/* CA Assist · design draft, direction "Ledger".
   Tokens first, then one rule set per component. Every page is built from these components only.
   Palette: paper, ink, grey and one accent (rust). Green is used only for done / correct. */

/* ---------- tokens ---------- */
:root {
  --bg: #faf8f4; --surface: #ffffff; --sunken: #f3efe7; --line: #ddd7cb; --line-strong: #1f2328;
  --text: #1f2328; --text-muted: #5f5c55;
  --brand: #9a3412; --on-brand: #ffffff; --brand-bg: #f6e7df;      /* links, primary action, Tier S, common mistake, incorrect */
  --correct: #1c6b34; --correct-bg: #e8f1ea;                        /* done, correct, full marks */
  --f-read: 'Literata', Georgia, serif; --f-ui: 'Figtree', system-ui, sans-serif;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-base: 1.0625rem; --fs-q: 1.125rem; --fs-h3: 1.2rem; --fs-h2: 1.45rem; --fs-h1: 1.9rem;
  --lh: 1.75; --measure: 70ch;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-sm: 3px; --r: 6px; --r-pill: 99px;
  --tutor-w: 384px;
}
:root[data-theme="dark"] {
  --bg: #17150f; --surface: #1e1b14; --sunken: #28241a; --line: #3b3629; --line-strong: #ece7db;
  --text: #ece7db; --text-muted: #aaa393;
  --brand: #ec8f66; --on-brand: #1a120c; --brand-bg: #3a2318;
  --correct: #84cc98; --correct-bg: #1b2b20;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #17150f; --surface: #1e1b14; --sunken: #28241a; --line: #3b3629; --line-strong: #ece7db;
  --text: #ece7db; --text-muted: #aaa393; --brand: #ec8f66; --on-brand: #1a120c; --brand-bg: #3a2318; --correct: #84cc98; --correct-bg: #1b2b20; } }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-base)/var(--lh) var(--f-read); }
h1, h2, h3, h4, h5 { font-family: var(--f-ui); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; margin: 0; }
p { margin: 0 0 1em; } a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.num, td.num, .s-eq, .f-text, .t-eq, .m-n, .timer, .tl-label, .tl-tick { font-family: var(--f-ui); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s5); }
.muted { color: var(--text-muted); } .ui { font-family: var(--f-ui); } .small { font-size: var(--fs-sm); }
.scroll { overflow-x: auto; }

/* draft switcher (not part of the design) */

/* ---------- component: button, chip ---------- */
.btn { font: 600 var(--fs-sm) var(--f-ui); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--text); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.quiet { border-color: var(--line); }
.chip { display: inline-flex; align-items: center; font: 600 var(--fs-xs) var(--f-ui); padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--text-muted); white-space: nowrap; }
.chip.tier-S { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.tier-A { background: var(--brand-bg); border-color: var(--brand); color: var(--brand); }
.chip.tier-B { background: var(--sunken); border-color: var(--line); color: var(--text-muted); }
.tiers { margin: 0 0 var(--s8); font-family: var(--f-ui); }
.tiers-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s4); margin-bottom: var(--s4); }
.tiers-head h2 { font: 700 var(--fs-xs)/1.4 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.tiers-head p { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
.tier-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.tier-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4) var(--s5) var(--s5); border: 1px solid var(--line); border-top-width: 4px; border-radius: var(--r); background: var(--surface); }
.tier-card b { font-size: var(--fs-base); } .tier-card p { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin: 0; }
.tc-S { border-top-color: var(--brand); background: var(--brand-bg); } .tc-A { border-top-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand-bg) 40%, var(--surface)); } .tc-B { border-top-color: color-mix(in srgb, var(--text-muted) 40%, var(--line)); background: var(--sunken); }
@media (max-width: 640px) { .tier-cards { grid-template-columns: 1fr; } .fam > header .fam-chips { margin-left: 0; justify-content: flex-start; } }
.chip.free { border-color: var(--line-strong); color: var(--text); }

/* ---------- component: site header ---------- */
.brand { font: 700 1.05rem var(--f-ui); color: var(--text); text-decoration: none; } .brand i { font-style: normal; color: var(--brand); }
.search { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); padding: 0 var(--s3); height: 40px; font: var(--fs-sm) var(--f-ui); min-width: 260px; }
.crumbs { font: var(--fs-sm) var(--f-ui); color: var(--text-muted); padding: var(--s6) 0 var(--s5); } .crumbs a { color: var(--text-muted); }

/* ---------- component: section label ---------- */
.sec { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin: var(--s8) 0 var(--s4); display: flex; align-items: center; gap: var(--s4); }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- component: question title ---------- */
.qtitle { padding-bottom: var(--s6); border-bottom: 2px solid var(--line-strong); }
.q-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .08em; text-transform: uppercase; margin-bottom: var(--s3); }
.q-no { color: var(--brand); } .q-marks { color: var(--text-muted); } .q-marks b { font-size: 1.1rem; color: var(--text); letter-spacing: 0; margin-right: 2px; }
.qtitle h1 { font-size: var(--fs-h1); } .q-tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.tb { font: 600 var(--fs-sm) var(--f-ui); min-height: 40px; padding: 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; cursor: pointer; }
.tb.on { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); } .tb-ai { margin-left: auto; border-color: var(--line-strong); }

/* ---------- component: question text ---------- */
.question { background: var(--sunken); border-radius: var(--r); padding: var(--s5) var(--s6); font-size: var(--fs-q); max-width: var(--measure); }
.question p:last-child { margin: 0; }

/* ---------- component: answer text ---------- */
.answer { max-width: var(--measure); } .answer > * { margin-top: 0; margin-bottom: var(--s6); }
.summary { font: 500 1.1rem/1.65 var(--f-ui); border-left: 3px solid var(--brand); padding-left: var(--s5); margin-bottom: var(--s7) !important; }
.prose h4 { font-size: var(--fs-h3); margin: var(--s7) 0 var(--s3); } .prose ul { margin: 0 0 1em; padding-left: 1.3em; } .prose li { margin-bottom: .5em; }
.prose > :last-child { margin-bottom: 0; }

/* ---------- component: glossary (terms used) ---------- */
.glossary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--s5) 0; font-family: var(--f-ui); }
.g-title { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--s4); }
dl.term { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: var(--s2) var(--s5); margin: 0 0 var(--s4); font-size: var(--fs-sm); line-height: 1.6; } dl.term:last-child { margin: 0; }
dl.term dt { font-weight: 700; } dl.term dd { margin: 0; color: var(--text-muted); }

/* ---------- component: formula ---------- */
.formula { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: var(--s5) var(--s6); }
.f-text { font-size: 1.08rem; font-weight: 600; } dl.where { margin: var(--s4) 0 0; font: var(--fs-sm)/1.6 var(--f-ui); color: var(--text-muted); display: grid; gap: var(--s1); }
dl.where div { display: flex; gap: var(--s2); } dl.where dt { font-weight: 700; color: var(--text); white-space: nowrap; } dl.where dt::after { content: " ="; font-weight: 400; } dl.where dd { margin: 0; }

/* ---------- component: panel (frame shared by working, table, time graph, marks split) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--f-ui); }
.phead { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.pkind { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.phead h5 { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; }
.pbody { padding: var(--s5); } .pfoot { padding: var(--s3) var(--s5) var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.6; color: var(--text-muted); }

/* working: a numbered chain, each step reads "what, then calculation = result, then why" */
.stepper { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.stepper li { counter-increment: s; position: relative; padding: 0 0 var(--s6) 48px; }
.stepper li:last-child { padding-bottom: 0; }
.stepper li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); font: 700 var(--fs-xs)/25px var(--f-ui); text-align: center; }
.stepper li::after { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: 6px; width: 1px; background: var(--line); }
.stepper li:last-child::after { display: none; } .stepper li:last-child::before { background: var(--line-strong); color: var(--surface); }
.s-what { font-size: var(--fs-base); font-weight: 600; line-height: 1.4; padding: 2px 9rem 0 0; }
.s-eq { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-top: var(--s2); font-size: var(--fs-base); line-height: 1.5; }
.s-calc { color: var(--text-muted); } .s-is { color: var(--text-muted); } .s-res { font-weight: 700; } .s-own { flex-basis: 100%; }
.stepper li:last-child .s-res { border-bottom: 3px double var(--line-strong); padding-bottom: 1px; }
.s-why { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin: var(--s2) 0 0; }
.s-ask { position: absolute; right: 0; top: 0; font: 600 var(--fs-xs) var(--f-ui); color: var(--brand); background: none; border: 0; padding: var(--s1) 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; opacity: 0; }
.stepper li:hover .s-ask, .s-ask:focus-visible { opacity: 1; } @media (hover: none) { .s-ask { opacity: 1; } }

/* table */
.p-table .pbody, .p-time .pbody { padding: 0; }
table.grid { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); line-height: 1.5; }
table.grid th, table.grid td { padding: var(--s3) var(--s5); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.grid th { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); background: var(--sunken); white-space: nowrap; }
table.grid th:not(:first-child) { text-align: right; } table.grid.tl th:nth-child(2) { text-align: left; }
table.grid td.num { text-align: right; white-space: nowrap; } table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tr.total td { font-weight: 700; border-top: 1.5px solid var(--line-strong); }

/* time graph */
.graph { padding: var(--s5) var(--s5) var(--s3); border-bottom: 1px solid var(--line); }
svg.timeline { width: 100%; min-width: 520px; height: auto; display: block; --tl-font: var(--f-ui); --tl-axis: var(--text-muted); --tl-text: var(--text); --tl-muted: var(--text-muted); --tl-in: var(--text); --tl-out: var(--brand); }

/* marks split */
.m-bar { display: flex; gap: 3px; height: 8px; margin-bottom: var(--s4); } .m-bar i { background: var(--line-strong); border-radius: 2px; opacity: .8; }
.m-bar i[style*="--got"] { opacity: 1; background: linear-gradient(90deg, var(--correct) var(--got), var(--brand) 0); } .m-bar i.m-none { background: var(--brand); }
.m-list { list-style: none; margin: 0; padding: 0; }
.m-list li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: var(--s4); align-items: baseline; padding: var(--s3) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.5; }
.m-list li:first-child { border-top: 0; } .m-n { font-size: 1.15rem; font-weight: 700; } .m-n small { font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
.m-s { font: 600 var(--fs-xs) var(--f-ui); white-space: nowrap; } .m-full .m-s { color: var(--correct); } .m-none .m-s, .m-none .m-n { color: var(--brand); } .m-half .m-s { color: var(--text-muted); }

/* ---------- component: note (three levels, same look everywhere) ---------- */
.note { border-left: 3px solid var(--line); padding: var(--s1) 0 var(--s1) var(--s5); }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.n-title { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--s2); }
.n-title::before { content: "i"; display: inline-block; width: 1.5em; height: 1.5em; line-height: 1.5em; margin-right: var(--s2); border-radius: 50%; border: 1px solid currentColor; text-align: center; letter-spacing: 0; text-transform: none; font-weight: 700; }
.n-pitfall { border-left-color: var(--brand); background: var(--brand-bg); padding: var(--s4) var(--s5); border-radius: 0 var(--r) var(--r) 0; }
.n-pitfall .n-title { color: var(--brand); } .n-pitfall .n-title::before { content: "!"; }
.n-exam_note .n-title::before { content: "✎"; border: 0; width: auto; } .n-example .n-title::before { content: "e.g."; border: 0; width: auto; }

/* ---------- component: related list / question rows ---------- */
.related, .rows { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-family: var(--f-ui); }
.related a, .qrow { display: grid; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-top: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: var(--fs-sm); line-height: 1.45; }
.related a { grid-template-columns: 9rem minmax(0, 1fr) auto; } .related a:first-child, .qrow:first-child { border-top: 0; }
.r-when, .qrow .when { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); } .r-t, .qrow .t b { font-weight: 600; } .qrow .t b { display: block; } .r-m { color: var(--text-muted); font-size: var(--fs-xs); }
.related a:hover, .qrow:hover { background: var(--sunken); }
.src { font: var(--fs-sm)/1.6 var(--f-ui); color: var(--text-muted); margin-top: var(--s7); max-width: var(--measure); } .wm { font: var(--fs-xs) var(--f-ui); color: var(--text-muted); opacity: .7; }

