:root {
  --studio-bg: #e4e4e7;
  --ocean-bg: #0f3552;
  --navy-blue: #2e62a1;
  --crimson: #b21e51;
  --teal: #1ed4b7;
  --money-green: #38a169;
  --emerald: #4dab5b;
  --ink: #141619;
  --panel-bg: rgba(20, 22, 25, 0.88);
  --panel-border: rgba(255, 255, 255, 0.12);

  /* Type scale (AGENTS.md rule 10): nothing on screen below --fs-sm */
  --fs-sm: 14px;
  --fs-md: 18px;
  --fs-lg: 28px;
  --fs-xl: 52px;

  /* Left subject nav rail (live pages only) */
  --nav-w: 60px;
  --nav-w-open: 252px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--studio-bg);
  color: var(--ink);
  user-select: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Vignette & Film Grain Overlay matching Rajesh Daniel / The Invisible Hand style */
.studio-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.22) 100%);
  transition: opacity 0.5s ease;
}

/* Top Documentary Header Overlay (matches video's top-left chart headers) */
.chart-header-overlay {
  position: fixed;
  top: 28px;
  left: 36px;
  z-index: 10;
  display: flex;
  align-items: stretch;
  gap: 12px;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-header-bar {
  width: 5px;
  background: var(--ink);
  border-radius: 1px;
  transition: background 0.35s ease;
}

.chart-header-Overlay-dark .chart-header-bar {
  background: #ffffff;
}

.chart-header-text {
  max-width: min(640px, 42vw);
  /* Backdrop keeps the header legible when 3D content passes behind it */
  background: rgba(228, 228, 231, 0.84);
  backdrop-filter: blur(6px);
  padding: 6px 12px 8px;
  border-radius: 4px;
  transition: background 0.35s ease;
}

body.theme-ocean .chart-header-text {
  background: rgba(15, 53, 82, 0.72);
}

.chart-header-text h1 {
  font-size: var(--fs-lg);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink);
  transition: color 0.35s ease;
}

.chart-header-text p {
  font-size: var(--fs-md);
  font-weight: 500;
  color: #52525b;
  margin-top: 3px;
  transition: color 0.35s ease;
}

.chart-header-text p.chart-source {
  font-size: var(--fs-sm);
  font-weight: 500;
  font-style: italic;
  color: #71717a;
  line-height: 1.35;
  margin-top: 6px;
}

.chart-header-text p.chart-source:empty {
  display: none;
}

body.theme-ocean .chart-header-bar {
  background: #1ed4b7;
}
body.theme-ocean .chart-header-text h1 {
  color: #f8fafc;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
body.theme-ocean .chart-header-text p {
  color: #94a3b8;
}
body.theme-ocean .chart-header-text p.chart-source {
  color: #cbd5e1;
}

/* Top-Right SDK Badge & Controls */
.top-right-bar {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sdk-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  color: #f4f4f5;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.sdk-pill {
  white-space: nowrap;
}

/* Icon-only pills below 1600px keep the header clear; the two content pills keep a short label */
@media (max-width: 1600px) {
  .pill-label:not(.pill-label-keep) {
    display: none;
  }
}

.sdk-pill:hover {
  background: rgba(30, 34, 40, 0.96);
  transform: translateY(-1px);
}

.sdk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1ed4b7;
  box-shadow: 0 0 8px #1ed4b7;
}

/* Kinetic Typography Callout Banner */
.kinetic-banner {
  position: fixed;
  top: var(--kinetic-top, 92px);
  left: 36px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.kinetic-big {
  font-size: clamp(var(--fs-lg), 4vw, var(--fs-xl));
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  background: var(--ink);
  padding: 6px 14px;
  display: inline-block;
  width: fit-content;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.doc-recon-badge {
  font-size: var(--fs-sm);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: #facc15;
  padding: 4px 10px;
  width: fit-content;
  border-radius: 3px;
}

.doc-recon-badge[hidden] {
  display: none;
}

.kinetic-sub {
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--crimson);
  padding: 4px 10px;
  width: fit-content;
  border-radius: 3px;
}

/* Sub-mode / Phase Switcher Pills */
.phase-switcher {
  position: fixed;
  top: 86px;
  right: 28px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.phase-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);
  color: #18181b;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.18s ease;
}

