/* IELTS Quest — design system. Mobile-first, three layouts (phone / tablet / desktop). */
:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #eef0f8; --line: #dfe2ef;
  --text: #171a2b; --muted: #5d6280; --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: #e6e5fd;
  --good: #15803d; --good-soft: #dcfce7; --bad: #b91c1c; --bad-soft: #fee2e2; --warn: #b45309; --warn-soft: #fef3c7;
  --gold: #d97706; --hl: #fde68a; --hl-ev: #bbf7d0;
  --c-ta: #dbeafe; --c-cc: #fce7f3; --c-lr: #dcfce7; --c-gra: #fef3c7;
  --sh: 0 1px 2px rgba(20,24,60,.06), 0 6px 18px rgba(20,24,60,.06);
  --r: 16px; --r-sm: 10px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --tabh: 60px; --sidew: 232px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1220; --surface: #181c30; --surface-2: #20253d; --line: #2b3150;
  --text: #eceefa; --muted: #9aa0c3; --accent: #818cf8; --accent-2: #6366f1; --accent-soft: #272b57;
  --good: #4ade80; --good-soft: #14301f; --bad: #f87171; --bad-soft: #3b1717; --warn: #fbbf24; --warn-soft: #3a2a0c;
  --gold: #fbbf24; --hl: #6b5a14; --hl-ev: #14532d;
  --c-ta: #1e3a5f; --c-cc: #4a1d3a; --c-lr: #14391f; --c-gra: #4a3a0e;
  --sh: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1220; --surface: #181c30; --surface-2: #20253d; --line: #2b3150;
    --text: #eceefa; --muted: #9aa0c3; --accent: #818cf8; --accent-2: #6366f1; --accent-soft: #272b57;
    --good: #4ade80; --good-soft: #14301f; --bad: #f87171; --bad-soft: #3b1717; --warn: #fbbf24; --warn-soft: #3a2a0c;
    --gold: #fbbf24; --hl: #6b5a14; --hl-ev: #14532d;
    --c-ta: #1e3a5f; --c-cc: #4a1d3a; --c-lr: #14391f; --c-gra: #4a3a0e;
    --sh: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: .86rem; } .tiny { font-size: .76rem; }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt { margin-top: 14px; } .mt2 { margin-top: 26px; } .mb0 { margin-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; }