/* ---------- layout: reading page with tutor sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--tutor-w) minmax(0, 1fr); align-items: start; }
body.tutor-closed .shell { grid-template-columns: 56px minmax(0, 1fr); }
.read { max-width: 860px; width: 100%; margin: 0 auto; padding: 0 var(--s7) 140px; }

/* ---------- component: tutor (AI sidebar) ---------- */
.tutor { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); font-family: var(--f-ui); }
.t-panel { display: flex; flex-direction: column; height: 100%; } .t-rail { display: none; }
body.tutor-closed .t-panel { display: none; }
body.tutor-closed .t-rail { display: flex; flex-direction: column; align-items: center; gap: var(--s4); width: 100%; height: 100%; padding: var(--s5) 0; background: none; border: 0; cursor: pointer; }
.t-glyph { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 1rem/32px var(--f-ui); text-align: center; }
.t-vert { writing-mode: vertical-rl; font: 600 var(--fs-xs) var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }

.t-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s4) var(--s3) var(--s5); }
.t-id { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.t-mark { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font: 700 .95rem var(--f-read); }
.t-head h3 { font-size: 1rem; line-height: 1.2; } .t-head p { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-close { flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r); background: none; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--text-muted); }
.t-tabs { display: grid; grid-template-columns: repeat(3, auto); justify-content: stretch; gap: 2px; margin: 0 var(--s5) var(--s2); padding: 3px; background: var(--sunken); border-radius: var(--r); }
.t-tabs button { border: 0; background: none; border-radius: 4px; padding: 6px 10px; text-align: center; font: 600 var(--fs-xs) var(--f-ui); color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.t-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.t-view { display: none; flex: 1; min-height: 0; flex-direction: column; } .t-view.on { display: flex; }

/* conversation */
.t-thread { flex: 1; overflow-y: auto; padding: var(--s4) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s5); scroll-behavior: smooth; }
.t-day { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-xs); color: var(--text-muted); } .t-day::before, .t-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.t-q { align-self: flex-end; max-width: 90%; background: var(--line-strong); color: var(--surface); border-radius: 16px 16px 4px 16px; padding: var(--s3) var(--s4); font-size: var(--fs-sm); line-height: 1.55; position: relative; }
.t-q p { margin: 0; } .t-q time { display: block; text-align: right; font-size: 10px; opacity: .6; margin-top: 2px; }
.t-quote { display: block; width: 100%; text-align: left; font: 600 var(--fs-xs)/1.4 var(--f-ui); color: inherit; opacity: .8; background: rgba(255,255,255,.1); border: 0; border-left: 2px solid var(--brand); border-radius: 4px; padding: 5px 8px; margin-bottom: var(--s2); cursor: pointer; }
.t-a { font: .94rem/1.7 var(--f-read); padding-left: var(--s4); border-left: 2px solid var(--brand); }
.t-a p { margin: 0 0 var(--s3); } .t-a .tex-d { background: var(--sunken); border-radius: var(--r); padding: var(--s3) var(--s4); margin: 0 0 var(--s3); }
.t-a .tex-d .katex { font-size: 1.05em; }
.t-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font: var(--fs-xs) var(--f-ui); }
.t-src { color: var(--text-muted); text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .t-src:hover { color: var(--brand); border-color: var(--brand); }
.t-acts { display: flex; gap: 2px; } .t-acts button { width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--text-muted); cursor: pointer; font-size: 11px; } .t-acts button:hover { background: var(--sunken); color: var(--text); }
.t-typing { display: flex; gap: 4px; padding-left: var(--s4); border-left: 2px solid var(--line); height: 20px; align-items: center; }
.t-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); opacity: .4; }
@media (prefers-reduced-motion: no-preference) { .t-typing i { animation: t-dot 1.2s infinite; } .t-typing i:nth-child(2) { animation-delay: .2s; } .t-typing i:nth-child(3) { animation-delay: .4s; } }
@keyframes t-dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* composer */
.t-dock { border-top: 1px solid var(--line); padding: var(--s3) var(--s4) var(--s4); background: var(--surface); }
.t-suggest { display: flex; gap: var(--s2); align-items: center; overflow-x: auto; scrollbar-width: none; padding-bottom: var(--s3); }
.t-suggest span { flex: none; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.t-suggest button { flex: none; font: 500 var(--fs-xs) var(--f-ui); padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); cursor: pointer; }
.t-suggest button:hover { border-color: var(--line-strong); }
.t-compose { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: var(--s2); }
.t-compose:focus-within { border-color: var(--line-strong); outline: 3px solid var(--brand-bg); outline-offset: 0; }
.t-ctx { display: inline-flex; align-items: center; gap: 4px; margin: 2px 2px 0; padding: 2px 4px 2px 8px; border-radius: 4px; background: var(--brand-bg); color: var(--brand); font: 600 var(--fs-xs) var(--f-ui); }
.t-ctx button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 4px; }
.t-compose textarea { display: block; width: 100%; border: 0; background: none; resize: none; padding: var(--s2) var(--s2) var(--s1); font: var(--fs-sm)/1.5 var(--f-ui); outline: none; max-height: 140px; }
.t-bar { display: flex; align-items: center; gap: var(--s2); padding: 0 0 0 var(--s2); font-size: 11px; color: var(--text-muted); }
.t-quota { width: 42px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; } .t-quota i { display: block; height: 100%; background: var(--text-muted); }
.t-send { margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 1rem var(--f-ui); cursor: pointer; }

/* check my answer, find questions */
.t-pane { flex: 1; overflow-y: auto; padding: var(--s4) var(--s5) var(--s5); }
.t-lead { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin: 0 0 var(--s4); }
.ck { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.ck-row { display: grid; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.ck-row input, .t-search { width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 9px 12px; font: var(--fs-sm) var(--f-ui); color: var(--text); font-variant-numeric: tabular-nums; }
.t-search { margin-bottom: var(--s3); } .t-wide { width: 100%; }
.ck-out { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; gap: var(--s3); font-size: var(--fs-sm); line-height: 1.55; }
.ck-out li { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--sunken); } .ck-out b { display: block; margin-bottom: 2px; }
.ck-out .ok b { color: var(--correct); } .ck-out .no { background: var(--brand-bg); } .ck-out .no b { color: var(--brand); }
.t-hits { list-style: none; margin: 0; padding: 0; } .t-hits li { padding: var(--s3) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); cursor: pointer; }
.t-hits b { display: block; font-weight: 600; } .t-hits span { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- page: chapter ---------- */
.chead { padding-bottom: var(--s6); } .chead h1 { font-size: 2.2rem; } .chead p { font: var(--fs-base)/1.65 var(--f-ui); color: var(--text-muted); margin: var(--s4) 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-family: var(--f-ui); margin-bottom: var(--s5); }
.stat { display: flex; flex-direction: column; padding: var(--s5); border-left: 1px solid var(--line); } .stat:first-child { border-left: 0; } .stat > b { display: block; font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; } .stat > span { font-size: var(--fs-xs); color: var(--text-muted); }
.progress { height: 4px; background: var(--sunken); border-radius: 99px; overflow: hidden; margin-top: var(--s3); } .progress i { display: block; height: 100%; background: var(--correct); }
.fam { margin-bottom: var(--s8); } .fam > header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s3); } .fam h2 { font-size: var(--fs-h2); margin-right: var(--s2); } .fam-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-left: auto; justify-content: flex-end; }
.fam .what { font: var(--fs-sm)/1.65 var(--f-ui); color: var(--text-muted); margin: 0 0 var(--s5); }
.qrow { grid-template-columns: 28px 7.5rem minmax(0, 1fr) auto 3.5rem; padding: var(--s4) var(--s5); }
.tick { width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 12px; } .tick.done { background: var(--correct); border-color: var(--correct); color: var(--surface); } .tick.done::before { content: "✓"; }
.qrow .t span { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; } .qrow .mk { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; } .qrow .mk small { font-weight: 400; color: var(--text-muted); }

/* ---------- page: landing ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s8); align-items: center; padding: 96px 0 var(--s8); }
.hero h1 { font: 700 clamp(2.1rem, 4.6vw, 3.3rem)/1.12 var(--f-read); letter-spacing: -.02em; } .lead { font: 1.1rem/1.7 var(--f-ui); color: var(--text-muted); margin: var(--s5) 0 var(--s6); }
.kicker { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: var(--s4); }
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); } .fine { font: var(--fs-sm) var(--f-ui); color: var(--text-muted); margin-top: var(--s5); }
.section-h { font-size: var(--fs-h2); margin: var(--s8) 0 var(--s6); }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); padding-bottom: 140px; font-family: var(--f-ui); }
.plan { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: var(--s6); display: flex; flex-direction: column; } .plan.best { border: 2px solid var(--line-strong); }
.plan h3 { font-size: 1rem; } .price { font-size: 2.1rem; font-weight: 700; line-height: 1.2; margin-top: var(--s3); font-variant-numeric: tabular-nums; } .per { font-size: var(--fs-xs); color: var(--text-muted); }
.plan ul { flex: 1; margin: var(--s5) 0 var(--s6); padding-left: 1.2em; font-size: var(--fs-sm); line-height: 1.6; } .plan li { margin-bottom: var(--s2); }

/* ---------- page: mock exam and result ---------- */
.exambar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); font-family: var(--f-ui); }
.exambar .wrap { display: flex; align-items: center; gap: var(--s6); min-height: 76px; }
.timer { font-size: 1.6rem; font-weight: 700; line-height: 1.1; } .exambar .bar { flex: 1; min-width: 160px; }
.qnav { display: flex; flex-wrap: wrap; gap: var(--s2); } .qnav a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); font: 600 var(--fs-sm) var(--f-ui); color: var(--text); text-decoration: none; }
.qnav a.up { background: var(--sunken); } .qnav a.up::after { content: "•"; position: absolute; margin: -26px 0 0 26px; color: var(--correct); } .qnav a.cur { background: var(--line-strong); border-color: var(--line-strong); color: var(--surface); }
.exam { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s8); padding: var(--s7) 0 140px; align-items: start; }
.side { display: grid; gap: var(--s5); position: sticky; top: 100px; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: var(--s7) var(--s4); text-align: center; font-size: var(--fs-sm); line-height: 1.7; color: var(--text-muted); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s4); } .thumb { aspect-ratio: 3/4; border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; place-items: end start; padding: 6px; font-size: var(--fs-xs); color: var(--text-muted); background: repeating-linear-gradient(var(--surface) 0 13px, var(--line) 13px 14px); }
.score { display: flex; flex-wrap: wrap; gap: var(--s7); align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: var(--s6); margin-bottom: var(--s7); font: var(--fs-sm)/1.7 var(--f-ui); }
.big { font-size: 3.2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; } .big small { font-size: 1.1rem; font-weight: 500; color: var(--text-muted); }
.fb { margin-bottom: var(--s7); } .fb > h2 { font-size: var(--fs-h3); margin-bottom: var(--s4); display: flex; gap: var(--s3); align-items: baseline; } .fb > h2 span { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; }
.fb .note { margin: var(--s5) 0; font-size: var(--fs-base); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  html { font-size: 16.5px; } .wrap { padding: 0 var(--s4); } .search { display: none; }
  .shell, body.tutor-closed .shell { grid-template-columns: minmax(0, 1fr); } .read { padding: 0 var(--s4) 120px; }
  .tutor { position: fixed; inset: 0; height: auto; z-index: 40; border: 0; }
  body.tutor-closed .tutor { inset: auto var(--s4) var(--s4) auto; background: none; }
  body.tutor-closed .t-rail { flex-direction: row; width: auto; height: 52px; padding: 0 var(--s4) 0 var(--s2); gap: var(--s2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
  .t-vert { writing-mode: horizontal-tb; color: var(--text); letter-spacing: .04em; }
  .qtitle h1 { font-size: 1.5rem; } .question { padding: var(--s4); } .pbody { padding: var(--s4); } .phead { padding: var(--s3) var(--s4); flex-wrap: wrap; }
  table.grid th, table.grid td { padding: var(--s3) var(--s4); } .stepper li { padding-left: 40px; } .s-what { padding-right: 0; } .s-ask { position: static; margin-top: var(--s2); }
  dl.term { grid-template-columns: 1fr; gap: 2px; } .related a { grid-template-columns: 1fr auto; } .r-when { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .qrow { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "tick when mk" "tick t t" "tick tags tags"; row-gap: 2px; align-items: start; }
  .qrow .tick { grid-area: tick; margin-top: 1px; } .qrow .when { grid-area: when; } .qrow .t { grid-area: t; } .qrow .mk { grid-area: mk; white-space: nowrap; } .qrow .tags { grid-area: tags; } .qrow .tags:empty { display: none; }
  .hero, .exam { grid-template-columns: 1fr; gap: var(--s7); } .hero { padding: var(--s7) 0; } .pricing { grid-template-columns: 1fr; gap: var(--s6); }
  .side { position: static; } .tb-ai { display: none; } .m-list li { grid-template-columns: 3.6rem minmax(0, 1fr); } .m-s { grid-column: 2; }
}
table.grid.tl td:first-child, table.grid.tl th:first-child { white-space: nowrap; width: 1%; }

/* question parts: lead-in, standard sub-question list, given data */
.q-required { font: 600 var(--fs-base) var(--f-ui); margin: var(--s5) 0 var(--s3); }
.q-parts { list-style: none; margin: 0; padding: 0; } .q-parts li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: var(--s2); padding: var(--s2) 0; }
.q-pl { font: 700 var(--fs-sm)/2 var(--f-ui); color: var(--text-muted); }
.q-given { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: var(--s2); align-items: baseline; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); font: var(--fs-sm)/1.7 var(--f-ui); }
.q-gl { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); grid-column: 1 / -1; }
.q-given ul { list-style: none; margin: 0; padding: 0; grid-column: 1 / -1; font-variant-numeric: tabular-nums; }

