/* Kerala 2026 — Visual Language */

:root {
  --bg: #f5f0e8;
  --bg-dark: #e8e0d0;
  --ink: #2a2520;
  --ink-soft: #5a524a;
  --rule: #c8beb0;
  --ldf: #b83737;
  --udf: #2e5a95;
  --nda: #d97822;
  --gray: #c9c4ba;
  --accent: #b88a00;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; }

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border-bottom: 1px solid var(--rule);
}
.hero-inner { max-width: 760px; text-align: center; }
.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}
h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.05;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}
.dek {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 3rem;
  line-height: 1.5;
}
.scroll-cue {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge {
  0%,100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* ─── Scrollytelling layout ────────────────────────────── */
#scrolly {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
  gap: 0rem;
}

.map-container {
  position: sticky;
  top: 11vh;
  height: 75vh;
  margin: 0;
}
#map { width: 100%; height: 100%; position: relative; }
#map svg { width: 100%; height: 100%; display: block; }

.steps { padding: 0; }
.step {
  min-height: 75vh;
  display: flex;
  align-items: center;
  padding: 3rem 0;
  opacity: 0.35;
  transition: opacity 0.5s ease;
}
.step.is-active { opacity: 1; }
.step-inner { max-width: 440px; }
.step h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 1.2rem;
  letter-spacing: -0.005em;
}
.step p {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.02rem;
}
.step p.note {
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule);
  padding-left: 1rem;
  margin-top: 1.5rem;
}
.step strong { color: var(--ink); font-weight: 700; }
.step em { font-style: italic; color: var(--ink); }
.big-stat {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.5;
  margin: 1.5rem 0 !important;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.big-stat strong { font-size: 1.8rem; font-weight: 900; }

.swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin: 0 2px;
  vertical-align: baseline;
}
.swatch.ldf { background: var(--ldf); }
.swatch.udf { background: var(--udf); }
.swatch.nda { background: var(--nda); }

/* ─── Legend ────────────────────────────────────────────── */
#legend {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(245, 240, 232, 0.92);
  border: 1px solid var(--rule);
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  z-index: 5;
  transition: opacity 0.4s ease;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.5;
}
.legend-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 1px solid rgba(0,0,0,0.1);
}
.legend-label { color: var(--ink-soft); }

/* ─── Tooltip ───────────────────────────────────────────── */
.tooltip {
  position: fixed;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--ink);
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  max-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 1000;
  transition: opacity 0.12s ease;
}
.tooltip[aria-hidden="true"] { opacity: 0; }
.tooltip[aria-hidden="false"] { opacity: 1; }
.tt-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.tt-ac-no {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--ink-soft);
  margin-left: 0.35rem;
}
.tt-meta {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.55rem;
}
.tt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin: 0.15rem 0;
}
.tt-lab { color: var(--ink-soft); }
.tt-val { font-weight: 600; }
.tt-val.tt-LDF { color: var(--ldf); }
.tt-val.tt-UDF { color: var(--udf); }
.tt-val.tt-NDA { color: var(--nda); }
.tt-bars {
  display: flex;
  height: 6px;
  margin-top: 0.6rem;
  background: var(--bg-dark);
  overflow: hidden;
}
.tt-bars .bar { height: 100%; }
.tt-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

