/* PPA Helper — power-market terminal as editorial broadsheet.
   Identity: ink on warm paper, copper accent (the wire), monospace data spine.
   See docs/design.md. System fonts only; no web fonts, no frameworks. */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Charter", "Source Serif 4", "Iowan Old Style", "Palatino", "Georgia", "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* paper + ink */
  --bg: #f3efe6;
  --surface: #faf7f0;
  --surface-2: #ece6d8;
  --border: #d8cfbd;
  --rule: #1c1a17;            /* masthead / strong rule lines */
  --text: #1c1a17;
  --text-muted: #6b6356;

  /* copper — the single brand accent (electrical conductor) */
  --accent: #b06a2c;
  --accent-ink: #ffffff;
  --accent-soft: #f0e2d0;

  /* semantic money-flow — only ever on settlement direction */
  --flow-credit: #2f7d4f;     /* party receives */
  --flow-debit: #b1432c;      /* party pays */
  --warn: #b1432c;

  font-feature-settings: "tnum" 1;
}

[data-theme="dark"] {
  --bg: #15181b;
  --surface: #1d2125;
  --surface-2: #262b30;
  --border: #343b42;
  --rule: #e9e4d9;
  --text: #e9e4d9;
  --text-muted: #9aa2ab;
  --accent: #d18a4e;
  --accent-ink: #15181b;
  --accent-soft: #2c2620;
  --flow-credit: #57b07d;
  --flow-debit: #d9694f;
  --warn: #d9694f;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }   /* the [hidden] trap guard */

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0; }
h2 { font-size: 1.5rem; margin: 0 0 12px; }
h3 { font-size: 1.15rem; margin: 24px 0 8px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 14px; max-width: 68ch; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); font-weight: 600; }

/* skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---- masthead ---- */
.masthead {
  border-bottom: 3px double var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 40;
}
.masthead-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.masthead-controls { display: flex; align-items: center; gap: 10px; }
.wordmark { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.wordmark .spark { color: var(--accent); }
.masthead-tag {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em;
  border-left: 1px solid var(--border); padding-left: 16px;
}
.masthead-spacer { flex: 1; }

.theme-toggle {
  font-family: var(--font-mono); font-size: 12px; background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 8px; padding: 6px 10px; cursor: pointer;
  min-height: 32px; min-width: 64px; text-align: center;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

/* ---- nav (view switcher) ---- */
nav.views {
  max-width: 1180px; margin: 0 auto; padding: 0 14px;
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.nav-btn {
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); padding: 12px 14px; cursor: pointer; white-space: nowrap;
  min-height: 44px;
}
.nav-btn:hover { color: var(--text); }
.nav-btn[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---- layout ---- */
main { max-width: 1180px; margin: 0 auto; padding: 28px 22px 80px; }
.view { animation: fade 200ms ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lede {
  font-family: var(--font-serif); font-size: 1.22rem; line-height: 1.45; color: var(--text);
  max-width: 64ch; margin: 8px 0 24px;
}

.rule { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---- cards / grid ---- */
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}
.card h3 { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }

/* pills */
.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  vertical-align: middle;
}
.pill.outline { border: 1px solid var(--border); color: var(--text-muted); background: none; }
.pill.verified { border: 1px solid var(--flow-credit); color: var(--flow-credit); background: none; }
.pill.secondary { border: 1px solid var(--accent); color: var(--accent); background: none; }
.pill.gap { border: 1px solid var(--warn); color: var(--warn); background: none; }

/* source trail */
.src { font-size: 12px; color: var(--text-muted); }
.src::before { content: "Source: "; }

/* ---- simulator ---- */
.sim-layout { display: grid; gap: 22px; }
@media (min-width: 1024px) { .sim-layout { grid-template-columns: 320px 1fr; align-items: start; } }

.controls { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.controls fieldset { border: none; margin: 0 0 18px; padding: 0; }
.controls legend { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 700; padding: 0; margin-bottom: 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.field input[type="number"] {
  width: 100%; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 16px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
}
.field input[type="range"] { width: 100%; accent-color: var(--accent); }

.scenario-row { display: flex; flex-wrap: wrap; gap: 6px; }
.scenario-btn {
  font-size: 12px; font-weight: 600; padding: 7px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; min-height: 38px;
}
.scenario-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.toggle-row { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.toggle-row button {
  font-size: 12.5px; font-weight: 600; padding: 8px 14px; border: none; background: var(--surface-2);
  color: var(--text-muted); cursor: pointer; min-height: 40px;
}
.toggle-row button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* readout (data spine) */
.readout { display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.kpi .k-val { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-size: 1.7rem; margin-top: 2px; line-height: 1.1; }
.kpi .k-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.k-val.credit { color: var(--flow-credit); }
.k-val.debit { color: var(--flow-debit); }

.direction-banner {
  font-family: var(--font-mono); font-size: 13.5px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
}
.direction-banner strong { font-weight: 700; }
.direction-banner.credit { border-color: var(--flow-credit); }
.direction-banner.debit { border-color: var(--flow-debit); }

/* chart */
.chart-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px 6px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-muted); padding: 6px 6px 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* settlement table */
.table-wrap { overflow-x: auto; }
table.settle { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.settle th, table.settle td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--border); }
table.settle th:first-child, table.settle td:first-child { text-align: left; }
table.settle th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
table.settle td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.settle td.credit { color: var(--flow-credit); }
table.settle td.debit { color: var(--flow-debit); }
table.settle tfoot td { font-weight: 700; border-top: 2px solid var(--rule); border-bottom: none; }

/* ---- glossary ---- */
.glossary-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
#glossary-search {
  flex: 1; min-width: 200px; font-size: 16px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
}
.cat-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-btn { font-size: 12px; font-weight: 600; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); cursor: pointer; min-height: 36px; }
.cat-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.term {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 13px 16px;
}
.term dt { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.term dd { margin: 6px 0 0; color: var(--text); font-size: 14px; }
.term .term-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; }

/* ---- coverage scorecard ---- */
table.coverage { width: 100%; border-collapse: collapse; font-size: 14px; }
table.coverage th, table.coverage td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.coverage th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

/* per-view "On this page" contents bar */
.toc { margin: 14px 0 4px; }
.toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.toc li { counter-increment: toc; }
.toc-link {
  font: inherit; font-size: 13px; background: none; border: none; padding: 0;
  color: var(--text-muted); cursor: pointer; border-bottom: 1px dotted transparent;
}
.toc-link::before { content: counter(toc); color: var(--accent); font-weight: 700; margin-right: 5px; font-feature-settings: "tnum" 1; }
.toc-link:hover, .toc-link:focus-visible { color: var(--text); border-bottom-color: var(--accent); }
h2[id] { scroll-margin-top: 96px; }

/* inline glossary tooltip terms */
.gterm { border-bottom: 1px dotted var(--accent); cursor: help; }
.gterm-auto { border-bottom-color: var(--border); }
.gterm:hover, .gterm:focus-visible { border-bottom-color: var(--accent); border-bottom-style: solid; }

/* hover explainer card (shared, positioned by app.js) */
.term-card {
  position: fixed; z-index: 60; max-width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 8px 24px rgba(28, 26, 23, 0.18);
  font-size: 13.5px; line-height: 1.5;
}
.term-card p { margin: 0 0 6px; max-width: none; }
.term-card .term-card-name { font-weight: 700; font-family: var(--font-serif); }
.term-card .term-card-name .term-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-left: 4px; }
.term-card .term-card-src { font-size: 12px; color: var(--text-muted); }
.term-card .term-card-src a { color: var(--accent); }
.term-card .term-card-hint { font-size: 11.5px; color: var(--text-muted); margin-bottom: 0; border-top: 1px solid var(--border); padding-top: 6px; }

/* ---- footer ---- */
footer {
  border-top: 3px double var(--rule); margin-top: 40px;
  font-size: 12.5px; color: var(--text-muted);
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 20px 22px; }
.footer-inner a { color: var(--text-muted); text-decoration: underline; }

/* focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, a, input, [tabindex] { touch-action: manipulation; }

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition: none !important; }
}

@media (max-width: 639px) {
  h1 { font-size: 1.6rem; }
  main { padding: 20px 16px 70px; }
  .masthead-tag { display: none; }
  .lede { font-size: 1.06rem; }
  .masthead-spacer { display: none; }
  .masthead-controls { width: 100%; justify-content: space-between; }
}

/* ---- level filter + inline nav links ---- */
.lvl-hidden { display: none !important; }
.level-filter { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.level-filter button { font-size: 12px; font-weight: 600; padding: 6px 10px; border: none; background: var(--surface); color: var(--text-muted); cursor: pointer; min-height: 32px; }
.level-filter button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.nav-link-btn { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---- example PPAs (annotated) ---- */
.example-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.example-pill { font-family: var(--font-serif); font-size: 15px; font-weight: 600; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; }
.example-pill[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); }
.example-summary { font-size: 15px; color: var(--text-muted); max-width: 72ch; margin: 0 0 18px; }

.annotate { display: grid; gap: 16px; }
@media (min-width: 860px) { .annotate { grid-template-columns: 304px 1fr; align-items: start; } }

.clause-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.clause-row { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; }
.clause-row:hover { border-color: var(--accent); }
.clause-row[aria-selected="true"] { border-left-color: var(--accent); background: var(--accent-soft); }
.clause-label { font-size: 13px; font-weight: 600; }
.clause-val { font-size: 11.5px; color: var(--text-muted); }

.clause-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.clause-detail h3 { margin: 8px 0 6px; }
.clause-detail-val { font-size: 14px; color: var(--accent); margin: 0 0 12px; }
@media (min-width: 860px) {
  .clause-detail { position: sticky; top: 116px; }
  ol.path { position: sticky; top: 116px; z-index: 20; background: var(--bg); padding-bottom: 14px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; min-height: 32px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.gloss-chip::before { content: "\21AA\00A0"; color: var(--accent); }

/* ---- data centers ---- */
.dc-structure { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.dc-structure > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.dc-structure > summary::-webkit-details-marker { display: none; }
.dc-structure > summary .pill { margin-left: auto; }
.dc-structure > summary::after { content: "+"; color: var(--text-muted); font-size: 18px; width: 14px; text-align: center; }
.dc-structure[open] > summary::after { content: "\2212"; }
.dc-structure[open] > summary { border-bottom: 1px solid var(--border); }
.dc-s-name { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; }
.dc-s-body { padding: 14px 16px; }
.dc-s-body p { font-size: 14px; margin: 0 0 10px; max-width: none; }

.dc-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.dc-filter-btn { font-size: 12px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); cursor: pointer; min-height: 36px; }
.dc-filter-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

table.dc-table td, table.dc-table th { text-align: left; vertical-align: top; font-size: 13px; }
table.dc-table td.mono { white-space: nowrap; }

/* ---- perspectives ---- */
.voice-card .eyebrow { color: var(--accent); }
.voice-role { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 10px; }
.voice-card p { font-size: 14px; }
.voice-takeaway { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.resource-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.resource { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; min-height: 44px; }
.resource .pill { flex-shrink: 0; }

/* ---- learning-path stepper ---- */
.path { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.path li { flex: 1 1 200px; }
.path-step { width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 1px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; cursor: pointer; min-height: 44px; color: var(--text); }
.path-step:hover { border-color: var(--accent); background: var(--accent-soft); }
.path-n { grid-row: 1 / span 2; align-self: center; font-family: var(--font-serif); font-weight: 700; color: var(--accent); font-size: 1.3rem; }
.path-t { grid-column: 2; font-weight: 600; font-size: 13.5px; }
.path-lvl { grid-column: 2; font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.stage-n { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.78em; margin-right: 10px; vertical-align: middle; }

/* ---- generic accordion (foundations on-ramp) ---- */
details.acc { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
details.acc > summary { list-style: none; cursor: pointer; padding: 12px 16px; min-height: 44px; display: flex; align-items: center; font-family: var(--font-serif); font-weight: 600; font-size: 1.02rem; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "+"; margin-left: auto; color: var(--text-muted); font-size: 18px; width: 14px; text-align: center; }
details.acc[open] > summary::after { content: "\2212"; }
details.acc[open] > summary { border-bottom: 1px solid var(--border); }
.acc-body { padding: 12px 16px; }
.acc-body p { font-size: 14px; margin: 0; max-width: none; }

/* ---- numbered process list (drafting steps) ---- */
ol.steps { margin: 0 0 6px; padding-left: 0; list-style: none; counter-reset: step; }
ol.steps li { counter-increment: step; position: relative; padding: 9px 0 9px 40px; border-bottom: 1px solid var(--border); font-size: 15px; max-width: 74ch; }
ol.steps li:last-child { border-bottom: none; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-serif); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* ---- PPA draft generator ---- */
.draft-layout { display: grid; gap: 22px; }
@media (min-width: 1024px) { .draft-layout { grid-template-columns: 340px 1fr; align-items: start; } }

.draft-output {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; min-height: 400px; max-height: 72vh; overflow-y: auto;
  color: var(--text);
}
.draft-output:empty::before {
  content: "Fill the form and click Generate PPA →";
  color: var(--text-muted); font-style: italic;
}
.draft-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.draft-actions button { font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border: none; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-secondary:disabled { opacity: 0.4; cursor: default; }

/* --- self-check quiz --- */
.quiz { display: grid; gap: 16px; margin-top: 8px; }
.quiz-q { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.quiz-q .q-prompt { font-weight: 600; margin: 0 0 12px; }
.quiz-q .q-num { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt {
  text-align: left; font: inherit; font-size: 14.5px; line-height: 1.4;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text); cursor: pointer; min-height: 44px;
  display: flex; gap: 10px; align-items: baseline;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt .opt-key { font-family: var(--font-mono); font-weight: 700; color: var(--text-muted); }
.quiz-opt.correct { border-color: var(--flow-credit); background: var(--accent-soft); }
.quiz-opt.correct .opt-key { color: var(--flow-credit); }
.quiz-opt.wrong { border-color: var(--flow-debit); }
.quiz-opt.wrong .opt-key { color: var(--flow-debit); }
.quiz-explain { margin: 12px 0 0; font-size: 13.5px; color: var(--text-muted); border-left: 3px solid var(--accent); padding-left: 12px; }
.quiz-score { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* mobile nav scroll affordance — fade right edge to hint at off-screen tabs */
@media (max-width: 860px) {
  nav.views {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
  }
}

/* mobile overrides placed last so they win over later base component rules */
@media (max-width: 639px) {
  .path { display: grid; grid-template-columns: 1fr 1fr; }
  .path-lvl { display: none; }
  .path-step { min-height: 40px; padding: 8px 10px; }
}