/* typewriter face for formulas, given data and calculation lines */
:root { --f-mono: 'IBM Plex Mono', ui-monospace, monospace; }
.q-given ul, .f-text, .s-eq, .t-eq { font-family: var(--f-mono); font-variant-numeric: normal; }
.q-given ul { font-size: 1rem; line-height: 1.8; } .f-text { font-size: 1.02rem; font-weight: 600; } .s-eq { font-size: .98rem; } .t-eq { font-size: .88rem; font-weight: 600; }
.q-given ul { font-size: .92rem; }

/* part badge: marks which sub-question a line, heading or marking point belongs to */
.part { display: inline-block; font: 700 var(--fs-xs)/1 var(--f-ui); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; padding: 4px 8px; margin-right: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); vertical-align: .12em; }
.prose h4 .part, .phead .part { background: var(--line-strong); color: var(--surface); }

/* ---------- revision: line breaks and tables ----------
   Reading text keeps a comfortable measure; panels, tables and the glossary use the full column,
   so their contents are not squeezed into a narrow strip. */
.read { max-width: 920px; }
.answer { max-width: none; }
.answer > .prose, .answer > .summary, .answer > .note, .question, .src { max-width: var(--measure); }
dl.term { display: block; margin: 0 0 var(--s4); font-size: var(--fs-base); line-height: 1.65; }
dl.term dt { display: inline; } dl.term dt::after { content: " — "; font-weight: 400; color: var(--text-muted); } dl.term dd { display: inline; color: var(--text); }
.s-what { padding-right: 0; } .s-why { max-width: none; font-size: .94rem; }
.s-ask { position: static; display: inline-block; margin-top: var(--s2); opacity: 1; font-weight: 500; color: var(--text-muted); }
table.grid { min-width: 560px; } table.grid th { text-align: left !important; } table.grid th.num { text-align: right !important; }
table.grid td:not(.num) { min-width: 9rem; } table.grid.tl td:first-child, table.grid td[colspan] { min-width: 0; }
table.grid td, .pfoot, .m-list li { font-size: .94rem; } .pfoot { line-height: 1.6; }
.spec { margin-bottom: 96px; } .spec .sec { color: var(--brand); font-size: var(--fs-sm); } .spec-meta { font: var(--fs-sm) var(--f-ui); color: var(--text-muted); margin-bottom: var(--s6); }
.question { max-width: none; } .question > p, .question .q-parts, .question .q-given { max-width: var(--measure); }

/* ---------- revision: fixes found by the in-browser audit ---------- */
body { overflow-wrap: break-word; }
.m-t, .s-calc, .s-res, .r-t, dl.term dd, .note p { overflow-wrap: anywhere; min-width: 0; }
.hero > *, .exam > *, .layout > *, .shell > * { min-width: 0; }
.m-list li { grid-template-columns: 5rem minmax(0, 1fr) auto; }
.f-where { display: block; margin-top: var(--s2); font-weight: 500; color: var(--text-muted); }

@media (max-width: 900px) {
  .exambar .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s2) var(--s4); padding: var(--s3) var(--s4); }
  .exambar .bar { min-width: 0; } .qnav { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; order: 3; }
  .exambar .btn { grid-column: 3; grid-row: 1; padding: 0 var(--s3); }
  .timer { font-size: 1.3rem; } .exambar .bar .small { display: none; }
}

/* ---------- revision: line breaking ----------
   One column width for every answer block (no ragged right edges) and expressions that never split inside a term.
   Text wraps greedily: every line fills to the edge. No text-wrap: pretty/balance and no glued last words; they
   pull words down early and leave short lines (measured with design/_audit_breaks.js). */
.read { max-width: 820px; }
.answer > .prose, .answer > .summary, .answer > .note, .question, .question > p, .question .q-parts, .question .q-given, .src { max-width: none; }
.f-text { overflow-x: auto; } .f-seg, .s-calc, .s-res, .t-eq { white-space: nowrap; }
.s-eq { flex-wrap: wrap; } .s-calc { white-space: normal; } .s-calc .f-seg { white-space: nowrap; }
.s-own { white-space: normal; }
table.grid th.num, table.grid td.num { width: 1%; } /* number columns shrink to their figures; text columns take the rest */
table.grid th { white-space: normal; vertical-align: bottom; }
table.grid th, table.grid td { padding-left: var(--s4); padding-right: var(--s4); }
table.grid th.num { min-width: 5.5rem; }

/* ---------- maths: typeset with KaTeX and set apart from the prose ---------- */
.tex:empty::before { content: attr(data-plain); font-family: var(--f-mono); }      /* shown only if KaTeX fails */
.tex { display: inline-block; padding: 1px 6px; margin: 0 1px; border-radius: var(--r-sm); background: var(--sunken); color: var(--text); line-height: 1.5; vertical-align: baseline; white-space: nowrap; }
.tex .katex { font-size: 1.04em; }
.tex-d { display: block; background: none; padding: var(--s2) 0; margin: 0; overflow-x: auto; overflow-y: hidden; text-align: left; }
.tex-d .katex-display { margin: 0; text-align: left; } .tex-d .katex { font-size: 1.22em; }
.formula { border-left-color: var(--brand); }
.s-eq .tex { font-size: 1.02rem; background: none; padding: 0; } .s-eq { align-items: center; row-gap: var(--s2); }
.s-res .tex { font-weight: 700; }
.t-a .tex, .note .tex, td .tex { background: var(--sunken); }
.n-pitfall .tex { background: rgba(255,255,255,.55); } :root[data-theme="dark"] .n-pitfall .tex { background: rgba(0,0,0,.25); }
.s-res, .s-res .f-seg { font-family: var(--f-ui); font-size: 1.02rem; } .s-is { font-family: KaTeX_Main, serif; }
.tex { max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; } /* a long expression scrolls inside itself on a phone */
.tex-d .katex-display > .katex { text-align: left; }
.f-where { font-family: var(--f-ui); font-size: var(--fs-sm); }
.f-where .tex { font-size: 1rem; }

/* step results with fractions were clipped: give typeset maths room above and below */
.tex { padding-top: .3em; padding-bottom: .3em; line-height: 1.2; } .s-eq .tex { padding-top: .35em; padding-bottom: .35em; }
/* part column: a narrow first column holding the badge, aligned with the first line of the row */
table.grid th.pcol, table.grid td.pcol { width: 1%; white-space: nowrap; padding-right: 0; }
table.grid td.pcol .part { margin: 1px 0 0; }
table.grid td.pcol + td { font-weight: 600; }
table.grid td.pcol, table.grid th.pcol { min-width: 0; padding-right: var(--s2); }
table.grid td:not(.num):not(.pcol) { min-width: 7.5rem; }
table.grid td .tex { white-space: nowrap; font-size: .95em; }
/* related questions: reference and session stacked, topic in reading size */
.related a { grid-template-columns: 6.5rem minmax(0, 1fr) auto; padding: var(--s4) var(--s5); }
.r-when { display: grid; gap: 1px; } .r-when b { font: 700 var(--fs-sm) var(--f-ui); color: var(--text); letter-spacing: .01em; } .r-when span { font-size: var(--fs-xs); font-weight: 500; }
.r-t { font-size: var(--fs-base); font-weight: 500; } .r-m { white-space: nowrap; }
.related a:hover .r-t { color: var(--brand); }
@media (max-width: 900px) { .related a { grid-template-columns: 5rem minmax(0, 1fr); } .r-when { grid-column: auto; } .r-m { grid-column: 2; } }

/* landing hero preview: the sample time graph and schedule fit the card, no scrollbars */
.hero .scroll { overflow: visible; }
.hero svg.timeline { min-width: 0; }
.hero table.grid { min-width: 0; font-size: var(--fs-sm); }
.hero table.grid td:not(.num):not(.pcol), .hero table.grid th.num { min-width: 0; }
.hero > div:last-child { container-type: inline-size; }
@container (max-width: 460px) {   /* narrow card: the preview keeps year, cash flow and present value */
  .hero table.grid.tl th:nth-child(3), .hero table.grid.tl th:nth-child(4),
  .hero table.grid.tl tr:not(.total) > td:nth-child(3), .hero table.grid.tl tr:not(.total) > td:nth-child(4) { display: none; }
  .hero table.grid.tl tr.total > td:nth-child(2), .hero table.grid.tl tr.total > td:nth-child(3) { display: none; }
  .hero table.grid.tl tr:not(.total) > td:nth-child(2) { white-space: nowrap; }
}
.nobr { white-space: nowrap; }
/* a formula wider than its column breaks after = or × (KaTeX's own break points), never mid-term */
.tex.wrap { max-width: 100%; } .tex.wrap, .tex.wrap .katex, .tex.wrap .katex-html, .nobr:has(.tex.wrap) { white-space: normal; }

