/* ============================================================
   MOMENTIC STORY TEMPLATE
   Vertical, tap-through, Spotify-Wrapped-style data narrative.
   Layered on colors_and_type.css for tokens.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background:
    radial-gradient(ellipse at top, rgba(255,36,23,0.05), transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--primary);
  min-height: 100vh;
  overflow: hidden;
}

/* The page chrome around the stage. */
.viewer {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
}
.viewer-meta {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 20px 30px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 10;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted);
  pointer-events: none;
}
.viewer-meta .brand {
  display: inline-flex; align-items: center; gap: 8px;
  pointer-events: auto;
}
.viewer-meta .brand img { height: 18px; }
.viewer-meta .counter { letter-spacing: 0.12em; }

/* ============================================================
   STAGE — 9:16 phone-shaped canvas, scaled to viewport via JS.
   The inner geometry stays 480 × 854 so component code does not
   need to be responsive.
   ============================================================ */
.stage-wrap {
  width: 480px; height: 854px;
  transform-origin: center center;
}
.stage {
  position: relative;
  width: 100%; height: 100%;
  background: var(--story-bg, var(--bg));
  color: var(--story-fg, var(--fg));
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(31,32,27,0.18), 0 4px 16px rgba(31,32,27,0.08);
  transition: background var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard);
}

/* Theme variants */
.stage.theme-paper { --story-bg: var(--bg); --story-fg: var(--fg); --story-muted: var(--fg-muted); }
.stage.theme-cream { --story-bg: var(--bg-cream); --story-fg: var(--fg); --story-muted: var(--fg-muted); }
.stage.theme-dark  { --story-bg: var(--bg-dark); --story-fg: var(--fg-on-dark); --story-muted: var(--fg-on-dark-muted); }

/* ============================================================
   CHROME — progress bar, beat counter, share, nav
   ============================================================ */

.progress {
  position: absolute; top: 14px; left: 28px; right: 28px;
  display: flex; gap: 5px;
  z-index: 8;
}
.progress-seg {
  flex: 1; height: 3px; border-radius: 999px;
  background: rgba(31,32,27,0.18);
  overflow: hidden;
}
.stage.theme-dark .progress-seg { background: rgba(244,245,238,0.22); }
.progress-seg .fill {
  height: 100%; width: 0%; background: var(--story-fg, var(--fg));
  transition: width var(--dur-fast) linear;
}
.progress-seg.done .fill { width: 100%; }
.progress-seg.active .fill {
  background: var(--brand);
  width: var(--p, 0%);
  transition: width 80ms linear;
}

/* Lift interactive controls above the edge tap-zones so chip/slider
   clicks aren't intercepted by the nav strips. */
.beat .explore-chips,
.beat .scenario-slider,
.beat .scenario-output,
.beat .cta-row,
.beat .explore-readout,
.beat .stat-supports,
.beat .stat-grid,
.beat .stat-support-row,
.beat .list-items,
.beat .compare-pair {
  position: relative;
  z-index: 5;
}

/* ============================================================
   PERSISTENT STAGE LOGO — Momentic mark in top-left of every beat
   ============================================================ */
.stage-logo {
  position: absolute;
  top: 28px; left: 28px;
  z-index: 8;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--story-fg);
  cursor: pointer;
}
.stage-logo .mark {
  width: 26px; height: 26px;
  display: block;
}
.stage-logo .stage-counter {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--story-muted);
  padding-left: 4px;
  border-left: 1px solid currentColor;
  border-left-color: var(--story-muted);
  opacity: 0.7;
}
.stage.theme-dark .stage-logo .mark { filter: invert(0); }

/* Shift beat content down so it clears the top chrome (progress + logo) */
.beat { padding-top: 108px; }
.dir-notebook .beat { padding-top: 112px; }
.share-btn {
  position: absolute; top: 26px; right: 28px;
  z-index: 8;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--story-fg);
  border: 1px solid var(--story-fg);
  font-family: var(--utility); font-weight: 600; font-size: 11px;
  padding: 5px 10px; border-radius: 999px;
  cursor: pointer;
  opacity: 0.6; transition: opacity var(--dur-fast);
}
.share-btn:hover { opacity: 1; }
.stage.theme-dark .share-btn { border-color: var(--fg-on-dark); color: var(--fg-on-dark); }

.toast {
  position: absolute; bottom: 76px; left: 50%;
  transform: translate(-50%, 12px);
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  background: var(--story-fg); color: var(--story-bg);
  padding: 8px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base);
  z-index: 9;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Tap zones — narrow edge strips so the middle of the stage stays
   clickable for interactive elements (chips, sliders, CTAs). */
.tap-zones {
  position: absolute; top: 0; bottom: 0;
  z-index: 2;
  width: 56px;
  pointer-events: auto;
}
.tap-zones.left  { left: 0;  cursor: w-resize; }
.tap-zones.right { right: 0; cursor: e-resize; }
.tap-zones:hover ~ .nav-hint { opacity: 0.5; }

.nav-hint {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 12px;
  color: var(--story-muted);
  opacity: 0; transition: opacity var(--dur-fast);
  pointer-events: none;
  z-index: 3;
}
.nav-hint-left  { left: 18px; }
.nav-hint-right { right: 18px; }