.phase-btn:hover {
  background: #ffffff;
  transform: translateX(-2px);
}

.phase-btn.active {
  background: var(--crimson);
  color: #ffffff;
  border-color: var(--crimson);
  box-shadow: 0 4px 14px rgba(178, 30, 81, 0.35);
}

/* Bottom Narration & Scene Timeline Dock */
.bottom-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100vw - 40px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.narration-box {
  align-self: center;
  max-width: 820px;
  background: rgba(15, 17, 21, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.narration-time {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #1ed4b7;
  margin-right: 8px;
}

.narration-highlight {
  background: rgba(250, 204, 21, 0.25);
  color: #fde047;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}

/* Scene Selector Strip */
.timeline-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ctrl-btn.active {
  background: #1ed4b7;
  color: #091e2c;
  border-color: #1ed4b7;
}

.scene-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.scene-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 7px 9px;
  text-align: left;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.scene-tab:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #f4f4f5;
}

.scene-tab.active {
  background: rgba(46, 98, 161, 0.38);
  border-color: #60a5fa;
  color: #ffffff;
}

.scene-tab-num {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #1ed4b7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-tab-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

.scene-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #b21e51;
  width: 0%;
  transition: width 0.1s linear;
}

.scene-tab.active .scene-progress {
  background: #1ed4b7;
}

/* Bottom-dock link from each explainer to its written article */
.article-link {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 8px;
}

.article-link:hover,
.article-link:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* Sound pill (shared/explainer.js SoundPlayer): highlighted while sound is on */
.sound-pill.on {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Left subject nav: a slim rail of monogram badges that widens on hover / keyboard focus to show
   each explainer's title. Built by shared/explainer.js from shared/subjects.js; never in exports. */
.subject-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: var(--nav-w);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--panel-border);
  overflow: hidden;
  transition: width 0.22s ease-out;
}

.subject-nav:hover,
.subject-nav:focus-within {
  width: var(--nav-w-open);
  box-shadow: 12px 0 32px rgba(0, 0, 0, 0.3);
}

.subject-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px;
  border-radius: 10px;
  color: #f4f4f5;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.subject-link:hover,
.subject-link:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.subject-link:focus-visible {
  box-shadow: 0 0 0 2px var(--teal);
}

.subject-badge {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-sm);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #ffffff;
  border: 2px solid var(--subject-accent, var(--panel-border));
  background: rgba(255, 255, 255, 0.06);
}

.subject-link.current .subject-badge {
  background: var(--subject-accent);
}

.subject-link.current {
  background: rgba(255, 255, 255, 0.08);
}

.subject-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.subject-nav:hover .subject-text,
.subject-nav:focus-within .subject-text {
  opacity: 1;
}

.subject-title {
  font-size: var(--fs-sm);
  font-weight: 800;
}

.subject-sub {
  font-size: var(--fs-sm);
  color: #a1a1aa;
}

.subject-sep {
  border: 0;
  border-top: 1px solid var(--panel-border);
  margin: 4px 6px;
}

/* Keep the left-hand overlays and the bottom dock clear of the rail */
body.has-subject-nav .chart-header-overlay,
body.has-subject-nav .kinetic-banner,
body.has-subject-nav .sources-card {
  left: calc(var(--nav-w) + 24px);
}

body.has-subject-nav .sources-card {
  width: min(760px, calc(58vw - var(--nav-w)));
}

body.has-subject-nav .bottom-dock {
  left: calc(50% + var(--nav-w) / 2);
  width: min(1120px, calc(100vw - var(--nav-w) - 40px));
}

@media (prefers-reduced-motion: reduce) {
  .subject-nav,
  .subject-text {
    transition: none;
  }
}

/* Phones: slimmer rail so the scene keeps most of the width */
@media (max-width: 640px) {
  :root {
    --nav-w: 48px;
  }
  .subject-nav {
    padding: 10px 5px;
  }
  .subject-badge {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }
}

/* Phones (live pages only; exports render at ≥1080px and carry .export-mode). Everything stacks in
   the width right of the rail: pills → phase row → header → callout … 3D … narration → scene strip. */