/* ---------- component: dashboard (home when signed in; the logo leads here; layout follows the canvas mockup) ---------- */
.dash { padding: var(--s7) var(--s5) var(--s8); font-family: var(--f-ui); max-width: 1280px; }
.d-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4) var(--s5); margin-bottom: var(--s6); }
.d-head .kicker { margin-bottom: var(--s2); } .d-head h1 { font-size: var(--fs-h1); }
.d-head p { font: var(--fs-base)/1.6 var(--f-read); color: var(--text-muted); margin: var(--s2) 0 0; }
.d-head .btn svg, .d-ico svg, .st-done svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.d-row1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s4); } .d-row1 > :last-child { grid-column: 1 / -1; }
.d-row2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.25fr); gap: var(--s4); }
.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.d-card > .btn:last-child { margin-top: auto; }
.d-ch { display: flex; align-items: flex-start; gap: var(--s3); } .d-ch > div { flex: 1; min-width: 0; }
.d-ch h2 { font-size: 1rem; } .d-ch p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-muted); }
.d-ch > a { font-size: var(--fs-sm); font-weight: 600; align-self: center; }
.d-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--brand-bg); color: var(--brand); }
.d-ico svg { width: 18px; height: 18px; }
/* study time: one pill bar per day, today in the accent; bars widen to fill the card with an even 8px gap */
/* mock exams home (mocks.html) */
.mx-col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.mx-list { list-style: none; margin: 0; padding: 0; } .mx-row:first-child { border-top: 0; }
.mx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.mx-row b { display: block; font-size: var(--fs-sm); } .mx-row small { font-size: var(--fs-xs); color: var(--text-muted); } .mx-row em { font-style: normal; color: var(--brand); }
.mx-row .btn { min-width: 92px; justify-content: center; }
.mx-score { display: flex; align-items: baseline; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mx-score b { font-size: 1.15rem; color: var(--text); }
.mx-how { margin: 0; padding: 0; list-style: none; counter-reset: how; display: flex; flex-direction: column; gap: var(--s3); font-size: var(--fs-sm); color: var(--text-muted); }
.mx-how li { counter-increment: how; display: grid; grid-template-columns: 28px 1fr; column-gap: var(--s2); }
.mx-how li::before { content: counter(how); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font: 700 var(--fs-xs) var(--f-ui); color: var(--text); }
.mx-how b { color: var(--text); }
@media (max-width: 520px) { .mx-row { grid-template-columns: minmax(0, 1fr) auto; } .mx-row .mx-score:empty { display: none; } .mx-row .btn { grid-column: 1 / -1; } }
/* study total drafts (study_heads.html); .d-stats is the dashboard's stat row */
.sh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--s4); }
.sh-name { font-size: 1rem; margin: 0 0 2px; } .sh-why { margin: 0 0 var(--s3); font-size: var(--fs-sm); color: var(--text-muted); }
.sh-delta { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px 2px 6px; border-radius: var(--r-pill); background: var(--sunken); font: 600 var(--fs-xs)/18px var(--f-ui); color: var(--text); vertical-align: middle; }
.sh-delta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sh-kick { margin: 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.d-ch .sh-big { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: var(--s2); }
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px !important; }
.sh-chip { padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-xs); line-height: 18px; } .sh-chip b { color: var(--text); }
.sh-overlay-wrap { position: relative; } .sh-overlay { position: absolute; z-index: 1; top: 0; left: 0; display: grid; gap: 2px; justify-items: start; }
.sh-overlay b { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; } .sh-overlay small { font-size: var(--fs-xs); color: var(--text-muted); }
.d-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: auto 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); }
.d-stats div + div { padding-left: var(--s4); border-left: 1px solid var(--line); } .d-stats dt { font-size: var(--fs-xs); color: var(--text-muted); }
.d-stats dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-vs { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-muted); }
.sh-vs i { height: 8px; width: var(--w); border-radius: var(--r-pill); background: var(--line); } .sh-vs i.on { background: var(--brand); }
.sh-vs b { font-size: var(--fs-sm); color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 900px) { .sh-grid { grid-template-columns: 1fr; } }
.d-tot { font-size: 1.3rem; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; display: inline-block; margin: 6px 2px 0 0; }
.d-range { flex: 1; display: flex; flex-direction: column; gap: var(--s4); } .d-range[hidden] { display: none; }
.d-select { align-self: center; height: 36px; padding: 0 38px 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-pill); appearance: none; -webkit-appearance: none;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; font: 600 var(--fs-sm) var(--f-ui); color: var(--text); cursor: pointer; }
.d-chart { position: relative; min-width: 280px; }
.d-bars { display: flex; align-items: flex-end; gap: 8px; height: 220px; margin: 0; padding: 0; list-style: none; }
.d-bars li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: var(--fs-xs); line-height: 18px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-bars li span { height: 18px; }   /* every bar keeps a label slot, so bars share one baseline */
.d-bars i { display: block; width: 100%; border-radius: var(--r-pill); background: var(--line); }
.d-bars .on { color: var(--brand); font-weight: 700; } .d-bars .on i { background: var(--brand); }
/* outline 12px around the bar tops (TRACE_JS), hour labels above it; fades in from the left and into the accent at today's ringed dot, where it ends */
.d-trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

.d-empty .d-trace, .d-empty .d-dot { display: none; }   /* nothing to trace in an empty week */
.d-trace .f0 { stop-color: var(--text); stop-opacity: .12; } .d-trace .f1 { stop-color: var(--text); stop-opacity: .85; } .d-trace .f2 { stop-color: var(--brand); }
.d-val { position: absolute; transform: translate(-50%, calc(-100% - 6px)); font-size: var(--fs-xs); line-height: 18px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-val.on { color: var(--brand); font-weight: 700; }
.d-dot { position: absolute; z-index: 1; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--surface); border: 4px solid var(--brand); }
/* question coverage: done green (the only green use), started ink, the rest sunken; numbers in the key */
.d-donut { position: relative; width: 180px; height: 180px; margin: auto; }   /* centred in the space between header and stat row */
.d-stats.d-key { margin-top: 0; }
.d-donut svg { display: block; transform: rotate(-90deg); } .d-donut circle { fill: none; stroke-width: 24; }
.c-rest { stroke: var(--sunken); } .c-done { stroke: var(--correct); } .c-started { stroke: var(--line-strong); }
.d-donut div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: var(--fs-xs); color: var(--text-muted); }
.d-donut b { font-size: 1.6rem; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.d-key dt { display: flex; align-items: center; gap: 6px; } .d-key i { width: 10px; height: 10px; border-radius: var(--r-pill); }
.k-done { background: var(--correct); } .k-started { background: var(--line-strong); } .k-rest { background: var(--sunken); border: 1px solid var(--line); }
/* study plan: day strip, then today's list on an inverted (ink) card */
.d-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.d-days button { min-height: 56px; padding: 6px 0; border: 1px solid var(--sunken); border-radius: var(--r-pill); background: var(--sunken); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; line-height: 1.2; }
.d-days b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.d-days [aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
/* study plan: page colours (it was a dark slate block) */
.d-plan { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s4) var(--s2); }
.d-plan header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s1); }
.d-plan h3 { font-size: .94rem; font-weight: 600; } .d-plan header span { font-size: var(--fs-sm); color: var(--text-muted); } .d-plan header b { font-size: 1.2rem; color: var(--text); }
.d-plan ul { list-style: none; margin: 0; padding: 0; }
.d-plan li { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); }
.d-plan li > div { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }
.d-plan small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
.st-done { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--correct); }
.st-done svg { stroke-width: 2.5; }
.st-todo { font-size: var(--fs-xs); color: var(--text-muted); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 1px 8px; white-space: nowrap; }
/* chapters in progress: ten-step bar, filled steps green */
.d-chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.d-chap { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.d-chap header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.d-chap h3 { font-size: .94rem; } .d-chap header p { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.d-seg { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.d-seg span { flex: 1; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.d-seg i { height: 12px; border-radius: 2px; background: var(--line); } .d-seg i.f { background: var(--correct); }
.d-chap footer { display: flex; justify-content: space-between; gap: var(--s3); padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-muted); }
.d-chap footer b { font-weight: 400; color: var(--text); } .d-chap footer a { font-weight: 600; white-space: nowrap; }
/* mock exams */
.d-last { background: var(--sunken); border-radius: var(--r); padding: var(--s4); font-size: var(--fs-sm); color: var(--text-muted); }
.d-last p { margin: 0 0 var(--s2); } .d-last a { font-weight: 600; }
.d-score { display: flex; align-items: baseline; gap: 6px; margin: 6px 0; } .d-score b { font-size: 2rem; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.d-hist { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.d-hist li { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); } .d-hist span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .d-row2 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .dash { padding: var(--s6) var(--s4) var(--s7); } .d-row1, .d-chapters { grid-template-columns: 1fr; } .d-card { padding: var(--s4); } }

/* No printing or "save as PDF": a printed page shows only this notice (business rule, 2026-10-11) */
@media print {
  body > * { display: none !important; }
  body::before { content: "Printing and saving as PDF are turned off. Read your answers online at any time with your account."; display: block; padding: 3cm 2cm; font: 600 14pt var(--f-ui); color: #000; }
}

/* landing: "What is inside" on its own band; each feature is a card holding its pitch and a framed sample */
.inside { background: var(--sunken); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--s8) 0; margin-top: var(--s8); }
.inside-head { margin-bottom: var(--s7); }
.inside-head h2 { font: 700 var(--fs-h1)/1.2 var(--f-ui); margin: 0 0 var(--s3); }
.inside-head p { font: var(--fs-base)/1.6 var(--f-ui); color: var(--text-muted); margin: 0; }
.tour { display: flex; flex-direction: column; gap: var(--s5); }
.tr { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s7); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--s6); }
.tr-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .tr-flip .tr-text { order: 2; }
.tr-kick { display: flex; align-items: center; gap: var(--s3); font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: var(--s3); }
.tr-no { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--r-pill); background: var(--brand-bg); color: var(--brand); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tr-text h3 { font: 700 1.45rem/1.25 var(--f-ui); margin-bottom: var(--s4); }
.tr-text p { font: var(--fs-base)/1.7 var(--f-ui); color: var(--text-muted); margin: 0 0 var(--s4); }
.tr-text ul { list-style: none; margin: 0; padding: 0; font: var(--fs-sm)/1.6 var(--f-ui); }
.tr-text li { position: relative; padding-left: var(--s5); margin-bottom: var(--s2); }
.tr-text li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--correct); }
.tr-sample { min-width: 0; margin: 0; background: var(--sunken); border-radius: 10px; padding: var(--s3) var(--s4) var(--s4); }
.tr-sample figcaption { font: 600 var(--fs-xs) var(--f-ui); color: var(--text-muted); padding: 0 var(--s1) var(--s3); display: flex; align-items: center; gap: var(--s2); }
.tr-sample figcaption::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.tr-frame > .panel, .tr-frame > .note { margin: 0; }
.tr-dash { display: flex; flex-direction: column; gap: var(--s4); font-family: var(--f-ui); }   /* dashboard sample: UI font and card spacing, as on the dashboard */
.tr-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-family: var(--f-ui); }
.tr-cap { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.tr-fams { list-style: none; margin: 0; padding: 0; }
.tr-fams li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t c" "n c"; column-gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
.tr-fams li:first-child { border-top: 0; } .tr-t { grid-area: t; font-weight: 600; } .tr-n { grid-area: n; font-size: var(--fs-xs); color: var(--text-muted); } .tr-fams .chip { grid-area: c; }
.tr-chat { display: flex; flex-direction: column; gap: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: var(--s5); }
.inside + .wrap .section-h { margin-top: var(--s8); }
@media (max-width: 860px) { .tr, .tr-flip { grid-template-columns: 1fr; gap: var(--s5); padding: var(--s5); } .tr-flip .tr-text { order: 0; } .inside { padding: var(--s7) 0; } .inside-head h2 { font-size: var(--fs-h2); } }
@media (max-width: 420px) { .tr, .tr-flip { padding: var(--s4); } .tr-sample { padding: var(--s2) var(--s2) var(--s3); } }

/* site footer */
.pricing { padding-bottom: var(--s8); }
.site-foot { border-top: 1px solid var(--line); background: var(--sunken); font-family: var(--f-ui); padding: var(--s7) 0 var(--s6); margin-top: var(--s7); }
.sf-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--s6); }
.sf-brand p { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin: var(--s3) 0 0; }
.site-foot h4 { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text); margin-bottom: var(--s3); }
.site-foot nav a { display: block; font-size: var(--fs-sm); color: var(--text-muted); text-decoration: none; padding: 3px 0; }
.site-foot nav a:hover { color: var(--brand); text-decoration: underline; }
.sf-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3) var(--s6); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.6; color: var(--text-muted); }
.sf-legal p { margin: 0; } .sf-legal p:first-child { flex: 1 1 480px; }
@media (max-width: 860px) { .sf-grid { grid-template-columns: 1fr 1fr; } .sf-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .sf-grid { grid-template-columns: 1fr; } }
/* hero card: label above the title, so the title runs as one line */
.hero .phead { flex-direction: column; align-items: flex-start; gap: 2px; }

/* "What is inside": even cards take a soft tint of the rust accent so the cards alternate */
.tr-flip { background: color-mix(in srgb, var(--brand-bg) 75%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); }
.tr-flip .tr-sample { background: var(--surface); }
.tr-flip .tr-no { background: var(--surface); }