/* play / pause control bottom center */
.play-ctl {
  position: absolute; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--story-muted);
  border: none;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  cursor: pointer;
}
.play-ctl:hover { color: var(--story-fg); }

/* ============================================================
   BEAT CONTAINER — shared
   ============================================================ */

.beat {
  position: absolute; inset: 0;
  padding: 64px 28px 64px;
  display: flex; flex-direction: column;
  animation: beatIn var(--dur-slow) var(--ease-out);
}
@keyframes beatIn {
  from { transform: translateY(10px); }
  to   { transform: translateY(0); }
}
.beat-eyebrow {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--story-muted);
  margin-bottom: 18px;
}
.beat-title {
  font-family: var(--primary-heading); font-weight: 900;
  line-height: 0.98; letter-spacing: -0.045em;
  color: var(--story-fg); margin: 0;
  text-wrap: balance;
}
.beat-body {
  font-family: var(--primary);
  line-height: 1.55; letter-spacing: 0.015em;
  color: var(--story-fg); margin: 0;
  text-wrap: pretty;
}
.beat-source {
  font-family: var(--mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--story-muted);
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid currentColor;
  opacity: 0.6;
}

/* ============================================================
   DIRECTION A — FINDINGS
   Full-bleed hero per beat. Huge type. One element per beat.
   ============================================================ */

.dir-findings .beat-title { font-size: 56px; }
.dir-findings .beat-body  { font-size: 16px; max-width: 36ch; margin-top: 18px; }

/* OPEN beat — grid layout: title + mascot in row 1, body fills below.
   Mascot sits in a flex cell, not absolutely positioned. */
.dir-findings .beat-open {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 18px;
  padding: 76px 28px 64px;
}
.dir-findings .beat-open .open-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.dir-findings .beat-open .open-title-col {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.dir-findings .beat-open .beat-title { font-size: 52px; line-height: 0.98; margin: 0; }
.dir-findings .beat-open .open-mascot {
  width: 140px; height: auto;
  display: block;
  align-self: start;
  justify-self: end;
  animation: floaty 6s ease-in-out infinite;
}
.dir-findings .beat-open .beat-body { max-width: 28ch; margin-top: 0; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* FRAME / CONTEXT */
.dir-findings .beat-frame { justify-content: center; }
.dir-findings .beat-frame .beat-title { font-size: 56px; }

/* STAT */
.dir-findings .beat-stat { justify-content: space-between; }
.dir-findings .stat-big {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 200px; line-height: 0.88; letter-spacing: -0.06em;
  color: var(--brand); margin: 0;
  text-align: left;
}
.dir-findings .stat-big sup {
  font-size: 0.45em; vertical-align: top; color: var(--brand);
  letter-spacing: -0.04em; margin-left: -8px;
}
.dir-findings .stat-caption {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 18px; letter-spacing: -0.02em; line-height: 1.2;
  margin: 8px 0 0;
}
.dir-findings .stat-supports {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-top: 24px;
}
.dir-findings .stat-support {
  border-top: 1px solid currentColor;
  padding-top: 10px;
}
.dir-findings .stat-support .v {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 36px; letter-spacing: -0.035em; line-height: 1;
  color: var(--brand);
}
.dir-findings .stat-support .l {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--story-muted); margin-top: 4px;
}

/* CHART */
.dir-findings .beat-chart .beat-title { font-size: 36px; max-width: 12ch; }
.dir-findings .beat-chart .chart-wrap { margin-top: 32px; flex: 1; }

/* COMPARE */
.dir-findings .beat-compare .beat-title { font-size: 36px; max-width: 14ch; }
.dir-findings .compare-pair {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; margin-top: 32px;
}
.dir-findings .compare-cell {
  padding: 18px 16px;
  border-top: 1px solid currentColor;
}
.dir-findings .compare-cell + .compare-cell {
  border-left: 1px solid currentColor;
}
.dir-findings .compare-cell .label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--story-muted);
}
.dir-findings .compare-cell .value {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 72px; letter-spacing: -0.05em; line-height: 0.95;
  margin: 12px 0 8px;
  color: var(--brand);
}
.dir-findings .compare-cell .cap {
  font-family: var(--primary); font-size: 12px; line-height: 1.4;
  color: var(--story-fg); margin: 0;
}

/* QUOTE */
.dir-findings .beat-quote {
  justify-content: center;
}
.dir-findings .beat-quote .beat-title {
  font-size: 52px;
  font-family: var(--primary-heading);
  letter-spacing: -0.045em;
}
.dir-findings .beat-quote .attribution {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--story-muted); margin-top: 24px;
}
.dir-findings .beat-quote .beat-body {
  font-size: 16px; max-width: 28ch; margin-top: 24px;
}

/* LIST */
.dir-findings .beat-list .beat-title { font-size: 36px; max-width: 14ch; }
.dir-findings .list-items {
  display: flex; flex-direction: column;
  margin-top: 28px; gap: 0;
}
.dir-findings .list-item {
  display: grid; grid-template-columns: 32px 1fr;
  gap: 16px; padding: 16px 0;
  border-top: 1px solid currentColor;
  font-family: var(--primary); font-size: 15px; line-height: 1.5;
}
.dir-findings .list-item:last-child { border-bottom: 1px solid currentColor; }
.dir-findings .list-item .n {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--story-muted);
  padding-top: 2px;
}