@media (max-width: 640px) {
  body:not(.export-mode) {
    --phone-left: 8px;
  }
  body.has-subject-nav:not(.export-mode) {
    --phone-left: calc(var(--nav-w) + 8px);
  }

  body:not(.export-mode) .top-right-bar {
    top: 8px;
    left: var(--phone-left);
    right: 8px;
    gap: 6px;
    padding: 2px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body:not(.export-mode) .top-right-bar::-webkit-scrollbar {
    display: none;
  }
  /* Right-aligned without flex-end, so pills that overflow stay reachable by scrolling */
  body:not(.export-mode) .top-right-bar > :first-child {
    margin-left: auto;
  }
  body:not(.export-mode) .sdk-pill {
    flex: none;
    padding: 6px 10px;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }
  body:not(.export-mode) .sdk-pill:hover {
    transform: none;
  }
  /* Icon-only pills: drop every label that has an icon, and the status dot beside an icon */
  body:not(.export-mode) .pill-icon ~ .pill-label,
  body:not(.export-mode) .sdk-dot:has(~ .pill-icon) {
    display: none;
  }

  /* Phase pills: one horizontally scrollable row under the pill bar */
  body:not(.export-mode) .phase-switcher {
    top: 50px;
    left: var(--phone-left);
    right: 8px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
  }
  body:not(.export-mode) .phase-switcher::-webkit-scrollbar {
    display: none;
  }
  body:not(.export-mode) .phase-btn {
    flex: none;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  body:not(.export-mode) .phase-btn:hover {
    transform: none;
  }

  body:not(.export-mode) .chart-header-overlay,
  body:not(.export-mode) .kinetic-banner,
  body:not(.export-mode) .sources-card {
    left: var(--phone-left);
    right: 8px;
  }
  body:not(.export-mode) .chart-header-overlay {
    top: 94px;
    gap: 8px;
  }
  body:not(.export-mode) .chart-header-bar {
    width: 4px;
  }
  body:not(.export-mode) .chart-header-text {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 6px 10px;
  }
  body:not(.export-mode) .chart-header-text h1 {
    font-size: var(--fs-md);
  }
  body:not(.export-mode) .chart-header-text p {
    font-size: var(--fs-sm);
    margin-top: 2px;
  }
  body:not(.export-mode) .chart-header-text p.chart-source {
    margin-top: 4px;
  }
  body:not(.export-mode) .kinetic-big {
    font-size: var(--fs-lg);
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body:not(.export-mode) .sources-card {
    top: 94px;
    width: auto;
    max-height: calc(100vh - 300px);
    padding: 12px 14px;
  }
  body:not(.export-mode) .sources-card h2 {
    font-size: var(--fs-md);
  }

  body:not(.export-mode) .bottom-dock {
    left: var(--phone-left);
    right: 8px;
    bottom: 8px;
    width: auto;
    transform: none;
    gap: 6px;
  }
  body:not(.export-mode) .narration-box {
    align-self: stretch;
    max-width: none;
    padding: 8px 12px;
    text-align: left;
  }

  /* Scene tabs: a horizontally scrollable strip next to the play controls */
  body:not(.export-mode) .timeline-bar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
  }
  body:not(.export-mode) .timeline-bar > :nth-child(3) {
    display: none; /* "Drag to Orbit • Scroll to Zoom" hint */
  }
  body:not(.export-mode) .playback-controls {
    gap: 4px;
  }
  body:not(.export-mode) .scene-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  body:not(.export-mode) .scene-tabs::-webkit-scrollbar {
    display: none;
  }
  body:not(.export-mode) .scene-tab {
    flex: 0 0 140px;
    scroll-snap-align: start;
  }
}

/* Modal Drawer for Antigravity SDK Report */
.sdk-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sdk-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.sdk-modal-card {
  width: min(760px, 92vw);
  max-height: 82vh;
  overflow-y: auto;
  background: #141619;
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.sdk-modal-card h2 {
  font-size: var(--fs-md);
  font-weight: 800;
  margin-bottom: 8px;
  color: #1ed4b7;
}

.sdk-modal-card pre {
  background: #090a0c;
  padding: 14px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  overflow-x: auto;
  color: #d4d4d8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 10px;
}

@media (max-width: 900px) {
  .scene-tabs {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Clean Documentary Video Export Mode */
body.export-mode .top-right-bar,
body.export-mode .phase-switcher,
body.export-mode .timeline-bar {
  display: none !important;
}

body.export-mode .bottom-dock {
  bottom: 34px;
}

body.export-mode .narration-box {
  font-size: var(--fs-md);
  padding: 12px 24px;
  max-width: 940px;
  background: rgba(12, 14, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Closing Sources Card (China page, phase 7E) */
.sources-card {
  position: fixed;
  top: 28px;
  left: 36px;
  z-index: 12;
  /* Live: stays left of the phase switcher and may scroll. Export: wider, never scrolls. */
  width: min(760px, 58vw);
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: rgba(20, 22, 25, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-left: 5px solid var(--crimson);
  border-radius: 8px;
  padding: 18px 22px;
  color: #f4f4f5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.sources-card[hidden] {
  display: none;
}

.sources-card h2 {
  font-size: var(--fs-lg);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.sources-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 22px;
}

@media (max-width: 900px) {
  .sources-list {
    grid-template-columns: 1fr;
  }
}

.sources-list li {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: #d4d4d8;
}

.sources-scene {
  display: block;
  font-weight: 800;
  color: var(--teal);
}

.sources-note {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: #a1a1aa;
  font-style: italic;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
}

body.sources-mode .chart-header-overlay,
body.sources-mode .kinetic-banner {
  opacity: 0;
}

body.export-mode .sources-card {
  width: min(1120px, calc(100vw - 72px));
  max-height: calc(100vh - 150px);
}

/* Document Archive Modal */
.doc-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.doc-entry {
  background: #1c1f24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 14px 18px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.doc-entry:hover {
  border-color: rgba(239, 68, 68, 0.8);
  transform: translateY(-2px);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.doc-code-badge {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.doc-date {
  font-size: var(--fs-sm);
  color: #a1a1aa;
}

.doc-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.doc-chinese-title {
  font-size: var(--fs-sm);
  color: #e4e4e7;
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
  margin-bottom: 8px;
  opacity: 0.85;
}

.doc-desc {
  font-size: var(--fs-sm);
  color: #a1a1aa;
  line-height: 1.5;
  margin-bottom: 8px;
}

.doc-highlights {
  background: rgba(250, 204, 21, 0.08);
  border-left: 3px solid #facc15;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin: 8px 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: #fef08a;
}

.doc-fly-btn {
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fafafa;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  margin-top: 6px;
}

.doc-fly-btn:hover {
  background: #b21e51;
  border-color: #b21e51;
  color: #ffffff;
}



/* ==========================================================================
   9:16 YouTube Shorts export (body.export-short, ?export=1&short=1)
   AGENTS.md rules 24-25: keep text out of the top 15%, bottom 20% and right 12%;
   stack header -> callout -> 3D visual -> narration. Type scale grows with the
   1080px-wide frame so it reads on a phone.
   ========================================================================== */
body.export-short {
  --fs-sm: 24px;
  --fs-md: 30px;
  --fs-lg: 46px;
  --fs-xl: 76px;
}

body.export-short .chart-header-overlay {
  top: 15vh;
  left: 4vw;
}

body.export-short .chart-header-text {
  max-width: calc(84vw - 17px);
}

body.export-short .kinetic-banner {
  left: 4vw;
  max-width: 84vw;
}

body.export-short .kinetic-big {
  font-size: var(--fs-xl);
}

body.export-short .bottom-dock {
  left: 4vw;
  width: 84vw;
  transform: none;
  bottom: 20vh;
}

body.export-short .narration-box {
  max-width: none;
  width: 100%;
  font-size: var(--fs-md);
  padding: 16px 22px;
}

body.export-short .sources-card {
  top: 15vh;
  left: 4vw;
  width: 84vw;
  max-height: 62vh;
  padding: 20px 24px;
}

body.export-short .sources-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

body.export-short .sources-list li,
body.export-short .sources-note {
  font-size: 20px;
}
