/* Hallmark · genre: modern-minimal · macrostructure: Split Studio · theme: Cobalt · design-system: design.md · designed-as-app
   Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V5 · nav: N1b · footer: Ft5 · contrast: pass (40–41) · slop: pass (42–45)
   honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57) */
:root {
  color-scheme: light dark;

  /* Locked tokens (design.md, amended 2026-09-22): Cobalt. Cool engineered
     paper, one electric cobalt signal, hairlines over shadows. Light block;
     the two dark blocks below must stay byte-identical (design_tokens_test). */
  --color-paper:      oklch(0.985 0.004 250);
  --color-paper-2:    oklch(0.958 0.006 250);
  --color-ink:        oklch(0.22 0.018 258);
  --color-ink-2:      oklch(0.52 0.02 257);
  --color-rule:       oklch(0.90 0.005 252);
  --color-accent:     oklch(0.53 0.17 256);
  --color-accent-ink: oklch(0.98 0.005 250);
  --color-focus:      oklch(0.53 0.17 256);
  --color-band:       oklch(0.22 0.016 260);
  --color-band-ink:   oklch(0.94 0.008 250);
  --color-warn:       oklch(0.50 0.16 25);
  --color-ok:         oklch(0.47 0.12 152);
  --color-caution:    oklch(0.47 0.12 75);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --space-3xs: 0.25rem;  --space-2xs: 0.5rem;  --space-xs: 0.75rem;
  --space-sm:  1rem;     --space-md: 1.5rem;   --space-lg: 2rem;
  --space-xl:  3rem;     --space-2xl: 4.5rem;  --space-3xl: 7rem;

  --text-xs: 0.75rem;  --text-sm: 0.875rem; --text-md: 1.125rem;
  --text-lg: 1.375rem; --text-xl: 1.75rem;  --text-2xl: 2.25rem;
  --text-display: clamp(2.5rem, 4.5vw + 1rem, 4.5rem);
  --text-display-s: clamp(2rem, 3vw + 1rem, 3.25rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-short: 220ms;
  --radius-control: 6px; --radius-card: 10px; --radius-pill: 999px;
  --radius-input: 6px;
  /* One container width: page, site nav, footer and flash. */
  --content-max: 1120px;

  /* Legacy aliases: pre-redesign component classes keep working, remapped
     onto the locked tokens. Removed as views are restructured. */
  --bg: var(--color-paper);
  --surface: var(--color-paper-2);
  --surface-2: var(--color-paper-2);
  --text: var(--color-ink);
  --muted: var(--color-ink-2);
  --accent: var(--color-accent);
  --warn: var(--color-warn);
  --ok: var(--color-ok);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-paper:      oklch(0.16 0.012 260);
    --color-paper-2:    oklch(0.21 0.014 260);
    --color-ink:        oklch(0.93 0.010 252);
    --color-ink-2:      oklch(0.72 0.015 255);
    --color-rule:       oklch(0.30 0.015 260);
    --color-accent:     oklch(0.70 0.14 256);
    --color-accent-ink: oklch(0.16 0.02 260);
    --color-focus:      oklch(0.70 0.14 256);
    --color-band:       oklch(0.24 0.016 260);
    --color-band-ink:   oklch(0.94 0.008 250);
    --color-warn:       oklch(0.75 0.14 25);
    --color-ok:         oklch(0.80 0.13 152);
    --color-caution:    oklch(0.80 0.13 78);
  }
}

/* Explicit manual choice wins over the OS preference. This block must stay
   identical to the media-query block above — design_tokens_test fails on drift. */
:root[data-theme="dark"] {
  --color-paper:      oklch(0.16 0.012 260);
  --color-paper-2:    oklch(0.21 0.014 260);
  --color-ink:        oklch(0.93 0.010 252);
  --color-ink-2:      oklch(0.72 0.015 255);
  --color-rule:       oklch(0.30 0.015 260);
  --color-accent:     oklch(0.70 0.14 256);
  --color-accent-ink: oklch(0.16 0.02 260);
  --color-focus:      oklch(0.70 0.14 256);
  --color-band:       oklch(0.24 0.016 260);
  --color-band-ink:   oklch(0.94 0.008 250);
  --color-warn:       oklch(0.75 0.14 25);
  --color-ok:         oklch(0.80 0.13 152);
  --color-caution:    oklch(0.80 0.13 78);
}

/* No horizontal scroll, ever (Hallmark responsive floor). Clip, not hidden,
   so position: sticky keeps working. */
html, body { overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

/* One heading voice across marketing, workbench and auth: the display
   face, weight 600, marketing's tracking. Class rules below still win per
   surface (.hero h1, .split-hero h1, .auth-frame h1, …). */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

/* Tabular numerals for every lab value. */
.tnum { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

.page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-xl) clamp(1rem, 4vw, 1.5rem) var(--space-2xl); }

/* Static-page head: page-head scale, grotesk, roman — no drop caps. */
.hero h1 { font-family: var(--font-display); font-weight: 600; margin: 0 0 var(--space-2xs); font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; min-width: 0; }
.hero .lede { font-size: var(--text-md); max-width: 52ch; }
.lede { color: var(--muted); margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: 1rem;
  margin: 0 0 1rem;
}

.field { display: flex; flex-direction: column; gap: .25rem; }
.field span { color: var(--muted); font-size: .8rem; }

