/* P3 — dashboard stylesheet, dark dashboard language, rebuilt originally.
   Same tokens as styles.css (near-black page #0A0A0A, white text, body
   #D4D4D4, muted #AAAAAA, amber accent spent only on primary pills /
   active tabs / key links, dark panels #1A1A1A, dark link-module headers
   #1E1E1E, hairlines #2A2A2A).
   Self-contained: defines every class app.html uses and every class
   app.js / workspace.js inject at runtime. Keeps the pinned selectors
   the suite reads from this file: .skip-link:focus, .app-rule,
   .nav-links a::after, .headliner-image, .disc-*, .leg-progress,
   .export-rail, .verdict-jump, .how-made, .ws-*.
   Dashboard shape (P3, distinct from a two-column desk): ONE divided
   gallery column — eyebrow-numbered sections separated by 72–96px of
   whitespace, each with its own visual anchor (figure, diagram, or
   chip row). Nothing is stacked on top of anything else: the verdict
   hero, the formula diagram, and the action rows each own their own
   band. The single nav carries both groups (main + proof index). */
:root {
  --paper: #0A0A0A;
  --footer-band: #111111;
  --purple: oklch(84% 0.19 80.46);
  --purple-light: #FBBF24;
  --purple-dark: #D97706;
  --ink: #FFFFFF;
  --body: #D4D4D4;
  --muted: #AAAAAA;
  --crumb: #AAAAAA;
  --hair: #2A2A2A;
  --lavender: #1A1A1A;
  --blue-band: #1E1E1E;
  --focus: #F59E0B;
  --sans: "Albert Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1080px;
  --radius-card: 12px;
  --radius-panel: 14px;
  --radius-pill: 999px;
  --radius-tab: 8px;
  --dur: 180ms;
}
* { box-sizing: border-box; }
html { background: var(--paper); overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--body);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0; }
h1 { font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-family: var(--display); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 500; }
p { margin: 0 0 12px; }
a { color: var(--purple-light); text-underline-offset: 3px; }
a:hover { color: var(--purple-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px;
}
img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 8px 0 12px; padding-left: 22px; }
li { margin-bottom: 6px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.eyebrow, .specimen {
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--purple); margin: 0 0 8px;
}
.label { font-size: 13px; color: var(--muted); }