/* ─── Chapter sections (5–9) ────────────────────────────── */
.chapter {
  border-top: 1px solid var(--rule);
  padding: 5rem 2rem;
}
.chapter-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.chapter-num {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.8rem;
}
.chapter-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
  max-width: 740px;
}
.chapter-lead {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 680px;
  line-height: 1.55;
  margin: 0 0 2.5rem;
}
.chapter-kicker {
  font-family: var(--sans);
  font-size: 0.98rem;
  color: var(--ink);
  max-width: 700px;
  line-height: 1.65;
  margin: 2.5rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--rule);
}
.chapter-kicker em { font-style: italic; }
.sub-h {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

/* ─── Ch 4 legend (inline) ───────────────────────────────── */
.ch4-legend { margin: 1rem 0 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; }
.ch4-row { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; line-height: 1.4; }
.ch4-swatch { display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 2px; flex-shrink: 0; margin-top: 0.18rem; }

/* ─── Tooltip track lines ────────────────────────────────── */
.tt-track {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  font-family: var(--sans);
}

/* ─── Ch 5: Redesigned ───────────────────────────────────── */
.ch5-block {
  margin: 0 0 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}
.ch5-block:last-child { border-bottom: none; }
.ch5-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
}
.ch5-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 680px;
  margin: 1rem 0 0;
}
/* Viz 1: split stat */
.ch5-split-stat {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0.5rem 0 0;
}
.ch5-split-item { text-align: center; }
.ch5-split-item.safe .ch5-num { color: #7a6e62; }
.ch5-split-item.vuln .ch5-num { color: var(--udf); }
.ch5-num {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
}
.ch5-num small { font-size: 0.45em; font-weight: 700; }
.ch5-cat {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}
.ch5-sub {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}
.ch5-split-arrow {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink-soft);
  font-style: italic;
}
/* Viz 2: strip chart */
.ch5-strip { width: 100%; margin: 0.5rem 0 0; }
.ch5-strip-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }
.safe-dot { background: #a39584; }
.vuln-dot { background: #7b3fa0; }
/* Viz 3: cushion chart */
.ch5-cushion { margin: 1rem 0; }
.ch5-cush-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.8rem 0;
}
.ch5-cush-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  width: 6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.ch5-cush-visual {
  display: flex;
  height: 28px;
  flex: 1;
  overflow: visible;
}
.cush-bar {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 0.4rem;
  position: relative;
  min-width: 0;
}
.cush-val { font-size: 0.7rem; color: white; font-weight: 600; white-space: nowrap; }
.cush-drop {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 0.2rem;
}
.cush-drop-val { font-size: 0.68rem; color: #7a3020; font-weight: 600; white-space: nowrap; }
.ch5-cush-result {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.ch5-cush-result.pos { color: #3a6a3a; }
.ch5-cush-result.neg { color: var(--ldf); }

/* ─── Ch 6: Clusters + LSG ───────────────────────────────── */
.chapter-rule { border: none; border-top: 1px solid var(--rule); margin: 3rem 0 2.5rem; }
.sub-section-h {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 0 0.6rem;
}
.sub-section-lead {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 640px;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}
.lsg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1rem 0;
}
.lsg-card { border-top: 2px solid var(--ink); padding-top: 0.9rem; }
.lsg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.lsg-ac-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.lsg-holder {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  color: white;
}
.lsg-holder.LDF { background: var(--ldf); }
.lsg-holder.UDF { background: var(--udf); }
.lsg-sub { font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.8rem; }
.lsg-row { margin: 0.4rem 0; }
.lsg-name { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.15rem; }
.lsg-bar-wrap { height: 6px; background: var(--bg-dark); position: relative; margin-bottom: 0.15rem; }
.lsg-bar { height: 100%; }
.lsg-val { font-size: 0.72rem; color: var(--ink-soft); }

/* ─── Ch 7: NDA ──────────────────────────────────────────── */
.nda-container {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  margin: 2rem 0;
}
.nda-bar-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.4rem 0;
  font-size: 0.85rem;
}
.nda-bar-name {
  width: 8.5rem;
  font-weight: 500;
}
.nda-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--bg-dark);
  position: relative;
}
.nda-bar {
  height: 100%;
  background: var(--nda);
}
.nda-bar-val {
  width: 3rem;
  text-align: right;
  font-family: var(--serif);
  font-weight: 700;
}
.trajectory-chart {
  height: 220px;
  position: relative;
  margin-top: 0.5rem;
}
.trajectory-chart svg { width: 100%; height: 100%; }