input[type="number"] {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-input);
  padding: .45rem .6rem;
}

.button {
  background: var(--accent);
  color: var(--color-accent-ink);
  font-weight: 600;
  border: 0;
  border-radius: var(--radius-control);
  padding: .6rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { filter: brightness(1.1); }
.button:active { filter: brightness(0.93); }
.button:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }

.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.scores dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.scores dd { margin: 0; font-size: 1.35rem; font-weight: 700; }
.score-meta .scores dd { font-size: var(--text-md); font-weight: 500; }

.flags li, .plan li { margin-bottom: .4rem; }
.flags strong, .plan strong { color: var(--accent); }

/* Action-plan details: plain-words explanation + science links behind an info
   icon. The details itself rides inline so the icon shares its plan item's
   line; the open panel's blocks drop below the line. */
details.plan-info { display: inline; }
.plan-info summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; padding: .1rem 0; margin-left: .35rem; }
.plan-info summary::-webkit-details-marker { display: none; }
.info-icon { width: 16px; height: 16px; }
.info-icon circle { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.info-icon .dot { fill: var(--accent); stroke: none; }
.info-icon line { stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.plan-info summary:hover .info-icon circle { fill: color-mix(in srgb, var(--color-accent) 15%, transparent); }
.plan-summary { margin: .5rem 0 .5rem; }
.plan-terms { margin: 0 0 .5rem; }
.plan-terms div { display: flex; gap: .5rem; padding: .1rem 0; }
.plan-terms dt { flex: 0 0 11rem; font-weight: 600; color: var(--accent); }
.plan-terms dd { margin: 0; color: var(--muted); font-size: .92rem; }
.plan-sources-label { margin: .35rem 0 .15rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.plan-links { margin: 0; padding-left: 1.1rem; font-size: .88rem; }
.plan-links a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.plan-links a:hover { color: var(--ok); }
.plan-info[open] summary { margin-bottom: .1rem; }

/* Account chrome: header controls and in-page action rows, then flash. */
.topnav-user { color: var(--muted); margin-right: auto; }
.topnav-link { color: var(--accent); text-decoration: none; }
.topnav-link:hover { text-decoration: underline; }
.topnav-form { display: inline; margin: 0; }
.topnav-button { background: none; border: 1px solid var(--color-rule); color: var(--text); border-radius: var(--radius-input); padding: .25rem .7rem; cursor: pointer; font-size: .85rem; }
.topnav-button:hover { border-color: var(--accent); color: var(--accent); }
.flash { max-width: var(--content-max); margin: .75rem auto 0; padding: .55rem 1.25rem; border-radius: var(--radius-card); font-size: .92rem; }
.flash-notice { background: color-mix(in srgb, var(--color-ok) 12%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--color-ok) 35%, transparent); }
.flash-alert { background: color-mix(in srgb, var(--color-warn) 12%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--color-warn) 35%, transparent); }

/* Save card */
.save-card .button { margin-top: .25rem; }

/* Banner on a re-opened saved snapshot */
.saved-banner { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; }

/* History table actions: view link sits next to the delete button */
.history-table td .topnav-link { margin-right: .75rem; }

/* Auth (Devise) pages */
.auth-card { max-width: 420px; }
.auth-card h2 { margin-top: 0; }
.auth-card .field { margin-bottom: .75rem; }
.auth-card .field > label { color: var(--muted); font-size: .8rem; }
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-input);
  padding: .45rem .6rem;
}
.auth-remember { flex-direction: row; align-items: center; gap: .5rem; }
.auth-links { margin-top: 1rem; font-size: .9rem; }
.auth-links a { color: var(--accent); }
.auth-links br { display: none; }
.auth-hint { color: var(--muted); font-size: .78rem; }
.field_with_errors input { border-color: var(--warn); }

