
/* Theme tokens · shared brand with The Briefing (tb-theme). Dark = warm ink, light = parchment. */
:root {
  --a-bg: #14120e;
  --a-ocean: #191612;
  --a-land: #2c2820;
  --a-land-line: #4b4436;
  --a-panel: #1c1a15;
  --a-panel-2: #272319;
  --a-line: #3a352c;
  --a-line-strong: #4f4839;
  --a-text: #f2ede0;
  --a-text-2: #b8b2a4;
  --a-text-3: #837c6c;
  --a-brass: #c8a961;
  --a-focus: #e08a5a;
  --a-graticule: #201d16;
  --a-label: #ddd6c6;
  --a-halo: rgba(20, 18, 14, 0.92);
  --a-trace: #e8d9ac;
  --a-scrim: rgba(10, 9, 7, 0.72);
  --a-shadow: rgba(0, 0, 0, 0.65);
  --c-ai: #d4705f;
  --c-ml: #6f9de0;
  --c-tech: #5bad82;
  --c-research: #ab8bd4;
  --c-entity: #b7a97e;
  --sans: "Helvetica Neue", Arial, system-ui, sans-serif;
  --display: "Playfair Display", Georgia, serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  --a-bg: #fbfaf5;
  --a-ocean: #f1efe6;
  --a-land: #e5e1d2;
  --a-land-line: #cfc9b6;
  --a-panel: #ffffff;
  --a-panel-2: #f3f1e8;
  --a-line: #d8d4c7;
  --a-line-strong: #b5afa0;
  --a-text: #1a1a1a;
  --a-text-2: #4a4a4a;
  --a-text-3: #857f70;
  --a-brass: #8a6d1f;
  --a-focus: #7a1d1d;
  --a-graticule: #e9e6d9;
  --a-label: #33322c;
  --a-halo: rgba(251, 250, 245, 0.92);
  --a-trace: #8a6d1f;
  --a-scrim: rgba(70, 64, 52, 0.45);
  --a-shadow: rgba(80, 68, 40, 0.22);
  --c-ai: #9c2b2b;
  --c-ml: #2c4a6e;
  --c-tech: #2d5a3d;
  --c-research: #6d3a61;
  --c-entity: #8a7648;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body.map-body {
  margin: 0;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: var(--sans);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font-family: var(--sans); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--a-focus); outline-offset: 2px; }

/* ── Topbar (condensed) ── */
.map-topbar {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--a-line);
  background: var(--a-bg);
  z-index: 30;
  flex-wrap: wrap;
}
.map-namewrap { display: flex; flex-direction: column; gap: 1px; }
.map-name { font-family: var(--display); font-weight: 900; font-size: 1.35rem; margin: 0; letter-spacing: -0.012em; color: var(--a-text); line-height: 1.05; }
.map-tagline { margin: 0; font-size: 0.68rem; color: var(--a-text-2); letter-spacing: 0.015em; }
.map-status {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  background: none; border: none; padding: 3px 10px; border-radius: 6px;
  cursor: pointer; text-align: right; max-width: 480px;
  margin-left: auto;
}
.map-status:hover { background: var(--a-panel); }
.status-line { font-size: 0.78rem; color: var(--a-text-2); line-height: 1.35; }
.status-line b { color: var(--a-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.status-updated { font-size: 0.64rem; color: var(--a-text-3); letter-spacing: 0.07em; text-transform: uppercase; }
.map-actions { display: flex; gap: 0.5rem; align-items: center; }

.viewswitch { display: inline-flex; border: 1px solid var(--a-line); border-radius: 7px; overflow: hidden; }
.vbtn {
  padding: 5px 12px; background: transparent; border: none;
  border-right: 1px solid var(--a-line);
  color: var(--a-text-2); font-size: 0.71rem; font-weight: 600; letter-spacing: 0.03em;
  cursor: pointer; transition: background 130ms ease, color 130ms ease;
}
.vbtn:last-child { border-right: none; }
.vbtn:hover { color: var(--a-text); }
.vbtn.active { background: var(--a-panel-2); color: var(--a-text); }

.map-btn {
  padding: 5px 12px; background: transparent;
  border: 1px solid var(--a-line); border-radius: 7px;
  color: var(--a-text-2); font-size: 0.71rem; font-weight: 600; letter-spacing: 0.03em;
  cursor: pointer; transition: color 130ms ease, border-color 130ms ease, background 130ms ease;
}
.map-btn:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.map-btn.active { background: var(--a-text); border-color: var(--a-text); color: var(--a-bg); }
.map-btn-icon { width: 28px; padding: 5px 0; text-align: center; font-weight: 700; }

/* ── Data health ── */
.datahealth {
  position: fixed; top: 52px; left: 200px; z-index: 40;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 10px;
  padding: 1rem 1.2rem; width: 300px;
  box-shadow: 0 18px 48px -16px var(--a-shadow);
}
.datahealth h3 { margin: 0 0 0.6rem; font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--a-text-3); }
.datahealth dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; font-size: 0.76rem; }
.datahealth dt { color: var(--a-text-2); }
.datahealth dd { margin: 0; color: var(--a-text); font-variant-numeric: tabular-nums; text-align: right; }
.dh-note { margin: 0.7rem 0 0; font-size: 0.68rem; color: var(--a-text-3); line-height: 1.5; }

/* ── Controls (single condensed row) ── */
.map-controls {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--a-line);
  background: var(--a-bg);
  z-index: 25;
  overflow: visible;
  flex-wrap: wrap;
  position: relative;
}

/* ── Filter dropdown groups ── */
.fgroup { position: relative; flex-shrink: 0; }
.fbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--a-line); border-radius: 7px;
  background: transparent; color: var(--a-text-2);
  font-family: var(--sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em;
  cursor: pointer; transition: all 130ms ease; white-space: nowrap;
}
.fbtn:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.fbtn.open { background: var(--a-panel-2); color: var(--a-text); }
.fsum { font-weight: 400; color: var(--a-text-3); font-variant-numeric: tabular-nums; }
.fcaret { font-size: 0.55rem; color: var(--a-text-3); }
.fpanel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 46;
  min-width: 240px; max-width: 340px;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 10px;
  padding: 0.7rem 0.8rem 0.8rem;
  box-shadow: 0 18px 48px -16px var(--a-shadow);
}
.fp-label { margin: 0 0 0.4rem; font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-text-3); font-weight: 700; }
.fp-note { margin: 0 0 0.6rem; font-size: 0.72rem; line-height: 1.5; color: var(--a-text-2); max-width: 300px; }
.fp-label + .fp-label, .fp-chips + .fp-label { margin-top: 0.7rem; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.help-ex { font-style: italic; color: var(--a-text-3); font-size: 0.7rem; }
.ctrl-sep { width: 1px; height: 16px; background: var(--a-line); flex-shrink: 0; }
.chips { display: flex; gap: 0.3rem; flex-shrink: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--a-line); border-radius: 6px;
  background: transparent; color: var(--a-text-2);
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer; transition: all 130ms ease; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chip-c); }
.chip .swatch { width: 12px; height: 2px; border-radius: 1px; background: var(--chip-c); }
.chip:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.chip.on { background: var(--a-panel-2); color: var(--a-text); }
.chip.off { opacity: 0.38; }
.chip .cnt { font-variant-numeric: tabular-nums; opacity: 0.55; font-weight: 400; }
.stab.active { background: var(--a-text); color: var(--a-bg); border-color: var(--a-text); }
.stab.active .cnt { opacity: 0.75; }

