/* EaaS demo prototype (design v9: content v7, layered pages v8, charts v9). Palette: neutral greys, one primary (deep teal), amber for caution only. */
:root {
  /* Three colours only: neutral greys, one primary (deep teal, in shades), amber for caution. */
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f2f4f6; --line: #e1e5ea; --line-strong: #c9d0d8;
  --ink: #1b2430; --muted: #5b6675; --label: #4a5563;
  --primary: #0f5f66; --primary-dark: #0a474d; --primary-tint: #e6f0f1; --primary-line: #b5d0d3;
  --primary-deep: #0e2a30; --primary-on-deep: #9fd3d8;
  --amber: #8a5a12; --amber-bg: #fbf3df; --amber-line: #e7d7aa; --focus: #c08a1e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.6; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--primary); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px;
}
h1:focus, main:focus { outline: none; }
h1:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
p, li, dd, td, th { overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.2; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 12px; background: #fff; padding: 10px 14px; z-index: 10; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.overline { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--label); margin: 0 0 8px; }
.eyebrow { text-transform: uppercase; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 28px; padding: 14px clamp(16px, 4vw, 60px); background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; line-height: 1.1; flex-shrink: 0; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; margin-top: 4px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; background: var(--primary); font: 700 18px Georgia, serif; }
.topbar-decision { margin: 0 0 0 auto; max-width: 640px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.topbar-decision span, .decision-q span, .record-decision span { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--primary); border-radius: 10px; padding: 2px 8px; margin-right: 6px; vertical-align: 1px; }

main { display: block; min-height: 60vh; }

/* Hero and closing: the line alone */
.hero-view, .closing-view { min-height: calc(100vh - 50px); background: var(--primary-deep); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 8vw, 140px); }
.hero-view h1, .closing-view h1 { font: 500 clamp(40px, 7vw, 92px)/1.08 Georgia, serif; letter-spacing: -.035em; margin: 0; max-width: 1100px; }
.closing-view h1 { font-size: clamp(32px, 5vw, 64px); max-width: 1000px; }
.hero-view h1 { font-size: clamp(38px, 6vw, 80px); max-width: 1000px; }
.hero-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-on-deep); margin: 0 0 22px; }
.hero-sub { font: 400 clamp(19px, 2vw, 26px)/1.45 Georgia, serif; color: #e4eced; max-width: 820px; margin: 26px 0 0; }
.hero-example { font-size: 15px; font-weight: 700; color: #fff; margin: 22px 0 0; padding-left: 12px; border-left: 3px solid var(--primary-on-deep); }
.hero-means { font-size: 14px; color: #9fb1b6; max-width: 640px; margin: 40px 0 0; padding-top: 16px; border-top: 1px solid #ffffff22; }
.hero-next, .closing-back { align-self: flex-start; margin-top: 44px; color: var(--primary-on-deep); font-size: 15px; font-weight: 700; text-decoration: none; border-bottom: 1px solid #9fd3d866; padding: 4px 0; }
.hero-next:hover, .closing-back:hover { border-bottom-color: var(--primary-on-deep); }
.closing-back { font-weight: 400; font-size: 13px; color: #b7c4c9; }

/* Buttons and links */
.primary-btn { display: inline-flex; align-items: center; gap: 9px; border: 0; background: var(--primary); color: #fff; border-radius: 8px; padding: 12px 18px; font-size: 14px; font-weight: 700; text-decoration: none; line-height: 1.35; }
.primary-btn:hover { background: var(--primary-dark); }
.action { display: inline-block; border: 1px solid var(--primary-line); background: #fff; color: var(--primary); border-radius: 7px; padding: 9px 12px; font-size: 13px; font-weight: 700; line-height: 1.4; text-decoration: none; }
.action:hover { background: var(--primary-tint); border-color: var(--primary); }
.text-link { font-weight: 700; text-underline-offset: 3px; }

/* Starting point */
.start-view { max-width: 1200px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 60px); }
.start-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.start-title { font: 500 clamp(30px, 3.4vw, 44px)/1.15 Georgia, serif; letter-spacing: -.02em; margin: 0 0 20px; }
.start-conclusion { font: 400 clamp(18px, 1.7vw, 22px)/1.5 Georgia, serif; margin: 0 0 28px; max-width: 680px; }
.start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.decision-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; padding: 22px 24px; }
.decision-card h2 { margin: 0 0 10px; }
.decision-text { font: 500 clamp(20px, 2vw, 26px)/1.3 Georgia, serif; margin: 0 0 12px; }
.decision-note { font-size: 13px; color: var(--muted); margin: 0; }
.about-demo { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 820px; font-size: 13px; color: var(--muted); }
.about-demo p { margin: 0 0 8px; }

/* Workspace */
.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; max-width: 1400px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 44px) 56px; }
.rail { align-self: start; position: sticky; top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; }
.rail-title { font-size: 10px; letter-spacing: .12em; font-weight: 700; color: var(--muted); text-transform: uppercase; margin: 14px 8px 6px; }
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-end { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.rail-link { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.3; border: 1px solid transparent; }
.rail-link:hover { background: var(--surface-2); }
.rail-link.active { background: var(--primary-tint); border-color: var(--primary-line); font-weight: 700; }
.rail-mark { color: var(--primary); font-weight: 700; }
.rail-link .count { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.rail-count { margin: 2px 8px 0; font-size: 12px; color: var(--muted); }
.rail-title.rail-end { padding-top: 12px; }
.rail-link:not(.done) .rail-mark { color: var(--muted); font-weight: 400; }
.rail-result .rail-link { font-weight: 700; }
.surface { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: clamp(18px, 3vw, 34px); }
.surface h1 { font: 500 clamp(26px, 3vw, 38px)/1.18 Georgia, serif; letter-spacing: -.02em; margin: 0 0 12px; }
.surface h2 { font: 500 22px/1.25 Georgia, serif; margin: 0 0 10px; }
.surface h2 .count { font: 400 13px Arial, sans-serif; color: var(--muted); margin-left: 6px; }
.surface h3 { font-size: 15px; margin: 18px 0 8px; }
.h-small { font: 700 12px/1.3 Arial, sans-serif !important; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); margin: 0 0 10px !important; }
.population { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.population span { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin-right: 6px; }
.intro { color: var(--muted); margin: 0 0 14px; }
.block { margin: 22px 0; }
.evidence-list { padding-left: 20px; margin: 14px 0; }
.evidence-list li { margin: 7px 0; }
.lead-in { margin: 0 0 14px; }

/* Production strip: what it took to produce this evidence (v6 §4.3) */
.strip { margin: 0 0 22px; border: 1px solid var(--primary-line); border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; background: var(--primary-tint); padding: 12px 16px 10px; }
.strip dl { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2.2fr) minmax(0, 1fr); gap: 4px 24px; margin: 0; }
.strip .f { min-width: 0; }
.strip dt { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--label); margin-bottom: 3px; }
.strip dd { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.strip dd b { display: inline-block; font: 700 22px/1.15 Georgia, serif; color: var(--primary); letter-spacing: -.01em; }
.strip .times { display: flex; flex-wrap: wrap; gap: 4px 22px; overflow-wrap: normal; }
.strip .t { display: inline-flex; flex-direction: column; min-width: 0; }
.strip .t-src { font-size: 11px; font-weight: 700; color: var(--label); }
.strip .times b { font-size: 21px; white-space: nowrap; }
.strip .sep { display: none; }
.strip .nr dd { font-style: italic; color: var(--muted); }
.strip-label { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.session-total { margin: 0 0 24px; border: 1px solid var(--primary-line); border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; background: var(--primary-tint); padding: 14px 18px; }
.session-text { margin: 0; font: 400 17px/1.5 Georgia, serif; }
.session-text strong { color: var(--primary); font-size: 21px; }

/* Sources side by side */
.table-title { font-size: 12px; font-weight: 700; color: var(--ink); margin: 6px 0 -6px; }
table.src-table { min-width: 560px; }
table.src-table tbody th { min-width: 150px; }
table.src-table tbody th, table.src-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
table.src-table thead th:first-child { background: var(--surface-2); }
td.na, .na { color: var(--muted); font-style: italic; }
.src-focus { box-shadow: inset 0 0 0 9999px var(--primary-tint); }
th.src-focus { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.src-banner { font-size: 12px; font-weight: 700; color: var(--primary-dark); background: var(--primary-tint); border-radius: 6px; padding: 6px 10px; display: inline-block; margin: 0 0 10px; }

/* Evidence map */
.map-headline { font: 400 19px/1.45 Georgia, serif; margin: 0 0 16px; }
.map-headline strong { font-weight: 700; color: var(--ink); }
table.map-table { table-layout: fixed; }
table.map-table thead th:first-child { width: 31%; }
table.map-table th[scope=row] { font-weight: 700; }
table.map-table th[scope=row] a { color: var(--ink); text-decoration: none; }
table.map-table th[scope=row] a:hover { text-decoration: underline; }
table.map-table td { padding: 0; }
.map-cell { display: block; padding: 12px; color: var(--ink); text-decoration: none; height: 100%; min-height: 48px; }
.map-cell:hover { background: var(--primary-tint); }
.map-cell .time { font: 700 17px/1.2 Georgia, serif; color: var(--primary); white-space: nowrap; }
.map-cell .note { display: block; font-size: 12px; font-weight: 700; color: var(--amber); margin-top: 3px; }
.mark { display: inline-block; width: 1.4em; font-weight: 700; }
.mark.ok { color: var(--primary); }
.mark.part { color: transparent; position: relative; }
.mark.part::after { content: ''; position: absolute; left: 0; top: 50%; width: .8em; height: .8em; margin-top: -.45em; border-radius: 50%; border: 2px solid var(--amber); background: linear-gradient(90deg, var(--amber) 50%, transparent 50%); }
.map-legend { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }

/* Two evidence blocks on one page (published evidence, our data) */
.evidence-block { margin: 18px 0 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.evidence-block:first-of-type { border-top: 0; padding-top: 0; }
.block-title { font: 500 22px/1.25 Georgia, serif !important; margin: 0 0 8px !important; }
.evidence-block .population { margin-bottom: 12px; }
table.lit-table { min-width: 640px; }
@media (min-width: 601px) {
  table.lit-table tbody th { width: 30%; }
  table.lit-table td:nth-child(3) { width: 22%; }
}
table.lit-table td a { white-space: nowrap; }
.gap-statement { margin: 14px 0 0; padding: 14px 16px; background: var(--primary-tint); border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; }

/* Tables: wide tables scroll inside their own container */
.table-wrap { max-width: 100%; overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: var(--surface-2); font-size: 12px; color: var(--label); line-height: 1.35; }
tbody th { font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead th.num { white-space: normal; }
table.wide { min-width: 620px; }
table.panel { min-width: 760px; }
table.main-table td { font-size: 15px; }
table.main-table thead th { width: 24%; }
.scroll-hint { display: none; font-size: 11px; color: var(--muted); margin: 10px 0 -8px; text-align: right; }
@media (max-width: 900px) { .scroll-hint { display: block; } }
.table-wrap.scrolls { box-shadow: inset -12px 0 10px -10px #1b243033; }
table.main-table { min-width: 560px; }
table.main-table tbody th { min-width: 130px; }
.table-note { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.verdict { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--primary-tint); color: var(--primary); }
.verdict.warn { background: var(--amber-bg); color: var(--amber); }
.verdict.no { background: var(--amber-bg); color: var(--amber); }
.tests-table td strong { color: var(--primary); }

.qualification { font-size: 13px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--line-strong); padding: 10px 14px; margin: 14px 0; }
.callout { border: 1px solid var(--amber-line); background: var(--amber-bg); border-radius: 9px; padding: 14px 16px; margin: 18px 0; }
.callout .h-small { color: var(--amber); }
.callout p { margin: 0; }
.interpretation { margin: 22px 0; }
.interpretation p { font: 400 19px/1.45 Georgia, serif; margin: 0; }
.time-label { font-size: 13px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--primary); padding: 10px 14px; margin: 4px 0 16px; }
.answer { margin: 18px 0 0; }
.answer-lead { font: 400 24px/1.35 Georgia, serif; color: var(--ink); margin: 6px 0 0; }
.answer-points { margin: 12px 0 0; padding-left: 20px; font-size: 16px; line-height: 1.5; }
.answer-points li { margin: 0 0 6px; }
.answer-points li::marker { color: var(--primary); }

/* Charts (v9). Colour carries only the kidney state: still elevated = primary, back below = grey, not re-measured = hollow grey.
   Gaps, trials and the coverage strip are drawn in ink and neutral greys. */
.fig { --below: color-mix(in srgb, var(--muted) 68%, var(--surface)); --lab: 14px; --row: 24px;
  container-type: inline-size; margin: 16px 0 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; font-size: var(--lab); line-height: 1.3; }
.fig figcaption { color: var(--label); font-weight: 700; margin: 0 0 14px; max-width: 900px; line-height: 1.4; }
.fig p { margin: 0; }
.fig i { font-style: normal; display: block; }
.fig-panels { display: grid; gap: 26px; }
.fig-panel { min-width: 0; }
.fig-source { font-weight: 700; color: var(--ink); }
.fig-panel > .fig-source { padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.fig-sub { font-weight: 700; color: var(--ink); margin: 22px 0 10px !important; }
.fig-sub:first-child { margin-top: 0 !important; }
.fig-scope { color: var(--muted); margin: -4px 0 8px !important; }
.fig-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 14px; padding: 0; color: var(--label); }
.fig-legend li { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.fig-legend .key.dot { position: static; transform: none; flex: none; }
.fig-legend .key.line { width: 22px; height: 3px; border-radius: 2px; flex: none; }
.fig-legend .ln-recent { background: var(--primary); }
.fig-legend .ln-gone { background: var(--below); }
.fig-note { color: var(--muted); margin: 10px 0 0 !important; }
.axis-title { color: var(--muted); text-align: center; }

/* Plot box: its left and right edges are the axis ends */
.plot { display: block; position: relative; height: var(--row); }
.plot.with-after { margin-right: 54px; }
.gridline { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--line); }
.gridline.zero { background: var(--muted); }
.plot.axis { height: 20px; }
.tick-label { position: absolute; top: 2px; transform: translateX(-50%); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plot.axis.ends .tick-label:first-child { transform: none; }
.plot.axis.ends .tick-label:last-child { transform: translateX(-100%); }
.bar-row { margin: 0 0 10px; }
.bar-lab { display: flex; justify-content: space-between; gap: 8px; color: var(--ink); margin: 0 0 3px; }
.bar-n { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.axis-row { margin-top: -6px; }
.bar { position: absolute; left: 0; top: 4px; bottom: 4px; border-radius: 0 4px 4px 0; transform-origin: left; }
.bar.st-ongoing { background: var(--primary); }
.bar.st-below { background: var(--below); }
.bar.st-no_recent { background: var(--surface); border: 2px solid var(--below); border-left: 0; }
.bar.st-hollow { background: var(--surface); border: 2px solid var(--primary); border-left: 0; }
.track { position: absolute; inset: 4px 0; background: var(--surface-2); border-radius: 4px; }
.track.thin { inset: 11px 0; border-radius: 1px; background: var(--line); }
/* Interval: a line with end caps */
.ci { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--ink); }
.ci.on-bar { background: linear-gradient(90deg, var(--surface) var(--in), var(--ink) var(--in)); }
.ci.on-bar::before { background: var(--surface) !important; }
.ci::before, .ci::after { content: ''; position: absolute; top: -4px; width: 2px; height: 10px; background: var(--ink); }
.ci::before { left: 0; }
.ci::after { right: 0; }
.dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); background: var(--ink); }
.dot.st-ongoing, .dot.pt-recent { background: var(--primary); }
.dot.st-below, .dot.pt-gone { background: var(--below); }
.dot.gap-hollow { background: var(--surface); border: 2px solid var(--ink); }
.link { position: absolute; top: 50%; height: 4px; margin-top: -2px; background: var(--line-strong); }
.val { font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.val.v-below, .val.v-gone { font-weight: 400; color: var(--label); }
.dumb .dot.st-below, .key.st-below.dot { width: 16px; height: 16px; box-shadow: none; }
.dumb .dot.st-ongoing, .key.st-ongoing.dot { width: 11px; height: 11px; box-shadow: none; }
.plot .val { position: absolute; top: 50%; line-height: 16px; margin-top: -8px; }
.plot .val.after { margin-left: 7px; }
.plot .val.left { margin-right: 11px; }
.plot .val.right { margin-left: 11px; }
.val.words { font-weight: 400; font-style: italic; color: var(--muted); white-space: normal; }

/* Forest plot: label, plot, value; one axis under all groups */
.fr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.fr-row .plot { grid-column: 1 / -1; grid-row: 2; margin: 0 14px; }
.fr-axis .plot, .fr-axis .axis-title { grid-column: 1 / -1; }
.fr-lab { color: var(--label); }
.fr-val { font-weight: 400; }
.fr-group { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.forest > .fr-group:first-child { border-top: 0; padding-top: 0; }
.fr-rows { grid-column: 1 / -1; display: grid; row-gap: 4px; }
.fr-group > .fig-source:not(:empty) + .fr-verdict { margin-bottom: 4px; }
.fr-axis { padding: 2px 0 0; }
.fr-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.vm { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--primary); }
.vm-survived { background: var(--primary); }
.vm-part { background: linear-gradient(90deg, var(--primary) 50%, transparent 50%); }
.vm-insufficient { border-color: var(--below); background: var(--surface); }

/* Existing care: what is covered, what is not; then one row per trial, each on its own */
.coverage { display: grid; gap: 8px; }
.need { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 8px; border: 2px solid var(--line-strong); color: var(--ink); }
.need > span { position: relative; }
.need.covered::before { content: ''; position: absolute; inset: 0; background: var(--line); transform-origin: left; }
.need-name { font-weight: 700; }
.need-by { color: var(--label); }
.need.uncovered { border: 2px dashed var(--ink); background: var(--surface); }
.trials { display: grid; gap: 12px; }
.trial { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 8px; min-width: 0; }
.trial-name { margin: 0 0 6px !important; }
.pair-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 46px; column-gap: 10px; align-items: center; }
.pair-row > .plot.axis { grid-column: 2; }
.pair-val { text-align: right; }

/* Two lines over the landmarks, per database */
.line-plot { position: relative; height: 264px; margin: 14px 0 28px 40px; }
.hgrid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.hgrid.base { background: var(--line-strong); }
.ytick { position: absolute; left: -40px; width: 34px; text-align: right; line-height: 16px; transform: translateY(50%); color: var(--muted); }
.xtick { position: absolute; top: calc(100% + 6px); transform: translateX(-50%); color: var(--muted); white-space: nowrap; }
.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ln { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ln-recent { stroke: var(--primary); }
.ln-gone { stroke: var(--below); }
.dot.pt { top: auto; width: 11px; height: 11px; transform: translate(-50%, 50%); }
.pt-val { position: absolute; transform: translate(-50%, -9px); line-height: 16px; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 3px var(--surface); }
.pt-val.up-left { transform: translate(-74%, -9px); }
.pt-val.under-right { transform: translate(-28%, calc(100% + 8px)); }
.line-plot .val.words { position: absolute; left: 0; bottom: 29%; width: 66px; line-height: 16px; }

/* Endpoints by database */
.ep-head { display: none; }
.ep-group + .ep-group { border-top: 2px solid var(--line-strong); margin-top: 8px; padding-top: 14px; }
.ep-group .fig-sub { margin: 0 0 4px !important; color: var(--primary); }
.ep-row { padding: 8px 0; border-top: 1px solid var(--line); }
.ep-group .fig-sub + .ep-row { border-top: 0; }
.ep-lab { color: var(--ink); }
.ep-kind { display: block; color: var(--muted); font-style: italic; }
.ep-cell { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 8px; align-items: center; min-height: 24px; }
.ep-src { color: var(--muted); }
.ep-cell .val { white-space: normal; }
.ep-cell .val.words { grid-column: 2 / -1; }
.ep-cell .plot { height: 16px; }
.ep-cell .plot .bar, .ep-cell .plot .track { top: 2px; bottom: 2px; }

@container (min-width: 660px) {
  .fig-panels { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
  .coverage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fr-row { grid-template-columns: 206px minmax(0, 1fr) 156px; }
  .fr-row .plot { grid-column: 2; grid-row: auto; margin: 0; }
  .fr-axis .plot, .fr-axis .axis-title { grid-column: 2; }
  .forest.with-verdicts .fr-group { grid-template-columns: 84px minmax(0, 1fr) 108px; align-items: center; }
  .forest.with-verdicts .fr-row { grid-template-columns: 66px minmax(0, 1fr) 156px; }
  .forest.with-verdicts .fr-rows { grid-column: 2; grid-row: 1; }
  .forest.with-verdicts .fr-verdict { grid-column: 3; margin-bottom: 0 !important; }
  .fr-rows { row-gap: 0; }
  .ep-head { display: grid; border-top: 0; padding: 0 0 8px; }
  .ep-row { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); column-gap: 22px; align-items: center; }
  .ep-src { display: none; }
  .ep-cell { display: block; }
  .ep-cell .val { display: block; margin-bottom: 2px; }
}

/* Draw-in, once on arrival and under one second; text never moves or fades */
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes appear { from { opacity: 0; } }
@keyframes move-x { from { left: var(--from); } }
@keyframes reveal { from { clip-path: inset(-10px 100% -10px 0); } to { clip-path: inset(-10px 0 -10px 0); } }
.fig .bar { animation: grow-x .55s ease-out backwards; }
.fig .plot .ci { animation: appear .25s ease-out .5s backwards; }
.fig .plot .dot { animation: appear .3s ease-out backwards; }
.fig .plot .dot.moves, .fig .plot.dumb .dot.st-ongoing { animation: move-x .5s ease-in-out .1s backwards; }
.fig .link { animation: appear .3s ease-out .5s backwards; }
.fig .fr-group:nth-child(2) .moves { animation-delay: .2s; }
.fig .fr-group:nth-child(3) .moves { animation-delay: .35s; }
.fig .fr-group:nth-child(3) .ci { animation-delay: .65s; }
.fig .need.covered::before { animation: grow-x .3s ease-out calc(var(--i) * .2s) backwards; }
.fig .lines { animation: reveal .8s ease-out; }
.fig .pt { animation: appear .3s ease-out .4s backwards; }
@media (prefers-reduced-motion: reduce) { .fig *, .fig *::before { animation: none !important; } }

/* Main result */
.verdict-table { table-layout: fixed; }
.verdict-table thead th:first-child { width: 25%; }
.verdict-table th[scope=row] a { color: var(--ink); }
.fig .verdict-table { font-size: 14px; }
.fig .verdict-table thead th { font-size: 14px; }
.verdict-table .vm { display: inline-block; vertical-align: -1px; margin-right: 5px; }
.verdict-table .sep { display: none; }
.verdict-table .verdict-fig { display: block; color: var(--label); margin-top: 3px; font-variant-numeric: tabular-nums; }
.verdict-table .full-row > * { background: var(--surface-2); }
.fig-result .table-wrap { margin: 0; }
.limits { margin: 16px 0; max-width: 900px; }
.surface .decision-card { margin: 0 0 4px; padding: 18px 22px; }
.surface .decision-card .overline { font: 700 11px/1.3 Arial, Helvetica, sans-serif; }
.surface .decision-card .decision-text { font-size: 21px; margin-bottom: 8px; }
.cost { margin: 0 0 18px; border-left: 4px solid var(--primary); background: var(--primary-tint); border-radius: 0 10px 10px 0; padding: 12px 16px; }
.cost-line { margin: 0; font-weight: 700; }

/* Layers: "where and how fast" and "beyond public data" open as side panels over the page */
.layer-btns { display: grid; gap: 10px; margin: 20px 0 0; }
.layer-btn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; width: 100%; text-align: left; font: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px 48px 14px 18px; position: relative; color: inherit; }
.layer-btn:hover { background: var(--primary-tint); border-color: var(--primary); }
.layer-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.layer-title { font-weight: 700; font-size: 15px; color: var(--primary); }
.layer-hint { font-size: 13px; color: var(--muted); }
.layer-arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--primary); }

dialog.panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(860px, 68vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  padding: 0; border: 0; border-left: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: -18px 0 48px rgba(14, 42, 48, .18); }
dialog.panel[open] { display: flex; flex-direction: column; animation: panel-in .2s ease-out; }
dialog.panel::backdrop { background: rgba(14, 42, 48, .38); }
@keyframes panel-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
body:has(dialog.panel[open]) { overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; gap: 16px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex: none; }
.panel-head h2 { margin: 0; font: 400 22px/1.3 Georgia, serif; color: var(--ink); flex: 1; }
.panel-x { flex: none; width: 36px; height: 36px; border: 1px solid var(--primary-line); border-radius: 8px; background: #fff; color: var(--primary); font-size: 22px; line-height: 1; cursor: pointer; }
.panel-x:hover { background: var(--primary-tint); }
.panel-body { flex: 1; overflow: auto; padding: 18px 22px 24px; overscroll-behavior: contain; }
.panel-body > .population:first-child { margin-top: 0; }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: #fff; flex: none; }
.panel-foot .action { cursor: pointer; font-family: inherit; }
.panel-switch { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.panel-body > .decision-effect { margin: 0; }
.decision-effect .decision-text { font-size: 17px; line-height: 1.55; margin-top: 12px; }
.beyond-list { margin: 14px 0 0; padding-left: 20px; }
.beyond-list li { margin: 0 0 10px; line-height: 1.5; }
.beyond-next { margin: 14px 0 0; padding: 12px 14px; background: var(--primary-tint); border-radius: 8px; font-size: 14px; }
.decision-effect { margin: 24px 0; padding: 18px 20px; background: var(--primary-tint); border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; }
.decision-effect p { margin: 8px 0 0; }
.decision-q { font-size: 13px; color: var(--muted); line-height: 1.4; }
.decision-effect .decision-q { margin-top: 0; }
.recorded { font-size: 12px; color: var(--muted); }
.record-decision { margin: 0 0 18px; }
.next-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.sources { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* Details disclosures */
.details { margin: 16px 0; border-top: 1px solid var(--line); padding-top: 10px; }
.details summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: 13px; padding: 4px 0; }
.details-body { font-size: 13px; color: var(--muted); }
.details-body ul { padding-left: 18px; }
.details-body table { font-size: 13px; }
.source-details { margin: 22px 0; }
.source-details .details { margin: 4px 0; }

/* Evidence record */
.record-item { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 12px 0; }
.record-item h3 { font: 500 18px/1.3 Georgia, serif; margin: 0 0 10px; }
.record-item dl { margin: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.record-item dt { font-weight: 700; color: var(--label); }
.record-item dd { margin: 0; }
.record-item dd ul { margin: 0; padding-left: 18px; }
.record-item .src { color: var(--muted); font-size: 12px; }
.record-item .text-link { display: inline-block; margin-top: 10px; }
.open-list { list-style: none; padding: 0; margin: 0; }
.open-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.frn { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); background: var(--amber-bg); border-radius: 10px; padding: 2px 8px; margin-right: 4px; }

/* Clinical background */
.background-view { max-width: 980px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 56px; }
.background-view h1 { font: 500 clamp(28px, 3.4vw, 42px)/1.15 Georgia, serif; letter-spacing: -.02em; margin: 0 0 10px; }
.background-view h2 { font: 500 23px/1.25 Georgia, serif; margin: 32px 0 10px; }
.bg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 26px; }
.bg-bottom { margin-top: 32px; }
.bg-table td, .bg-table th { font-size: 13px; }
.hypothesis { margin: 16px 0; padding: 16px 20px; background: var(--primary-tint); border-left: 4px solid var(--primary); font: 400 19px/1.45 Georgia, serif; }

.site-footer { padding: 14px clamp(16px, 4vw, 60px); font-size: 12px; color: #b7c4c9; background: var(--primary-deep); border-top: 1px solid #ffffff14; }
.site-footer p { margin: 0; max-width: 1000px; }
.noscript { padding: 24px; }

@media (max-width: 900px) {
  .strip dl { grid-template-columns: 92px minmax(0, 1fr); gap: 0; }
  .strip .f { display: contents; }
  .strip dt, .strip dd { padding: 6px 0; border-top: 1px solid var(--primary-line); margin: 0; }
  .strip .f-data dt, .strip .f-data dd { border-top: 0; }
  .strip dt { padding-right: 10px; }
  .topbar { flex-wrap: wrap; gap: 8px 20px; }
  .topbar-decision { margin-left: 0; max-width: none; }
  .start-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; padding-top: 16px; }
  .rail { position: static; padding: 10px; }
  .rail-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .rail-title { margin: 10px 2px 6px; }
  .rail-link { display: inline-flex; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 16px; font-size: 12px; }
  .rail-mark:empty { display: none; }
  .rail-link .count { display: inline; margin-left: 4px; }
  .rail-end { margin-top: 8px; padding-top: 8px; }
  .rail-count { margin: 0 2px; }
}
/* Text-heavy tables stack into labelled cards on narrow screens */
@media (max-width: 600px) {
  table.map-table { table-layout: auto; }
  table.map-table thead th:first-child { width: auto; }
  table.map-table th[scope=row] { font: 500 17px/1.3 Georgia, serif; padding: 10px 12px 4px; }
  table.map-table td { display: grid !important; grid-template-columns: 82px minmax(0, 1fr); align-items: baseline; padding: 0 12px !important; }
  table.map-table.stack td::before { padding: 8px 0; text-transform: none; letter-spacing: .02em; font-size: 11px; }
      .map-cell { padding: 8px 0; min-height: 0; }
  table.stack { min-width: 0; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack th, table.stack td { display: block; border: 0; padding: 4px 12px; text-align: left; white-space: normal; }
  .verdict-table thead th:first-child { width: auto; }
  table.verdict-table.stack td[data-label] { position: relative; padding: 5px 10px 5px 92px; }
  table.verdict-table.stack td[data-label]::before { position: absolute; left: 12px; letter-spacing: 0; text-transform: none; font-weight: 400; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
}
@media (max-width: 540px) {
  table.src-table tbody th { min-width: 112px; max-width: 132px; }
  .strip .times b { font-size: 18px; }
  .strip .times { flex-direction: column; gap: 2px; }
  .strip .t { flex-direction: row; align-items: baseline; gap: 8px; }
  .strip .t-src { min-width: 62px; }
  body { font-size: 14px; }
  .topbar { padding: 10px 16px; }
  .brand small { display: none; }
  .topbar-decision { font-size: 12px; }
  .surface { padding: 18px 14px; border-radius: 10px; }
  .answer-lead { font-size: 21px; }
  .answer-points { font-size: 15px; }
  .fig { --lab: 13px; padding: 14px 12px; }
  .fig .verdict-table, .fig .verdict-table thead th, .fig .verdict-table.stack td::before { font-size: 13px; }
  .layer-btn { padding: 12px 40px 12px 14px; }
  dialog.panel { width: 100vw; border-left: 0; }
  .panel-head { padding: 14px 14px 12px; }
  .panel-head h2 { font-size: 19px; }
  .panel-body { padding: 14px 12px 20px; }
  .panel-foot { padding: 10px 12px; }
  .panel-foot .action, .panel-switch { flex: 1 1 100%; text-align: center; }
  .workspace { padding-left: 10px; padding-right: 10px; }
  .record-item dl { grid-template-columns: 1fr; gap: 2px; }
  .record-item dd { margin-bottom: 8px; }
  .primary-btn { width: 100%; justify-content: center; }
  .hero-view h1 { font-size: 44px; }
  .closing-view h1 { font-size: 34px; }
  th, td { padding: 8px 9px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } dialog.panel[open] { animation: none; } }
