:root {
  color-scheme:dark;
  --bg:#0d121a; --panel:#151d28; --soft:#1b2533; --line:#2c394a; --line-soft:#253244;
  --text:#f4f6fa; --muted:#a8b5c6; --amber:#ffca73; --green:#8fdfb7; --rose:#ffadba;
  font:16px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;
}
*,*::before,*::after {box-sizing:border-box}
body {margin:0;background:var(--bg);color:var(--text)}
button,select {font:inherit}
button {color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled {cursor:default}
button:focus-visible, select:focus-visible, summary:focus-visible {outline:2px solid var(--amber);outline-offset:3px}
svg {width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
h1,h2,h3,p {margin:0}
.shell {max-width:720px;margin:auto;padding:0 clamp(14px,4.3vw,28px)}
.masthead {min-height:77px;display:flex;align-items:center;justify-content:space-between;gap:8px}
.brand {display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark {width:40px;height:40px;border-radius:12px;background:var(--amber);display:grid;place-items:center;color:#171c22;flex:0 0 auto}
.brand-name {font-size:13px;font-weight:900;letter-spacing:.105em;white-space:nowrap}
.brand-name span {color:var(--amber);margin-left:.28em}
.brand-note {font-size:12px;color:var(--muted)}
.offline {display:flex;align-items:center;gap:5px;font:700 9px/1.2 ui-monospace,monospace;letter-spacing:.08em;color:#9fddba;background:#182b28;border:1px solid #29443a;border-radius:30px;padding:6px 8px}
.offline i {width:5px;height:5px;border-radius:50%;background:#a5e2b8}
.nav {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;background:#101924;border:1px solid var(--line-soft);border-radius:14px;padding:4px;margin-bottom:18px}
.nav button {min-height:43px;border:0;border-radius:10px;background:none;color:var(--muted);font-size:13px;font-weight:740;padding:7px 4px}
.nav button[aria-current] {background:#263243;color:var(--text)}
#app {outline:0;min-width:0}
.hero {position:relative;isolation:isolate;overflow:hidden;padding:clamp(17px,5vw,26px);min-height:167px;border:1px solid #32435a;border-radius:18px;background:linear-gradient(125deg,#1d2c3e,#17202c 85%);display:flex;align-items:center}
.hero .words {z-index:1;max-width:81%}
.route-art {position:absolute;right:-17px;top:8px;width:39%;height:100%;color:#5e7e9d;opacity:.67}
.route-art .accent {stroke:var(--amber)}
.eyebrow {color:var(--amber);font:750 10px/1.4 ui-monospace,monospace;letter-spacing:.13em;text-transform:uppercase}
.hero h1 {margin-top:6px;font-size:clamp(26px,6.4vw,39px);line-height:1.09;letter-spacing:-.045em}
.hero p,.page-title p {font-size:14px;color:#c4cedc;margin-top:9px;max-width:40ch}
.section {margin-top:21px}
.section-title {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}
.section-title h2 {font-size:16px;letter-spacing:-.018em}
.section-title span,.small {color:var(--muted);font-size:12px}
.topic-list {display:grid;grid-template-columns:1fr;gap:7px}
@media(min-width:585px) {.topic-list {grid-template-columns:1fr 1fr}}
.topic {position:relative;display:flex;text-align:left;align-items:center;gap:10px;min-height:64px;width:100%;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel);padding:8px 10px}
.topic[aria-pressed=true] {border-color:#a78251;background:#24272c}
.topic-icon {width:33px;height:33px;border-radius:9px;display:grid;place-items:center;flex:0 0 auto;background:#293746;color:#c0d1e4}
.topic-icon svg {width:17px;height:17px}
.topic-icon.amber {color:#ffd48b;background:#382f29}.topic-icon.blue {color:#9ad5ff;background:#25394c}.topic-icon.green {color:#8fdfb7;background:#233b38}.topic-icon.purple {color:#d4bcff;background:#352e47}.topic-icon.rose {color:#ffb7cb;background:#3e2f3f}
.topic-copy {flex:1;min-width:0}
.topic-copy strong {display:block;font-size:14px;line-height:1.2}
.topic-copy small {display:block;margin-top:3px;font-size:11px;line-height:1.25;color:var(--muted)}
.topic-count {font:700 11px/1 ui-monospace,monospace;color:#c1cbd7;margin-left:auto}
.action,.secondary {min-height:50px;border-radius:12px;padding:10px 13px;font-size:15px;font-weight:800;text-align:center}
.action {border:1px solid var(--amber);background:var(--amber);color:#20232a}
.secondary {border:1px solid var(--line);background:var(--panel);color:var(--text)}
.action:active,.secondary:active,.topic:active,.option:active {filter:brightness(.91)}
.wide {width:100%}
.action-row {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:8px;margin-top:12px}
.chips {display:flex;gap:7px;flex-wrap:wrap}
.chip {min-height:43px;border-radius:10px;border:1px solid var(--line);background:var(--panel);padding:5px 13px;color:#c4cedc;font-size:13px;font-weight:750}
.chip[aria-pressed=true] {border-color:var(--amber);color:var(--amber);background:#2a2726}
.chip:disabled {opacity:.48}
.mode-note {margin-top:7px}
.quiet,.exit,footer button {border:0;background:none;color:var(--muted);min-height:44px;padding:3px 7px;font-size:13px}
.quiet:hover,.exit:hover,footer button:hover {color:var(--text)}
.resume {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;padding:10px 10px 10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.resume strong {display:block;font-size:13px}.resume .secondary {min-height:44px;font-size:12px;padding:6px 9px}
.page-title {padding:8px 0 5px}.page-title h1 {font-size:29px;letter-spacing:-.04em}
.quiz-bar {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:3px}
.quiz-count {font:700 12px/1.4 ui-monospace,monospace;color:#d6dfed}
.exit {padding-left:0}
progress {display:block;width:100%;height:6px;appearance:none;border:0;border-radius:10px;overflow:hidden;background:#263244}
progress::-webkit-progress-bar {background:#263244}
progress::-webkit-progress-value {background:var(--amber);border-radius:8px}
progress::-moz-progress-bar {background:var(--amber)}
.quiz-heading {margin:15px 0 12px}
.quiz-heading h1,.flash h1 {font-size:clamp(20px,5.4vw,27px);line-height:1.22;letter-spacing:-.026em;margin-top:6px}
.mark {border:1px solid #3c4b5e;background:#1c2734;border-radius:12px;display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:12px 14px;font:750 clamp(17px,4.6vw,23px)/1.25 ui-monospace,monospace;color:#e7edf4;margin-bottom:12px}
.paper {background:#f0f1ed;color:#17212c;border-radius:12px;padding:10px clamp(7px,2vw,13px);margin-bottom:12px}
.paper-label {color:#515c66;font:800 9px/1.5 ui-monospace,monospace;letter-spacing:.1em;margin-bottom:6px}
.paper table {border-collapse:collapse;table-layout:fixed;width:100%;font-size:clamp(11px,3.25vw,15px);line-height:1.17;font-variant-numeric:tabular-nums;font-weight:650}
.paper th,.paper td {border-right:1px solid #75838c;padding:4px 2px;text-align:center;overflow-wrap:break-word}
.paper th:nth-child(3),.paper td:nth-child(3) {border-right:1px solid #75838c}
.paper th:nth-child(4),.paper td:nth-child(4) {border-right:2px solid #455666}
.paper th:last-child,.paper td:last-child {border-right:0}
.paper th {font-size:.85em;border-block:1px solid #667480;padding:3px 1px}
.paper td:nth-child(3) {text-align:left;padding-left:4px;font-weight:720}
.paper td:nth-child(2) {font-weight:850}
.paper tr.focus td {background:#fff0ca}
.paper tr.focus td:first-child {box-shadow:inset 3px 0 #a66d19}
.paper td.solid {border-top:2px solid #26303a}
.paper td.dashed {border-top:2px dashed #26303a}
.paper td.inverse,.mark .inverse {color:#fff;background:#151c23}
.mark .inverse {padding:2px 6px;border:1px solid #bec9d3;border-radius:3px}
.paper-head {font-size:13px;font-weight:700;padding:6px 1px 0}
.paper-head h2 {font-size:19px;line-height:1.15;margin-bottom:7px}
.paper-head div {display:flex;gap:6px 13px;flex-wrap:wrap;margin-bottom:4px}
.paper-head .train {font-weight:900;margin-bottom:8px}
.options {display:grid;gap:7px}
.option {display:flex;text-align:left;align-items:center;gap:10px;min-height:55px;width:100%;border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:8px 11px;font-size:14px;line-height:1.31}
.option .letter {display:grid;place-items:center;width:27px;height:27px;border:1px solid #3c4d62;background:#233042;border-radius:7px;flex:0 0 auto;font:750 12px/1 ui-monospace,monospace;color:#dce5f0}
.option.ok {background:#1d352e;border-color:#4b9a78}
.option.ok .letter {background:#2b5644;border-color:#619c81}
.option.no {background:#392932;border-color:#b46e80}
.option.no .letter {background:#5a3445;border-color:#a5667c}
.option.dim {color:#b5c0ce}
.written-form label {display:block;margin-bottom:5px;font-size:13px;font-weight:750}
.written-form textarea {display:block;width:100%;min-height:96px;padding:10px 12px;resize:vertical;border:1px solid #4b5f70;border-radius:10px;background:#121c26;color:var(--text);font:inherit}
.written-form textarea:focus-visible {outline:2px solid var(--amber);outline-offset:2px}
.typed-answer {overflow-wrap:anywhere;white-space:pre-wrap}
.feedback {border-radius:12px;background:#182635;border:1px solid #3d536b;padding:12px 13px;margin-top:11px}
.feedback strong {display:block;margin-bottom:4px;font-size:14px;color:var(--green)}
.feedback.wrong strong {color:var(--rose)}
.feedback p {font-size:14px}
.ref {display:block;color:var(--muted);font-size:11px;margin-top:7px}
.flash,.summary,.stat-card,.source-card {padding:16px;border:1px solid var(--line);border-radius:15px;background:var(--panel);margin-top:12px}
.flash .mark,.flash .paper {margin:12px 0 0}
.flash select {width:100%;background:#1d2b3b}
.select {min-height:44px;width:100%;margin-top:10px;border:1px solid var(--line);border-radius:10px;padding:8px 10px;color:var(--text);background:var(--panel)}
.card-answer {margin-top:12px;padding:12px;border-radius:10px;background:#20352f;border:1px solid #386553}
.card-answer strong {color:var(--green);display:block;margin-bottom:4px}
.card-answer p,.source-card p {font-size:14px}
.score {font:850 clamp(38px,10vw,56px)/1 ui-monospace,monospace;letter-spacing:-.08em;color:var(--amber);margin:7px 0 8px}
.summary h1 {font-size:25px;margin-top:5px}
.summary p {font-size:14px;color:var(--muted)}
.metric-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:11px}
.metric {background:#182331;border:1px solid var(--line-soft);border-radius:11px;padding:11px 6px;text-align:center}
.metric strong {display:block;font-size:21px;color:var(--amber);line-height:1.12}
.metric span {font-size:10px;color:#c3cfdd}
.stat-line {display:flex;justify-content:space-between;align-items:center;gap:6px;margin-bottom:6px;font-size:13px}
.stat-line span {color:var(--muted);font-size:12px}
.stat-card progress + .stat-line {margin-top:13px}
.mistake {margin-top:7px;border:1px solid var(--line);border-radius:11px;background:#17212e;padding:10px}
.mistake summary {cursor:pointer;font-size:14px;font-weight:700}
.mistake p {font-size:13px;margin-top:6px}
.source-card h2 {font-size:16px;margin-bottom:7px}
.source-card p + p {margin-top:8px}
footer {display:flex;align-items:center;justify-content:space-between;gap:5px;color:var(--muted);font-size:11px;padding:6px 0 15px;margin-top:10px}
footer button {font-size:11px}
.km1 {width:12%}.km2 {width:13%}.col3a {width:33%}.col3b {width:12%}.time4 {width:15%}.time5 {width:15%}
@media(max-width:350px) {
  .topic-copy small {font-size:10px}
  .paper td,.paper th {padding-inline:1px}
  .paper td:nth-child(3) {padding-left:2px}
  .offline {padding-inline:5px;letter-spacing:0}
}
.paper tr.focus td.inverse {background:#151c23;color:#fff}
.hero-quick {min-height:42px;margin-top:8px;padding:3px 0;border:0;background:none;color:var(--amber);font-size:13px;font-weight:820}
