/* Forest theme: soft sage paper, deep green ink, forest-green brand, fox-amber accent, a characterful serif for headlines, a plain sans for UI, and a book serif for passages */
:root {
  --bg: #f5f7f2; --surface: #ffffff; --surface-2: #ecf1e8; --ink: #14231a; --ink-2: #33463a; --muted: #647368; --line: #e0e7dc; --line-strong: #c9d4c3;
  --brand: #1f6b47; --brand-2: #155236; --brand-ink: #ffffff; --brand-soft: #e1efe6;
  --accent: #f2b33d; --good: #2f7d4f; --good-soft: #e2f1e5; --bad: #b42318; --bad-soft: #fbe4e0; --mid: #9a6200; --mid-soft: #fbefd6;
  --lilac: #e9eef8; --peach: #fdf0d8;
  --hard: rgba(20, 35, 26, .12); --shadow: 0 1px 0 rgba(20, 35, 26, .05); --shadow-sm: 0 1px 0 rgba(20, 35, 26, .05);
  --shadow-lg: 0 2px 0 var(--line-strong), 0 10px 28px rgba(20, 35, 26, .07);
  --radius: 10px; --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --display: 'Fraunces', Georgia, serif; --serif: 'Source Serif 4', Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f0c; --surface: #121a15; --surface-2: #19231d; --ink: #e8efe9; --ink-2: #c2cfc6; --muted: #8a998e; --line: #212d25; --line-strong: #2f3f34;
    --brand: #5fcf94; --brand-2: #86dcae; --brand-ink: #08140d; --brand-soft: #1a3326;
    --accent: #8a6514; --good: #6fcf8f; --good-soft: #183020; --bad: #ff8f80; --bad-soft: #3d1d18; --mid: #f0b456; --mid-soft: #3a2a10;
    --lilac: #232a3a; --peach: #3a2e14;
    --hard: rgba(0, 0, 0, .5); --shadow: 0 1px 0 rgba(0, 0, 0, .3); --shadow-sm: 0 1px 0 rgba(0, 0, 0, .25); --shadow-lg: 0 2px 0 var(--line-strong), 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f0c; --surface: #121a15; --surface-2: #19231d; --ink: #e8efe9; --ink-2: #c2cfc6; --muted: #8a998e; --line: #212d25; --line-strong: #2f3f34;
  --brand: #5fcf94; --brand-2: #86dcae; --brand-ink: #08140d; --brand-soft: #1a3326;
  --accent: #8a6514; --good: #6fcf8f; --good-soft: #183020; --bad: #ff8f80; --bad-soft: #3d1d18; --mid: #f0b456; --mid-soft: #3a2a10;
  --lilac: #232a3a; --peach: #3a2e14;
  --hard: rgba(0, 0, 0, .5); --shadow: 0 1px 0 rgba(0, 0, 0, .3); --shadow-sm: 0 1px 0 rgba(0, 0, 0, .25); --shadow-lg: 0 2px 0 var(--line-strong), 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; min-height: 100vh; display: flex; flex-direction: column; }
#main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; margin: .3em 0 .3em; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin: .2em 0 .4em; }
.h3 { font-size: 1.1rem; margin: 0 0 .8rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .5rem; }
p { margin: .4em 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; } .mono { font-family: ui-monospace, Menlo, monospace; }
.hidden { display: none !important; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .75rem; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; }
label { display: block; font-weight: 600; font-size: .9rem; }
label > input, label > select, label > textarea { margin-top: .35rem; font-weight: 400; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; font-size: .85em; background: var(--surface-2); }