/* ---------------------------------------------------------------- navbar: A "simple bar" is the site header (chosen 2026-10-11); B and C kept for the options page */
.nv { background: var(--surface); border-bottom: 1px solid var(--line); font-family: var(--f-ui); position: relative; z-index: 20; }
.nv-row { display: flex; align-items: center; gap: var(--s5); height: 64px; padding: 0 var(--s5); }
.nv svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nv-links { display: flex; gap: var(--s5); font-size: var(--fs-sm); align-self: stretch; }
.nv-links a { display: flex; align-items: center; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nv-links a:hover { color: var(--text); } .nv-links a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--brand); }
.nv-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r); background: none; color: var(--text); cursor: pointer; }
.nv-ico:hover { background: var(--sunken); }
.nv-burger, .nv-phone-search, .nv-drawer, .nv-tabbar, .nv-paper .short { display: none; }
.nv-right { display: flex; align-items: center; gap: var(--s3); margin-left: auto; }
.si, .so { display: contents; } body.signed-out .si, body:not(.signed-out) .so { display: none; }
.nv-link { font-size: var(--fs-sm); font-weight: 600; color: var(--text); text-decoration: none; padding: 0 var(--s3); }
.nv-cta { min-height: 40px; }
.nv-pass { display: inline-flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.nv-pass i { width: 7px; height: 7px; border-radius: 50%; background: var(--correct); }
.nv-acct { position: relative; }
.nv-avbtn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 2px; border-radius: var(--r-pill); cursor: pointer; color: var(--text-muted); }
.nv-avbtn svg { width: 16px; height: 16px; }
.nv-av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-bg); color: var(--brand); font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .02em; }
.nv-av.lg { width: 40px; height: 40px; font-size: var(--fs-sm); }
.nv-menu { display: none; position: absolute; right: 0; top: calc(100% + 10px); width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); padding: var(--s2); z-index: 30; }
body.menu-open .nv-menu { display: block; }
.nv-who { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); } .nv-who b { display: block; font-size: var(--fs-sm); } .nv-who span:not(.nv-av) { font-size: var(--fs-xs); color: var(--text-muted); }
.nv-plan { background: var(--sunken); border-radius: var(--r); padding: var(--s2) var(--s3); margin: 0 0 var(--s2); font-size: var(--fs-xs); }
.nv-plan div { display: flex; align-items: baseline; gap: var(--s2); padding: 4px 0; } .nv-plan span { color: var(--text-muted); flex: 1; } .nv-plan a { color: var(--brand); font-weight: 600; }
.nv-menu > a { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s3); border-radius: var(--r); font-size: var(--fs-sm); color: var(--text); text-decoration: none; }
.nv-menu > a:hover { background: var(--sunken); } .nv-menu > a small { font-size: var(--fs-xs); color: var(--text-muted); }
.nv-menu > a.nv-out { border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); margin-top: var(--s1); color: var(--text-muted); }
kbd { font: 600 11px var(--f-ui); color: var(--text-muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: var(--surface); white-space: nowrap; }
/* A */
.nv-search { display: inline-flex; align-items: center; gap: var(--s2); height: 38px; padding: 0 var(--s2) 0 var(--s3); margin-left: auto; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); color: var(--text-muted); font: var(--fs-sm) var(--f-ui); cursor: pointer; min-width: 220px; }
.nv-search span { flex: 1; text-align: left; } .nv-a .nv-right { margin-left: 0; }
/* B */
.nv-paper { display: inline-flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); font-family: var(--f-ui); cursor: pointer; text-align: left; }
.nv-paper small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-right: var(--s1); }
.nv-paper b { font-size: var(--fs-sm); } .nv-paper svg { width: 16px; height: 16px; color: var(--text-muted); }
.nv-b .nv-links { margin-left: var(--s3); }
/* C */
.nv-bigsearch { flex: 1; max-width: 640px; display: flex; align-items: center; gap: var(--s3); height: 44px; padding: 0 var(--s3); margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); color: var(--text-muted); }
.nv-bigsearch input { flex: 1; min-width: 0; border: 0; background: none; font: var(--fs-sm) var(--f-ui); color: var(--text); outline: none; }
.nv-c .nv-right { margin-left: 0; }
.nv-sub { display: flex; align-items: stretch; justify-content: space-between; gap: var(--s5); height: 44px; padding: 0 var(--s5); border-top: 1px solid var(--line); }
.nv-ctx { align-self: center; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; } .nv-ctx b { color: var(--text); }
/* bottom tab bar (B and C on phones) */
.nv-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); font-family: var(--f-ui); }
.nv-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s2) 0; font-size: 11px; color: var(--text-muted); text-decoration: none; }
.nv-tabbar a.on { color: var(--brand); font-weight: 600; } .nv-tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nv-demo { padding-top: var(--s6); padding-bottom: 96px; } .nv-demo h1 { font-size: 2rem; margin: var(--s3) 0; } .nv-demo > p { font: var(--fs-base)/1.6 var(--f-ui); color: var(--text-muted); margin: 0 0 var(--s5); }
@media (max-width: 1100px) { .nv-links { gap: var(--s4); } .nv-search { min-width: 0; } .nv-search span, .nv-search kbd { display: none; } .nv-pass { display: none; } }
@media (max-width: 760px) {
  .nv-row { gap: var(--s2); padding: 0 var(--s3); height: 56px; }
  .nv-row > .nv-links, .nv-search, .nv-sub, .nv-cta { display: none; }
  .nv-burger, .nv-phone-search { display: inline-grid; } .nv-a .brand { margin-right: auto; } .nv-a .nv-phone-search { order: 5; } .nv-a .nv-right { order: 6; margin-left: 0; }
  body.drawer-open .nv-drawer { display: block; border-top: 1px solid var(--line); }
  .nv-drawer nav { display: flex; flex-direction: column; padding: var(--s2) var(--s3) var(--s3); } .nv-drawer a { padding: var(--s3); border-radius: var(--r); color: var(--text); text-decoration: none; font-size: var(--fs-base); } .nv-drawer a.on { background: var(--sunken); font-weight: 600; }
  .nv-tabbar { display: grid; }
  .nv-paper { height: 38px; } .nv-paper small, .nv-paper b:not(.short) { display: none; } .nv-paper .short { display: inline; }
  .nv-c .nv-row { flex-wrap: wrap; height: auto; padding: var(--s2) var(--s3) var(--s3); row-gap: var(--s2); } .nv-c .brand { margin-right: auto; }
  .nv-bigsearch { order: 9; flex-basis: 100%; max-width: none; height: 40px; } .nv-bigsearch kbd { display: none; }
  .nv-menu { position: fixed; left: var(--s3); right: var(--s3); top: 60px; width: auto; }
}
/* gallery */
.nvg-wrap { padding-top: var(--s7); padding-bottom: var(--s8); } .nvg-wrap > h1 { font-size: var(--fs-h1); margin-bottom: var(--s3); }
.nvg-lead { font: var(--fs-base)/1.65 var(--f-ui); color: var(--text-muted); margin: 0 0 var(--s7); }
.nvg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--s6); margin-bottom: var(--s6); font-family: var(--f-ui); }
.nvg header h2 { font-size: var(--fs-h2); margin-bottom: var(--s2); } .nvg header p { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin: 0 0 var(--s2); } .nvg-note { color: var(--text) !important; }
.nvg figure { margin: 0; } .nvg figcaption { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: var(--s2); }
.nvg-desk { margin: var(--s5) 0 0 !important; }
.nvg-scale { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.nvg-scale iframe { border: 0; transform-origin: 0 0; display: block; }
.nvg-phones { display: flex; flex-wrap: wrap; gap: var(--s6); margin-top: var(--s5); }
.nvg-phone { width: 312px; } .nvg-phone iframe { border: 1px solid var(--line); border-radius: 18px; width: 390px; height: 640px; transform: scale(.8); transform-origin: 0 0; margin-bottom: -128px; margin-right: -78px; display: block; background: var(--bg); }
.embed body { overflow: hidden; }

/* ---------------------------------------------------------------- answer header drafts */
.ah { container-type: inline-size; font-family: var(--f-ui); }
.ah svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ah h1 { font: 700 var(--fs-h1)/1.2 var(--f-ui); margin: 0; }
.ah-crumbs { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--s4); }
.ah-crumbs a { color: var(--text-muted); text-decoration: none; } .ah-crumbs a:hover { color: var(--brand); text-decoration: underline; }
.ah-kick { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: var(--s2); }
/* A */
.ah-a h1 { margin-bottom: var(--s4); }
.ah-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.ah-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) 0; font-size: var(--fs-sm); color: var(--text-muted); }
.ah-meta .chip { margin-right: var(--s3); }
.ah-meta > span:not(.chip):not(:last-child)::after { content: "·"; margin: 0 var(--s2); color: var(--text-muted); opacity: .6; }
.ah-meta b { color: var(--text); }
.ah-icons { display: flex; gap: var(--s1); }
.ah-ib { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.ah-ib:hover { background: var(--sunken); color: var(--text); } .ah-ib.on { background: var(--correct-bg); color: var(--correct); }
.ah-free { font-size: var(--fs-xs); color: var(--text-muted); margin: var(--s3) 0 0; }
/* B */
.ah-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ah-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5); padding: var(--s5); }
.ah-marks { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--sunken); }
.ah-marks b { font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; } .ah-marks span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }
.ah-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.ah-facts div { padding: var(--s3) var(--s5); border-left: 1px solid var(--line); } .ah-facts div:first-child { border-left: 0; }
.ah-facts dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; } .ah-facts dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.ah-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s5); border-top: 1px solid var(--line); background: var(--bg); }
.ah-seg { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ah-seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 var(--s3) 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: 600 var(--fs-sm) var(--f-ui); color: var(--text-muted); cursor: pointer; }
.ah-seg button:hover { color: var(--text); border-color: var(--text-muted); } .ah-seg button.on { background: var(--correct-bg); border-color: color-mix(in srgb, var(--correct) 45%, var(--line)); color: var(--correct); }
.ah-tag { font-size: var(--fs-xs); font-weight: 600; color: var(--correct); }
/* C */
.ah-split { display: flex; align-items: stretch; gap: var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.ah-main { flex: 1; min-width: 0; } .ah-sub { font-size: var(--fs-sm); color: var(--text-muted); margin: var(--s3) 0 0; }
.ah-sub b { color: var(--brand); } .ah-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: var(--s2); vertical-align: 1px; }
.ah-box { flex: none; display: flex; flex-direction: column; gap: var(--s2); width: 168px; padding: var(--s3); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ah-box .ah-marks { flex-direction: row; gap: var(--s2); align-items: baseline; background: none; padding: 0 var(--s2) var(--s2); border-bottom: 1px solid var(--line); border-radius: 0; justify-content: flex-start; }
.ah-text { display: flex; flex-direction: column; }
.ah-text button { display: flex; align-items: center; gap: var(--s2); height: 34px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: none; font: 600 var(--fs-sm) var(--f-ui); color: var(--text-muted); cursor: pointer; text-align: left; }
.ah-text button:hover { background: var(--sunken); color: var(--text); } .ah-text button.on { color: var(--correct); }
/* narrow (phone) layouts, by the header's own width */
@container (max-width: 520px) {
  .ah h1 { font-size: 1.45rem; }
  .ah-top, .ah-foot { padding-left: var(--s4); padding-right: var(--s4); } .ah-marks { min-width: 60px; } .ah-marks b { font-size: 1.5rem; }
  .ah-facts { grid-template-columns: 1fr 1fr; } .ah-facts div { padding: var(--s3) var(--s4); } .ah-facts div:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .ah-seg { width: 100%; } .ah-seg button { flex: 1; justify-content: center; padding: 0 var(--s2); }
  .ah-foot { padding: var(--s3) var(--s4); }
  .ah-split { flex-direction: column; gap: var(--s4); } .ah-box { width: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: var(--s2) var(--s3); }
  .ah-box .ah-marks { border-bottom: 0; padding: 0; } .ah-text { flex-direction: row; gap: var(--s1); } .ah-text button { width: 38px; justify-content: center; padding: 0; } .ah-text button span { display: none; }
}
/* gallery */
.ahg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--s6); margin-bottom: var(--s6); font-family: var(--f-ui); }
.ahg > header h2 { font-size: var(--fs-h2); margin-bottom: var(--s2); } .ahg > header p { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin: 0; }
.ahg-row { display: flex; flex-wrap: wrap; gap: var(--s6); align-items: flex-start; margin-top: var(--s5); }
.ahg figure { margin: 0; } .ahg figcaption { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: var(--s3); }
.ahg-desk { flex: 1 1 100%; max-width: 820px; background: var(--bg); padding: var(--s5); border-radius: var(--r); }
.ahg-phone { flex: 0 0 360px; max-width: 100%; background: var(--bg); padding: var(--s4); border-radius: 18px; border: 1px solid var(--line); }
.ahg-now .ahg-desk { max-width: 820px; }

