/* ============================================================
   layout.css — section-level layout only (Lead)
   Components/visual styling live in theme.css; viz in viz.css.
   ============================================================ */

/* ---------- page shell ---------- */
html { scroll-behavior: smooth; }
html.presenter-mode { scroll-behavior: auto; }
body { overflow-x: hidden; }
#app { position: relative; }
.chapter { position: relative; }
.chapter-inner {
  width: min(100% - 128px, 1360px);
  margin-inline: auto;
  padding-block: clamp(72px, 9vw, 132px);
  position: relative;
  z-index: 1;
}
.chapter-head { max-width: 820px; margin-bottom: clamp(40px, 5vw, 64px); }
.chapter-head .chapter-lead { max-width: 720px; }
.section-label { display: inline-block; margin-bottom: 14px; }

/* hero */
.hero { min-height: 100svh; display: flex; align-items: stretch; overflow: hidden; }
.hero .chapter-inner { display: flex; flex-direction: column; justify-content: center; padding-block: 140px 90px; min-height: 100svh; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-inner { width: min(100% - 128px, 1360px); }
.hero-copy { max-width: 880px; position: relative; z-index: 2; }
.hero-title { margin: 18px 0 22px; }
.hero-lead { max-width: 700px; margin-bottom: 14px; }
.hero-sub { max-width: 660px; margin-bottom: 30px; }
.hero-side { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.network-label { position: absolute; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); opacity: .75; }
.label-china { top: 24%; right: 10%; }
.label-mauritania { top: 40%; left: 58%; }
.label-hub { top: 61%; left: 66%; color: var(--ivory); }
.label-africa { top: 74%; right: 16%; }
.hero-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(36px, 5vw, 64px); border-top: 1px solid var(--line); position: relative; z-index: 2; }
.hero-kpis .kpi-mini { padding: 18px 22px 0 0; border-right: 1px solid var(--line); }
.hero-kpis .kpi-mini:last-child { border-right: 0; }
.scroll-hint { display: flex; gap: 10px; align-items: center; margin-top: 26px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.scroll-arrow { animation: shortBounce 2.4s ease-in-out infinite; }

/* 01 pourquoi */
.problems-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.avant-apres { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.transition { margin-top: 46px; max-width: 900px; }

/* 02 systeme */
.system-groups { display: flex; flex-direction: column; gap: 46px; }
.system-group .group-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.business-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.layer-stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.click-hint { margin-top: 28px; }
#stage-legend { margin-left: auto; display: flex; gap: 8px; }

/* 03 rimu */
.rimu-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 420px); gap: clamp(32px, 5vw, 72px); align-items: start; }
.rimu-copy { display: flex; flex-direction: column; gap: 18px; }
.module-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rimu-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; position: sticky; top: 96px; }
.phone-controls { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; }
.day-block { margin-top: clamp(48px, 6vw, 84px); border-top: 1px solid var(--line); padding-top: 28px; }
.day-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.day-timeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }

/* 04 ia */
.ia-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.layer-3d { display: flex; flex-direction: column; gap: 10px; perspective: 900px; }
.ai-main { display: flex; flex-direction: column; gap: 18px; }
.ai-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-panel { min-height: 180px; }
.phases-block { margin-top: clamp(38px, 5vw, 64px); border-top: 1px solid var(--line); padding-top: 28px; }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.callout { margin-top: 28px; }

/* 05 flux */
.flow-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.flow-side { display: flex; flex-direction: column; gap: 16px; }
.flow-legend { display: flex; flex-direction: column; gap: 8px; }
.flow-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.story-chips { display: flex; flex-direction: column; gap: 8px; }
.story-caption { min-height: 64px; }
.flow-main { min-width: 0; }
.flow-canvas { min-height: 520px; }
.flow-matrix { margin-top: 20px; overflow-x: auto; }

/* 06 trajectoire */
.roadmap { display: flex; flex-direction: column; gap: 22px; }
.track-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.timeline-wrap { position: relative; padding: 22px 0 8px; }
.timeline-axis { position: relative; height: 34px; margin-bottom: 12px; }
.timeline { position: relative; min-height: 120px; }
.timeline-detail { min-height: 120px; }
.roadmap .note { margin-top: 8px; }