.map-search {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 3px 10px;
  border: 1px solid var(--a-line); border-radius: 6px;
  color: var(--a-text-3);
  min-width: 190px; flex-shrink: 0; margin-left: auto;
  transition: border-color 130ms ease;
  position: relative;
}
.map-search:focus-within { border-color: var(--a-line-strong); }
.map-search input { background: transparent; border: none; outline: none; color: var(--a-text); font-family: var(--sans); font-size: 0.74rem; width: 100%; }
.map-search input::placeholder { color: var(--a-text-3); }
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 340px; max-height: 320px; overflow-y: auto;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 10px;
  box-shadow: 0 18px 48px -16px var(--a-shadow);
  z-index: 45;
}
.sr-group { padding: 0.45rem 0.8rem 0.15rem; font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--a-text-3); }
.sr-item {
  display: block; width: 100%; text-align: left;
  padding: 0.5rem 0.8rem;
  background: none; border: none;
  color: var(--a-text-2); font-size: 0.76rem; cursor: pointer; line-height: 1.35;
}
.sr-item:hover, .sr-item.active { background: var(--a-panel-2); color: var(--a-text); }
.sr-item .sr-sub { display: block; font-size: 0.62rem; color: var(--a-text-3); }

/* ── Strip (Cascades / Insights) · collapsed by default ── */
.strip { border-bottom: 1px solid var(--a-line); background: var(--a-bg); padding: 0.55rem 1rem 0.65rem; z-index: 24; }
.strip-cards { display: flex; gap: 0.55rem; overflow-x: auto; scrollbar-width: none; }
.strip-cards::-webkit-scrollbar { display: none; }
.strip-card {
  min-width: 260px; max-width: 330px; text-align: left;
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: 9px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}
.strip-card:hover { border-color: var(--a-line-strong); background: var(--a-panel-2); }
.strip-label {
  display: flex; align-items: center; flex-shrink: 0;
  font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700;
  color: var(--a-text-3); padding-right: 0.4rem; max-width: 92px; line-height: 1.5;
}
a.map-btn { text-decoration: none; display: inline-flex; align-items: center; }
.sc-title {
  font-family: var(--display); font-weight: 700; font-size: 0.98rem; color: var(--a-text);
  margin: 0 0 0.25rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sc-meta { font-size: 0.72rem; color: var(--a-text-3); margin: 0; letter-spacing: 0.03em; }
.sc-tag { display: inline-block; margin-top: 0.35rem; font-size: 0.68rem; letter-spacing: 0.02em; color: var(--a-text-3); border: 1px solid var(--a-line); border-radius: 4px; padding: 1px 7px; }

/* ── View bar / trace banner ── */
.viewbar {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 0.35rem 1rem;
  background: var(--a-panel); border-bottom: 1px solid var(--a-line);
  font-size: 0.72rem; color: var(--a-text-2); z-index: 23;
}
.trace-banner {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 0.4rem 1rem;
  background: var(--a-panel-2); border-bottom: 1px solid var(--a-line-strong);
  color: var(--a-text); font-size: 0.74rem; font-weight: 600; z-index: 24;
}

/* ── Stage ── */
.map-stage { position: relative; flex: 1; min-height: 0; }
#map-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#map-svg:active { cursor: grabbing; }
.sphere { fill: var(--a-ocean); }
.graticule { fill: none; stroke: var(--a-graticule); stroke-width: 0.4; }
.country { fill: var(--a-land); stroke: var(--a-land-line); stroke-width: 0.5; transition: stroke 150ms ease; }
.country.has-events { cursor: pointer; }
.country.has-events:hover { stroke: var(--a-text-3); stroke-width: 0.8; }

.zoombtns { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 5px; z-index: 10; }
.zoombtns button {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--a-panel); border: 1px solid var(--a-line);
  color: var(--a-text-2); font-size: 1rem; cursor: pointer; transition: all 120ms ease;
}
.zoombtns button:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.netopts { position: absolute; left: 14px; top: 14px; z-index: 10; }

/* ── Table ── */
.table-view { position: absolute; inset: 0; background: var(--a-bg); z-index: 12; display: flex; flex-direction: column; }
.table-tools { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.2rem; border-bottom: 1px solid var(--a-line); font-size: 0.74rem; color: var(--a-text-2); }
.table-actions { display: flex; gap: 0.5rem; }
.table-scroll { flex: 1; overflow: auto; }
#atlas-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
#atlas-table th {
  position: sticky; top: 0;
  background: var(--a-panel);
  text-align: left; padding: 0.6rem 1rem;
  font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--a-text-3); border-bottom: 1px solid var(--a-line-strong);
  cursor: pointer; user-select: none; white-space: nowrap;
}
#atlas-table th:hover { color: var(--a-text); }
#atlas-table td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--a-line); color: var(--a-text-2); vertical-align: top; }
#atlas-table tbody tr { cursor: pointer; }
#atlas-table tbody tr:hover td { background: var(--a-panel); }
#atlas-table .td-event { color: var(--a-text); font-family: var(--display); font-weight: 700; max-width: 420px; }
#atlas-table .td-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
#atlas-table .theme-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }

/* ── Tooltip / toast ── */
.map-tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  max-width: 270px;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 8px;
  padding: 9px 12px;
  box-shadow: 0 12px 34px -12px var(--a-shadow);
}
.tt-kicker { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; margin: 0 0 3px; }
.tt-head { font-family: var(--display); font-weight: 700; font-size: 0.88rem; line-height: 1.3; margin: 0 0 4px; color: var(--a-text); }
.tt-meta { font-size: 0.7rem; color: var(--a-text-3); margin: 0; letter-spacing: 0.03em; }
.map-toast {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--a-panel-2); border: 1px solid var(--a-line-strong);
  color: var(--a-text);
  padding: 8px 16px; border-radius: 8px;
  font-size: 0.76rem; font-weight: 600; z-index: 22;
}

/* ── Empty / loading / onboarding ── */
.empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem;
  z-index: 15; color: var(--a-text-2); font-size: 0.85rem;
  background: var(--a-scrim);
}
.map-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem;
  background: var(--a-bg); z-index: 40;
  color: var(--a-text-3); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.map-loading-ring {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--a-line); border-top-color: var(--a-text-2);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ── Cinematic intro ── */
