/* RadJev · Light Box
   The report is a lit sheet on a viewing box. RadJev's explanations live in
   the room beside it. Looks (looks.css) supply the room, the sheet, the
   backlight and the clip metal; this file supplies one shared layout. */

/* ---------- Base tokens (Light Box defaults; looks.css overrides) ---------- */
:root {
  --f-display: "Parkinsans", "Atkinson Hyperlegible Next", ui-rounded, system-ui, sans-serif;
  --f-text: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Malgun Gothic", sans-serif;
  --f-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --room: #0b1117;
  --room-deep: #070b0f;
  --room-raise: #121b23;
  --room-ink: #eef4f3;
  --room-muted: #a2b4bb;
  --room-rule: #24333d;
  --sheet-hi: #f8fcfd;
  --sheet-lo: #e4eff2;
  --sheet-ink: #0e1c23;
  --sheet-muted: #4b5d63;
  --sheet-dim: #5d6d72;
  --sheet-rule: #c9d6d5;
  --glow: #74e0cf;
  --glow-ink: #0b3a33;
  --bloom: rgb(160 235 225 / .2);
  --accent: #8ae8d9;
  --accent-ink: #062621;
  --focus: #f6c26b;
  --clip-hi: #f4f7f8;
  --clip-mid: #9aa6ad;
  --clip-lo: #59646b;
  --clip-hole: #0b1117;
  --edge: var(--glow);
  --line: var(--glow);
  --find: #a9b8ff;
  --find-line: #a9b8ff;
  --sheet-shadow: rgb(0 0 0 / .7);
  --room-pattern: none;
  --phone-edge: var(--glow-ink);
  --phone-accent: var(--glow-ink);
  --phone-accent-ink: #ffffff;

  --radius-card: 18px;
  --radius-sheet: 6px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 60px;
  --tabs-h: 64px;
}

/* ---------- Reset and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--room);
  color: var(--room-ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--room-rule) var(--room);
  accent-color: var(--glow);
  caret-color: var(--glow);
}
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 1rem/1.55 var(--f-text);
  background:
    var(--room-pattern),
    radial-gradient(90rem 50rem at 70% -10%, color-mix(in oklab, var(--glow) 7%, transparent), transparent 70%),
    var(--room);
  background-attachment: fixed;
  color: var(--room-ink);
  font-synthesis-weight: none;
}
::selection { background: color-mix(in oklab, var(--glow) 55%, transparent); color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: from-font; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.glyph { width: 1.15em; height: 1.15em; flex: none; }

/* Context tokens: components read --c-*; rooms and sheets set them. */
.room, .app-header, .phone-tabs, .entry-intro, .auth-intro, .recent-rail, .page-column, .settings-dialog {
  --c-ink: var(--room-ink); --c-muted: var(--room-muted); --c-rule: var(--room-rule); --c-raise: var(--room-raise); --c-ground: var(--room);
}
.sheet {
  --c-ink: var(--sheet-ink); --c-muted: var(--sheet-muted); --c-rule: var(--sheet-rule); --c-raise: color-mix(in oklab, var(--sheet-lo) 45%, var(--sheet-hi)); --c-ground: var(--sheet-hi);
  color-scheme: light;
}

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: .6rem 1rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: .75rem; }

/* ---------- Header: the room's top edge ---------- */
.app-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  border-bottom: 1px solid color-mix(in oklab, var(--room-rule) 70%, transparent);
  background: color-mix(in oklab, var(--room-deep) 70%, var(--room));
}
.app-logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.facet-mark { width: 28px; height: 28px; }
.wordmark { font: 700 1.28rem/1 var(--f-display); letter-spacing: -.02em; color: var(--room-ink); }
.logo-hc { display: none; }
.settings-trigger {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--room-rule); border-radius: 50%; background: transparent; color: var(--room-muted); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.settings-trigger:hover { color: var(--room-ink); border-color: color-mix(in oklab, var(--glow) 50%, var(--room-rule)); background: var(--room-raise); }
.settings-trigger svg { width: 21px; height: 21px; }

main { display: block; }

.back-link {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px;
  color: var(--c-muted, var(--room-muted)); font-size: .9rem; font-weight: 600; text-decoration: none;
}
.back-link:hover { color: var(--c-ink, var(--room-ink)); }

/* ---------- The viewer ---------- */
.viewer {
  max-width: 98rem; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(20rem, .8fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "heading sheet" "room sheet";
  column-gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.25rem, 2.5vw, 2.25rem) clamp(1.25rem, 3vw, 3rem) 5rem;
}
.report-heading { grid-area: heading; padding-bottom: 1.75rem; --c-ink: var(--room-ink); --c-muted: var(--room-muted); }
.report-heading .back-link { margin: -.4rem 0 .75rem -.1rem; }
.report-heading h1 {
  font: 650 clamp(2.15rem, 3.3vw, 3.35rem)/1.02 var(--f-display);
  letter-spacing: -.028em;
  color: var(--room-ink);
}
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin-top: .7rem; font: 500 .82rem/1.4 var(--f-mono); color: var(--room-muted); letter-spacing: .01em; }
.report-state-chip { display: inline-flex; align-items: center; gap: .4rem; }
.report-state-chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--room-muted); }
.report-state-chip.state-done::before { background: var(--room-ink); }
.report-state-chip.state-pending::before { background: transparent; border: 1.5px dashed var(--room-muted); }
.report-demo-watch { margin-top: 1rem; }
.report-demo-watch a, .demo-entry a, .demo-film-link, .demo-relay-entry a {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  color: var(--c-ink); font-weight: 600; font-size: .92rem; text-decoration: none;
}
.report-demo-watch a .glyph, .demo-entry a .glyph, .demo-film-link .glyph, .demo-relay-entry a .glyph { color: var(--edge); }
.report-demo-watch a:hover span, .demo-entry a:hover span, .demo-film-link:hover span, .demo-relay-entry a:hover span { text-decoration: underline; }

.room {
  grid-area: room; align-self: start;
  position: sticky; top: 1.25rem;
  max-height: calc(100dvh - 2.5rem); overflow: auto; overscroll-behavior: contain;
  padding: .25rem .9rem 2rem .25rem; margin-left: -.25rem;
  scrollbar-width: thin;
}
.room-heading { font: 650 1.2rem/1.25 var(--f-display); color: var(--c-ink); letter-spacing: -.01em; margin-bottom: .9rem; }
.room-subhead { margin: -.55rem 0 .9rem; color: var(--c-muted); font-size: .88rem; }
.patient-outcomes { display: grid; gap: 2.4rem; }