/* 07 impact */
.impact-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 40px; }
.charts { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; }
.chart-card { min-width: 0; }
.chart { min-height: 240px; }
.win-block { margin-top: clamp(44px, 5vw, 72px); }
.win-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.map-block { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; align-items: center; margin-top: clamp(44px, 5vw, 72px); }
.map-canvas { min-height: 320px; }
.transformation { margin-top: clamp(44px, 5vw, 72px); }
.transformation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* 08 decision */
.decision-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; }
.supports, .risks { display: flex; flex-direction: column; gap: 8px; }
.cta-block { margin-top: clamp(44px, 5vw, 72px); }
.ctas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.next-block { margin-top: clamp(44px, 5vw, 72px); }
.next-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.contact { margin-top: clamp(44px, 5vw, 72px); }
.disclaimer { margin-top: 28px; }

/* footer */
.site-footer .footer-inner { width: min(100% - 128px, 1360px); margin-inline: auto; padding-block: 56px; display: grid; grid-template-columns: 1.1fr .9fr 1.2fr; gap: 32px; }
.footer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; align-content: start; }
.footer-meta { display: flex; flex-direction: column; gap: 8px; }

/* mobile menu / rail overlay */
body.menu-open { overflow: hidden; }
body.menu-open #chapter-rail { opacity: 1; pointer-events: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .chapter-inner, .hero-inner, .site-footer .footer-inner { width: min(100% - 96px, 1200px); }
  .hero-kpis { grid-template-columns: repeat(4, 1fr); }
  .rimu-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; }
}
@media (max-width: 1080px) {
  .pillar-grid, .business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layer-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rimu-layout { grid-template-columns: 1fr; }
  .phone-wrap { position: static; }
  .ia-layout { grid-template-columns: 1fr; }
  .flow-layout { grid-template-columns: 1fr; }
  .flow-side { order: 1; }
  .flow-main { order: 2; }
  .charts { grid-template-columns: 1fr; }
  .map-block { grid-template-columns: 1fr; }
  .decision-layout { grid-template-columns: 1fr; }
  .site-footer .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-meta { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .chapter-inner, .hero-inner, .site-footer .footer-inner { width: calc(100% - 64px); }
  .hero .chapter-inner { padding-block: 120px 72px; }
  .hero-kpis { grid-template-columns: repeat(2, 1fr); }
  .hero-kpis .kpi-mini:nth-child(2) { border-right: 0; }
  .hero-kpis .kpi-mini { padding: 14px 16px 0 0; }
  .day-timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .impact-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctas, .next-steps { grid-template-columns: 1fr; }
  .transformation-grid { grid-template-columns: 1fr; }
  .rimu-trust { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; }
  .avant-apres { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .chapter-inner, .hero-inner, .site-footer .footer-inner { width: calc(100% - 40px); }
  .chapter-inner { padding-block: 64px; }
  .hero .chapter-inner { padding-block: 104px 64px; }
  .hero-title { margin: 12px 0 16px; }
  .hero-side { display: none; }
  .problems-grid, .pillar-grid, .business-grid, .layer-stack { grid-template-columns: 1fr; }
  .hero-kpis { grid-template-columns: 1fr 1fr; }
  .day-timeline { grid-template-columns: 1fr; }
  .flow-canvas { min-height: 420px; }
  .site-footer .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .chapter-head { margin-bottom: 32px; }
}

/* keyboard / reduced-motion */
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 9999; }
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-arrow { animation: none; }
}
@keyframes shortBounce { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(5px);} }

/* ---------- Lead precision overrides (added during integration) ---------- */
.chapter { scroll-margin-top: 88px; }

/* hero KPI row: prevent overflow and keep 4 columns readable */
.hero-kpis .kpi-mini { min-width: 0; padding-right: 18px; }
.hero-kpis .kpi-mini-value { display: block; font-size: clamp(24px, 2.35vw, 34px); line-height: 1.08; white-space: nowrap; letter-spacing: -0.01em; }
.hero-kpis .kpi-mini-value.range, .hero-kpis .range { font-size: clamp(21px, 2.05vw, 30px); }
.hero-kpis .kpi-mini-label { display: block; max-width: 96%; font-size: 9px; line-height: 1.35; letter-spacing: .1em; text-transform: uppercase; }