/* History table */
.history-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.history-table th, .history-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--color-rule); }
.history-table thead th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.history-table tbody th { font-weight: 600; }
.history-source { color: var(--muted); font-size: .85rem; }
.history-flagged { color: var(--warn); font-weight: 700; }
.history-table .topnav-button { font-size: .78rem; padding: .2rem .55rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Chronological vs biological age */
.chronology dd.gap-worse { color: var(--warn); }

/* Organ & system score bars */
.organs { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.organ {
  display: grid;
  grid-template-columns: 9rem 1fr 3.5rem;
  gap: .25rem .75rem;
  align-items: center;
  padding: .35rem 0;
  border-bottom: 1px solid var(--color-rule);
}
.organ:last-child { border-bottom: 0; }
.organ-name { font-weight: 600; }
.organ-bar {
  display: block; height: 8px; border-radius: 4px;
  background: var(--surface-2); overflow: hidden;
}
.organ-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.organ.good .organ-fill { background: var(--ok); }
.organ.alert .organ-fill { background: var(--warn); }
.organ-score { font-weight: 700; text-align: right; }
.organ-detail { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }

.disclaimer { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--color-rule); padding-top: 1rem; }

/* ---------- Data-viz additions (server-rendered SVG + CSS only) ---------- */

/* Score hero: half-circle gauge + meta */
.score-hero { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.25rem; }
.score-hero .gauge { width: 180px; flex: 0 0 auto; }
.gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 12; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; }
.gauge-fill.band-good { stroke: var(--ok); }
.gauge-fill.band-watch { stroke: var(--color-caution); }
.gauge-fill.band-alert { stroke: var(--warn); }
.gauge-score { fill: var(--text); font-size: 34px; font-weight: 700; }
.gauge-band { font-size: 11px; font-weight: 600; fill: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.band-text-good { fill: var(--ok); }
.band-text-watch { fill: var(--color-caution); }
.band-text-alert { fill: var(--warn); }

/* Zone distribution strip */
.zone-dist { margin: 0 0 1.25rem; }
.zone-strip { display: flex; height: 12px; border-radius: var(--radius-control); overflow: hidden; background: var(--surface-2); }
.zone-seg { display: block; height: 100%; }
.seg-optimal { background: var(--ok); }
.seg-borderline { background: var(--color-caution); }
.seg-flagged { background: var(--warn); }

/* Age scale */
.age-scale-card { margin: 0 0 1.25rem; }
.age-scale { width: 100%; height: auto; display: block; }
.scale-axis { stroke: var(--color-rule); stroke-width: 2; }
.scale-tick { stroke: var(--color-rule); stroke-width: 1; }
.scale-tick-label { fill: var(--muted); font-size: 11px; }
.gap-brace { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.gap-brace.gap-worse { stroke: var(--warn); }
.marker-chrono { fill: var(--muted); }
.marker-counter { fill: var(--ok); }
.marker-pheno { fill: var(--accent); stroke: var(--color-paper); stroke-width: 2; }
.marker-label { fill: var(--text); font-size: 13px; font-weight: 700; }
.marker-label.pheno-label { fill: var(--accent); }
.legend { display: flex; gap: 1.25rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; margin: .35rem 0 .25rem; }
.legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; }
.key-chrono { background: var(--muted); }
.key-pheno { background: var(--accent); }
.key-counter { background: var(--ok); }

/* PhenoAge diverging driver bars */
.drivers { list-style: none; margin: 0 0 .25rem; padding: 0; }
.driver { display: grid; grid-template-columns: 10rem 1fr 4.5rem; gap: .5rem .75rem; align-items: center; padding: .2rem 0; }
.driver-name { font-size: .85rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-track { position: relative; display: block; height: 10px; background: var(--surface-2); border-radius: 5px; }
.driver-track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.driver-bar { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.driver-bar.worse { background: var(--warn); }
.driver-bar.better { background: var(--ok); }
.driver-bar.zero { background: var(--muted); }
.driver-years { font-size: .85rem; font-weight: 700; text-align: right; }
.driver-worse { color: var(--warn); }
.driver-better { color: var(--ok); }
.driver-zero { color: var(--muted); }

/* Axis row under the bars: -max | 0 | +max, aligned to the track column */
.driver-axis { margin-bottom: .5rem; }
.driver-axis-track { position: relative; display: block; height: 1rem; }
.driver-axis-neg, .driver-axis-zero, .driver-axis-pos {
  position: absolute; top: 50%; font-size: .72rem; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.driver-axis-neg { left: 0; transform: translateY(-50%); }
.driver-axis-pos { right: 0; transform: translateY(-50%); }
.driver-axis-zero { left: 50%; transform: translate(-50%, -50%); }

/* Organ donut rings */
.organ-rings { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; margin: 0 0 1.25rem; padding: 0; }
.ring-card { display: flex; flex-direction: column; align-items: center; gap: .25rem; background: var(--surface-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: .75rem .5rem; text-align: center; }
.ring { width: 72px; }
.ring-track { fill: none; stroke: var(--color-rule); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.ring.good .ring-fill { stroke: var(--ok); }
.ring.alert .ring-fill { stroke: var(--warn); }
.ring-score { fill: var(--text); font-size: 17px; font-weight: 700; }
.ring-name { font-weight: 600; font-size: .9rem; }
.ring-detail { color: var(--muted); font-size: .72rem; }

/* ASCVD chips */
.chip { display: inline-block; padding: .1rem .55rem; border-radius: var(--radius-pill); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.chip-high { background: color-mix(in srgb, var(--color-warn) 14%, transparent); color: var(--warn); border: 1px solid var(--warn); }
.chip-moderate { background: color-mix(in srgb, var(--color-caution) 15%, transparent); color: var(--color-caution); border: 1px solid var(--color-caution); }
.chip-low { background: color-mix(in srgb, var(--color-ok) 12%, transparent); color: var(--ok); border: 1px solid var(--ok); }
.ascvd-flags { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }

/* Reference-range position chart */
.range-group { margin-bottom: 1rem; }
.range-group-name { margin: .5rem 0 .25rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.range-row { display: grid; grid-template-columns: 15rem 1fr; gap: .25rem .75rem; align-items: center; padding: .15rem 0; border-bottom: 1px solid var(--color-rule); }
.range-row:last-child { border-bottom: 0; }
.range-label { display: flex; flex-direction: column; }
.range-key { font-weight: 600; font-size: .85rem; position: relative; }
.range-value { color: var(--muted); font-size: .75rem; }
.range-track { width: 100%; height: 24px; display: block; }
.band-optimal { fill: color-mix(in srgb, var(--color-ok) 45%, transparent); }
.band-ref { fill: var(--color-caution); opacity: 0.30; }
.value-dot { fill: var(--warn); stroke: var(--color-paper); stroke-width: 1.5; }
.value-stem { stroke: var(--warn); stroke-width: 1.5; }

/* Zero-JS glossary tooltip on a marker name: mouse hover, keyboard focus,
   or tap. ARIA: aria-describedby reads the same node to screen readers. */
.range-tip { position: absolute; left: 0; top: calc(100% + .3rem); z-index: 5; width: max-content; max-width: min(22rem, 70vw); padding: .45rem .6rem; background: var(--color-paper); color: var(--text); border: 1px solid var(--color-rule); border-radius: var(--radius-control); font-size: .78rem; font-weight: 400; line-height: 1.4; visibility: hidden; opacity: 0; }
.range-key:hover .range-tip, .range-key:focus .range-tip { visibility: visible; opacity: 1; }

/* Longitudinal delta table (change vs previous report) */
.delta-rows { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: .9rem; }
.delta-rows th, .delta-rows td { padding: .3rem .5rem; border-bottom: 1px solid var(--color-rule); text-align: left; }
.delta-rows thead th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.delta-rows tbody th { font-weight: 600; }
.delta-better td { color: var(--ok); }
.delta-worse td { color: var(--warn); }
.delta-unchanged td { color: var(--muted); }
.delta-rows tbody tr td:first-child, .delta-rows tbody tr th:first-child { color: var(--text); }

@media (max-width: 700px) {
  .score-hero { flex-direction: column; }
  .range-row { grid-template-columns: 1fr; }
  /* Driver rows stack: name and years share line one, the bar spans the
     full width beneath — at 320px a 1fr track would be ~60px, unreadable. */
  .driver { grid-template-columns: 1fr auto; row-gap: .2rem; }
  .driver-name { grid-column: 1; grid-row: 1; }
  .driver-years { grid-column: 2; grid-row: 1; }
  .driver-track { grid-column: 1 / -1; grid-row: 2; }
  .driver-axis-spacer { display: none; }
  .driver-axis-track { grid-column: 1 / -1; }
}


/* Motion preferences: skip-link slide and nav underline draw collapse to
   instant under prefers-reduced-motion (slop gate 27). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* Phase H a11y: visible keyboard focus everywhere + offscreen-until-focused skip link. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 100; background: var(--surface-2); color: var(--text); padding: .5rem 1rem; border-radius: var(--radius-card); text-decoration: none; transform: translateY(-4rem); transition: transform .15s ease-in; }
.skip-link:focus-visible { transform: translateY(0); }

/* Hallmark marketing layer · genre: modern-minimal · theme: Cobalt
   macrostructure: Split Studio · nav: N1b flush bordered (prev N6 masthead)
   footer: Ft5 statement (prev Ft4 colophon) · hero: H2 split 7/5
   knobs: nav = always-solid (zero JS, no scroll frost, no dead ⌘K),
   footer statement = 38ch, stat strip = 2×2, steps = 1.0/2.0 vertical. */

/* N1b · flush bordered nav — wordmark · centred cluster · actions right. */
.site-nav { position: sticky; top: 0; z-index: 10; background: var(--color-paper); border-bottom: 1px solid var(--color-rule); }
.site-nav__inner { display: flex; align-items: center; gap: var(--space-md); max-width: var(--content-max); margin: 0 auto; padding: var(--space-xs) clamp(1rem, 4vw, 1.5rem); }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); letter-spacing: -0.03em; color: var(--color-ink); text-decoration: none; white-space: nowrap; }
/* Logo mark sits inline with the wordmark; em-based so it scales with it.
   The art is tight-cropped (2:3), so height drives the box and width follows
   the SVG's intrinsic ratio. 2.1em is the largest measured value that fits
   the bar's content box, so the header does not grow. */
.wordmark { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.wordmark__mark { width: auto; display: block; flex: none; height: 2.1em; } /* 37.8px in the 63px bar */
.site-nav__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs) var(--space-md); margin-inline: auto; font-size: var(--text-sm); }
.site-nav__links a { color: var(--color-ink-2); text-decoration: none; white-space: nowrap; padding-block: var(--space-3xs);
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px;
  transition: background-size var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.site-nav__links a:hover, .site-nav__links a[aria-current="page"] { color: var(--color-ink); background-size: 100% 2px; }
.site-nav__actions { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-sm); }
.site-nav__actions a:not(.button-primary) { color: var(--color-ink-2); text-decoration: none; white-space: nowrap; }
.site-nav__actions a:not(.button-primary):hover { color: var(--color-accent); text-decoration: underline; }
.site-nav__actions .topnav-user { font-size: var(--text-xs); font-family: var(--font-mono); }
.site-nav__cta.button-primary { padding: 0.5rem 1rem; font-size: var(--text-sm); }
.site-nav__quiet { color: var(--color-ink); }
/* N1b · ≤1024px — two tidy rows instead of an increasingly crumpled one.
   Measured: the signed-in single row needs ~925px before the link cluster
   stops wrapping (and the bar balloons to 96–138px), so the redo runs to
   1024px — the smallest round width where one row provably fits again.
   Row 1 = brand (auto-margined left) + actions right; row 2 = one link rail
   that scrolls horizontally rather than wrapping. Account chrome the bar can
   live without (the member email, too wide for a phone row) drops out — the
   navigation itself lives in the rail. The page containers keep their own
   768px reflow. */
@media (max-width: 1024px) {
  .site-nav__inner { flex-wrap: wrap; row-gap: var(--space-3xs); column-gap: var(--space-sm); padding-block: var(--space-2xs); }
  .wordmark { margin-right: auto; font-size: var(--text-sm); }
  .wordmark__mark { height: 1.75em; }
  .site-nav__actions { gap: var(--space-2xs) var(--space-sm); }
  .topnav-user { display: none; }
  .site-nav__links { order: 3; display: flex; width: 100%; margin: 0; flex-wrap: nowrap;
    justify-content: flex-start; gap: var(--space-md); overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: var(--space-3xs); }
  .site-nav__links::-webkit-scrollbar { display: none; }
  .site-nav__links a { flex: none; }
}

/* Split Studio hero · H2 split diptych 7/5. */
.split-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-xl); align-items: center; padding: var(--space-lg) 0 var(--space-2xl); }
.split-hero__text { min-width: 0; }
.eyebrow { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-accent); margin: 0 0 var(--space-sm); }
.split-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-display); line-height: 1.04; letter-spacing: -0.03em; max-width: 15ch; margin: 0 0 var(--space-md); overflow-wrap: anywhere; min-width: 0; }
.split-hero .lede { font-size: var(--text-md); max-width: 52ch; margin-top: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.button-primary { display: inline-block; background: var(--color-accent); color: var(--color-accent-ink); padding: 0.7rem 1.4rem; border-radius: var(--radius-control); text-decoration: none; font-weight: 600; white-space: nowrap; }
.button-primary:hover { filter: brightness(1.07); }
.button-primary:active { filter: brightness(0.93); }
.button-primary:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.chip-outline { display: inline-block; border: 1px solid var(--color-rule); color: var(--color-accent); padding: 0.7rem 1.2rem; border-radius: var(--radius-control); text-decoration: none; white-space: nowrap; }
.chip-outline:hover { border-color: var(--color-accent); }
.hero-note { color: var(--color-ink-2); font-size: var(--text-sm); max-width: 62ch; margin-top: var(--space-md); }

/* T4 · stat strip — the hero's proof column: 2×2, hairline panel, tnum. */
.stat-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin: 0; padding: var(--space-md); background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
.stat-strip > div { display: flex; flex-direction: column-reverse; gap: var(--space-3xs); min-width: 0; }
.stat-strip dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.02em; color: var(--color-ink); }
.stat-strip dd span { font-size: 0.55em; font-weight: 500; color: var(--color-ink-2); margin-left: 0.1em; }
.stat-strip dt { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-2); }
@media (max-width: 768px) {
  .split-hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
}
@media (max-width: 640px) {
  .split-hero h1 { font-size: var(--text-display-s); }
}

