:root {
  --bg: #F7F7F5; --card: #FFFFFF; --ink: #16181D; --muted: #4A4F5C; --line: #E4E4E0; --line-soft: #EFEFEA;
  --accent: #1D4ED8; --accent-dark: #1E3A8A; --accent-bg: #EEF2FF;
  --warn-bg: #FFF1E6; --warn-fg: #7C2D0A; --warn-line: #F5C9A8; --chip: #F0F0EC; --ph: #DCDCD6;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
.app { max-width: 640px; margin: 0 auto; padding-bottom: 80px; min-height: 100vh; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.header { background: var(--card); border-bottom: 1px solid var(--line); padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; z-index: 2; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
h1 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.btn { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #D4D4CE; background: var(--card); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0 4px; }
.btn.pill { border-radius: 22px; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--chip); }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.pad { padding: 14px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.banner { padding: 10px 12px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-dark); min-height: 44px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.lrow { display: flex; flex-direction: column; overflow: hidden; }
.lrow.flagged { border-color: var(--warn-line); }
.lrow .main { display: flex; align-items: stretch; }
.lrow .open { flex: 1; min-width: 0; display: flex; gap: 12px; padding: 12px; color: var(--ink); }
.thumb { width: 76px; height: 76px; flex-shrink: 0; border-radius: 10px; background: var(--ph) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.lrow .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.score { flex-shrink: 0; min-width: 38px; padding: 3px 4px; text-align: center; border-radius: 8px; background: var(--accent); color: #fff; font-family: var(--display); font-weight: 700; font-size: 15px; }
.score.none { background: var(--chip); color: var(--muted); }
.actions { display: flex; flex-direction: column; border-left: 1px solid var(--line-soft); }
.actions button { flex: 1; width: 48px; min-height: 44px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.actions button + button { border-top: 1px solid var(--line-soft); }
.badge { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--accent-bg); color: var(--accent-dark); font-weight: 600; }
.flag { padding: 10px 12px; background: var(--warn-bg); color: var(--warn-fg); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 80px; max-width: 608px; margin: 0 auto; min-height: 48px; padding: 0 8px 0 14px; border-radius: 12px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; font-size: 13px; z-index: 10; }
.toast button { min-height: 44px; padding: 0 12px; border: 0; background: none; color: #A5B4FC; font-weight: 700; cursor: pointer; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: 64px; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--muted); }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar svg, .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.hero { height: 230px; background: var(--ph) center/cover no-repeat; position: relative; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.hero .back { position: absolute; top: 12px; left: 12px; width: 44px; height: 44px; border-radius: 22px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.hero .seen { position: absolute; bottom: 12px; left: 12px; padding: 4px 8px; border-radius: 8px; background: #fff; font-size: 12px; color: var(--ink); }
.section { margin: 12px 16px 0; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.origin { width: 22px; height: 22px; border-radius: 5px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.origin.P { background: var(--accent-bg); color: var(--accent-dark); }
.origin.S { background: var(--warn-bg); color: var(--warn-fg); }
.origin.L { background: var(--chip); color: var(--ink); }
.big { font-family: var(--display); font-weight: 700; font-size: 22px; }
.tile { padding: 10px; border-radius: 10px; display: flex; flex-direction: column; gap: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
details > summary { cursor: pointer; min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 8px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.dot.ok { background: var(--accent); } .dot.warn { background: #EA580C; } .dot.error { background: #B91C1C; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