/* CLOSE */
.dir-findings .beat-close {
  justify-content: space-between;
}
.dir-findings .beat-close .beat-title { font-size: 56px; }
.dir-findings .beat-close .cta-row {
  display: flex; gap: 12px; align-items: center;
  margin-top: 18px;
}
.dir-findings .beat-close .cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: var(--fg-on-dark);
  padding: 12px 18px; border-radius: 4px;
  font-family: var(--utility); font-weight: 600; font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.dir-findings .beat-close .cta:hover { background: var(--brand-hover); }
/* CLOSE beat — mascot in flow, sits between body and CTA */
.dir-findings .beat-close { display: grid; grid-template-rows: auto auto 1fr auto; gap: 16px; }
.dir-findings .beat-close .close-mascot {
  width: 130px; height: auto;
  display: block; align-self: end; justify-self: end;
  animation: floaty 6s ease-in-out infinite;
}

/* ============================================================
   DIRECTION B — NOTEBOOK
   Denser. Editorial column. Eyebrow + chart + body + footnotes.
   ============================================================ */

.dir-notebook .beat { padding: 70px 28px 64px; }
.dir-notebook .beat-title { font-size: 30px; letter-spacing: -0.025em; line-height: 1.05; }
.dir-notebook .beat-body  { font-size: 14px; line-height: 1.6; margin-top: 14px; }

.dir-notebook .beat-open { justify-content: flex-start; }
.dir-notebook .beat-open .beat-title { font-size: 44px; line-height: 1; }
.dir-notebook .beat-open .meta-block {
  margin-top: 36px; padding-top: 28px;
  border-top: 1px solid currentColor;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px;
}
.dir-notebook .beat-open .meta-block .lbl {
  font-family: var(--mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--story-muted);
}
.dir-notebook .beat-open .meta-block .val {
  font-family: var(--primary); font-size: 13px;
  margin-top: 4px;
}
/* OPEN beat (notebook) — mascot in flow, in the meta block area */
.dir-notebook .beat-open .open-head {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
}
.dir-notebook .beat-open .open-mascot {
  width: 96px; height: auto;
  display: block; align-self: start; justify-self: end;
  animation: floaty 6s ease-in-out infinite;
}

.dir-notebook .beat-stat .stat-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
  padding: 24px 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
.dir-notebook .stat-big {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 88px; line-height: 0.85; letter-spacing: -0.05em;
  color: var(--brand); margin: 0;
}
.dir-notebook .stat-caption {
  font-family: var(--primary); font-size: 13px; line-height: 1.45;
  margin: 12px 0 0;
}
.dir-notebook .stat-support-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  border-top: 1px dashed currentColor;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.dir-notebook .stat-support-row .v { color: var(--brand); font-size: 14px; }

.dir-notebook .beat-chart .chart-wrap {
  margin-top: 18px;
  padding: 16px 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.dir-notebook .beat-compare .compare-pair {
  display: flex; flex-direction: column;
  border-top: 1px solid currentColor;
  margin-top: 18px;
}
.dir-notebook .compare-cell {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid currentColor;
}
.dir-notebook .compare-cell .label {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--story-muted);
}
.dir-notebook .compare-cell .value {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 44px; letter-spacing: -0.04em; line-height: 1;
  color: var(--brand); margin: 0;
}
.dir-notebook .compare-cell .cap {
  grid-column: 1 / -1;
  font-family: var(--primary); font-size: 12px;
  color: var(--story-fg); margin: 0;
  opacity: 0.75;
}

.dir-notebook .beat-quote {
  justify-content: flex-start;
}
.dir-notebook .beat-quote .beat-title { font-size: 32px; line-height: 1.1; }
.dir-notebook .beat-quote .attribution {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--story-muted); margin-top: 20px;
  padding-top: 14px; border-top: 1px solid currentColor;
}

.dir-notebook .beat-list .list-items {
  display: flex; flex-direction: column;
  border-top: 1px solid currentColor;
  margin-top: 18px;
}
.dir-notebook .list-item {
  display: grid; grid-template-columns: 28px 1fr;
  gap: 14px; padding: 14px 0;
  border-bottom: 1px solid currentColor;
  font-family: var(--primary); font-size: 14px; line-height: 1.45;
}
.dir-notebook .list-item .n {
  font-family: var(--mono); font-size: 10px;
  color: var(--story-muted);
  padding-top: 4px;
}

.dir-notebook .beat-close {
  justify-content: space-between;
}
.dir-notebook .beat-close .beat-title { font-size: 40px; }
.dir-notebook .beat-close .cta-row {
  display: flex; gap: 10px; align-items: center; margin-top: 16px;
}
.dir-notebook .beat-close .cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: var(--fg-on-dark);
  padding: 10px 14px; border-radius: 4px;
  font-family: var(--utility); font-weight: 600; font-size: 13px;
  text-decoration: none; white-space: nowrap;
}
/* CLOSE beat (notebook) — mascot in flow */
.dir-notebook .beat-close .close-mascot {
  width: 88px; height: auto;
  display: block; align-self: end; justify-self: end;
  animation: floaty 6s ease-in-out infinite;
}