/* The one graphite band — pipeline stages 1.0 → 7.0, icons lifted toward
   band-ink so cobalt clears 3:1 against the dark ground. */
.band { background: var(--color-band); color: var(--color-band-ink); border-radius: var(--radius-card); padding: var(--space-xl) var(--space-lg); margin: var(--space-2xl) 0; }
.band h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.02em; color: var(--color-band-ink); margin: 0 0 var(--space-md); overflow-wrap: anywhere; min-width: 0; }
.band .ruled-list li { border-color: color-mix(in srgb, var(--color-band-ink) 18%, transparent); color: var(--color-band-ink); }
.band .ruled-list li:last-child { border-bottom-color: color-mix(in srgb, var(--color-band-ink) 18%, transparent); }
.band .ruled-list li::before { color: color-mix(in srgb, var(--color-band-ink) 60%, transparent); font-size: var(--text-sm); }
.band .ruled-list li svg.icon { color: color-mix(in srgb, var(--color-accent) 45%, var(--color-band-ink)); }
.band__more { margin: var(--space-md) 0 0; font-size: var(--text-sm); }
.band__more a { color: var(--color-band-ink); text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset: 2px; white-space: nowrap; }
@media (max-width: 640px) { .band { padding: var(--space-lg) var(--space-md); } }