.atlas-intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--a-bg);
  transition: opacity 600ms ease;
}
.atlas-intro.out { opacity: 0; pointer-events: none; }
#intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-copy {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(1020px, 93vw);
  height: min(660px, 84vh);
  z-index: 2; text-align: center;
}
.intro-copy::before {
  content: '';
  position: absolute; inset: -14% -16%;
  background: radial-gradient(closest-side, var(--a-bg) 52%, transparent 86%);
  z-index: -1;
}
.intro-beat {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-42%);
  opacity: 0; pointer-events: none;
  transition: opacity 800ms ease, transform 800ms ease;
}
.intro-beat.on { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
.ib-kicker { font-size: 0.7rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--a-text-3); margin: 0 0 1.2rem; font-weight: 700; }
.ib-big {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2rem, 5.6vw, 3.4rem);
  line-height: 1.08; color: var(--a-text);
  margin: 0 0 1.2rem; letter-spacing: -0.02em;
  text-wrap: balance;
}
.ib-sub { font-size: 1.12rem; line-height: 1.6; color: var(--a-text-2); margin: 0 auto; max-width: 34rem; }
.ib-sub b { color: var(--a-text); font-variant-numeric: tabular-nums; }
.intro-enter {
  padding: 14px 28px;
  background: var(--a-text); color: var(--a-bg);
  border: 1px solid var(--a-text); border-radius: 8px;
  font-family: var(--sans); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}
.intro-enter:hover { transform: translateY(-2px); opacity: 0.92; }
.intro-enter span { display: inline-block; transition: transform 180ms ease; }
.intro-enter:hover span { transform: translateX(4px); }
.intro-skip {
  position: absolute; top: 18px; right: 20px; z-index: 3;
  background: none; border: 1px solid var(--a-line); border-radius: 7px;
  color: var(--a-text-3); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  padding: 6px 13px; cursor: pointer; transition: all 150ms ease;
}
.intro-skip:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.intro-dots {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 3;
}
.intro-dots button {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  border: none; background: var(--a-line-strong);
  cursor: pointer;
  transition: background 300ms ease, transform 300ms ease;
}
.intro-dots button.on { background: var(--a-text); transform: scale(1.3); }

/* ── Intro scenes: staged reveals ── */
@keyframes ibFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ibSettle { to { opacity: 0.4; transform: translateY(-12px) scale(0.95); } }
@keyframes ibDim { to { opacity: 0.3; } }
@keyframes ibGrow { to { transform: scaleY(1); } }

.ib-headline {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.9rem, 5vw, 3.1rem); line-height: 1.14;
  color: var(--a-text); margin: 0 0 1.5rem; letter-spacing: -0.018em;
  text-wrap: balance; opacity: 0;
}
.intro-beat.on .ib-headline { animation: ibFadeUp 800ms ease 150ms both, ibSettle 900ms ease 2400ms forwards; }
.ib-line { font-size: 1.18rem; color: var(--a-text-2); margin: 0 0 0.6rem; opacity: 0; }
.ib-line.ib-l2 { font-family: var(--display); font-weight: 700; font-size: 1.75rem; color: var(--a-text); }
.intro-beat[data-beat="1"].on .ib-l1 { animation: ibFadeUp 700ms ease 2900ms both; }
.intro-beat[data-beat="1"].on .ib-l2 { animation: ibFadeUp 700ms ease 3900ms both; }

.ib-chain { max-width: 36rem; margin: 0 auto 1.3rem; text-align: left; position: relative; padding-left: 24px; }
.ib-chain::before {
  content: ''; position: absolute; left: 5px; top: 10px; bottom: 12px; width: 1px;
  background: var(--a-line-strong); transform-origin: top; transform: scaleY(0);
}
.intro-beat.on .ib-chain::before { animation: ibGrow 2.4s ease 600ms forwards; }
.ib-step { position: relative; margin-bottom: 0.8rem; opacity: 0; }
.intro-beat.on .ib-step { animation: ibFadeUp 550ms ease both; animation-delay: calc(500ms + var(--i) * 500ms); }
.ib-sdot { position: absolute; left: -21px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--a-focus); border: 2px solid var(--a-bg); }
.ib-step:first-child .ib-sdot { background: var(--a-text); }
.ib-smeta { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a-text-3); font-weight: 700; margin-bottom: 3px; }
.ib-linkword { color: var(--a-focus); }
.ib-ev { display: block; font-family: var(--display); font-weight: 700; font-size: 1.08rem; line-height: 1.35; color: var(--a-text); }
.intro-beat[data-beat="2"].on .ib-l1 { animation: ibFadeUp 700ms ease 3300ms both; }

.ib-feed { display: flex; flex-direction: column; gap: 9px; max-width: 36rem; margin: 0 auto 1.3rem; text-align: left; }
.ib-card {
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: 8px;
  padding: 9px 13px;
  font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.35; color: var(--a-text);
  opacity: 0;
}
.intro-beat.on .ib-card {
  animation: ibFadeUp 450ms ease both, ibDim 700ms ease forwards;
  animation-delay: calc(200ms + var(--i) * 260ms), 2300ms;
}
.ib-cdate { margin-right: 10px; font-family: var(--sans); font-weight: 600; font-size: 0.63rem; color: var(--a-text-3); letter-spacing: 0.1em; text-transform: uppercase; }
.intro-beat[data-beat="3"].on .ib-l1 { animation: ibFadeUp 650ms ease 2500ms both; }
.intro-beat[data-beat="3"].on .ib-l2 { animation: ibFadeUp 650ms ease 3300ms both; }

