/* EEZYPG — same family as qbMLE: monochrome surfaces, one accent, Fraunces for display, Jakarta for UI,
   the system face for clinical reading text (unambiguous I / l / 1). */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(fonts/plus-jakarta-sans.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/fraunces.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 700; font-display: swap; src: url(fonts/fraunces-italic.woff2) format("woff2"); }

:root {
  --paper: #f6f6f8;
  --surface: #ffffff;
  --raised: #fbfbfd;
  --ink: #17171c;
  --text: #22222a;
  --muted: #676774;
  --faint: #9a9aa6;
  --line: #e4e4ec;
  --line-strong: #d3d3de;
  --accent: #0b7f8a;            /* arcade teal (default accent) */
  --accent-rgb: 11,127,138;
  --on-accent: #ffffff;
  --accent-soft: #e2f3f4;
  --wm-shadow: rgba(var(--accent-rgb),.30);
  --ok: #1d7f48;
  --ok-soft: #e7f4ec;
  --bad: #c03a3a;
  --bad-soft: #fbeaea;
  --warn: #a8621a;
  --glass: rgba(246,246,248,.8);
  --shadow: 0 1px 2px rgba(24,22,48,.05), 0 8px 24px rgba(60,48,140,.06);
  --shadow-lift: 0 2px 6px rgba(24,22,48,.06), 0 18px 40px rgba(60,48,140,.12);
  --backdrop: radial-gradient(1100px 600px at 0% -10%, rgba(var(--accent-rgb),.10), transparent 60%),
              radial-gradient(900px 520px at 110% 0%, rgba(160,156,200,.14), transparent 60%);
  --font-ui: "Plus Jakarta Sans", -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-read: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  --read-size: 17px;
  --r-sm: 8px; --r: 14px; --r-lg: 22px;
  --nav-w: 232px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #111115;
  --surface: #18181d;
  --raised: #1d1d23;
  --ink: #f0f0f4;
  --text: #e4e4ea;
  --muted: #a0a0ad;
  --faint: #6e6e7a;
  --line: #2a2a32;
  --line-strong: #383842;
  --accent: #5fcfd8;
  --accent-rgb: 95,207,216;
  --on-accent: #08262a;
  --accent-soft: #12292c;
  --wm-shadow: rgba(var(--accent-rgb),.32);
  --ok: #52c487;
  --ok-soft: rgba(82,196,135,.13);
  --bad: #f07a7a;
  --bad-soft: rgba(240,122,122,.13);
  --warn: #f0aa62;
  --glass: rgba(17,17,21,.78);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.35), 0 18px 40px rgba(0,0,0,.45);
  --backdrop: radial-gradient(1000px 560px at 0% -10%, rgba(var(--accent-rgb),.10), transparent 60%);
  color-scheme: dark;
}
:root[data-accent="lavender"] { --accent: #6656cf; --accent-rgb: 102,86,207; --accent-soft: #efedfc; }
:root[data-theme="dark"][data-accent="lavender"] { --accent: #b4a9f7; --accent-rgb: 180,169,247; --accent-soft: #25223b; --on-accent: #17142e; }
:root[data-accent="sky"]      { --accent: #2f6db5; --accent-rgb: 47,109,181; --accent-soft: #e8f1fb; }
:root[data-accent="sage"]     { --accent: #2b7a67; --accent-rgb: 43,122,103; --accent-soft: #e5f4ef; }
:root[data-accent="rose"]     { --accent: #b0436b; --accent-rgb: 176,67,107; --accent-soft: #fbeaf0; }
:root[data-accent="amber"]    { --accent: #9a5b16; --accent-rgb: 154,91,22; --accent-soft: #fbf1e2; }
:root[data-accent="graphite"] { --accent: #3d3d45; --accent-rgb: 61,61,69; --accent-soft: #efeff2; }
:root[data-theme="dark"][data-accent="sky"]      { --accent: #8cc3f5; --accent-rgb: 140,195,245; --accent-soft: #172534; --on-accent: #0f1a26; }
:root[data-theme="dark"][data-accent="sage"]     { --accent: #8fd5c1; --accent-rgb: 143,213,193; --accent-soft: #152d27; --on-accent: #0f211c; }
:root[data-theme="dark"][data-accent="rose"]     { --accent: #f2a6c2; --accent-rgb: 242,166,194; --accent-soft: #331e27; --on-accent: #2a1220; }
:root[data-theme="dark"][data-accent="amber"]    { --accent: #f2c784; --accent-rgb: 242,199,132; --accent-soft: #322817; --on-accent: #2a1e0c; }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #d6d6dc; --accent-rgb: 214,214,220; --accent-soft: #25252b; --on-accent: #141418; }
:root[data-size="s"]  { --read-size: 15.5px; }
:root[data-size="l"]  { --read-size: 19px; }
:root[data-size="xl"] { --read-size: 21px; }
:root[data-read="serif"] { --font-read: "Fraunces", Georgia, serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--text); }
body { font: 15.5px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; background-image: var(--backdrop); background-attachment: fixed; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- logo ---------- */
/* 8-bit logo: pixel art drawn on a grid (tools/make_brand.py); crisp edges, sizes in whole pixel multiples */
.mark, .wordmark { stroke: none; shape-rendering: crispEdges; display: block; flex: none; }
.mark { width: 36px; height: 36px; }               /* 18-px sprite at 2x */
.wordmark { width: 108px; height: 24px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 15px;
  text-decoration: none; color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.18); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(var(--accent-rgb),.08); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: rgba(var(--accent-rgb),.08); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.on svg { fill: currentColor; }

/* ---------- splash / login ---------- */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--paper); transition: opacity .3s; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-in { text-align: center; }
.splash .mark { width: 72px; height: 72px; margin: 0 auto; }
.splash .wordmark { width: 180px; height: 40px; margin: 18px auto 0; }
.splash-msg { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  /* the wordmark types itself in, one letter per step, like an old title screen */
  .splash .wordmark { clip-path: inset(0 100% 0 0); animation: type-in .9s steps(6, end) .15s forwards; }
  @keyframes type-in { to { clip-path: inset(0 0 0 0); } }
}
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.login-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: -.02em; margin: 8px 0 0; color: var(--ink); }
.login-card p { margin: 0; }
.login-card label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.login-card label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.login-card input:not([type=checkbox]) { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--raised); }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.16); }
.brand { display: flex; align-items: center; gap: 10px; }
.login-err { color: var(--bad); font-size: 14px; min-height: 1em; }

/* ---------- layout + navigation ---------- */
.app { min-height: 100vh; }
.nav { position: fixed; z-index: 20; display: flex; background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.nav-brand { display: none; align-items: center; gap: 10px; text-decoration: none; }
.nav-link { display: flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; border-radius: 12px; }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] { color: var(--accent); }
.view { outline: none; padding: 20px 18px 110px; max-width: 880px; margin: 0 auto; }
@media (max-width: 859px) {
  .nav { left: 0; right: 0; bottom: 0; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .nav-link { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 10px; min-width: 64px; }
}
@media (min-width: 860px) {
  .nav { top: 0; bottom: 0; left: 0; width: var(--nav-w); flex-direction: column; gap: 4px; padding: 22px 14px; border-right: 1px solid var(--line); }
  .nav-brand { display: flex; padding: 0 10px 22px; }
  .nav-link { padding: 11px 12px; }
  .nav-link[aria-current="page"] { background: rgba(var(--accent-rgb),.10); }
  .nav-more { margin-top: auto; }
  .view { margin-left: var(--nav-w); margin-right: 0; padding: 36px 48px 80px; max-width: calc(880px + var(--nav-w)); }
  .view > * { max-width: 880px; }
}

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; }
.page-head h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 5vw, 38px); line-height: 1.08; letter-spacing: -.025em; color: var(--ink); margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.back:hover { color: var(--accent); }
.back svg { width: 18px; height: 18px; }
h2.sec { font-family: var(--font-display); font-weight: 500; font-size: 21px; letter-spacing: -.01em; color: var(--ink); margin: 34px 0 12px; }
h2.sec small { font-family: var(--font-ui); font-size: 13.5px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.empty { padding: 28px 22px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- home ---------- */
.hello { display: grid; gap: 4px; margin: 4px 0 22px; }
.hello h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 6vw, 44px); line-height: 1.05; letter-spacing: -.03em; color: var(--ink); margin: 0; }
.hello p { margin: 0; color: var(--muted); }
.today { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 22px; }
.ring { position: relative; width: 104px; height: 104px; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1; color: var(--ink); }
.ring-label span { font-size: 12px; color: var(--muted); }
.today-body h2 { font-size: 17px; margin: 0 0 4px; }
.today-body p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.today-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.fact { padding: 14px 16px; }
.fact b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.fact span { font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .today { grid-template-columns: 1fr; justify-items: start; } .facts { grid-template-columns: 1fr 1fr 1fr; } .fact { padding: 12px; } .fact b { font-size: 21px; } }

/* the strengths map: one bar per subject; length = how much you've covered, colour = how accurate you are */
.smap { padding: 8px 6px; }
.smap-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 52px; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 10px; text-align: left; text-decoration: none; color: inherit; }
.smap-row:hover { background: rgba(var(--accent-rgb),.06); }
.smap-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smap-track { position: relative; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.smap-track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--faint); min-width: 2px; }
.smap-acc { font-variant-numeric: tabular-nums; font-size: 13.5px; text-align: right; color: var(--muted); }
.smap-key { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px 6px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 6px; }
.smap-key i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }

/* ---------- subjects ---------- */
.group { margin-bottom: 8px; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.subj { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.subj:hover { border-color: rgba(var(--accent-rgb),.5); box-shadow: var(--shadow-lift); }
.mono { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.subj b { display: block; font-size: 15.5px; color: var(--ink); line-height: 1.25; }
.subj .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.subj .prog { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.subj .prog i { display: block; height: 100%; background: var(--accent); }

.topic-list { display: grid; gap: 8px; }
.topic { overflow: hidden; }
.topic-head { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; width: 100%; padding: 14px 10px 14px 16px; border: 0; background: none; text-align: left; }
.topic-head b { display: block; font-size: 15.5px; color: var(--ink); }
.topic-head .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.topic-head .chev { transition: transform .2s; color: var(--faint); }
.topic[open] .chev, .topic.open .chev { transform: rotate(90deg); }
.mini-ring { width: 34px; height: 34px; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 4; }
.mini-ring .track { stroke: var(--line); }
.mini-ring .fill { stroke: var(--accent); stroke-linecap: round; }
.subs { border-top: 1px solid var(--line); padding: 6px; }
.sub-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; width: 100%; min-height: 46px; padding: 8px 10px; border: 0; background: none; border-radius: 10px; text-align: left; }
.sub-row:hover { background: rgba(var(--accent-rgb),.06); }
.sub-row .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sub-row .pct { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; color: var(--muted); }
.sub-row.all { font-weight: 600; color: var(--accent); }
.subject-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }

/* ---------- revision / stats ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rcard { display: grid; gap: 4px; padding: 18px; text-align: left; color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rcard:hover:not(:disabled) { border-color: rgba(var(--accent-rgb),.5); box-shadow: var(--shadow-lift); }
.rcard:disabled { cursor: default; opacity: .6; }
.rcard b { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.rcard strong { font-size: 15.5px; }
.rcard span { font-size: 13.5px; color: var(--muted); }
.chart { padding: 18px 18px 10px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars span { flex: 1; min-width: 3px; border-radius: 3px 3px 1px 1px; background: rgba(var(--accent-rgb),.3); position: relative; }
.bars span.hit { background: var(--accent); }
.bars-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; }
.history { display: grid; gap: 8px; }
.hist { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 16px; }
.hist b { font-size: 15px; }
.hist span { font-size: 13px; color: var(--muted); }

/* ---------- settings ---------- */
.set-list { display: grid; }
.set { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.set:last-child { border-bottom: 0; }
.set b { display: block; font-size: 15px; }
.set span { font-size: 13.5px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--paper); border: 1px solid var(--line); }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.field { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); }
@media (max-width: 560px) { .set { grid-template-columns: 1fr; } }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10,10,16,.4); display: grid; align-items: end; justify-items: center; }
@media (min-width: 700px) { .scrim { align-items: center; } }
.sheet { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lift); }
@media (min-width: 700px) { .sheet { border-radius: var(--r-lg); } }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: rise .22s ease-out; } @keyframes rise { from { transform: translateY(24px); opacity: 0; } } }
.sheet h2 { font-family: var(--font-display); font-weight: 500; font-size: 25px; letter-spacing: -.02em; margin: 0 0 4px; color: var(--ink); }
.sheet > p { margin: 0 0 18px; color: var(--muted); }
.opt-group { margin: 16px 0; }
.opt-group > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip:disabled { opacity: .4; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.pick-list { display: grid; gap: 2px; max-height: 42vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.pick { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: 8px; font-size: 14.5px; }
.pick:hover { background: rgba(var(--accent-rgb),.06); }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.pick .n { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- question session ---------- */
body.in-session .nav { display: none; }
body.in-session .view, body.in-session .view > * { margin: 0 auto; padding: 0; max-width: none; }
body.in-session .view .s-body, body.in-session .view .summary { padding: 22px 18px 40px; }
.session { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.s-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.s-title { flex: 1; min-width: 0; display: grid; }
.s-title b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-title span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.s-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.s-progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; padding: 0 8px; color: var(--muted); }
.s-body { width: min(760px, 100%); margin: 0 auto; padding: 22px 18px 40px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.q-meta .tag { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; }
.q-meta .tag.plain { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.read { font-family: var(--font-read); font-size: var(--read-size); line-height: 1.65; color: var(--ink); }
.read img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 10px 0; cursor: zoom-in; background: #fff; }
.read table { border-collapse: collapse; margin: 12px 0; font-size: .92em; display: block; overflow-x: auto; }
.read td, .read th { border: 1px solid var(--line-strong); padding: 6px 10px; vertical-align: top; }
.read p { margin: 0 0 .8em; }
.read p:last-child { margin-bottom: 0; }
.read h4 { font-size: 1em; margin: 1em 0 .4em; }
.group-text { padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; background: var(--raised); border: 1px dashed var(--line-strong); }
.multi-note { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 13.5px; font-weight: 600; color: var(--warn); }
.options { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.opt { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 56px; padding: 10px 14px 10px 12px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; transition: border-color .12s, background .12s; }
.opt:hover:not(:disabled) { border-color: rgba(var(--accent-rgb),.55); }
.opt .key { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted); }
.opt.multi .key { border-radius: 8px; }
.opt .otext { font-family: var(--font-read); font-size: var(--read-size); line-height: 1.45; color: var(--ink); }
.opt .otext img { max-width: 100%; height: auto; }
.opt .omark { width: 22px; height: 22px; }
.opt[aria-checked="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb),.07); }
.opt[aria-checked="true"] .key { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.right .omark { color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.wrong .omark { color: var(--bad); }
.opt.missed { border-style: dashed; border-color: var(--ok); }
.verdict { display: flex; align-items: center; gap: 10px; margin: 22px 0 0; padding: 14px 16px; border-radius: 14px; font-weight: 700; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict span { font-weight: 500; color: var(--text); }
.review-flag { margin-top: 10px; font-size: 13.5px; color: var(--warn); }
.explain { margin-top: 18px; padding: 20px 20px 18px; }
.explain h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; margin: 0 0 10px; color: var(--ink); }
.s-foot { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.s-foot .grow { flex: 1; }
.kbd-hint { font-size: 12.5px; color: var(--faint); }
@media (max-width: 640px) { .kbd-hint { display: none; } }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.navgrid button { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; position: relative; }
.navgrid button.cur { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.navgrid button.done { background: var(--accent-soft); color: var(--accent); }
.navgrid button.ok { background: var(--ok-soft); color: var(--ok); }
.navgrid button.bad { background: var(--bad-soft); color: var(--bad); }
.navgrid button.bm::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* summary */
.summary { width: min(760px, 100%); margin: 0 auto; padding: 32px 18px 60px; }
.score { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 24px; margin-bottom: 18px; }
.score h1 { font-family: var(--font-display); font-weight: 500; font-size: 32px; margin: 0; letter-spacing: -.02em; color: var(--ink); }
.score p { margin: 4px 0 0; color: var(--muted); }
.res-list { display: grid; gap: 6px; }
.res { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.res .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--paper); color: var(--muted); }
.res .dot.ok { background: var(--ok-soft); color: var(--ok); }
.res .dot.bad { background: var(--bad-soft); color: var(--bad); }
.res .stem { font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* search */
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 50px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); margin-bottom: 14px; }
.search-box input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; min-height: 48px; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.14); }

/* zoom + toast */
.zoom { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8,8,12,.86); cursor: zoom-out; padding: 16px; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; padding: 11px 18px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lift); max-width: calc(100% - 32px); }
@media (min-width: 860px) { .toast { bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* practice filters (collapsible) */
.filters { border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; margin: 4px 0 6px; }
.filters summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.filters[open] summary::after { transform: rotate(-135deg); }
.filters summary b { font-size: 12.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.filters .opt-group { margin: 6px 0 12px; }
.opt-group > span small { font-weight: 500; }