/* entity cards: three metrics must not collide */
.pillar-kpis, .business-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.pillar-kpis .metric, .business-metrics .business-metric { min-width: 0; }
.pillar-kpis .metric-value, .business-metrics .business-metric-value { display: block; font-size: 15px; line-height: 1.15; white-space: nowrap; letter-spacing: -0.01em; }
.pillar-kpis .metric-label, .business-metrics .business-metric-label { display: block; margin-top: 4px; font-size: 8.5px; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; opacity: .78; }
.pillar-kpis .metric .badge, .business-metrics .badge { margin-top: 5px; }
.pillar-card .card-cta, .business-card .card-cta { margin-top: 14px; }

/* links on dark tone */
[data-tone="dark"] .btn-link, .hero .btn-link { color: var(--ivory); opacity: .86; }
[data-tone="dark"] .btn-link:hover, .hero .btn-link:hover { opacity: 1; color: var(--gold); }

/* drawer stage badge hidden attribute */
#drawer-stage[hidden], #drawer-kpis[hidden] { display: none !important; }

/* layer rows: keep three columns readable */
.layer-row .layer-value { max-width: 34%; }
.layer-row .layer-comp { overflow: hidden; text-overflow: ellipsis; }

/* day timeline labels */
.day-step { min-width: 0; text-align: left; }
.day-step .day-title { display: block; font-size: 11px; line-height: 1.35; }

/* flow layout: legend buttons full width */
.flow-legend .flow-check { width: 100%; justify-content: flex-start; }

/* win panel items */
.win-panel .benefit-item { padding-block: 10px; }

