/* Chronicle page: scroll-through-time layout with one persistent map.
   Uses the site palette from main.css. Motion is opt-out via reduced-motion. */

.chronicle-page {
  --lane-politics: var(--lapis);
  --lane-wars: var(--pomegranate);
  --lane-religion: #a97d1c;
  --lane-culture: var(--copper);
  --lane-economy: var(--cypress);
  --clock-bg: rgba(248, 245, 236, 0.97);
}

.chronicle-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- top bar */

.ch-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.ch-topnav {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  font-size: 0.9rem;
}

.ch-topnav a {
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  padding-block: 0.15rem;
}

.ch-topnav a[aria-current="page"] {
  border-bottom-color: var(--pomegranate);
  color: var(--ink);
  font-weight: 600;
}

.ch-topnav a:hover,
.ch-topnav a:focus-visible {
  border-bottom-color: var(--lapis);
}

/* -------------------------------------------------------- the pinned clock */

.ch-clock {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--clock-bg);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 12px 30px rgba(23, 33, 38, 0.10);
}

.ch-lanes {
  padding: 0.55rem clamp(0.75rem, 3vw, 2.5rem) 0.15rem;
  display: grid;
  gap: 4px;
}

.ch-lane {
  display: grid;
  grid-template-columns: minmax(96px, 132px) 1fr;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

/* hover-to-expand: the strip lifts into an overlay and grows to fit every
   sub-lane of the visible window; the clock itself never reflows */
.ch-lane.is-expanded .ch-lane-strip {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 6;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px rgba(23, 33, 38, 0.24);
  border-radius: 6px;
}

.ch-lane.is-expanded .ch-lane-label { color: var(--ink); }

.ch-lane-label {
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-inline-start: 0.6rem;
  border-inline-start: 3px solid var(--lane-color, var(--line));
}

.ch-lane-strip {
  position: relative;
  height: 34px;
  border-radius: 4px;
  background: linear-gradient(to right, transparent, rgba(23, 33, 38, 0.05) 10%, rgba(23, 33, 38, 0.05) 90%, transparent);
  overflow: hidden;
  transition: height 220ms ease, box-shadow 220ms ease;
}

.ch-lane-strip::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  border-top: 1px solid var(--line);
}

.ch-tl-band,
.ch-tl-point {
  position: absolute;
  top: 0;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}

.ch-tl-band {
  border-radius: 4px;
  background: color-mix(in srgb, var(--lane-color, var(--lapis)) 24%, transparent);
  border: 1px solid color-mix(in srgb, var(--lane-color, var(--lapis)) 52%, transparent);
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: background 200ms ease, border-color 200ms ease;
}

.ch-tl-band.u-approx,
.ch-tl-band.u-range { border-style: dashed; }
.ch-tl-band.u-disputed { border-style: dotted; }