/* answer page: the header card replaces the old title block */
.read > .ah { padding-top: var(--s6); margin-bottom: 0; } .read > .ah + .sec { margin-top: var(--s6); }

/* chapters list: weight in the exam (rust bar) beside the student's progress (green bar) */
.cx-list { list-style: none; margin: 0; padding: 0; } .cx-list[hidden] { display: none; }
.cx-key, .cx-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 180px 160px; gap: var(--s4); align-items: center; }
.cx-key { padding: 0 0 var(--s2); border-bottom: 1px solid var(--line); font: 600 var(--fs-xs) var(--f-ui); color: var(--text-muted); }
.cx-key span:first-child { grid-column: span 2; }
.cx-row { padding: var(--s3) 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-family: var(--f-ui); }
.cx-list li:last-child .cx-row { border-bottom: 0; } .cx-row:hover .cx-t b { color: var(--brand); }
.cx-no { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font: 700 var(--fs-xs) var(--f-ui); }
.cx-t b { display: block; font-size: var(--fs-sm); } .cx-t small, .cx-p small { font-size: var(--fs-xs); color: var(--text-muted); }
.cx-w, .cx-p { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cx-w b, .cx-p { font-size: var(--fs-sm); font-weight: 600; color: var(--text); } .cx-p small { margin-left: auto; font-weight: 400; }
.cx-w i, .cx-p i { flex-basis: 100%; height: 6px; margin-top: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--c) var(--w), var(--sunken) 0); }
.cx-w i { --c: var(--brand); } .cx-p i { --c: var(--correct); }
@media (max-width: 720px) { .cx-key { display: none; } .cx-row { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr); row-gap: var(--s2); }
  .cx-t { grid-column: 2 / -1; } .cx-w { grid-column: 2; } .cx-p { grid-column: 3; } .cx-no { grid-row: span 2; align-self: start; } }
@media (max-width: 520px) { .d-ch { flex-wrap: wrap; } .d-ch > .d-select { flex: 1 0 100%; } }
/* AI pass features: shown to pass holders (.if-pass); without a pass (data-pass="none", the draft bar switch)
   each stays visible as locked (.if-nopass), so students do not forget it exists */
/* states: yes (pass), none (never had one), ended (had one); .if-nopass covers none and ended */
:root:not([data-pass="yes"]) .if-pass, [data-pass="yes"] .if-nopass, :root:not([data-pass="none"]) .if-never, :root:not([data-pass="ended"]) .if-ended,
[data-pass="none"] .if-hadpass { display: none !important; }
svg.lock { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cx-lock { display: flex; flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); color: var(--text-muted); }
.cx-lock > span { display: inline-flex; align-items: center; gap: 4px; }
.cx-lock i { flex-basis: 100%; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--sunken); }
.cx-key span:last-child { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.cx-unlock { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); }
@media (max-width: 720px) { .cx-lock { grid-column: 3; } }
.nv-links a svg.lock { margin-left: 5px; color: var(--text-muted); }
.nv-get { color: var(--brand); } .nv-get svg.lock { width: 13px; height: 13px; }
.stat-lock { color: var(--text-muted); text-decoration: none; } .stat-lock > b { color: var(--brand); } .stat-lock > b svg.lock { width: 24px; height: 24px; }
.pass-gate { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: var(--r); background: var(--brand-bg); font-family: var(--f-ui); }
.pass-gate > div { flex: 1; min-width: 0; } .pass-gate b { display: block; } .pass-gate p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; }
.pg-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--brand); } .pg-ico svg.lock { width: 20px; height: 20px; }
.gated > .pass-gate { margin-bottom: var(--s5); }
:root:not([data-pass="yes"]) .gated > :not(.pass-gate):not(.d-head) { opacity: .45; filter: grayscale(1); pointer-events: none; user-select: none; }
.t-gate { margin: var(--s4); flex-direction: column; align-items: flex-start; }
@media (max-width: 720px) { .pass-gate { flex-wrap: wrap; } .pass-gate .btn { flex: 1 0 100%; } }
/* paper switcher: on one-paper pages only, as the page title or the first breadcrumb (the dashboard spans all papers) */
.pp { position: relative; display: inline-block; } .pp h1 { margin: 0; }
.pp-btn { font: inherit; color: inherit; background-color: transparent; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: .2em; text-align: left; }
.pp-btn svg { width: .75em; height: .75em; flex: none; fill: none; stroke: var(--text-muted); stroke-width: 2.5; stroke-linecap: round; }
.pp-btn:hover svg, .pp.open .pp-btn svg { stroke: var(--brand); }
.pp-crumb .pp-btn { margin-left: 2px; padding: 2px; border-radius: 4px; vertical-align: middle; } .pp-crumb .pp-btn svg { width: 14px; height: 14px; }
.pp-crumb .pp-btn:hover { background: var(--sunken); }
.pp-menu { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: max-content; max-width: min(340px, calc(100vw - 32px)); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgb(0 0 0 / .14); font: 400 var(--fs-sm)/1.4 var(--f-ui); letter-spacing: 0; text-transform: none; }
.pp.open .pp-menu { display: block; }
.pp-menu a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s5); padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.pp-menu a:hover { background: var(--sunken); } .pp-menu b { font-weight: 500; } .pp-menu a[aria-current] b { font-weight: 700; color: var(--brand); }
.pp-menu small { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
/* dashboard papers card */
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s7); }
@media (max-width: 720px) { .pl-list { grid-template-columns: minmax(0, 1fr); } }
.pl-list a { display: grid; grid-template-columns: minmax(0, 1fr) 90px 40px; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-family: var(--f-ui); }
.pl-list a:hover b { color: var(--brand); } .pl-t b { display: block; font-size: var(--fs-sm); } .pl-t small { font-size: var(--fs-xs); color: var(--text-muted); }
.pl-bar i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--correct) var(--w), var(--sunken) 0); }
.pl-pct { font-size: var(--fs-sm); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.pp h1 .pp-btn { display: inline; } .pp h1 .pp-btn svg { vertical-align: -.05em; margin-left: .15em; }
.pp-last { white-space: nowrap; }
.pp-filter { align-self: center; } .pp .pp-btn.d-select { display: block; font: 600 var(--fs-sm) var(--f-ui); padding: 0 38px 0 var(--s4); background-color: var(--bg); border: 1px solid var(--line); }
.pp-filter .pp-menu { left: auto; right: 0; }
@media (max-width: 520px) { .d-ch > .pp-filter { flex: 1 0 100%; } .pp .pp-btn.d-select { width: 100%; } .pp-filter .pp-menu { left: 0; right: 0; width: auto; max-width: none; } }
.d-ch > .pp-filter { flex: none; margin-left: auto; }
.dash > .d-card { margin-bottom: var(--s4); }
.d-more { align-self: flex-start; font-size: var(--fs-sm); font-weight: 600; }
.d-chap footer { margin-top: auto; }
/* study guide */
.gs-card { padding: 0 var(--s5); } .gs-glance { margin: 0; padding-top: 0; border-top: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gs-glance > div { padding-top: var(--s4); padding-bottom: var(--s4); }
.gs-list { list-style: none; margin: 0; padding: 0; }
.gs-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 120px; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.gs-list:first-child .gs-row:first-child { border-top: 0; }
.gs-rank { font: 600 var(--fs-xs) var(--f-ui); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.gs-t b { display: block; font-size: var(--fs-sm); } .gs-t small { font-size: var(--fs-xs); color: var(--text-muted); }
.gs-score { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; } .gs-score b { width: 32px; text-align: right; }
.gs-score i { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand) var(--w), var(--sunken) 0); }
.gs-more summary, .gp summary { cursor: pointer; } .gs-more summary { padding: var(--s3) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--brand); border-top: 1px solid var(--line); }
.gs-more[open] summary { padding-bottom: var(--s2); }
.gs-note { margin: 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-muted); }
.gp { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.gp summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); list-style: none; }
.gp summary::-webkit-details-marker { display: none; } .gp summary::after { content: "+"; font: 600 1.1rem var(--f-ui); color: var(--text-muted); } .gp[open] summary::after { content: "−"; }
.gp-body { padding: 0 var(--s4) var(--s4); font-size: var(--fs-sm); line-height: 1.6; } .gp-body p { margin: 0 0 var(--s2); } .gp-ev { color: var(--text-muted); }
.gp-body h4 { margin: var(--s4) 0 var(--s2); font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.gp-know { margin: 0; padding-left: 1.2em; } .gp-know li { margin-bottom: 4px; }
.gp-qs { display: flex; flex-wrap: wrap; gap: 6px; } .gp-qs a { padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-xs); color: var(--text); text-decoration: none; }
.gp-qs a:hover { border-color: var(--brand); color: var(--brand); } .gp-qs small { color: var(--text-muted); margin-left: 2px; }
.gr-blurb { margin: 0 0 var(--s2); font-size: var(--fs-sm); color: var(--text-muted); }
.gr-list { list-style: none; margin: 0; padding: 0; } .gr-list li { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.gr-chain { font: 500 var(--fs-xs) var(--f-ui); color: var(--brand); } .gr-list small { font-size: var(--fs-xs); color: var(--text-muted); }
.gr-more { margin: 0; padding-top: var(--s2); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-muted); }
.gt-list, .gk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); font-size: var(--fs-sm); }
.gt-list li { display: grid; grid-template-columns: minmax(0, 1fr) 80px 36px; align-items: center; gap: var(--s3); } .gt-list b { text-align: right; font-variant-numeric: tabular-nums; }
.gt-list i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand) var(--w), var(--sunken) 0); }
.gk-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); } .gk-list small { color: var(--text-muted); font-size: var(--fs-xs); }
@media (max-width: 720px) { .gs-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gs-row { grid-template-columns: 24px minmax(0, 1fr) auto; } .gs-score { grid-column: 2 / -1; } }
.gs-t small { display: block; line-height: 1.5; margin-top: 2px; } .gp summary .gs-t { flex: 1; min-width: 0; }
.gs-side { align-self: start; }   /* not sticky: the column (~1100px) is taller than most screens, so sticking cut off its lower cards */
@media (max-width: 1100px) { .gs-side { position: static; } }
@media (max-width: 720px) { .gs-glance > div { border-left: 0 !important; padding-left: 0 !important; } .gs-glance > div:last-child { grid-column: 1 / -1; } .gs-card { padding: 0 var(--s4); } }
/* dashboard cards that need no AI pass: Start here, Bookmarks */
.d-free { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--s4); }
.hl-list { list-style: none; margin: 0; padding: 0; } .hl-list li + li { border-top: 1px solid var(--line); }
.hl-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; color: inherit; text-decoration: none; } .hl-list a:hover b { color: var(--brand); }
@media (max-width: 720px) { .d-free { grid-template-columns: 1fr; } }

/* AI cards without the pass: greyed in place, with a lock badge as the card's first line */
:root:not([data-pass="yes"]) .ai-only > :not(.ai-row) { opacity: .4; filter: grayscale(1); user-select: none; }
.ai-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) 0;
  padding: var(--s2) var(--s5); background: var(--brand-bg); border-bottom: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: var(--r) var(--r) 0 0; }
