:root {
  --bg: #f8faf7; --surface: #ffffff; --surface-2: #eaf0eb;
  --ink: #233b32; --muted: #5d7067; --line: #d6e0d9;
  --brand: #2e6555; --brand-ink: #fff;
  --ok: #31664e; --ok-bg: #eaf4ed; --bad: #94492f; --bad-bg: #f9eee7;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16221e; --surface: #1c2b25; --surface-2: #283c32;
    --ink: #e2ece3; --muted: #a8beb0; --line: #3c5044;
    --brand: #b1d6bd; --brand-ink: #182b20;
    --ok: #b1d6bd; --ok-bg: #243d2d; --bad: #eeb798; --bad-bg: #3c2d25;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16221e; --surface: #1c2b25; --surface-2: #283c32;
  --ink: #e2ece3; --muted: #a8beb0; --line: #3c5044;
  --brand: #b1d6bd; --brand-ink: #182b20;
  --ok: #b1d6bd; --ok-bg: #243d2d; --bad: #eeb798; --bad-bg: #3c2d25;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
a { color: var(--brand); text-underline-offset: 4px; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
h1, h2, h3 { line-height: 1.35; font-weight: 550; margin: 0 0 14px; text-wrap: pretty; }
h1 { font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.035em; }
h1:focus { outline: none; }
h2 { font-size: 1.12rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
p { margin: 0 0 16px; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 10px; background: var(--surface); padding: 10px; z-index: 20; }
.topbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 20px 24px; max-width: 1160px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 1.16rem; font-weight: 650; text-decoration: none; letter-spacing: -.04em; }
.mark { font-weight: 400; font-size: 1.6rem; color: var(--brand); }
#nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 0 8px env(safe-area-inset-bottom); }
#nav a { min-height: 62px; display: flex; align-items: center; justify-content: center; font-size: .82rem; color: var(--muted); text-decoration: none; border-top: 2px solid transparent; }
#nav a[aria-current="page"] { color: var(--brand); border-top-color: var(--brand); font-weight: 650; }
main { max-width: 1000px; margin: auto; padding: 20px 24px; }
.panel, .hero, .explain { margin-bottom: 32px; padding: 24px 0; }
.narrow, .runner { max-width: 680px; margin-inline: auto; }
.eyebrow { font-size: .75rem; color: var(--muted); margin-bottom: 20px; letter-spacing: .06em; }
.lede { font-size: 1.04rem; max-width: 58ch; }
.muted, .tip { color: var(--muted); }
.small, .tip { font-size: .84rem; }
.fineprint { font-size: .8rem; color: var(--muted); max-width: 75ch; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; border: 1px solid transparent; border-radius: 5px; font: 550 .94rem/1.4 var(--sans); text-decoration: none; text-align: center; cursor: pointer; }
.btn.primary { color: var(--brand-ink); background: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { color: var(--brand); background: transparent; border-color: var(--line); }
.btn.danger { color: var(--bad); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }
.cta-row .btn { flex: 1 1 auto; }
.hero { padding-block: 32px 24px; }
.hero h1 { max-width: 20ch; }
.beta-scope { padding: 24px; background: var(--surface-2); margin-block: 8px 40px; border-radius: 5px; font-size: .9rem; }
.beta-scope p:last-child { margin-bottom: 0; }
.features { display: grid; gap: 22px; margin: 36px 0; }
.features article p { font-size: .9rem; color: var(--muted); }
.features h2 { font-size: 1rem; }
.explain { border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0; gap: 20px; }
.facts dt { font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts dd { margin: 0; font-size: .8rem; color: var(--muted); }
.site-footer { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); padding-block: 24px; margin-top: 40px; }
.site-footer span { flex-basis: 100%; }
.home-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-bottom: 0; }
.home-page .topbar { width: 100%; margin-block: 0; }
.home-page main { display: flex; flex-direction: column; flex: 1; width: 100%; margin-block: 0; }
.home-panel { width: 100%; }
.home-page .site-footer { margin-top: auto; }
.bridge-steps { padding-left: 24px; margin-block: 24px; }
.bridge-steps li { margin-bottom: 12px; }
.transfer-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 24px; border: 1px solid var(--brand); border-radius: 5px; background: var(--surface-2); }
.transfer-banner p { margin: 0; }
.transfer-banner .btn { flex-shrink: 0; }
.about-version { margin-top: 32px; color: var(--muted); font-size: .84rem; }
.contact-link { display: inline-flex; align-items: center; min-height: 44px; }
.notice, .resume-strip { padding: 14px 16px; background: var(--surface-2); font-size: .85rem; margin-bottom: 20px; border-radius: 4px; }
.resume-strip { display: flex; justify-content: space-between; }
.session-tools { margin-top: 24px; }
.chip { display: inline-block; font-size: .75rem; color: var(--muted); }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; }
.qmeta .subj { color: var(--brand); font-weight: 600; }
.chip.approved { color: var(--ok); }
.chip.rejected { color: var(--bad); }
.question-review { margin-bottom: 24px; }
.snapshot { font-size: .73rem; color: var(--muted); margin: 3px 0; }
.review-meta { font-size: .74rem; color: var(--muted); }
.review-meta summary { min-height: 32px; }
.review-meta p { overflow-wrap: anywhere; }
.qsource { font-size: .8rem; margin-bottom: 8px; }
.qcard { margin-bottom: 16px; }
.run-head { margin-bottom: 28px; }
.run-title { font-size: 1.18rem; }
.run-head .bar { margin-block: 10px 14px; }
.bar { height: 4px; overflow: hidden; background: var(--surface-2); }
.bar > span { display: block; height: 100%; background: var(--brand); }
.big-bar { margin-bottom: 24px; }
.stem { font-size: 1.08rem; font-weight: 550; line-height: 1.65; margin-bottom: 22px; }
.options { display: grid; gap: 8px; }
.opt { display: flex; gap: 14px; align-items: baseline; width: 100%; text-align: left; min-height: 52px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font: .94rem/1.5 var(--sans); cursor: pointer; }
.opt .letter { flex: none; color: var(--muted); font-size: .8rem; }
.opt:hover:not(:disabled), .opt.is-selected { border-color: var(--brand); background: var(--surface-2); }
.opt.is-correct { background: var(--ok-bg); border-color: var(--ok); }
.opt.is-wrong { background: var(--bad-bg); border-color: var(--bad); }
.opt:disabled { cursor: default; }
.feedback { padding-top: 28px; margin-top: 24px; border-top: 1px solid var(--line); }
.feedback .verdict { color: var(--ok); font-weight: 600; }
.feedback.bad .verdict { color: var(--bad); }
/* The article is the centre of the explanation: a provision with a margin
   reference, rather than another success/error card. The same rhythm repeats
   in subject rows, the study plan and history. */