.intro-beat[data-beat="4"].on .ib-big { animation: ibFadeUp 750ms ease 150ms both; }
.intro-beat[data-beat="4"].on .ib-sub { animation: ibFadeUp 750ms ease 700ms both; }
.ib-ctas { display: flex; gap: 0.7rem; justify-content: center; align-items: center; margin-top: 1.7rem; flex-wrap: wrap; opacity: 0; }
.intro-beat.on .ib-ctas { animation: ibFadeUp 600ms ease 1200ms both; }
.ib-ctas .intro-enter { margin-top: 0; }
.intro-secondary {
  background: none; border: 1px solid var(--a-line-strong); border-radius: 8px;
  color: var(--a-text-2); padding: 14px 28px;
  font-family: var(--sans); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.intro-secondary:hover { color: var(--a-text); border-color: var(--a-text-3); }
.ib-seq { color: var(--a-focus); }

/* ── Intro gateway (beat 0) · the "because of it" screen ── */
.intro-beat.ib-gateway {
  top: 0; bottom: 0; transform: none;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
}
.intro-beat.ib-gateway.on { transform: none; }
.ib-gateway .ib-kicker { opacity: 0; }
.ib-gateway.on .ib-kicker { animation: ibFadeUp 700ms ease 150ms both; }
.gw-head {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.14;
  color: var(--a-text); margin: 0 0 1.7rem; letter-spacing: -0.02em;
  text-wrap: balance;
  opacity: 0;
}
.intro-beat.on .gw-head { animation: ibFadeUp 800ms ease 350ms both; }
.gw-accent { color: var(--a-focus); }
.gw-accent em { font-style: italic; }
.gw-lines { font-size: 1.12rem; line-height: 1.9; color: var(--a-text-2); margin: 0 0 2.1rem; }
.gw-lines span { display: block; opacity: 0; }
.intro-beat.on .gw-lines span { animation: ibFadeUp 550ms ease both; animation-delay: calc(1200ms + var(--i) * 320ms); }
.gw-ctas { display: flex; gap: 0.8rem; align-items: center; justify-content: center; flex-wrap: wrap; opacity: 0; }
.intro-beat.on .gw-ctas { animation: ibFadeUp 650ms ease 2400ms both; }
.gw-stats {
  display: flex; gap: 3rem; flex-wrap: wrap; justify-content: center;
  margin-top: 2.8rem; padding-top: 1.5rem;
  border-top: 1px solid var(--a-line);
  opacity: 0;
}
.intro-beat.on .gw-stats { animation: ibFadeUp 700ms ease 3000ms both; }
.gw-stat { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.gw-stat b { font-size: 1.55rem; font-weight: 700; color: var(--a-text); font-variant-numeric: tabular-nums; }
.gw-stat span { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--a-text-3); font-weight: 700; }
@media (max-height: 740px) {
  .gw-head { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; }
  .gw-lines { font-size: 1rem; line-height: 1.7; margin-bottom: 1.4rem; }
  .gw-stats { margin-top: 1.8rem; padding-top: 1rem; gap: 2rem; }
  .gw-stat b { font-size: 1.2rem; }
}

/* ── Guided tour ── */
/* The layer soaks up every click so the app can't be used mid-tour · Show me does the demos. */
.tour-layer { position: fixed; inset: 0; z-index: 90; pointer-events: auto; }
.tour-hole {
  position: fixed;
  border-radius: 12px;
  box-shadow: 0 0 0 200vmax var(--a-scrim);
  transition: top 400ms cubic-bezier(0.4, 0, 0.2, 1), left 400ms cubic-bezier(0.4, 0, 0.2, 1), width 400ms cubic-bezier(0.4, 0, 0.2, 1), height 400ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.tour-tip {
  position: fixed; z-index: 95;
  width: min(340px, calc(100vw - 24px));
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 12px;
  padding: 1rem 1.1rem 0.9rem;
  box-shadow: 0 20px 50px -18px var(--a-shadow);
  pointer-events: auto;
  transition: top 400ms cubic-bezier(0.4, 0, 0.2, 1), left 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-x {
  position: absolute; top: 8px; right: 10px;
  width: 26px; height: 26px;
  background: none; border: none; border-radius: 6px;
  color: var(--a-text-3); font-size: 1rem; cursor: pointer;
}
.tour-x:hover { color: var(--a-text); background: var(--a-panel-2); }
.tour-title { font-family: var(--display); font-weight: 900; font-size: 1.02rem; color: var(--a-text); margin: 0 1.4rem 0.35rem 0; }
.tour-copy { font-size: 0.8rem; line-height: 1.55; color: var(--a-text-2); margin: 0 0 0.85rem; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tour-progress { display: flex; align-items: center; gap: 8px; font-size: 0.62rem; color: var(--a-text-3); font-variant-numeric: tabular-nums; }
.tour-dots { display: flex; gap: 3px; }
.tour-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--a-line-strong); }
.tour-dots i.on { background: var(--a-text); }
.tour-btns { display: flex; gap: 0.4rem; }
.tour-primary { background: var(--a-text) !important; color: var(--a-bg) !important; border-color: var(--a-text) !important; }
.tour-confirm p { font-size: 0.76rem; color: var(--a-text-2); margin: 0 0 0.7rem; line-height: 1.5; }
.tour-confirm b { color: var(--a-text); }

.tour-modal {
  position: fixed; inset: 0; z-index: 96;
  background: var(--a-scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.tour-card {
  position: relative;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 14px;
  max-width: 420px; width: 100%;
  padding: 1.8rem 1.9rem;
  box-shadow: 0 24px 60px -20px var(--a-shadow);
  text-align: center; overflow: hidden;
}
.tc-kicker { font-size: 0.6rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--a-text-3); font-weight: 700; margin: 0 0 0.7rem; }
.tc-head { font-family: var(--display); font-weight: 900; font-size: 1.55rem; color: var(--a-text); margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.tc-sub { font-size: 0.84rem; line-height: 1.6; color: var(--a-text-2); margin: 0 0 1.2rem; }
.tc-sub b { color: var(--a-text); }
.tc-btns { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.tc-btns .map-btn { padding: 9px 18px; font-size: 0.78rem; }

.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: -10px;
  width: 6px; height: 10px; border-radius: 1px;
  opacity: 0;
  animation: confetti-fall 1600ms ease-in forwards;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(340px) rotate(540deg); }
}

/* ── Brand lockup (back to The Briefing) ── */
.map-brandlock {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--a-text); text-decoration: none;
  padding: 3px 1.1rem 3px 0;
  border-right: 1px solid var(--a-line);
}
.bl-text { display: flex; flex-direction: column; line-height: 1.3; }
.bl-name { font-family: var(--display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.01em; }
.bl-back { font-size: 0.58rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--a-text-3); transition: color 150ms ease; white-space: nowrap; }
.bl-arrow { display: inline-block; transition: transform 180ms ease; }
.map-brandlock:hover .bl-back { color: var(--a-focus); }
.map-brandlock:hover .bl-name { color: var(--a-focus); }
.map-brandlock:hover .bl-arrow { transform: translateX(-3px); }

.help-guided { display: flex; gap: 0.5rem; margin: 0.2rem 0 1rem !important; }

/* ── Scrubber ── */
.map-timeline {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.45rem 1rem 0.55rem;
  border-top: 1px solid var(--a-line);
  background: var(--a-bg); z-index: 26;
}
.tl-play {
  width: 30px; height: 30px; border-radius: 7px;
  background: transparent; border: 1px solid var(--a-line);
  color: var(--a-text-2); font-size: 0.72rem; cursor: pointer; flex-shrink: 0;
  transition: all 130ms ease;
}
.tl-play:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.tl-track { flex: 1; }
#tl-range { width: 100%; appearance: none; height: 3px; border-radius: 2px; background: var(--a-line-strong); outline: none; cursor: pointer; }
#tl-range::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--a-text); border: none; cursor: grab; }
.tl-labels { display: flex; justify-content: space-between; font-size: 0.58rem; color: var(--a-text-3); letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.tl-current { color: var(--a-text-2); font-weight: 700; }

/* ── Panel ── */
.map-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 92vw);
  background: var(--a-panel);
  border-left: 1px solid var(--a-line-strong);
  z-index: 50; overflow-y: auto;
  box-shadow: -18px 0 50px -20px var(--a-shadow);
}
.panel-close {
  position: absolute; top: 10px; right: 12px;
  width: 28px; height: 28px;
  background: var(--a-panel-2); border: 1px solid var(--a-line); border-radius: 7px;
  color: var(--a-text-2); font-size: 1rem; cursor: pointer; z-index: 2;
}
.panel-close:hover { color: var(--a-text); }
.panel-body { padding: 1.3rem 1.3rem 2rem; }
.p-hero { width: calc(100% + 2.6rem); margin: -1.3rem -1.3rem 1rem; aspect-ratio: 16/9; object-fit: cover; display: block; }
.p-kicker { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700; margin: 0 0 0.45rem; }
.p-head { font-family: var(--display); font-weight: 900; font-size: 1.25rem; line-height: 1.18; margin: 0 0 0.55rem; color: var(--a-text); letter-spacing: -0.01em; }
.p-meta { font-size: 0.68rem; color: var(--a-text-3); letter-spacing: 0.05em; margin: 0 0 0.85rem; }
.p-sum { font-size: 0.98rem; line-height: 1.65; color: var(--a-text-2); margin: 0 0 1rem; }
.p-also { font-size: 0.7rem; color: var(--a-text-3); margin: -0.5rem 0 0.9rem; line-height: 1.5; }
.p-also a { color: var(--a-text-2); }
.p-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--a-line-strong); border-radius: 4px;
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--a-text-3); margin: 0 0 0.9rem;
}
.p-row { display: flex; gap: 0.45rem; margin-bottom: 1.1rem; }
.p-read {
  flex: 1; display: inline-flex; justify-content: center;
  padding: 9px 13px;
  background: var(--a-text); color: var(--a-bg);
  border-radius: 7px; text-decoration: none;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  transition: opacity 130ms ease;
}
.p-read:hover { opacity: 0.88; }
.p-iconbtn {
  width: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--a-line); border-radius: 7px;
  color: var(--a-text-2); cursor: pointer; font-size: 0.9rem; transition: all 130ms ease;
}
.p-iconbtn:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.p-iconbtn.starred { color: var(--a-brass); border-color: var(--a-brass); }
.p-sec { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--a-text-3); font-weight: 700; margin: 1.2rem 0 0.55rem; border-bottom: 1px solid var(--a-line); padding-bottom: 0.35rem; }
.p-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.p-tag {
  padding: 3px 9px;
  background: transparent; border: 1px solid var(--a-line); border-radius: 5px;
  font-size: 0.68rem; color: var(--a-text-2); cursor: pointer;
  transition: all 130ms ease; display: inline-flex; align-items: center; gap: 5px;
}
.p-tag:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.p-tag.watch { border-color: var(--a-brass); color: var(--a-brass); }
.p-tag-org { cursor: pointer; }
.p-tag-org:hover { border-color: var(--a-entity); color: var(--a-text); }
.p-tag-n { font-size: 0.6rem; color: var(--a-text-3); }
.p-tag-org:hover .p-tag-n { color: var(--a-entity); }
.p-tag-plain { cursor: default; }
.p-tag-plain:hover { color: var(--a-text-2); border-color: var(--a-line); }
.p-conn { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.p-conn li { border: 1px solid var(--a-line); border-radius: 8px; overflow: hidden; }
.p-conn button {
  width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 8px 11px; cursor: pointer;
  color: var(--a-text-2); transition: background 130ms ease;
}
.p-conn button:hover { background: var(--a-panel-2); }
.p-conn .c-type { font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; display: inline-block; margin-bottom: 3px; }
.p-conn .c-head { display: block; font-family: var(--display); font-weight: 700; font-size: 0.88rem; color: var(--a-text); line-height: 1.3; margin-bottom: 2px; }
.p-conn .c-reason { display: block; font-size: 0.76rem; color: var(--a-text-3); line-height: 1.45; }
.p-empty { font-size: 0.76rem; color: var(--a-text-3); font-style: italic; }
.p-foot { margin: 1rem 0 0.2rem; font-size: 0.7rem; color: var(--a-text-3); line-height: 1.5; }

/* ── Company dossier · one organization as a flowing record ── */
.dossier { position: fixed; inset: 0; z-index: 1250; background: var(--a-bg); display: flex; flex-direction: column; }
.dossier[hidden] { display: none; }
.dossier-head { position: relative; padding: 1.1rem 1.5rem 0.9rem; border-bottom: 1px solid var(--a-line); }
.dossier-kicker { margin: 0; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--a-text-3); }
.dossier-name { margin: 0.15rem 0 0.2rem; font-family: var(--display, serif); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -0.015em; color: var(--a-text); }
.dossier-stats { margin: 0 0 0.55rem; font-size: 0.78rem; color: var(--a-text-2); font-variant-numeric: tabular-nums; }
.dossier-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dossier-co { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.dossier-co-label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a-text-3); margin-right: 0.2rem; }
.co-chip { font: inherit; font-size: 0.72rem; color: var(--a-text-2); background: var(--a-surface); border: 1px solid var(--a-line); padding: 3px 9px; cursor: pointer; }
.co-chip:hover { color: var(--a-accent); border-color: var(--a-accent); }
.dossier-pick { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a-text-3); display: inline-flex; align-items: center; gap: 0.5rem; }
.dossier-pick select { font: inherit; font-size: 0.8rem; letter-spacing: normal; text-transform: none; color: var(--a-text); background: var(--a-surface); border: 1px solid var(--a-line); padding: 5px 8px; max-width: 240px; }
.dossier-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.55rem; }
.dossier-key { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; color: var(--a-text-2); }
.dossier-key-line { display: inline-block; width: 16px; height: 2px; }
.dossier-body { flex: 1; overflow-y: auto; position: relative; padding: 1.2rem 1.6rem 3.5rem; }
/* Two-column record: the whole width works, no empty right half, far less scroll */
.dossier-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1240px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.65rem 0.9rem; align-items: start;
}
.dossier-month { grid-column: 1 / -1; font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-text-3); margin: 0.9rem 0 0; padding-bottom: 0.3rem; border-bottom: 1px solid var(--a-line); }
.dossier-month:first-child { margin-top: 0; }
.dossier-item button { display: block; width: 100%; height: 100%; text-align: left; font: inherit; color: inherit; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 6px; padding: 0.7rem 0.9rem 0.75rem; cursor: pointer; transition: border-color 140ms ease, transform 140ms ease; }
.dossier-item button:hover { border-color: var(--a-accent); transform: translateY(-1px); }
.dossier-item.flash button { border-color: var(--a-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--a-accent) 30%, transparent); }
.di-top { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.25rem; }
.di-date { font-size: 0.7rem; color: var(--a-text-3); font-variant-numeric: tabular-nums; }
.di-cat { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }
.di-hot { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--a-accent); }
.di-head { display: block; font-family: var(--display, serif); font-weight: 700; font-size: 0.98rem; line-height: 1.35; letter-spacing: -0.01em; color: var(--a-text); }
.di-sum { display: block; margin-top: 0.25rem; font-size: 0.76rem; line-height: 1.5; color: var(--a-text-3); }
/* The company's name lights up wherever it appears */
.di-hit { background: color-mix(in srgb, var(--a-accent) 14%, transparent); color: var(--a-text); border-radius: 2px; padding: 0 2px; font-weight: 700; }
/* One quiet breadcrumb per card: where the event led */
.di-links { display: block; margin-top: 0.4rem; }
.di-link { font: inherit; font-size: 0.68rem; line-height: 1.4; color: var(--a-text-2); background: none; border: none; padding: 0; cursor: pointer; text-align: left; transition: color 120ms ease; }
.di-link:hover { color: var(--a-text); text-decoration: underline; }
.di-link b { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.58rem; }
.dossier-how { font-size: 0.76rem; line-height: 1.55; color: var(--a-text-2); max-width: 62ch; display: block; }
/* Passing mentions: the company appears, but the story is someone else's */
.dossier-mentions { max-width: 1240px; margin: 1.6rem auto 0; }
.dm-title { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-text-3); margin: 0 0 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--a-line); }
.dm-row { display: flex; align-items: baseline; gap: 0.8rem; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: none; border-bottom: 1px solid color-mix(in srgb, var(--a-line) 55%, transparent); padding: 0.42rem 0.2rem; cursor: pointer; }
.dm-row:hover .dm-head { color: var(--a-accent); }
.dm-date { font-size: 0.68rem; color: var(--a-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 78px; }
.dm-head { font-size: 0.82rem; line-height: 1.4; color: var(--a-text); }
@media (max-width: 640px) {
  .dossier-body { padding: 1rem 0.8rem 3rem; }
  .dossier-head { padding: 0.9rem 1rem 0.8rem; }
  .dossier-pick select { max-width: 160px; }
}

/* Explore panel: analytical lenses as tactile buttons, not text lines */
.fpanel-explore { min-width: 252px; }
.fp-item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; text-align: left; background: var(--a-surface-2, rgba(127,127,127,0.07)); border: 1px solid var(--a-line); padding: 0.6rem 0.75rem; margin: 0 0 0.45rem; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--a-text); cursor: pointer; transition: border-color 130ms ease, color 130ms ease; }
.fp-item::after { content: '→'; color: var(--a-text-3); font-weight: 400; }
.fp-item:hover { color: var(--a-accent); border-color: var(--a-accent); }
.fp-item:hover::after { color: var(--a-accent); }
.fp-item .cnt { margin-left: auto; font-size: 0.68rem; font-weight: 400; color: var(--a-text-3); }
.fp-item.active { color: var(--a-accent); border-color: var(--a-accent); }
.watch-list { display: flex; flex-direction: column; gap: 0.2rem; }
.watch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.2rem; font-size: 0.78rem; color: var(--a-text); }
.watch-remove { background: none; border: none; color: var(--a-text-3); font-size: 0.95rem; cursor: pointer; padding: 0 0.3rem; }
.watch-remove:hover { color: var(--a-accent); }
.p-status { margin: 0.35rem 0 0.8rem; font-size: 0.68rem; color: var(--a-text-3); letter-spacing: 0.03em; text-transform: uppercase; }
.p-report { margin-top: 0.4rem; background: none; border: none; color: var(--a-text-3); font-size: 0.7rem; cursor: pointer; text-decoration: underline; padding: 0; }
.p-report:hover { color: var(--a-text-2); }
.mr-form { margin-top: 0.6rem; padding: 0.75rem; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-panel-2); }
.mr-title { margin: 0 0 0.5rem; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--a-text); }
.mr-kinds { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 0.55rem; }
.mr-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.mr-kinds span { display: inline-block; padding: 3px 9px; border: 1px solid var(--a-line); border-radius: 999px; font-size: 0.66rem; color: var(--a-text-2); cursor: pointer; transition: all 120ms ease; }
.mr-kinds label:hover span { border-color: var(--a-line-strong); color: var(--a-text); }
.mr-kinds input:checked + span { background: var(--a-text); border-color: var(--a-text); color: var(--a-bg); }
.mr-note { width: 100%; box-sizing: border-box; padding: 6px 9px; border: 1px solid var(--a-line); border-radius: 6px; background: var(--a-bg); font: inherit; font-size: 0.74rem; color: var(--a-text); resize: vertical; margin-bottom: 0.5rem; }
.mr-note:focus { outline: none; border-color: var(--a-brass); }
.mr-actions { display: flex; gap: 6px; }
.mr-send, .mr-cancel { font: inherit; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.mr-send { background: var(--a-text); color: var(--a-bg); border: 1px solid var(--a-text); }
.mr-send:hover { background: var(--a-brass); border-color: var(--a-brass); }
.mr-cancel { background: none; color: var(--a-text-3); border: 1px solid var(--a-line); }
.mr-cancel:hover { color: var(--a-text); }
.mr-done { margin: 0; font-size: 0.74rem; color: var(--a-brass); }

/* story steps */
.p-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.p-steps li { position: relative; padding: 0 0 1.35rem 1.7rem; border-left: 1px solid var(--a-line-strong); margin-left: 0.55rem; }
.p-steps li:last-child { border-left-color: transparent; padding-bottom: 0.4rem; }
.p-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: -12px; top: 0;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--a-panel-2); border: 1px solid var(--a-line-strong);
  color: var(--a-text); font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.p-steps li.active::before { background: var(--a-brass); border-color: var(--a-brass); color: var(--a-bg); }