/* Alternating block: text against proof (Split Studio rhythm). */
.split-block { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-xl); align-items: start; padding-top: var(--space-xl); }
.split-block__text { min-width: 0; max-width: 68ch; }
.split-block h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.02em; margin: 0 0 var(--space-sm); overflow-wrap: anywhere; }
.split-block p + p { margin-top: var(--space-sm); }
.proof-note { border-left: 1px solid var(--color-rule); padding-left: var(--space-md); min-width: 0; }
.proof-note__label { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-2); margin: 0 0 var(--space-2xs); }
.proof-note__value { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-ink); margin: 0; }
@media (max-width: 768px) {
  .split-block { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
  .proof-note { border-left: 0; border-top: 1px solid var(--color-rule); padding-left: 0; padding-top: var(--space-sm); }
}

/* Steps, shared heads, teasers (C3 typographic links). */
.ruled-list ol { list-style: none; counter-reset: steps; margin: 0; padding: 0; }
.ruled-list li { counter-increment: steps; display: flex; gap: var(--space-md); padding: var(--space-sm) 0; border-top: 1px solid var(--color-rule); }
.ruled-list li:last-child { border-bottom: 1px solid var(--color-rule); }
.ruled-list li::before { content: counter(steps) ".0"; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-accent); min-width: 3.5ch; }
.landing h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 var(--space-sm); overflow-wrap: anywhere; }
.prose { max-width: 68ch; }
.prose p + p { margin-top: var(--space-sm); }
.teasers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--space-lg); margin-top: var(--space-2xl); }
.teasers p { max-width: 46ch; }
.text-link { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; white-space: nowrap; }
.text-link::after { content: " →"; }
.text-link:hover { color: var(--color-ink); }