.sidenav { display: none; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 14px) 8px calc(var(--sal) + 14px);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.chip.xp { color: var(--gold); } .chip.fire { color: #ea580c; }
.view { flex: 1; padding: 16px calc(var(--sar) + 16px) calc(var(--tabh) + var(--sab) + 28px) calc(var(--sal) + 16px); width: 100%; max-width: 1100px; margin: 0 auto; outline: none; }
.footer { padding: 6px 16px calc(var(--tabh) + var(--sab) + 14px); text-align: center; font-size: .72rem; color: var(--muted); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  padding: 0 var(--sar) var(--sab) var(--sal); }
.tabbar a, .tabbar button { flex: 1; min-height: var(--tabh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; background: none; border: 0; }
.tabbar .ic { font-size: 1.35rem; line-height: 1; }
.tabbar [aria-current="page"] { color: var(--accent); }

@media (min-width: 900px) {
  .sidenav { display: flex; flex-direction: column; gap: 2px; width: var(--sidew); flex: none; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    padding: calc(var(--sat) + 18px) 12px 18px calc(var(--sal) + 12px); border-right: 1px solid var(--line); background: var(--surface); }
  .sidenav .brand { font-weight: 800; font-size: 1.15rem; padding: 4px 10px 14px; display: flex; gap: 8px; align-items: center; }
  .sidenav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem; }
  .sidenav a:hover { background: var(--surface-2); }
  .sidenav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .sidenav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
  .tabbar { display: none; }
  .view { padding-bottom: 40px; }
  .footer { padding-bottom: 14px; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.card.flat { box-shadow: none; }
.card + .card, .card + .grid, .grid + .card { margin-top: 14px; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; text-decoration: none; color: var(--text); transition: transform .06s; touch-action: manipulation; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .88rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--muted); min-height: 36px; }
.seg button[aria-pressed="true"], .seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .74rem; font-weight: 700; }
.tag.good { background: var(--good-soft); color: var(--good); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #a78bfa); border-radius: 999px; transition: width .4s; }
.bar.good > i { background: linear-gradient(90deg, #22c55e, #86efac); }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.6rem; letter-spacing: -.02em; } .kpi span { font-size: .8rem; color: var(--muted); }
.hint-fr { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 4px 10px; margin: 6px 0 10px; background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.note { padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--text); font-size: .9rem; margin: 10px 0; }
.note.info { background: var(--accent-soft); } .note.good { background: var(--good-soft); } .note.bad { background: var(--bad-soft); }
label.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-height: 44px; font-size: 16px; /* 16px stops iOS zoom */ }
textarea { resize: vertical; line-height: 1.55; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--accent-2); flex: none; }
table.t { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.t th, table.t td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
table.t th { background: var(--surface-2); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); }
.item:hover { border-color: var(--accent); }
.item .ic { font-size: 1.5rem; width: 40px; text-align: center; flex: none; }
.item .sub { color: var(--muted); font-size: .84rem; }
.big-ic { font-size: 2rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; padding: 4px 12px; border-radius: 12px; background: var(--surface-2); }
.timer.low { color: var(--bad); background: var(--bad-soft); }
.sticky-bar { position: sticky; top: calc(var(--sat) + 56px); z-index: 10; background: var(--bg); padding: 8px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
@media (min-width: 900px) { .sticky-bar { top: 0; } .sticky-bar[style*='bottom'] { bottom: 0 !important; } }

/* overlay / modal / toast */
#overlay:empty { display: none; }
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(8,10,25,.55); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { background: var(--surface); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px 18px calc(var(--sab) + 18px); max-height: 88vh; overflow-y: auto; box-shadow: var(--sh); }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; padding-bottom: 20px; } }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--sab) + 12px); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 900px) { #toasts { bottom: 24px; } }
.toast { background: #111322; color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 600; font-size: .92rem; box-shadow: var(--sh); max-width: 90vw; animation: pop .25s; }
.toast.xp { background: linear-gradient(90deg, #f59e0b, #d97706); }
@keyframes pop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Home ---------- */
.hero { background: linear-gradient(135deg, #4f46e5, #312e81 70%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero .bar { background: rgba(255,255,255,.2); } .hero .bar > i { background: #fbbf24; }
.hero .muted { color: rgba(255,255,255,.75); }
.mission { display: flex; flex-direction: column; gap: 10px; }
.mtask { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.mtask.done { background: var(--good-soft); border-color: transparent; }
.mtask .ck { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 800; }
.mtask.done .ck { background: var(--good); border-color: var(--good); color: #fff; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week .d { padding: 6px 0; border-radius: 12px; background: var(--surface-2); font-size: .72rem; color: var(--muted); font-weight: 600; }
.week .d b { display: block; font-size: 1.05rem; color: var(--text); }
.week .d.on { background: var(--accent-soft); } .week .d.on b::after { content: " 🔥"; font-size: .8rem; }
.week .d.today { outline: 2px solid var(--accent); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { width: 100%; aspect-ratio: 1; min-width: 11px; border-radius: 3px; background: var(--surface-2); display: block; }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); } .heat i.l2 { background: color-mix(in srgb, var(--accent) 60%, var(--surface-2)); } .heat i.l3 { background: var(--accent); }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--surface-2); font-size: .74rem; font-weight: 600; opacity: .45; }
.badge.on { opacity: 1; background: var(--warn-soft); } .badge .e { font-size: 1.7rem; }

/* ---------- Questions ---------- */
.qgroup { margin: 0 0 22px; }
.qgroup h3 { background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.qgroup .instr { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.q { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.q .n { flex: none; min-width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.q .body { flex: 1; min-width: 0; }
.q.ok .n { background: var(--good); color: #fff; } .q.no .n { background: var(--bad); color: #fff; }
.q input[type=text] { max-width: 280px; display: inline-block; margin: 2px 4px; min-height: 40px; padding: 6px 10px; }
.q.ok input[type=text] { border-color: var(--good); background: var(--good-soft); } .q.no input[type=text], .q.no select { border-color: var(--bad); background: var(--bad-soft); }
.blank { width: 150px !important; max-width: 46vw !important; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; cursor: pointer; background: var(--surface); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt.right { border-color: var(--good); background: var(--good-soft); } .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt b { flex: none; }
.pillset { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.pill { padding: 8px 14px; min-width: 52px; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; cursor: pointer; }
.pill.on { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.opts-list { margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .93rem; }
.opts-list div { padding: 2px 0; }
.opts-list b { display: inline-block; min-width: 28px; }
.res { margin-top: 6px; font-size: .88rem; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.res .ans { font-weight: 800; color: var(--good); }
.explain { margin-top: 6px; font-size: .88rem; color: var(--muted); }
.chip-miss { background: var(--bad-soft); color: var(--bad); }
.body-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; line-height: 2.1; }
.body-box table { width: 100%; border-collapse: collapse; } .body-box td, .body-box th { border: 1px solid var(--line); padding: 6px 8px; }
.map-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.map-wrap svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.hot { cursor: pointer; } .hot rect.hit { fill: transparent; } .hot:hover rect.hit, .hot.sel rect.hit { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; }
.qrow-active { background: var(--accent-soft); border-radius: 10px; }

/* Reading layout */
.reading { display: grid; gap: 14px; }
.passage { font-family: var(--serif); font-size: 1.04rem; line-height: 1.75; }
.passage p { margin: 0 0 .9em; }
.passage .plabel { font-family: var(--font); font-weight: 800; color: var(--accent); margin-right: 6px; }
.passage h2 { font-family: var(--font); }
.hl { background: var(--hl); border-radius: 3px; cursor: pointer; }
mark.ev { background: var(--hl-ev); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.ev sup { font-family: var(--font); font-weight: 800; color: var(--good); margin-left: 2px; }
mark.ev.miss { background: var(--bad-soft); } mark.ev.miss sup { color: var(--bad); }
.reading.split { grid-template-columns: 1fr 1fr; align-items: start; }
.reading.split > .pane { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); overflow-y: auto; padding-right: 8px; position: sticky; top: 70px; -webkit-overflow-scrolling: touch; }
.tabs-only { display: flex; }
.pane { min-width: 0; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: .74rem; font-weight: 700; padding: 0; }
.dots button.a { background: var(--accent-soft); border-color: var(--accent); }

/* Listening */
.player { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; padding: 18px; }
.wave { display: flex; gap: 4px; height: 44px; align-items: center; }
.wave i { width: 5px; height: 12px; background: var(--accent); border-radius: 3px; opacity: .4; }
.playing .wave i { animation: wv 1s infinite ease-in-out; opacity: 1; } .wave i:nth-child(2n) { animation-delay: .2s !important; } .wave i:nth-child(3n) { animation-delay: .4s !important; }
@keyframes wv { 0%,100% { height: 10px; } 50% { height: 40px; } }
.script .turn { padding: 6px 0; } .script .who { font-weight: 800; color: var(--accent); margin-right: 6px; }
.script mark { background: var(--hl-ev); color: inherit; padding: 0 2px; border-radius: 3px; }
.script mark sup { color: var(--good); font-weight: 800; font-family: var(--font); }
.script mark.miss { background: var(--bad-soft); } .script mark.miss sup { color: var(--bad); }

/* Writing */
.crit { padding: 1px 3px; border-radius: 4px; }
.crit.TR, .crit.TA { background: var(--c-ta); } .crit.CC { background: var(--c-cc); } .crit.LR { background: var(--c-lr); } .crit.GRA { background: var(--c-gra); }
.model { font-family: var(--serif); font-size: 1.04rem; line-height: 1.8; }
.model p { margin: 0 0 .9em; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.chart-box svg { width: 100%; height: auto; display: block; }
:root[data-theme="dark"] .chart-box { background: #f8f9ff; }
.wc { font-weight: 800; } .wc.ok { color: var(--good); } .wc.low { color: var(--bad); }
.checklist label { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.stars { letter-spacing: 3px; color: var(--gold); }

/* Speaking */
.cue { background: linear-gradient(135deg, var(--surface), var(--accent-soft)); border: 2px dashed var(--accent); border-radius: 18px; padding: 18px; }
.cue ul { margin: .4em 0 0; padding-left: 1.2em; }
.rec { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #dc2626; color: #fff; font-size: 1.6rem; box-shadow: 0 6px 18px rgba(220,38,38,.4); }
.rec.on { animation: pulse 1.2s infinite; } @keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(220,38,38,.12); } }
.big-timer { font-size: 3.2rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }

/* Vocab */
.flash { min-height: 230px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
/* tag chips should not stretch inside flex columns */
.flash .tag { align-self: flex-start; }
.flash .sent { font-size: 1.28rem; line-height: 1.5; font-family: var(--serif); }
.flash .sent u { text-decoration: none; border-bottom: 3px solid var(--accent); padding: 0 .5em; }
.flash .sent b { color: var(--accent); }
.choice { display: block; width: 100%; text-align: left; padding: 13px 14px; margin: 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; min-height: 48px; }
.choice.right { background: var(--good-soft); border-color: var(--good); } .choice.wrong { background: var(--bad-soft); border-color: var(--bad); }
.boxes { display: flex; gap: 6px; } .boxes div { flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--surface-2); font-size: .76rem; } .boxes b { display: block; font-size: 1.2rem; }
.mpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mpair button { padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; min-height: 48px; }
.mpair button.sel { border-color: var(--accent); background: var(--accent-soft); } .mpair button.done { opacity: .35; pointer-events: none; background: var(--good-soft); }

/* Charts */
.svgchart text { font-family: var(--font); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .tabbar, .sidenav, .topbar { display: none; } }