.p-steps .s-head { display: block; font-family: var(--display); font-weight: 700; font-size: 1.04rem; line-height: 1.32; color: var(--a-text); cursor: pointer; margin: 0 0 4px; }
.p-steps .s-head:hover { text-decoration: underline; }
.p-steps li.active .s-head { color: var(--a-brass); }
.p-steps .s-link { display: block; font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; margin: 0 0 5px; }
.p-steps .s-reason { display: block; font-size: 0.86rem; color: var(--a-text-2); line-height: 1.58; }
.p-steps .s-link + .s-reason { margin: -2px 0 9px; }
.p-steps .s-meta { display: block; font-size: 0.72rem; color: var(--a-text-3); letter-spacing: 0.04em; margin-top: 3px; }
.p-storynav { display: flex; gap: 0.45rem; margin-top: 1rem; flex-wrap: wrap; }

/* Editor-only export buttons */
.ed-label { display: inline-flex; align-items: center; font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--a-brass); margin-left: 0.8rem; }
.ed-btn { border-color: var(--a-brass) !important; }

/* ── Story mode · a quiet, focused reading of one chain. Design rules:
   The Briefing's own paper, type, and hairlines, nothing that couldn't
   appear elsewhere on the site. The rest of the page dims evenly (no
   vignette, no letterbox) and cannot be interacted with. ── */