/* Ft5 · statement footer — one display line, meta row, methods, disclaimer. */
.site-foot { max-width: var(--content-max); margin: 0 auto; padding: var(--space-xl) clamp(1rem, 4vw, 1.5rem) var(--space-2xl); border-top: 1px solid var(--color-rule); }
/* Footer lede — the brand mark rides the same line as the statement,
   vertically centred; scales with the viewport like the statement does. */
.foot-lede { display: flex; align-items: center; gap: clamp(var(--space-sm), 2vw, var(--space-md)); margin: 0 0 var(--space-lg); }
.foot-lede .foot-statement { margin: 0; }
.foot-mark { display: block; flex: none; height: clamp(3rem, 5vw, 4rem); width: auto; }
.foot-statement { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; max-width: 38ch; color: var(--color-ink); margin: 0 0 var(--space-lg); overflow-wrap: anywhere; }
.foot-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-sm) var(--space-lg); }
.foot-meta nav { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-right: auto; font-size: var(--text-sm); }
.site-foot a { color: var(--color-ink-2); text-decoration: none; white-space: nowrap; }
.site-foot a:hover { color: var(--color-accent); text-decoration: underline; }
.foot-methods { font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.6; color: var(--color-ink-2); max-width: 92ch; margin: var(--space-md) 0 0; }
.site-foot .copyright { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink-2); margin: 0; }
.site-foot .medical-disclaimer { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-ink-2); max-width: 68ch; margin-top: var(--space-md); border-top: 0; padding-top: 0; }

/* Server-side theme switch: one quiet icon button, three states in the DOM. */
.theme-switch { display: inline-flex; margin: 0; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; background: none; border: 1px solid var(--color-rule); border-radius: var(--radius-pill); color: var(--color-ink-2); cursor: pointer; }
.theme-toggle:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* Show only the state button matching <html data-theme> (no attribute =
   auto), so icon, label and value always name the next theme in the
   auto → dark → light cycle — with or without JS. */
.theme-switch .theme-toggle { display: none; }
html:not([data-theme]) .theme-switch .theme-toggle[data-state="auto"],
html[data-theme="dark"] .theme-switch .theme-toggle[data-state="dark"],
html[data-theme="light"] .theme-switch .theme-toggle[data-state="light"] { display: inline-flex; }

/* Phase I.1: centred rows (icon toggle rides level with links). */
.site-nav__links, .site-nav__actions { align-items: center; }
.theme-switch, .topnav-form { align-self: center; }

/* Phase I.1: auth frame — mini masthead, hairline card, ghost numeral. */
.auth { max-width: 28rem; }
.mast-mini { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); margin: var(--space-lg) 0 var(--space-md); }
.mast-mini a { color: var(--color-ink); text-decoration: none; }
.auth-frame { position: relative; overflow: hidden; background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-xl) var(--space-lg); }
.auth-frame h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-2xl); margin: 0 0 var(--space-2xs); }
.auth-frame .lede { margin-top: 0; }
.auth-ghost { position: absolute; top: -2.5rem; right: 0.5rem; font-family: var(--font-display); font-size: 9rem; line-height: 1; color: var(--color-ink); opacity: 0.06; pointer-events: none; }
.auth-frame .field { margin-bottom: var(--space-sm); }
.auth-frame label { display: block; font-size: var(--text-sm); margin-bottom: var(--space-3xs); }
.auth-frame input[type="email"], .auth-frame input[type="password"] { width: 100%; box-sizing: border-box; background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: var(--radius-input); color: var(--color-ink); font-size: var(--text-md); padding: 0.6rem 0.8rem; }
.auth-frame .button-primary { width: 100%; text-align: center; border: 0; cursor: pointer; font-size: var(--text-md); }
.auth-frame .actions { margin-top: var(--space-md); }
.auth-links { margin-top: var(--space-md); font-size: var(--text-sm); }
.auth-hint { color: var(--color-ink-2); }