/* ============================================================
   CHARTS
   ============================================================ */

.bars-chart { display: flex; flex-direction: column; gap: 12px; }
.bars-chart .bar-row {
  display: grid; grid-template-columns: 1fr; gap: 6px;
}
.bars-chart .bar-label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--story-fg); line-height: 1.3;
  white-space: pre-wrap;
}
.bars-chart .bar-track {
  position: relative;
  height: 18px;
  background: transparent;
  border-bottom: 1px solid currentColor;
}
.bars-chart .bar-fill {
  position: absolute; left: 0; bottom: 0;
  height: 100%;
  background: var(--brand);
  width: 0;
  animation: barGrow var(--dur-slow) var(--ease-out) forwards;
}
@keyframes barGrow { to { width: var(--w, 0%); } }
.bars-chart .bar-value {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px;
  color: var(--story-bg, var(--bg));
  mix-blend-mode: difference;
}

/* ============================================================
   PLAY OVERLAY (initial tap-to-start scrim)
   ============================================================ */
.start-scrim {
  position: absolute; inset: 0;
  background: rgba(31,32,27,0.04);
  display: grid; place-items: center;
  z-index: 7;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base);
}
.start-scrim.visible { opacity: 1; pointer-events: auto; }
.start-scrim .scrim-cta {
  background: var(--story-fg);
  color: var(--story-bg);
  padding: 12px 22px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em;
}

/* ============================================================
   DENSITY MODES
   ============================================================ */

/* Spacious — more breathing room, larger type, looser padding */
.stage.density-spacious .beat { padding-top: 118px; padding-bottom: 76px; padding-left: 28px; padding-right: 28px; }
.stage.density-spacious .beat-eyebrow { margin-bottom: 28px; }
.stage.density-spacious.dir-findings .beat-title { font-size: 62px; line-height: 0.95; }
.stage.density-spacious.dir-findings .beat-body { font-size: 17px; line-height: 1.6; margin-top: 24px; }
.stage.density-spacious.dir-findings .stat-big { font-size: 220px; }
.stage.density-spacious.dir-findings .compare-cell .value { font-size: 80px; }
.stage.density-spacious.dir-notebook .beat-title { font-size: 34px; }
.stage.density-spacious.dir-notebook .beat-body { font-size: 15px; line-height: 1.7; }
.stage.density-spacious.dir-notebook .stat-big { font-size: 100px; }

/* Dense — tighter, smaller, fills the frame */
.stage.density-dense .beat { padding-top: 92px; padding-bottom: 56px; padding-left: 28px; padding-right: 28px; }
.stage.density-dense .beat-eyebrow { margin-bottom: 12px; }
.stage.density-dense.dir-findings .beat-title { font-size: 48px; }
.stage.density-dense.dir-findings .beat-body { font-size: 14px; line-height: 1.5; margin-top: 14px; }
.stage.density-dense.dir-findings .stat-big { font-size: 168px; }
.stage.density-dense.dir-findings .compare-cell .value { font-size: 60px; }
.stage.density-dense.dir-findings .list-item { padding: 10px 0; font-size: 13.5px; }
.stage.density-dense.dir-notebook .beat-title { font-size: 26px; }
.stage.density-dense.dir-notebook .beat-body { font-size: 13px; line-height: 1.55; margin-top: 10px; }
.stage.density-dense.dir-notebook .stat-big { font-size: 72px; }
.stage.density-dense.dir-notebook .list-item { padding: 10px 0; font-size: 13px; }

/* ============================================================
   PALETTE MODES
   monochrome: brand orange as the only accent. Everything else
              is warm-black + warm-grays.
   full:      brings in alien green + lime yellow + coral as
              support accents on charts, lists, and stats.
   ============================================================ */

/* Monochrome (default) — brand orange is the only chromatic accent */
.stage.palette-monochrome { --acc-1: var(--brand); --acc-2: var(--brand); --acc-3: var(--brand); --acc-bg: var(--brand); }
.stage.palette-monochrome .stat-big,
.stage.palette-monochrome .stat-support .v,
.stage.palette-monochrome .compare-cell .value,
.stage.palette-monochrome .stat-support-row .v { color: var(--brand); }
.stage.palette-monochrome .bar-fill { background: var(--brand); }
.stage.palette-monochrome .bars-chart .bar-fill:nth-child(odd) { background: var(--brand); }