/* Next-step cards: lit edge when linked to the sheet. */
.action-plan-list { display: grid; gap: .9rem; counter-reset: next; }
.next-card {
  position: relative;
  padding: 1.35rem 1.45rem 1.2rem;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, color-mix(in oklab, var(--c-raise) 100%, transparent), color-mix(in oklab, var(--c-raise) 70%, transparent));
  transition: border-color .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.next-card.is-linked {
  border-color: color-mix(in oklab, var(--edge) 75%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--edge) 30%, transparent), 0 22px 48px -30px color-mix(in oklab, var(--edge) 70%, transparent);
}
.next-card.is-linked::after { /* connector port */
  content: ""; position: absolute; right: -5px; top: var(--port-y, 2.6rem);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); box-shadow: 0 0 10px 2px color-mix(in oklab, var(--line) 70%, transparent);
}
.next-number {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-bottom: .8rem;
  border-radius: 50%; border: 1.5px solid color-mix(in oklab, var(--edge) 70%, transparent);
  font: 700 .9rem/1 var(--f-mono); color: var(--edge);
}
.next-step-statement {
  font: 650 clamp(1.85rem, 2.75vw, 2.85rem)/1.06 var(--f-display);
  letter-spacing: -.026em; color: var(--c-ink); text-wrap: balance;
}
.action-plan-list:not(.action-plan-single) .next-step-statement { font-size: clamp(1.35rem, 1.75vw, 1.8rem); line-height: 1.12; }
.action-negative + .action-negative, .action-plan-list + .action-negative, .next-card-solo + .action-negative { margin-top: .9rem; }
.state-mark {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: .85rem;
  font: 500 .8rem/1.3 var(--f-mono); color: var(--c-muted); letter-spacing: .01em;
}
.state-mark svg { width: 15px; height: 15px; color: var(--glow); filter: drop-shadow(0 0 4px color-mix(in oklab, var(--glow) 60%, transparent)); }
.sheet .state-mark svg, .look-light .state-mark svg { color: var(--glow-ink); filter: none; }
.next-card { display: flow-root; }
@media (min-width: 1000px) {
  .next-card .state-mark { position: absolute; top: 1.25rem; right: 1.35rem; margin: 0; }
  .next-card { padding-top: 3.1rem; }
  .next-card .next-number { position: absolute; top: 1.05rem; left: 1.45rem; margin: 0; }
}
.mark-reading svg circle { animation: reading 1.4s var(--ease-out) infinite; }
.mark-reading svg circle:nth-child(2) { animation-delay: .18s; }
.mark-reading svg circle:nth-child(3) { animation-delay: .36s; }
@keyframes reading { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
.action-condition { margin-top: .7rem; padding: .7rem .85rem; border-radius: 10px; background: color-mix(in oklab, var(--glow) 9%, transparent); color: var(--c-ink); font-size: .95rem; line-height: 1.45; }
.next-step-detail { margin-top: 1rem; color: var(--c-muted); font-size: .95rem; line-height: 1.5; max-width: 46ch; }
.next-card .next-step-detail { margin-top: .8rem; }

.next-evidence { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1.05rem; }
.evidence-jump {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 44px;
  padding: .5rem 1.05rem .5rem .85rem;
  border: 1px solid color-mix(in oklab, var(--edge) 60%, transparent);
  border-radius: 999px;
  color: var(--c-ink); font-weight: 650; font-size: .92rem; text-decoration: none;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.evidence-jump .glyph-evidence { color: var(--edge); }
.evidence-jump:hover { background: color-mix(in oklab, var(--glow) 16%, transparent); border-color: var(--edge); }
.evidence-jump:active { background: color-mix(in oklab, var(--glow) 22%, transparent); }
.evidence-where { font: 500 .78rem/1.3 var(--f-mono); color: var(--c-muted); }

.care-launch { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1.25rem; color: var(--c-muted); font-size: .88rem; }
.care-primary, .primary-action {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px;
  padding: .7rem 1.35rem; border: 0; border-radius: 999px;
  background: var(--room-ink); color: var(--room);
  font: 700 .98rem/1.1 var(--f-text); text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 24px -16px color-mix(in oklab, var(--room-ink) 70%, transparent);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.care-primary:hover, .primary-action:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -16px color-mix(in oklab, var(--room-ink) 80%, transparent); }
.care-primary:active, .primary-action:active { transform: translateY(0); }
.care-primary svg { width: 1em; height: 1em; }

.analysis-retry { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.1rem; }
.analysis-retry button { min-height: 44px; padding: .55rem 1.2rem; border-radius: 999px; border: 1px solid var(--c-ink); background: transparent; color: var(--c-ink); font-weight: 650; cursor: pointer; }
.analysis-retry button:disabled { opacity: .55; cursor: progress; }
.retry-ack { color: var(--c-muted); font-size: .9rem; }
.retry-details { margin-top: .75rem; color: var(--c-muted); font-size: .9rem; }
.retry-details summary { cursor: pointer; min-height: 32px; }
.analysis-progress { margin-top: .9rem; color: var(--c-muted); font-size: .92rem; }
/* The card's "Still reading" mark already says this; keep it for screen readers. */
.patient-next:has(.mark-reading) .analysis-progress { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* Key results and changes: quieter, no cards. */
.key-result-list, .change-list { display: grid; gap: .75rem; }
.key-result, .change-list article {
  padding: 1.15rem 1.35rem 1.1rem; border: 1px solid var(--c-rule); border-radius: var(--radius-card);
  background: color-mix(in oklab, var(--c-raise) 45%, transparent);
  transition: border-color .45s var(--ease-out);
}
.key-result.is-linked, .change-list article.is-linked { border-color: color-mix(in oklab, var(--edge) 60%, transparent); }
.key-result h3, .change-list h3 { font: 650 clamp(1.15rem, 1.1vw, 1.3rem)/1.3 var(--f-text); color: var(--c-ink); }
.key-result-explanation, .change-wording { margin-top: .4rem; color: var(--c-muted); font-size: clamp(1rem, .9vw, 1.1rem); line-height: 1.5; }
/* The paragraph reader's findings: the report's own words, then small labels (side, size, change, category). */
.key-result-quote { margin: 0; color: var(--c-ink); font: 500 clamp(1rem, .95vw, 1.1rem)/1.5 var(--f-text); }
.para-labels { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.para-labels li { padding: .12rem .55rem; border: 1px solid var(--c-rule); border-radius: 999px; background: var(--c-raise); color: var(--c-muted); font-size: .85rem; line-height: 1.5; }
.change-wording { font-style: italic; }
.key-result-help { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: .75rem; }
.key-result-help .evidence-jump, .change-list .evidence-jump { min-height: 40px; padding-block: .4rem; font-size: .88rem; }
.change-list .evidence-jump { margin-top: .6rem; }
.term-help { color: var(--c-muted); font-size: .9rem; }
.term-help summary { cursor: pointer; list-style: none; text-decoration: underline dotted; text-underline-offset: .3em; min-height: 40px; display: inline-flex; align-items: center; }
.term-help summary::-webkit-details-marker { display: none; }
.term-help[open] p { margin-top: .3rem; color: var(--c-ink); max-width: 42ch; }
.duplicate-change-heading { display: none; }
.key-result.is-linked h3, .change-list article.is-linked h3 { color: var(--c-ink); text-decoration: underline 2px color-mix(in oklab, var(--glow) 80%, transparent); text-underline-offset: .3em; }

/* Walkthrough */
.guided-review { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--c-rule); }
.guide-launch { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0; border: 0; background: none; color: var(--c-ink); font-weight: 650; cursor: pointer; }
.guide-launch .glyph { color: var(--edge); }
.guide-launch:hover .guide-launch-action { text-decoration: underline; }
.guide-active { padding: 1rem 1.1rem; border-radius: 14px; background: var(--c-raise); border: 1px solid color-mix(in oklab, var(--glow) 45%, var(--c-rule)); }
.guide-progress { font: 600 .82rem/1.3 var(--f-mono); color: var(--edge); }
.sheet .guide-progress, .look-light .guide-progress { color: var(--glow-ink); }
.guide-text { margin-top: .45rem; color: var(--c-ink); }
.guide-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.guide-actions button { min-height: 42px; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--c-rule); background: transparent; color: var(--c-ink); font-weight: 600; cursor: pointer; }
.guide-actions button:hover:not(:disabled) { border-color: var(--glow); }
.guide-actions button:disabled { opacity: .45; cursor: default; }
.is-guide-current { outline: 2px solid color-mix(in oklab, var(--glow) 75%, transparent); outline-offset: 6px; border-radius: var(--radius-card); }

.room-notice { margin-top: 1.75rem; color: var(--c-muted); font-size: .82rem; line-height: 1.5; max-width: 44ch; }
.audit-route-link { margin-top: 1rem; font-size: .85rem; }

/* ---------- The lit sheet ---------- */
.sheet-stage { grid-area: sheet; padding-top: 1.1rem; min-width: 0; }
.sheet {
  position: relative; isolation: isolate;
  color: var(--sheet-ink);
  background:
    radial-gradient(140% 90% at 50% 30%, var(--sheet-hi) 0%, var(--sheet-hi) 45%, color-mix(in oklab, var(--sheet-lo) 60%, var(--sheet-hi)) 80%, var(--sheet-lo) 100%);
  border-radius: var(--radius-sheet);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, #fff 55%, transparent),
    0 50px 100px -40px var(--sheet-shadow),
    0 0 140px 6px var(--bloom);
  animation: warm-up 1.1s var(--ease-out) both;
}
.sheet::before { /* opal grain, very faint */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  opacity: .06; mix-blend-mode: multiply;
  background-image: url("/static/opal-grain.svg");
}
@keyframes warm-up { from { filter: brightness(.82) saturate(.9); } to { filter: none; } }

.sheet-clips { position: absolute; top: -17px; left: 22%; right: 22%; display: flex; justify-content: space-between; pointer-events: none; z-index: 2; }
.sheet-clip { width: 50px; height: auto; filter: drop-shadow(0 3px 2px rgb(0 0 0 / .35)) drop-shadow(0 1px 0 rgb(0 0 0 / .25)); }

.source-first-reader.sheet { padding: clamp(3rem, 5vw, 4.75rem) clamp(1.5rem, 5.5vw, 5.5rem) clamp(3rem, 5vw, 4.5rem); }
.source-first-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; padding-bottom: 1.35rem; margin-bottom: .4rem; border-bottom: 1px solid var(--sheet-rule); }
.sheet-title h2 { font: 650 1.3rem/1.2 var(--f-display); letter-spacing: -.01em; color: var(--sheet-ink); }
.sheet-title p { margin-top: .2rem; font: 500 .8rem/1.3 var(--f-mono); color: var(--sheet-muted); }
.reading-order-control a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 650; font-size: .88rem; color: var(--sheet-ink); }