/* ---------- layout ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.page.narrow { max-width: 640px; } .page.narrow-wide { max-width: 860px; }
.center-page { text-align: center; padding-top: 4rem; }
.row { display: flex; align-items: center; } .row.gap { gap: .6rem; } .gap { gap: .6rem; } .row.wrap, .wrap { flex-wrap: wrap; }
.between { justify-content: space-between; } .end { justify-content: flex-end; } .row.center { justify-content: center; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.stack > .card { margin-bottom: 0; }
.card.flush { padding: 0; overflow: auto; }
.card.hover { transition: transform .15s, box-shadow .15s, border-color .15s; color: inherit; }
.card.hover:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.banner { background: var(--brand-soft); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: .5rem 0 1rem; }
.banner.accent { background: var(--mid-soft); }
.empty { text-align: center; padding: 2.5rem 1rem; } .empty.slim { padding: 1.2rem; }
.big-emoji { font-size: 3rem; }
.note { font-size: .8rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; }
.warnline { color: var(--mid); font-weight: 600; }
.section-title { text-align: center; margin: 2.8rem 0 1.2rem; } .section-title.left { text-align: left; margin: 2rem 0 .8rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .95rem; padding: .6rem 1.05rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: var(--brand); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); } .btn.danger:hover { border-color: var(--bad); } .btn.danger.primary { background: var(--bad); color: #fff; }
.btn.lg { padding: .8rem 1.4rem; font-size: 1.02rem; } .btn.sm { padding: .4rem .8rem; font-size: .88rem; } .btn.xs { padding: .2rem .6rem; font-size: .8rem; border-radius: 8px; }
.btn.block { width: 100%; } .btn.dashed { border-style: dashed; margin: 1rem 0; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; font-weight: 600; } .link.sm { font-size: .85rem; }
.icon-btn { background: none; border: 0; color: var(--ink-2); cursor: pointer; font-size: 1.1rem; width: 2.2rem; height: 2.2rem; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.pill { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: .35rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.pill.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); } .pill.sm { padding: .15rem .6rem; font-size: .78rem; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: .9rem; padding: .45rem .9rem; border-radius: 8px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.full { display: flex; } .seg.full button { flex: 1; } .seg.sm button { padding: .3rem .65rem; font-size: .82rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1.5px solid var(--line); margin: 1rem 0 1.2rem; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: .7rem 1rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.tag.subtle { background: var(--surface-2); color: var(--muted); } .tag.good { background: var(--good-soft); color: var(--good); } .tag.mid { background: var(--mid-soft); color: var(--mid); }
.ok { color: var(--good); font-weight: 700; } .bad { color: var(--bad); font-weight: 700; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1160px; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: 1.2rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; text-decoration: none !important; }
.brand-fox { color: #f9a825; }
.logo { width: 34px; height: 34px; flex: none; }
.logo-shadow { fill: var(--hard); }
.links { display: flex; gap: .2rem; flex: 1; }
.links a { white-space: nowrap; color: var(--ink-2); font-weight: 600; font-size: .93rem; padding: .45rem .7rem; border-radius: 8px; text-decoration: none; }
.links a:hover { background: var(--surface-2); } .links a.active { color: var(--brand); background: var(--brand-soft); }
.nav-right { display: flex; align-items: center; gap: .5rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; text-decoration: none !important; }
.menu-btn { display: none; }

/* ---------- questions (shared) ---------- */
.passage, .tr-passage { font-family: var(--serif); font-size: 1.06rem; line-height: 1.7; }
.passage { background: var(--surface-2); border-radius: 10px; padding: .9rem 1rem; margin: .6rem 0; }
.stem { font-size: 1.02rem; margin: .8rem 0; }
.eq { text-align: center; margin: .8rem 0; font-size: 1.08rem; }
.blank { letter-spacing: .05em; }
.choices { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-direction: column; gap: .6rem; }
.choices li { display: flex; align-items: stretch; gap: .5rem; }
.choice { flex: 1; display: flex; align-items: center; gap: .8rem; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: .7rem .9rem; cursor: pointer; transition: border-color .12s, background .12s; }
.choice:hover:not(:disabled) { border-color: var(--brand); }
.letter { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1.5px solid var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; font-family: var(--font); }
.choices li.sel .choice { border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.choices li.sel .letter { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.choices li.struck .ctext, .choices li.struck .letter { text-decoration: line-through; opacity: .45; }
.choices li.correct .choice, .choices.static li.correct { border-color: var(--good); background: var(--good-soft); }
.choices li.correct .letter { background: var(--good); border-color: var(--good); color: #fff; }
.choices li.wrong .choice, .choices.static li.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choices.static li { border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .8rem; align-items: center; gap: .8rem; }
.choices.static li .ok, .choices.static li .bad { margin-left: auto; font-size: .8rem; }
.strike { flex: none; width: 3.2rem; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.feedback { border-radius: 10px; padding: .8rem 1rem; margin: .8rem 0; background: var(--surface-2); border-left: 4px solid var(--brand); }
.feedback.ok { background: var(--good-soft); border-color: var(--good); } .feedback.bad { background: var(--bad-soft); border-color: var(--bad); }
.feedback.ok > b { color: var(--good); } .feedback.bad > b { color: var(--bad); }
.expl { margin-top: .5rem; color: var(--ink-2); }
.qtags { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; } .qtags.tight { margin: -.2rem 0 .3rem; }
.diff { font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.diff.d1 { color: var(--good); } .diff.d2 { color: var(--mid); } .diff.d3 { color: var(--bad); }
.spr { margin: 1rem 0; } .spr-input { max-width: 220px; font-size: 1.2rem; font-weight: 600; letter-spacing: .04em; border-width: 2px; }
.spr-preview { margin-top: .4rem; color: var(--muted); font-size: .9rem; }
.spr-help { font-size: .88rem; color: var(--ink-2); margin: .4rem 0; } .spr-help summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.spr-review { display: grid; gap: .3rem; margin: .6rem 0; }
table.data { border-collapse: collapse; margin: .8rem auto; font-family: var(--font); font-size: .9rem; }
table.data caption { font-weight: 700; margin-bottom: .3rem; font-size: .85rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: .35rem .7rem; text-align: center; }
table.data thead th { background: var(--surface-2); }
.notes { margin: .4rem 0; } .notes li { margin: .25rem 0; }
.pass-head { font-family: var(--font); font-size: .9rem; }
.pnum { font-family: var(--font); font-size: .7rem; color: var(--muted); margin-right: .5rem; vertical-align: super; }
u.ul { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tex-fallback { font-family: ui-monospace, monospace; }

/* figures */
.fig { margin: .8rem auto; text-align: center; max-width: 480px; } .fig.fig-sm { max-width: 300px; }
.fig svg { width: 100%; height: auto; overflow: visible; }
.fig figcaption { font-size: .8rem; font-weight: 700; font-family: var(--font); } .fig-note { font-weight: 400 !important; color: var(--muted); }
.fig-grid { stroke: var(--line); stroke-width: 1; } .fig-axis { stroke: var(--ink-2); stroke-width: 1.5; fill: none; }
.fig-tick { fill: var(--muted); font: 11px var(--font); } .fig-label { fill: var(--ink); font: 600 12.5px var(--font); }
.fig-pt { fill: var(--brand); } .fig-fit { stroke: var(--bad); stroke-width: 2; }
.fig-shape { fill: var(--brand-soft); stroke: var(--ink); stroke-width: 1.8; }
.fig-series { fill: none; stroke-width: 2; } .fig-mk { stroke: none; }
.s0 .fig-mk, .fig-series.s0 { stroke: var(--brand); fill: var(--brand); } .fig-series.s0 { fill: none; }
.s1 .fig-mk { fill: var(--mid); } .fig-series.s1 { stroke: var(--mid); stroke-dasharray: 6 4; }
.s2 .fig-mk { fill: var(--good); } .fig-series.s2 { stroke: var(--good); stroke-dasharray: 2 3; }
.s3 .fig-mk { fill: var(--bad); } .fig-series.s3 { stroke: var(--bad); }

/* ---------- test runner (test-day style) ---------- */
body.testing .nav, body.testing .site-foot { display: none; }
body.testing { overflow: hidden; }
.tr { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--surface); z-index: 40; }
.tr-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .6rem 1.2rem; gap: 1rem; background: var(--surface); }
.tr-title { font-weight: 700; font-size: .98rem; }
.tr-mid { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.tr-timer { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; } .tr-timer.warn { color: var(--bad); }
.tr-right { display: flex; justify-content: flex-end; gap: .3rem; }
.tool { background: none; border: 0; font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: .2rem .55rem; border-radius: 8px; }
.tool span { font-size: 1.15rem; } .tool:hover { background: var(--surface-2); } .tool.on { background: var(--brand-soft); color: var(--brand); }
.tr-rule { height: 0; }
.tr-body { flex: 1; overflow: hidden; display: flex; }
.tr-body.split > .tr-passage, .tr-body.split > .tr-q { flex: 1; overflow: auto; padding: 1.6rem 2rem 3rem; }
.tr-body.single > .tr-q, .tr-body.single > .check { flex: 1; overflow: auto; padding: 1.6rem max(1rem, calc(50% - 380px)) 3rem; }
.tr-divider { width: 6px; background: var(--surface-2); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.tr-passage.hl-mode { cursor: text; } .tr-passage ::selection { background: var(--accent); color: #111; }
mark.hl { background: var(--accent); color: #111; border-radius: 2px; cursor: pointer; }
.tr-qhead { display: flex; align-items: center; gap: .6rem; background: var(--surface-2); border-radius: 8px; padding: .3rem .4rem; border-bottom: 2px dashed var(--line); }
.qnum { background: var(--ink); color: var(--surface); font-weight: 700; min-width: 1.9rem; height: 1.9rem; border-radius: 6px; display: grid; place-items: center; }
.markrev { background: none; border: 0; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.markrev.on { color: var(--bad); }
.abc { border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; padding: .15rem .4rem; color: var(--ink-2); }
.abc.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tr-bottom { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .6rem 1.2rem; border-top: 2px dashed var(--line); background: var(--surface); }
.tr-user { font-weight: 600; color: var(--ink-2); font-size: .9rem; }
.tr-navbtn { background: var(--ink); color: var(--surface); border: 0; border-radius: 8px; padding: .5rem 1rem; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.tr-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.navpop { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(560px, 94vw); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); padding: 1rem; z-index: 5; }
.navpop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); justify-content: center; margin-bottom: .8rem; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: .3rem; }
.lgd { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1.5px dashed var(--ink-2); }
.lgd.cur { border: 0; background: none; } .lgd.cur::before { content: '📍'; font-size: 12px; font-style: normal; }
.lgd.mk { border: 0; background: var(--bad); }
.navgrid { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; margin-bottom: 1rem; }
.nb { width: 2.3rem; height: 2.3rem; border: 1.5px dashed var(--ink-2); background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; border-radius: 4px; position: relative; }
.nb.ans { background: var(--brand); color: var(--brand-ink); border: 1.5px solid var(--brand); }
.nb.mk::after { content: ''; position: absolute; top: -5px; right: -5px; width: 11px; height: 11px; background: var(--bad); border-radius: 2px 2px 0 50%; }
.nb.cur { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.navgrid.big .nb { width: 2.8rem; height: 2.8rem; }
.check { text-align: center; } .check .card { max-width: 640px; margin: 1rem auto; }
.break-screen { position: fixed; inset: 0; background: #11131c; color: #fff; display: grid; place-items: center; padding: 1rem; }
.break-card { text-align: center; max-width: 520px; }
.break-label { color: #aab; } .break-time { font-size: 4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: .5rem 0 1rem; }
.break-tips { margin-top: 2rem; color: #ccd; text-align: left; background: #1c1f2d; border-radius: 12px; padding: 1rem 1.2rem; }

/* calculator */
.calc-float { position: fixed; top: 80px; right: 20px; width: 420px; height: 560px; min-width: 300px; min-height: 320px; max-width: 96vw; max-height: 88vh; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 50px rgba(0, 0, 0, .25); z-index: 60; display: flex; flex-direction: column; resize: both; overflow: hidden; }
.calc-float.wide { width: 820px; height: 640px; }
.calc-head { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; background: var(--ink); color: var(--surface); cursor: move; user-select: none; }
.calc-head .icon-btn { color: var(--surface); } .calc-head .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.calc-head .seg { background: rgba(255, 255, 255, .12); } .calc-head .seg button { color: #cfd2e0; } .calc-head .seg button.on { background: var(--surface); color: var(--ink); }
.grip { opacity: .6; letter-spacing: -2px; }
.calc-body { flex: 1; position: relative; }
.calc-host { position: absolute; inset: 0; }
.calc-loading { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 1rem; text-align: center; }
.calc-full { height: min(72vh, 720px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 12, 22, .5); display: grid; place-items: center; z-index: 100; padding: 1rem; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; position: sticky; top: 0; background: var(--surface); }
.modal-head h3 { margin: 0; }
.modal-body { padding: .4rem 1.2rem 1.3rem; }
.modal-body textarea { font-family: ui-monospace, monospace; font-size: .85rem; }
.bullets li { margin: .3rem 0; }
.kbd-list { list-style: none; padding: 0; } .kbd-list li { margin: .5rem 0; }
@keyframes fade { from { opacity: 0; } }

/* reference sheet */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: .8rem; }
.ref-cell { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; }
.ref-svg { width: 100%; max-width: 140px; height: auto; } .ref-svg circle:not(.fig-shape) { fill: var(--ink); }
.ref-facts { color: var(--ink-2); font-size: .92rem; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: .7rem; }
.fcell { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; }
.fname { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fmath { margin: .35rem 0; font-size: 1.02rem; overflow-x: auto; }

/* toasts */
#toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: .65rem 1.1rem; border-radius: 10px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 75vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth { width: min(420px, 100%); } .auth h1 { text-align: center; font-size: 1.6rem; }
.auth-logo { display: flex; justify-content: center; } .auth-logo .logo { width: 56px; height: 56px; }
.welcome fieldset { border: 0; padding: 0; margin: 0; } .welcome legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.goals { display: flex; flex-wrap: wrap; gap: .45rem; }
.goal { display: inline-flex !important; align-items: center; gap: .4rem; padding: .4rem .75rem; border: 1px solid var(--line-strong); border-radius: 6px; font-size: .9rem; cursor: pointer; font-weight: 500 !important; }
.goal:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.goal input { accent-color: var(--brand); margin: 0; width: auto; }
.consents { border-top: 1px solid var(--line); padding-top: .8rem; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--ink-2); margin: .4rem 0 .8rem; cursor: pointer; }
.consent input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; flex: none; accent-color: var(--brand); }
.form-err { color: var(--bad); font-size: .9rem; min-height: 1.2em; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0; }
.kpi { margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.kpi-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-val { font-size: 2.1rem; line-height: 1.1; letter-spacing: -.02em; }
.spark { width: 100%; height: 44px; margin-top: .3rem; } .spark path { fill: none; stroke: var(--brand); stroke-width: 2.5; } .spark circle { fill: var(--brand); }
.week { display: flex; gap: .3rem; align-items: flex-end; height: 58px; margin-top: .3rem; }
.wk { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.wk i { width: 100%; max-width: 18px; border-radius: 4px; background: var(--surface-2); } .wk i.on { background: var(--good); }
.wk span { font-size: .65rem; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
.mastery { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; margin: .55rem 0; }
.mastery .m-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .92rem; font-weight: 600; grid-column: 1; }
.mastery .bar { grid-column: 1; } .mastery .btn { grid-column: 2; grid-row: 1 / span 2; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar.thin { height: 5px; margin-top: .6rem; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.bar i.good { background: var(--good); } .bar i.mid { background: var(--mid); } .bar i.low { background: var(--bad); }
.weak { list-style: none; padding: 0; margin: 0 0 1rem; } .weak li { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.weak li div { display: flex; flex-direction: column; }
.attempts { list-style: none; padding: 0; margin: 0; } .attempts a { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); color: inherit; }
.attempts a span:first-child { display: flex; flex-direction: column; }
.score-pill { background: var(--brand-soft); color: var(--brand); font-weight: 800; border-radius: 8px; padding: .2rem .6rem; }

/* ---------- practice ---------- */
.bank { display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; align-items: start; }
.sticky { position: sticky; top: 76px; }
.dom { margin: 0; } .dom.dim { opacity: .65; }
.dom-head { display: flex; align-items: center; gap: .6rem; cursor: pointer; } .dom-head .muted { margin-left: auto; font-weight: 500; }
.skills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.skill { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .86rem; border: 1.5px solid var(--line); border-radius: 99px; padding: .3rem .75rem; cursor: pointer; background: var(--surface); }
.skill:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.skill .acc { font-size: .72rem; font-weight: 700; color: var(--muted); }
.radio { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; margin: .5rem 0; cursor: pointer; } .radio input { margin-top: .3rem; }
.mistake summary { display: flex; justify-content: space-between; cursor: pointer; gap: 1rem; } .mbody { margin-top: .8rem; }

/* ---------- exams + results ---------- */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 1rem; }
.exam { margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.exam-top { display: flex; justify-content: space-between; align-items: center; }
.mods { list-style: none; padding: 0; margin: .3rem 0; font-size: .86rem; flex: 1; } .mods li { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.tcode { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: .6rem .8rem; margin: 1rem 0; } .sm-input { width: 220px; padding: .4rem .6rem; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.review-table .rrow { cursor: pointer; } .review-table .rrow:hover { background: var(--surface-2); }
.rdetail td { background: var(--surface-2); }
.score-hero { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.score-hero.slim { justify-content: space-between; }
.score-main { display: flex; flex-direction: column; } .score-main b { font-size: 3.4rem; line-height: 1; letter-spacing: -.03em; color: var(--brand); margin: .2rem 0; }
.score-secs { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.score-secs .sec { flex: 1; min-width: 150px; background: var(--surface-2); border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; }
.score-secs .sec b { font-size: 1.8rem; }
.qreview { padding: .5rem 0; }

/* ---------- flashcards ---------- */
.search { margin: 1rem 0; padding: .8rem 1rem; font-size: 1rem; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1rem; }
.set-card { margin: 0; display: flex; flex-direction: column; gap: .4rem; } .set-card h3 { margin: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1rem 0; }
.mode { margin: 0; display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit; color: var(--ink); text-align: left; }
.mode span { font-size: 1.4rem; }
.flip { perspective: 1400px; height: clamp(240px, 42vh, 380px); cursor: pointer; position: relative; outline: none; }
.face { position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: grid; place-items: center; padding: 2rem 2.5rem; text-align: center; backface-visibility: hidden; transition: transform .45s cubic-bezier(.3, .7, .3, 1); }
.face-txt { font-size: clamp(1.1rem, 2.6vw, 1.7rem); max-height: 100%; overflow: auto; white-space: pre-wrap; }
.face.back { transform: rotateX(180deg); } .flip.flipped .front { transform: rotateX(180deg); } .flip.flipped .back { transform: rotateX(360deg); }
.flip:focus-visible .face { box-shadow: 0 0 0 3px var(--brand); }
.hint { position: absolute; bottom: .8rem; font-size: .75rem; color: var(--muted); }
.star { position: absolute; top: .8rem; right: 1rem; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--muted); } .star.on { color: #f5b301; }
.term .star { position: static; }
.flip-empty { height: 200px; display: grid; place-items: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 18px; }
.viewer-ctrl { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin: 1rem 0 .5rem; font-weight: 700; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.round:hover { border-color: var(--brand); }
.viewer-opts { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.set-meta { margin: 1.5rem 0; }
.term-list { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.term { margin: 0; display: grid; grid-template-columns: 1fr 2fr auto; gap: 1rem; align-items: center; }
.term .t { font-weight: 600; border-right: 1px solid var(--line); padding-right: 1rem; } .term-side { display: flex; align-items: center; gap: .5rem; }
.edit-row { margin: 0; } .edit-row textarea { min-height: 44px; overflow: hidden; }
.learn-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.toggle { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.learn-card { padding: 1.8rem; } .learn-prompt { font-size: 1.5rem; margin: 1rem 0 1.6rem; white-space: pre-wrap; }
.learn-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.lopt { display: flex; gap: .7rem; align-items: center; text-align: left; font: inherit; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1rem; cursor: pointer; }
.lopt:hover:not(:disabled) { border-color: var(--brand); } .lopt.correct { border-color: var(--good); background: var(--good-soft); } .lopt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.lopt .letter { width: 1.6rem; height: 1.6rem; font-size: .8rem; }
#wform input { font-size: 1.1rem; }
.center-card { text-align: center; padding: 2.5rem 1.5rem; }
.tq { margin: 0; } .tq.right { border-color: var(--good); } .tq.wrongq { border-color: var(--bad); }
.tq-prompt { font-size: 1.2rem; font-weight: 600; margin: .5rem 0; } .tq-shown { font-size: 1.05rem; padding: .6rem .8rem; background: var(--surface-2); border-radius: 10px; margin-bottom: .6rem; }
.tq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; } .tq-fb { margin-top: .5rem; color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: .5rem; border: 1.5px solid var(--line); border-radius: 10px; padding: .55rem .8rem; font-weight: 500; cursor: pointer; }
.chip.block { display: flex; } .chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.match-time { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-top: 1rem; }
.tile { min-height: 120px; font: inherit; font-size: .95rem; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 14px; padding: .8rem; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, opacity .25s, border-color .12s; }
.tile:hover { border-color: var(--brand); } .tile.sel { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.03); }
.tile.match { border-color: var(--good); background: var(--good-soft); } .tile.miss { border-color: var(--bad); background: var(--bad-soft); animation: shake .3s; }
.tile.gone { opacity: 0; pointer-events: none; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.calc-page .calc-full { margin-top: 1rem; }
pre.err { white-space: pre-wrap; background: var(--surface-2); padding: 1rem; border-radius: 10px; font-size: .8rem; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem; }
  body.nav-open .links { display: flex; }
  .menu-btn { display: inline-grid; margin-left: auto; order: 3; }
  .nav-right { margin-left: auto; }
}
@media (max-width: 960px) {
  .hero-inner, .dash-grid, .bank, .prep { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .sticky { position: static; }
  .tr-body.split { flex-direction: column; overflow: auto; } .tr-body.split > .tr-passage, .tr-body.split > .tr-q { flex: none; overflow: visible; padding: 1rem; }
  .tr-divider { width: auto; height: 6px; }
}
@media (max-width: 640px) {
.grid2, .modes, .learn-opts, .tq-opts { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .match-grid { grid-template-columns: repeat(3, 1fr); } .tile { min-height: 90px; font-size: .82rem; }
  .term { grid-template-columns: 1fr; } .term .t { border-right: 0; padding: 0; }
  .tr-top { grid-template-columns: 1fr auto; } .tr-top .tr-right { grid-column: 1 / -1; justify-content: center; }
  .tr-bottom { grid-template-columns: auto 1fr; gap: .5rem; } .tr-user { display: none; }
  .tr-title { font-size: .85rem; }
  .learn-head { grid-template-columns: 1fr; }
  .calc-float { left: 2vw !important; right: 2vw; width: 96vw; top: 60px !important; }
  .nav-right .btn.ghost { display: none; }
}
@media print {
  .nav, .site-foot, .btn { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- polish ---------- */
body { -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
.card.hover:hover { box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost:hover { background: var(--surface-2); }
input, select, textarea, .choice, .pill, .skill, .strike, .abc, .choices.static li, .lopt, .chip, .tile, .round, .nb { border-color: var(--line-strong); }
.choice:hover:not(:disabled), .lopt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.tag { font-weight: 600; }
.nav { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.links a.active { color: var(--brand); background: var(--brand-soft); }
.logo-shadow { fill: var(--ink); }
.tr-rule { border-top: 1px solid var(--line); background: none; }
.tr-bottom { border-top: 1px solid var(--line); }
.tr-qhead { border-bottom: 1px solid var(--line); }
.nb { border-style: solid; }
.lgd.cur::before { content: ''; display: block; width: 8px; height: 8px; margin: 3px; border-radius: 50%; background: var(--brand); }
mark.hl { background: #f2b33d; color: #14231a; }

/* ---------- icons ---------- */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.icon-btn .ico { width: 1.25rem; height: 1.25rem; }
.big-emoji { font-size: 1rem; display: flex; justify-content: center; margin-bottom: .5rem; }
.sticker { width: 88px; height: 88px; }
.f-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin-bottom: .6rem; }
.f-icon .ico { width: 22px; height: 22px; }
.mode span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.star .ico { width: 1.4rem; height: 1.4rem; } .star.on { color: var(--ink); } .star.on .ico { fill: var(--accent); }
.round { display: inline-grid; place-items: center; }
.markrev.on .ico { fill: var(--bad-soft); }
.kpi-val .flame { color: var(--mid); fill: var(--mid-soft); }
.tool span .ico { width: 1.3rem; height: 1.3rem; }

/* Native-language help */
.xl { margin-top: .5rem; }
.xl .link svg { width: 1em; height: 1em; vertical-align: -.15em; }
.xl-text { margin-top: .4rem; padding: .6rem .8rem; border-radius: 8px; background: var(--surface); border: 1px dashed var(--muted); color: var(--ink-2); }
.xl-out p { margin: .3rem 0 0; }
label[hidden] { display: none; }

/* ---------- social sign-in ---------- */
.social { gap: .6rem; margin-top: 1rem; }
.social .btn .ico { width: 20px; height: 20px; }
.btn.apple { background: #000; border-color: #000; color: #fff; }
:root[data-theme="dark"] .btn.apple { background: #fff; border-color: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.apple { background: #fff; border-color: #fff; color: #000; } }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1rem 0 .4rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- legal ---------- */
.legal h2 { font-size: 1.15rem; margin-top: 1.6rem; }
.legal ul { padding-left: 1.2rem; } .legal li { margin: .4rem 0; }

/* ---------- speed practice ---------- */
.speed-top { position: sticky; top: .5rem; z-index: 5; }
.speed-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; } .speed-time.warn { color: var(--bad); }
.speed-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: .6rem; }
.speed-bar div { height: 100%; background: var(--brand); transition: width 1s linear; }
.speed .pill .ico { width: 14px; height: 14px; }
.speed-q.flash-ok { animation: flashOk .45s; } .speed-q.flash-bad { animation: flashBad .45s; }
@keyframes flashOk { from { box-shadow: 0 0 0 4px var(--good); } }
@keyframes flashBad { from { box-shadow: 0 0 0 4px var(--bad); } }

/* ---------- courses ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1rem; margin-top: 1.2rem; }
.course-card { margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.course-card .tag { align-self: flex-start; } .course-card h3 { margin: .2rem 0 0; } .course-card p { margin: 0; }
.subject-filter { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.subject-title { font-size: 1.15rem; margin: 2rem 0 0; }
.course-prog { margin: .6rem 0 1rem; } .course-prog .bar { margin: 0 0 .3rem; }
.course-card .course-prog { margin: auto 0 0; padding-top: .4rem; }
.course-head { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1rem; } .course-head h1 { margin-top: 0; } .course-head .f-icon { flex: none; }
.lesson-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-direction: column; gap: .6rem; }
.lesson-row { margin: 0; display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; }
.lesson-row .grow { display: flex; flex-direction: column; } .lesson-row > .ico { color: var(--muted); }
.lnum { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--surface-2); color: var(--ink-2); }
.lnum.done { background: var(--good-soft); color: var(--good); }
.lesson-body { font-size: 1.02rem; line-height: 1.7; padding: 1.4rem 1.6rem; }
.lesson-body > :first-child { margin-top: 0; }
.lesson-body h3 { margin-top: 1.4rem; } .lesson-body ul, .lesson-body ol { padding-left: 1.3rem; } .lesson-body li { margin: .35rem 0; }
.lesson-body .tbl-wrap { overflow-x: auto; margin: .8rem 0; } .lesson-body .tbl-wrap table.data { margin: 0; } .lesson-body table.data td { text-align: left; }
.lesson-body pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; overflow-x: auto; line-height: 1.5; } .lesson-body pre code { background: none; border: 0; padding: 0; font-size: .85rem; }
.lesson-body code { font-family: ui-monospace, Menlo, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }
.rule { background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; }
.tip { background: var(--surface-2); border-radius: 8px; padding: .7rem 1rem; margin: 1rem 0; font-size: .95rem; } .tip b { color: var(--brand); margin-right: .3rem; }
.ex { display: flex; gap: .8rem; align-items: baseline; border-radius: 8px; padding: .55rem .9rem; margin: .5rem 0; font-family: var(--serif); font-size: 1.04rem; }
.ex b { font-family: var(--font); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; flex: none; width: 5.5rem; }
.ex-bad { background: var(--bad-soft); } .ex-bad b { color: var(--bad); }
.ex-good { background: var(--good-soft); } .ex-good b { color: var(--good); }
.lesson-calc { height: 440px; margin-top: .6rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.practice-cta p { margin: .2rem 0 0; }
@media (max-width: 640px) {
  .lesson-body { padding: 1.1rem; } .ex { flex-direction: column; gap: .1rem; } .lesson-calc { height: 360px; }
  .lesson-nav .btn { flex: 1; white-space: normal; }
}
.course-search { display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: .55rem .8rem; margin-top: 1rem; max-width: 560px; }
.course-search .ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.course-search input { border: 0; background: none; padding: 0; font: inherit; color: inherit; width: 100%; outline: none; }
.course-search:focus-within { border-color: var(--brand); }
.empty-note { margin-top: 1.5rem; }

/* ---------- stats strip (speed practice) ---------- */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem; }
.stats-strip div { text-align: center; } .stats-strip b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 600; color: var(--brand); } .stats-strip span { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) { .stats-strip { grid-template-columns: 1fr 1fr; } }

/* ---------- type + surfaces (redesign) ---------- */
h1, h2, .section-title, .auth h1 { font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 96, 'SOFT' 30; letter-spacing: -.015em; }
h2 { font-size: 1.55rem; line-height: 1.2; }
h3 { font-weight: 650; }
.card { box-shadow: none; }
.card.hover:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn { border-radius: 8px; }
.btn.primary { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); }
.btn.primary:hover { border-color: var(--brand-2); }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.brand-fox { color: var(--brand); }
.links a.active { background: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.tabs button.on { color: var(--ink); }
.tag { background: var(--brand-soft); color: var(--brand-2); }
:root[data-theme="dark"] .tag { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: var(--brand); } }
.kpi-val, .score-main b { font-family: var(--display); font-weight: 600; }
.f-icon { border-radius: 8px; }
::selection { background: var(--accent); color: #14231a; }

/* ---------- home ---------- */
.kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin: 0 0 .8rem; }
.hero2 { position: relative; overflow: hidden; }
.hero-note { font-size: .9rem; color: var(--muted); margin: .9rem 0 0; }
.hero2-inner { max-width: 1160px; margin: 0 auto; padding: 4rem 1rem 3.5rem; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero2 h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); line-height: 1.03; margin: 0 0 1.1rem; font-variation-settings: 'opsz' 144, 'SOFT' 50; }
.scribble { font-style: italic; color: var(--brand); position: relative; white-space: nowrap; }
.scribble::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.12em; height: .3em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c40-6 90-7 196-3' fill='none' stroke='%23f2b33d' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 34rem; margin-bottom: 1.4rem; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem 2.2rem; margin: 2.4rem 0 0; }
.facts dt { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; }
.facts dd { margin: .25rem 0 0; color: var(--muted); font-size: .85rem; }

/* hero collage: little previews of real features */
.collage { position: relative; height: 440px; }
.mock { position: absolute; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 1rem 1.1rem; box-shadow: 0 2px 0 var(--line-strong); display: flex; flex-direction: column; gap: .5rem; animation: floaty 6s ease-in-out infinite; }
.mock .ico { color: var(--brand); }
.mock-card { top: 0; left: 2%; width: 54%; transform: rotate(-3deg); min-height: 170px; }
.mock-card b { font-family: var(--display); font-size: 1.3rem; line-height: 1.25; }
.mock-card .tag { align-self: flex-start; }
.mock-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.mock-dots { display: flex; gap: 4px; } .mock-dots i { width: 18px; height: 5px; border-radius: 3px; background: var(--line-strong); } .mock-dots i.on { background: var(--brand); }
.mock-streak { top: 40px; right: 0; width: 42%; animation-delay: -2s; }
.mock-streak .row > span { display: flex; flex-direction: column; line-height: 1.2; }
.mock-streak .ico { color: #e8792b; width: 1.6rem; height: 1.6rem; }
.mock-bank { bottom: 0; left: 0; width: 58%; animation-delay: -4s; }
.mock-head { display: flex; justify-content: space-between; align-items: baseline; }
.mock-score { bottom: 40px; right: 4%; width: 36%; transform: rotate(3deg); animation-delay: -3s; }
.mock-score b { font-family: var(--display); font-size: 2.4rem; line-height: 1; }
.good-txt { color: var(--good); font-weight: 650; font-size: .85rem; }
@keyframes floaty { 50% { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .mock { animation: none; } }
.art-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.art-grid span { font-size: .62rem; font-weight: 650; text-align: center; padding: .3rem 0; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--muted); font-variant-numeric: tabular-nums; }
.art-grid .q-right { background: var(--good-soft); color: var(--good); border-color: transparent; }
.art-grid .q-miss { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.art-bars { display: flex; align-items: flex-end; gap: 5px; height: 56px; }
.art-bars i { flex: 1; background: var(--brand-soft); border-radius: 4px 4px 2px 2px; } .art-bars i.on { background: var(--brand); }

/* features: editorial, no icon boxes */
.home2 { padding-top: 0; }
.sec-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin: 5rem 0 1.6rem; }
.feature-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.feat { display: flex; flex-direction: column; gap: .5rem; padding: 2rem; border-radius: 6px; color: var(--ink); text-decoration: none !important; }
.feat h3 { font-family: var(--display); font-size: 1.6rem; line-height: 1.2; font-weight: 600; margin: 0; }
.feat p { margin: 0; color: var(--ink-2); }
.feat .go { margin-top: auto; padding-top: 1rem; font-weight: 700; color: var(--brand); }
.feat:hover .go { text-decoration: underline; }
.feat-courses { background: var(--brand-soft); }
.ap-list { font-size: .9rem; line-height: 1.8; margin-top: .6rem !important; color: var(--brand-2) !important; }
.feat-bank { background: #14231a; color: #eef3ee; }
.feat-bank p { color: #b9c8bd; } .feat-bank .go { color: #f2b33d; }
.feat-bank .art-grid { margin-top: 1rem; }
.feat-bank .art-grid span { border-color: #2c4234; color: #8da394; } .feat-bank .art-grid .q-right { background: #1d4a31; color: #8fe0b2; } .feat-bank .art-grid .q-miss { background: #4a2420; color: #ffab9f; }
.big-nums { display: flex; gap: 1.6rem; margin-bottom: .4rem; }
.big-nums span { font-family: var(--display); font-size: 3rem; font-weight: 600; line-height: 1; display: inline-flex; align-items: baseline; gap: .4rem; }
.big-nums small { font-family: var(--font); font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: #f2b33d; }
.feat-cards { margin-top: 1.2rem; display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.5rem; align-items: center; background: var(--peach); }
.fc-copy { display: flex; flex-direction: column; gap: .7rem; }
.fc-mock { background: var(--surface); border-radius: 6px; padding: 1.1rem; box-shadow: 0 2px 0 var(--line-strong); transform: rotate(1deg); }
.fc-title { font-family: var(--display); font-weight: 600; font-size: 1.15rem; display: flex; justify-content: space-between; margin-bottom: .6rem; } .fc-title span { font-family: var(--font); font-size: .8rem; color: var(--muted); font-weight: 500; }
.fc-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .9rem; } .fc-row span:first-child { font-weight: 650; } .fc-row span:last-child { color: var(--ink-2); }
.fc-row.new span:last-child { border-bottom: 2px solid var(--brand); }
.fc-modes { display: flex; gap: .4rem; margin-top: .8rem; } .fc-modes span { font-size: .78rem; font-weight: 650; padding: .25rem .7rem; border-radius: 4px; background: var(--surface-2); } .fc-modes span:first-child { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 860px) { .feat-cards { grid-template-columns: 1fr; } }
.feat-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); column-gap: 2.5rem; }
.feat-list a { display: flex; flex-direction: column; padding: 1.1rem 0; border-top: 1px solid var(--line-strong); color: var(--ink); text-decoration: none !important; }
.feat-list b { font-size: 1.05rem; } .feat-list span { color: var(--muted); font-size: .93rem; }
.feat-list a:hover b { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.art-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.art-grid span { font-size: .62rem; font-weight: 650; text-align: center; padding: .3rem 0; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted); font-variant-numeric: tabular-nums; }
.art-grid .q-right { background: var(--good-soft); color: var(--good); border-color: transparent; }
.art-grid .q-miss { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.steps { padding: 0; margin: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.steps li { counter-increment: step; color: var(--ink-2); font-size: 1.02rem; }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-style: italic; font-size: 3.4rem; line-height: 1; color: var(--brand); margin-bottom: .5rem; }
.steps b { color: var(--ink); }
.subjects { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 3rem; }
.subjects li { break-inside: avoid; }
.subjects a { display: block; padding: .8rem 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.subjects a b { font-size: 1.1rem; } .subjects .muted { display: block; }
.subjects a:hover b { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.sub-n { font-family: var(--display); font-style: italic; color: var(--muted); margin-left: .2rem; }
.cta-band { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; margin: 5rem 0 0; padding: 2.4rem; border-radius: 6px; background: var(--brand); color: var(--brand-ink); }
.cta-band h2 { margin: 0; color: inherit; } .cta-band p { margin: .3rem 0 0; opacity: .85; }
.cta-band .btn { background: var(--brand-ink); color: var(--brand); border-color: transparent; }
.home2-bottom { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; margin-top: 4rem; align-items: start; }
.home2-bottom .faq h2 { margin: 0 0 .8rem; }
.home2-bottom .note-from { margin: 0; }
@media (max-width: 960px) {
  .hero2-inner { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.4rem; }
  .collage { height: 400px; max-width: 520px; width: 100%; margin: 0 auto; }
  .feature-pair { grid-template-columns: 1fr; }
  .home2-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .collage { height: 360px; } .mock-score { display: none; } .mock-streak { width: 52%; } .mock-card { width: 72%; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; } .subjects { columns: 1; } .feat { padding: 1.4rem; }
  .cta-band { padding: 1.6rem; }
}
.faq { border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-strong); padding: 1rem .2rem; }
.faq summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--display); font-size: 1.3rem; line-height: 1; color: var(--brand); }
.faq details[open] summary::after { content: '\2013'; }
.faq p { color: var(--ink-2); margin: .6rem 0 0; max-width: 46rem; }
.note-from { display: flex; gap: 1.2rem; max-width: 640px; margin: 3.5rem auto 1rem; padding: 1.6rem 1.8rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; transform: rotate(-.4deg); box-shadow: 0 1px 0 var(--line-strong); }
.note-from .avatar { width: 52px; height: 52px; font-size: 1.3rem; flex: none; font-family: var(--display); }
.note-from p { margin: .2rem 0 .6rem; color: var(--ink-2); font-family: var(--serif); font-size: 1.05rem; }
.note-from .kicker { font-family: var(--font); font-size: .72rem; margin: 0; }
.note-from .sig { font-family: var(--display); font-style: italic; font-size: 1.25rem; color: var(--ink); }
.note-from { flex-wrap: wrap; } @media (max-width: 560px) { .note-from { flex-direction: column; transform: none; } }

/* ---------- footer ---------- */
.site-foot { border-top: 1.5px solid var(--ink); color: var(--muted); font-size: .85rem; padding: 2rem 1rem 1.5rem; margin-top: 2rem; }
.foot-inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem 2rem; }
.foot-brand b { font-family: var(--display); font-size: 1.2rem; color: var(--ink); } .foot-brand p { margin: .3rem 0 .6rem; max-width: 30rem; }
.foot-ig { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--ink); }
.foot-ig:hover { color: var(--brand); }
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-content: start; justify-content: flex-end; }
.foot-links a { color: var(--ink-2); font-weight: 600; }
.foot-legal { grid-column: 1 / -1; font-size: .75rem; border-top: 1px solid var(--line); padding-top: 1rem; margin: .5rem 0 0; }
@media (max-width: 640px) { .foot-inner { grid-template-columns: 1fr; } .foot-links { justify-content: flex-start; } }

/* ---------- numbered question bank ---------- */
.bank-progress { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: .4rem 2.2rem; align-items: end; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line-strong); padding: 1rem 0; margin: 1.2rem 0 .4rem; }
.bank-progress > div:not(.bp-bar) { display: flex; flex-direction: column; }
.bp-num { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; }
.bp-of { font-family: var(--display); font-size: 1rem; color: var(--muted); margin-top: -.2rem; }
.bank-progress > div:first-child { display: block; } .bank-progress > div:first-child .bp-label { display: block; }
.bp-label { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.bp-bar { align-self: center; } .bp-bar .bar i { background: var(--brand); }
.tab-count { font-size: .75rem; font-weight: 600; color: var(--muted); margin-left: .3rem; }
.qgrid-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .5rem 1rem; margin: 2.5rem 0 .8rem; border-top: 1.5px solid var(--ink); padding-top: 1rem; }
.qgrid-head h2 { margin: 0; font-size: 1.4rem; } .qgrid-head p { margin: .2rem 0 0; } .qgrid-head .legend { margin: 0; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr)); gap: .35rem; margin-bottom: 1rem; }
.qn { font: inherit; font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; height: 2.4rem; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: border-color .1s, transform .1s; }
.qn:hover { border-color: var(--ink); transform: translateY(-1px); }
.qn.q-right { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--good); }
.qn.q-miss { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.lgd.q-new { border: 1px solid var(--line-strong); background: var(--surface); }
.lgd.q-right { border: 0; background: var(--good); } .lgd.q-miss { border: 0; background: var(--bad); }
.qno { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-2); background: var(--brand-soft); border-radius: 5px; padding: .1rem .45rem; white-space: nowrap; }
:root[data-theme="dark"] .qno { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qno { color: var(--brand); } }
@media (max-width: 640px) { .bank-progress { grid-template-columns: repeat(3, 1fr); gap: .8rem; } .bp-bar { grid-column: 1 / -1; } .bp-num { font-size: 1.5rem; } }

/* ---------- runner home button ---------- */
.tr-left { display: flex; align-items: center; gap: .6rem; }
.tr-home { flex: none; border: 1px solid var(--line-strong); }
:root[data-theme="dark"] .card.hover:hover { box-shadow: 6px 6px 0 var(--brand-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.hover:hover { box-shadow: 6px 6px 0 var(--brand-soft); } }
:root[data-theme="dark"] .feat-bank { background: #163323; border-color: #1f4630; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feat-bank { background: #163323; border-color: #1f4630; } }
.custom-sep { align-items: center; flex-wrap: wrap; } .custom-sep input[type=radio] { margin-top: 0; }
.custom-sep input:not([type]) { width: 7rem; padding: .3rem .5rem; margin: 0; }

/* home polish: soft hero glow, course marquee, subject tiles */
.hero2::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(40rem 26rem at 85% 30%, var(--brand-soft), transparent 70%), radial-gradient(30rem 20rem at 5% 90%, var(--peach), transparent 70%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.hero2 { isolation: isolate; }
.marquee { overflow: hidden; border-block: 1px solid var(--line-strong); padding: .8rem 0; background: var(--surface); }
.marquee > div { display: flex; gap: 2.4rem; width: max-content; animation: marquee 80s linear infinite; }
.marquee span { font-family: var(--display); font-style: italic; font-size: 1.05rem; color: var(--ink-2); white-space: nowrap; }
.marquee span::before { content: '\2022'; color: var(--accent); margin-right: 2.4rem; font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee > div { animation: none; } }
.subj-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .8rem; }
.subj-tiles a { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; height: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.subj-tiles a:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); border-color: var(--ink); }
.subj-tiles b { font-size: 1.05rem; } .subj-tiles .muted { display: block; margin-top: .15rem; }
.subj-ic { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.subj-ic .ico { width: 1.3rem; height: 1.3rem; }

/* dashboard */
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.8rem 2rem; margin: .5rem 0 1rem; border-radius: 10px; background: var(--brand); color: var(--brand-ink); position: relative; overflow: hidden; }
.dash-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0 0 .2rem; color: inherit; }
.dash-hero p { margin: 0; opacity: .88; } .dash-hero .kicker { color: inherit; opacity: .75; margin-bottom: .3rem; }
.dash-ring { --p: 0; flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); position: relative; z-index: 1; }
.dash-ring > div { width: 88px; height: 88px; border-radius: 50%; background: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.dash-ring b { font-family: var(--display); font-size: 1.8rem; } .dash-ring span { font-size: .72rem; opacity: .85; }
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; margin-bottom: 1rem; }
.quick a { display: flex; flex-direction: column; gap: .1rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.quick a:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); border-color: var(--ink); }
.quick .ico { width: 1.5rem; height: 1.5rem; color: var(--brand); margin-bottom: .4rem; }
.quick span { font-size: .82rem; color: var(--muted); }
.dash-title { margin: 2rem 0 .8rem; } .dash-title h2 { margin: 0; } h2.dash-title { font-size: 1.4rem; }
.resume { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: .8rem; }
.resume-card { margin: 0; text-align: left; align-items: flex-start; display: flex; flex-direction: column; gap: .2rem; }
.resume-card .bar { align-self: stretch; }
.resume-card b { font-family: var(--display); font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
.resume-card.empty { border-style: dashed; }
.dash .kpis { margin-top: 0; }
@media (max-width: 860px) { .quick { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .quick { grid-template-columns: 1fr 1fr; } .dash-hero { padding: 1.4rem; } .dash-ring { width: 92px; height: 92px; } .dash-ring > div { width: 72px; height: 72px; }
}

/* donate */
.donate .lead { margin-bottom: 1rem; }
.donate-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.6rem 0; padding: 1.4rem; border-color: var(--line-strong); }
.donate-card > div { flex: 1; min-width: 12rem; } .donate-card p { margin: .2rem 0 0; }
.donate-ic { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--bad-soft); color: var(--bad); }
.donate-ic .ico { width: 1.5rem; height: 1.5rem; fill: currentColor; }

/* ---------- Courses catalog ---------- */
.tone-0 { --t: #1f6b47; --t-soft: #e1efe6; } .tone-1 { --t: #2f5d9e; --t-soft: #e4ecf8; } .tone-2 { --t: #a2511c; --t-soft: #fbeadb; }
.tone-3 { --t: #7a3f8f; --t-soft: #f1e6f5; } .tone-4 { --t: #8a6a0c; --t-soft: #f8f0d4; } .tone-5 { --t: #9b3343; --t-soft: #f8e4e7; }
:root[data-theme="dark"] .tone-0 { --t: #6fd49f; --t-soft: #173022; } :root[data-theme="dark"] .tone-1 { --t: #8fb6f0; --t-soft: #18243a; } :root[data-theme="dark"] .tone-2 { --t: #f0a675; --t-soft: #3a2316; }
:root[data-theme="dark"] .tone-3 { --t: #d2a2e4; --t-soft: #2e1f36; } :root[data-theme="dark"] .tone-4 { --t: #e7c75e; --t-soft: #342b10; } :root[data-theme="dark"] .tone-5 { --t: #f0939f; --t-soft: #3a1b20; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tone-0 { --t: #6fd49f; --t-soft: #173022; } :root:not([data-theme="light"]) .tone-1 { --t: #8fb6f0; --t-soft: #18243a; } :root:not([data-theme="light"]) .tone-2 { --t: #f0a675; --t-soft: #3a2316; }
  :root:not([data-theme="light"]) .tone-3 { --t: #d2a2e4; --t-soft: #2e1f36; } :root:not([data-theme="light"]) .tone-4 { --t: #e7c75e; --t-soft: #342b10; } :root:not([data-theme="light"]) .tone-5 { --t: #f0939f; --t-soft: #3a1b20; } }

.courses-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.courses-head .page { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; padding-top: 2.4rem; padding-bottom: 2rem; }
.courses-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 .4rem; line-height: 1; }
.courses-head p { color: var(--ink-2); max-width: 34rem; margin: 0; }
.ch-stats { display: flex; gap: 0; margin: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.ch-stats div { padding: .8rem 1.2rem; text-align: center; } .ch-stats div + div { border-left: 1px solid var(--line-strong); }
.ch-stats dt { font-family: var(--display); font-size: 1.8rem; font-weight: 600; line-height: 1; color: var(--ink); }
.ch-stats dd { margin: .25rem 0 0; font-size: .8rem; color: var(--muted); }
.courses-head .course-search { margin-top: 1.2rem; }
.courses-body { padding-top: 1rem; }
.cc-sec { font-size: 1.3rem; margin: 1rem 0 0; }
.subject-filter { margin: 1.2rem 0 0; }

.subject-block { margin-top: 2.2rem; }
.subject-title { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; margin: 0; padding-bottom: .6rem; border-bottom: 2px solid var(--t); }
.st-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--t); color: var(--surface); }
.st-icon .ico { width: 18px; height: 18px; }
.st-count { font-family: var(--font); font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: auto; }

.course-card { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.1rem .9rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); color: inherit; overflow: hidden; box-shadow: 0 2px 0 var(--line-strong); transition: transform .15s, box-shadow .15s, border-color .15s; }
.course-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--t); box-shadow: 0 5px 0 var(--t); }
.cc-top { display: flex; align-items: center; justify-content: space-between; }
.cc-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: var(--t-soft); color: var(--t); }
.cc-icon .ico { width: 21px; height: 21px; }
.cc-level { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--t); }
.course-card h3 { margin: .2rem 0 0; font-family: var(--display); font-size: 1.2rem; line-height: 1.2; font-weight: 600; }
.cc-blurb { margin: 0; color: var(--muted); font-size: .88rem; }
.cc-peek { list-style: none; margin: .2rem 0 0; padding: .6rem 0 0; border-top: 1px dashed var(--line-strong); font-size: .82rem; color: var(--ink-2); counter-reset: l; }
.cc-peek li { counter-increment: l; display: flex; gap: .5rem; padding: .12rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-peek li::before { content: counter(l); flex: none; width: 1.2rem; color: var(--t); font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-peek li.more { color: var(--muted); } .cc-peek li.more::before { content: ''; }
.cc-foot { display: flex; align-items: center; gap: .9rem; margin-top: auto; padding-top: .5rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.cc-go, .cc-done { margin-left: auto; color: var(--t); display: inline-flex; align-items: center; gap: .25rem; }
.cc-go .ico, .cc-done .ico { width: 16px; height: 16px; }
.course-card:hover .cc-go { transform: translateX(3px); transition: transform .15s; }
.cc-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: var(--t); }
@media (max-width: 720px) {
  .courses-head .page { grid-template-columns: 1fr; gap: 1.2rem; padding-top: 1.6rem; }
  .ch-stats { width: 100%; } .ch-stats div { flex: 1; padding: .7rem .5rem; }
  .subject-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .subject-filter .pill { flex: none; }
}

/* ---------- News, admin, contact ---------- */
.page-head { margin-bottom: 1.4rem; } .page-head h1 { margin: .3rem 0 .3rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.eyebrow .ico { width: 16px; height: 16px; }
.news-post .news-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; flex-wrap: wrap; }
.news-post.pinned { border-left: 4px solid var(--brand); }
.news-post h2 { margin: 0 0 .4rem; font-size: 1.3rem; }
.news-body p { margin: 0 0 .7rem; } .news-body p:last-child { margin: 0; } .news-body a { word-break: break-all; }
.news-compose { display: grid; gap: .6rem; } .news-compose b { display: inline-flex; align-items: center; gap: .4rem; }
.news-compose.compact { margin: .8rem 0 .5rem; box-shadow: none; background: var(--surface-2); }
.news-widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.2rem 0; }
.news-widget .h3 { margin: 0; } .news-widget .row { margin-bottom: .4rem; }
.news-item { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); color: inherit; }
.news-item:hover b { color: var(--brand); } .news-item span { flex: none; }
.danger-text { color: var(--bad); }
.admin-status { display: grid; gap: .6rem; border-left: 4px solid var(--good); } .admin-status.down { border-left-color: var(--bad); }
.admin-status p { margin: 0; }
.maintenance { padding-top: 4rem; } .maintenance .f-icon { margin: 0 auto .8rem; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; }
.contact-card { display: flex; flex-direction: column; gap: .25rem; margin: 0; }
.form-embed { margin-top: 1rem; } .form-embed iframe { width: 100%; height: 900px; border: 0; display: block; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; justify-self: start; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* Dashboard tabs (Overview / Settings / Support) */
.dash-tabs { padding-bottom: 0; }
.dash-tabs .tabs { margin-bottom: 0; }
.dash-tabs .tabs a { font-weight: 600; color: var(--muted); padding: .7rem 1rem; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; text-decoration: none; }
.dash-tabs .tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.in-dash { padding-top: 1.2rem; }

/* ---------- AP question bank ---------- */
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: .9rem; }
.ap-card { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--ink); }
.ap-card .ap-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.ap-card .bar { margin-top: auto; }
.ap-opts { margin: 1rem 0; }
.ap-unit { display: flex; flex-direction: column; gap: .5rem; }
.ap-unit-name { text-align: left; color: var(--ink); }
.ap-concepts { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-concepts .chip { font: inherit; font-size: .85rem; cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: .3rem .75rem; }
.ap-concepts .chip:hover { border-color: var(--brand); }
.ap-prog { display: flex; align-items: center; gap: .8rem; margin: .8rem 0; } .ap-prog .bar { flex: 1; }
.ap-q .stem { margin: .8rem 0; font-size: 1.05rem; }
.ap-q .banner { margin-top: .8rem; }
.row.end { justify-content: flex-end; }

/* ---------- speed practice: modes, countdown, scoring ---------- */
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1rem 0; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left; font: inherit; color: var(--ink); cursor: pointer; border: 1.5px solid var(--line); }
.mode-card .ico { width: 22px; height: 22px; color: var(--brand); }
.mode-card.on { border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--brand-soft); }
@media (max-width: 640px) { .mode-cards { grid-template-columns: 1fr; } }
.speed-setup select.full { width: 100%; margin-top: .4rem; }
.countdown { font-size: 6rem; font-weight: 800; text-align: center; padding: 5rem 0; color: var(--brand); }
.countdown.pop { animation: cdPop .5s ease-out; }
@keyframes cdPop { from { transform: scale(1.6); opacity: .2; } to { transform: scale(1); opacity: 1; } }
.speed .pill.mult.m2 { color: #e65100; } .speed .pill.mult.m3 { color: #d84315; } .speed .pill.mult.m4 { color: #fff; background: #d84315; }
.speed .pill.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.speed .pill.lives .ico.on { color: var(--bad); } .speed .pill.lives .ico.off { opacity: .25; }
.speed-q.flash-skip { opacity: .7; }
.speed { position: relative; }
.pop-score { position: absolute; right: 1.5rem; top: 5.5rem; font-weight: 800; font-size: 1.4rem; opacity: 0; pointer-events: none; }
.pop-score.show { animation: popUp 1s ease-out; } .pop-score.good { color: var(--good); } .pop-score.bad { color: var(--bad); }
@keyframes popUp { 0% { opacity: 0; transform: translateY(10px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.speed-score { font-size: 2.4rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.speed-chart { width: 100%; height: 120px; }

/* ---------- news images ---------- */
.news-img { display: block; width: calc(100% + 2 * var(--pad, 1.25rem)); max-width: none; margin: calc(-1 * var(--pad, 1.25rem)) calc(-1 * var(--pad, 1.25rem)) .9rem; aspect-ratio: 16 / 7; object-fit: cover; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.news-cover { display: grid; place-items: center; aspect-ratio: 16 / 5; margin-bottom: .9rem; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.news-cover .ico { width: 44px; height: 44px; opacity: .9; }
.news-compose .img-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.news-compose .img-prev { max-height: 90px; border-radius: 8px; }
.banner.good { background: var(--good-soft); color: var(--good); font-weight: 600; } .banner.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.news-img { width: calc(100% + 2.4rem); margin: -1.2rem -1.2rem .9rem; }
.news-thumb { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: 8px; }
.news-item b { flex: 1; }

/* ---------- about ---------- */
.about-me { display: grid; grid-template-columns: 200px 1fr; gap: 1.6rem; align-items: center; }
.about-me img { width: 200px; height: 200px; object-fit: cover; object-position: 50% 30%; border-radius: 16px; justify-self: center; }
@media (max-width: 640px) { .about-me { grid-template-columns: 1fr; text-align: left; } .about-me img { width: 160px; height: 160px; } }

/* ---------- share sheet ---------- */
.share-sheet { display: flex; flex-direction: column; gap: .9rem; align-items: stretch; }
.share-preview { display: grid; place-items: center; }
.share-preview img { width: 180px; aspect-ratio: 9 / 16; border-radius: 14px; box-shadow: var(--shadow); }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.share-actions .btn { justify-content: center; }
.nav-right .share-btn { gap: .35rem; }

/* ---------- contact: copyable email ---------- */
.email-copy { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.email-copy code { user-select: all; -webkit-user-select: all; font-size: 1rem; padding: .35rem .6rem; background: var(--surface-2); border-radius: 8px; }
.contact-grid:has(> :only-child) { grid-template-columns: 1fr; }
.selectable { user-select: all; -webkit-user-select: all; }

/* Homepage "100% free" pill linking to the About page */
.free-pill { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; padding: .55rem .9rem; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); color: var(--ink); font-size: .92rem; text-decoration: none; }
.free-pill > .ico { color: var(--brand); }
.free-pill .free-why { display: inline-flex; align-items: center; gap: .25rem; font-weight: 700; color: var(--brand); }
.free-pill:hover .free-why { text-decoration: underline; }

/* About page */
.about-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem; }
.about-values .card h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .4rem; font-size: 1.05rem; }
.about-values .card h3 .ico { color: var(--brand); }
.about-values .card p { margin: 0; }
.about-quote { font-size: 1.15rem; font-weight: 600; border-left: 4px solid var(--brand); padding: .2rem 0 .2rem 1rem; margin: 0; }

.about-facts { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }

/* Section tabs (SAT & ACT tools, dashboard): a filled pill bar so they read as navigation, not page text. */
.dash-tabs .tabs { display: flex; width: fit-content; max-width: 100%; gap: 4px; padding: 5px; margin: 1rem 0 .4rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-radius: 14px; }
.dash-tabs .tabs a { padding: .6rem 1.1rem; margin: 0; border: 0; border-radius: 10px; color: var(--ink-2); font-weight: 700; transition: background .15s, color .15s; }
.dash-tabs .tabs a:hover { background: var(--surface); color: var(--ink); }
.dash-tabs .tabs a.on { background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 35%, transparent); }

/* Formula sheet picker */
.sheet-pick { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.2rem; }
.sheet-pick a { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .88rem; text-decoration: none; }
.sheet-pick a:hover { border-color: var(--brand); color: var(--ink); }
.sheet-pick a.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* Share card design picker */
.share-themes { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.share-themes button { width: 58px; height: 58px; border-radius: 14px; border: 2px solid var(--line-strong); cursor: pointer; position: relative; padding: 0; overflow: hidden; }
.share-themes button span { position: absolute; left: 0; right: 0; bottom: 0; font-size: .62rem; font-weight: 700; padding: 2px 0; background: rgba(0,0,0,.45); color: #fff; }
.share-themes button.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent); }
.sw-forest { background: linear-gradient(160deg, #1f6b47, #0d3322); }
.sw-sunset { background: linear-gradient(180deg, #ff7a59, #e8457c 55%, #5b2a86); }
.sw-midnight { background: radial-gradient(circle at 50% 40%, rgba(95,242,193,.4), transparent 60%), #0b1020; }
.sw-notebook { background: repeating-linear-gradient(#fbf7ec 0 9px, rgba(80,130,200,.4) 9px 10px); }
.sw-bold { background: repeating-linear-gradient(-20deg, #f9c80e 0 8px, #e6b500 8px 12px); }

/* Course cover art: a tinted banner with a glow, dot texture, and an oversized tilted icon. */
.cc-art { position: relative; margin: -1.1rem -1.1rem .3rem; height: 108px; padding: .9rem 1.1rem; display: flex; align-items: flex-end; justify-content: space-between; overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, #fff 35%, transparent), transparent 45%),
    radial-gradient(color-mix(in srgb, #fff 22%, transparent) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
    linear-gradient(135deg, var(--t), color-mix(in srgb, var(--t) 55%, #000));
}
.cc-art::after { content: ''; position: absolute; left: -30px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: color-mix(in srgb, #fff 10%, transparent); }
.cc-art-big { position: absolute; right: -14px; top: -18px; color: color-mix(in srgb, #fff 26%, transparent); transform: rotate(-14deg); transition: transform .3s; }
.cc-art-big .ico { width: 128px; height: 128px; stroke-width: 1.4; }
.course-card:hover .cc-art-big { transform: rotate(-4deg) scale(1.06); }
.cc-art .cc-icon { position: relative; z-index: 1; background: rgba(255,255,255,.92); color: color-mix(in srgb, var(--t) 80%, #000); box-shadow: 0 6px 16px rgba(0,0,0,.22); width: 46px; height: 46px; border-radius: 12px; }
.cc-art .cc-level { position: relative; z-index: 1; color: #fff; background: rgba(0,0,0,.25); padding: .25rem .55rem; border-radius: 999px; backdrop-filter: blur(4px); }
.course-head .course-art { margin: 0; flex: none; width: 120px; height: 120px; border-radius: 22px; align-items: center; justify-content: center; }
.course-head .course-art .cc-art-big { right: -24px; top: -24px; }
.course-head .course-art .cc-icon { width: 56px; height: 56px; }
.course-head .course-art .cc-icon .ico { width: 28px; height: 28px; }
/* Dark mode tones are pastel, so deepen the cover gradient there. */
:root[data-theme="dark"] .cc-art { background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--t) 45%, transparent), transparent 50%), radial-gradient(color-mix(in srgb, #fff 14%, transparent) 1.2px, transparent 1.6px) 0 0 / 14px 14px, linear-gradient(135deg, color-mix(in srgb, var(--t) 70%, #000), color-mix(in srgb, var(--t) 28%, #000)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cc-art { background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--t) 45%, transparent), transparent 50%), radial-gradient(color-mix(in srgb, #fff 14%, transparent) 1.2px, transparent 1.6px) 0 0 / 14px 14px, linear-gradient(135deg, color-mix(in srgb, var(--t) 70%, #000), color-mix(in srgb, var(--t) 28%, #000)); } }

/* Nav: the four study tools sit together in a tinted pill, a step bigger, with icons. */
.nav-study { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin: 0 .3rem; border-radius: 12px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.nav-study a { display: inline-flex; align-items: center; gap: .4rem; font-size: 1rem; font-weight: 700; color: var(--brand); padding: .45rem .8rem; border-radius: 9px; box-shadow: none; }
.nav-study a .ico { width: 17px; height: 17px; }
.nav-study a:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.nav-study a.active { background: var(--brand); color: var(--brand-ink); box-shadow: none; border-radius: 9px; }
@media (max-width: 1320px) and (min-width: 1121px) { .nav-study a .ico { display: none; } .nav-study a { padding: .45rem .6rem; } }
@media (max-width: 1120px) {
  .nav-study { flex-direction: column; align-items: stretch; margin: .3rem 0; padding: 4px; }
  .nav-study a .ico { display: inline-block; }
  .nav-study a { padding: .65rem .8rem; }
}

/* Accessibility settings (see js/a11y.js) */
.a11y-toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); cursor: pointer; }
.a11y-toggle > span { display: flex; flex-direction: column; }
.a11y-toggle input { width: 2.6rem; height: 1.4rem; accent-color: var(--brand); flex: none; }
.a11y-sample { margin: 0; padding: .8rem 1rem; border-radius: 10px; background: var(--surface-2); }
:root[data-font="dyslexic"] { --font: 'OpenDyslexic', system-ui, sans-serif; --display: 'OpenDyslexic', system-ui, sans-serif; --serif: 'OpenDyslexic', system-ui, sans-serif; }
:root[data-font="lexend"] { --font: 'Lexend', system-ui, sans-serif; --display: 'Lexend', system-ui, sans-serif; --serif: 'Lexend', system-ui, sans-serif; }
:root[data-font="atkinson"] { --font: 'Atkinson Hyperlegible', system-ui, sans-serif; --display: 'Atkinson Hyperlegible', system-ui, sans-serif; --serif: 'Atkinson Hyperlegible', system-ui, sans-serif; }
:root[data-font="dyslexic"] body { line-height: 1.7; }
:root[data-text-size="large"] { font-size: 112.5%; } :root[data-text-size="large"] body { font-size: 18px; }
:root[data-text-size="xl"] { font-size: 125%; } :root[data-text-size="xl"] body { font-size: 20px; }
:root[data-spacing="on"] body { letter-spacing: .04em; word-spacing: .12em; line-height: 1.85; }
:root[data-spacing="on"] p, :root[data-spacing="on"] li { margin-bottom: .9em; }
:root[data-contrast="on"] { --muted: var(--ink-2); --line: var(--line-strong); }
:root[data-contrast="on"] body { color: var(--ink); }
:root[data-contrast="on"] .card, :root[data-contrast="on"] .btn, :root[data-contrast="on"] input, :root[data-contrast="on"] select, :root[data-contrast="on"] textarea { border-color: var(--ink-2) !important; }
:root[data-motion="on"] *, :root[data-motion="on"] *::before, :root[data-motion="on"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
:root[data-links="on"] main a:not(.btn):not(.card):not(.course-card):not(.mode), :root[data-links="on"] footer a { text-decoration: underline; text-underline-offset: 3px; }

/* Match leaderboard */
.match-board { margin-top: 1.5rem; text-align: left; width: 100%; max-width: 460px; margin-left: auto; margin-right: auto; }
.board { list-style: none; margin: .6rem 0 0; padding: 0; counter-reset: b; }
.board li { counter-increment: b; display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: 8px; }
.board li:nth-child(odd) { background: var(--surface-2); }
.board li::before { content: counter(b); width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .8rem; background: var(--line); color: var(--ink-2); flex: none; }
.board li:nth-child(1)::before { background: #f2b33d; color: #3a2a00; } .board li:nth-child(2)::before { background: #c9d1d9; color: #222; } .board li:nth-child(3)::before { background: #d08a4c; color: #2a1400; }
.board li span { flex: 1; } .board li b { font-variant-numeric: tabular-nums; }
.board li.you { outline: 2px solid var(--brand); }

/* Keep every nav link on one center line with the study-tools pill. */
.links { align-items: center; }
@media (max-width: 1120px) { .links { align-items: stretch; } }

/* "100% free" pill: on narrow screens stack it as a small card instead of a wrapped pill. */
@media (max-width: 560px) {
  .free-pill { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .2rem .55rem; border-radius: 14px; padding: .7rem .85rem; width: 100%; box-sizing: border-box; }
  .free-pill > .ico { margin-top: .15rem; }
  .free-pill .free-why { grid-column: 2; }
}

/* Phone polish */
.feature-pair > *, .fcell { min-width: 0; }
@media (max-width: 560px) {
  .hero2-copy > .row > .btn { flex: 1 1 100%; justify-content: center; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .fmath { font-size: .9rem; }
  .fgrid { grid-template-columns: 1fr; }
  .dash-tabs .tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .dash-tabs .tabs a { padding: .55rem .8rem; font-size: .9rem; }
  .match-grid { grid-template-columns: 1fr 1fr; }
}
.fmath { overflow-y: hidden; scrollbar-width: thin; }
.piles { display: flex; justify-content: space-between; margin-bottom: .6rem; font-weight: 600; }
.pile b { display: inline-block; min-width: 1.8rem; padding: .1rem .5rem; margin-right: .35rem; border-radius: 99px; text-align: center; color: #fff; }
.pile.learning { color: var(--mid); } .pile.learning b { background: var(--mid); }
.pile.known { color: var(--good); } .pile.known b { background: var(--good); }
.sort-btns { display: flex; justify-content: center; gap: .75rem; margin: .25rem 0 1rem; flex-wrap: wrap; }
.sort-btns .btn { min-width: 9rem; justify-content: center; }
.sort-learning { color: var(--mid); border-color: var(--mid); } .sort-learning:hover { background: var(--mid-soft); }
.sort-known { color: var(--good); border-color: var(--good); } .sort-known:hover { background: var(--good-soft); }
.round-done { height: auto; min-height: 200px; padding: 1.5rem; text-align: center; }

/* ---------- App look: softer, rounder surfaces that match the iOS app ---------- */
:root { --radius: 16px; }
/* Cards: rounded with a solid bottom ledge, and they press down instead of throwing an offset shadow. */
.card, .quick a, .subj-tiles a, .resume-card, .mock { border-radius: 16px; border: 1px solid var(--line); border-bottom: 3px solid var(--line-strong); box-shadow: none; }
.card.hover:hover, .quick a:hover, .subj-tiles a:hover { transform: translateY(-1px); box-shadow: none; border-color: var(--line-strong); border-bottom-color: var(--brand); }
.card.hover:active, .quick a:active, .subj-tiles a:active { transform: translateY(2px); border-bottom-width: 1px; }
.card.flush { border-bottom-width: 1px; }
.btn { border-radius: 12px; } .btn.lg { border-radius: 14px; } .btn.sm, .btn.xs { border-radius: 10px; }
.btn.primary { box-shadow: none; border-bottom: 3px solid var(--brand-2); }
.btn.primary:active { border-bottom-width: 1.5px; }
input, select, textarea { border-radius: 12px; }
.seg { border-radius: 12px; } .seg button { border-radius: 9px; }

/* Colored icon tiles with white glyphs, like the app's IconTile. */
.ap-card .ap-ic, .subj-ic, .q-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--t, var(--brand)); color: #fff; }
.ap-card .ap-ic .ico, .subj-ic .ico, .q-ic .ico { width: 21px; height: 21px; color: #fff; margin: 0; }
.quick a { gap: .15rem; } .quick .q-ic { margin-bottom: .55rem; }
.ap-card b { margin-top: .35rem; }

/* Nav: plain words, no icon-stuffed green box. The study tools sit together with a soft active pill. */
.nav-study { background: none; border: 0; padding: 0; margin: 0; gap: .2rem; }
.nav-study a { font-size: .93rem; font-weight: 600; color: var(--ink-2); padding: .45rem .7rem; border-radius: 10px; }
.nav-study a:hover { background: var(--surface-2); }
.links a.active, .nav-study a.active { background: var(--brand-soft); color: var(--brand); box-shadow: none; border-radius: 10px; }
:root[data-theme="dark"] .nav-study a.active, :root[data-theme="dark"] .links a.active { color: var(--brand-2); }
@media (max-width: 1120px) { .nav-study { padding: 0; margin: 0; } }

/* Section labels are just words. */
.eyebrow .ico { display: none; }

/* Home hero: a calm, still layout instead of tilted floating cards and blurred glows. */
.hero2::before { background: linear-gradient(to bottom, var(--brand-soft), transparent 70%); opacity: .6; }
.mock { animation: none; transform: none !important; }
.mock-card { left: 0; }
.marquee { border-block-color: var(--line); background: transparent; }
.marquee span { font-style: normal; font-family: var(--font); font-weight: 600; font-size: .95rem; color: var(--muted); }
.marquee span::before { color: var(--line-strong); }
.facts dt { font-variant-numeric: tabular-nums; }

/* Dashboard banner: the app's deep forest card rather than a flat neon slab. */
.dash-hero { border-radius: 20px; background: linear-gradient(160deg, #1f6b47, #174f35); color: #fff; }
.dash-ring > div { background: #1a5a3c; }
:root[data-theme="dark"] .dash-hero { background: linear-gradient(160deg, #1d4a32, #123222); } :root[data-theme="dark"] .dash-ring > div { background: #183f2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dash-hero { background: linear-gradient(160deg, #1d4a32, #123222); } :root:not([data-theme="light"]) .dash-ring > div { background: #183f2b; } }
:root[data-theme="dark"] :is(.ap-ic, .subj-ic, .q-ic) { background: color-mix(in srgb, var(--t, var(--brand)) 62%, #000); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.ap-ic, .subj-ic, .q-ic) { background: color-mix(in srgb, var(--t, var(--brand)) 62%, #000); } }

/* ---------- Home: plain headline, then the four study tools front and center ---------- */
.hero3-inner { max-width: 1160px; margin: 0 auto; padding: 3.5rem 1rem 1.6rem; }
.hero3 h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 0 0 .9rem; max-width: 16ch; }
.hero3 .lead { max-width: 38rem; }
.home2 { padding-top: .5rem; }
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.door { display: flex; flex-direction: column; gap: .25rem; padding: 1.3rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--line-strong); color: var(--ink); text-decoration: none !important; transition: transform .12s, border-color .12s; }
.door:hover { transform: translateY(-1px); border-bottom-color: var(--t); }
.door:active { transform: translateY(2px); border-bottom-width: 1px; }
.door .q-ic { width: 46px; height: 46px; border-radius: 14px; margin-bottom: .7rem; } .door .q-ic .ico { width: 24px; height: 24px; }
.door b { font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1.15; }
.door-n { font-size: .85rem; font-weight: 700; color: var(--t); }
:root[data-theme="dark"] .door-n { color: color-mix(in srgb, var(--t) 85%, #fff); }
.door-d { color: var(--ink-2); font-size: .93rem; margin-top: .3rem; }
.door-eg { margin-top: auto; padding-top: .8rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: .9rem; }
@media (max-width: 960px) { .doors { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .doors { grid-template-columns: 1fr; } .hero3-inner { padding-top: 2.2rem; } }

/* Nav: the four study tools read as the main links; News, About, and the rest step back. */
.links > a { color: var(--muted); font-weight: 500; font-size: .9rem; }
.nav-study a { color: var(--ink); font-weight: 650; font-size: .97rem; }
.nav-study { padding-right: .7rem; margin-right: .5rem; border-right: 1px solid var(--line); border-radius: 0; }
.links > a.active { color: var(--ink); background: var(--surface-2); }
@media (max-width: 1120px) { .nav-study { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 .4rem; margin: 0 0 .4rem; } }

/* Calmer hero: the collage stays, but it barely moves, tilts only a hair, and sits on a quiet background. */
.hero2::before { background: none; }
.mock { animation: floaty 14s ease-in-out infinite; }
.mock-card { transform: rotate(-1.5deg) !important; }
.mock-score { transform: rotate(1deg) !important; }
@keyframes floaty { 50% { translate: 0 -3px; } }
.marquee > div { animation-duration: 160s; }
.hero2 + .marquee + .page .doors { margin-top: 1.5rem; }

/* Creator note: real photo, and the whole card leads to About. */
.creator-pic { object-fit: cover; object-position: 50% 15%; padding: 0; }
.note-from { cursor: pointer; }
.note-from:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.about-me img { height: auto; aspect-ratio: 512 / 760; object-fit: contain; }
@media (max-width: 640px) { .about-me img { height: auto; } }

/* Practice tests: numbered full-length tests and subject half tests */
.exam-sub { margin: 1.4rem 0 .3rem; font-size: 1.05rem; }
.num-tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin: .7rem 0 .5rem; }
.num-test { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .9rem 1rem; font: inherit; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--line-strong); border-radius: 14px; cursor: pointer; transition: transform .12s, border-color .12s; }
.num-test:hover { transform: translateY(-1px); border-bottom-color: var(--brand); }
.num-test:active { transform: translateY(2px); border-bottom-width: 1px; }
.nt-n { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1; color: var(--brand); }
.nt-l { font-weight: 650; font-size: .92rem; margin-top: .35rem; }
.nt-s { font-size: .8rem; color: var(--muted); }
.num-test.taken { background: var(--brand-soft); } .num-test.taken .nt-s { color: var(--brand); font-weight: 700; }
.best-secs { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-bottom: .6rem; }
.best-secs div { display: flex; flex-direction: column; } .best-secs b { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.best-secs span { font-size: .78rem; color: var(--muted); }

/* "What you're studying for": search picker and the strip at the top of study pages */
.study-picker { display: flex; flex-direction: column; gap: .5rem; margin-top: .4rem; font-weight: 400; }
.sp-chips { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 1.9rem; align-items: center; }
.sp-chip { display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-size: .85rem; font-weight: 650; padding: .3rem .4rem .3rem .75rem; border-radius: 99px; border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand); cursor: pointer; }
.sp-chip .ico { width: 14px; height: 14px; opacity: .7; } .sp-chip:hover .ico { opacity: 1; }
.sp-search { display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 0 .75rem; background: var(--surface); font-weight: 400; }
.sp-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.sp-search .ico { color: var(--muted); width: 18px; height: 18px; }
.sp-search input { border: 0; box-shadow: none !important; padding: .6rem 0; margin: 0; background: none; }
.sp-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; max-height: 15rem; overflow-y: auto; }
.sp-results li + li { border-top: 1px solid var(--line); }
.sp-results button { display: flex; align-items: center; gap: .6rem; width: 100%; font: inherit; font-size: .92rem; text-align: left; padding: .55rem .8rem; background: none; border: 0; color: var(--ink); cursor: pointer; }
.sp-results button:hover { background: var(--surface-2); }
.sp-results button span { flex: 1; } .sp-results .ico { width: 17px; height: 17px; color: var(--muted); }
.sp-none { padding: .6rem .8rem; }
.classes-bar { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding: .7rem .9rem; margin: 0 0 1.2rem; border: 1px solid var(--line); border-bottom: 3px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.classes-bar.empty { justify-content: space-between; color: var(--muted); font-size: .92rem; }
.cb-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cb-chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.cb-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; font-weight: 650; padding: .35rem .75rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand); text-decoration: none !important; }
.cb-chip:hover { background: var(--brand); color: var(--brand-ink); }
.cb-chip .ico { width: 15px; height: 15px; }
.courses-body > .classes-bar { margin-top: 1.2rem; }

/* ---------- Quieter surfaces and type ----------
   Fewer outlined boxes: panels are plain fills with no border or ledge, and only inputs keep outlines.
   The serif is saved for page titles and the brand; everything else uses the plain sans. */
.card, .quick a, .subj-tiles a, .resume-card, .door, .num-test, .classes-bar, .course-card, .exam.card, .mock, .note-from, .feat, .feat-list a, .mastery, .donate-card {
  border: 0 !important; box-shadow: none !important;
}
.card.hover:hover, .quick a:hover, .subj-tiles a:hover, .door:hover, .num-test:hover, .course-card:hover { transform: none; background: var(--surface-2); }
.card.hover:active, .quick a:active, .subj-tiles a:active, .door:active, .num-test:active, .course-card:active { transform: scale(.99); }
.resume-card.empty { border: 1.5px dashed var(--line-strong) !important; background: transparent; }
.classes-bar { background: transparent; padding: 0; }
.btn.primary { border-bottom-width: 1.5px; }
.btn.primary:active { border-bottom-width: 1.5px; }
.note-from { transform: none; }
/* Course covers: keep the color and big icon, drop the shine, dots, and bubble. */
.cc-art { background: linear-gradient(135deg, var(--t), color-mix(in srgb, var(--t) 70%, #000)) !important; }
.cc-art::after { display: none; }
.mock .q-right, .mock .q-miss { box-shadow: none; }

/* Type: serif only for big titles. */
h2, .section-title, .feat h3, .course-card h3, .door b, .resume-card b, .mock-card b, .fc-title, .foot-brand b, .note-from .avatar,
.kpi-val, .score-main b, .facts dt, .mock-score b, .big-nums span, .bp-num, .bp-of, .dash-ring b, .ch-stats dt, .nt-n, .best-secs b, .stats-strip b, .sub-n, .steps li::before, .faq summary::after {
  font-family: var(--font) !important; font-style: normal !important; font-variation-settings: normal;
}
h2, .section-title { font-weight: 700; letter-spacing: -.01em; font-size: 1.35rem; }
.course-card h3, .door b, .resume-card b { font-weight: 700; letter-spacing: -.01em; }
.door b { font-size: 1.25rem; } .course-card h3 { font-size: 1.1rem; } .resume-card b { font-size: 1.05rem; }
.facts dt, .ch-stats dt, .bp-num, .nt-n, .best-secs b, .dash-ring b, .mock-score b, .big-nums span, .kpi-val { font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.note-from p { font-family: var(--font); }
.banner, .free-pill, .dash-tabs .tabs, .seg, .note, .feedback { border: 0 !important; box-shadow: none !important; }
.dash-tabs .tabs a.on { box-shadow: none; }
.mock { background: var(--surface); }
.ch-stats, .ch-stats > div { border: 0 !important; }
