/* Omelvian demo. One stylesheet, bundled fonts (static/fonts), no scripts. */
@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Black";
  src: url("fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
/* Dark forest theme. Chart colours validated for colour-blind separation and contrast on
   --surface (dataviz validator, 2026-10-27). */
:root {
  color-scheme: dark;
  --page: #0c1d15;
  --surface: #132a1f;
  --raised: #193426;
  --ink: #e7f0ea;
  --ink-2: #b9cbbf;
  --muted: #8ea699;
  --rule: #26443a;
  --grid: #1f3a2d;
  --axis: #3a5a4a;
  --accent: #8fe3b0;
  --accent-ink: #0c1d15;
  --series: #3d95f0;
  --band80: rgba(61, 149, 240, 0.32);
  --band95: rgba(61, 149, 240, 0.15);
  --likely: #f07a6e;       /* text and markers: at least 4.5:1 on every surface */
  --threshold: #e0574b;    /* chart line, validated with --series */
  --control: #6b8f7c;      /* form borders: at least 3:1 on every surface */
  --possible: #f2b632;
  --pass: #5fcf86;
  --strip: #07140e;
  --strip-ink: #cfe3d6;
  --logo-a: #8fe3b0;
  --logo-b: #3d95f0;
  --display: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--series);
  outline-offset: 2px;
}
code { font-size: 0.92em; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--sans); font-weight: 750; line-height: 1.2; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.8em; }

.synthetic {
  margin: 0;
  padding: 6px 16px;
  background: var(--strip);
  color: var(--strip-ink);
  font-size: 0.82rem;
}
/* Platform shell: a left side panel (collapsible to icons) and a slim top bar. */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: calc(100vh - 30px); }
.nav-collapsed .shell { grid-template-columns: 76px minmax(0, 1fr); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 18px; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px; padding: 4px 4px 8px;
  color: var(--ink); text-decoration: none;
}
.brand-mark { width: 36px; height: 24.5px; flex: none; }  /* circles 23.3px tall, as the letters */
/* Wordmark: drawn, not typed. Lowercase letters on one rounded, monoline stroke, every
   letter exactly as tall as the two circles (the l has a curled foot so it stays distinct
   from the i). The link is labelled "Omelvian home" for screen readers. */
.wordmark { height: 23.3px; width: auto; flex: none; overflow: visible; }
.wordmark .strokes { fill: none; stroke: var(--ink); stroke-width: 4.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { stroke-width: 3.5; }
.brand-mark .a { fill: rgba(143, 227, 176, 0.18); stroke: var(--logo-a); }
.brand-mark .b { fill: rgba(61, 149, 240, 0.18); stroke: var(--logo-b); }
.menu-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.side-nav a, .collapse-toggle, .account-toggle, .account-links a, .menu-button, .menu-note, .mobile-menu summary, .mobile-menu a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px;
  border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600;
  border-left: 3px solid transparent;
}
.side-nav a:hover, .collapse-toggle:hover, .account-toggle:hover, .account-links a:hover,
.menu-button:hover, .mobile-menu summary:hover, .mobile-menu a:hover { background: var(--raised); color: var(--ink); }
.side-nav a[aria-current="page"] {
  background: var(--raised); color: var(--ink); border-left-color: var(--accent); font-weight: 800;
}
.side-nav a[aria-current="page"] .icon { color: var(--accent); }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.collapse-toggle { font-weight: 500; color: var(--muted); }
/* Account menu (ADR 0026): above Collapse, set apart by a rule, opening into its own links. */
.account-menu { margin-top: auto; border-top: 1px solid var(--rule); padding-top: 10px; }
.account-toggle { list-style: none; cursor: pointer; font-weight: 500; color: var(--muted); }
.account-toggle::-webkit-details-marker, .mobile-menu summary::-webkit-details-marker { display: none; }
.account-menu[open] .account-toggle { color: var(--ink); }
.account-links { margin: 4px 0 4px 10px; padding-left: 8px; border-left: 1px solid var(--rule); }
.account-links a, .menu-button, .menu-note { min-height: 36px; font-weight: 500; font-size: 0.92rem; }
.account-links a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.account-links form { margin: 0; }
.menu-button { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-note { color: var(--muted); font-size: 0.82rem; }
.account-links .icon { width: 19px; height: 19px; }
.mobile-menu { display: none; }
.nav-collapsed .account-links { margin-left: 0; padding-left: 0; border-left: 0; }
.nav-collapsed .account-toggle, .nav-collapsed .account-links a, .nav-collapsed .menu-button, .nav-collapsed .menu-note { justify-content: center; padding: 8px; }
.nav-collapsed .wordmark { display: none; }
.nav-collapsed .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* names stay for screen readers */
.nav-collapsed .sidebar { padding: 18px 10px; align-items: center; }
.nav-collapsed .side-nav a, .nav-collapsed .collapse-toggle { justify-content: center; padding: 8px; }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px; min-height: 56px; border-bottom: 1px solid var(--rule);
  background: var(--page); position: sticky; top: 0; z-index: 2;
}
.search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 460px;
  background: var(--surface); border: 1px solid var(--control); border-radius: 8px; padding: 0 10px; }