.source-section-list { display: grid; }
.source-section { padding-top: 2.1rem; }
.source-section > header h3 {
  font: 700 .84rem/1.2 var(--f-text); text-transform: uppercase; letter-spacing: .16em;
  color: var(--sheet-muted); margin-bottom: .5rem;
}
.source-section > header { display: flex; align-items: center; gap: .75rem; }
.source-section .source-sentence,
.source-section { font-size: clamp(1.08rem, .55vw + .8rem, 1.42rem); line-height: 1.62; color: var(--sheet-ink); }
.source-section { max-width: 68ch; }
.source-sentence { transition: color .5s var(--ease-out); }
.source-sentence-text { transition: color .5s var(--ease-out); }
.report-subheading { font-weight: 700; margin-right: .3em; }
.impression-number { display: inline-block; min-width: 1.6em; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--sheet-muted); }
.report-paragraph-break { content: ""; display: block; margin-top: .35rem; }
.source-first-uncertain p { color: var(--sheet-muted); margin: 1.25rem 0; }
.source-first-uncertain pre { white-space: pre-wrap; font: 1rem/1.6 var(--f-mono); color: var(--sheet-ink); }

/* Backlit evidence. Rest: softly lit. Linked: lit. Active: fully lit and the
   rest of the sheet dims. Marks keep full ink so text contrast never drops. */
mark.evidence-rest {
  color: var(--sheet-ink);
  background: transparent;
  box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--glow) 70%, var(--sheet-ink) 30%);
  border-radius: 3px; padding: .05em .12em; margin: 0 -.12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
mark.evidence-rest.is-linked {
  background: color-mix(in oklab, var(--glow) 46%, var(--sheet-hi));
  box-shadow: 0 0 0 .14em color-mix(in oklab, var(--glow) 46%, var(--sheet-hi)), 0 0 1.1em .1em color-mix(in oklab, var(--glow) 45%, transparent);
}
mark.evidence-rest.evidence-active {
  background: color-mix(in oklab, var(--glow) 62%, var(--sheet-hi));
  box-shadow: 0 0 0 .2em color-mix(in oklab, var(--glow) 62%, var(--sheet-hi)), 0 0 1.8em .35em color-mix(in oklab, var(--glow) 60%, transparent);
}
.sheet:has(mark.evidence-active) .source-sentence-text { color: var(--sheet-dim); }
.sheet:has(mark.evidence-active) mark { color: var(--sheet-ink); }
.sheet:has(mark.evidence-active) .source-section > header h3 { color: color-mix(in oklab, var(--sheet-muted) 80%, var(--sheet-hi)); }
.source-sentence.is-evidence-focus { outline: none; }
.source-sentence.is-evidence-focus:focus-visible mark.evidence-active { outline: 3px solid var(--focus); outline-offset: 4px; }
.source-evidence-link { color: inherit; text-decoration: none; }
.back-to-result {
  display: inline-flex; align-items: center; gap: .4rem; margin: .2rem 0 .2rem .4rem; min-height: 36px; padding: .2rem .8rem;
  border-radius: 999px; background: var(--sheet-ink); color: var(--sheet-hi);
  font: 650 .82rem/1.2 var(--f-text); text-decoration: none; vertical-align: middle;
}
.back-to-result::before { content: ""; width: .5em; height: .5em; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); margin-top: .2em; }