/* Phase I.2: sample-viz plate — hairline-framed Tier-B strips, no cards. */
.sample-viz { margin: var(--space-xl) 0; padding: var(--space-md) 0; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.sample-viz figcaption h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); margin: 0 0 var(--space-3xs); }
.sample-viz figcaption p { color: var(--color-ink-2); margin: 0 0 var(--space-md); max-width: 62ch; }
.sample-viz svg { width: 100%; height: auto; display: block; }
.sample-viz text { font-family: var(--font-body); fill: var(--color-ink-2); font-size: 12px; }
.sample-viz .viz-title { font-family: var(--font-display); font-size: 14px; fill: var(--color-ink); }
.sample-viz .viz-value { fill: var(--color-ink); font-weight: 600; }
.sample-viz .viz-rule { stroke: var(--color-rule); stroke-width: 1; }
.sample-viz .viz-tick { stroke: var(--color-ink-2); stroke-width: 2; }
.sample-viz .viz-tick.viz-ember { stroke: var(--color-accent); stroke-width: 3; }
.sample-viz .viz-dash { stroke-dasharray: 3 3; }
.sample-viz .viz-dot { fill: var(--color-accent); }
.sample-viz .viz-bar { fill: var(--color-accent); opacity: 0.75; }
.sample-viz .viz-flag { font-size: 11px; }
.sample-viz .viz-kicker { font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; fill: var(--color-accent); }
.sample-viz .viz-scale { font-size: 11px; }
.sample-viz .viz-anno { font-size: 12px; }
.sample-viz .viz-strong { fill: var(--color-ink); font-weight: 600; }
.sample-viz .viz-gapband { fill: var(--color-accent); opacity: 0.18; }
.sample-viz .viz-ring { fill: none; stroke: var(--color-ink-2); stroke-width: 2.5; }
.sample-viz .viz-dot-lg { fill: var(--color-accent); }
.sample-viz .viz-zone-ok { fill: var(--color-ok); opacity: 0.18; }
.sample-viz .viz-zone-caution { fill: var(--color-caution); opacity: 0.20; }
.sample-viz .viz-zone-warn { fill: var(--color-warn); opacity: 0.20; }
.sample-viz .viz-pill { font-size: 12px; font-weight: 700; fill: var(--color-ink); }
.sample-viz .viz-flagval { font-family: var(--font-display); font-size: 20px; fill: var(--color-ink); }
.sample-viz .viz-flagname { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.viz-caption { color: var(--color-ink-2); font-size: var(--text-sm); margin: var(--space-sm) 0 0; }

/* Phase I.3: Tier-B marketing figures — marker grid (Science) + pipeline
   rail (How it works). Same plate treatment as sample-viz; every fill and
   stroke references a token (slop gate 48), so both themes come free. */
.marker-grid, .pipeline-flow { margin: var(--space-xl) 0; padding: var(--space-md) 0; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.marker-grid figcaption h2, .pipeline-flow figcaption h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); margin: 0 0 var(--space-3xs); overflow-wrap: anywhere; }
.marker-grid figcaption p, .pipeline-flow figcaption p { color: var(--color-ink-2); margin: 0 0 var(--space-md); max-width: 62ch; }
.marker-grid svg, .pipeline-flow svg { width: 100%; height: auto; display: block; }
.marker-grid text, .pipeline-flow text { font-family: var(--font-body); fill: var(--color-ink-2); font-size: 12px; }
.marker-grid .viz-kicker, .pipeline-flow .viz-kicker { font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; fill: var(--color-accent); }
.marker-grid .mg-cell { fill: color-mix(in srgb, var(--color-ink-2) 24%, transparent); }
.marker-grid .mg-flag { fill: color-mix(in srgb, var(--color-warn) 75%, var(--color-paper)); }
.marker-grid .mg-key { fill: color-mix(in srgb, var(--color-ink-2) 24%, transparent); }
.marker-grid .mg-key--flag { fill: color-mix(in srgb, var(--color-warn) 75%, var(--color-paper)); }
.marker-grid .mg-legend { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; }
.pipeline-flow .pipe-rail { stroke: var(--color-rule); stroke-width: 1.5; }
.pipeline-flow .pipe-arrow { fill: none; stroke: var(--color-ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pipeline-flow .pipe-node { fill: var(--color-paper); stroke: var(--color-rule); stroke-width: 1.5; }
.pipeline-flow .pipe-step { font-family: var(--font-mono); font-size: 13px; font-weight: 500; fill: var(--color-accent); text-anchor: middle; }
.pipeline-flow .pipe-label { font-family: var(--font-mono); font-size: 15px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; text-anchor: middle; }

/* Phase I.3: f3 tabular spec sheet. */
.table-scroll { overflow-x: auto; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.spec-sheet { width: 100%; border-collapse: collapse; margin: 0; min-width: 28rem; }
.spec-sheet th, .spec-sheet td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--color-rule); text-align: left; }
.spec-sheet thead th { font-family: var(--font-display); font-size: var(--text-lg); }
.spec-sheet thead th:not(:first-child), .spec-sheet td:not(:first-child) { text-align: center; }
.spec-sheet tbody th { font-weight: 500; }
.spec-sheet tbody tr:last-child th, .spec-sheet tbody tr:last-child td { border-bottom: 0; }
.spec-sheet td { color: var(--color-accent); font-weight: 600; }
.spec-sheet .spec-cta .button-primary { border: 0; cursor: pointer; font-size: var(--text-sm); white-space: nowrap; }

/* Phase I.4: doc grid with margin stats, drop-cap ledes, hanging refs. */
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: var(--space-xl); align-items: start; }
.margin-stats { display: grid; gap: var(--space-md); border-top: 1px solid var(--color-rule); padding-top: var(--space-sm); }
.margin-stats div { display: grid; gap: var(--space-3xs); }
.margin-stats .tnum { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-accent); }
.margin-stats span:last-child { font-size: var(--text-sm); color: var(--color-ink-2); }
.ref-list { list-style: none; margin: var(--space-sm) 0 0; padding: 0; }
.ref-list li { padding-left: 2rem; text-indent: -2rem; margin-bottom: var(--space-2xs); font-size: var(--text-sm); color: var(--color-ink-2); }
@media (max-width: 768px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } }

/* Screenshot review fixes: base link voice (no browser-default blue
   anywhere), auth-links spacing. The :not() exclusions matter: a:visited
   and a:hover outrank single-class button selectors, so without them every
   visited primary button renders accent-on-accent (invisible) and every
   button-shaped link picks up a hover underline. */
main a { color: var(--color-accent); }
main a:not(.button-primary):not(.button):not(.chip-outline):visited { color: var(--color-accent); }
main a:not(.button-primary):not(.button):not(.chip-outline):hover { text-decoration: underline; }
.auth-links { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); }
.auth-links a { color: var(--color-accent); }

/* Workbench rhythm: inline link rows with separators. */
.inline-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-sm); }
.inline-links span[aria-hidden] { color: var(--color-ink-2); }

/* History charts: polyline carries no presentation attributes by design —
   all paint lives here so both themes follow the tokens. */
.chart-line { fill: none; stroke: var(--color-accent); stroke-width: 2; }
.chart-dot { fill: var(--color-accent); }
.chart-zero { stroke: var(--color-rule); stroke-width: 1; }

/* Analyzer form: file input that matches the system (keeps native control
   for accessibility, dresses the frame around it). */
.file-field input[type="file"] { font: inherit; color: var(--color-ink-2); }
.file-field input[type="file"]::file-selector-button { font: inherit; font-weight: 600; color: var(--color-accent-ink); background: var(--color-accent); border: 0; border-radius: var(--radius-input); padding: 0.45rem 0.9rem; margin-right: var(--space-sm); cursor: pointer; }

/* Tier-B ornament: step icons. (The diamond rule divider is retired — the
   modern-minimal genre works in hairlines only.) */
.ruled-list li svg.icon { flex: 0 0 auto; color: var(--color-accent); margin-top: 0.15rem; }
.ruled-list ol.plan li::before { display: none; }
.ruled-list li span { min-width: 0; }
.empty-icon { width: 40px; height: 40px; color: var(--color-ink-2); opacity: 0.55; }
svg.icon { vertical-align: -3px; }

/* Conversational FAQ: native disclosures, hairline-separated. */
.qa-list { border-top: 1px solid var(--color-rule); margin: var(--space-md) 0; }
details.qa { border-bottom: 1px solid var(--color-rule); padding: var(--space-sm) 0; }
details.qa summary { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: var(--space-sm); }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before { content: "+"; color: var(--color-accent); font-family: var(--font-body); font-weight: 400; }
details.qa[open] summary::before { content: "–"; }
details.qa p { margin: var(--space-sm) 0 0; max-width: 62ch; }

/* Phase J surfaces: priorities, report cards, banners, and status rows.
   Token-only (no new colors): urgency reuses the warn/caution/ok hooks
   already AA-checked on chips and flash. */
p.alert, div.alert { background: color-mix(in srgb, var(--color-warn) 12%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--color-warn) 35%, transparent); border-radius: var(--radius-card); padding: var(--space-sm) 1.25rem; }
.critical-banner { border-left: 4px solid var(--warn); }
.critical-banner h3 { margin-top: 0; }
.demo-banner { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; }
.priorities, .focus-areas { display: grid; gap: var(--space-sm); margin: var(--space-sm) 0; padding-left: 1.25rem; }
.priorities li::marker, .focus-areas li::marker { color: var(--accent); font-weight: 700; }
.priority-urgency, .rec-category { display: inline-block; padding: .1rem .55rem; border-radius: var(--radius-pill); font-size: .78rem; font-weight: 700; letter-spacing: .04em; margin-left: .5rem; border: 1px solid; }
.urgency-discuss, .category-discuss_clinician { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--color-warn) 12%, transparent); }
.urgency-caution, .category-discuss_before_changing { color: var(--color-caution); border-color: var(--color-caution); background: color-mix(in srgb, var(--color-caution) 12%, transparent); }
.urgency-lifestyle, .category-lifestyle { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.urgency-maintain, .category-maintain { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--color-ok) 10%, transparent); }
.priority-markers { margin: .35rem 0; font-size: .9rem; }
.report-cards { list-style: none; margin: var(--space-sm) 0; padding: 0; display: grid; gap: var(--space-sm); }
.report-card { border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-sm) 1.25rem; }
.report-card h3 { margin-top: 0; }
.report-numbers { display: grid; gap: .15rem .75rem; margin: .5rem 0; font-size: .92rem; }
.report-numbers > div { display: flex; gap: .5rem; align-items: baseline; }
.report-numbers dt { color: var(--color-ink-2); }
.report-numbers dd { margin: 0; font-weight: 600; }
.report-actions, .action-status-row, .save-top form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.report-actions .topnav-link { margin-right: .25rem; }
.save-top { margin: var(--space-sm) 0; }
details.see-all { margin-top: var(--space-sm); }
details.see-all > summary { cursor: pointer; font-weight: 600; }
.tier-price { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }
.origin-tag { display: inline-block; padding: .1rem .55rem; border-radius: var(--radius-pill); font-size: .78rem; color: var(--color-ink-2); border: 1px solid var(--color-rule); margin-left: .5rem; }
.gap-chart, .score-sparkline { max-width: 100%; height: auto; display: block; }
