:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f4e79; --accent-text: #fff; --ok: #1e7d3b; --ok-bg: #e6f4ea;
  --bad: #b3261e; --bad-bg: #fbe9e7; --warn: #8a5a00;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1b2027; --text: #e7eaee; --muted: #9aa3ad; --line: #2c333c;
          --accent: #6ea8dc; --accent-text: #0d1b2a; --ok: #7bd389; --ok-bg: #16301e;
          --bad: #ff8a80; --bad-bg: #3a1a17; --warn: #f0c36d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 640px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 96px; }
h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 24px 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: .85rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 10px 0; }
button, select { font: inherit; }
.btn { display: block; width: 100%; padding: 14px 16px; margin: 8px 0; border-radius: 12px; border: 1px solid var(--line);
       background: var(--card); color: var(--text); text-align: left; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); text-align: center; font-weight: 600; }
.btn.link { border: none; background: none; color: var(--accent); padding: 8px 0; text-align: left; width: auto; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.topic { display: flex; align-items: center; gap: 12px; }
.topic .name { flex: 1; } .topic .pct { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.option { display: flex; gap: 10px; }
.option .letter { font-weight: 700; min-width: 1.2em; }
.option.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option.right { background: var(--ok-bg); border-color: var(--ok); }
.option.wrong { background: var(--bad-bg); border-color: var(--bad); }
.feedback { border-left: 4px solid var(--accent); }
.feedback.ok { border-left-color: var(--ok); } .feedback.ko { border-left-color: var(--bad); }
.quote { font-style: italic; color: var(--muted); margin-top: 8px; }
.top { position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.timer.low { color: var(--bad); }
.dots { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.dots button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
               color: var(--text); font-size: .75rem; padding: 0; }
.dots button.done { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.dots button.here { outline: 2px solid var(--accent); outline-offset: 1px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
          padding: 8px 16px max(8px, env(safe-area-inset-bottom)); }
.bottom .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
.bottom .btn { margin: 0; text-align: center; }
.big { font-size: 2.4rem; font-weight: 700; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.tag { font-size: .75rem; color: var(--muted); }
.case summary { cursor: pointer; }
.case p { margin: 8px 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; text-align: center; }
.toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.toggle input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