/* The connector: a luminous line from the linked card to its lit sentences. */
.connector { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 4; overflow: visible; }
.connector path { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 3px color-mix(in oklab, var(--line) 80%, transparent)); }
.connector circle { fill: var(--line); filter: drop-shadow(0 0 4px var(--line)); }
.connector .is-drawing path { animation: draw .9s var(--ease-out) both; }
/* Findings get their own colour; next steps keep the look's glow. */
.connector.is-finding path { stroke: var(--find-line); filter: drop-shadow(0 0 3px color-mix(in oklab, var(--find-line) 80%, transparent)); }
.connector.is-finding circle { fill: var(--find-line); filter: drop-shadow(0 0 4px var(--find-line)); }
mark.evidence-rest.evidence-key-result.is-linked, mark.evidence-rest.evidence-key-result.evidence-active { background: color-mix(in oklab, var(--find) 42%, var(--sheet-hi)); box-shadow: 0 0 0 .16em color-mix(in oklab, var(--find) 42%, var(--sheet-hi)), 0 0 1.4em .2em color-mix(in oklab, var(--find) 50%, transparent); }
.key-result.is-linked::after, .change-list article.is-linked::after { content: ""; position: absolute; right: -5px; top: var(--port-y, 2rem); width: 9px; height: 9px; border-radius: 50%; background: var(--find-line); box-shadow: 0 0 10px 2px color-mix(in oklab, var(--find-line) 70%, transparent); }
.key-result, .change-list article { position: relative; }
@media (max-width: 999px) { .key-result.is-linked::after, .change-list article.is-linked::after { display: none; } }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

.phone-tabs, .phone-clips { display: none; }

/* ---------- Home, demos, auth, settings ---------- */
.report-entry-page, .page-column { max-width: 76rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 3rem) 5rem; }
.page-column { max-width: 52rem; }
.entry-intro { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.entry-intro h1, .page-column > h1, .auth-intro h1 {
  font: 650 clamp(2.4rem, 5vw, 4.4rem)/1 var(--f-display); letter-spacing: -.032em; color: var(--room-ink);
}
.entry-intro p, .auth-intro p { margin-top: 1rem; color: var(--room-muted); font-size: clamp(1.05rem, 1.3vw, 1.2rem); max-width: 44ch; }
.page-column > h1 { margin: .5rem 0 2rem; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.entry-sheet { padding: clamp(2.5rem, 4vw, 3.5rem) clamp(1.4rem, 3.5vw, 3rem) 2rem; }
.entry-sheet-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.entry-sheet-heading h2, .auth-form h2 { font: 650 1.55rem/1.15 var(--f-display); letter-spacing: -.015em; }
.entry-sheet-heading span { font: 500 .8rem var(--f-mono); color: var(--c-muted); }
.entry-label-row label, .auth-form label, .example-loader label, .language-form label { display: block; font-weight: 650; font-size: .95rem; margin-bottom: .4rem; color: var(--c-ink); }
.example-loader { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin: .5rem 0 .25rem; }
.example-loader label { margin: 0; font-weight: 500; color: var(--c-muted); }
select, input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), textarea {
  min-height: 46px; padding: .6rem .8rem; border-radius: 10px;
  border: 1px solid var(--c-rule); background: color-mix(in oklab, var(--c-ground) 85%, var(--c-ink) 4%); color: var(--c-ink);
  transition: border-color .2s, box-shadow .2s;
}
textarea { width: 100%; min-height: 12rem; resize: vertical; font: 1rem/1.55 var(--f-mono); }
.auth-form input { width: 100%; margin-bottom: 1rem; }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--glow-ink); box-shadow: 0 0 0 3px var(--focus); }
.sheet select:focus-visible, .sheet input:focus-visible, .sheet textarea:focus-visible { border-color: var(--sheet-ink); }
.field-description { color: var(--c-muted); font-size: .88rem; margin: .4rem 0 .6rem; }
.entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1rem; }
.entry-actions .field-description { margin: 0; }
.sheet .primary-action { background: var(--sheet-ink); color: var(--sheet-hi); box-shadow: 0 10px 22px -14px rgb(0 0 0 / .6); }
.service-status { margin-top: 1rem; font: 500 .8rem var(--f-mono); color: var(--c-muted); }
.form-error { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; border: 1px solid currentColor; font-weight: 600; }

.recent-rail { padding-top: .5rem; }
.report-list { display: grid; }
.report-list li { border-top: 1px solid var(--c-rule); }
.report-list li:first-child { border-top: 0; }
.report-list li > a:first-child, .report-list p { display: grid; gap: .2rem; padding: 1rem 0; text-decoration: none; }
.report-list strong { font: 650 1.08rem/1.25 var(--f-text); color: var(--c-ink); }
.report-list li > a:first-child:hover strong { text-decoration: underline; text-decoration-color: var(--glow); text-underline-offset: .25em; }
.report-list-meta, .report-list-actions { font: 500 .8rem/1.4 var(--f-mono); color: var(--c-muted); }
.demo-list { max-width: 40rem; }
.demo-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1.5rem; }
.demo-film-link { padding-bottom: .4rem; }
.empty-message { padding: 1rem 0; color: var(--c-muted); }
.empty-message strong { display: block; color: var(--c-ink); font-weight: 650; }
.demo-entry { margin-top: 1.25rem; }
.demo-relay-entry { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin-top: 1.25rem; }
.demo-relay-entry > span { color: var(--room-muted); font-size: .92rem; }