/* Header: static, dark, hairline below. The appbar is NOT sticky. */
.nav, .appbar { background: var(--paper); border-bottom: 1px solid var(--hair); }
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 16px 28px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.wordmark { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.app-kicker { font-size: 20px; font-weight: 700; color: var(--purple); }
.badge {
  font-size: 13px; font-weight: 600; color: var(--ink); background: var(--lavender);
  border: 1px solid var(--hair); border-radius: var(--radius-pill); padding: 6px 14px; white-space: nowrap;
}
.badge.ok { background: #1A1A1A; border-color: var(--purple); color: var(--purple-dark); }
.badge.amber { background: #2A1E05; border-color: #F59E0B; color: #FCD34D; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-left: auto; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
  min-height: 48px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--radius-pill);
}
.nav-links a:hover { background: var(--lavender); color: var(--ink); }
/* Active-link indicator only (no hover underline animation — hover darkens). */
.nav-links a::after { content: ""; display: none; }
.nav-links a[aria-current="page"] { background: var(--purple); color: #0A0A0A; }
.nav-group { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.nav-group--proof { border-left: 1px solid var(--hair); padding-left: 12px; margin-left: 4px; }
.nav-group-label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.nav-cta { margin-left: 8px; }
.nav-toggle { margin-left: auto; }
.nav-scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.4); z-index: 80; opacity: 0; pointer-events: none; transition: opacity 300ms ease-out; }
.nav-scrim.is-open { opacity: 1; pointer-events: auto; }
/* Drawer controls are hidden on desktop by the .btn.nav-* rule below
   (higher specificity than .btn, placed after it); see the ≤820px
   media query for the matching .btn.nav-* reveal rules. */
.skip-link { position: absolute; left: -9999px; top: 0; background: #1E1E1E; color: var(--ink); border: 2px solid var(--purple); padding: 12px 20px; z-index: 100; border-radius: var(--radius-pill); font-weight: 600; }
.skip-link:focus { position: fixed; left: 16px; top: 16px; }

/* Buttons: pill-shaped. Primary amber fill; secondary outlined gray. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: var(--radius-pill);
  border: 1px solid var(--hair); background: #1E1E1E; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.nav-toggle, .btn.nav-close { display: none; }
.btn:hover { background: var(--lavender); color: var(--ink); }
.btn--primary { background: var(--purple); border-color: var(--purple); color: #0A0A0A; }
.btn--primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: #0A0A0A; }
.btn-sm { min-height: 48px; padding: 10px 16px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn { color: var(--purple); font-weight: 600; min-height: 48px; display: inline-flex; align-items: center; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--purple-dark); }

.breadcrumb { font-size: 13px; color: var(--crumb); padding: 24px 0 0; }
.breadcrumb a { color: var(--crumb); }
.title-block { padding: 16px 0 0; }
.title-block p.sub { font-size: 16px; max-width: 64ch; color: var(--muted); }
.title-block .title-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
/* V4 flow steps (user-approved sketch v4): five numbered steps, one
   row, active step gold. Divs, never links — the sidebar nav keeps
   the only #verdict link on the page. */
.flow-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 32px; }
.flow-step { border-top: 2px solid var(--hair); padding-top: 8px; }
.flow-step.on { border-top-color: var(--purple); }
.flow-step .flow-num { font-size: 11px; letter-spacing: 0.14em; color: var(--muted); margin: 0; }
.flow-step.on .flow-num { color: var(--purple); }
.flow-step .flow-title { font-size: 14px; font-weight: 500; color: var(--ink); margin: 0; }
.flow-step .flow-sub { font-size: 12px; color: var(--muted); margin: 0; }
/* V4 section system: sections are cards (panel, hairline, 14px, 24px
   padding, 32px gaps) — not borderless bands with 72px whitespace.
   Disc sections keep their own disc layout; only their separation
   (margin-top) comes from here. */
main > section, main > .desk, main > .lower-grid { padding: 0; }
.desk { display: block; }
.rail { display: block; }
main .sheet, main section.sheet { margin-top: 32px; }
main section.sheet:not(.disc) {
  background: var(--lavender); border: 1px solid var(--hair);
  border-radius: var(--radius-panel); padding: 24px;
}
.sheet-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.sheet-head img { width: 40px; height: 40px; flex: none; border-radius: 8px; }
.sheet-head h2 { margin-bottom: 4px; }
.sheet-head .label { margin: 0; }
/* Figures: borderless, large thumbnail, gray caption. No container, no shadow. */
.fig { margin: 0 0 24px; min-width: 0; }
.fig img { width: 100%; border-radius: var(--radius-card); }
.fig figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.fig-fallback { display: none; border: 1px solid var(--hair); border-radius: var(--radius-card); padding: 16px; background: var(--lavender); color: var(--ink); font-size: 15px; }
.fig-fallback.show { display: block; }
.img-missing { display: none; }
/* Hairline rule before the footer (decorative svg line, 1px). */
.app-rule { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.app-rule svg { display: block; width: 100%; height: 12px; }
.app-rule line { stroke: var(--hair); stroke-width: 1; }

/* V4 form: 4-field main row + 3-field optional row, uniform 56px
   fields, 11px uppercase labels above inputs. The #offerForm id
   beats kinpaku's .formstrip flex, so the grid below governs. */
form .field { margin-bottom: 0; }
form label, .checker-field { display: grid; gap: 6px; font-weight: 600; color: var(--ink); font-size: 15px; }
#offerForm .field > label {
  display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
form input, .checker-field input {
  min-height: 56px; width: 100%; padding: 0 16px; font: inherit; font-size: 16px;
  color: var(--ink); background: #1E1E1E; border: 1px solid var(--hair); border-radius: 8px;
}
form input:focus, .checker-field input:focus { border-color: var(--purple); outline: 2px solid var(--purple); outline-offset: 1px; }
.field-hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.field-more { margin-top: 6px; }
.field-more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--purple); min-height: 48px; display: flex; align-items: center; }
.form-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.form-actions .form-note { font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }
#offerForm { display: grid; grid-template-columns: 1fr; gap: 0; }
#offerForm .form-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
#offerForm .form-row--opt { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
#offerForm .form-row--costs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; gap: 16px; }
#offerForm .form-actions { grid-column: 1 / -1; margin-top: 24px; }
.form-disabled-note { background: #2A1210; border: 1px solid #FECACA; border-radius: 12px; padding: 14px 16px; color: #FECACA; font-size: 15px; }
.config-banner { background: #2A1210; border: 1px solid #FECACA; border-radius: 16px; padding: 20px 24px; color: #FECACA; margin: 24px 0 0; }
.config-banner p { margin: 0 0 6px; }
.status { background: var(--lavender); border-radius: var(--radius-panel); padding: 20px 24px; margin: 24px 0; }
.status:empty { display: none; }
.leg-progress { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--hair); }
.leg-progress li { font-size: 14px; line-height: 1.5; color: var(--ink); padding: 10px 0; border-bottom: 1px solid var(--hair); margin: 0; }
/* Trial cards: borderless cards with thumbnail treatment via dark panel. */
.trial-cards { margin-top: 24px; }
.trial-cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
.trial-card { background: var(--lavender); border-radius: var(--radius-panel); padding: 16px; cursor: pointer; min-height: 48px; color: var(--ink); }
.trial-card:hover { background: var(--blue-band); }
.trial-card--blank { background: #1E1E1E; border: 1px dashed var(--hair); }
.trial-card-be { font-size: 20px; font-weight: 800; color: var(--ink); }

/* Verdict hero: number is the page (64px light), unit inline small.
   The .verdict-card qualifier beats kinpaku's plain .verdict-unit
   block rule, so the unit sits beside the number as sketched. */
.verdict-card { background: var(--lavender); border-radius: var(--radius-panel); padding: 32px; }
.verdict-card.sheet { padding: 32px; }
.verdict-number { font-family: var(--display); font-size: 64px; line-height: 1.1; font-weight: 300; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.verdict-unit { font-size: 19px; font-weight: 700; color: var(--ink); }
.verdict-card .verdict-unit { display: inline; font-size: 18px; font-weight: 400; color: var(--muted); margin-top: 0; }
.verdict-formula-line { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 8px 0 0; }
.verdict-line { font-size: 18px; color: var(--ink); font-weight: 600; }
.source-tag-line { font-size: 14px; color: var(--muted); }
.confidence-box { background: #1E1E1E; border: 1px solid var(--hair); border-radius: 12px; padding: 16px; margin: 16px 0; }
.thin-badge { background: #2A1E05; border: 1px solid #F59E0B; border-radius: 12px; padding: 12px 16px; color: #FCD34D; font-size: 15px; margin: 12px 0; }
.cannot-box { background: #2A1210; border: 1px solid #FECACA; border-radius: 12px; padding: 14px 16px; color: #FECACA; margin: 12px 0; }
.capacity-badge { font-size: 15px; font-weight: 600; color: var(--ink); margin: 12px 0; }
.capacity-badge.unknown { color: var(--muted); }
.unknown-box { background: #2A1E05; border: 1px solid #F59E0B; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.cite-chips, .proof-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.cite-chip, .source-tag-chip {
  min-height: 48px; display: inline-flex; align-items: center; padding: 4px 12px;
  background: #1E1E1E; border: 1px solid var(--hair); border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.proof-summary li { margin: 0; background: #1E1E1E; border: 1px solid var(--hair); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 0; }
.facts div { background: #1E1E1E; border: 1px solid var(--hair); border-radius: var(--radius-pill); padding: 8px 14px; font-size: 14px; }
.facts dt { display: inline; font-weight: 600; color: var(--ink); margin-right: 6px; }
.facts dd { display: inline; margin: 0; }
.sign-checklist { display: grid; gap: 8px; margin: 12px 0; }
.aggregate-note { font-size: 14px; color: var(--muted); }
.verdict-jump { margin-top: 16px; }
.export-rail { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.share-note { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.proof-pack-wrap, .rerank-section { border-top: 1px solid var(--hair); margin-top: 24px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.proof-pack-wrap h3, .rerank-section h3 { flex-basis: 100%; }
.rerank-out { font-size: 15px; }
.how-made { margin-top: 20px; border-top: 1px solid var(--hair); padding-top: 12px; }
.how-made summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); min-height: 48px; display: flex; align-items: center; }
/* Headliner image (static slot in app.html, filled by app.js): capped
   width, rounded, never page-scrolling. Hidden by default via the
   hidden attribute; a verdict without a Qloo image, or a failed load,
   leaves it hidden — never a placeholder, never a stretched image. */
.headliner-image { margin: 0 0 20px; }
.headliner-image[hidden] { display: none !important; }
.headliner-image img { display: block; width: 100%; max-width: 420px; height: auto; border-radius: var(--radius-card); background: var(--lavender); }
.headliner-image figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* Formula: dark diagram panel + live numbers; checker below it. */
.diagram { background: var(--lavender); border-radius: var(--radius-panel); padding: 24px; margin: 20px 0; }
.diagram-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.diagram-cell { display: grid; gap: 4px; min-width: 0; }
.diagram-dim-label { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.diagram-value { font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.diagram-build { font-size: 14px; color: var(--body); max-width: 32ch; }
.diagram-op { font-size: 28px; font-weight: 700; color: var(--ink); padding-bottom: 6px; }
.diagram-ceil { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; border-top: 1px solid var(--hair); margin-top: 20px; padding-top: 16px; }
.diagram-ceil-line { display: none; }
.diagram-ceil-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.diagram-result { font-size: 28px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.diagram-note { margin: 12px 0 0; }
.checker { background: #1E1E1E; border: 1px solid var(--hair); border-radius: var(--radius-panel); padding: 24px; margin-top: 20px; }
.checker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0; }
.checker-out { font-size: 18px; font-weight: 700; color: var(--ink); }
.cost-lines { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.cost-lines li { background: #1E1E1E; border: 1px solid var(--hair); border-radius: 8px; padding: 8px 14px; font-size: 14px; overflow-wrap: anywhere; }
.cost-lines .cost-label { font-weight: 600; }
.cost-lines .cost-value { color: var(--ink); }
/* Evidence: native details cards, each with its own icon + chip row. */
details { border-top: 1px solid var(--hair); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 18px; min-height: 48px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 8px; }
.proof-note-details { border-top: 1px solid var(--hair); padding: 12px 0; }
/* Receipts as a link module: dark header band, chevron rows. */
#receiptSection .disc-head-row, .disc-head-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.disc-toggle { flex: none; }
.disc--closed .disc-body { display: none; }
#receiptSection { border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; padding: 0; }
#receiptSection .disc-head-row { background: var(--blue-band); padding: 20px 24px; }
#receiptSection .disc-body { padding: 0 24px 24px; }
.receipt, .set > div { border-top: 1px solid var(--hair); padding: 14px 0; }
.receipt:first-child, .set > div:first-child { border-top: 0; }
.step-lead { font-size: 14px; color: var(--muted); }
.receipt-step { font-size: 15px; }
.source-tag { font-size: 13px; color: var(--muted); }
.replay-out { margin-top: 12px; font-size: 15px; }
/* Verdict sheet, race, workspace panels. */
.verdict-sheet .sheet-actions, .sheet-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.race-toggle-wrap { margin: 16px 0; }
.race-timer { font-size: 15px; font-weight: 600; color: var(--ink); margin: 12px 0; }
.race-note { background: #2A1E05; border: 1px solid #F59E0B; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.lane { border-top: 1px solid var(--hair); padding: 14px 0; }
.lane-head { font-weight: 700; color: var(--ink); }
.lane-pick { font-size: 19px; font-weight: 800; color: var(--ink); }
.lane-bar { height: 8px; background: var(--hair); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.lane-bar--empty { background: var(--hair); }
.lane-unavailable { color: var(--muted); font-size: 14px; }
.miss-taxonomy { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.ws-panel { background: var(--lavender); border-radius: var(--radius-panel); padding: 24px; min-width: 0; }
.ws-panel h3 { margin-bottom: 6px; }
#workspace .ws-label, #workspace .ws-out, #workspace .ws-replay-out { font-size: 14px; line-height: 1.5; color: var(--ink); }
.ws-big, .big { font-size: 34px; line-height: 1.1; font-weight: 800; color: var(--ink); }
.ws-g { font-weight: 600; white-space: nowrap; }
.ws-form { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
.ws-form > * { grid-column: 1 / -1; min-width: 0; }
.ws-form label { display: grid; gap: 8px; font-weight: 600; color: var(--ink); }
.ws-form input[type="text"], .ws-form input:not([type]), .ws-form input[type="number"], .ws-form textarea {
  min-height: 48px; width: 100%; padding: 10px 14px; font: inherit; font-size: 16px;
  color: var(--ink); background: #1E1E1E; border: 1px solid var(--hair); border-radius: 12px;
}
.ws-form fieldset { border: 1px solid var(--hair); border-radius: 12px; padding: 16px; margin: 0; display: grid; gap: 16px; }
.ws-form fieldset legend { font-weight: 600; padding: 0 8px; }
.ws-form input[type="radio"] { min-width: 48px; min-height: 48px; width: 48px; height: 48px; accent-color: var(--purple); vertical-align: middle; }
.ws-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: var(--radius-pill); border: 1px solid var(--hair); background: #1E1E1E; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.ws-btn:hover { background: var(--lavender); }
.ws-btn--primary { background: var(--purple); border-color: var(--purple); color: #0A0A0A; }
.ws-btn--primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }
/* Primary-button focus must stay visible: the generic focus outline is
   amber, which is invisible on an amber button, so primary buttons get
   a white focus-visible outline instead (glow halos unchanged). */
.btn--primary:focus-visible, .ws-btn--primary:focus-visible { outline-color: #FFFFFF; }
.ws-btn--sm { min-height: 48px; }
.ws-btn:disabled { opacity: 0.5; cursor: default; }
.ws-file-label { display: inline-block; line-height: 32px; }
.ws-msg { border-top: 1px solid var(--hair); padding-top: 8px; }
.ws-msg--ok { font-weight: 600; }
.ws-msg--refused { font-weight: 600; }
.ws-refusal { border: 1px solid var(--hair); border-radius: 12px; padding: 16px; margin: 16px 0; }
.ws-row { border-top: 1px solid var(--hair); padding: 16px 0; }
.ws-row--refused { opacity: 1; }
.ws-row--mismatch, .ws-receipt.ws-row--mismatch { color: var(--muted); }
.ws-mismatch { font-weight: 600; }
.ws-receipts { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.ws-receipt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws-table-wrap { overflow-x: auto; margin: 16px 0; }
.ws-why-not { min-width: 180px; }
.ws-season-ledger { font-weight: 600; }
.ws-table { border-collapse: collapse; min-width: 640px; width: 100%; }
.ws-table th, .ws-table td { border-bottom: 1px solid var(--hair); padding: 12px 10px; text-align: left; font-size: 15px; }
.ws-table th { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ws-offer { margin-bottom: 8px; }
.ws-mapstrip-svg { display: block; width: 100%; height: auto; background: #1E1E1E; border: 1px solid var(--hair); border-radius: 12px; margin: 16px 0 8px; }
.ws-pin { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.ws-pin--base { fill: var(--purple); stroke: var(--ink); }
.ws-pin-label { font-family: var(--sans); font-size: 13px; line-height: 16px; fill: var(--ink); }
.ws-pin-label--base { font-weight: 700; }
.ws-mapstrip-caption { list-style: none; padding: 0; margin: 8px 0 16px; }
.ws-mapstrip-caption li { font-size: 14px; line-height: 1.5; }
.ws-cand-btn { min-height: 48px; }
.ws-settle-line { font-weight: 600; }
.depth-table, .table-wrap table { border-collapse: collapse; width: 100%; }
.table-wrap { overflow-x: auto; }
.depth-table th, .depth-table td { border-bottom: 1px solid var(--hair); padding: 12px 10px; text-align: left; font-size: 15px; vertical-align: top; }
.depth-table th { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stamp { display: inline-flex; min-height: 32px; align-items: center; padding: 4px 12px; background: var(--lavender); border: 1px solid var(--hair); border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.row-wired .stamp { background: #2A1E05; border-color: #F59E0B; color: #FCD34D; white-space: normal; }
.tally-line { font-weight: 700; color: var(--ink); }
.proof-note { font-size: 15px; }
.safety { background: var(--lavender); border-radius: var(--radius-panel); padding: 24px; }
.safety p { margin: 0; }
/* Footer: dark band, 3 columns, pill CTA, hairline above bottom bar. */
.footer { background: var(--footer-band); border-top: 1px solid var(--hair); padding: 40px 0 0; overflow-x: clip; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.footer-cta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.footer-cta p { font-size: 18px; font-weight: 500; color: var(--ink); margin: 0; max-width: 56ch; }
.footer-disclaimer, .footer-lead { max-width: 72ch; font-size: 15px; margin: 0 0 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 40px; }
.footer-cols h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-cols li { margin: 0; }
.footer-cols a { color: var(--ink); text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; overflow-wrap: anywhere; }
.footer-cols a:hover { color: var(--purple); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--hair); padding: 20px 0 32px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-bottom p { font-size: 13px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.footer .colophon, .colophon { font-size: 13px; color: var(--muted); }
.footer p { color: var(--body); font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.footer-links a { color: var(--ink); min-height: 48px; display: inline-flex; align-items: center; }
/* Print: chrome off, sheet + workspace printable (baseline print list, restyled). */
@media print {
  .nav, .appbar, .sidebar-panel, .sidebar-toggle, .nav-scrim, #tool, #status, #raceToggleWrap, #raceSection, #trialTally, #receiptSection, #depth, #formula, #ledger, #limits, .safety, .footer, #verdict, #partialSection { display: none !important; }
}
/* Narrow: single column everywhere, drawer nav, 48px targets, no page scroll. */
@media (max-width: 820px) {
  .wrap, .nav-inner, .footer-inner, .app-rule { padding-left: 16px; padding-right: 16px; }
  main section.sheet:not(.disc) { padding: 20px; }
  .flow-steps { grid-template-columns: 1fr 1fr; }
  #offerForm .form-row, #offerForm .form-row--opt, #offerForm .form-row--costs, .checker-grid, .ws-grid, .trial-cards-row { grid-template-columns: 1fr; }
  .form-actions .form-note { margin-left: 0; text-align: left; }
  .btn.nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; margin: 0;
    width: min(320px, 86vw); flex-direction: column; align-items: stretch; justify-content: flex-start;
    background: #1E1E1E; padding: 16px; gap: 4px; overflow-y: auto;
    transform: translateX(105%); transition: transform 300ms ease-out;
    box-shadow: -16px 0 32px rgba(17, 24, 39, 0.15);
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { width: 100%; }
  .nav-group { flex-direction: column; align-items: stretch; }
  .nav-group--proof { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--hair); padding-top: 12px; margin-top: 8px; }
  .btn.nav-close { display: inline-flex; align-self: flex-end; }
  .nav-cta { margin-left: 0; }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .verdict-card.sheet, .verdict-card { padding: 24px 20px; }
  #receiptSection .disc-head-row { padding: 16px 20px; }
  #receiptSection .disc-body { padding: 0 20px 20px; }
  .diagram { padding: 20px; }
}
@media (max-width: 390px) {
  .wrap, .nav-inner, .footer-inner, .app-rule { padding-left: 16px; padding-right: 16px; }
  .verdict-number { font-size: 64px; }
  .diagram-value { font-size: 20px; }
  .headliner-image img { max-width: 100%; }
}
/* Motion: quiet chrome only. */
.fig img { animation: p3-fade 300ms ease-out; }
@keyframes p3-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .fig img { animation: none; }
  .nav-links { transition: none; transform: none; }
  .nav-scrim { transition: none; }
  .app-rule { animation: none; }
  .nav-links a::after { display: none; }
}
/* Reduced-motion closed-drawer hiding, drawer viewport ONLY. The
   unscoped rule that used to live in the reduced-motion block above
   hid the whole nav on desktop (the toggle that sets .is-open is
   itself hidden above 820px). The reduced-motion block also sets
   .nav-links transform: none, which disables the off-canvas hiding,
   so this display rule must survive inside the drawer viewport. */
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .nav-links:not(.is-open) { display: none; }
}

/* ---------- Dark dashboard additions (coordinator, merge) ----------
   Dark cinematic language engineered for dense tools. Amber is the ONE
   glow accent (buttons, focus, active states); everything else is
   monochrome + hairlines so numbers stay scannable. All pinned selectors
   above are untouched; these rules only add. */
:root {
  --display: "Albert Sans", ui-sans-serif, system-ui, sans-serif;
  --glow: #F59E0B;
  --glow-soft: rgba(245, 158, 11, .35);
  --color-paper-2: #D4D4D4;
  --color-paper-hi: #FFFFFF;
}

/* Glowing primary buttons: static halo at rest, stronger on hover/focus,
   one shimmer sweep on hover/focus. Never glow-only meaning: near-black
   text on the amber fill with an amber border is the button even with
   no glow. */
.btn--primary {
  position: relative; overflow: hidden;
  border-color: var(--glow);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .55), 0 0 24px rgba(245, 158, 11, .35), 0 0 48px rgba(245, 158, 11, .18);
}
.btn--primary:hover, .btn--primary:focus-visible {
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .8), 0 0 32px rgba(245, 158, 11, .5), 0 0 64px rgba(245, 158, 11, .25);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); pointer-events: none;
}
.btn--primary:hover::after, .btn--primary:focus-visible::after { transform: translateX(120%); transition: transform 600ms ease-out; }

/* Verdict spotlight panel: soft amber light following the pointer
   (pointer:fine only, set by dark-dash.js); keyboard focus shows a
   static spotlight, so the effect is never hover-only. */
.spotlight { position: relative; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(245, 158, 11, .14), transparent 70%);
}
.spotlight:focus-within::before {
  background: radial-gradient(320px circle at 50% 30%, rgba(245, 158, 11, .14), transparent 70%);
}

/* Form: instant usability first. The form enters once (fast rise,
   fields never hidden behind animation, inputs focusable from paint);
   engaging the form intensifies its halo. Focus ring is amber + text
   label change, never color alone (labels stay visible above fields). */
#offerForm { animation: form-in 600ms ease-out both; }
@keyframes form-in { from { transform: translateY(10px); } to { transform: translateY(0); } }

/* Dashboard title letter reveal (JS-gated splitter in app.js; without
   JS the h1 text stays whole). Words are nowrap wrappers, so words
   never break mid-word; characters stagger in, capped at 840ms. */
[data-title-reveal] .tr-word { display: inline-block; white-space: nowrap; }
[data-title-reveal] .tr-char { display: inline-block; opacity: 0; transform: translateY(.3em); transition: opacity 500ms ease-out, transform 500ms ease-out; transition-delay: var(--d, 0ms); }
[data-title-reveal].revealed .tr-char { opacity: 1; transform: none; }

/* Formula divider draw-on (decorative only, carries no data). Without
   JS the full stroke shows; JS adds .js-draw, then .drawn on intersect
   draws the single horizontal path once to a static full stroke. */
.formula-divider { display: block; width: 100%; max-width: 600px; height: 24px; margin: 8px 0 16px; }
.formula-divider-path { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 2; }
.formula-divider.js-draw .formula-divider-path { stroke-dasharray: 100; stroke-dashoffset: 100; }
.formula-divider.js-draw.drawn .formula-divider-path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s ease-out; }
#tool:focus-within { box-shadow: 0 0 0 1px rgba(245, 158, 11, .4), 0 0 32px rgba(245, 158, 11, .15); }
form input:focus, .checker-field input:focus { border-color: var(--glow); outline: 2px solid var(--glow); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }


/* Quiet tabular rows: hairline dividers, generous row padding. */
.ws-table-wrap td, .ws-table-wrap th { padding: 16px 12px; border-bottom: 1px solid var(--hair); }

/* Footer: dark band, light text, clips horizontally (suite-pinned). */
.footer.band--deep { background: #0A0A0A; border-top: 1px solid var(--hair); overflow-x: clip; }
.footer.band--deep p { color: var(--color-paper-2); max-width: 100%; }
.footer.band--deep a { color: var(--color-paper-hi); }
/* App-footer twin of the landing fix: without this, a footer .btn--primary
   (amber pill) inherits white text — readable but poor contrast. */
.footer.band--deep .footer-cta a.btn--primary { color: #0A0A0A; }

@media (prefers-reduced-motion: reduce) {
  .btn--primary::after { display: none; }
  .btn--primary, .btn--primary:hover, .btn--primary:focus-visible { box-shadow: 0 0 0 1px rgba(245, 158, 11, .55); }
  #offerForm { animation: none; }
  .spotlight::before { display: none; }
  [data-title-reveal] .tr-char { opacity: 1; transform: none; }
  .formula-divider.js-draw .formula-divider-path { stroke-dashoffset: 0; }
}

/* T5 mobile surface (tech): 48px link display, table/nav scroll capture,
   min-width chain so a 640px table cannot push grid tracks, narrow
   formula stacking, file-label display, nav CTA height, safe areas.
   Appended only; no existing rule above is changed. */
.link-btn { display: inline-flex; align-items: center; }
.nav-cta { min-height: 48px; }
.ws-table-wrap, .table-wrap { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.rail > *, .lower-grid > *, .sheet { min-width: 0; }
#workspace .ws-panel { min-width: 0; }
.sheet-head > div { min-width: 0; }
.lane-head { flex-wrap: wrap; }
#workspace .ws-file-label { display: inline-flex; align-items: center; }
.appbar { padding-top: env(safe-area-inset-top); }
.footer.band--deep { padding-bottom: max(48px, calc(48px + env(safe-area-inset-bottom))); }
@media (max-width: 640px) {
  .nav-group { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .diagram-cell { flex: 1 1 100%; }
  .footer.band--deep { padding-bottom: max(40px, calc(40px + env(safe-area-inset-bottom))); }
}

/* ---------- SIDEBAR CONSOLIDATION (one sidebar only) ----------
   Replaces the removed top header bar and the removed floating glass
   toolbar. The sidebar panel is the dashboard's ONLY navigation
   chrome: on desktop it is persistent (fixed left, content offset by
   .app-shell); at <=820px it becomes a left drawer opened by the
   fixed Menu toggle. The .nav/.appbar rule above is RETAINED (static,
   never sticky) only because the suite pins that exact rule; no
   header element ships anymore — the sidebar replaces it, and the
   safe-area top inset the suite also pins now lives on the panel.
   The floating-toolbar rules were deleted with the bar itself. The old
   <=820px .nav-links drawer rules below are overridden here by the
   higher-specificity .sidebar-panel rules (panel carries the drawer,
   the nav inside it is a plain column). */
.sidebar-panel {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 90;
  width: 280px; display: flex; flex-direction: column;
  background: #111111; border-right: 1px solid var(--hair);
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.sidebar-head {
  flex: none; display: grid; gap: 12px; padding: 8px 20px 20px;
  border-bottom: 1px solid var(--hair);
}
.sidebar-head .badge { white-space: normal; text-align: center; }
.sidebar-head .btn { width: 100%; }
.sidebar-panel .nav-links {
  flex: 1; display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; margin: 0; padding: 16px; overflow-y: auto; overflow-x: hidden;
  position: static; transform: none; width: auto; background: transparent;
  box-shadow: none;
  /* Base .nav-links sets flex-wrap: wrap; without this override the
     drawer nav wraps into two columns at 390px and groups 2-3 clip past
     the panel edge. The v3 app nav has a single group today, so this is
     currently untriggered — it is a guard, not a visible change. */
  flex-wrap: nowrap;
}
.sidebar-panel .nav-group { flex-direction: column; align-items: stretch; overflow-x: visible; overflow-y: visible; }
.sidebar-panel .nav-group--proof { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--hair); padding-top: 12px; margin-top: 8px; }
.sidebar-panel .nav-links a { width: 100%; }
.sidebar-panel .btn.nav-close { display: none; }
/* V4 nav items: number + link + state on one row. The number and state
   are siblings of the <a>, never inside it — the sidebar link-text
   pin reads <a> contents exactly, so nothing may nest inside a link. */
.sidebar-panel .nav-item { display: flex; align-items: baseline; gap: 12px; }
.sidebar-panel .nav-item a { flex: 1; width: auto; }
.sidebar-panel .nav-num { font-size: 11px; letter-spacing: 0.14em; color: var(--purple); flex: none; }
.sidebar-panel .nav-state { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; flex: none; }
.sidebar-panel .btn.nav-toggle, .sidebar-toggle { display: none; }
/* Inert-but-explained verdict links (pre-run, and Race until a race
   runs): still real links with real targets, but muted, never
   glowing, and app.js intercepts the click with an explanation
   instead of jumping to a hidden section. Live links are untouched. */
.sidebar-panel .nav-verdict-link[aria-disabled="true"] {
  opacity: 0.75; color: var(--muted); cursor: not-allowed;
}
.sidebar-panel .nav-verdict-link[aria-disabled="true"]:hover { background: transparent; color: var(--muted); }
.sidebar-note { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; }
.sidebar-status { font-size: 14px; line-height: 1.5; color: var(--ink); margin: 8px 0 0; }
.sidebar-status:empty { display: none; }
.app-shell { margin-left: 280px; min-width: 0; }
/* The glass toolbar is gone, so its body bottom padding goes with it. */
body.app-page { padding-bottom: 0; }
@media (max-width: 820px) {
  .sidebar-panel {
    transform: translateX(-105%);
    /* Closed drawer must not be Tab-reachable: visibility hides it from
       keyboard focus, delayed past the slide-out so the animation still
       plays. The open rule below restores visibility immediately. */
    visibility: hidden;
    transition: transform 300ms ease-out, visibility 0s linear 300ms;
    width: min(320px, 86vw); box-shadow: 16px 0 32px rgba(0, 0, 0, 0.5);
  }
  .sidebar-panel.is-open { transform: translateX(0); visibility: visible; transition: transform 300ms ease-out, visibility 0s; }
  .sidebar-panel .btn.nav-close { display: inline-flex; align-self: flex-end; }
  .sidebar-toggle.btn.nav-toggle {
    display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 85;
  }
  .app-shell { margin-left: 0; }
  .app-shell main.wrap { padding-top: 76px; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .sidebar-panel { transition: none; }
  .sidebar-panel:not(.is-open) { display: none; }
}
/* Print: sidebar chrome is hidden by the print list above; the content
   offset must go with it or the printed sheet sits 280px indented. */
@media print {
  .app-shell { margin-left: 0; }
}