/* Full palette — orange + alien green + lime yellow + coral */
.stage.palette-full { --acc-1: #FF2417; --acc-2: #7AF58C; --acc-3: #E2F57A; --acc-bg: #FF736C; }
.stage.palette-full .stat-big { color: var(--acc-1); }
.stage.palette-full .stat-caption { color: var(--story-fg); }
.stage.palette-full .stat-support:nth-child(1) .v { color: var(--acc-1); }
.stage.palette-full .stat-support:nth-child(2) .v { color: var(--acc-2); }
.stage.palette-full .stat-support-row:nth-child(odd) .v { color: var(--acc-1); }
.stage.palette-full .stat-support-row:nth-child(even) .v { color: var(--acc-2); }
.stage.palette-full .compare-pair .compare-cell:nth-child(1) .value { color: var(--acc-1); }
.stage.palette-full .compare-pair .compare-cell:nth-child(2) .value { color: var(--acc-2); }

/* Bars cycle through palette colors in full mode */
.stage.palette-full .bars-chart .bar-row:nth-child(3n+1) .bar-fill { background: var(--acc-1); }
.stage.palette-full .bars-chart .bar-row:nth-child(3n+2) .bar-fill { background: var(--acc-2); }
.stage.palette-full .bars-chart .bar-row:nth-child(3n+3) .bar-fill { background: var(--acc-3); }

/* Theme-dark + full: green/yellow read better than orange on dark for accents */
.stage.theme-dark.palette-full .stat-big { color: var(--acc-3); }

/* Lists in full palette get a left-stripe color */
.stage.palette-full .list-item { border-left: 3px solid var(--acc-3); padding-left: 12px; margin-left: -3px; }
.stage.palette-full .list-item:nth-child(2) { border-left-color: var(--acc-2); }
.stage.palette-full .list-item:nth-child(3) { border-left-color: var(--acc-1); }
.stage.palette-full .list-item:nth-child(4) { border-left-color: var(--acc-bg); }

/* Quote tick mark in full palette becomes alien green */
.stage.palette-full .beat-quote .beat-title::first-letter { color: var(--acc-2); }

/* CTA on close beat in full palette keeps orange — brand is brand */

/* ============================================================
   INTERACTIVE BEAT TYPES
   ============================================================ */

/* "explore" beat — chip strip that filters a stat */
.beat-explore .explore-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 16px;
}
.explore-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent; color: var(--story-fg);
  cursor: pointer; opacity: 0.55;
  transition: opacity var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.explore-chip:hover { opacity: 0.85; }
.explore-chip.active {
  opacity: 1;
  background: var(--brand);
  color: var(--fg-on-dark);
  border-color: var(--brand);
}
.stage.palette-full .explore-chip.active { background: var(--acc-2); color: var(--bg-dark); border-color: var(--acc-2); }
.explore-readout {
  margin-top: 28px;
  padding: 24px 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
.explore-readout .stat-big {
  display: block;
  margin: 0;
  font-family: var(--primary-heading); font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--brand);
  transition: color var(--dur-base);
}
.stage.dir-findings .explore-readout .stat-big { font-size: 132px; }
.stage.dir-notebook .explore-readout .stat-big { font-size: 76px; }
.explore-readout .readout-cap {
  font-family: var(--primary); font-size: 14px; line-height: 1.5;
  margin: 12px 0 0;
}
.explore-explain {
  font-family: var(--primary); font-size: 13.5px; line-height: 1.55;
  margin: 18px 0 0;
  color: var(--story-fg); opacity: 0.85;
}

