/* ============================================================== tokens */
:root {
  color-scheme: dark light;
  --paper: #0f1319;
  --panel: #161b23;
  --panel-2: #1c222c;
  --ink: #e8ecf3;
  --muted: #98a2b3;
  --faint: #6b7686;
  --line: #262d38;
  --line-soft: #1e242e;
  --line-strong: #3a434f;
  --accent: #4b9bff;
  --accent-ink: #0b1220;
  --accent-soft: #14273f;
  --magenta: #e05fa8;
  --good: #34c98a;
  --good-soft: #10281f;
  --bad: #ff6b6b;
  --bad-soft: #2b1618;
  --warn: #f0b53f;
  --warn-soft: #2a2213;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.45), 0 18px 48px rgba(0,0,0,.35);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1180px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-lg: 0 4px 12px rgba(16,24,40,.10), 0 18px 48px rgba(16,24,40,.08);
  --paper: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f1f3f7;
  --ink: #131820;
  --muted: #59616f;
  --faint: #7c8595;
  --line: #e0e4ea;
  --line-soft: #eceff4;
  --line-strong: #c3cad5;
  --accent: #1667d8;
  --accent-ink: #ffffff;
  --accent-soft: #e6effc;
  --magenta: #c2338a;
  --good: #14874f;
  --good-soft: #e5f5ec;
  --bad: #c62b2b;
  --bad-soft: #fceaea;
  --warn: #9a6a05;
  --warn-soft: #fcf3e0;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 20px rgba(16,24,40,.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.22rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .85em; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--panel-2); padding: .12em .38em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ============================================================== layout */
.app { min-height: 100vh; display: flex; flex-direction: column; }
header.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; display: flex; align-items: center; gap: 14px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 1.02rem; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; flex: none; }
.brand b { color: var(--accent); }
nav.main { display: flex; gap: 2px; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a {
  padding: 7px 11px; border-radius: var(--radius-sm); color: var(--muted);
  font-size: .875rem; font-weight: 550; white-space: nowrap; text-decoration: none;
}
nav.main a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
nav.main a.on { background: var(--accent-soft); color: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

main { flex: 1; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 22px 18px 90px; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

/* ============================================================ elements */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.card.pad-lg { padding: 24px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* The modifiers are listed here too: an <a class="btn-primary"> has no
   element selector to fall back on, so without this it renders as bare
   coloured text instead of a button. */
button, .btn, .btn-primary, .btn-sm, .btn-lg, .btn-ghost, .btn-danger {
  font: inherit; font-weight: 570; font-size: .9rem;
  padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; transition: background .12s, border-color .12s, transform .06s;
}
button:hover, .btn:hover, .btn-sm:hover, .btn-lg:hover, .btn-ghost:hover, .btn-danger:hover { background: var(--line-soft); border-color: var(--faint); text-decoration: none; }
button:active, .btn:active, .btn-primary:active, .btn-sm:active, .btn-lg:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: .82rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

input, select, textarea {
  font: inherit; font-size: .9rem; padding: 8px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 5px; font-weight: 550; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: 999px; font-size: .74rem; font-weight: 620;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  letter-spacing: .01em; white-space: nowrap;
}
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; }
.stat .k { font-size: .76rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.stat .v { font-size: 1.85rem; font-weight: 700; letter-spacing: -.025em; margin-top: 3px; line-height: 1.1; }
.stat .s { font-size: .8rem; color: var(--faint); margin-top: 2px; }

.bar { height: 7px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s cubic-bezier(.4,0,.2,1); }
.bar > i.good { background: var(--good); } .bar > i.bad { background: var(--bad); } .bar > i.warn { background: var(--warn); }

table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--panel-2); }

/* =============================================================== quiz */
.quiz-wrap { max-width: 800px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.progress-track { flex: 1; min-width: 140px; height: 5px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.progress-track > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.timer { font-family: var(--mono); font-size: .95rem; font-weight: 650; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--panel-2); }
.timer.low { background: var(--bad-soft); color: var(--bad); }

.stem { font-size: 1.06rem; line-height: 1.6; margin-bottom: 4px; }
.figure-note { font-size: .85rem; color: var(--muted); font-style: italic; margin: 6px 0 10px; }
.figbox {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; margin: 12px 0; text-align: center; cursor: zoom-in;
}
.figbox svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.figbox .cap { font-size: .76rem; color: var(--muted); margin-top: 7px; }

.choices { display: grid; gap: 9px; margin: 16px 0 0; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 13px 15px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: .95rem; line-height: 1.5;
}
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.choice .ltr {
  flex: none; width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center;
  background: var(--panel-2); font-weight: 700; font-size: .8rem; color: var(--muted);
  border: 1px solid var(--line);
}
.choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.choice.sel .ltr { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.right .ltr { background: var(--good); color: #fff; border-color: transparent; }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .ltr { background: var(--bad); color: #fff; border-color: transparent; }
.choice:disabled { cursor: default; }

.explain {
  margin-top: 16px; padding: 15px 17px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  animation: fade .2s ease;
}
.explain h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 7px; }
.explain .why { font-size: .93rem; }
.explain .dis { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.explain .dis div { margin-bottom: 5px; }
.explain .dis b { color: var(--ink); font-family: var(--mono); font-size: .84rem; }
.explain .cite { margin-top: 11px; font-size: .8rem; }
.explain .cite code { background: var(--accent-soft); color: var(--accent); }

/* ============================================================== study */
.lesson-body { max-width: 760px; font-size: 1rem; line-height: 1.72; }
.lesson-body h1 { font-size: 1.5rem; margin-top: 1.8em; }
.lesson-body h2 { font-size: 1.22rem; margin-top: 1.7em; color: var(--accent); }
.lesson-body h3 { font-size: 1.04rem; margin-top: 1.5em; }
.lesson-body ul, .lesson-body ol { padding-left: 1.35em; margin: 0 0 1em; }
.lesson-body li { margin-bottom: .4em; }
.lesson-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .89rem; }
.lesson-body th { text-align: left; background: var(--panel-2); padding: 8px 11px; border: 1px solid var(--line); font-weight: 650; }
.lesson-body td { padding: 8px 11px; border: 1px solid var(--line-soft); vertical-align: top; }
.lesson-body blockquote { margin: 1.1em 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.lesson-body blockquote.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.lesson-body blockquote p:last-child { margin-bottom: 0; }
.lesson-body pre { background: var(--panel-2); padding: 13px 15px; border-radius: var(--radius-sm); overflow-x: auto; border: 1px solid var(--line); }
.lesson-body pre code { background: none; padding: 0; font-size: .85rem; line-height: 1.6; }
.keypoints { margin-top: 26px; padding: 17px 19px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.keypoints h4 { color: var(--accent); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.keypoints ul { margin: 0; padding-left: 1.2em; }
.keypoints li { margin-bottom: .45em; font-size: .93rem; }

.lesson-card { display: flex; gap: 13px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-decoration: none; color: inherit; }
.lesson-card:hover { border-color: var(--accent); text-decoration: none; }
.lesson-card .num { flex: none; width: 29px; height: 29px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; font-size: .82rem; color: var(--muted); }
.lesson-card.done .num { background: var(--good); color: #fff; }
.lesson-card .t { font-weight: 600; font-size: .95rem; margin-bottom: 2px; }

/* ============================================================== misc */
.gauge { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge .inner { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .num { font-size: 2.3rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.gauge .lbl { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

.countdown { display: flex; gap: 10px; }
.countdown .unit { background: var(--panel-2); border-radius: var(--radius-sm); padding: 9px 13px; text-align: center; min-width: 62px; }
.countdown .unit b { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.countdown .unit span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .4; margin-bottom: 12px; }

.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); font-size: .88rem; animation: up .22s ease; }
.toast.bad { border-color: var(--bad); color: var(--bad); }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

dialog { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--radius); padding: 0; max-width: min(860px, 94vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
dialog .dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
dialog .dlg-body { padding: 20px; max-height: 70vh; overflow: auto; }
dialog .dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.seg { display: inline-flex; background: var(--panel-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 5px 12px; font-size: .84rem; border-radius: 6px; }
.seg button.on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }

.plan-day { border-left: 2px solid var(--line); padding: 0 0 22px 20px; position: relative; }
.plan-day::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 99px; background: var(--line); border: 2px solid var(--paper); }
.plan-day.today { border-left-color: var(--accent); }
.plan-day.today::before { background: var(--accent); }
.plan-day.final::before { background: var(--magenta); }
.plan-day.past { opacity: .5; }

.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(11px, 1fr)); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 2px; background: var(--panel-2); }

kbd { border: 1px solid var(--line); border-bottom-width: 2px; padding: 1px 5px; border-radius: 4px; font-size: .78em; }

@media (max-width: 860px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  main { padding: 16px 13px 80px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .top-in { height: 54px; padding: 0 13px; gap: 8px; }
  .brand span { display: none; }
  h1 { font-size: 1.4rem; }
  .gauge { width: 140px; height: 140px; }
}
@media print {
  header.top, nav.main, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
}

/* ============================================================== chrome
   The shell written after the first pass: top bar, boot screen, footer,
   and the handful of components the views introduced. */

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 50; }
.boot-inner { text-align: center; color: var(--muted); max-width: 30rem; padding: 24px; }
.boot-inner h2 { margin: 0 0 8px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view-loading { height: 3px; border-radius: 3px; margin: 40px auto; max-width: 320px;
  background: linear-gradient(90deg, var(--line), var(--accent), var(--line));
  background-size: 200% 100%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { to { background-position: -200% 0; } }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 54px; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; flex: none; }
.topbar .brand svg { color: var(--accent); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; padding: 7px 11px; border-radius: 8px; font-size: .88rem; font-weight: 550;
  color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--panel-2); }
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 5px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: .66rem; font-weight: 700; text-align: center; line-height: 16px; }
.badge[hidden] { display: none; }
.icon { padding: 6px; }
.only-narrow { display: none; }

.footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center;
  max-width: 1080px; margin: 48px auto 0; padding: 18px; border-top: 1px solid var(--line);
  font-size: .76rem; color: var(--faint); }
.footer a { color: var(--muted); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }

/* ------------------------------------------------------------- layout */
.view { max-width: 1080px; margin: 0 auto; padding: 24px 18px 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.narrow { max-width: 780px; margin: 0 auto; width: 100%; }
.page-head h1 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -.025em; }
.page-head p { margin: 0 0 10px; max-width: 62ch; }
.grow { flex: 1 1 auto; min-width: 0; }
.pad-lg { padding: 22px; }
.row.tight { gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: .78rem; color: var(--faint); }
.crumbs a { color: var(--muted); }

/* --------------------------------------------------------- hero / stats */
.hero { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; padding: 26px; }
.hero.compact { padding: 20px; gap: 20px; }
.hero-gauge { flex: none; }
.hero-copy { flex: 1 1 320px; min-width: 0; }
.hero-copy h1 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -.02em; }
.hero-copy p { margin: 0; max-width: 56ch; }
.bigcount { flex: none; text-align: center; min-width: 96px; }
.bigcount .n { font-size: 3.4rem; font-weight: 760; line-height: 1; letter-spacing: -.04em; color: var(--accent); }
.bigcount .l { font-size: .72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.readiness-parts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.rp { display: flex; flex-direction: column; gap: 3px; min-width: 90px; flex: 1 1 90px; }
.stat-v { font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; margin: 2px 0; }
.bar.slim { height: 4px; }
.bar.mini { height: 5px; width: 72px; flex: none; }
.bar.mini.grow { width: auto; flex: 1 1 auto; }

/* ------------------------------------------------------------- tables */
table.data.areas tr.weak td:first-child b { color: var(--warn); }
table.data.kv td:first-child { width: 42%; }
table.data td .bar { display: inline-block; width: calc(100% - 46px); vertical-align: middle; margin-right: 6px; }

/* ------------------------------------------------------------ tasklist */
.tasklist { display: flex; flex-direction: column; }
.taskrow { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 8px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.taskrow:last-child { border-bottom: 0; }
.taskrow:hover { background: var(--panel-2); }
.taskrow.thin { opacity: .62; }

/* --------------------------------------------------- segmented controls */
.seg.vertical { display: flex; flex-direction: column; gap: 6px; background: none; padding: 0; }
.seg.vertical button { text-align: left; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel-2); color: var(--ink); width: 100%; display: block; }
.seg.vertical button:hover { border-color: var(--line-strong); }
.seg.vertical button.on { border-color: var(--accent); background: var(--accent-soft); }
.seg a { padding: 7px 12px; border-radius: 7px; color: var(--muted); text-decoration: none;
  font-size: .85rem; font-weight: 550; white-space: nowrap; }
.seg a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

.chipset { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-size: .8rem; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.checks { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.field.row { display: flex; align-items: center; gap: 10px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.narrow-in { width: 84px; }
.wide { width: 100%; }
.sticky-cta { position: sticky; bottom: 12px; z-index: 10; box-shadow: var(--shadow-lg); }
.big { padding: 11px 20px; font-size: .96rem; }

/* ---------------------------------------------------------- exam extras */
.sparkbars { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin: 14px 0 4px;
  padding-bottom: 18px; position: relative; border-bottom: 1px solid var(--line); }
.sparkbars::before { content: ''; position: absolute; left: 0; right: 0; bottom: calc(18px + 70%);
  border-top: 1px dashed var(--warn); opacity: .6; }
.sb { flex: 1 1 0; min-width: 14px; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; height: 100%; position: relative; }
.sb i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--accent); }
.sb.good i { background: var(--good); }
.sb.bad i { background: var(--bad); }
.sb span { position: absolute; bottom: -17px; font-size: .64rem; color: var(--faint); }
.passline-note { margin-top: 20px; }

/* ------------------------------------------------------------- review */
.qrow { border-bottom: 1px solid var(--line-soft); }
.qrow:last-child { border-bottom: 0; }
.qrow summary { display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; list-style: none; }
.qrow summary::-webkit-details-marker { display: none; }
.qrow summary:hover { background: var(--panel-2); }
.qrow-body { padding: 4px 2px 16px; }
.choice-static { padding: 5px 9px; border-radius: 6px; margin-bottom: 3px; color: var(--muted);
  border: 1px solid transparent; }
.choice-static.right { color: var(--good); background: var(--good-soft); border-color: var(--good); }
.note-box { margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: var(--panel-2);
  border-left: 3px solid var(--accent); font-size: .86rem; }
.bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-top: 14px; }
.bubble { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: .8rem; }
.bubble:hover { border-color: var(--line-strong); }
.bubble.on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); font-weight: 700; }
.bubble.on::after { content: '\2717'; position: absolute; font-size: .7rem; }

/* -------------------------------------------------------------- study */
.lesson-head h1 { margin: 6px 0 10px; font-size: 2rem; letter-spacing: -.03em; line-height: 1.15; }
.lead { font-size: 1.04rem; color: var(--muted); margin: 14px 0 0; max-width: 64ch; }
.lesson-foot { margin-top: 26px; }
.refnav { display: flex; flex-wrap: wrap; gap: 6px; }
.refnav a { padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: .78rem; color: var(--muted); text-decoration: none; }
.refnav a:hover { color: var(--accent); border-color: var(--accent); }
.ref h2 { margin: 0; font-size: 1.15rem; }
.callout { border-left: 3px solid var(--accent); }
.tickless { margin: 10px 0 0; padding-left: 18px; font-size: .88rem; color: var(--muted); }
.tickless li { margin-bottom: 8px; }
.tickless li b { color: var(--ink); }
.steps { margin: 10px 0 0; padding-left: 20px; font-size: .88rem; color: var(--muted); }
.steps li { margin-bottom: 7px; }
.plan-tasks { margin: 8px 0 0; padding-left: 18px; font-size: .86rem; color: var(--muted); }
.plan-tasks li { margin-bottom: 5px; }

/* ----------------------------------------------------------- settings */
.profiles { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: left; width: 100%; }
.profile:hover { border-color: var(--line-strong); }
.profile.on { border-color: var(--accent); background: var(--accent-soft); }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--bad); }

dialog.welcome { max-width: 460px; }
dialog.welcome h2 { margin: 0 0 8px; }

kbd { display: inline-block; padding: 1px 5px; margin: 0 1px; border-radius: 4px; border: 1px solid var(--line-strong);
  background: var(--panel-2); font: 600 .72rem/1.5 var(--mono); color: var(--muted); }

/* -------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .only-narrow { display: inline-flex; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 14px; }
  .nav { order: 10; width: 100%; max-height: 0; overflow: hidden; transition: max-height .2s ease; }
  .topbar.open .nav { max-height: 320px; padding-bottom: 8px; }
  .hero { flex-direction: column; text-align: center; }
  .hero-copy p { margin-inline: auto; }
  .readiness-parts { justify-content: center; }
}
@media (max-width: 620px) {
  .view { padding: 16px 12px 8px; }
  .page-head h1 { font-size: 1.4rem; }
  .bigcount .n { font-size: 2.6rem; }
  .sticky-cta { position: static; }
}
@media print {
  .topbar, .footer, .toasts, .sticky-cta, .seg, .refnav { display: none !important; }
  .view { max-width: none; padding: 0; }
  .card { break-inside: avoid; border: 0; box-shadow: none; padding: 0 0 12px; }
}

/* study-plan day cards */
.plan-date { text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.plan-tasks a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.plan-tasks a:hover { border-bottom-color: var(--accent); color: var(--accent); }