.ai-ex { font: 600 var(--fs-xs) var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }   /* the greyed figures are sample data, not the student's */
.ai-lock { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-sm) var(--f-ui); color: var(--brand); text-decoration: none; }
.ai-lock:hover { text-decoration: underline; }
@media (max-width: 720px) { .ai-row { margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) 0; padding: var(--s2) var(--s4); } }
/* navbar: search is a link to the search page; the AI pass in the phone menu */
a.nv-search, a.nv-phone-search { text-decoration: none; } .nv-dpass { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); margin-top: var(--s2); }
/* search */
.sr-bar { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.sr-box { flex: 1; display: flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); }
.sr-box svg { width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.sr-box input { flex: 1; min-width: 0; border: 0; background: none; font: 500 1rem var(--f-ui); color: var(--text); outline: none; }
.sr-box kbd { font: 500 var(--fs-xs) var(--f-ui); color: var(--text-muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.sr-none { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.sr-why { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--brand); }
/* AI pass page */
.ps-days { display: flex; align-items: baseline; gap: var(--s2); } .ps-days b { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; } .ps-days span { color: var(--text-muted); font-size: var(--fs-sm); }
.ps-bar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--line-strong) var(--w), var(--correct) 0); }
.ps-use { margin-top: 0; } .ps-use small { font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
.ps-pay { margin: 0; display: grid; gap: var(--s2); font-size: var(--fs-sm); } .ps-pay div { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.ps-pay div:last-child { border-bottom: 0; padding-bottom: 0; } .ps-pay dt { color: var(--text-muted); } .ps-pay dd { margin: 0; font-weight: 600; text-align: right; }
.ps-list { margin: 0; padding-left: 1.2em; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); }
/* account: one narrow column of plain sections */
.ac { max-width: 760px; padding: var(--s7) var(--s5) var(--s8); font-family: var(--f-ui); }
.ac-who { display: flex; align-items: center; gap: var(--s4); padding-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.ac-who > div { flex: 1; min-width: 0; } .ac-who h1 { font-size: 1.6rem; margin: 0; } .ac-who p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.ac-sec { padding: var(--s6) 0; border-bottom: 1px solid var(--line); } .ac-sec:last-child { border-bottom: 0; }
.ac-sec h2 { margin: 0 0 var(--s4); font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ac-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.ac-plan { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: inherit; text-decoration: none; }
a.ac-plan:hover { border-color: var(--line-strong); } .ac-plan > div { flex: 1; min-width: 0; }
.ac-plan b, .ac-main b { display: block; font-size: var(--fs-sm); } .ac-plan small, .ac-main small { font-size: var(--fs-xs); color: var(--text-muted); }
.ac-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--line-strong); } .ac-dot.on { background: var(--correct); }
.ac-go { font-size: var(--fs-sm); font-weight: 600; color: var(--brand); white-space: nowrap; }
.ac-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ac-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); } .ac-row + .ac-row { border-top: 1px solid var(--line); }
.ac-main { flex: 1; min-width: 0; } .ac-amt { font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-btn { min-height: 36px; padding: 0 var(--s4); }
.ac-note { margin: var(--s3) 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-muted); }
.ac-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: 0; font-size: var(--fs-sm); } .ac-links a { font-weight: 600; }
@media (max-width: 560px) { .ac { padding: var(--s6) var(--s4) var(--s7); } .ac-plans { grid-template-columns: 1fr; } .ac-who { flex-wrap: wrap; } .ac-who .btn { flex: 1 0 100%; }
  .ac-pay { flex-wrap: wrap; row-gap: var(--s3); } .ac-pay .ac-main { flex-basis: 100%; } .ac-pay .ac-amt { margin-right: auto; } }
/* mock exams: today's marked tests as two dots (filled = still available), then totals */
.mk-today { padding: var(--s4); border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.mk-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); } .mk-head b { font-size: 1rem; }
.mk-today small { display: block; margin-top: var(--s1); font-size: var(--fs-xs); line-height: 1.5; color: var(--text-muted); }
.mk-dots { display: flex; gap: 5px; flex: none; } .mk-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.mk-dots i.used { background: none; border: 2px solid var(--line-strong); }
.mk-stats { grid-template-columns: repeat(2, 1fr); } .mk-stats small { font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
/* pass page: How it works and the FAQ stacked, so an opened answer never stretches a neighbour */
.pf-stack { display: flex; flex-direction: column; gap: var(--s4); } .pf-faq { display: flex; flex-direction: column; gap: var(--s2); }
/* saved */
/* saved: a group per chapter; each saved question is a row, its note a labelled box under it */
.sv-group { margin-top: var(--s6); } .sv-group:first-child { margin-top: var(--s4); }
.sv-group header { display: flex; align-items: baseline; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 2px solid var(--text); }
.sv-num { flex: none; font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.sv-group h3 { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-sm); } .sv-count { flex: none; font-size: var(--fs-xs); color: var(--text-muted); }
.sv-list { list-style: none; margin: 0; padding: 0; } .sv-item { padding: var(--s4) 0; } .sv-item + .sv-item { border-top: 1px solid var(--line); }
.sv-row { display: flex; align-items: center; gap: var(--s3); } .sv-row a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.sv-row a b { display: block; font-size: var(--fs-sm); } .sv-row a:hover b { color: var(--brand); } .sv-row small { font-size: var(--fs-xs); color: var(--text-muted); }
.sv-note { margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--sunken); }
.sv-note span { display: block; font: 700 11px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.sv-note p { margin: 2px 0 0; font: var(--fs-sm)/1.55 var(--f-read); }
.sv-x { width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.sv-x:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 720px) { .sr-bar { flex-wrap: wrap; } .sr-bar .pp-filter { flex: 1 0 100%; } }
.hl-list a > b { font-size: var(--fs-sm); }
.ac-main small, .ac-plan small { display: block; line-height: 1.5; margin-top: 2px; }
.nv-who b, .nv-who span:not(.nv-av) { display: block; line-height: 1.35; } .nv-who span:not(.nv-av) { margin-top: 1px; }
.nv-pass { line-height: 1; } .nv-pass svg.lock { display: block; margin-top: -2px; }   /* the lock's body sits low in its box; lift it to the text's middle */
/* example mode (?example=1 from the pass page): a pass holder's page under a banner; the navbar keeps the visitor's own no-pass state */
.ex-banner { display: none; background: var(--brand-bg); border-bottom: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); font: var(--fs-sm) var(--f-ui); }
[data-example] .ex-banner { display: block; }
.ex-banner .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-top: var(--s3); padding-bottom: var(--s3); }
.ex-banner .btn { min-height: 36px; flex: none; }
[data-example] .nv .if-pass { display: none !important; }
[data-example] .nv .nv-pass.if-nopass { display: inline-flex !important; } [data-example] .nv svg.lock.if-nopass { display: inline !important; }
[data-example] .nv .nv-plan .if-nopass { display: flex !important; }
@media (max-width: 720px) { .ex-banner .wrap { flex-wrap: wrap; } .ex-banner .btn { flex: 1 0 100%; } }
@media (max-width: 520px) { .d-ch > .pp-filter { flex: 1 0 100%; margin-left: 0; } }   /* after the desktop rule that pins filters right */

/* pass page: what the pass adds, one row per feature (icon, name + what it does, limit, example) */
.pf-card { margin-bottom: var(--s4); } .pf-list { list-style: none; margin: 0; padding: 0; }
.pf-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px auto; align-items: center; gap: var(--s5); padding: var(--s4) 0; }
.pf-row + .pf-row { border-top: 1px solid var(--line); }
.pf-what h3 { margin: 0 0 2px; font-size: 1rem; } .pf-what p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-muted); }
.pf-lim { font-size: var(--fs-sm); font-weight: 600; } .pf-ex { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) { .pf-row { grid-template-columns: auto minmax(0, 1fr); row-gap: var(--s2); align-items: start; }
  .pf-lim, .pf-ex { grid-column: 2; } .pf-lim { color: var(--text-muted); } }