.auth-layout { max-width: 76rem; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 3vw, 3rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(20rem, .9fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.auth-form { padding: clamp(2.75rem, 4vw, 3.5rem) clamp(1.5rem, 3.5vw, 2.75rem) 2.25rem; }
.auth-form h2 { margin-bottom: 1.5rem; }
.auth-form .primary-action { width: 100%; margin-top: .5rem; }
.development-note { font: 500 .8rem var(--f-mono) !important; }

/* Settings dialog */
.settings-dialog {
  width: min(40rem, calc(100vw - 2rem)); max-height: min(46rem, calc(100dvh - 2rem));
  padding: 0; border: 1px solid var(--room-rule); border-radius: 22px;
  background: var(--room); color: var(--room-ink);
  box-shadow: 0 40px 100px -30px rgb(0 0 0 / .8);
}
.settings-dialog::backdrop { background: rgb(4 7 10 / .62); backdrop-filter: blur(3px); }
.settings-dialog[open] { animation: dialog-in .35s var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem .5rem 1.5rem; }
.settings-head h2 { font: 650 1.4rem/1.2 var(--f-display); }
.close-settings { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--room-muted); cursor: pointer; }
.close-settings:hover { background: var(--room-raise); color: var(--room-ink); }
.close-settings svg { width: 20px; height: 20px; }
.settings-dialog form, .settings-dialog .settings-footer, .settings-dialog .experimental-setting { padding: 0 1.5rem; }
.theme-form fieldset { margin: 0; padding: 0; border: 0; }
.theme-form legend { font: 600 .95rem var(--f-text); color: var(--room-muted); margin-bottom: .2rem; }
/* Appearance: one row naming the current look; the looks open beneath it. */
.theme-picker > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; cursor: pointer; list-style: none; border-radius: 10px; }
.theme-picker > summary::-webkit-details-marker { display: none; }
.theme-picker > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.theme-picker-label { font: 600 .95rem var(--f-text); color: var(--room-muted); }
.theme-picker-current { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; color: var(--room-ink); }
.theme-picker-current .look-swatch { width: 1.6rem; padding: 3px 3px 0; border-radius: 6px; }
.theme-picker-current .look-swatch-sheet { padding: 22% 12% 0; }
.theme-picker-chevron { width: 18px; height: 18px; color: var(--room-muted); transition: transform .2s var(--ease-out); }
.theme-picker[open] .theme-picker-chevron { transform: rotate(90deg); }
.theme-picker[open] > fieldset { margin-top: .25rem; }
@media (prefers-reduced-motion: reduce) { .theme-picker-chevron { transition: none; } }
.theme-group-label { margin: .9rem 0 .55rem; font: 500 .78rem var(--f-mono); color: var(--room-muted); letter-spacing: .02em; }
.theme-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.theme-option { position: relative; display: grid; gap: .45rem; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; inset: 0; }
.theme-option-copy strong { font-weight: 600; font-size: .8rem; color: var(--room-ink); }
.look-swatch {
  display: block; aspect-ratio: 1 / 1.05; border-radius: 12px; padding: 18% 16% 0;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--glow) 10%, var(--room)), var(--room));
  border: 1px solid var(--room-rule); overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease-out);
}
.look-swatch-sheet { display: block; height: 100%; border-radius: 3px 3px 0 0; padding: 26% 14% 0; background: linear-gradient(180deg, var(--sheet-hi), var(--sheet-lo)); box-shadow: 0 0 18px -2px var(--bloom); }
.look-swatch-glow { display: block; height: 14%; border-radius: 2px; background: color-mix(in oklab, var(--glow) 62%, var(--sheet-hi)); box-shadow: 0 0 10px 1px color-mix(in oklab, var(--glow) 55%, transparent); }
.theme-option:hover .look-swatch { transform: translateY(-2px); }
.theme-option input:checked + .look-swatch { border-color: var(--edge); box-shadow: 0 0 0 2px var(--edge); }
.theme-option input:focus-visible + .look-swatch { outline: 3px solid var(--focus); outline-offset: 3px; }
.theme-status { margin: .5rem 0 0; font-size: .85rem; color: var(--room-muted); }
.theme-status:empty { margin: 0; }
.language-form { margin-top: 1rem; }
.language-row { display: flex; gap: .6rem; align-items: center; }
.language-row select { flex: 1; --c-ground: var(--room-raise); --c-rule: var(--room-rule); --c-ink: var(--room-ink); }
.text-action { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem; border: 0; background: none; color: var(--c-ink, var(--room-ink)); font-weight: 650; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.experimental-setting { margin-top: 1.25rem; padding-top: 1rem !important; border-top: 1px solid var(--room-rule); }
.experimental-setting h3 { font: 650 1rem var(--f-text); }
.experimental-setting p { color: var(--room-muted); font-size: .88rem; margin: .3rem 0 .5rem; }
.settings-footer { margin: 1.25rem 0 1.5rem; padding-top: 1rem !important; border-top: 1px solid var(--room-rule); color: var(--room-muted); font-size: .88rem; display: grid; gap: .3rem; justify-items: start; }
.settings-page .theme-form, .settings-page .language-form, .settings-page .settings-footer { max-width: 40rem; }

/* ---------- Narrow: the whole screen becomes the viewing box ---------- */
@media (max-width: 999px) {
  .viewer { display: block; padding: 0 0 calc(var(--tabs-h) + env(safe-area-inset-bottom) + 1rem); }
  .report-heading { padding: .35rem 1.15rem 1.6rem; }
  .report-heading .back-link { margin: 0; min-height: 40px; }
  .report-heading h1 { font-size: clamp(1.55rem, 6.4vw, 2rem); }
  .report-meta { margin-top: .35rem; }
  .report-demo-watch { margin-top: .15rem; }
  .report-demo-watch a { min-height: 40px; }
  .room-heading { font-size: 1.05rem; }

  /* One continuous lit panel: room content first, then the report. */
  .room {
    position: relative; top: auto; max-height: none; overflow: visible; margin: 0;
    padding: 2.6rem 1.15rem 1.5rem;
    --c-ink: var(--sheet-ink); --c-muted: var(--sheet-muted); --c-rule: var(--sheet-rule); --c-raise: transparent; --c-ground: var(--sheet-hi);
    color: var(--sheet-ink);
    background: linear-gradient(180deg, color-mix(in oklab, var(--glow) 12%, var(--sheet-hi)) 0, var(--sheet-hi) 15rem, color-mix(in oklab, var(--sheet-lo) 30%, var(--sheet-hi)));
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -20px 60px -20px var(--bloom), inset 0 1px 0 #fff;
    color-scheme: light;
  }
  .sheet-stage { padding-top: 0; }
  .source-first-reader.sheet {
    border-radius: 0; animation: none;
    padding: 1.6rem 1.15rem 2.5rem;
    background: linear-gradient(180deg, color-mix(in oklab, var(--sheet-lo) 30%, var(--sheet-hi)), var(--sheet-hi) 30%, var(--sheet-lo));
    box-shadow: none;
  }
  .source-first-reader.sheet .sheet-clips { display: none; }
  .phone-clips { display: contents; }
  .next-card { padding: 0; border: 0; background: none; border-radius: 0; box-shadow: none !important; }
  .key-result, .change-list article { padding: 1.1rem 0; border: 0; border-top: 1px solid var(--c-rule); border-radius: 0; background: none; }
  .key-result-list > li:first-child .key-result, .change-list > li:first-child article { border-top: 0; padding-top: .1rem; }
  .next-card::after { display: none !important; }
  .action-plan-list { gap: 2rem; }
  .next-step-statement { font-size: clamp(2rem, 9.4vw, 2.75rem); line-height: 1.04; }
  .action-plan-list:not(.action-plan-single) .next-step-statement { font-size: clamp(1.55rem, 6.6vw, 2rem); }
  .action-plan-list:not(.action-plan-single) > li + li { padding-top: 2rem; border-top: 1px solid var(--sheet-rule); }
  .state-mark svg { color: var(--glow-ink); filter: none; }
  .next-evidence { flex-direction: column; align-items: stretch; gap: .45rem; }
  .next-evidence .evidence-jump { justify-content: center; min-height: 52px; font-size: 1rem; border-width: 1.5px; border-color: var(--phone-edge); }
  .next-evidence .evidence-jump .glyph-evidence { color: var(--phone-edge); }
  .room .evidence-jump .glyph-evidence, .room .guide-launch .glyph, .room .next-number { color: var(--phone-edge); }
  .room .next-number { border-color: var(--phone-edge); }
  .evidence-where { text-align: center; }
  .action-condition { background: color-mix(in oklab, var(--glow) 18%, transparent); }
  .care-primary { background: var(--phone-accent); color: var(--phone-accent-ink); box-shadow: 0 10px 22px -14px var(--phone-accent); }
  .room .guide-progress { color: var(--phone-edge); }
  .patient-outcomes { gap: 2.75rem; }
  .guide-progress { color: var(--glow-ink); }
  .room-notice { max-width: none; }
  .connector { display: none; }

  .phone-tabs {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(3, 1fr);
    padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--room-deep) 88%, transparent);
    backdrop-filter: blur(14px) saturate(1.2);
    border-top: 1px solid var(--room-rule);
  }
  .phone-tabs a {
    display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 54px;
    color: var(--room-muted); font: 600 .74rem/1 var(--f-text); text-decoration: none; border-radius: 12px;
  }
  .phone-tabs a .glyph { width: 22px; height: 22px; }
  .phone-tabs a[aria-current="true"] { color: var(--room-ink); }
  .phone-tabs a[aria-current="true"] .glyph { color: var(--tab-glow, var(--glow)); filter: drop-shadow(0 0 5px color-mix(in oklab, var(--tab-glow, var(--glow)) 70%, transparent)); }

  .dashboard-layout, .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .entry-sheet .sheet-clips, .auth-form .sheet-clips { left: 14%; right: 14%; }
  .theme-options { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .45rem; }
  .theme-option-copy strong { font-size: .7rem; }
}
@media (max-width: 999px) { html { scroll-padding-top: 1rem; scroll-padding-bottom: calc(var(--tabs-h) + 1rem); } }
@media (max-width: 560px) {
  .settings-dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .theme-options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .theme-option-copy strong { font-size: .74rem; line-height: 1.15; display: block; overflow-wrap: anywhere; }
  .demo-list li { display: block; }
  .demo-list .demo-films { align-items: flex-start; padding-bottom: .4rem; }
}