#cinema-scrim {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(15, 13, 9, 0.93);
  opacity: 0; transition: opacity 600ms ease;
  pointer-events: auto; /* swallows every click on the page behind the story */
}
#cinema-scrim.on { opacity: 1; }
.map-stage.cinema { z-index: 610; }
#cinema-veil {
  position: absolute; inset: 0; pointer-events: auto; z-index: 5;
  opacity: 0; transition: opacity 600ms ease;
  background: rgba(15, 13, 9, 0.55); /* even darkening · the graph stays legible underneath */
}
.cinema #cinema-veil { opacity: 1; }
.cinema #map-svg { pointer-events: none; filter: saturate(0.85); transition: filter 600ms ease; }
.cinema .map-legend, .cinema #zoombtns, .cinema #map-timeline, .cinema #empty-state {
  visibility: hidden !important;
}
.cinema .node-label { opacity: 0 !important; transition: opacity 400ms ease; }
body.cinema-live .map-panel { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 350ms ease, visibility 0s 350ms; }
body.cinema-live #trace-banner, body.cinema-live #viewbar { opacity: 0; pointer-events: none; transition: opacity 350ms ease; }
/* Dimmed nodes are scenery, not controls · applies outside story mode too */
.node.dim { pointer-events: none; }
.cc-exit {
  position: fixed; top: 16px; right: 16px; z-index: 640; pointer-events: auto;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 999px;
  color: var(--a-text-2); font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 7px 16px; cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
  transition: all 150ms ease;
}
.cc-exit:hover { color: var(--a-text); border-color: var(--a-text); }
/* The reading card · a Briefing card, docked left so the graph keeps the floor */
#cinema-card {
  position: absolute; left: 24px; bottom: 60px; z-index: 8;
  transform: translateY(12px);
  width: min(400px, calc(100% - 48px));
  background: var(--a-panel);
  border: 1px solid var(--a-line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms ease;
}
#cinema-card.on { transform: translateY(0); opacity: 1; }
.cc-hero { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-bottom: 1px solid var(--a-line); }
.cc-hero[hidden] { display: none; }
.cc-body { padding: 0.85rem 1.15rem 0.9rem; }
.cc-top { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.45rem; }
.cc-kicker {
  font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  color: var(--a-brass); white-space: nowrap;
}
.cc-ctrl { display: flex; gap: 4px; margin-left: auto; }
.cc-ctrl button {
  background: none; border: 1px solid var(--a-line); border-radius: 5px;
  color: var(--a-text-3); font-size: 0.66rem; line-height: 1.4;
  padding: 2px 8px; cursor: pointer; pointer-events: auto; transition: all 140ms ease;
}
.cc-ctrl button:hover { color: var(--a-text); border-color: var(--a-line-strong); }
.cc-stamp { display: block; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a-text-3); margin: 0 0 0.3rem; }
.cc-head {
  font-family: var(--display); font-weight: 800; font-size: 1.18rem; line-height: 1.24;
  color: var(--a-text); margin: 0 0 0.45rem; letter-spacing: -0.01em;
}
.cc-head .cc-w { display: inline-block; opacity: 0; animation: cc-wordup 420ms ease forwards; }
@keyframes cc-wordup { to { opacity: 1; } }
.cc-meta { font-size: 0.66rem; color: var(--a-text-3); letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.4rem; }
.cc-why { font-size: 0.9rem; line-height: 1.6; color: var(--a-text-2); margin: 0 0 0.55rem; min-height: 1.6em; }
.cc-caret { display: inline-block; width: 2px; height: 1em; background: var(--a-brass); vertical-align: text-bottom; margin-left: 2px; animation: cc-blink 0.9s steps(1) infinite; }
@keyframes cc-blink { 50% { opacity: 0; } }
.cc-scenes { display: flex; align-items: center; gap: 0; margin: 0.1rem 0; }
.cc-scene {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1px solid var(--a-line-strong);
  background: none; padding: 0; cursor: pointer; pointer-events: auto; font-family: var(--sans, inherit);
  color: var(--a-text-3);
  font-size: 0.58rem; font-weight: 700; line-height: 18px; text-align: center;
  transition: all 250ms ease;
}
.cc-scene:hover { border-color: var(--a-text); color: var(--a-text); }
.cc-scene.done { background: var(--a-panel-2); color: var(--a-text-2); }
.cc-scene.now { background: var(--a-text); border-color: var(--a-text); color: var(--a-bg); }
.cc-rail { height: 1px; flex: 1; background: var(--a-line); min-width: 8px; }
.cc-rail.done { background: var(--a-text-3); }
.cc-hint {
  margin: 0.55rem 0 0; display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  font-size: 0.6rem; color: var(--a-text-3); transition: opacity 600ms ease;
}
.cc-hint kbd {
  font-family: var(--sans, inherit); font-size: 0.56rem; font-weight: 700;
  border: 1px solid var(--a-line-strong); border-bottom-width: 2px; border-radius: 4px;
  padding: 1px 5px; color: var(--a-text-2); background: var(--a-panel-2);
}
.cc-bar { height: 2px; background: var(--a-line); overflow: hidden; margin-top: 0.5rem; }
.cc-bar i { display: block; height: 100%; width: 0; background: var(--a-brass); }
.cc-end-actions { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.cc-replay, .cc-readlink {
  pointer-events: auto; cursor: pointer; text-decoration: none;
  border: 1px solid var(--a-text); border-radius: 6px;
  padding: 6px 14px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--a-text); color: var(--a-bg);
  transition: opacity 150ms ease, background 150ms ease;
}
.cc-readlink { background: none; color: var(--a-text); }
.cc-replay:hover { opacity: 0.85; }
.cc-readlink:hover { background: var(--a-panel-2); }
/* Time passing between scenes · bare type over the darkened map, like an
   intertitle: large, unmissable, gone before it overstays */