/* the card's heading is a plain title over a rule, so it never reads as one more feature row */
.pf-head { padding-bottom: var(--s4); border-bottom: 1px solid var(--line); } .pf-head h2 { margin: 0; font: 700 1.3rem var(--f-ui); }
.pf-head p { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-muted); font-family: var(--f-ui); }
/* saved: each chapter boxed, its heading on a tinted strip */
.sv-group { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: var(--s4); }
.sv-group header { padding: var(--s3) var(--s4); background: var(--sunken); border-bottom: 1px solid var(--line); align-items: center; }
.sv-item { padding: var(--s4); }
@media (max-width: 560px) { .sv-group header { flex-wrap: wrap; row-gap: 2px; } .sv-group h3 { flex-basis: 100%; order: 3; } .sv-count { margin-left: auto; } .sv-item { padding: var(--s3); } }
/* the note is the student's own writing: a rust-tinted box with a rust rule, never the grey of the chapter strip */
.sv-note { background: var(--brand-bg); border-left: 3px solid var(--brand); border-radius: 0 var(--r) var(--r) 0; } .sv-note span { color: var(--brand); }
/* navbar search: a real box; live matches drop below it */
form.nv-search { position: relative; cursor: text; } .nv-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; outline: none; }
.nv-search input::placeholder { color: var(--text-muted); } .nv-search input::-webkit-search-cancel-button { display: none; }
.nv-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.nv-sclose { display: none; }
.nv-sugg { position: absolute; top: calc(100% + 6px); left: 0; width: max(100%, 420px); z-index: 60; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: 0 12px 32px rgb(0 0 0 / .12); }
.nv-sugg a { display: block; padding: var(--s2) var(--s3); border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.nv-sugg a:hover, .nv-sugg a.on { background: var(--sunken); } .nv-sugg b { display: block; font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.nv-sugg small { font-size: var(--fs-xs); color: var(--text-muted); } .nv-sugg mark, .hl-list mark { background: none; color: var(--brand); font-weight: 700; }
.nv-sugg .nv-all { margin-top: var(--s1); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); } .nv-sugg .nv-all b { color: var(--brand); }
.nv-empty { margin: 0; padding: var(--s2) var(--s3); font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 760px) {   /* phone: the 🔍 button opens the box over the bar */
  .nv.search-open form.nv-search { display: flex; position: absolute; inset: 9px var(--s3) auto; height: 38px; z-index: 70; min-width: 0; background: var(--surface); }
  .nv.search-open .nv-sclose { display: block; flex: none; border: 0; background: none; color: var(--brand); font: 600 var(--fs-sm) var(--f-ui); padding: 0 var(--s2); }
  .nv.search-open .nv-search kbd { display: none; } .nv-row { position: relative; } .nv-sugg { width: 100%; } }
.sr-count { margin: 0 0 var(--s2); font-size: var(--fs-xs); color: var(--text-muted); }
.sr-sample { margin: 0 0 var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--sunken); font-size: var(--fs-xs); color: var(--text-muted); }
/* draft only: a notice for links to pages this draft does not build */
.draft-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r); background: var(--text); color: var(--bg); font: 500 var(--fs-sm) var(--f-ui); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.draft-toast.on { opacity: 1; transform: translate(-50%, 0); }
/* account menu, review only: theme and AI pass state (replaces the old draft bar) */
.nv-review { margin-top: var(--s1); padding: var(--s3); border-top: 1px dashed var(--line-strong); display: grid; gap: var(--s2); }
.nv-rlabel { font: 700 11px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.nv-seg { display: flex; padding: 3px; border-radius: var(--r-pill); background: var(--sunken); }
.nv-seg a { flex: 1; padding: 5px 0; border-radius: var(--r-pill); text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-decoration: none; }
.nv-seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.nv-rall { font-size: var(--fs-xs); font-weight: 600; }
/* mock exam: confirm before finishing */
.fin { width: min(460px, calc(100% - 32px)); padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font-family: var(--f-ui); }
.fin::backdrop { background: rgb(0 0 0 / .45); } .fin h2 { margin: 0 0 var(--s2); font-size: 1.3rem; } .fin p { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-muted); }
.fin-list { margin: var(--s4) 0; padding: 0; list-style: none; display: grid; gap: var(--s2); font-size: var(--fs-sm); }
.fin-list li { padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--sunken); } .fin-list li.miss { background: var(--brand-bg); }
.fin-list li.miss::before { content: "! "; font-weight: 700; color: var(--brand); }
.fin-acts { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 480px) { .fin-acts .btn { flex: 1 0 100%; } }
/* result: the same gap above every "See the full answer" */
.fb > :nth-last-child(2) { margin-bottom: 0; } .fb > .btn { margin-top: var(--s4); }
/* guide topics: the rank sits on the title's line; the whole row opens the topic; more room before the tier */
.gs-row { position: relative; } .gs-row:hover .gs-go b { color: var(--brand); }
.gs-go { color: inherit; text-decoration: none; } .gs-go::after { content: ""; position: absolute; inset: 0; }
.gs-rank { align-self: start; font-size: var(--fs-sm); line-height: 1.5; } .gs-row .gs-t b { line-height: 1.5; }
.gp { scroll-margin-top: var(--s4); }
/* meta line: parts never split; each part carries its own · and the one starting a line is clipped off the left edge */
small.ml { display: block; overflow: hidden; } .ml > span { display: block; margin-left: -1.2em; }
.ml > span > span { display: inline-block; max-width: 100%; }   /* one unit; only a part longer than the line wraps inside itself */ .ml > span > span { position: relative; padding-left: 1.2em; } .ml > span > span::before { content: "·"; position: absolute; left: 0; width: 1.2em; text-align: center; }   /* the · hangs in the padding, so a wrapped part lines up with its own text */
.qrow .t .ml > span { display: block; margin-top: 2px; } .qrow .t .ml > span > span { display: inline-block; margin-top: 0; }   /* .qrow .t span would stack the parts */
.gs-row > .chip { margin-left: calc(var(--s7) + var(--s3)); }   /* with the row gap, 72px: twice the earlier 36px before the tier badge */
.gr-chain a { color: inherit; } .gr-chain a:hover { color: var(--brand); }
details:not([open]) > summary .if-open, details[open] > summary .if-closed { display: none; }   /* "Show N more" reads "Hide" once opened */
/* how topics are ranked (study guide, top) and the one-line pointer to it (chapter page) */
.tier-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--s4) 0; } .tc-C { border-top-color: var(--line); }
.tier-card strong { color: var(--text); font-weight: 600; } .tier-card > small { margin-top: auto; font: 600 var(--fs-xs) var(--f-ui); color: var(--text-muted); }
.gs-lead { margin: 0; font: var(--fs-base)/1.6 var(--f-read); }
#ranking .gs-note { margin: 0; } #ranking { scroll-margin-top: var(--s4); }
@media (max-width: 900px) { .tier-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tier-cards-4 { grid-template-columns: 1fr; } }
.tiers-line { margin: 0 0 var(--s7); font: var(--fs-sm)/1.6 var(--f-ui); color: var(--text-muted); } .tiers-line a { font-weight: 600; }
.fam-pack { font: 600 var(--fs-sm) var(--f-ui); white-space: nowrap; } .fam { scroll-margin-top: var(--s4); }
.gs-score b { width: 44px; flex: none; white-space: nowrap; }
.scroll, .tex-d, .f-text { position: relative; }   /* KaTeX's hidden MathML is position:absolute; this keeps it inside the scroll box instead of widening the page */
/* breadcrumb: one look on every page (crumbs() in build_drafts.py) */
nav.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s2); font: var(--fs-sm)/1.5 var(--f-ui); color: var(--text-muted); }
nav.crumbs a { color: var(--text-muted); text-decoration: none; } nav.crumbs a:hover { color: var(--brand); text-decoration: underline; }
nav.crumbs [aria-current] { color: var(--text); } .ah nav.crumbs { padding: 0; margin-bottom: var(--s4); }
/* a control named in text, drawn like the control */
.ui-ref { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: 600 .82em/1.7 var(--f-ui); white-space: nowrap; vertical-align: .05em; }
.ui-ref svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ui-ref { padding: 0; border: 0; background: none; gap: 3px; font-weight: 600; line-height: inherit; vertical-align: baseline; } .ui-ref svg { width: 13px; height: 13px; align-self: center; }   /* icon + name, no box: a box was taller than the line */
.ui-ref { display: inline; font: inherit; font-weight: 600; } .ui-ref svg { display: inline; vertical-align: -.12em; margin-right: 3px; width: .95em; height: .95em; }   /* sits on the text's baseline like a letter */
/* dashboard: where you're losing marks (marks kept in green, lost in rust; the reasons; the question that fixes it) */
.d-seg i.x { background: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.d-why { margin: 0; padding-left: 1.1em; font-size: var(--fs-sm); line-height: 1.5; color: var(--text); display: grid; gap: 4px; } .d-why li::marker { color: var(--brand); }
.d-histh { margin-bottom: var(--s1); } .d-hist small { margin-left: 4px; font-size: var(--fs-xs); color: var(--text-muted); } .d-mockbtn { margin-top: auto; }
.d-hist li > span:first-child { color: var(--text); } .d-hist li > span:first-child small { color: var(--text-muted); }
/* dashboard papers: tiles grouped by exam group (I: 3 papers, II: 4) */
.pt-groups { display: grid; grid-template-columns: 3fr 4fr; gap: var(--s5); } .pt-group .pkind { margin-bottom: var(--s2); }
.pt-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.pt { display: flex; flex-direction: column; gap: var(--s2); height: 100%; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: inherit; text-decoration: none; font-family: var(--f-ui); }
.pt:hover { border-color: var(--line-strong); } .pt:hover b { color: var(--brand); }
.pt header { display: flex; justify-content: space-between; align-items: center; }
.pt-code { padding: 2px 8px; border-radius: var(--r-sm); background: var(--brand-bg); color: var(--brand); font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .04em; }
.pt-pct { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt b { font-size: var(--fs-sm); line-height: 1.35; flex: 1; } .pt .d-seg i { height: 8px; } .pt .ml { color: var(--text-muted); font-size: var(--fs-xs); }
@media (max-width: 1100px) { .pt-groups { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .pt-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt b { flex: none; min-height: calc(1.35em * 3); }   /* names wrap to 1-3 lines; equal room keeps every bar on one line across both groups */
.pt-groups { grid-template-columns: 1fr; gap: var(--s4); }   /* each exam group on its own row, its tiles sharing the width */
.pt b { min-height: calc(1.35em * 2); }
@media (min-width: 521px) { .pt-list { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; } }
@media (max-width: 760px) { .pt-list { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* compact tile: code, name and % on one line, then the bar and counts; no reserved blank lines */
.pt { gap: var(--s3); } .pt header { align-items: flex-start; gap: var(--s2); } .pt header b { flex: 1; min-height: 0; padding-top: 1px; }
.pt-code { flex: none; } .pt-pct { flex: none; line-height: 1.2; } .pt .d-seg { margin-top: auto; }
.pt header { align-items: baseline; } .pt-code { padding: 1px 6px; } .pt .d-seg { margin-top: auto; } .pt .d-seg i { height: 8px; }
/* pass page: how the pass works, as a timeline of one pass */
.pw-track { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); font-family: var(--f-ui); }
.pw-track li { position: relative; padding-top: var(--s6); display: flex; flex-direction: column; gap: 4px; }
.pw-track li::before { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); box-sizing: border-box; }
.pw-track li::after { content: ""; position: absolute; left: 18px; right: calc(-1 * var(--s5) + 4px); top: 10px; height: 2px; background: var(--line); }
.pw-track li:first-child::before { background: var(--brand); } .pw-track li:last-child::after { display: none; }
.pw-when { font: 700 var(--fs-xs) var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.pw-track b { font-size: 1rem; } .pw-track p { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-muted); }
.pw-foot { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 0; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--sunken); font: var(--fs-sm) var(--f-ui); color: var(--text-muted); }
.pw-foot svg.lock { flex: none; width: 14px; height: 14px; color: var(--brand); }
@media (max-width: 760px) { .pw-track { grid-template-columns: 1fr; gap: var(--s4); }
  .pw-track li { padding: 0 0 0 var(--s6); } .pw-track li::after { left: 6px; right: auto; top: 22px; bottom: calc(-1 * var(--s4) + 4px); width: 2px; height: auto; } }
/* centred steps: dot above the middle of each step, the line running dot to dot */
@media (min-width: 761px) {
  .pw-track li { align-items: center; text-align: center; }
  .pw-track li::before { left: 50%; transform: translateX(-50%); }
  .pw-track li::after { left: calc(50% + 11px); right: calc(-50% - var(--s5) + 11px); }
  .pw-foot { justify-content: center; } }
@media (min-width: 761px) { .pw-track li { align-items: flex-start; text-align: left; } .pw-foot { justify-content: flex-start; } }   /* text left as before; the dots and line stay centred */
@media (min-width: 761px) { .pw-track .pw-when { align-self: center; } }   /* the step label stays under its dot */
/* pass timeline as boxed steps: one box per step, a short line joining neighbours (replaces the dot track) */
.pw-track { gap: var(--s4); }
.pw-track li, .pw-track li:first-child { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); align-items: flex-start; text-align: left; }
.pw-track li::before { display: none; }
.pw-track .pw-when { align-self: flex-start; }
.pw-track li::after { left: 100%; right: auto; top: 50%; width: var(--s4); height: 2px; bottom: auto; }
@media (max-width: 760px) { .pw-track li::after { left: var(--s5); top: 100%; width: 2px; height: var(--s4); } }
/* page title + its one rust button: button always on the right, level with the last line of the title block; below it on phones */
.d-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.d-head > div:first-child { max-width: 68ch; } .d-head > .cta { justify-self: end; }
@media (max-width: 720px) { .d-head { grid-template-columns: 1fr; } .d-head > .cta { justify-self: start; } }
.nv-menu > a.nv-out { border-radius: 0; }   /* For review sits below Sign out now */
/* upload thumbnails: the photo fills the tile (cropped to 3:4), page label on a solid strip so it reads on any photo */
.thumb { position: relative; overflow: hidden; padding: 0; background: var(--sunken); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; background: rgb(0 0 0 / .6); color: #fff; font: 600 var(--fs-xs) var(--f-ui); }
/* signed out (For review switch, or arriving from the landing page): navbar shows Sign in; account-only pages show a sign-in card */
:root[data-auth="out"] .si, :root:not([data-auth="out"]) body:not(.signed-out) .so { display: none; }
:root[data-auth="out"] .so { display: contents; }
:root[data-auth="out"] .si-only, :root[data-auth="out"] .cx-p, :root[data-auth="out"] .cx-key span:last-child { display: none; }
:root[data-auth="out"] .cx-key, :root[data-auth="out"] .cx-row { grid-template-columns: 32px minmax(0, 1fr) 180px; }
:root[data-auth="out"] .stats:has(.si-only) { grid-template-columns: repeat(3, 1fr); }
.so-gate { display: none; }
:root[data-auth="out"] body.needs-account > .so-gate { display: block; padding: var(--s7) var(--s4); }
:root[data-auth="out"] body.needs-account > :not(header):not(.so-gate):not(.site-foot):not(script):not(dialog) { display: none; }
.gate-card { max-width: 560px; margin: 0 auto; padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: center; }
.gate-card h1 { font-size: var(--fs-h2, 1.6rem); margin: 0 0 var(--s3); } .gate-card > p { font: var(--fs-base)/1.6 var(--f-read); color: var(--text-muted); margin: 0 0 var(--s5); }
.gate-card .cta { justify-content: center; } .gate-card .fine { margin: var(--s5) 0 0; }
:root[data-auth="out"] .qrow .tick { visibility: hidden; }   /* done ticks are yours; signed out there are none */
.fin > p + .fin-acts { margin-top: var(--s5); }   /* sign-in popup: text straight above the buttons */
/* study plan: why each task is there; Edit shows remove buttons, add and reset */
.d-plan small.d-whyline { margin-top: 2px; color: var(--brand); }
.d-edit { padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 600 var(--fs-sm) var(--f-ui); cursor: pointer; }
.d-edit[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.d-rm { display: none; width: 28px; height: 28px; flex: none; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--text-muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.d-rm:hover { color: var(--brand); border-color: var(--brand); }
.d-plan.editing .d-rm { display: grid; place-items: center; } .d-plan.editing .st-done, .d-plan.editing .st-todo { display: none; }
.d-planbar { display: none; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0 var(--s2); border-top: 1px solid var(--line); font: 600 var(--fs-sm) var(--f-ui); }
.d-plan.editing .d-planbar { display: flex; }
.d-planbar button { padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; text-decoration: underline; cursor: pointer; }
.d-plan li[hidden] { display: none; }