.search .icon { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 7px 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--series); outline-offset: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-link { display: inline-flex; padding: 6px; border-radius: 8px; color: var(--ink-2); }
.icon-link:hover { background: var(--raised); color: var(--ink); }
.data-badge { font-size: 0.8rem; font-weight: 700; color: var(--possible); border: 1px solid var(--possible); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-title { margin: 0 0 1rem; }
/* Lens pills and summary strip (ADR 0017) */
.lens-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: -0.25rem 0 1rem; }
.lens-pill {
  border: 1px solid var(--rule); border-radius: 999px; padding: 6px 16px; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.lens-pill:hover { border-color: var(--accent); }
.lens-pill[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.strip { margin: 0 0 1.25rem; }
.strip .kpis { margin-bottom: 0.5rem; }
.strip-warnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.strip-warnings li { border-left: 3px solid var(--likely); padding-left: 12px; }
.figure-unit { color: var(--muted); font-size: 0.85rem; grid-column: 1 / -1; margin: 0; }
[id] { scroll-margin-top: 72px; }  /* anchors land below the sticky top bar */
.lede-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 800; letter-spacing: -0.01em; margin-top: 0; }

main { width: 100%; max-width: 1120px; padding: 24px 24px 48px; }
.colophon {
  max-width: 1120px; padding: 16px 24px; color: var(--muted);
  font-size: 0.85rem; border-top: 1px solid var(--rule); margin-top: auto;
}
.lede { max-width: 46rem; margin-bottom: 1.5rem; }
.lede > p { color: var(--ink-2); }
.meta, .quiet, .spark-note { color: var(--muted); font-size: 0.88rem; }
.quiet { font-size: 1rem; }

/* Overview */
.family { margin-top: 2.2rem; }
.family-head { border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 4px; }
.family-head h2 { margin: 0 0 4px; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alert {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 10rem;
  gap: 8px 20px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
}
.alert-body p { color: var(--ink-2); max-width: 44rem; }
.alert-body h3 { margin-bottom: 6px; }
.suggestion { font-size: 0.93rem; }
.badge { margin: 2px 0 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.alert-likely .dot { background: var(--likely); }
.alert-possible .dot { background: transparent; border: 2px solid var(--possible); }
.alert-side { text-align: right; }
.alert-side .spark-note { margin: 0 0 6px; }
.action { font-weight: 600; }
.alert-inline { display: flex; gap: 10px; align-items: baseline; color: var(--ink); }
.alert-inline .dot { transform: translateY(1px); }

/* Overview: summary tiles and metric cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.kpi .kpi-label { display: block; color: var(--muted); font-size: 0.85rem; }
.kpi .kpi-value { display: block; margin: 2px 0 0; font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.kpi-hero .kpi-value { font-size: 3rem; }
.kpi-alert .kpi-value { color: var(--likely); }
/* A card with a list opens on click (ADR 0024): it lifts on hover and shows focus. */
.kpi-open { align-self: start; }
.kpi-open > summary { list-style: none; cursor: pointer; border-radius: 6px; }
.kpi-open > summary::-webkit-details-marker { display: none; }
.kpi-open:hover { border-color: var(--ink-2); box-shadow: 0 2px 8px rgb(0 0 0 / 0.12); }
.kpi-more { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--ink-2); text-decoration: underline; }
.kpi-hide, .kpi-open[open] .kpi-show { display: none; }
.kpi-open[open] .kpi-hide { display: inline; }
.kpi-list { margin: 8px 0 0; padding-left: 1.1rem; font-size: 0.9rem; max-height: 14rem; overflow-y: auto; }
.kpi-list li { margin: 2px 0; }
.card:target { outline: 3px solid var(--likely); outline-offset: 2px; }
.cards { list-style: none; margin: 14px 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.card.alert-likely { border-top: 3px solid var(--likely); }
.card.alert-possible { border-top: 3px solid var(--possible); }
.card p { margin: 0; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-head h3 { margin: 0; }
.card-unit { display: block; color: var(--ink-2); font-size: 0.92rem; font-weight: 600; }
.card-head .badge { white-space: nowrap; font-size: 0.88rem; }
.card-figures { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; align-items: baseline; }
.figure { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.figure-label, .delta-base { color: var(--muted); font-size: 0.85rem; grid-column: 1 / -1; }
.delta { font-size: 1.35rem; font-weight: 800; }
.delta-word { font-size: 0.9rem; font-weight: 700; }
.delta-base { font-weight: 500; }
.trend-worse { color: var(--likely); }
.trend-neutral { color: var(--ink); }
.card-range { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 8px; margin: 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; }
.card-range dt { color: var(--muted); font-size: 0.78rem; }
.card-range dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.card-chart { margin: 0; }
.card-chart svg { width: 100%; height: auto; display: block; }
.card-message { color: var(--ink-2); font-size: 0.92rem; }
.spark .band80 { fill: var(--band80); }
.spark .forecast { fill: none; stroke: var(--series); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.spark .threshold { stroke: var(--threshold); stroke-width: 1.5; stroke-dasharray: 2 4; }
.spark .divider { stroke: var(--axis); stroke-width: 1; }

/* Charts (colours by class so the theme controls them) */
.chart-figure { margin: 0 0 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 12px 8px; }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .history, .spark .history { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .forecast { fill: none; stroke: var(--series); stroke-width: 2; stroke-dasharray: 6 4; stroke-linecap: round; }
.chart .actual { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; } /* what happened, in a look-back chart */
.chart .band80 { fill: var(--band80); }
.chart .band95 { fill: var(--band95); }
.chart .divider { stroke: var(--axis); stroke-width: 1; }
.chart .threshold { stroke: var(--threshold); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .end, .spark .end { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--grid); fill-opacity: 0.5; }
figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

/* Forms */
.picker, .field-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; }
.picker { margin-bottom: 4px; }
label { display: block; font-size: 0.9rem; color: var(--ink-2); max-width: 100%; }
select { max-width: 100%; }
.picker label, .field-row label { display: flex; flex-direction: column; gap: 4px; }
select, input[type="text"], input[type="password"], input:not([type]), input[inputmode], input[type="file"], .evidence-search input[type="search"] {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--control); border-radius: 4px; padding: 6px 8px; min-height: 38px; max-width: 100%;
}
button {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--control); border-radius: 4px; padding: 7px 14px; cursor: pointer; min-height: 38px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
fieldset { border: 1px solid var(--rule); border-radius: 4px; padding: 10px 14px; margin: 0; }
legend { font-size: 0.9rem; color: var(--ink-2); padding: 0 4px; }
.choice { display: flex; gap: 8px; align-items: baseline; color: var(--ink); margin: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: start; }
.assumptions { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 1.5rem; }
.assumptions h2 { margin: 0; }
.assumptions > button { align-self: flex-start; }
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; margin-bottom: 0.6rem; }
.table-wrap .data { margin-bottom: 0; }

/* Data onboarding */
.gates-legend { padding-left: 1.4rem; color: var(--ink-2); }
.gates-legend li { margin: 2px 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 12px 40px; }
.samples { display: flex; flex-direction: column; gap: 8px; }
.sample { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; width: 100%; }
.sample:hover { border-color: var(--accent); }
.sample-label { font-weight: 600; }
.sample-expect { color: var(--muted); font-size: 0.86rem; }

.gates { list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: gate; }
.gate {
  display: grid; grid-template-columns: 7.5rem 13rem minmax(0, 1fr); gap: 4px 16px;
  padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.gate-state { font-weight: 600; }
.gate-name { font-weight: 700; }
.gate-purpose { color: var(--muted); font-size: 0.9rem; }
.gate-passed .gate-state { color: var(--pass); }
.gate-passed .gate-state::before { content: "✓ "; }
.gate-stopped .gate-state { color: var(--likely); }
.gate-stopped .gate-state::before { content: "✕ "; }
.gate-waiting .gate-state { color: var(--ink); }
.gate-waiting .gate-state::before { content: "… "; }
.gate-not-reached { color: var(--muted); }
.gate-not-reached .gate-state, .gate-not-reached .gate-name { color: var(--muted); }
.findings { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Tables */
.data { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.93rem; margin-bottom: 0.6rem; }
.data th, .data td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.data thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; border-bottom-color: var(--axis); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data tr.chosen th, .data tr.chosen td { background: var(--band95); }
.data .sev-block td:first-child { color: var(--likely); font-weight: 600; }
.tag { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.table-view { margin: 1.5rem 0; }
.table-view summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.table-view .data { margin-top: 10px; }
.forecast-row td { color: var(--ink-2); }
.estimates { max-width: 44rem; }

.how-to { margin-top: 0.4rem; }
.how-to summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.how-to p { margin-top: 8px; color: var(--ink-2); }
.definition { color: var(--ink-2); max-width: 46rem; }
.glossary th[scope="row"] { white-space: normal; min-width: 11rem; }
.guide-terms { max-width: 52rem; gap: 8px 22px; }
.guide-terms dt { font-weight: 600; color: var(--ink); }
.hypothetical { border-left: 3px solid var(--possible); padding: 4px 0 4px 12px; color: var(--ink); }
.withheld { border-left: 3px solid var(--axis); padding-left: 12px; }
.error { border-left: 3px solid var(--likely); padding-left: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Experiments */
.alert-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.4rem; }
.pick {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--control); color: var(--ink); text-decoration: none; font-size: 0.9rem;
}
.pick[aria-current="true"] { border-color: var(--accent); background: var(--raised); }
.pick-conf { color: var(--muted); font-size: 0.82rem; }
.selected-alert p { color: var(--ink-2); max-width: 46rem; }
.idea {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 18px 20px; margin: 0 0 1.4rem;
}
.idea-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.idea-head h2 { margin: 0; }
.idea h3 { margin-top: 1.2rem; }
.idea .data { background: var(--raised); }
.evidence { color: var(--ink-2); }
.evidence a { margin-left: 2px; }
.idea-facts { margin: 0.8rem 0; }
.tag { font-size: 0.8rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--control); color: var(--ink-2); }
.strength-moderate { border-color: var(--pass); color: var(--pass); }
.strength-none { color: var(--muted); }
.strength-low { color: var(--ink-2); }
.verdict-line { font-weight: 650; max-width: 46rem; }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: baseline; margin: 6px 0; }
.box { width: 14px; height: 14px; border: 2px solid var(--control); border-radius: 3px; flex: none; transform: translateY(2px); }
.brief { max-width: 52rem; }
.brief-facts { gap: 8px 22px; }
.brief-facts dt { font-weight: 700; color: var(--ink); }

/* Results */
.results-head .lede-title { margin-bottom: 0.3rem; }
.results-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 0.9rem; }
.status-pill {
  background: var(--raised); border: 1px solid var(--possible); color: var(--possible);
  padding: 1px 10px; border-radius: 999px; font-weight: 700;
}
.design-note { color: var(--ink-2); max-width: 52rem; border-left: 3px solid var(--possible); padding-left: 12px; }
.headline {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px 20px; margin: 1.2rem 0;
}
.headline p { margin: 0; }
.headline-label { color: var(--ink-2); font-weight: 650; }
.headline-value { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.headline-detail { color: var(--ink-2); }
.headline .verdict-badge { grid-column: 2; grid-row: 1 / span 3; font-size: 1.1rem; }
.verdict-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.verdict-badge.improved { color: var(--pass); }
.verdict-badge.improved .dot { background: var(--pass); }
.verdict-badge.worsened { color: var(--likely); }
.verdict-badge.worsened .dot { background: var(--likely); }
.verdict-badge.inconclusive { color: var(--ink-2); }
.verdict-badge.inconclusive .dot { background: transparent; border: 2px solid var(--muted); }
.sub { color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.results-table td { vertical-align: middle; }
.interval-text { display: block; font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--ink-2); }
.interval-bar { display: block; }
.interval-bar .zero, .chart .zero { stroke: var(--ink-2); stroke-width: 1; }
.interval-bar .interval { stroke-width: 4; stroke-linecap: round; stroke: var(--muted); }
.interval-bar .interval.improved { stroke: var(--pass); }
.interval-bar .interval.worsened { stroke: var(--likely); }
.interval-bar .point { fill: var(--ink); }
.checks { color: var(--ink-2); }

@media print {
  :root { --page: #ffffff; --surface: #ffffff; --raised: #ffffff; --ink: #000000; --ink-2: #222222;
          --muted: #444444; --rule: #bbbbbb; --control: #666666; --accent: #000000; }
  .sidebar, .topbar, .no-print, .colophon { display: none; }
  .shell { display: block; }
  main:has(.brief) .page-title { display: none; }  /* a printed brief leads with its own title */
  .synthetic { background: #ffffff; color: #000000; border-bottom: 1px solid #000000; }
  a { color: #000000; }
}

@media (max-width: 720px) {
  .shell, .nav-collapsed .shell { grid-template-columns: minmax(0, 1fr); }
  .synthetic { font-size: 0.74rem; padding: 5px 12px; }
  /* Phones: the brand and one Menu button; the menu opens below them, full width. */
  .sidebar, .nav-collapsed .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-right: 0; border-bottom: 1px solid var(--rule); padding: 8px 12px; }
  .side-nav, .account-menu, .collapse-toggle { display: none; }
  .nav-collapsed .wordmark { display: block; }
  .brand-mark { width: 30px; height: 20.4px; }
  .wordmark { height: 20px; width: auto; }
  .sidebar { position: relative; z-index: 3; overflow: visible; }
  .mobile-menu { display: block; }
  .mobile-menu summary { list-style: none; cursor: pointer; min-height: 44px; border: 1px solid var(--control); border-radius: 8px; padding: 6px 12px; color: var(--ink); }
  .mobile-menu[open] summary { background: var(--raised); }
  .mobile-menu:not([open]) .mobile-menu-panel { display: none; }
  /* The open menu drops over the page below the bar, full width. */
  .mobile-menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--rule); padding: 6px 12px 12px; box-shadow: 0 10px 24px rgb(0 0 0 / 0.35); }
  .mobile-menu-panel nav + nav { border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 6px; }
  .mobile-menu a, .mobile-menu .menu-button, .mobile-menu .menu-note { min-height: 44px; padding: 8px 10px; }
  .mobile-menu a[aria-current="page"] { background: var(--raised); color: var(--ink); border-left-color: var(--accent); font-weight: 800; }
  /* Phones always show the names: there is no hover, so icons alone would be unlabelled. */
  .nav-label, .nav-collapsed .nav-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .account-links { margin: 0; padding: 0; border: 0; }
  .topbar { padding: 8px 12px; }
  .data-badge { display: none; }
  main { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alert { grid-template-columns: minmax(0, 1fr); }
  .alert-side { text-align: left; }
  .gate { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .gate-purpose { grid-column: 2; }
  .data { font-size: 0.86rem; }
  .data th, .data td { padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Registry */
.register { margin-top: 1.6rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 16px; }
.register h2 { margin-top: 0; }
.field-row.compact { gap: 6px 10px; }
.field-row.compact select, .field-row.compact button { padding: 4px 8px; }
code.wrap { overflow-wrap: anywhere; }

/* Registered test results (planned looks and harm checks) */
.monitor-banner { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--control); border-radius: 8px; padding: 12px 16px; margin: 8px 0 12px; }
.monitor-banner p { margin: 0 0 4px; }
.monitor-banner .banner-title { font-weight: 800; font-size: 1.1rem; }
.decision-harm { border-left-color: var(--likely); }
.decision-benefit, .decision-final { border-left-color: var(--pass); }
.decision-continue { border-left-color: var(--series); }

/* Search results */
.search-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.search-results li { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; }
.search-results a { font-weight: 700; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); max-width: 46rem; }

/* Evidence */
.evidence-search { margin: 0 0 1.2rem; }
.evidence-search input { min-width: 16rem; }
.evidence-entry h4 { margin: 0; font-size: 1rem; }
.evidence-entry p { margin: 0.4rem 0; max-width: 52rem; }
.local-results { padding-left: 1.2rem; }
.measured-here { border-left: 3px solid var(--pass); padding-left: 10px; }

/* Card summaries and the forecast board (ADR 0018) */
.card-kicker { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--ink-2); }
.card-sentence { font-size: 1.12rem; font-weight: 800; line-height: 1.35; color: var(--ink); }
.card-definition { margin: 0; font-size: 0.88rem; color: var(--ink-2); max-width: 46rem; }
.card-detail-sentence { margin: 0; font-size: 1rem; color: var(--ink); }
.card-headline { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.card-headline .figure { font-size: 3rem; line-height: 0.95; }
.tone-worse { color: var(--possible); }
.tone-neutral { color: var(--ink); }
.figure-main { font-weight: 700; }
.week-by-week { margin: 0; display: grid; gap: 4px; }
.week-by-week figcaption { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.week-strip { width: 100%; height: 84px; display: block; }
.week-strip .axis { stroke: var(--axis); stroke-width: 1; }
.week-strip .bar-worse { fill: var(--possible); }
.week-strip .bar-other { fill: var(--series); }
.week-strip .bar-neutral { fill: var(--muted); }
.week-strip .holiday { fill: var(--ink-2); }
.week-values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--weeks, 13), minmax(0, 1fr));
  font-size: 0.68rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.week-values .tone-worse { color: var(--possible); font-weight: 800; }
.week-values .holiday { text-decoration: underline dotted; }
.week-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; color: var(--muted); }
.week-holidays { font-size: 0.75rem; color: var(--muted); }
.card-details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.card-details[open] { display: grid; gap: 10px; }
.card-details[open] summary { margin-bottom: 4px; }
.figure-detail { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.spark .now { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 5 4; }

.board { margin: 1.5rem 0 2rem; }
.board h2 { margin-bottom: 0.25rem; }
.board-key { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 0.5rem 0; font-size: 0.85rem; color: var(--ink-2); }
.board-key li { display: flex; align-items: center; gap: 6px; }
.board-key .swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.board-table th[scope="row"] { font-weight: 700; text-align: left; }
.board-unit { color: var(--ink-2); font-weight: 500; }
.board-table td.num { font-weight: 700; }
.conf-likely { color: var(--likely); font-weight: 700; }
.conf-possible { color: var(--possible); font-weight: 700; }
.shade-neutral { background: rgba(142, 166, 153, 0.12); }
.shade-worse-1 { background: rgba(242, 182, 50, 0.18); }
.shade-worse-2 { background: rgba(242, 182, 50, 0.34); }
.shade-worse-3 { background: rgba(242, 182, 50, 0.52); }
.shade-other-1 { background: rgba(61, 149, 240, 0.18); }
.shade-other-2 { background: rgba(61, 149, 240, 0.32); }
.shade-other-3 { background: rgba(61, 149, 240, 0.48); }

/* A/B test summaries (ADR 0018) */
.idea-summary { display: grid; gap: 10px; margin: 0.4rem 0 0.8rem; }
.idea-sentence, .result-sentence { font-size: 1.15rem; font-weight: 800; line-height: 1.35; margin: 0; }
.idea-headline, .result-headline { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.idea-headline .figure, .result-headline .figure { font-size: 3rem; line-height: 0.95; margin: 0; }
.idea-headline p, .result-headline p { margin: 0; }
.kind-can-tell .figure, .result-good .figure { color: var(--series); }
.kind-may-miss .figure { color: var(--possible); }
.result-harm .figure { color: var(--likely); }
.detect-scale, .looks-chart { width: 100%; max-width: 520px; height: auto; display: block; }
.detect-scale .tick, .looks-chart .tick { fill: var(--muted); font: 11px var(--sans); }
.detect-scale .tick.strong, .looks-chart .tick.strong { fill: var(--ink); font-weight: 700; }
.detect-scale .undetectable { fill: rgba(142, 166, 153, 0.14); }
.detect-scale .detect-line, .looks-chart .zero { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 3; }
.detect-scale .expected-range, .looks-chart .interval { fill: rgba(61, 149, 240, 0.35); }
.detect-scale .expected.can-tell, .looks-chart .estimate { fill: var(--series); }
.detect-scale .expected.may-miss { fill: var(--possible); }
.detect-scale .axis, .looks-chart .axis { stroke: var(--axis); }
.idea-more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.result-summary { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 16px; margin: 8px 0 12px; }
.card-caution { color: var(--possible); font-size: 0.88rem; font-weight: 600; }

/* Sizing on the hospital's own target (ADR 0019) */
.target-form { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; margin: 0.5rem 0 0.25rem; }
.target-form .target-title { flex-basis: 100%; margin: 0; }
.detect-scale .expected-ghost { fill: none; stroke: var(--series); stroke-width: 2; }

.feed-offer { border: 2px solid var(--ink-2); border-radius: 8px; padding: 12px 16px; margin: 0 0 1.25rem; }
/* Plan and usage (ADR 0025) */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; }
.plan-current { border: 2px solid var(--ink-2); }
.plan-tokens { font-size: 1.4rem; font-weight: 800; margin: 4px 0; }
meter.usage { width: 100%; height: 1.25rem; margin: 8px 0; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.notice { border-left: 3px solid var(--ink-2); padding-left: 12px; }

/* Hosted demo sign-in (ADR 0026) */
.signin { max-width: 26rem; margin: 9vh auto 0; padding: 0 16px 40px; }
.signin h1 { font-size: 1.7rem; margin: 0.6rem 0 0.4rem; }
.skip-link { position: absolute; left: 16px; top: -48px; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); z-index: 20; }
.skip-link:focus { top: 12px; }
/* The website's menu, above the sign-in form: the same links as getomelvian.com. On phones
   a menu button opens them; it is a link to #site-menu, so it needs no script. */
.site-header { background: var(--page); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; }
.site-header-inner { display: flex; align-items: center; gap: 28px; max-width: 1160px; min-height: 64px; margin: 0 auto; padding: 0 24px; }
.site-links { margin-left: auto; }
.site-links ul, .site-menu ul { list-style: none; margin: 0; padding: 0; }
.site-links ul { display: flex; gap: 26px; }
.site-links a, .site-menu ul a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-links a:hover { border-bottom-color: var(--accent); }
.site-menu-open, .site-menu-close { display: none; width: 44px; height: 44px; border-radius: 10px; align-items: center; justify-content: center; color: var(--ink); }
.site-menu-open svg, .site-menu-close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.site-menu-open:hover, .site-menu-close:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.site-menu-closed { position: fixed; top: 0; width: 0; height: 0; overflow: hidden; }  /* close target: fixed, so the page does not move */
.site-menu { display: none; position: fixed; inset: 0 0 auto 0; z-index: 11; background: var(--page); border-bottom: 1px solid var(--rule); padding: 12px 16px 24px; }
.site-menu:target { display: block; }
.site-menu .site-menu-close { display: flex; margin-left: auto; }
.site-menu ul { display: grid; gap: 4px; margin-top: 4px; }
.site-menu ul a { display: block; padding: 12px 4px; font-size: 1.15rem; }
.site-menu ul a:hover { color: var(--accent); }
@media (max-width: 860px) {
  .site-links { display: none; }
  .site-menu-open { display: flex; margin-left: auto; }
  .site-header-inner { padding: 0 16px; min-height: 58px; }
}
.signin input { width: 100%; }
.signin-error { color: var(--possible); font-weight: 700; }
/* Admin capacity page (ADR 0034): the operator only. */
.admin { max-width: 44rem; margin: 6vh auto 0; padding: 0 16px 40px; }
.admin-warnings { border-left: 4px solid var(--likely); padding: 0.2rem 0 0.2rem 0.9rem; }
.admin-warnings h2 { color: var(--likely); font-size: 1.1rem; margin: 0.4rem 0; }
.admin-ok { font-weight: 700; }
.admin th { text-align: left; font-weight: 600; }
.commands dt { margin-top: 10px; }
.commands dt code { overflow-wrap: anywhere; }
.commands dd { margin: 2px 0 0; color: var(--ink-2); }

/* Start-here tour (ADR 0027) */
a.button { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--control); text-decoration: none; color: var(--ink); font-weight: 600; }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tour-bar { border: 2px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; background: var(--raised); }
.tour-bar p { margin: 6px 0; }
.tour-step { color: var(--muted); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tour-title { margin: 2px 0 6px; font-size: 1.15rem; }
.tour-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }
.tour-invite { margin: 0 0 12px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tour-hide { font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.tour-stops li { margin-bottom: 10px; }
.try-upload { border: 1px dashed var(--control); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.try-upload ul { margin: 6px 0 0; padding-left: 18px; }

/* Executive summary (ADR 0028) */
.exec-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.exec-tile { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; background: var(--raised); }
.exec-number { font-size: 1.9rem; font-weight: 800; margin: 0; letter-spacing: -0.01em;
  overflow-wrap: anywhere; }
.exec-label { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.exec-panel { margin: 0 0 22px; }
.exec-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exec-chart .target-line { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; }
.exec-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.exec-chart { width: 100%; height: auto; display: block; }
.exec-chart .tick { font-size: 12px; fill: var(--muted); }
.exec-chart .grid { stroke: var(--rule); stroke-width: 1; }
.exec-chart .axis { stroke: var(--control); stroke-width: 1; }
.exec-chart .value-line { fill: none; stroke: var(--accent); stroke-width: 3; }
.exec-chart .value-area { fill: var(--accent); opacity: 0.12; }
.exec-chart .value-dot { fill: var(--accent); }
.exec-chart .count-bar { fill: var(--accent); opacity: 0.8; }
.exec-chart .bar-count { font-size: 13px; font-weight: 700; fill: var(--ink); }
.exec-outcomes { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.exec-outcomes li { display: grid; grid-template-columns: 9.5rem 1fr 2rem; align-items: center; gap: 10px; }
.exec-outcome-bar { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border: 0; border-radius: 7px; background: var(--rule); overflow: hidden; }
.exec-outcome-bar::-webkit-meter-bar { background: var(--rule); border: 0; border-radius: 7px; height: 14px; }
.exec-outcome-bar::-webkit-meter-optimum-value, .exec-outcome-bar::-webkit-meter-suboptimum-value, .exec-outcome-bar::-webkit-meter-even-less-good-value { background: var(--muted); border-radius: 7px; }
.exec-outcome-bar::-moz-meter-bar { background: var(--muted); border-radius: 7px; }
.exec-outcome-bar.outcome-worked::-webkit-meter-optimum-value { background: var(--accent); }
.exec-outcome-bar.outcome-worked::-moz-meter-bar { background: var(--accent); }
.exec-outcome-bar.outcome-made_worse::-webkit-meter-optimum-value { background: var(--possible); }
.exec-outcome-bar.outcome-made_worse::-moz-meter-bar { background: var(--possible); }
.exec-outcome-count { font-weight: 700; text-align: right; }
.exec-risks li, .exec-how li, .exec-kinds li { margin-bottom: 6px; }
.exec-price { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-top: 12px; }
.exec-price label { flex-basis: 100%; }
.exec-price input { width: 12rem; }
.exec-price p { flex-basis: 100%; margin: 4px 0 0; }
@media (max-width: 720px) {
  .exec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exec-two { grid-template-columns: minmax(0, 1fr); }
  .exec-number { font-size: 1.5rem; }
  .exec-outcomes li { grid-template-columns: 7.5rem 1fr 1.5rem; }
}

/* Test wizard (ADR 0029) */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0;
  margin: 0 0 16px; font-size: 0.9rem; }
.wizard-steps li { color: var(--muted); }
.wizard-steps li.is-done a { color: var(--accent); }
.wizard-steps li.is-current { color: var(--ink); font-weight: 700; }
.wizard-step .stack fieldset { border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 14px; margin: 0 0 14px; }
.wizard-step .choice { display: block; margin: 8px 0; line-height: 1.45; }
.wizard-step .choice .meta { display: block; }
.wizard-so-far { margin-bottom: 18px; }
.wizard-noted { margin: 0 0 14px; }
