/*
 * stage.css — Full-screen audience stage: a fixed 1920×1080 logical canvas,
 * scaled with transform to fit any viewport (centred, letterboxed).
 *
 * Projector-grade type: body ≥ 32px, headings 56–88px, KPI numbers 96–140px.
 * The canvas carries its own data-theme, independent of the operator UI theme.
 */

.stage-viewport {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  cursor: default;
}

.stage-missing {
  display: grid;
  place-items: center;
  gap: 16px;
  height: 100%;
  color: #fff;
  font-size: 24px;
}

/* ---- Canvas --------------------------------------------------------------------------- */
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 36px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.s-slide {
  /* --fit steps text down when content would not fit (stage.js settle()). */
  --fit: 1;
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 88px 120px 40px;
  font-size: calc(36px * var(--fit));
  display: flex;
  flex-direction: column;
}
.s-slide > * { flex: 1; min-height: 0; }

.stage.is-entering .s-slide { animation: s-fade 280ms var(--ease); }
.is-new { animation: s-rise 260ms var(--ease); }

@keyframes s-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes s-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---- Type ------------------------------------------------------------------------------ */
.s-h1 { margin: 0 0 32px; font-size: calc(76px * var(--fit, 1)); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
.s-h2 { margin: 0 0 20px; font-size: calc(44px * var(--fit, 1)); font-weight: 600; line-height: 1.2; }
.s-lead { margin: 0 0 24px; font-size: calc(40px * var(--fit, 1)); color: var(--ink); }
.s-muted { margin: 0 0 16px; font-size: calc(32px * var(--fit, 1)); color: var(--ink-muted); }
.s-small { font-size: calc(32px * var(--fit, 1)); margin: 0 0 24px; }
.s-mono { font-family: var(--font-mono); font-size: calc(30px * var(--fit, 1)); margin: 0 0 12px; }
.s-kicker {
  margin: 0 0 16px;
  font-size: calc(30px * var(--fit, 1));
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.s-strike { text-decoration: line-through; text-decoration-thickness: 3px; color: var(--ink-muted); }

.s-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; }
.s-list { margin: 0 0 32px; padding-left: 1.1em; display: grid; gap: 14px; }
.s-list--small { font-size: calc(32px * var(--fit, 1)); }

/* ---- Wordmark & rail ---------------------------------------------------------------------- */
.s-wordmark { display: inline-flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 500; letter-spacing: 0.08em; color: var(--ink-muted); }
.s-wordmark .icon { color: var(--accent); stroke-width: 1.5; }

.s-rail {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 80px;
  padding: 0 120px;
  border-top: 1px solid var(--line);
  font-size: 26px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.s-rail__stages { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; flex: 1; }
.s-rail__seg {
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 20px;
  font-weight: 600;
}
.s-rail__seg.is-done { background: var(--accent-soft); color: var(--accent); }
.s-rail__seg.is-current { background: var(--accent); color: var(--on-accent); }
.s-rail__clock { font-weight: 600; color: var(--ink); }
.s-rail__clock, .s-rail__count { white-space: nowrap; }
.s-rail--dense .s-meter__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.s-rail--dense .s-meters { gap: 20px; }
/* Pressure meters in the rail: icon, short label, five segments. */
.s-meters { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; font-size: 20px; }
.s-rail--branching .s-meters { margin-left: auto; }
.s-meter { display: inline-flex; gap: 10px; align-items: center; color: var(--ink-muted); }
.s-meter .icon { color: var(--accent); }
.s-meter__bar { display: inline-flex; gap: 4px; }
.s-meter__bar span { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); }
.s-meter__bar span.is-on { background: var(--accent); }
.s-meter--regulator .s-meter__bar span.is-on, .s-meter--media .s-meter__bar span.is-on { background: var(--warn); }
.stage--twist .s-meter, .stage--twist .s-meter .icon { color: var(--on-accent); }

/* Complication card over the slide */
.s-complication { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 94%, transparent); }
.s-complication__card { width: 1240px; padding: 64px 80px; background: var(--surface); border: 1px solid var(--line); border-top: 10px solid var(--warn); border-radius: 24px; box-shadow: var(--shadow); }
.s-complication__kicker { display: flex; gap: 16px; align-items: center; margin: 0 0 28px; color: var(--warn); font-size: 28px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.s-complication__title { margin: 0 0 24px; font-size: 72px; line-height: 1.1; }
.s-complication__text { margin: 0; font-size: 44px; line-height: 1.4; color: var(--ink); }
.s-complication--deadline .s-complication__card { border-top-color: var(--danger); }
.s-complication--deadline .s-complication__kicker { color: var(--danger); }
.s-complication--challenge .s-complication__card { border-top-color: var(--accent); }
.s-complication--challenge .s-complication__kicker { color: var(--accent); }
.s-complication--interrupt .s-complication__card { border-top-color: var(--warn); }
.s-complication__ask { display: block; margin-bottom: 8px; font-size: 26px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
/* Facts left in play by interrupts, under the room's decision. */
.s-slide > .s-facts { flex: none; }
.s-facts { margin-top: 28px; padding: 18px 28px; border-radius: 12px; border-left: 8px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.s-facts__label { display: flex; gap: 12px; align-items: center; margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); }
.s-facts__list { margin: 0; padding-left: 28px; font-size: calc(32px * var(--fit, 1)); line-height: 1.35; }
.s-complication__choice { margin: 32px 0 0; padding: 24px 32px; font-size: 44px; line-height: 1.35; font-weight: 700; background: var(--surface-2); border-radius: 16px; }

/* ---- Title ------------------------------------------------------------------------------------ */
.s-title { position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding-top: 96px; }
.s-title__art {
  position: absolute;
  inset: auto -120px -40px -120px;
  height: 200px;
  z-index: -1;
  border-top: 2px solid var(--line);
  background:
    linear-gradient(transparent 0 30%, var(--surface-2) 30% 31%, transparent 31% 55%, var(--surface-2) 55% 56%, transparent 56%);
  opacity: 0.7;
}
.s-banner {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 10px 24px;
  border: 2px solid var(--warn);
  border-radius: 999px;
  color: var(--warn);
  font-size: calc(26px * var(--fit, 1));
  font-weight: 700;
  letter-spacing: 0.1em;
}
.s-emblem {
  display: grid;
  place-items: center;
  width: 200px;
  height: 200px;
  margin-bottom: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.s-emblem .icon { stroke-width: 1.25; }
.s-title__heading { margin: 0 0 16px; font-size: calc(104px * var(--fit, 1)); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; max-width: 1500px; }
.s-title__sub { margin: 0 0 24px; font-size: calc(40px * var(--fit, 1)); color: var(--ink-muted); }
.s-title__org { margin: 24px 0 8px; font-size: calc(48px * var(--fit, 1)); font-weight: 500; }
.s-title__meta { margin: 0; font-size: calc(32px * var(--fit, 1)); color: var(--ink-muted); }
.stage--title .s-slide::after {
  content: "";
}

/* ---- Briefing & context ------------------------------------------------------------------------- */
.s-rounds { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: round; }
.s-rounds li {
  counter-increment: round;
  flex: 1;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: calc(28px * var(--fit, 1));
  font-weight: 600;
}
.s-rounds li::before { content: counter(round); display: block; font-size: calc(44px * var(--fit, 1)); color: var(--accent); }

.s-services { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.s-services li { display: grid; gap: 2px; padding: 10px 20px; border-left: 6px solid var(--accent); background: var(--surface); border-radius: 8px; font-size: calc(32px * var(--fit, 1)); }
.s-services span { font-size: calc(24px * var(--fit, 1)); color: var(--ink-muted); }
.s-roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
.s-roster li { display: flex; align-items: center; gap: 16px; }
.s-roster span:last-child { display: grid; font-size: calc(30px * var(--fit, 1)); line-height: 1.2; }
.s-roster small { font-size: calc(24px * var(--fit, 1)); color: var(--ink-muted); }
.s-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: calc(24px * var(--fit, 1));
  font-weight: 700;
}

/* ---- Situation ------------------------------------------------------------------------------------ */
.s-situation { display: flex; flex-direction: column; }
.s-situation__top { display: flex; justify-content: space-between; align-items: baseline; }
.s-clock { margin: 0; font-size: calc(44px * var(--fit, 1)); font-weight: 600; font-variant-numeric: tabular-nums; }
.s-narrative { margin: 0; font-size: calc(46px * var(--fit, 1)); line-height: 1.45; max-width: 1560px; }
.s-story { display: grid; gap: 0.6em; font-size: calc(46px * var(--fit, 1)); }
.s-story .s-narrative { font-size: inherit; }
.s-story--long { font-size: calc(40px * var(--fit, 1)); }

/* ---- Timeline -------------------------------------------------------------------------------------- */
.s-tl { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 24px; }
.s-tl__item { display: grid; grid-template-columns: 140px 32px 1fr; gap: 24px; align-items: start; }
.s-tl__time { font-size: calc(40px * var(--fit, 1)); font-weight: 600; font-variant-numeric: tabular-nums; }
.s-tl__dot { width: 24px; height: 24px; margin-top: 14px; border-radius: 50%; border: 4px solid var(--accent); background: var(--bg); }
.s-tl__item.is-new .s-tl__dot { background: var(--accent); }
.s-tl__body { display: grid; gap: 4px; font-size: calc(36px * var(--fit, 1)); }
.s-tl__body small { font-size: calc(26px * var(--fit, 1)); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- Inject artefact (generic fallback; type-specific mock-ups below) -------------------------------------- */
.s-inject { display: flex; align-items: center; justify-content: center; }
.s-artefact {
  width: 1480px;
  max-height: 840px;
  overflow: hidden;
  padding: 48px 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.s-artefact__head { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; font-size: calc(26px * var(--fit, 1)); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.s-artefact__type { font-weight: 700; color: var(--accent); }
.s-artefact__time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.s-artefact__source { margin: 0 0 16px; font-size: calc(30px * var(--fit, 1)); color: var(--ink-muted); }
.s-artefact__meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0 0 24px; font-size: calc(28px * var(--fit, 1)); }
.s-artefact__meta dt { color: var(--ink-muted); }
.s-artefact__meta dd { margin: 0; }
.s-artefact__headline { margin: 0 0 20px; font-size: calc(52px * var(--fit, 1)); line-height: 1.15; }
.s-artefact__content { margin: 0; font-size: calc(38px * var(--fit, 1)); line-height: 1.45; }
.s-artefact__reliability { margin: 24px 0 0; font-size: calc(28px * var(--fit, 1)); font-weight: 600; color: var(--warn); }
.s-artefact--ransomNote { border: 3px solid var(--danger); font-family: var(--font-mono); }
.s-artefact--ransomNote .s-artefact__content { font-size: calc(34px * var(--fit, 1)); }
.s-sev { display: inline-flex; align-items: center; gap: 8px; padding: 4px 16px; border-radius: 999px; font-weight: 700; }
.s-sev--critical, .s-sev--high { background: var(--danger-soft); color: var(--danger); }
.s-sev--medium { background: var(--warn-soft); color: var(--warn); }
.s-sev--low, .s-sev--info { background: var(--info-soft); color: var(--info); }

/* ---- Data ------------------------------------------------------------------------------------------------- */
.s-data { display: flex; flex-direction: column; }
.s-data__top { display: flex; justify-content: space-between; align-items: baseline; }
.s-data-label { font-size: calc(22px * var(--fit, 1)); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 16px; }
.s-data__chart { flex: 1; min-height: 0; display: flex; align-items: center; }
.s-data__chart > * { width: 100%; }
/* The chart fills the space left under the title; the drawing scales down so a legend or marker key
   below it never pushes it over the caption. */
.s-data__chart > .chart { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.s-data__chart .chart-svg { flex: 0 1 auto; min-height: 0; }
.s-data__chart + .s-muted { margin-top: 20px; }
.s-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 40px; }
.s-kpi { display: grid; gap: 8px; min-width: 0; padding: 40px; border-radius: 20px; background: var(--surface); border-top: 8px solid var(--info); container-type: inline-size; }
.s-kpi--danger { border-top-color: var(--danger); }
.s-kpi--warn { border-top-color: var(--warn); }
.s-kpi--ok { border-top-color: var(--ok); }
.s-kpi__value { display: flex; align-items: flex-end; min-height: calc(120px * var(--fit, 1)); font-size: min(calc(120px * var(--fit, 1)), calc(100cqi / (var(--chars, 6) * 0.62))); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.s-kpi__label { font-size: calc(32px * var(--fit, 1)); color: var(--ink-muted); }

/* ---- Twist (high contrast) ------------------------------------------------------------------------------ */
/* Accent field with its paired on-accent ink: ≥ 7:1 in both stage themes. */
.stage--twist { background: var(--accent); color: var(--on-accent); }
.stage--twist .s-rail { border-top-color: transparent; color: var(--on-accent); }
.stage--twist .s-rail__clock,
.stage--twist .s-wordmark,
.stage--twist .s-wordmark .icon { color: var(--on-accent); }
.stage--twist .s-rail__seg { background: transparent; border: 2px solid var(--on-accent); color: var(--on-accent); }
.stage--twist .s-rail__seg.is-current { background: var(--on-accent); color: var(--accent); }
.s-twist { display: flex; flex-direction: column; justify-content: center; }
.s-twist__flag { display: inline-flex; align-items: center; gap: 16px; margin: 0 0 32px; font-size: calc(34px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.s-twist__text { margin: 0 0 56px; font-size: calc(88px * var(--fit, 1)); font-weight: 600; line-height: 1.12; max-width: 1600px; }
.s-twist__assumption .s-kicker { color: var(--on-accent); }
.s-twist__assumption .s-strike { font-size: calc(44px * var(--fit, 1)); color: var(--on-accent); }

/* ---- Discussion ------------------------------------------------------------------------------------------- */
.s-discussion { display: flex; flex-direction: column; }
.s-discussion__top { display: flex; justify-content: space-between; align-items: flex-start; }
.s-questions { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 28px; }
.s-q { display: grid; grid-template-columns: 220px 1fr; gap: 8px 32px; align-items: start; }
.s-q__kind { display: inline-flex; align-items: center; gap: 12px; font-size: calc(24px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); padding-top: 10px; }
.s-q--challenge .s-q__kind { color: var(--warn); }
.s-q__text { font-size: calc(40px * var(--fit, 1)); line-height: 1.3; }
.s-q__roles { grid-column: 2; font-size: calc(26px * var(--fit, 1)); color: var(--ink-muted); }
.s-q__roles--missing { color: var(--warn); font-weight: 600; }

.s-timer { display: inline-flex; align-items: center; gap: 16px; color: var(--ink-muted); }
.s-timer__value { font-size: calc(120px * var(--fit, 1)); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.s-timer.is-running .icon { color: var(--accent); }
.s-timer.is-done .s-timer__value { color: var(--danger); }

/* ---- Decision & recap ---------------------------------------------------------------------------------------- */
.s-options { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 20px; }
.s-options li { display: flex; gap: 28px; align-items: flex-start; font-size: calc(40px * var(--fit, 1)); line-height: 1.3; }
.s-options__key {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: calc(40px * var(--fit, 1));
  font-weight: 700;
}
.s-recap__entry { display: grid; gap: 24px; }
.s-recap__option { display: flex; gap: 28px; align-items: center; margin: 0; font-size: calc(44px * var(--fit, 1)); }
.s-recap__text { margin: 0; padding: 24px 40px; border-left: 8px solid var(--accent); background: var(--surface); font-size: calc(40px * var(--fit, 1)); border-radius: 8px; }
.s-reconsider { display: flex; flex-direction: column; gap: 28px; }
.s-reconsider__pressure { display: flex; gap: 24px; align-items: flex-start; margin: 0; padding: 28px 36px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-left: 8px solid var(--warn); font-size: calc(38px * var(--fit, 1)); line-height: 1.35; }
.s-reconsider__pressure .icon { flex: none; color: var(--warn); margin-top: 4px; }
.s-reconsider__ask { margin: 0; font-size: calc(46px * var(--fit, 1)); font-weight: 700; color: var(--accent); }
.s-reconsider__verdict { align-self: flex-start; margin: 0; padding: 10px 28px; border-radius: 999px; font-size: calc(36px * var(--fit, 1)); font-weight: 700; background: var(--surface-2); }
.s-reconsider__verdict.is-keep { color: var(--ok); }
.s-reconsider__verdict.is-reverse { color: var(--danger); }
.s-reconsider__verdict.is-unsure { color: var(--warn); }

/* ---- Debrief ------------------------------------------------------------------------------------------------ */
.s-avr { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 16px; font-size: calc(28px * var(--fit, 1)); }
.s-avr li { display: grid; gap: 4px; }

/* ---- Overlays inside the canvas --------------------------------------------------------------------------------- */
.s-paused {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
}
.s-paused .icon { color: var(--accent); }
.s-blank { position: absolute; inset: 0; z-index: 10; }
.s-blank--black { background: #000; }
.s-blank--white { background: #fff; }

/* ---- Overlays outside the canvas (operator-visible) ---------------------------------------------------------------- */
.private-overlay,
.help-overlay {
  position: fixed;
  inset: 40px;
  z-index: 20;
  overflow: auto;
  padding: 32px 40px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  font-size: 20px;
  line-height: 1.5;
}
.private-overlay { border: 8px solid #D92D20; }
.private-overlay__flag {
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #D92D20;
}
.private-overlay__hint { position: absolute; top: 16px; right: 24px; margin: 0; color: var(--ink-muted); }
.help-overlay { border: 2px solid var(--line); inset: 10% 20%; }
.shortcut-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 16px 0 0; }
.shortcut-list dt { display: flex; gap: 6px; }
.shortcut-list dd { margin: 0; }
kbd {
  display: inline-block;
  min-width: 28px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.85em;
  text-align: center;
}

/* ---- Previews (presenter) ------------------------------------------------------------------------------------------ */
.stage-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-radius: 10px;
}
.stage-frame__empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #aaa; }
.stage--preview .is-new,
.stage--preview .s-slide { animation: none; }

/* ============================================================================================
   Charts, artefacts and title artwork (stage scale: 1920×1080 canvas units)
   ============================================================================================ */

/* ---- Title artwork & emblem ------------------------------------------------------------------ */
.s-slide { position: relative; }
.s-art { position: absolute; left: -120px; top: -88px; width: 1920px; height: 1080px; z-index: -1; pointer-events: none; }
.s-art__horizon { stroke: var(--line); stroke-width: 2; }
.s-art__sun { fill: none; stroke: var(--art); stroke-opacity: 0.45; stroke-width: 3; }
.s-art__ridge { fill: var(--art); fill-opacity: calc(0.03 + var(--layer) * 0.06); stroke: var(--art); stroke-opacity: 0.35; stroke-width: 2; }
.s-emblem { width: auto; height: auto; background: transparent; }
.s-emblem .emblem-svg { stroke-width: 1.5; }

/* ---- Chart scaffolding ------------------------------------------------------------------------- */
.chart { display: grid; gap: 16px; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; max-height: 600px; overflow: visible; font-family: var(--font); }
.c-legend { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; padding: 0; list-style: none; font-size: 28px; color: var(--ink-muted); }
.c-legend li { display: flex; align-items: center; gap: 12px; }
.c-swatch { display: inline-block; width: 28px; height: 28px; border-radius: 6px; background: var(--c); }
.c-swatch--line { height: 6px; border-radius: 3px; }
.c-swatch--tick { width: 6px; height: 32px; border-radius: 2px; }
.c-swatch--diamond { width: 20px; height: 20px; border-radius: 2px; transform: rotate(45deg); }

/* Colour roles: every mark reads --c, set by exactly one class. */
.c-s1 { --c: var(--series-1); }
.c-s2 { --c: var(--series-2); }
.c-s3 { --c: var(--series-3); }
.c-s4 { --c: var(--series-4); }
.c-ok { --c: var(--ok); }
.c-warn { --c: var(--warn); }
.c-danger { --c: var(--danger); }
.c-info { --c: var(--info); }
.c-muted { --c: var(--ink-muted); }
.c-target-swatch { --c: var(--ink); }
.c-tl-attacker, .c-tl--attacker { --c: var(--danger); }
.c-tl-inject, .c-tl--inject { --c: var(--series-1); }
.c-tl-decision, .c-tl--decision { --c: var(--series-3); }

.c-grid { stroke: var(--line); stroke-width: 1.5; }
.c-axis { stroke: var(--ink-muted); stroke-width: 2; }
.c-tick { fill: var(--ink-muted); font-size: 26px; font-variant-numeric: tabular-nums; }
.c-unit { font-size: 22px; }
.c-label { fill: var(--ink); font-size: 30px; font-weight: 500; }
.c-label--sm { font-size: 24px; }
/* Timeline event list at projector scale (the operator sizes live in app.css). */
.stage .c-tl-list { font-size: 28px; gap: 12px; padding-left: 1.6em; }
.stage .c-tl-list__item { grid-template-columns: 20px minmax(150px, max-content) minmax(260px, max-content) 1fr; gap: 20px; }
.stage .c-tl-list__item .c-swatch { width: 18px; height: 18px; }
.stage .c-tl-list__item .c-swatch--diamond { width: 15px; height: 15px; }
.c-value { fill: var(--ink); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-hero { fill: var(--ink); font-size: 120px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-hero--sm { font-size: 88px; }

.c-line { fill: none; stroke: var(--c); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.c-area { fill: var(--c); fill-opacity: 0.12; stroke: none; }
.c-dot { fill: var(--c); stroke: var(--bg); stroke-width: 3; }
.c-hit { fill: transparent; }
.c-bar { fill: var(--c); }
.c-swatch-svg { fill: var(--c); }
.c-donut { fill: none; stroke: var(--c); stroke-width: 72; }
.c-track { fill: none; stroke: var(--surface-2); stroke-width: 56; stroke-linecap: round; }
.c-gauge { fill: none; stroke: var(--c); stroke-width: 56; stroke-linecap: round; }
.c-target { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }

.c-marker__line { stroke: var(--ink-muted); stroke-width: 2; stroke-dasharray: 6 6; }
.c-marker circle { fill: var(--bg); stroke: var(--ink); stroke-width: 3; }
.c-marker--hot circle { stroke: var(--danger); }
.c-marker__num { fill: var(--ink); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Marker key under a line chart: number, time, label; wraps instead of overlapping. */
.c-markers { display: flex; flex-wrap: wrap; gap: 10px 40px; margin: 0; padding: 0; list-style: none; font-size: 26px; color: var(--ink-muted); }
.c-markers li { display: flex; align-items: baseline; gap: 12px; max-width: 100%; }
.c-markers__num { flex: none; display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border: 3px solid var(--ink); border-radius: 50%; color: var(--ink); font-size: 0.8em; font-weight: 700; transform: translateY(-0.1em); }
.c-markers__num--hot { border-color: var(--danger); }
.c-markers__time { flex: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.c-value--inside { fill: var(--bg); }

.c-edge { fill: none; stroke: var(--line); stroke-width: 3; }
.c-edge--hot { stroke: var(--danger); stroke-width: 4; }
.c-node rect { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.c-node--compromised rect, .c-node--down rect { stroke: var(--danger); stroke-width: 3; }
.c-node--degraded rect { stroke: var(--warn); stroke-width: 3; }
.c-node__label { fill: var(--ink); font-size: 28px; font-weight: 600; }
.c-chip circle { fill: var(--c); }
.c-chip__label { fill: var(--ink-muted); font-size: 22px; font-weight: 600; }
.c-ring { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 4 8; }
.c-blast-node { stroke: var(--bg); stroke-width: 4; }
.c-blast-center { stroke: var(--bg); stroke-width: 6; }
.c-tl__stem { stroke: var(--line); stroke-width: 2; }
.c-tl__mark { fill: var(--c); stroke: var(--bg); stroke-width: 3; }

/* Draw-in (disabled by the global reduced-motion rule and in presenter previews). */
.c-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: c-draw 900ms var(--ease) forwards; }
.c-grow { transform-box: fill-box; transform-origin: bottom; animation: c-grow 500ms var(--ease) both; }
.c-grow-x { transform-box: fill-box; transform-origin: left; animation: c-grow-x 600ms var(--ease) both; }
@keyframes c-draw { to { stroke-dashoffset: 0; } }
@keyframes c-grow { from { transform: scaleY(0); } }
@keyframes c-grow-x { from { transform: scaleX(0); } }
.stage--preview .c-draw { animation: none; stroke-dashoffset: 0; }
.stage--preview .c-grow, .stage--preview .c-grow-x { animation: none; }
.s-kpi__label { display: flex; align-items: center; gap: 12px; }
.s-kpi--danger .s-kpi__label .icon { color: var(--danger); }
.s-kpi--warn .s-kpi__label .icon { color: var(--warn); }
.s-kpi--ok .s-kpi__label .icon { color: var(--ok); }

/* ---- Artefacts ---------------------------------------------------------------------------------- */
.a-wrap { display: flex; justify-content: center; width: 100%; }
.a-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-muted); font-size: calc(28px * var(--fit, 1)); font-weight: 600; }
.a-card { width: 1440px; max-height: 860px; overflow: hidden; padding: 40px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.a-reliability, .a-missing { display: flex; gap: 12px; align-items: center; margin: 20px 0 0; font-size: calc(28px * var(--fit, 1)); font-weight: 600; color: var(--warn); }
.a-avatar { flex: none; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: calc(34px * var(--fit, 1)); font-weight: 700; }
.a-kicker { display: flex; gap: 12px; align-items: center; margin: 0 0 24px; font-size: calc(26px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }

/* Mail window */
.a-mail { width: 1480px; padding: 0; }
.a-mail__chrome { display: flex; gap: 16px; align-items: center; padding: 18px 40px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: calc(24px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.a-mail__dots { display: inline-flex; gap: 10px; margin-right: 12px; }
.a-mail__dots span { width: 16px; height: 16px; border-radius: 50%; background: var(--line-strong); }
.a-mail--suspect .a-mail__chrome .icon { color: var(--warn); }
.a-mail__subject { margin: 0; padding: 36px 56px 8px; font-size: calc(46px * var(--fit, 1)); line-height: 1.2; }
.a-mail__from { display: flex; gap: 24px; align-items: center; padding: 20px 56px 28px; border-bottom: 1px solid var(--line); }
.a-mail__sender { display: grid; gap: 2px; font-size: calc(28px * var(--fit, 1)); }
.a-mail__sender span { color: var(--ink-muted); font-size: calc(26px * var(--fit, 1)); }
.a-mail__body { padding: 36px 56px 40px; font-size: calc(38px * var(--fit, 1)); line-height: 1.45; }
.a-mail__body p { margin: 0; }
.a-mail__attachment { display: inline-flex; gap: 14px; align-items: center; margin: 0 56px 36px; padding: 14px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: calc(28px * var(--fit, 1)); }
.a-mail .a-reliability, .a-mail .a-missing, .a-report .a-reliability, .a-report .a-missing { margin: 0 56px 32px; }

/* Avatars: initials for people, an icon for organisations and channels. */
.a-avatar--lg { width: 112px; height: 112px; font-size: calc(40px * var(--fit, 1)); }
.a-avatar--xl { width: 200px; height: 200px; font-size: calc(72px * var(--fit, 1)); }
.a-avatar--hostile { background: var(--danger-soft); color: var(--danger); }
/* Narration that frames the speech ("Jack calls from the car"): a quiet caption, not part of the quote. */
.a-sys { margin: 0 auto 8px; padding: 8px 24px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); font-size: calc(26px * var(--fit, 1)); text-align: center; }
.a-sys--start { margin: 0 0 20px; display: inline-block; text-align: left; }

/* Team chat window */
.a-chatwin { width: 1480px; padding: 0; display: flex; flex-direction: column; }
.a-chatwin__bar { display: flex; gap: 16px; align-items: center; padding: 18px 40px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: calc(26px * var(--fit, 1)); font-weight: 700; color: var(--ink-muted); }
.a-chatwin__bar .icon { color: var(--accent); }
.a-chatwin__body { display: grid; gap: 28px; padding: 36px 48px; }
.a-chatwin__compose { display: flex; align-items: center; margin: 0 48px 32px; padding: 16px 28px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-muted); font-size: calc(26px * var(--fit, 1)); }
.a-chatwin__compose .icon { margin-left: auto; color: var(--accent); }
.a-chatwin .a-reliability, .a-chatwin .a-missing { margin: -12px 48px 28px; }
.a-msg { display: flex; gap: 24px; align-items: flex-start; }
.a-msg--out { justify-content: flex-end; }
.a-msg__col { display: grid; gap: 10px; max-width: 1180px; }
.a-msg--out .a-msg__col { justify-items: end; }
.a-msg__who { display: flex; gap: 16px; align-items: baseline; margin: 0; font-size: calc(28px * var(--fit, 1)); }
.a-msg__who > span:not(.a-time) { color: var(--ink-muted); }
.a-msg__bubble { margin: 0; padding: 24px 36px; background: var(--surface-2); border-radius: 8px 32px 32px 32px; font-size: calc(40px * var(--fit, 1)); line-height: 1.4; }
.a-msg--out .a-msg__bubble { background: var(--accent-soft); border-radius: 32px 8px 32px 32px; }

/* Phone held upright (text messages) */
.a-phone { width: 820px; display: flex; flex-direction: column; padding: 20px 32px 28px; background: var(--surface); border: 14px solid var(--surface-2); border-radius: 72px; box-shadow: var(--shadow); }
.a-phone__status { display: flex; align-items: center; justify-content: space-between; padding: 4px 24px 0; color: var(--ink-muted); font-size: calc(24px * var(--fit, 1)); font-weight: 700; font-variant-numeric: tabular-nums; }
.a-phone__notch { width: 160px; height: 36px; border-radius: 999px; background: var(--surface-2); }
.a-phone__bars { display: inline-flex; gap: 4px; align-items: flex-end; height: 22px; }
.a-phone__bars span { width: 6px; border-radius: 2px; background: var(--ink-muted); }
.a-phone__bars span:nth-child(1) { height: 6px; } .a-phone__bars span:nth-child(2) { height: 11px; } .a-phone__bars span:nth-child(3) { height: 16px; } .a-phone__bars span:nth-child(4) { height: 22px; }
.a-phone__contact { display: grid; justify-items: center; gap: 6px; padding: 24px 0 28px; border-bottom: 1px solid var(--line); font-size: calc(32px * var(--fit, 1)); text-align: center; }
.a-phone__contact > span:last-child { color: var(--ink-muted); font-size: calc(24px * var(--fit, 1)); }
.a-phone__thread { display: grid; gap: 14px; padding: 28px 4px; }
.a-phone__bubble { max-width: 88%; margin: 0; padding: 22px 30px; font-size: calc(36px * var(--fit, 1)); line-height: 1.35; }
.a-phone__bubble--in { justify-self: start; background: var(--surface-2); border-radius: 32px 32px 32px 8px; }
.a-phone__bubble--out { justify-self: end; background: var(--accent); color: var(--on-accent); border-radius: 32px 32px 8px 32px; }
.a-phone__stamp { justify-self: center; color: var(--ink-muted); font-size: calc(22px * var(--fit, 1)); font-variant-numeric: tabular-nums; }
.a-phone__compose { display: flex; align-items: center; padding: 14px 24px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-muted); font-size: calc(24px * var(--fit, 1)); }
.a-phone__compose .icon { margin-left: auto; color: var(--accent); }
.a-phone .a-reliability { justify-content: center; }

/* Call screen */
.a-callscreen { width: 1600px; padding: 0; display: grid; grid-template-columns: 520px 1fr; }
.a-callscreen__caller { display: grid; justify-items: center; align-content: center; gap: 10px; padding: 80px 32px 56px; background: var(--surface-2); text-align: center; }
.a-callscreen__ring { display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 0 38px color-mix(in srgb, var(--accent) 7%, transparent); }
.a-callscreen__name { font-size: calc(40px * var(--fit, 1)); line-height: 1.2; }
.a-callscreen__title { color: var(--ink-muted); font-size: calc(26px * var(--fit, 1)); }
.a-callscreen__state { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; color: var(--ok); font-size: calc(26px * var(--fit, 1)); font-weight: 600; font-variant-numeric: tabular-nums; }
.a-callscreen__wave { display: flex; gap: 6px; align-items: center; height: 56px; margin: 8px 0 16px; }
.a-callscreen__wave span { width: 8px; height: 30%; border-radius: 4px; background: var(--accent); opacity: 0.7; }
.a-callscreen__wave span:nth-child(3n) { height: 70%; } .a-callscreen__wave span:nth-child(4n+1) { height: 45%; } .a-callscreen__wave span:nth-child(5n+2) { height: 95%; } .a-callscreen__wave span:nth-child(7n) { height: 20%; }
.a-callscreen__controls { display: flex; gap: 28px; }
.a-callscreen__controls > span { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--surface); color: var(--ink-muted); }
.a-callscreen__controls > .a-callscreen__end { background: var(--danger); color: #FFFFFF; }
.a-callscreen__transcript { display: flex; flex-direction: column; justify-content: center; padding: 48px 64px; }
.a-callscreen__transcript .a-kicker { margin-bottom: 20px; }
.a-callscreen__quote { margin: 0; padding-left: 36px; border-left: 6px solid var(--accent); font-size: calc(44px * var(--fit, 1)); line-height: 1.4; }
.a-callscreen__lines { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.a-callscreen__lines li { display: grid; grid-template-columns: minmax(160px, max-content) 1fr; gap: 28px; font-size: calc(36px * var(--fit, 1)); line-height: 1.4; }
.a-callscreen__lines strong { color: var(--accent); font-size: calc(28px * var(--fit, 1)); padding-top: 0.2em; }
.a-callscreen__lines li.is-out strong { color: var(--ink-muted); }
.a-callscreen .a-reliability, .a-callscreen .a-missing { margin-top: 28px; }

.a-news { width: 1400px; padding: 40px 64px; background: var(--surface); border-top: 12px solid var(--ink); box-shadow: var(--shadow); font-family: Georgia, "Times New Roman", serif; }
.a-news__mast { display: flex; align-items: baseline; gap: 24px; padding-bottom: 16px; margin-bottom: 28px; border-bottom: 4px double var(--ink); }
.a-news__name { font-size: calc(48px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.a-news__headline { margin: 0 0 24px; font-size: calc(76px * var(--fit, 1)); line-height: 1.08; }
.a-news__lead { margin: 0 0 24px; font-family: var(--font); font-size: calc(36px * var(--fit, 1)); line-height: 1.45; }
.a-news__rules span { display: block; height: 10px; margin: 14px 0; background: var(--surface-2); border-radius: 4px; }
.a-news__rules span:nth-child(2) { width: 85%; }
.a-news__rules span:nth-child(3) { width: 60%; }

/* Public post */
.a-post { width: 1240px; padding: 36px 48px 28px; }
.a-post__context { display: flex; gap: 12px; align-items: center; margin: 0 0 20px; color: var(--ink-muted); font-size: calc(26px * var(--fit, 1)); font-weight: 600; }
.a-post__head { display: flex; gap: 24px; align-items: center; }
.a-post__author { display: grid; gap: 2px; font-size: calc(32px * var(--fit, 1)); }
.a-post__author > span { color: var(--ink-muted); font-size: calc(24px * var(--fit, 1)); font-variant-numeric: tabular-nums; }
.a-post__more { margin-left: auto; color: var(--ink-muted); }
.a-post__text { margin: 28px 0; font-size: calc(46px * var(--fit, 1)); line-height: 1.35; }
.a-post__video { position: relative; display: grid; align-content: end; min-height: 440px; margin: 28px 0; overflow: hidden; border-radius: 20px; background: linear-gradient(160deg, var(--surface-2), color-mix(in srgb, var(--accent) 22%, var(--surface-2))); }
.a-post__play { position: absolute; left: 50%; top: 42%; display: grid; place-items: center; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); }
.a-post__duration { position: absolute; right: 20px; top: 20px; padding: 4px 14px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 75%, transparent); font-size: calc(24px * var(--fit, 1)); font-weight: 700; font-variant-numeric: tabular-nums; }
.a-post__video figcaption { display: grid; gap: 8px; padding: 28px 36px; background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 85%, transparent) 40%); }
.a-post__scene { color: var(--ink-muted); font-size: calc(24px * var(--fit, 1)); font-style: italic; }
.a-post__caption { font-size: calc(38px * var(--fit, 1)); line-height: 1.35; font-weight: 600; }
.a-post__actions { display: flex; gap: 56px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: calc(24px * var(--fit, 1)); font-variant-numeric: tabular-nums; }
.a-post__actions > span { display: inline-flex; gap: 10px; align-items: center; }

.a-console { width: 1520px; overflow: hidden; background: #0E1317; color: #E6EDF2; border-radius: 16px; box-shadow: var(--shadow); font-family: var(--font-mono); }
.a-console__bar { display: flex; gap: 16px; align-items: center; padding: 16px 32px; background: #1B242C; color: #A9B7C2; font-family: var(--font); font-size: calc(24px * var(--fit, 1)); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.a-console .a-time { color: #A9B7C2; }
.a-console__title { margin: 28px 40px 12px; color: #FFFFFF; font-family: var(--font); font-size: calc(44px * var(--fit, 1)); line-height: 1.2; }
.a-console__lines { display: grid; gap: 10px; margin: 0; padding: 12px 40px 36px; list-style: none; font-size: calc(30px * var(--fit, 1)); line-height: 1.4; }
.a-console__lines li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; }
.a-console__ts { color: #7FB4D0; }
.a-console .a-reliability { margin: 0 40px 28px; color: #E0B160; }

.a-report { padding: 0; }
.a-report__band { display: flex; gap: 16px; align-items: center; padding: 20px 48px; background: var(--accent); color: var(--on-accent); font-size: calc(26px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.a-report__band .a-time { color: var(--on-accent); }
.a-report__source, .a-report__meta { margin: 24px 48px 0; font-size: calc(28px * var(--fit, 1)); color: var(--ink-muted); }
.a-report__title { margin: 20px 48px 12px; font-size: calc(50px * var(--fit, 1)); line-height: 1.15; }
.a-report__body { margin: 0 48px 36px; font-size: calc(36px * var(--fit, 1)); line-height: 1.45; }

.a-letter { width: 1240px; padding: 56px 80px; background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); }
.a-letter__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 24px; border-bottom: 2px solid var(--line); }
.a-letter__crest { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--ink); color: var(--ink); }
.a-letter__from { font-size: calc(28px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-align: right; max-width: 70%; }
.a-letter__date { margin: 24px 0; font-size: calc(28px * var(--fit, 1)); color: var(--ink-muted); }
.a-letter__re { margin: 0 0 20px; font-size: calc(36px * var(--fit, 1)); font-weight: 700; }
.a-letter__body { margin: 0; font-size: calc(34px * var(--fit, 1)); line-height: 1.5; }
.a-letter__sign { width: 320px; margin: 48px 0 0; border-top: 2px solid var(--ink-muted); }

.a-ransom { width: 1480px; overflow: hidden; background: var(--surface); border: 3px solid var(--danger); border-radius: 12px; }
.a-ransom__bar { display: flex; gap: 16px; align-items: center; padding: 14px 28px; background: var(--danger-soft); color: var(--danger); font-family: var(--font-mono); font-size: calc(26px * var(--fit, 1)); font-weight: 700; }
.a-ransom__text { margin: 0; padding: 36px 48px; font-family: var(--font-mono); font-size: calc(32px * var(--fit, 1)); line-height: 1.5; white-space: pre-wrap; }

.a-status__head { display: flex; align-items: baseline; font-size: calc(32px * var(--fit, 1)); }
.a-status__banner { display: flex; gap: 16px; align-items: center; margin: 24px 0; padding: 20px 28px; background: var(--warn-soft); border-left: 8px solid var(--warn); font-size: calc(38px * var(--fit, 1)); font-weight: 600; }
.a-status__banner .icon { color: var(--warn); }
.a-status__body { margin: 0; font-size: calc(34px * var(--fit, 1)); line-height: 1.45; }
/* "Down" shares the danger hue with "compromised", so it differs in shape too: a hollow ring. */
.c-st-down circle { fill: var(--bg); stroke: var(--c); stroke-width: 6; }

/* ---- Branching (gamebook) slides ------------------------------------------------------------------------- */
/* The page number is the gamebook motif: large, quiet, set apart from the story. */
.s-page { display: grid; grid-template-columns: 380px 1fr; gap: 96px; align-items: center; }
.s-page__side { display: grid; gap: 48px; align-content: center; }
.s-page__emblem { color: var(--accent); opacity: 0.16; }
.s-page__emblem .emblem-svg { width: 220px; height: 220px; }
.s-page .s-story { font-size: calc(48px * var(--fit, 1)); }
.s-page .s-story--long { font-size: calc(40px * var(--fit, 1)); }
.s-page .s-narrative { line-height: 1.42; }
.s-page__num {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding-top: 8px;
  border-top: 6px solid var(--accent);
  font-size: calc(150px * var(--fit, 1));
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.s-page__mark { font-size: 0.5em; font-weight: 500; color: var(--accent); }
.s-page__body { min-width: 0; }
.s-page__because {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 28px;
  padding: 16px 24px;
  border-left: 6px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-soft);
  font-size: calc(32px * var(--fit, 1));
}
.s-page__because .icon { flex: none; margin-top: 4px; color: var(--warn); }

.s-choice { display: flex; flex-direction: column; }
.s-choice__q { max-width: 1500px; }
.s-paths { list-style: none; margin: 16px 0 24px; padding: 0; display: grid; gap: 20px; }
.s-path {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 22px 32px 22px 22px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  font-size: calc(38px * var(--fit, 1));
  line-height: 1.3;
  animation: s-rise 320ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: opacity var(--dur, 200ms) var(--ease), border-color var(--dur, 200ms) var(--ease), background-color var(--dur, 200ms) var(--ease);
}
.s-path__key {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: calc(40px * var(--fit, 1));
  font-weight: 700;
}
.s-path__turn {
  font-size: calc(26px * var(--fit, 1));
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.s-path.is-picked { border-color: var(--accent); background: var(--accent-soft); animation: s-pick 420ms var(--ease) both; }
.s-path.is-dimmed { opacity: 0.38; animation: none; }
@keyframes s-pick { 0% { transform: scale(1); } 40% { transform: scale(1.015); } 100% { transform: scale(1); } }
.s-choice__hint { margin-top: auto; }

.s-ending { display: flex; flex-direction: column; }
.s-ending__label { max-width: 1500px; }
.s-ending__summary { margin-bottom: 40px; }
.s-grades { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 0 0 28px; padding: 0; }
.s-grade {
  padding: 18px 12px;
  border-radius: 12px;
  border-top: 8px solid var(--line);
  background: var(--surface);
  text-align: center;
  font-size: calc(28px * var(--fit, 1));
  color: var(--ink-muted);
}
.s-grade.is-reached { color: var(--ink); font-weight: 700; background: var(--surface-2); }
.s-grade--1.is-reached { border-top-color: var(--ok); }
.s-grade--2.is-reached { border-top-color: var(--info); }
.s-grade--3.is-reached { border-top-color: var(--warn); }
.s-grade--4.is-reached, .s-grade--5.is-reached { border-top-color: var(--danger); }

.s-debrief--branching { display: flex; flex-direction: column; }
.s-routemap { flex: 1; min-height: 0; display: flex; align-items: center; margin: 8px 0 16px; }
.s-routemap > svg { width: 100%; max-height: 100%; }
.s-debrief__lessons { margin-bottom: 16px; }

.s-rail--branching { gap: 40px; }
.s-rail__page { font-size: 30px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.s-rail__choices { flex: 1; }

/* Route map (stage debrief and operator debrief). */
.routemap { display: block; overflow: visible; }
.rm-edge { fill: none; stroke: var(--line); stroke-width: 3; }
.rm-edge--route { stroke: var(--accent); stroke-width: 7; stroke-linecap: round; animation-delay: calc(var(--i, 0) * 80ms); }
.rm-node .rm-mark { fill: var(--surface-2); stroke: var(--line-strong, var(--line)); stroke-width: 2; }
.rm-node.is-visited .rm-mark { fill: var(--accent); stroke: var(--accent); }
.rm-node.is-current .rm-mark { stroke: var(--ink); stroke-width: 5; }
.rm-node--ending .rm-mark { fill: var(--surface); stroke-width: 4; }
.rm-node--ending.rm-tone-ok .rm-mark { stroke: var(--ok); }
.rm-node--ending.rm-tone-info .rm-mark { stroke: var(--info); }
.rm-node--ending.rm-tone-warn .rm-mark { stroke: var(--warn); }
.rm-node--ending.rm-tone-danger .rm-mark { stroke: var(--danger); }
.rm-node--ending.is-visited.rm-tone-ok .rm-mark { fill: var(--ok); }
.rm-node--ending.is-visited.rm-tone-info .rm-mark { fill: var(--info); }
.rm-node--ending.is-visited.rm-tone-warn .rm-mark { fill: var(--warn); }
.rm-node--ending.is-visited.rm-tone-danger .rm-mark { fill: var(--danger); }
.rm-num { fill: var(--ink-muted); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rm-node.is-visited .rm-num { fill: var(--on-accent); }
.rm-node--ending .rm-num { fill: var(--ink); }
.rm-label { fill: var(--ink-muted); font-size: 22px; font-weight: 600; }
.rm-node.is-visited .rm-label { fill: var(--ink); }
.stage--preview .s-path, .stage--preview .s-path.is-picked { animation: none; }

/* Ending: text on the left, a seal in the grade's tone on the right. */
.s-ending { display: grid; grid-template-columns: 1fr 420px; gap: 80px; align-items: center; }
.s-ending__text { display: flex; flex-direction: column; min-width: 0; }
.s-ending__seal {
  --tone: var(--warn);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 14px solid var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, var(--bg));
  animation: s-seal 600ms var(--ease) both;
}
.s-ending--1 .s-ending__seal { --tone: var(--ok); }
.s-ending--2 .s-ending__seal { --tone: var(--info); }
.s-ending--3 .s-ending__seal { --tone: var(--warn); }
.s-ending--4 .s-ending__seal, .s-ending--5 .s-ending__seal { --tone: var(--danger); }
.s-ending__pips { display: flex; gap: 14px; }
.s-ending__pips i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--tone); }
.s-ending__pips i.is-on { background: var(--tone); }
.s-ending__word { font-size: calc(52px * var(--fit, 1)); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
@keyframes s-seal { from { opacity: 0; transform: scale(0.92) rotate(-6deg); } }
.stage--preview .s-ending__seal { animation: none; }

/* ============================================================================================
   Custom (builder) slides — block layouts at canvas scale, using the stage tokens
   ============================================================================================ */
.s-custom { position: relative; height: 100%; }
.s-custom__timer { position: absolute; right: 0; top: 0; }
.cs { display: flex; flex-direction: column; justify-content: flex-start; gap: calc(28px * var(--fit, 1)); height: 100%; }
.cs--title { justify-content: center; padding-bottom: 80px; }
.cs--section { justify-content: center; }
.cs--section .cs-h1 { font-size: calc(96px * var(--fit, 1)); }
.cs--center { justify-content: center; align-items: center; text-align: center; }
.cs--twist { justify-content: center; }
.cs--twist .cs-kicker { color: var(--on-accent); opacity: 0.85; }
.cs--title .cs-h1 { font-size: calc(104px * var(--fit, 1)); }
.cs-h1 { margin: 0; font-size: calc(76px * var(--fit, 1)); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
.cs-h2 { margin: 0; font-size: calc(52px * var(--fit, 1)); font-weight: 600; line-height: 1.2; }
.cs-kicker { margin: 0; font-size: calc(30px * var(--fit, 1)); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.cs-text { margin: 0; max-width: 1560px; line-height: 1.45; }
.cs-text--s { font-size: calc(32px * var(--fit, 1)); color: var(--ink-muted); }
.cs-text--m { font-size: calc(40px * var(--fit, 1)); }
.cs-text--l { font-size: calc(48px * var(--fit, 1)); }
.cs-center { text-align: center; margin-left: auto; margin-right: auto; }
.cs-list { margin: 0; padding-left: 1.2em; display: grid; gap: calc(16px * var(--fit, 1)); font-size: calc(42px * var(--fit, 1)); line-height: 1.35; max-width: 1560px; }
.cs-list--numbered { padding-left: 1.4em; }
.cs-list li::marker { color: var(--accent); font-weight: 700; }
.cs-quote { margin: 0; max-width: 1500px; }
.cs-quote__text { margin: 0; padding-left: 40px; border-left: 8px solid var(--accent); font-size: calc(60px * var(--fit, 1)); line-height: 1.25; font-weight: 500; }
.cs--center .cs-quote__text { border-left: 0; padding-left: 0; }
.cs-quote__by { margin-top: 24px; padding-left: 48px; font-size: calc(30px * var(--fit, 1)); color: var(--ink-muted); }
.cs--center .cs-quote__by { padding-left: 0; }
.cs-callout { display: flex; gap: 28px; align-items: flex-start; max-width: 1560px; padding: 32px 40px; border-radius: 20px; background: var(--info-soft); border-left: 10px solid var(--info); }
.cs-callout .icon { flex: none; color: var(--info); }
.cs-callout__text { margin: 0; font-size: calc(40px * var(--fit, 1)); line-height: 1.4; }
.cs-callout--warn { background: var(--warn-soft); border-left-color: var(--warn); }
.cs-callout--warn .icon { color: var(--warn); }
.cs-callout--danger { background: var(--danger-soft); border-left-color: var(--danger); }
.cs-callout--danger .icon { color: var(--danger); }
.cs-callout--ok { background: var(--ok-soft); border-left-color: var(--ok); }
.cs-callout--ok .icon { color: var(--ok); }
.cs-icons { display: flex; flex-wrap: wrap; gap: 48px 96px; justify-content: center; align-items: flex-start; margin-top: 24px; }
.cs--center .cs-icons { margin-top: 0; }
.cs-icon { margin: 0; display: grid; justify-items: center; gap: 20px; max-width: 420px; text-align: center; }
.cs-icon__art { display: grid; place-items: center; width: 180px; height: 180px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.cs-icon--warn .cs-icon__art { background: var(--warn-soft); color: var(--warn); }
.cs-icon--danger .cs-icon__art { background: var(--danger-soft); color: var(--danger); }
.cs-icon--ok .cs-icon__art { background: var(--ok-soft); color: var(--ok); }
.cs-icon__label { font-size: calc(38px * var(--fit, 1)); font-weight: 600; line-height: 1.25; }
.cs-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 32px; }
.cs-kpi__tile { display: grid; gap: 12px; padding: 40px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); border-top: 8px solid var(--info); }
.cs-kpi__tile--warn { border-top-color: var(--warn); }
.cs-kpi__tile--danger { border-top-color: var(--danger); }
.cs-kpi__tile--ok { border-top-color: var(--ok); }
.cs-kpi__value { font-size: calc(104px * var(--fit, 1)); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.cs-kpi__label { font-size: calc(32px * var(--fit, 1)); color: var(--ink-muted); }
.cs-timeline { list-style: none; margin: 0; padding: 0 0 0 36px; display: grid; gap: calc(24px * var(--fit, 1)); border-left: 4px solid var(--line); }
.cs-timeline li { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 32px; font-size: calc(40px * var(--fit, 1)); line-height: 1.35; }
.cs-timeline li::before { content: ""; position: absolute; left: -48px; top: 0.4em; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); }
.cs-timeline__time { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.cs-options { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(20px * var(--fit, 1)); max-width: 1600px; }
.cs-options li { display: grid; grid-template-columns: 88px 1fr; gap: 28px; align-items: center; padding: 24px 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.cs-options__key { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 36px; font-weight: 700; }
.cs-options__text { font-size: calc(40px * var(--fit, 1)); line-height: 1.35; }
.cs-image { margin: 0; display: grid; place-items: center; min-height: 0; flex: 1 1 auto; }
.cs-image img { max-width: 100%; max-height: 640px; border-radius: 16px; object-fit: contain; }
.cs-image--empty { min-height: 360px; gap: 16px; border: 4px dashed var(--line-strong); border-radius: 24px; color: var(--ink-muted); font-size: 32px; }
.cs-divider { width: 100%; height: 0; margin: 8px 0; border: 0; border-top: 3px solid var(--line); }

/* Builder edit affordances (only present inside the builder's editable canvas). */
.cs-editable { outline: none; border-radius: 8px; transition: box-shadow 120ms; min-width: 40px; }
.cs-editable:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.cs-editable:focus { box-shadow: 0 0 0 4px var(--accent); }
.cs-editable:empty::before { content: attr(data-placeholder); color: var(--ink-muted); opacity: 0.6; }
.cs-block { position: relative; border-radius: 12px; }
.cs-block.is-selected { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); }

/* ---- Played challenge or interrupt: its own slide, slammed in like a rubber stamp ---- */
.s-played { position: relative; display: grid; place-items: center; height: 100%; }
.s-played__card { position: relative; width: 1300px; max-width: 100%; padding: 64px 80px; background: var(--surface); border: 1px solid var(--line); border-top: 12px solid var(--accent); border-radius: 24px; box-shadow: var(--shadow); }
.s-played--interrupt .s-played__card { border-top-color: var(--warn); }
.s-played__kicker { display: flex; gap: 16px; align-items: center; margin: 0 0 24px; font-size: 28px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.s-played--interrupt .s-played__kicker { color: var(--warn); }
.s-played__title { margin: 0 0 24px; font-size: calc(76px * var(--fit, 1)); line-height: 1.08; }
.s-played__text { margin: 0; font-size: calc(44px * var(--fit, 1)); line-height: 1.4; color: var(--ink); }
.s-played__choice { margin: 32px 0 0; padding: 24px 32px; border-radius: 16px; background: var(--surface-2); font-size: calc(40px * var(--fit, 1)); line-height: 1.35; font-weight: 700; }
/* A reopened decision: the question and its options, smaller, under the interrupt. */
.s-played__again { margin-top: 28px; }
.s-played__question { margin: 0 0 14px; font-size: calc(34px * var(--fit, 1)); font-weight: 700; color: var(--ink); }
.s-played__options { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.s-played__options li { display: flex; align-items: baseline; gap: 16px; padding: 14px 22px; border: 2px solid var(--line, var(--surface-2)); border-radius: 12px; font-size: calc(30px * var(--fit, 1)); line-height: 1.35; color: var(--ink); }
.s-played__key { flex: none; min-width: 1.6em; font-weight: 800; color: var(--warn); }
.s-played__ask { display: block; margin-bottom: 8px; font-size: 26px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
/* The stamp: a big tilted label in a double border, top right of the card. */
.s-played__stamp { position: absolute; top: 40px; right: 120px; z-index: 2; margin: 0; padding: 12px 36px; background: var(--surface); border: 8px double var(--danger); border-radius: 14px; color: var(--danger); font-size: 64px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(-12deg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.s-played--interrupt .s-played__stamp { border-color: var(--warn); color: var(--warn); }
.stage.is-entering .s-played__stamp { animation: s-stamp 520ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.stage.is-entering .s-played__card { animation: s-stamp-shake 420ms ease-out 360ms both; }
@keyframes s-stamp {
  0% { transform: rotate(-24deg) scale(3.2); opacity: 0; }
  60% { transform: rotate(-10deg) scale(0.92); opacity: 1; }
  80% { transform: rotate(-13deg) scale(1.04); }
  100% { transform: rotate(-12deg) scale(1); opacity: 1; }
}
@keyframes s-stamp-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-10px, 4px) rotate(-0.4deg); }
  40% { transform: translate(8px, -4px) rotate(0.3deg); }
  60% { transform: translate(-5px, 2px); }
  80% { transform: translate(3px, -1px); }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-entering .s-played__stamp, .stage.is-entering .s-played__card { animation: none; }
}