/* ---------- integration fixes (batch 2) ---------- */
/* entity KPI values: allow long ranges without collision */
.pillar-kpis .metric-value, .business-metrics .business-metric-value { font-size: 12.5px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
.pillar-kpis .metric-label, .business-metrics .business-metric-label { font-size: 8px; }
.hero-kpis .kpi-mini-value, .hero-kpis .kpi-mini-value.range { font-size: clamp(22px, 2vw, 30px); }
.hero-kpis .range { font-size: clamp(19px, 1.85vw, 27px); }
/* impact big numbers: ranges shouldn't wrap awkwardly */
.kpi-big .kpi-big-value { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.05; }
.kpi-big .kpi-big-value.range, .kpi-big .range { font-size: clamp(26px, 2.7vw, 40px); }
/* story chips: two lines */
.story-chip-title, .story-chip-sub { display: block; }
.story-chip-title { font-size: 13px; line-height: 1.3; }
.story-chip-sub { font-size: 10.5px; line-height: 1.35; opacity: .72; margin-top: 2px; }
/* layer 3D plates: never overflow */
.layer-3d { overflow: hidden; }
.layer-3d .layer-plate { overflow: hidden; }
.layer-plate-name, .layer-plate-comp { display: block; max-width: 100%; }
.layer-plate-comp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* flow graph: graph view vs matrix view + mobile horizontal pan */
#ch-flux[data-view="graph"] .flow-matrix { display: none; }
#ch-flux[data-view="matrix"] .flow-canvas { display: none; }
.flow-canvas { width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(201,162,94,.45) rgba(246,240,228,.06); }
#flow-controls .btn.is-active { border-color: var(--gold, #C9A25E); color: var(--ivory, #F6F0E4); }
.flow-drag-hint { display: none; margin: 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted, rgba(246,240,228,.58)); }
.flow-matrix thead th:first-child, .flow-matrix tbody th:first-child, .flow-matrix tbody td:first-child {
  position: sticky; left: 0; z-index: 2; background: #071C36;
}
@media (max-width: 1080px) {
  .flow-drag-hint { display: block; }
  #flow-canvas { min-height: 0; }
  .flow-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .flow-side { order: 1; }
  .flow-main { order: 2; }
}
@media (max-width: 900px) {
  .story-chips { flex-direction: row; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
  .story-chips::-webkit-scrollbar { display: none; }
  .story-chips > * { flex: 0 0 220px; }
}
@media (max-width: 640px) {
  .flow-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .flow-side { gap: 12px; }
  .story-chips { flex-direction: row; gap: 8px; }
  .story-chips > * { flex: 0 0 220px; }
  #flow-canvas { min-height: 0; }
  .flow-drag-hint { font-size: 9px; }
}
/* charts: keep labels inside */
#chart-mau, #chart-revenue { overflow: hidden; }
/* mobile safety */
@media (max-width: 640px) {
  .hero-kpis .kpi-mini-value { font-size: 24px; }
  .hero-kpis .kpi-mini-value.range, .hero-kpis .range { font-size: 20px; }
  .pillar-kpis .metric-value, .business-metrics .business-metric-value { font-size: 12px; }
}

/* ---------- integration fixes (batch 3 — mobile / drawer) ---------- */
#story-caption .viz-cap-head { display: flex; }
#story-caption .viz-cap-title, #story-caption .viz-cap-count { display: inline; }
#story-caption .viz-cap-body { display: block; margin-top: 4px; }

@media (max-width: 640px) {
  /* brand: keep the mark + RIMU/RIMP/IA line, avoid truncation */
  .site-header .brand-name { display: none; }
  .site-header .brand-sub { font-size: 9px; letter-spacing: .14em; }
  .site-header .brand-mark { width: 30px; height: 30px; }
  .site-header .header-inner { gap: 8px; }
  .site-header .header-actions { gap: 6px; }

  /* drawer: readable KPI grid + scrollable tabs */
  .drawer-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .drawer-tabs::-webkit-scrollbar { display: none; }
  .drawer-tab { flex: 0 0 auto; white-space: nowrap; }
  .drawer-body { padding-inline: 18px; }
  .drawer-kpi-value { font-size: 18px; }

  /* cards: less aggressive nowrap */
  .pillar-kpis .metric-value, .business-metrics .business-metric-value { font-size: 11.5px; }
  .pillar-kpis .metric-label, .business-metrics .business-metric-label { font-size: 7.5px; }
}

/* ---------- RIMU phone carousel (real screenshots from source docx) ---------- */
.phone-wrap { width: 100%; max-width: 360px; }
.phone-screen.phone-carousel {
  display: block;
  padding: 0;
  background: #04101E;
  cursor: grab;
  touch-action: pan-y;
}
.phone-screen.phone-carousel:active { cursor: grabbing; }
.phone-screen.phone-carousel:focus-visible { outline: 2px solid var(--gold, #C9A25E); outline-offset: 3px; }
.phone-track { position: absolute; inset: 0; }
.phone-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}
.phone-slide.is-active { opacity: 1; z-index: 1; }
.phone-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}
.phone-controls { flex-wrap: nowrap; gap: 8px; }
.phone-arrow {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong, rgba(246, 240, 228, 0.28));
  border-radius: 50%;
  background: transparent;
  color: var(--ivory, #F6F0E4);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.phone-arrow:hover { border-color: var(--gold, #C9A25E); color: var(--gold, #C9A25E); background: rgba(201, 162, 94, 0.08); }
.phone-arrow:focus-visible { outline: 2px solid var(--gold, #C9A25E); outline-offset: 2px; }
.phone-dots { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.phone-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(246, 240, 228, 0.28);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}
.phone-dot:hover { background: rgba(246, 240, 228, 0.6); }
.phone-dot.is-active { width: 18px; background: var(--gold, #C9A25E); }
.phone-dot:focus-visible { outline: 2px solid var(--gold, #C9A25E); outline-offset: 3px; }
.phone-caption-row { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; max-width: 340px; width: 100%; text-align: center; }
.phone-caption-row .phone-caption { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-muted, rgba(246, 240, 228, 0.58)); }
.phone-count { font-size: 10px; letter-spacing: 0.16em; color: var(--gold, #C9A25E); white-space: nowrap; font-variant-numeric: tabular-nums; }
.phone-demo-note { margin: 0; max-width: 340px; text-align: center; font-size: 10px; line-height: 1.4; color: var(--text-faint, rgba(246, 240, 228, 0.4)); }

@media (max-width: 640px) {
  .phone-wrap { max-width: 100%; }
  .phone { width: min(340px, 100%); }
  .phone-controls { gap: 6px; }
  .phone-arrow { width: 30px; height: 30px; flex-basis: 30px; }
  #phone-toggle { min-width: 0; padding-inline: 10px; }
  .phone-caption-row { max-width: 100%; }
  .phone-demo-note { max-width: 100%; }
}
/* RIMU carousel eyebrow + hero network label tweak */
.phone-eyebrow { margin: 0 0 6px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold, #C9A25E); text-align: center; }
.hero .label-africa { top: 69%; right: 11%; }
/* RIMU product facts under the trust cards */
.rimu-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 22px; }
.rimu-fact { border-top: 1px solid var(--line-soft, rgba(246, 240, 228, 0.12)); padding-top: 10px; min-width: 0; }
.rimu-fact-value { display: block; font-family: var(--ff-display, Didot, Georgia, serif); font-size: 17px; line-height: 1.1; color: var(--gold, #C9A25E); }
.rimu-fact-label { display: block; margin-top: 5px; font-size: 10px; line-height: 1.4; color: var(--text-muted, rgba(246, 240, 228, 0.58)); }
@media (max-width: 640px) { .rimu-facts { grid-template-columns: 1fr 1fr; gap: 10px 14px; } .rimu-fact-value { font-size: 15px; } }
/* flow matrix note + hide duplicated table caption */
#ch-flux[data-view="graph"] .flow-matrix-note { display: none; }
.flow-matrix-note {
  display: block;
  margin: 12px 0 10px;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint, rgba(246, 240, 228, .42));
  line-height: 1.5;
}
#flow-matrix .viz-matrix-table caption { display: none; }
@media (max-width: 900px) {
  .flow-matrix-note { font-size: 9px; letter-spacing: .06em; }
}


/* ---------- flow story progress + mobile HUD ---------- */
.story-progress { display: flex; gap: 5px; margin-top: 8px; width: 100%; }
.story-progress-seg { height: 3px; flex: 1 1 0; border-radius: 999px; background: rgba(246, 240, 228, 0.14); transition: background 0.25s ease; }
.story-progress-seg.is-done { background: rgba(201, 162, 94, 0.55); }
.story-progress-seg.is-on { background: var(--gold, #C9A25E); }
.flow-story-hud { display: none; }
.flow-story-hud[hidden] { display: none !important; }
#ch-flux.story-active #story-caption,
#ch-flux.story-active #story-progress { display: none; }
.flow-story-hud:not([hidden]) {
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 94, 0.38);
  background: rgba(201, 162, 94, 0.06);
  scroll-margin-top: 92px;
}
.flow-story-hud .hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flow-story-hud .hud-kicker { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold, #C9A25E); }
.flow-story-hud .hud-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-story-hud .hud-close { min-width: 30px; height: 30px; }
.flow-story-hud .hud-caption { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary, rgba(246, 240, 228, 0.78)); }
.flow-story-hud .hud-caption .viz-cap-head { display: none; }
.flow-story-hud .hud-caption .viz-cap-body { font-size: 12.5px; line-height: 1.5; }
.flow-story-hud .hud-caption .viz-cap-outcome { margin-top: 6px; padding-top: 6px; }
.flow-story-hud .hud-progress { display: flex; gap: 5px; margin-top: 10px; }
.flow-story-hud .hud-progress .story-progress-seg { height: 3px; }
.flow-story-hud .btn { min-height: 30px; padding: 4px 10px; font-size: 11px; }
@media (max-width: 1080px) {
  .flow-story-hud:not([hidden]) {
    display: block;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(201, 162, 94, 0.38);
    background: rgba(201, 162, 94, 0.06);
    scroll-margin-top: 92px;
  }
  .flow-story-hud .hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .flow-story-hud .hud-kicker { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold, #C9A25E); }
  .flow-story-hud .hud-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .flow-story-hud .hud-close { min-width: 30px; height: 30px; }
  .flow-story-hud .hud-caption { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary, rgba(246, 240, 228, 0.78)); }
  .flow-story-hud .hud-caption .viz-cap-head { display: none; }
  .flow-story-hud .hud-caption .viz-cap-body { font-size: 12.5px; line-height: 1.5; }
  .flow-story-hud .hud-caption .viz-cap-outcome { margin-top: 6px; padding-top: 6px; }
  .flow-story-hud .hud-progress { display: flex; gap: 5px; margin-top: 10px; }
  .flow-story-hud .hud-progress .story-progress-seg { height: 3px; }
  .flow-story-hud .btn { min-height: 30px; padding: 4px 10px; font-size: 11px; }
}