/* ─── Chapter alt background ─────────────────────────────── */
.chapter-alt { background: rgba(0,0,0,0.025); }

/* ─── Ch 8: NDA Cannibalization ──────────────────────────── */
.cannibal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 2rem 0;
}
.cannibal-stat-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0;
}
.cannibal-stat { text-align: center; }
.cannibal-big {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 3.5rem;
  line-height: 1;
}
.ldf-text { color: var(--ldf); }
.udf-text { color: var(--udf); }
.neutral-text { color: var(--ink-soft); }
.cannibal-party {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}
.cannibal-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
  max-width: 140px;
  line-height: 1.35;
}
.cannibal-vs { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink-soft); }
.cannibal-header-note { margin-bottom: 1.5rem; }
.cannibal-method {
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--bg-dark);
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--rule);
  line-height: 1.5;
  margin: 0;
}
.cannibal-caveat-box {
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  background: rgba(43,89,149,0.06);
  border-left: 3px solid var(--udf);
  font-size: 0.88rem;
  line-height: 1.6;
}
.cannibal-note {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.cannibal-scatter-wrap { }
.scatter-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

/* Two-column slope chart grid */
.cannibal-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin: 1.5rem 0;
}

/* ─── Ch 8: Regional bar chart ───────────────────────────── */
.reg-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.8rem 0;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.reg-row:last-child { border-bottom: none; }
.reg-label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.88rem;
  width: 5rem;
  flex-shrink: 0;
  color: var(--ink);
}
.reg-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.reg-bar-pair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.reg-bar-label {
  font-size: 0.7rem;
  width: 2.2rem;
  color: var(--ink-soft);
  font-weight: 600;
  flex-shrink: 0;
}
.reg-bar-track {
  flex: 1;
  height: 12px;
  background: var(--bg-dark);
}
.reg-bar { height: 100%; }
.reg-bar-val {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.88rem;
  width: 3rem;
  text-align: right;
  flex-shrink: 0;
}
.reg-note {
  font-size: 0.7rem;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Ch 8: Finding box (slope chart annotation) ─────────── */
.cannibal-finding-box {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 0.7rem 0.85rem;
  margin-top: 0.8rem;
}
.cannibal-finding-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}
.cannibal-fbar-row {
  display: grid;
  grid-template-columns: 2rem 1fr 4.2rem;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.3rem;
}
.cannibal-fbar-label {
  font-size: 0.68rem;
  font-weight: 700;
}
.cannibal-fbar-track {
  height: 10px;
  background: var(--bg-dark);
  position: relative;
}
.cannibal-fbar-fill {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.85;
}
.cannibal-fbar-val {
  text-align: right;
  font-weight: 700;
  font-size: 0.78rem;
}
.cannibal-verdict {
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg-dark);
  color: var(--ink);
}

/* ─── Ch 8: Regional card grid ───────────────────────────── */
.cannibal-reg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.cannibal-reg-card {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 1rem;
}
.cannibal-reg-card-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: var(--ink);
}
.cannibal-reg-block {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--bg-dark);
}
.cannibal-reg-block-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.cannibal-reg-bar-row {
  display: grid;
  grid-template-columns: 2rem 1fr 3.8rem;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.25rem;
}
.cannibal-reg-bar-party {
  font-size: 0.65rem;
  font-weight: 700;
}
.cannibal-reg-bar-track {
  height: 9px;
  background: var(--bg-dark);
  position: relative;
}
.cannibal-reg-bar-fill {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.85;
}
.cannibal-reg-bar-val {
  text-align: right;
  font-weight: 700;
  font-size: 0.73rem;
}
.cannibal-reg-ratio {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.3rem;
}