.ch-tl-band > span {
  font-size: 0.63rem;
  line-height: 1;
  padding-inline: 0.45rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-tl-band.is-slim > span { visibility: hidden; }

.ch-tl-band.is-live {
  background: color-mix(in srgb, var(--lane-color, var(--lapis)) 46%, transparent);
  border-color: var(--lane-color, var(--lapis));
}

.ch-tl-band.is-live > span { color: var(--ink); font-weight: 600; }

.ch-tl-point {
  width: 14px;
  margin-left: -7px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ch-tl-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-inline-start: 3.5px;
  border-radius: 50%;
  background: var(--lane-color, var(--lapis));
  box-shadow: 0 0 0 2px rgba(255, 253, 247, 0.8);
  opacity: 0.6;
  transition: transform 160ms ease, opacity 160ms ease;
}

.ch-tl-point.is-war .ch-tl-dot {
  border-radius: 1px;
  transform: rotate(45deg);
  width: 8px;
  height: 8px;
}

.ch-tl-name {
  position: absolute;
  left: 16px;
  font-size: 0.6rem;
  line-height: 1.1;
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none;
  paint-order: stroke;
  text-shadow:
    0 0 3px var(--paper),
    0 0 3px var(--paper),
    0 0 3px var(--paper);
  visibility: hidden;
}

.ch-tl-name.row-top { top: 1px; }
.ch-tl-name.row-bot { top: auto; bottom: 1px; }

/* leader line reconnecting a shifted name to its dot */

.ch-tl-leader {
  position: absolute;
  left: 7px;
  display: none;
  pointer-events: none;
  border-color: color-mix(in srgb, var(--lane-color, var(--ink-2)) 65%, transparent);
}

.ch-tl-leader.row-top {
  top: 7px;
  height: calc(50% - 7px);
  border-left: 1px solid;
  border-top: 1px solid;
  border-color: inherit;
  border-top-left-radius: 3px;
}

.ch-tl-leader.row-bot {
  top: 50%;
  height: calc(50% - 7px);
  border-left: 1px solid;
  border-bottom: 1px solid;
  border-color: inherit;
  border-bottom-left-radius: 3px;
}

.ch-tl-point.is-war .ch-tl-name { color: color-mix(in srgb, var(--pomegranate) 80%, var(--ink)); }

.ch-tl-point.is-live .ch-tl-dot,
.ch-tl-point:hover .ch-tl-dot,
.ch-tl-point:focus-visible .ch-tl-dot {
  opacity: 1;
  transform: scale(1.55);
}

.ch-tl-point.is-war.is-live .ch-tl-dot,
.ch-tl-point.is-war:hover .ch-tl-dot {
  transform: rotate(45deg) scale(1.55);
}

.ch-tl-point.is-live .ch-tl-name { font-weight: 700; color: var(--ink); }

[data-lane="myth"] { --lane-color: #1d8a93; } /* turquoise: mythic lifetimes */
/* mythic spans keep their turquoise wherever they live (incl. merged into the
   rulers lane), so the kind of claim stays visible at a glance */
.ch-tl-band.lane-myth { --lane-color: #1d8a93; }
[data-lane="politics"] { --lane-color: var(--lane-politics); }
[data-lane="warfaith"] { --lane-color: var(--lane-wars); }
[data-lane="culture"] { --lane-color: var(--lane-culture); }
[data-lane="rulers"] { --lane-color: #7d5185; }

/* politics lane: coexistence share chart - coexisting polities split the
   fixed lane height evenly; a sole power fills the whole lane */

[data-lane="politics"] .ch-lane-strip::before { display: none; }

.ch-poli-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ch-poli {
  fill: color-mix(in srgb, var(--lane-politics) 24%, transparent);
  stroke: color-mix(in srgb, var(--lane-politics) 62%, transparent);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 200ms ease;
}

.ch-poli.u-approx,
.ch-poli.u-range { stroke-dasharray: 5 3; }
.ch-poli.u-disputed { stroke-dasharray: 1.5 2.5; }

.ch-poli.is-live { fill: color-mix(in srgb, var(--lane-politics) 42%, transparent); }

.ch-poli:hover,
.ch-poli:focus-visible {
  fill: color-mix(in srgb, var(--lane-politics) 52%, transparent);
  outline: none;
}

.ch-poli-name {
  position: absolute;
  font-size: 0.6rem;
  line-height: 1;
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 3px var(--paper),
    0 0 3px var(--paper),
    0 0 3px var(--paper),
    0 0 3px var(--paper);
  transition: top 220ms ease;
}

.ch-poli-name.is-live { color: var(--ink); font-weight: 700; }

/* state-religion bands keep their own hues inside the war lane */
.ch-tl-band[data-band="band-zoroastrian-state"] { --lane-color: var(--lane-religion); }
/* Twelver Shiism state-religion band: brown, per editorial request */
.ch-tl-band[data-band="band-shia-state"] { --lane-color: #7c4a1e; }

/* lifetime lanes: five fixed sub-lanes, JS packs the visible window */

[data-lane="culture"] .ch-lane-strip { height: 76px; }
[data-lane="rulers"] .ch-lane-strip { height: 76px; }
[data-lane="myth"] .ch-lane-strip { height: 76px; }

/* mythic dating: dotted spans, italic names - visibly not historical.
   Turquoise = lifetime; the gold inset = reign over Iran (kings only). */
.ch-tl-band.u-mythic { border-style: dotted; }
.ch-tl-band.u-mythic > span { font-style: italic; }

.ch-life-reign {
  position: absolute;
  top: 0;
  height: 100%;
  background: color-mix(in srgb, var(--gold) 72%, transparent);
  border-radius: 999px;
  pointer-events: none;
}

.ch-lane-sub {
  display: block;
  font-size: 0.52rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  margin-top: 0.2rem;
}

.ch-lane-sub i {
  display: inline-block;
  width: 9px;
  height: 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-inline-end: 2px;
}

.ch-lane-sub .ch-key-life { background: color-mix(in srgb, #1d8a93 45%, transparent); border: 1px dotted #1d8a93; }
.ch-lane-sub .ch-key-reign { background: color-mix(in srgb, var(--gold) 72%, transparent); }

/* chronology selector: which dating system drives the myth lane */

.ch-chron {
  display: block;
  margin-top: 0.3rem;
  padding-inline-end: 0.4rem;
}

.ch-chron select {
  width: 100%;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #14646b;
  background-color: var(--surface);
  border: 1px solid color-mix(in srgb, #1d8a93 55%, var(--line));
  border-radius: 999px;
  padding: 0.18rem 1.15rem 0.18rem 0.55rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%231d8a93' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ch-chron select:hover,
.ch-chron select:focus-visible {
  border-color: #1d8a93;
  box-shadow: 0 0 0 2.5px rgba(29, 138, 147, 0.16);
  outline: none;
}

.ch-lane-label { text-overflow: clip; }

.ch-lane-title { display: block; font-weight: 600; }

/* merge/split toggle for the myth + rulers lanes */

.ch-merge-toggle {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  font: inherit;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5d3d66;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, #7d5185 50%, var(--line));
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.ch-merge-toggle:hover,
.ch-merge-toggle:focus-visible {
  border-color: #7d5185;
  box-shadow: 0 0 0 2.5px rgba(125, 81, 133, 0.16);
  outline: none;
}

.ch-merge-toggle[aria-pressed="false"] {
  background: #7d5185;
  color: #fff;
  border-color: #7d5185;
}

.ch-tl-band.is-life {
  border-radius: 999px;
  min-height: 5px;
  overflow: visible;
}

.ch-tl-band.is-life > span {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.58rem;
  line-height: 1;
  padding: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  pointer-events: none;
  text-shadow:
    0 0 3px var(--paper),
    0 0 3px var(--paper),
    0 0 3px var(--paper),
    0 0 3px var(--paper);
}

/* extras beyond the five rows share a row as a half-height offset bar */
.ch-tl-band.is-life.is-crowded {
  opacity: 0.82;
  border-style: solid;
}

.ch-life-leader {
  position: absolute;
  top: 50%;
  height: 0;
  border-top: 1px solid color-mix(in srgb, var(--lane-color, var(--ink-2)) 60%, transparent);
  display: none;
  pointer-events: none;
}

.ch-tl-band.is-life.is-live {
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--lane-color) 80%, var(--ink));
}

.ch-tl-band.is-life.is-live > span { font-weight: 700; }

/* shared rich tooltip for lanes */

.ch-clock-tip {
  position: absolute;
  transform: translateX(-50%);
  max-width: 280px;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(23, 33, 38, 0.4);
  z-index: 40;
  pointer-events: none;
  font-size: 0.74rem;
  line-height: 1.4;
}

.ch-clock-tip strong {
  display: block;
  font-family: var(--font-body, Georgia), Georgia, serif;
  font-size: 0.82rem;
}

.ch-clock-tip em {
  display: block;
  font-style: normal;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin: 0.1rem 0 0.15rem;
}

.ch-clock-tip span { display: block; color: rgba(255, 255, 255, 0.85); }

/* ruler */

.ch-ruler {
  display: grid;
  grid-template-columns: minmax(96px, 132px) 1fr;
  gap: 0.6rem;
  padding: 0.25rem clamp(0.75rem, 3vw, 2.5rem) 0;
}

.ch-ruler-track {
  position: relative;
  height: 46px;
}

.ch-ticks {
  position: absolute;
  inset: 0;
  border-top: 1.5px solid var(--ink);
  overflow: hidden;
}

.ch-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
}

.ch-tick i {
  display: block;
  width: 1px;
  height: 8px;
  margin: 0 auto;
  background: var(--ink-2);
}

.ch-tick b {
  display: block;
  font-weight: 500;
  font-size: 0.66rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ch-needle {
  position: absolute;
  left: 50%;
  top: -10px;
  bottom: 14px;
  width: 0;
  border-left: 2px solid var(--pomegranate);
}

.ch-needle::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -5px;
  border: 4px solid transparent;
  border-top-color: var(--pomegranate);
}

.ch-year-readout {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-family: var(--font-display, Georgia), Georgia, serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  background: var(--pomegranate);
  border: 1px solid color-mix(in srgb, var(--pomegranate) 70%, black);
  border-radius: 999px;
  padding: 0.05rem 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(155, 47, 61, 0.35);
}

.ch-clock-controls {
  position: absolute;
  top: 0.45rem;
  right: clamp(0.5rem, 2vw, 1.5rem);
  display: flex;
  gap: 0.3rem;
}

.ch-clock-controls button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.ch-clock-controls button:hover,
.ch-clock-controls button:focus-visible {
  border-color: var(--lapis);
  color: var(--lapis);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------- hero/end */

.ch-hero,
.ch-end {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 5rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
}

.ch-hero h1 {
  font-family: var(--font-display, Georgia), Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.4rem 0 0;
  letter-spacing: -0.01em;
}

.ch-hero-rule {
  width: 120px;
  margin: 1.1rem auto 1.2rem;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  height: 4px;
}

.ch-hero .lede { font-size: 1.08rem; color: var(--ink-2); max-width: 46rem; margin-inline: auto; }

.ch-hero-note {
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  max-width: 44rem;
  margin: 1.2rem auto 0;
}

.ch-end { border-top: 1px solid var(--line); }

/* --------------------------------------------- layout: fixed map + story */

.ch-layout {
  display: grid;
  grid-template-columns: minmax(360px, 46%) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
  max-width: 96rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem) clamp(3rem, 8vh, 6rem);
}

.ch-atlas { position: relative; }

/* Base behavior (also the no-JS fallback) is sticky; with JS the panel is
   pinned to the viewport (.is-fixed) and parked at the end of the story
   (.is-parked) so the map itself never travels with the scroll. */
.ch-atlas-sticky {
  position: sticky;
  top: calc(var(--clock-offset, 168px) + 14px);
  max-height: calc(100vh - var(--clock-offset, 168px) - 24px);
  display: flex;
  flex-direction: column;
}

.ch-atlas-sticky.is-fixed {
  position: fixed;
  z-index: 25;
}

.ch-atlas-sticky.is-parked {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  top: auto;
}

.ch-atlas-sticky .ch-map { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ch-atlas-sticky .ch-map figcaption { overflow-y: auto; }

.ch-atlas-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.35rem;
}

.ch-atlas-era {
  margin: 0;
  font-family: var(--font-display, Georgia), Georgia, serif;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--ink);
}

.ch-atlas-order {
  color: var(--copper);
  margin-inline-end: 0.35rem;
}

.ch-atlas-range {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- map */

.ch-geo-defs { position: absolute; }

.ch-map {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ch-map-frame { position: relative; }

.ch-map-svg { display: block; width: 100%; height: auto; }

/* base geography */

.ch-map-gratline {
  fill: none;
  stroke: rgba(23, 33, 38, 0.10);
  stroke-width: 0.6;
}

.ch-map-landmass {
  fill: #f0e9d8;
  stroke: #7fa0ab;
  stroke-width: 1.1;
}

.ch-map-sea-labels text {
  font-size: 17px;
  fill: #64828e;
  font-style: italic;
  font-family: var(--font-body, Georgia), Georgia, serif;
  letter-spacing: 0.08em;
}

/* historical boundary snapshots: sharp reconstructed borders */

.ch-snap {
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}

.ch-snap.is-on { opacity: 1; }

.ch-border {
  fill: rgba(36, 92, 115, 0.13);
  stroke: var(--lapis);
  stroke-width: 2.4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.ch-border.is-primary {
  fill: rgba(155, 47, 61, 0.15);
  stroke: var(--pomegranate);
  stroke-width: 2.8;
}

.ch-border:not(.is-primary) { fill: none; }

/* ghost: the previous border snapshot, dashed */

.ch-snap.is-ghost:not(.is-on) { opacity: 1; }

.ch-snap.is-ghost:not(.is-on) .ch-border {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.6;
  stroke-dasharray: 7 5;
  opacity: 0.75;
}

/* modern borders overlay: shown on hover or via toggle */

.ch-modern {
  opacity: 0;
  transition: opacity 350ms ease;
  pointer-events: none;
}

.ch-map-frame:hover .ch-modern,
.ch-map.show-modern .ch-modern { opacity: 1; }

.ch-modern-iran {
  fill: rgba(62, 107, 87, 0.18);
  stroke: var(--cypress);
  stroke-width: 2.2;
}

.ch-modern-borders {
  fill: none;
  stroke: rgba(23, 33, 38, 0.55);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.ch-modern-tag {
  font-size: 15px;
  fill: var(--cypress);
  font-weight: 700;
  font-family: var(--font-body, Georgia), Georgia, serif;
}

/* places and capitals: surface in their own eras */

.ch-map-place { cursor: help; }

.ch-enhanced .ch-map-place {
  opacity: 0;
  transition: opacity 450ms ease;
  pointer-events: none;
}

.ch-enhanced .ch-map-place.is-here {
  opacity: 1;
  pointer-events: auto;
}

.ch-map-place circle {
  fill: var(--ink-2);
  stroke: var(--surface);
  stroke-width: 1.5;
}

.ch-cap-star {
  display: none;
  fill: var(--copper);
  stroke: var(--surface);
  stroke-width: 1;
}

.ch-map-place.is-capital .ch-cap-star { display: block; }
.ch-map-place.is-capital circle { display: none; }

.ch-map-place text {
  font-size: 15px;
  fill: var(--ink-2);
  paint-order: stroke;
  stroke: rgba(248, 245, 236, 0.88);
  stroke-width: 3px;
}

.ch-map-place:hover circle,
.ch-map-place:hover .ch-cap-star { fill: var(--pomegranate); }

.ch-map-scale line { stroke: var(--ink-2); stroke-width: 1.6; }

.ch-map-scale text {
  font-size: 12.5px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* map tools + tooltip */

.ch-map-tools {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  display: none;
  gap: 0.35rem;
}

.ch-enhanced .ch-map-tools { display: flex; }

.ch-map-tool {
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.ch-map-tool:hover { border-color: var(--ink-2); }

.ch-map-tool[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.ch-map-tip {
  position: absolute;
  max-width: 240px;
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  line-height: 1.35;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  z-index: 6;
  box-shadow: 0 8px 22px rgba(23, 33, 38, 0.35);
}

/* caption: snapshot legend + honesty note */

.ch-map figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.5rem 0.8rem 0.55rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(rgba(23, 33, 38, 0.02), transparent);
}

.ch-map-snaplegend {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  max-height: 8em;
  overflow-y: auto;
}

.ch-enhanced .ch-map-snaplegend { max-height: none; overflow: visible; }

.ch-map-snaplegend li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: var(--muted);
  padding: 0.06rem 0;
}

.ch-enhanced .ch-map-snaplegend li { display: none; }

.ch-enhanced .ch-map-snaplegend li.is-on { display: flex; color: var(--ink); font-weight: 600; }

.ch-legend-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  align-self: center;
  border: 2px solid var(--pomegranate);
  background: rgba(155, 47, 61, 0.14);
  border-radius: 2px;
}

.ch-legend-year {
  font-family: var(--font-body, Georgia), Georgia, serif;
  font-variant-numeric: tabular-nums;
  min-width: 6.4em;
  flex: 0 0 auto;
}

.ch-legend-names { font-weight: inherit; }

.ch-legend-others { font-weight: 400; color: var(--muted); }

.ch-map-nostate { font-style: italic; }

.ch-enhanced .ch-map-nostate.is-on { display: flex; font-weight: 500; }

.ch-map-key {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  margin: 0 0 0.35rem;
  padding: 0.3rem 0 0;
  border-top: 1px dashed var(--line);
}

.ch-map-key li { display: flex; align-items: center; gap: 0.35rem; }

.key-swatch {
  width: 14px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 2px;
}

.key-swatch.key-primary {
  background: rgba(155, 47, 61, 0.15);
  border: 2px solid var(--pomegranate);
}

.key-swatch.key-neighbor {
  background: transparent;
  border: 2px solid var(--lapis);
}

.key-swatch.key-ghost {
  background: transparent;
  border: 1.5px dashed var(--ink-2);
}

.key-swatch.key-modern {
  background: rgba(62, 107, 87, 0.18);
  border: 2px solid var(--cypress);
}

.ch-map-note { margin: 0; }

/* event highlighting on the map */

.ch-map-event { opacity: 0; transition: opacity 400ms ease; pointer-events: none; }

.ch-map-event .ch-map-ring {
  fill: none;
  stroke: var(--pomegranate);
  stroke-width: 2.5;
}

.ch-map-event.is-live { opacity: 1; }

@keyframes ch-ring-pulse {
  0% { transform: scale(0.72); opacity: 0.9; }
  70% { transform: scale(1.25); opacity: 0.25; }
  100% { transform: scale(1.4); opacity: 0; }
}

.ch-map-event.is-live .ch-map-ring {
  transform-origin: center;
  transform-box: fill-box;
  animation: ch-ring-pulse 1.9s ease-out infinite;
}

/* now panel */

.ch-now {
  margin-top: 0.8rem;
  background: linear-gradient(135deg, rgba(155, 47, 61, 0.09), rgba(215, 168, 66, 0.09));
  border: 1px solid color-mix(in srgb, var(--pomegranate) 40%, var(--line));
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
}

.ch-now-title {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pomegranate);
  font-weight: 700;
}

.ch-now ul { margin: 0; padding-left: 1.1rem; font-size: 0.92rem; }

/* ------------------------------------------------------------- era story */

.ch-story {
  min-width: 0;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: clamp(1rem, 2.5vw, 2.25rem);
}

.ch-era {
  min-height: 165vh;
  padding: clamp(1.5rem, 4vh, 3rem) 0 clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--line);
}

.ch-era:first-child { border-top: 0; }

.ch-era-head { max-width: 46rem; }

.ch-era-kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.ch-era-order {
  font-family: var(--font-body, Georgia), Georgia, serif;
  font-size: 1.5rem;
  color: var(--copper);
  transition: color 300ms ease;
}

.ch-era h2 {
  font-family: var(--font-display, Georgia), Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 0.2rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.ch-era h2::after {
  content: "";
  display: block;
  width: 68px;
  border-bottom: 2px solid var(--gold);
  margin-top: 0.5rem;
}

.ch-era-transition {
  color: var(--ink-2);
  font-style: italic;
  margin-top: 0.6rem;
}

.ch-overview p { max-width: 62ch; }

.ch-overview h4 {
  font-family: var(--font-body, Georgia), Georgia, serif;
  margin: 1.4rem 0 0.3rem;
}

.ch-overview blockquote {
  border-inline-start: 3px solid var(--gold);
  margin-inline: 0;
  padding-inline-start: 1rem;
  color: var(--ink-2);
  font-style: italic;
}

/* evidence ledger: the era's graded claims, expandable */

.ch-evidence {
  margin-top: 1.1rem;
  max-width: 44rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ch-evidence summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  list-style: none;
}

.ch-evidence summary::-webkit-details-marker { display: none; }

.ch-evidence summary::after {
  content: "";
  flex: 0 0 auto;
  border: 4px solid transparent;
  border-top-color: var(--muted);
  translate: 0 2px;
  transition: rotate 160ms ease, translate 160ms ease;
}

.ch-evidence[open] summary::after { rotate: 180deg; translate: 0 -2px; }

.ch-evidence summary:hover { background: rgba(23, 33, 38, 0.03); }

.ch-evidence-count {
  font-size: 0.78rem;
  color: var(--ink-2);
  white-space: nowrap;
}

.ch-evidence-how {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  padding: 0.2rem 0.9rem 0.6rem;
  border-bottom: 1px dashed var(--line);
}

.ch-claim-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0.9rem 0.7rem;
}

.ch-claim-list li {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
}

.ch-claim-list li:last-child { border-bottom: 0; }

.ch-claim-text {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-family: var(--font-body, Georgia), Georgia, serif;
}

.ch-claim-note {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.ch-claim-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.ch-claim-chip {
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.ch-claim-chip.ev-solid { background: rgba(62, 107, 87, 0.14); border-color: var(--cypress); color: #2c5140; }
.ch-claim-chip.ev-consensus { background: rgba(36, 92, 115, 0.12); border-color: var(--lapis); color: #1c4a5e; }
.ch-claim-chip.ev-contested { background: rgba(155, 47, 61, 0.12); border-color: var(--pomegranate); color: #7c2531; }
.ch-claim-chip.ev-open { background: rgba(215, 168, 66, 0.16); border-color: var(--gold); color: #7a5c17; }
.ch-claim-chip.ev-conf { background: rgba(23, 33, 38, 0.05); border-color: var(--line); color: var(--ink-2); font-weight: 500; }

.ch-claim-sources { font-style: italic; }

.ch-meta-label {
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-right: 0.3rem;
}

.ch-evidence-bar {
  display: flex;
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 33, 38, 0.08);
  min-width: 60px;
}

.ch-evidence-bar .ev-solid { background: var(--cypress); }
.ch-evidence-bar .ev-consensus { background: var(--lapis); }
.ch-evidence-bar .ev-contested { background: var(--pomegranate); }
.ch-evidence-bar .ev-open { background: var(--gold); }

/* event stream */

.ch-stream-title {
  font-family: var(--font-body, Georgia), Georgia, serif;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
  margin: 1.8rem 0 0.9rem;
}

.ch-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--lapis);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  max-width: 44rem;
  transition: transform 300ms ease, box-shadow 300ms ease, opacity 300ms ease, border-color 300ms ease;
}

.ch-card h4 { margin: 0.15rem 0 0.35rem; font-family: var(--font-body, Georgia), Georgia, serif; }
.ch-card p { margin: 0 0 0.4rem; font-size: 0.94rem; }

.ch-card-war { border-inline-start-color: var(--pomegranate); }

.ch-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.ch-card-type {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--lapis);
}

.ch-card-war .ch-card-type { color: var(--pomegranate); }

.ch-card-war .ch-card-type::before {
  content: "\2694 ";
  letter-spacing: 0;
}

.ch-card-year {
  font-family: var(--font-body, Georgia), Georgia, serif;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ch-card-meta { font-size: 0.8rem; margin: 0.25rem 0; }

.ch-chip {
  display: inline-block;
  background: rgba(36, 92, 115, 0.09);
  border: 1px solid rgba(36, 92, 115, 0.22);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 0.76rem;
  margin: 0.1rem 0.1rem 0.1rem 0;
}

.ch-chip-place {
  background: rgba(182, 106, 53, 0.1);
  border-color: rgba(182, 106, 53, 0.3);
}

.ch-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.badge-uncertainty {
  background: rgba(215, 168, 66, 0.18);
  border: 1px solid rgba(215, 168, 66, 0.55);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.7rem;
}

/* scroll-time states (only meaningful when enhanced) */

.ch-enhanced .ch-card.is-future { opacity: 0.45; transform: translateY(4px); }

.ch-enhanced .ch-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 10px 32px rgba(155, 47, 61, 0.18);
  transform: translateY(-2px) scale(1.01);
}

.ch-enhanced .ch-card-war.is-active {
  border-inline-start-color: var(--pomegranate);
  box-shadow: 0 10px 32px rgba(155, 47, 61, 0.28);
}

.ch-era.is-current .ch-era-order { color: var(--pomegranate); }

.ch-people { margin-top: 1.2rem; max-width: 44rem; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .ch-layout { grid-template-columns: 1fr; }
  .ch-atlas-sticky {
    position: sticky;
    top: calc(var(--clock-offset, 150px) + 6px);
    z-index: 20;
  }
  .ch-atlas .ch-now { display: none; }
  .ch-map figcaption { padding-block: 0.35rem; }
  .ch-era { min-height: 150vh; }
  .ch-lane,
  .ch-ruler { grid-template-columns: 76px 1fr; }
  .ch-lane-label { font-size: 0.56rem; padding-inline-start: 0.4rem; }
  .ch-clock-controls { position: static; justify-content: center; padding: 0.3rem 0; }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .chronicle-page * { transition-duration: 0.01ms !important; }
  .ch-map-event.is-live .ch-map-ring { animation: none; }
  html { scroll-behavior: auto; }
}