#cinema-gap {
  position: absolute; left: 0; right: 0; top: 15%; z-index: 8; text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 650ms ease;
}
#cinema-gap span {
  display: inline-block;
  font-family: var(--display); font-style: italic; font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: 0.12em;
  color: #f3ecd9; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.94); transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1), letter-spacing 900ms ease;
}
#cinema-gap.on { opacity: 1; }
#cinema-gap.on span { transform: scale(1); letter-spacing: 0.16em; }
/* On-map story furniture */
.cinema-pulse { pointer-events: none; }
.cinema-halo {
  pointer-events: none; fill: none; stroke: var(--a-brass);
  animation: cc-halo 2.4s ease-in-out infinite;
  transform-box: fill-box; transform-origin: center;
}
@keyframes cc-halo {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.3); }
}
.cinema-drawline { pointer-events: none; }
@media (max-width: 720px) {
  #cinema-card { left: 10px; right: 10px; bottom: 12px; width: auto; }
  .cc-head { font-size: 1.02rem; }
  .cc-hero { aspect-ratio: 16 / 6; }
}
@media (prefers-reduced-motion: reduce) {
  #cinema-card, #cinema-scrim, #cinema-veil { transition: none; }
  .cc-caret, .cinema-halo { animation: none; }
  .cc-head .cc-w { animation: none; opacity: 1; }
}