.excerpt { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 16px; margin: 28px 0; padding: 22px 16px; background: var(--surface-2); border-radius: 3px; }
.excerpt p { font-size: 1.08rem; line-height: 1.85; letter-spacing: -.012em; }
.article-ref { grid-row: 1 / 3; font-size: .72rem; color: var(--muted); padding-top: 5px; }
.article-ref strong { display: block; font-size: 1.1rem; font-weight: 500; color: var(--brand); }
.excerpt footer { grid-column: 2; font-size: .76rem; color: var(--muted); }
.sr-note { font-size: .84rem; color: var(--muted); }
.actions { position: sticky; bottom: calc(62px + env(safe-area-inset-bottom)); padding: 12px 0; background: var(--bg); z-index: 3; }
.actions .btn { width: 100%; }
summary { cursor: pointer; min-height: 46px; padding-block: 12px; font-size: .9rem; }
details > p:first-of-type { margin-top: 12px; }
.assumptions, .diag-results, .exam-structure { border-top: 1px solid var(--line); margin-top: 26px; }
.assumptions { font-size: .85rem; }
.diag-results summary h2 { display: inline; font-size: .9rem; }
.diag-results ol { padding-left: 20px; }
.diag-results li { padding-block: 24px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.diag-results .ok { color: var(--ok); }
.diag-results .bad { color: var(--bad); }
.subject-grid { display: grid; gap: 0; margin: 24px 0; }
.subject-card { padding: 24px 0; border-bottom: 1px solid var(--line); }
.subject-card header { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.subject-card .rank { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); margin: 0 0 5px; }
.subject-card h2 { font-size: 1rem; margin: 0; }
.subject-card .big { font-size: 1.55rem; margin: 12px 0; font-variant-numeric: tabular-nums; }
.subject-card .bar { margin-bottom: 12px; }
.subject-card p:last-child { margin-bottom: 0; }
.weights { width: 100%; font-size: .8rem; border-collapse: collapse; }
.weights th, .weights td { text-align: left; padding: 10px 5px; border-bottom: 1px solid var(--line); }
.weights th:first-child { width: 48%; }
.weights tr.covered { color: var(--brand); }
.checklist, .mix, .forecast, .history { list-style: none; padding: 0; margin: 24px 0; }
.checklist li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mix li, .forecast li, .history li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; border-bottom: 1px solid var(--line); padding: 14px 0; font-size: .9rem; }
.mix li .small { grid-column: 1 / -1; }
.score-card { background: var(--surface-2); padding: 24px; border-radius: 4px; }
.score { font-size: 2rem; font-weight: 500; line-height: 1.3; margin: 0 0 18px; }
.score span { display: block; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.mastery-list { display: grid; gap: 24px; margin-block: 24px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
.mrow .bar { grid-row: 2; grid-column: 1 / -1; }
.mval { grid-column: 2; grid-row: 1; }
.two-col { display: grid; gap: 32px; }
.boxes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.boxes li { display: grid; border-bottom: 1px solid var(--line); padding: 8px 0; }
.boxes strong { font-size: 1.25rem; font-weight: 500; }
.spark { width: 100%; max-width: 480px; height: 70px; margin-block: 20px; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2; }
.spark-ref { stroke: var(--line); }
.field { display: grid; gap: 12px; margin: 32px 0 12px; }
.field input { max-width: 100%; min-width: 0; font-size: .85rem; }
.recovery h2, .narrow > h2 { margin-top: 32px; }
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .topbar { padding: 24px 36px; }
  #nav { position: static; display: flex; flex-wrap: wrap; max-width: 100%; gap: 24px; background: transparent; border: 0; padding: 0; }
  #nav a { min-height: 40px; border-top: 0; border-bottom: 2px solid transparent; font-size: .88rem; }
  #nav a[aria-current="page"] { border-bottom-color: var(--brand); }
  main { padding: 32px 40px; }
  .hero { padding-block: 42px 32px; max-width: 680px; }
  .hero h1 { max-width: none; }
  .beta-scope { max-width: 680px; padding: 24px 28px; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 36px; margin-block: 48px; }
  .facts { max-width: 420px; }
  .cta-row .btn { flex: 0 1 auto; }
  .subject-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 30px; }
  .subject-card header { display: block; }
  .subject-card h2 { min-height: 44px; margin-block: 8px; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .actions { position: static; }
  .actions .btn { width: auto; min-width: 220px; }
  .excerpt { padding: 28px 32px; }
  .site-footer span { flex-basis: auto; margin-left: auto; }
}
@media (max-width: 359px) {
  main { padding-inline: 18px; }
  .weights { font-size: .7rem; }
  .weights th, .weights td { padding-inline: 2px; }
}

.file-picker { position: relative; justify-self: start; overflow: hidden; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker:focus-within { outline: 2px solid var(--brand); outline-offset: 4px; }
@media (min-width: 760px) { .boxes { grid-template-columns: repeat(4, 1fr); } }

/* Article-first polish: one local serif, used only for statutory text. */
@font-face {
  font-family: "Source Serif 4";
  src: url('/fonts/source-serif-4-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.excerpt p { font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: 1.2rem; line-height: 1.6; letter-spacing: 0; }
.sample { padding-block: 24px; max-width: 680px; }
.sample h2 { font-size: 1.08rem; font-weight: 500; }
.sample .eyebrow { margin-bottom: 18px; }
.sample .excerpt { background: transparent; padding: 0; margin: 24px 0 18px; }
.sample .question-review { margin: 0; }
.sample-answer { font-size: .9rem; }
.beta-scope { background: transparent; padding: 24px 0; margin-bottom: 24px; }
.question-review { margin-top: 20px; margin-bottom: 12px; }
.review-meta summary { min-height: 44px; }
.run-head { margin-bottom: 20px; }
.run-head p { margin-bottom: 8px; }
.run-head .bar { margin-bottom: 0; }
.qmeta { margin-bottom: 12px; }
.stem { margin-bottom: 18px; }
.btn.quiet { color: var(--brand); background: transparent; font-weight: 400; }
.btn.quiet.danger { color: var(--bad); }
.pause-tools { font-size: .85rem; margin-bottom: 24px; }
.pause-tools summary { color: var(--brand); width: fit-content; min-width: 88px; }
.storage-note { margin-top: 32px; max-width: 680px; }
.storage-note h2 { font-size: 1rem; }
.storage-note p { max-width: 68ch; }
.storage-note .btn { font-size: .84rem; }
.subject-card { padding-block: 16px; }
.subject-card .big { font-size: 1.3rem; margin: 8px 0; }
.site-footer a, .excerpt footer a, .resume-strip a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a { min-height: 48px; padding-block: 8px; }
@media (max-width: 759px) {
  .focus-mode #nav, .focus-mode .site-footer { display: none; }
  .focus-mode { padding-bottom: env(safe-area-inset-bottom); }
  .focus-mode .actions { bottom: env(safe-area-inset-bottom); }
  .focus-mode .topbar { padding-block: 12px; }
  .focus-mode main { padding-top: 8px; }
  .subject-card header { grid-template-columns: 1fr auto; }
  .subject-card .rank { margin-bottom: 0; }
  .hero { padding-top: 16px; margin-bottom: 0; }
  .sample { padding-top: 12px; }
}
@media (min-width: 1000px) {
  .landing-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; padding-block: 28px 12px; }
  .landing-intro .hero, .sample { padding-block: 24px; margin-bottom: 0; }
  .hero h1 { max-width: 18ch; }
  .beta-scope { max-width: 760px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
@media (max-width: 759px) {
  .subject-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .subject-card header { display: block; }
  .subject-card header h2 { margin-bottom: 2px; }
  .subject-card .big { grid-column: 2; grid-row: 1; align-self: center; }
  .subject-card .bar { grid-column: 1 / -1; margin: 4px 0; }
  .subject-card > .small { grid-column: 1 / -1; }
  .brand { min-height: 44px; }
  .notice a { display: inline-flex; align-items: center; min-height: 44px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.report-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .8rem; text-underline-offset: 3px; }