/* ---------- Motion and forced colours ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  mark.evidence-rest { forced-color-adjust: none; background: Mark; color: MarkText; box-shadow: none; outline: 1px solid MarkText; }
  mark.evidence-rest.evidence-active, mark.evidence-rest.is-linked { outline: 3px solid Highlight; }
  .next-card, .sheet { border: 1px solid CanvasText; }
  .connector { display: none; }
  .evidence-jump, .care-primary, .primary-action { border: 1px solid ButtonText; }
}

/* ---------- Film player ---------- */
.film-page { max-width: 78rem; }
.film-heading { margin: .5rem 0 1.75rem; max-width: 52rem; }
.film-heading h1 { font: 650 clamp(2.2rem, 4.5vw, 3.8rem)/1.02 var(--f-display); letter-spacing: -.03em; }
.film-heading p { margin-top: .8rem; color: var(--room-muted); font-size: clamp(1.02rem, 1.2vw, 1.15rem); max-width: 48ch; }
.film-player { margin: 0; }
.film-screen { position: relative; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 40px 90px -40px rgb(0 0 0 / .8), 0 0 0 1px var(--room-rule); }
.film-screen video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.film-player.is-phone .film-screen { max-width: 26rem; margin-inline: auto; }
.film-player.is-phone .film-screen video { aspect-ratio: 9 / 16; }
.film-big-play {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: color-mix(in oklab, var(--room-ink) 92%, transparent); color: var(--room);
  box-shadow: 0 20px 50px -20px #000; transition: transform .25s var(--ease-out), opacity .25s;
}
.film-big-play svg { width: 40px; height: 40px; margin-left: 5px; }
.film-big-play:hover { transform: scale(1.05); }
.film-player.is-playing .film-big-play { opacity: 0; pointer-events: none; }
.film-controls { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; flex-wrap: wrap; }
.film-control { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 48px; min-height: 48px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--room-rule); background: var(--room-raise); color: var(--room-ink); cursor: pointer; font: 650 .95rem/1 var(--f-text); }
.film-control:hover { border-color: color-mix(in oklab, var(--edge) 60%, var(--room-rule)); }
.film-control svg { width: 22px; height: 22px; }
.film-control .icon-pause, .film-player.is-playing .film-control .icon-play { display: none; }
.film-player.is-playing .film-control .icon-pause { display: block; }
.film-mute { padding: 0 1.1rem; }
.film-mute .icon-muted, .film-player.is-muted .film-mute .icon-sound { display: none; }
.film-player.is-muted .film-mute .icon-muted { display: block; }
.film-control[aria-pressed="true"]:not(.film-mute) { border-color: var(--edge); color: var(--edge); }
.film-seek { flex: 1; min-width: 8rem; accent-color: var(--edge); height: 48px; }
.film-time { font: 500 .85rem/1 var(--f-mono); color: var(--room-muted); font-variant-numeric: tabular-nums; min-width: 6.5rem; text-align: right; }
.film-note { margin-top: .75rem; color: var(--room-muted); font-size: .88rem; }
.film-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 2rem; }
.film-downloads { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.film-live { margin-top: 1rem; }
/* A walk-through's translations, each live, by its own name. */
.film-langs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.1rem; margin-top: 1.25rem; color: var(--room-muted); font-size: .92rem; }
.film-langs a { display: inline-flex; align-items: center; min-height: 40px; color: var(--room-ink); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent); text-underline-offset: 3px; }
.film-downloads a { display: inline-flex; align-items: center; min-height: 44px; color: var(--room-ink); font-weight: 600; }
@media (max-width: 700px) { .film-mute-label { display: none; } .film-time { min-width: 0; } }
/* The films index: poster cards on two shelves. */
.film-shelf { margin-top: 2.5rem; }
.film-shelf h2 { font: 650 1.35rem/1.2 var(--f-display); letter-spacing: -.01em; margin-bottom: 1rem; }
.film-shelf-section { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--room-rule); }
.film-shelf-section h2 { font: 650 1.35rem/1.2 var(--f-display); letter-spacing: -.01em; }
.film-shelf-section > p { margin-top: .4rem; color: var(--room-muted); max-width: 48ch; }
.film-shelf-section .film-shelf { margin-top: 1.5rem; }
.film-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.75rem 1.5rem; }
.film-card { display: flex; flex-direction: column; gap: .45rem; color: var(--room-ink); text-decoration: none; border-radius: 14px; }
.film-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #000; box-shadow: 0 0 0 1px var(--room-rule); transition: box-shadow .15s ease; }
.film-card:hover img, .film-card:focus-visible img { box-shadow: 0 0 0 2px var(--edge); }
.film-card:focus-visible { outline: 2px solid var(--edge); outline-offset: 4px; }
.film-card-title { margin-top: .35rem; font: 650 1.12rem/1.25 var(--f-display); }
.film-card-summary { color: var(--room-muted); font-size: .95rem; line-height: 1.45; }
.report-demo-watch { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
/* The report's walk-through: a quieter second link beside its film. */
.report-demo-watch .report-demo-original, .demo-original-link { display: inline-flex; align-items: center; min-height: 40px; color: var(--room-muted); font-size: .88rem; font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); text-underline-offset: 3px; }
.report-demo-watch .report-demo-original:hover, .demo-original-link:hover { color: var(--room-ink); }
.demo-films { display: flex; flex-direction: column; align-items: flex-end; }
.demo-films .demo-film-link { padding-bottom: 0; }
.film-card-item { display: flex; flex-direction: column; gap: .35rem; }
.film-card-live { align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; color: var(--room-ink); font-weight: 600; font-size: .95rem; text-decoration: none; }
.film-card-live .glyph { color: var(--edge); }
.film-card-live:hover span { text-decoration: underline; }
.film-card-live:focus-visible { outline: 2px solid var(--edge); outline-offset: 3px; border-radius: 6px; }
.film-fullscreen .icon-exit, .film-player.is-fullscreen .film-fullscreen .icon-enter { display: none; }
.film-player.is-fullscreen .film-fullscreen .icon-exit { display: block; }
.film-player.is-fullscreen { display: flex; flex-direction: column; justify-content: center; background: #000; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.film-player.is-fullscreen .film-screen { flex: 1; min-height: 0; max-width: none; border-radius: 0; box-shadow: none; display: flex; align-items: center; }
.film-player.is-fullscreen .film-screen video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.film-player.is-fullscreen .film-controls { margin: .6rem 1rem 1rem; }
.film-player.is-fullscreen .film-note { display: none; }

/* ---------- Walkthrough: a floating step bar ---------- */
.guide-launch-key { margin-left: .35rem; padding: .1rem .45rem; border-radius: 6px; border: 1px solid var(--c-rule); font: 600 .78rem/1.3 var(--f-mono); color: var(--c-muted); }
.guided-review:has(.guide-active:not([hidden])) {
  position: fixed; z-index: 30; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(44rem, calc(100vw - 2rem));
  margin: 0; padding: 0; border: 0;
  --c-ink: var(--room-ink); --c-muted: var(--room-muted); --c-rule: var(--room-rule); --c-raise: var(--room-raise);
}
.guided-review:has(.guide-active:not([hidden])) .guide-active {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .35rem 1rem;
  padding: 1rem 1.1rem 1rem 1.35rem; border-radius: 20px;
  background: color-mix(in oklab, var(--room-raise) 94%, transparent); backdrop-filter: blur(12px);
  border: 1px solid color-mix(in oklab, var(--edge) 45%, var(--room-rule));
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / .75);
  color: var(--room-ink);
}
.guide-progress { grid-column: 1; }
.guide-text { grid-column: 1; margin: 0; font-size: .98rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.guided-review .guide-actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; flex-wrap: nowrap; align-items: center; }
.guide-step { display: inline-flex; align-items: center; gap: .3rem; min-height: 48px; min-width: 48px; justify-content: center; }
.guide-step svg { width: 20px; height: 20px; }
.guide-step span { display: none; }
.guide-step-next { background: var(--room-ink) !important; color: var(--room) !important; border-color: var(--room-ink) !important; padding-inline: 1.1rem !important; }
.guide-step-next span { display: inline; }
.guide-exit { border: 0 !important; color: var(--room-muted) !important; padding-inline: .6rem !important; }
.guide-keys { grid-column: 1 / -1; margin: .15rem 0 0; font: 500 .74rem/1.3 var(--f-mono); color: var(--room-muted); }
@media (max-width: 999px) {
  .guided-review:has(.guide-active:not([hidden])) { bottom: calc(var(--tabs-h) + .75rem + env(safe-area-inset-bottom)); }
  .guide-keys, .guide-launch-key { display: none; }
  .guide-step-next span { display: none; }
}
/* The return link matters when the source card has scrolled away: on wide
   screens the card stays beside the sheet, so the link waits for keyboard focus. */