/* "scenario" beat — drag a slider, watch the stat */
.beat-scenario .scenario-slider {
  margin-top: 24px;
  padding: 18px 0 8px;
  border-top: 1px solid currentColor;
}
.scenario-slider .scenario-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--story-muted);
  margin-bottom: 10px;
}
.scenario-slider .scenario-meta .v { color: var(--brand); font-size: 14px; }
.scenario-slider input[type="range"] {
  width: 100%;
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
  height: 24px;
}
.scenario-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: currentColor; opacity: 0.4; border-radius: 999px;
}
.scenario-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: var(--brand);
  border-radius: 999px;
  margin-top: -9px;
  border: 2px solid var(--story-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.scenario-slider input[type="range"]::-moz-range-track {
  height: 4px; background: currentColor; opacity: 0.4; border-radius: 999px;
}
.scenario-slider input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--brand); border-radius: 999px;
  border: 2px solid var(--story-bg);
}
.scenario-output {
  margin-top: 18px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.scenario-output .cell { padding: 14px 0; border-top: 1px solid currentColor; }
.scenario-output .cell .l {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--story-muted);
}
.scenario-output .cell .v {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 44px; letter-spacing: -0.04em; line-height: 1;
  color: var(--brand); margin-top: 6px;
  transition: color var(--dur-base);
}
.stage.palette-full .scenario-output .cell:nth-child(2) .v { color: #7AF58C; }
.stage.theme-dark.palette-full .scenario-output .cell:nth-child(1) .v { color: #E2F57A; }

/* "walker"/stepper controls — shared by walker, graph, passage, centroid beats
   (un-scoped so any beat reusing these classes gets the styling) */
.walker-count {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 30px; letter-spacing: -0.03em; line-height: 1;
  color: var(--story-fg); margin-top: 18px;
}
.walker-count span { color: var(--story-muted); font-size: 0.6em; }
.walker-tabs { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.walker-tab {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid currentColor; background: transparent;
  color: var(--story-fg); cursor: pointer; opacity: 0.5;
  transition: opacity var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.walker-tab:hover { opacity: 0.8; }
.walker-tab.on { opacity: 1; background: var(--brand); color: var(--fg-on-dark); border-color: var(--brand); }
.stage.palette-full .walker-tab.on { background: var(--acc-2); color: var(--bg-dark); border-color: var(--acc-2); }
.walker-segs {
  display: flex; gap: 4px; margin-top: 14px; flex-wrap: nowrap;
}
.walker-seg {
  flex: 1; height: 5px; border-radius: 3px;
  background: currentColor; opacity: 0.16;
  transition: opacity var(--dur-fast), background var(--dur-fast);
}
.walker-seg.done { opacity: 1; background: var(--brand); }
.walker-seg.fork { margin-left: 12px; }
.stage.palette-full .walker-seg.branch.done { background: var(--acc-2); }
.walker-rail {
  display: flex; align-items: center; gap: 4px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.walker-dot {
  width: 14px; height: 4px; border-radius: 2px;
  background: currentColor; opacity: 0.18;
  transition: opacity var(--dur-fast), background var(--dur-fast);
}
.walker-dot.done { opacity: 1; background: var(--brand); }
.walker-fork-mark {
  font-family: var(--mono); font-size: 14px;
  color: var(--brand);
  padding: 0 6px;
}
.walker-body {
  margin-top: 24px;
  padding: 24px 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  position: relative; z-index: 5;
}
.walker-step-num {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--story-muted);
  margin-bottom: 10px;
}
.walker-step-title {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 26px; line-height: 1.1; letter-spacing: -0.025em;
  margin: 0 0 10px;
}
.stage.dir-findings .walker-step-title { font-size: 30px; }
.walker-step-body {
  font-family: var(--primary); font-size: 14px; line-height: 1.55;
  margin: 0;
}
.walker-nav {
  display: flex; gap: 12px; justify-content: space-between; align-items: center;
  margin-top: 28px;
  position: relative; z-index: 5;
}
.walker-back,
.walker-next {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--utility); font-weight: 600; font-size: 13px;
  padding: 10px 16px; border-radius: 4px;
  cursor: pointer; border: 1px solid transparent;
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), opacity var(--dur-fast);
}
.walker-back {
  background: transparent; color: var(--story-fg);
  border-color: currentColor;
  opacity: 0.7;
}
.walker-back:hover:not(:disabled) { opacity: 1; }
.walker-back:disabled { opacity: 0.3; cursor: not-allowed; }
.walker-next {
  background: var(--brand); color: var(--fg-on-dark);
}
.walker-next:hover:not(:disabled) { background: var(--brand-hover); }
.walker-next:disabled { opacity: 0.5; cursor: not-allowed; }
.stage.palette-full .walker-next { background: var(--acc-2); color: var(--bg-dark); }
.stage.palette-full .walker-next:hover:not(:disabled) { background: #5fdf72; }

.walker-fork-body { background: transparent; }
.walker-fork-pick {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 16px;
}
.walker-branch {
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-start;
  background: transparent; color: var(--story-fg);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 14px;
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 14px; letter-spacing: -0.01em; line-height: 1.2;
  text-align: left; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.walker-branch:hover {
  background: var(--brand); color: var(--fg-on-dark); border-color: var(--brand);
}
.walker-branch-arrow {
  font-family: var(--mono); font-size: 14px;
  align-self: flex-end;
  margin-top: auto;
}

/* ============================================================
   DESKTOP — chapter rail on the left
   Visible at >=1100px viewport. Hidden on phone-shaped viewports.
   ============================================================ */
.chapter-rail {
  position: fixed;
  left: 24px; top: 80px; bottom: 80px;
  width: 256px;
  display: none;
  flex-direction: column; gap: 16px;
  z-index: 6;
  pointer-events: auto;
}
.rail-head { display: flex; flex-direction: column; gap: 6px; }
.rail-eyebrow {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-muted);
}
.rail-title {
  font-family: var(--primary-heading); font-weight: 900;
  font-size: 18px; line-height: 1.15; letter-spacing: -0.025em;
  color: var(--fg);
}
.rail-subtitle {
  font-family: var(--primary); font-size: 13px; line-height: 1.4;
  color: var(--fg-muted);
}
.rail-list {
  list-style: none; margin: 0; padding: 16px 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.rail-item {
  display: grid; grid-template-columns: 32px 1fr; gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--fg-muted);
  transition: color var(--dur-fast);
}
.rail-item:hover { color: var(--fg); }
.rail-item.active { color: var(--fg); }
.rail-item.active .rail-label { color: var(--brand); font-weight: 600; }
.rail-item.done .rail-num { color: var(--fg-muted); opacity: 0.4; }
.rail-num {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-top: 3px;
}
.rail-label {
  font-family: var(--primary); font-size: 13px; line-height: 1.35;
}

/* Show rail at >=1100px and shift the centered stage to clear it */
@media (min-width: 1000px) {
  .viewer { justify-items: end; padding-right: 30px; }
}
@media (min-width: 1100px) {
  .chapter-rail { display: flex; }
  .viewer { padding-left: 320px; }
}

/* ============================================================
   CUSTOM MOMENTIC BEATS — visual / fanout / passage / centroid / graph
   ============================================================ */

/* tall interactive beats scroll within the stage */
.beat-visual, .beat-fanout, .beat-passage, .beat-centroid, .beat-graph {
  overflow-y: auto; overflow-x: hidden;
}
.beat-visual::-webkit-scrollbar, .beat-fanout::-webkit-scrollbar,
.beat-passage::-webkit-scrollbar, .beat-centroid::-webkit-scrollbar,
.beat-graph::-webkit-scrollbar { width: 0; }

/* VISUAL */
.beat-visual-title { font-size: 26px !important; line-height: 1.08; letter-spacing: -0.03em; max-width: 18ch; }
.dir-findings .beat-visual-title { font-size: 30px !important; }
.visual-stage { margin-top: 22px; }
.visual-stage svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.beat-visual-body { font-size: 13.5px !important; line-height: 1.55; margin-top: 16px !important; }

/* FANOUT */
.fan-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.fan-presets .explore-chip { font-size: 10px; padding: 6px 10px; }
.fan-input {
  margin-top: 12px; width: 100%;
  font-family: var(--primary); font-size: 14px;
  color: var(--story-fg); background: transparent;
  border: 1px solid currentColor; border-radius: 4px;
  padding: 10px 12px; outline: none;
}
.fan-input:focus { border-color: var(--brand); }
.fan-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.fan-pill {
  font-family: var(--mono); font-size: 10px; line-height: 1.3;
  color: var(--story-fg); opacity: 0.78;
  border: 1px solid currentColor; border-radius: 999px;
  padding: 5px 9px; white-space: nowrap;
}
.fan-pill b { color: var(--brand); font-weight: 600; margin-right: 4px; text-transform: uppercase; }
.fan-readout {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid currentColor;
}
.fan-readout > div { display: flex; flex-direction: column; }
.fan-readout .v { font-family: var(--primary-heading); font-weight: 900; font-size: 30px; letter-spacing: -0.04em; line-height: 1; color: var(--story-fg); }
.fan-readout .v.brand { color: var(--brand); }
.fan-readout .l { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--story-muted); margin-top: 6px; line-height: 1.3; }

/* PASSAGE */
.passage-list { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.pp-para {
  font-family: var(--primary); font-size: 12.5px; line-height: 1.5;
  color: var(--story-fg);
  border: 1px solid currentColor; border-radius: 6px;
  padding: 10px 12px; cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast);
}
.pp-para { border-color: color-mix(in srgb, currentColor 22%, transparent); }
.pp-para.picked { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pp-para.cited { background: rgba(122,245,140,0.22); border-color: rgba(122,245,140,0.7); cursor: default; }
.pp-para.skipped { opacity: 0.42; cursor: default; }
.pp-tag { display: block; margin-top: 7px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.pp-para.cited .pp-tag { color: #2f7a3d; }
.pp-para.skipped .pp-tag { color: var(--story-muted); }
.stage.theme-dark .pp-para.cited .pp-tag { color: #1f201b; }
.pp-score { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); align-self: center; }

/* CENTROID */
.centroid-svg { width: 100%; height: auto; display: block; margin-top: 18px; background: var(--bg-cream); border-radius: 6px; border: 1px solid var(--border); }
.centroid-readout { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; }
.centroid-num { font-family: var(--primary-heading); font-weight: 900; font-size: 56px; letter-spacing: -0.04em; line-height: 1; }
.centroid-lbl { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--story-muted); }

/* GRAPH */
.graph-svg { width: 100%; height: auto; display: block; margin-top: 16px; background: #F4F1E8; border-radius: 6px; border: 1px solid rgba(31,32,27,0.13); }
.graph-dots { display: flex; gap: 7px; margin-top: 16px; }
.graph-dot {
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid currentColor; background: transparent; color: var(--story-fg);
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6; transition: all var(--dur-fast);
}
.graph-dot:hover { opacity: 1; }
.graph-dot.on { background: var(--brand); color: var(--fg-on-dark); border-color: var(--brand); opacity: 1; }
.graph-dot.done { border-color: var(--brand); color: var(--brand); opacity: 1; }
.graph-step { margin-top: 16px; padding: 16px 0; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; min-height: 96px; }

/* ============================================================
   LANDSCAPE / RESPONSIVE ZONES
   On phone widths the lead/aside wrappers are display:contents,
   so the original single-column layout is unchanged. On the wide
   landscape canvas they become two columns and the card reads as
   a presentation slide.
   ============================================================ */
.beat-lead, .beat-aside { display: contents; }

.stage.landscape .beat {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  gap: clamp(36px, 4.5vw, 84px);
  align-items: center;
  padding: 104px clamp(44px, 4vw, 80px) 80px 28px;
}
.stage.landscape .beat-lead,
.stage.landscape .beat-aside {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0; max-height: 100%; overflow-y: auto; overflow-x: hidden;
}
.stage.landscape .beat-lead::-webkit-scrollbar,
.stage.landscape .beat-aside::-webkit-scrollbar { width: 0; }
.stage.landscape .beat.no-aside { grid-template-columns: 1fr; justify-items: start; }
.stage.landscape .beat.no-aside .beat-lead { max-width: min(880px, 68%); }
.stage.landscape .beat-frame.no-aside .beat-lead,
.stage.landscape .beat-quote.no-aside .beat-lead { max-width: min(900px, 70%); }

/* landscape type scale — overrides the small portrait inline sizes */
.stage.landscape .beat-title { font-size: clamp(26px, 2.5vw, 40px) !important; line-height: 1.06; }
.stage.landscape.dir-notebook .beat-title { font-size: clamp(24px, 2.3vw, 38px) !important; }
.stage.landscape .beat-frame .beat-title,
.stage.landscape .beat-quote .beat-title { font-size: clamp(30px, 3vw, 46px) !important; }
.stage.landscape .beat-body { font-size: 16px !important; max-width: 50ch; line-height: 1.6; }
.stage.landscape .beat-eyebrow { margin-bottom: 20px; }

/* features fill their column */
.stage.landscape .visual-stage svg,
.stage.landscape .centroid-svg,
.stage.landscape .graph-svg { max-width: 720px; }
/* give the wide hand-drawn / graph SVGs a larger column on desktop */
.stage.landscape .beat-visual,
.stage.landscape .beat-graph { grid-template-columns: 0.74fr 1.26fr; }
.stage.landscape .bars-chart { max-width: 560px; }
.stage.landscape .compare-pair { max-width: 520px; }
.stage.landscape .list-items { max-width: 600px; }

/* the open/close mascot sits large in its column, aligned to the far edge */
.stage.landscape .open-aside, .stage.landscape .close-aside {
  align-items: flex-end; justify-content: center;
}
.stage.landscape .open-mascot { width: clamp(180px, 18vw, 260px); }
.stage.landscape .close-mascot { width: clamp(160px, 16vw, 230px); }

/* keep the findings huge-number sane inside a column */
.stage.landscape.dir-findings .stat-big { font-size: clamp(120px, 12vw, 200px); }
.stage.landscape .explore-readout .stat-big { font-size: clamp(96px, 10vw, 150px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
  .viewer-meta { font-size: 10px; }
}

/* ============================================================
   MOBILE FULL-VIEWPORT — Instagram Stories feel.
   Below 768px: kill all chrome (top bar, side rail, in-stage logo
   and share button, nav-hint cursors, auto-play). Stage fills the
   viewport entirely. Body background tracks the current slide theme
   so any letterbox area matches the slide.
   ============================================================ */
@media (max-width: 768px) {
  .viewer-meta { display: none; }
  .viewer { padding: 0; }

  /* stage fills the viewport edge to edge */
  .stage-wrap {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    transform: none !important;
    transform-origin: top left !important;
  }
  .stage {
    border-radius: 0;
    box-shadow: none;
  }

  /* hide ONLY the cursor chevron hints on mobile (mobile users tap, not hover) */
  .nav-hint { display: none !important; }
  /* keep .stage-logo, .share-btn, .play-ctl, .stage-counter visible on mobile */

  /* progress segments sit below the notch / status bar */
  .progress {
    top: max(env(safe-area-inset-top, 0px), 10px);
    left: 16px;
    right: 16px;
  }

  /* logo, share, and counter stay visible — keep enough top padding to clear them */
  .beat,
  .stage.density-spacious .beat,
  .stage.density-dense .beat,
  .dir-notebook .beat {
    padding-top: calc(env(safe-area-inset-top, 0px) + 96px) !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 64px) !important;
    padding-left: 22px !important;
    padding-right: 22px !important;
  }

  /* shift logo + share below the notch on iOS */
  .stage-logo { top: calc(env(safe-area-inset-top, 0px) + 24px); }
  .share-btn { top: calc(env(safe-area-inset-top, 0px) + 22px); }

  /* a touch more space between eyebrow and title on mobile */
  .beat-eyebrow { margin-bottom: 22px; }

  /* body background tracks the active slide theme so letterbox bars (if any) match */
  body { background: var(--bg-cream); transition: background 280ms ease; }
  body:has(.stage.theme-dark)  { background: var(--bg-dark); }
  body:has(.stage.theme-paper) { background: var(--bg); }
}

/* ============================================================
   STAGE COUNTER — bottom-right page counter, shown on every beat
   ============================================================ */
.stage-counter {
  position: absolute;
  bottom: 22px; right: 24px;
  z-index: 9;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--story-muted);
  opacity: 0.7;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
  .stage-counter {
    bottom: max(env(safe-area-inset-bottom, 0px), 18px);
    right: 16px;
  }
}

/* ============================================================
   PLAYBACK ROW — prev / play / speed / next, bottom center
   ============================================================ */
.play-row {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.nav-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--story-muted);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast);
}
.nav-btn:hover:not(:disabled) { color: var(--story-fg); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.stage.theme-dark .nav-btn { color: var(--fg-on-dark); }
.stage.theme-dark .nav-btn:disabled { opacity: 0.25; }
.play-row .play-ctl { position: static; transform: none; }
.speed-pill {
  background: transparent;
  border: 1px solid currentColor;
  color: var(--story-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.speed-pill:hover { color: var(--story-fg); }
.stage.theme-dark .speed-pill { color: var(--fg-on-dark); }
@media (max-width: 768px) {
  .play-row {
    bottom: max(env(safe-area-inset-bottom, 0px), 18px);
    left: 0; right: 0;
    transform: none;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* Pin chevrons to the edges, cluster play+speed in the middle */
  .play-row .play-ctl    { margin-left: auto; }
  .play-row .nav-btn-next { margin-left: auto; }
  .nav-btn { width: 38px; height: 38px; }
  .nav-btn svg { width: 22px; height: 22px; }
  .speed-pill { font-size: 10px; padding: 5px 10px; }
}