/* ─── Cluster grid ────────────────────────────────────────── */
/* ─── Ch 8: Cluster grid ─────────────────────────────────── */
.cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.cluster-card {
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.35);
  padding: 1.2rem 1.1rem;
}
.cluster-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.15rem;
}
.cluster-count {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.9rem;
}
.cluster-shifts {
  display: flex;
  gap: 0.7rem;
  margin: 0.8rem 0;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cluster-shift {
  flex: 1;
  text-align: center;
}
.cluster-shift-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.cluster-shift-val {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  display: block;
  margin-top: 0.2rem;
}
.cluster-shift-val.up { color: var(--udf); }
.cluster-shift-val.down { color: var(--ldf); }
.cluster-shift-val.neutral { color: var(--ink-soft); }
.cluster-acs {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ─── Ch 9: Tightest table ──────────────────────────────── */
.tight-table {
  width: 100%;
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 0.88rem;
}
.tight-row {
  display: grid;
  grid-template-columns: 0.3fr 1.6fr 1fr 0.6fr 1.2fr 0.8fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.tight-row.header {
  border-bottom: 2px solid var(--ink);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
}
.tight-row .ac { font-family: var(--serif); font-weight: 700; font-size: 0.98rem; }
.tight-row .ac small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tight-bars {
  display: flex;
  height: 10px;
  background: var(--bg-dark);
  overflow: hidden;
}
.tight-bars .seg { height: 100%; }
.tight-holder {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  color: white;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}
.tight-holder.LDF { background: var(--ldf); }
.tight-holder.UDF { background: var(--udf); }
.tight-holder.NDA { background: var(--nda); }
.tight-margin { font-family: var(--serif); font-weight: 700; }
.tight-swing { font-family: var(--serif); font-weight: 700; }
.tight-swing.up { color: var(--udf); }
.tight-swing.down { color: var(--ldf); }

/* ─── Ch 10-11: Path to victory ─────────────────────────── */
.path-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  margin: 2rem 0;
}
.path-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}
.path-row-label { color: var(--ink); }
.path-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}
.path-num.gap { color: var(--udf); }
.path-row-total { font-weight: 700; }
.path-needed { border-bottom: 2px solid var(--ink); }
.path-gap { margin-top: 0.2rem; }
.path-note-small {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  line-height: 1.45;
}
.path-seat-row {
  display: grid;
  grid-template-columns: 1.2rem 1fr 1fr 3rem 3.5rem;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
  align-items: center;
}
.path-seat-header {
  border-bottom: 2px solid var(--ink) !important;
  font-size: 0.7rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
}
.path-seat-rank { color: var(--ink-soft); font-size: 0.72rem; }
.path-seat-name { font-weight: 600; }
.path-seat-dist { color: var(--ink-soft); font-size: 0.78rem; }
.path-seat-margin { text-align: right; font-family: var(--serif); font-weight: 700; }
.path-seat-swing { text-align: right; font-family: var(--serif); font-weight: 700; font-size: 0.78rem; }
.swing-bad { color: var(--ldf); }
.swing-ok { color: #3a6a3a; }

/* ─── Footer ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 2rem 3.5rem;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.7;
}
footer code {
  background: var(--bg-dark);
  padding: 0.05rem 0.3rem;
  font-size: 0.78rem;
  border-radius: 2px;
}

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 380px) {
  #scrolly {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 2rem 1.2rem 4rem;
  }
  .map-container {
    position: sticky;
    top: 15vh;
    height: 60vh;
    z-index: 2;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
  }
  .step { min-height: 60vh; padding: 2rem 0; }
  .step-inner { max-width: 100%; }
  .hero { min-height: 70vh; padding: 2rem 1.2rem; }
  #legend { top: 0.5rem; left: 0.5rem; font-size: 0.7rem; padding: 0.5rem; }
  #legend { display: none; }
  .cannibal-main-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .nda-container { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .lsg-grid { grid-template-columns: 1fr; }
  .tight-row { grid-template-columns: 0.3fr 1.4fr 1fr 0.6fr; }
  .tight-row > :nth-child(5), .tight-row > :nth-child(6) { display: none; }
}