@media (min-width: 1000px) {
  .back-to-result:not(:focus-visible) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; margin: 0; }
}

@media (max-width: 999px) {
  .guided-review:has(.guide-active:not([hidden])) .guide-active { grid-template-columns: 1fr; padding: .85rem 1rem; }
  .guided-review .guide-actions { grid-column: 1; grid-row: auto; justify-content: space-between; }
  .guided-review .guide-actions .guide-step-next { flex: 1; }
  .guide-exit { order: -1; }
}

/* ---------- Care plan: a stage line above the lit sheet ---------- */
.care-page { max-width: 70rem; margin: 0 auto; padding: clamp(1.25rem, 2.5vw, 2.25rem) clamp(1.25rem, 3vw, 3rem) 4rem; --c-ink: var(--room-ink); --c-muted: var(--room-muted); --c-rule: var(--room-rule); --c-raise: var(--room-raise); }
.care-heading-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.care-heading h1 { font: 650 clamp(2.1rem, 3.6vw, 3.2rem)/1.02 var(--f-display); letter-spacing: -.028em; color: var(--room-ink); }
.care-play { display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: .55rem 1.2rem .55rem 1rem; border-radius: 999px; border: 1px solid color-mix(in oklab, var(--edge) 55%, var(--room-rule)); background: var(--room-raise); color: var(--room-ink); font-weight: 650; cursor: pointer; }
.care-play svg { width: 20px; height: 20px; color: var(--edge); }
.care-play .icon-pause, .care-page.is-playing .care-play .icon-play { display: none; }
.care-page.is-playing .care-play .icon-pause { display: block; }
.care-page.is-playing .care-play { border-color: var(--edge); box-shadow: 0 0 0 1px var(--edge); }
.care-top { margin: 1.75rem 0 2.1rem; }
.care-tracks { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.care-tracks button { min-height: 44px; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--room-rule); background: transparent; color: var(--room-muted); font-weight: 650; cursor: pointer; }
.care-tracks button[aria-pressed="true"] { background: var(--room-ink); color: var(--room); border-color: var(--room-ink); }
.care-stages { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .25rem; }
.care-stages::before, .care-stages::after { content: ""; position: absolute; top: calc(1.35rem - 1px); left: calc(100% / var(--care-count, 7) / 2); right: calc(100% / var(--care-count, 7) / 2); height: 2px; border-radius: 2px; background: var(--room-rule); }
.care-stages::after { background: var(--edge); box-shadow: 0 0 8px color-mix(in oklab, var(--edge) 60%, transparent); transform-origin: left; transform: scaleX(var(--care-progress, 0)); transition: transform .6s var(--ease-out); }
.care-stage button, .care-stage-static { position: relative; z-index: 1; display: grid; justify-items: center; align-content: start; gap: .45rem; width: 100%; min-height: 76px; padding: .4rem .3rem .5rem; border: 0; border-radius: 14px; background: none; color: var(--room-ink); text-align: center; font: inherit; }
.care-stage button { cursor: pointer; }
.care-stage button:hover { background: color-mix(in oklab, var(--room-raise) 80%, transparent); }
.care-stage.is-active button { background: var(--room-raise); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--edge) 45%, var(--room-rule)); }
.care-mark { width: 24px; height: 24px; color: var(--room-muted); background: var(--room); border-radius: 50%; margin-top: .25rem; }
.care-stage.is-done .care-mark { color: var(--edge); --c-ground: var(--room); }
.care-stage.is-current .care-mark { color: var(--edge); filter: drop-shadow(0 0 6px color-mix(in oklab, var(--edge) 70%, transparent)); }
.care-stage.is-waiting .care-mark, .care-stage.is-skipped .care-mark { color: var(--room-ink); }
.care-stage-text { display: grid; gap: .1rem; min-width: 0; }
.care-stage-name { font: 650 .92rem/1.2 var(--f-text); }
.care-stage-detail { font: 500 .72rem/1.3 var(--f-mono); color: var(--room-muted); overflow-wrap: anywhere; }
.care-stage.is-upcoming .care-stage-name, .care-stage.is-blocked .care-stage-name { color: var(--room-muted); }
.care-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; margin-top: 1.25rem; color: var(--room-muted); font-size: .88rem; }
.care-failure-tool summary { cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.care-failure-tool p { margin: .25rem 0; max-width: 40ch; }
.care-sheet { padding: clamp(2.75rem, 4.5vw, 4rem) clamp(1.5rem, 5vw, 4.5rem) clamp(2.5rem, 4vw, 3.5rem); min-height: 26rem; }
.care-step-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 1rem 2rem; }
.care-head-actions .care-actions { margin: .2rem 0 0; flex-direction: row-reverse; flex-wrap: nowrap; }
.care-footer:empty { display: none; }
.care-touch { position: fixed; z-index: 60; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; pointer-events: none; background: color-mix(in oklab, var(--glow) 35%, transparent); box-shadow: 0 0 0 2px var(--glow), 0 0 24px 4px color-mix(in oklab, var(--glow) 60%, transparent); animation: care-touch .65s var(--ease-out) forwards; }
@keyframes care-touch { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.care-step-title { font: 650 clamp(1.8rem, 2.6vw, 2.6rem)/1.08 var(--f-display); letter-spacing: -.025em; color: var(--sheet-ink); max-width: 22ch; outline: none; }
.care-lede { margin-top: .8rem; color: var(--sheet-muted); font-size: 1.08rem; line-height: 1.55; max-width: 52ch; }
.care-loading { color: var(--sheet-muted); }
.care-handoff { margin: 1.6rem 0 0; display: grid; gap: .1rem; border-radius: 14px; background: color-mix(in oklab, var(--sheet-lo) 55%, var(--sheet-hi)); padding: .4rem 1.2rem; max-width: 40rem; }
.care-handoff div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--sheet-rule); }
.care-handoff div:first-child { border-top: 0; }
.care-handoff dt { font: 700 .76rem/1.6 var(--f-text); text-transform: uppercase; letter-spacing: .14em; color: var(--sheet-muted); }
.care-handoff dd { margin: 0; color: var(--sheet-ink); font-weight: 600; }
.care-handoff ul { display: grid; gap: .3rem; }
.care-handoff li { font-weight: 500; }
.care-message { white-space: pre-line; }
.care-message, .care-quote blockquote { margin: 1.4rem 0 0; padding: 1rem 1.2rem; border-radius: 12px; background: color-mix(in oklab, var(--glow) 18%, var(--sheet-hi)); color: var(--sheet-ink); font-size: 1.05rem; line-height: 1.55; max-width: 40rem; }
.care-quote { margin: 1.6rem 0 0; }
.care-quote figcaption { font: 700 .76rem/1.4 var(--f-text); text-transform: uppercase; letter-spacing: .14em; color: var(--sheet-muted); }
.care-quote blockquote { margin-top: .55rem; box-shadow: 0 0 0 .14em color-mix(in oklab, var(--glow) 30%, transparent); }
.care-appointment { margin-top: 1.4rem; display: grid; gap: .2rem; font: 650 clamp(1.3rem, 1.8vw, 1.6rem)/1.2 var(--f-display); color: var(--sheet-ink); letter-spacing: -.01em; }
.care-appointment span { font: 500 1rem/1.4 var(--f-text); color: var(--sheet-muted); letter-spacing: 0; }
.care-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 2rem; }
.care-sheet .primary-action { background: var(--sheet-ink); color: var(--sheet-hi); box-shadow: 0 12px 26px -16px rgb(0 0 0 / .6); }
.care-secondary { display: inline-flex; align-items: center; min-height: 48px; padding: .6rem 1.2rem; border-radius: 999px; border: 1px solid var(--sheet-rule); background: transparent; color: var(--sheet-ink); font-weight: 650; cursor: pointer; }
.care-secondary:hover { border-color: var(--sheet-ink); }
.care-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--sheet-ink); font-weight: 650; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.care-inline-actions { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; margin-top: 1.2rem; }
.care-fine { margin-top: 1rem; font: 500 .8rem/1.4 var(--f-mono); color: var(--sheet-muted); }
.care-slots { margin: 1.6rem 0 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; max-width: 44rem; }
.care-slot { position: relative; display: grid; gap: .3rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--sheet-rule); background: var(--sheet-hi); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.care-slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.care-slot:has(input:checked) { border-color: var(--sheet-ink); box-shadow: 0 0 0 1px var(--sheet-ink), 0 0 24px -6px color-mix(in oklab, var(--glow) 70%, transparent); background: color-mix(in oklab, var(--glow) 10%, var(--sheet-hi)); }
.care-slot:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.care-slot-day { font: 650 1.02rem/1.3 var(--f-text); color: var(--sheet-ink); }
.care-slot-place { font-size: .9rem; color: var(--sheet-muted); }
.care-receipt { margin-top: 1.4rem; display: grid; justify-items: start; gap: .6rem; }
.care-receipt > .care-mark { width: 44px; height: 44px; color: var(--glow-ink); background: transparent; --c-ground: var(--sheet-hi); }
.care-sending { margin-top: 1.8rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; max-width: 40rem; font: 600 .92rem/1.3 var(--f-text); color: var(--sheet-ink); }
.care-sending-line { position: relative; height: 2px; border-radius: 2px; background: var(--sheet-rule); overflow: hidden; }
.care-sending-line span { position: absolute; inset: 0; width: 35%; border-radius: 2px; background: var(--glow-ink); box-shadow: 0 0 8px var(--glow); animation: care-send 1.1s var(--ease-out) infinite; }
@keyframes care-send { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.care-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.care-col { padding: 1rem 1.1rem; border-radius: 14px; background: color-mix(in oklab, var(--sheet-lo) 50%, var(--sheet-hi)); }
.care-col h3 { font: 700 .76rem/1.4 var(--f-text); text-transform: uppercase; letter-spacing: .14em; color: var(--sheet-muted); margin-bottom: .55rem; }
.care-col ul { display: grid; gap: .45rem; }
.care-col li { color: var(--sheet-ink); line-height: 1.4; }
.care-other { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--sheet-rule); display: grid; gap: .6rem; justify-items: start; color: var(--sheet-ink); }
.care-status { min-height: 1.4em; margin-top: .9rem; color: var(--room-muted); font-size: .9rem; }