/* ── Help ── */
.map-help {
  position: fixed; inset: 0;
  background: var(--a-scrim);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.help-panel {
  position: relative;
  background: var(--a-panel); border: 1px solid var(--a-line-strong); border-radius: 12px;
  max-width: 520px; width: 100%; max-height: calc(100dvh - 3rem);
  overflow-y: auto; padding: 1.7rem;
}
.help-panel h2 { font-family: var(--display); font-weight: 900; margin: 0 0 0.6rem; font-size: 1.3rem; color: var(--a-text); }
.help-panel h3 { font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--a-text-3); margin: 1.3rem 0 0.55rem; }
.help-panel p { color: var(--a-text-2); font-size: 0.84rem; line-height: 1.6; margin: 0; }
.help-panel b { color: var(--a-text); }
.help-edges { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.help-edges li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.84rem; color: var(--a-text-2); }
.help-edges .sw { width: 26px; height: 3px; border-radius: 1px; flex-shrink: 0; }
.help-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.84rem; color: var(--a-text-2); line-height: 1.5; }

/* ── Graph elements ── */
.node { cursor: pointer; transition: opacity 200ms ease; outline: none; }
.node:focus-visible .node-core, .node:focus-visible .node-rect { stroke: var(--a-focus); stroke-width: 2.2; }
.node-fresh { fill: none; stroke-opacity: 0.35; pointer-events: none; }
.node-ring { fill: none; stroke: var(--a-brass); pointer-events: none; }
.node-sel { fill: none; stroke: var(--a-text); pointer-events: none; }
/* Trending this week · a calm expanding ring, the only pulse on the page */
.node-hot {
  fill: none; pointer-events: none;
  transform-box: fill-box; transform-origin: center;
  animation: hotpulse 2.8s ease-out infinite;
}
@keyframes hotpulse {
  0%   { transform: scale(0.85); opacity: 0.65; }
  70%  { transform: scale(2.05); opacity: 0; }
  100% { transform: scale(2.05); opacity: 0; }
}
/* font-size, stroke-width and dy are set as attributes in rescale() so they
   counter-scale with zoom · do NOT set them here (CSS would override them). */
.node-label {
  font-family: var(--sans);
  fill: var(--a-label);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--a-halo);
}
.node.dim { opacity: 0.12; }
/* Timeline playback: nodes not yet "born" fade rather than pop in/out */
.node.pre { opacity: 0 !important; pointer-events: none; }
.node.born .node-core, .node.born .node-rect {
  animation: nodeborn 550ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-box: fill-box; transform-origin: center;
}
@keyframes nodeborn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.edge { fill: none; transition: opacity 300ms ease; }
.edge.dim { opacity: 0.05 !important; }
.edge.pre { opacity: 0 !important; pointer-events: none; }
.edge-hit { fill: none; stroke: transparent; stroke-width: 11; pointer-events: stroke; cursor: pointer; }
.edge.selected-edge { opacity: 1 !important; }
/* stroke-width intentionally NOT forced here: a fixed user-space width blows up
   at zoom (and took the arrowheads with it) · rescale() sets it per zoom level */
.trace-edge { stroke: var(--a-trace) !important; opacity: 1 !important; }
.tl-axis text { fill: var(--a-text-3); font-size: 9.5px; font-family: var(--sans); letter-spacing: 0.06em; }
.tl-axis line { stroke: var(--a-line); }
.tl-lane-label { font-size: 10px; font-family: var(--sans); letter-spacing: 0.14em; }
.tl-lane-line { stroke: var(--a-line); stroke-dasharray: 2 6; }

/* State boundaries + names · cartography, not data */
.state-line { fill: none; stroke: var(--a-land-line); opacity: 0.85; }
.state-label {
  font-family: var(--sans); font-weight: 600;
  fill: var(--a-text-3); opacity: 0.55;
  pointer-events: none;
}

/* ── Legend ── */
.map-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 10;
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: 9px;
  max-width: 235px; overflow: hidden;
  box-shadow: 0 10px 30px -14px var(--a-shadow);
}
.legend-toggle {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  padding: 7px 11px;
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  color: var(--a-text-3);
}
.legend-toggle:hover { color: var(--a-text); }
.map-legend.closed .legend-body { display: none; }
.legend-body { padding: 0 11px 10px; display: flex; flex-direction: column; gap: 5px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; color: var(--a-text-2); }
.legend-row .lg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-row .lg-sq { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.legend-row .lg-line { width: 18px; height: 0; border-top: 2px solid; flex-shrink: 0; }
.legend-row .lg-ring { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid; flex-shrink: 0; }
.legend-sep { height: 1px; background: var(--a-line); margin: 3px 0; }

@media (prefers-reduced-motion: reduce) {
  .map-loading-ring { animation: none; }
  .node-hot { animation: none; opacity: 0.45; transform: scale(1.35); }
  .node, .edge { transition: none; }
  .node.born .node-core, .node.born .node-rect { animation: none; }
  .confetti i { animation: none; }
  .intro-beat { transition: none; }
  .tour-hole, .tour-tip { transition: none; }
  .intro-beat.on .ib-headline, .intro-beat.on .ib-line, .intro-beat.on .ib-step,
  .intro-beat.on .ib-card, .intro-beat.on .ib-ctas,
  .intro-beat.on .gw-head, .intro-beat.on .gw-lines span, .intro-beat.on .gw-ctas, .intro-beat.on .gw-stats, .ib-gateway.on .ib-kicker,
  .intro-beat[data-beat="4"].on .ib-big, .intro-beat[data-beat="4"].on .ib-sub { animation: none; opacity: 1; }
  .intro-beat.on .ib-chain::before { animation: none; transform: scaleY(1); }
}

/* ── Mobile ── */
@media (max-width: 720px) {
  .map-topbar { gap: 0.6rem; padding: 0.45rem 0.8rem; }
  .map-tagline { display: none; }
  .map-name { font-size: 1rem; }
  .map-status { max-width: none; }
  .status-line { font-size: 0.62rem; }
  .map-actions { width: 100%; justify-content: space-between; margin-left: 0; }
  .vbtn { padding: 8px 10px; font-size: 0.66rem; }
  .map-btn { padding: 8px 11px; min-height: 34px; }
  .map-controls { padding: 0.4rem 0.8rem; }
  .map-search { min-width: 150px; }
  .search-results { width: calc(100vw - 2rem); right: -8px; }
  .datahealth { left: 12px; right: 12px; width: auto; }
  .map-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-height: 62dvh;
    border-left: none; border-top: 1px solid var(--a-line-strong);
    border-radius: 14px 14px 0 0;
  }
  .zoombtns button { width: 40px; height: 40px; }
  .tour-tip { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; }
  .bl-back { display: none; }
  .ib-big { font-size: 1.5rem; }
  .strip-card { min-width: 230px; }
}