@media (max-width: 999px) {
  .care-stages { display: flex; gap: .25rem; overflow-x: auto; padding-bottom: 2.2rem; scrollbar-width: none; }
  .care-stages::before { display: none; }
  .care-stages::after { content: attr(data-progress); left: 0; right: auto; bottom: 0; top: auto; height: auto; transform: none; background: none; box-shadow: none; font: 600 .86rem/1.3 var(--f-text); color: var(--room-ink); }
  .care-stage button, .care-stage-static { min-height: 44px; min-width: 44px; padding: .4rem; }
  .care-stage-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .care-heading-row { align-items: flex-start; }
  .care-play { padding: .5rem .9rem; }
  .care-sheet { border-radius: 14px; padding: 2.6rem 1.2rem 0; min-height: 0; }
  .care-step-head { grid-template-columns: 1fr; }
  .care-footer { display: block; }
  .care-footer { margin: 0 -1.2rem; padding: .9rem 1.2rem; position: sticky; bottom: 0; background: var(--sheet-hi); border-radius: 0 0 14px 14px; }
  .care-footer .care-actions { width: 100%; }
  .care-step-title { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  .care-cols { grid-template-columns: 1fr; }
  .care-handoff div { grid-template-columns: 1fr; gap: .2rem; }
  .care-actions .primary-action { flex: 1; }
}
