/* decesele-de-iarna — Thermal Cartography editorial system (Dual Theme, WCAG AAA) */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-normal-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic-az.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic-ro.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Light theme — Winter Alabaster & Terracotta (all text tokens >= 7:1 AAA) */
  --bg: #f6f3ec;
  --bg-deep: #ece6d9;
  --surface: #fcfaf5;
  --surface-alt: #efeae0;
  --map-sea: #e5ecf0;
  --map-empty: #d8d3c8;
  --fg: #14171d;
  --mut: #434b59;
  --line: #c7c0b0;
  --line-soft: #ded8ca;
  --cold: #0f4c75;
  --cold-soft: rgba(15, 76, 117, 0.11);
  --warm: #991f17;
  --warm-soft: rgba(153, 31, 23, 0.10);
  --acc: #991f17;
  --focus: #0f4c75;
  --topbar-bg: rgba(246, 243, 236, 0.94);
  --col: 68rem;
  --measure: 42rem;
  --topbar-h: 48px;
  --to-top-bg: #fcfaf5;
  --to-top-fg: #14171d;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]),
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1017;
  --bg-deep: #070a0f;
  --surface: #131924;
  --surface-alt: #1a2231;
  --map-sea: #0a1019;
  --map-empty: #222b3a;
  --fg: #f3eee4;
  --mut: #b7c1ce;
  --line: #334054;
  --line-soft: #222c3c;
  --cold: #79cdf4;
  --cold-soft: rgba(121, 205, 244, 0.14);
  --warm: #ff8676;
  --warm-soft: rgba(255, 134, 118, 0.14);
  --acc: #ff8676;
  --focus: #79cdf4;
  --topbar-bg: rgba(12, 16, 23, 0.94);
  --to-top-bg: #131924;
  --to-top-fg: #f3eee4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1017;
    --bg-deep: #070a0f;
    --surface: #131924;
    --surface-alt: #1a2231;
    --map-sea: #0a1019;
    --map-empty: #222b3a;
    --fg: #f3eee4;
    --mut: #b7c1ce;
    --line: #334054;
    --line-soft: #222c3c;
    --cold: #79cdf4;
    --cold-soft: rgba(121, 205, 244, 0.14);
    --warm: #ff8676;
    --warm-soft: rgba(255, 134, 118, 0.14);
    --acc: #ff8676;
    --focus: #79cdf4;
    --topbar-bg: rgba(12, 16, 23, 0.94);
    --to-top-bg: #131924;
    --to-top-fg: #f3eee4;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
svg[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.62;
  scroll-padding-top: calc(var(--topbar-h) + var(--browser-safe-top, env(safe-area-inset-top, 0px)) + 14px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--cold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
}
a:hover { color: var(--warm); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 12px;
  z-index: 900;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* Scroll progress hairline */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  z-index: 620;
  pointer-events: none;
  background: transparent;
}
.scroll-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--cold) 0%, var(--warm) 100%);
}

/* Sticky slim topbar (1 line at 1440px and 390px) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--browser-safe-top, env(safe-area-inset-top, 0px)) 16px 0;
  min-height: calc(var(--topbar-h) + var(--browser-safe-top, env(safe-area-inset-top, 0px)));
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line-soft);
  font: 500 0.88rem/1 var(--ui);
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ui);
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.home:hover { color: var(--warm); }
.home-mark {
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cold) 0%, var(--cold) 45%, var(--warm) 55%, var(--warm) 100%);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  padding: 4px 2px;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--mut);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.topnav a:hover, .topnav a[aria-current="true"] {
  color: var(--fg);
  border-bottom-color: var(--warm);
}

.spacer { flex: 1 1 auto; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-switch:hover { border-color: var(--warm); color: var(--warm); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.icon-btn:hover { border-color: var(--warm); color: var(--warm); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none !important; }
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .lang-switch { min-height: 40px; }
}

/* Main layout shells */
main { width: 100%; }
.wrap {
  width: min(var(--col), calc(100% - 28px));
  margin: 0 auto;
}
.prose {
  max-width: var(--measure);
}

/* Opening Hero — immediate finding, compact so the Europe Map rises above the fold on 1440x900 */
.hero {
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.kicker {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
}
h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.65rem, 2.95vw, 2.48rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 36ch;
  font-optical-sizing: auto;
}
.deck {
  margin: 0 0 12px;
  font-size: clamp(0.96rem, 1.25vw, 1.08rem);
  line-height: 1.48;
  color: var(--mut);
  max-width: 78ch;
}

/* Headline contrast strip — 3 editorial proof numbers (not generic boxes!) */
.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 11px 0 2px;
  border-top: 1px solid var(--line);
}
.proof-item {
  min-width: 0;
  padding-right: 8px;
}
.proof-num {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.38rem, 2.1vw, 1.88rem);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.proof-num.is-warm { color: var(--warm); }
.proof-num.is-cold { color: var(--cold); }
.proof-label {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.38;
  color: var(--mut);
}

/* Interactive Map Atlas Section (#harta) */
.atlas-section {
  padding: 14px 0 38px;
  border-bottom: 1px solid var(--line-soft);
}

/* Search + quick picks toolbar */
.lookup-bar {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 10px 16px;
  align-items: end;
  margin-bottom: 12px;
}
.search-wrap {
  position: relative;
  min-width: 0;
}
.search-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 5px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font: 500 0.96rem/1.2 var(--ui);
}
.search-input::placeholder { color: var(--mut); opacity: 0.85; }
.search-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  max-height: 270px;
  overflow-y: auto;
  z-index: 120;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.search-opt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: 500 0.9rem/1.3 var(--ui);
  text-align: left;
  cursor: pointer;
}
.search-opt:hover, .search-opt[aria-selected="true"] {
  background: var(--surface-alt);
}
.search-opt-sub {
  font-size: 0.78rem;
  color: var(--mut);
  white-space: nowrap;
}
.search-hint {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: var(--mut);
}

.quick-picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.quick-label {
  font-size: 0.78rem;
  color: var(--mut);
  margin-right: 2px;
}
.pick-btn {
  padding: 5px 10px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font: 500 0.8rem/1 var(--ui);
  cursor: pointer;
  white-space: nowrap;
}
.pick-btn:hover { border-color: var(--warm); color: var(--warm); }
.pick-btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Atlas workspace grid: Map Left + Dossier Right */
.atlas-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.map-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.lens-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tab-btn {
  padding: 7px 11px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--fg);
  font: 500 0.82rem/1.15 var(--ui);
  cursor: pointer;
}
.tab-btn:hover { border-color: var(--warm); }
.tab-btn[aria-selected="true"], .tab-btn[data-active="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.map-subcontrols {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.seg-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.seg-btn {
  padding: 6px 9px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--mut);
  font: 500 0.78rem/1 var(--ui);
  cursor: pointer;
}
.seg-btn[data-active="true"] {
  background: var(--surface-alt);
  color: var(--fg);
  font-weight: 600;
}
.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  min-height: 36px;
  border: 1.5px solid var(--warm);
  border-radius: 5px;
  background: var(--warm-soft);
  color: var(--warm);
  font: 600 0.8rem/1 var(--ui);
  cursor: pointer;
  white-space: nowrap;
}
.reset-btn:hover { background: var(--warm); color: var(--bg); }

.clean-view-btn {
  padding: 6px 9px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--mut);
  font: 500 0.78rem/1 var(--ui);
  cursor: pointer;
}
.clean-view-btn:hover { color: var(--fg); border-color: var(--fg); }

/* Pulse playback bar (shown when 52-week pulse lens is active) */
.pulse-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line-soft);
}
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  min-height: 38px;
  border: 1.5px solid var(--fg);
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: 600 0.82rem/1 var(--ui);
  cursor: pointer;
  white-space: nowrap;
}
.play-btn[data-on="true"] {
  background: var(--warm);
  border-color: var(--warm);
  color: #ffffff;
}
.pulse-slider {
  flex: 1 1 180px;
  min-width: 140px;
  accent-color: var(--warm);
  height: 28px;
  cursor: pointer;
}
.pulse-readout {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 130px;
}

/* Map stage canvas container */
.map-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 820;
  background: var(--map-sea);
  overflow: hidden;
  touch-action: pan-y;
}
.map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  max-width: 230px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.map-tooltip strong { display: block; font-size: 0.86rem; margin-bottom: 2px; }
.map-tooltip .tt-cta { opacity: 0.8; font-size: 0.74rem; margin-top: 3px; display: block; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8rem;
  color: var(--mut);
}
.legend-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
}
.legend-bar {
  height: 10px;
  flex: 1 1 140px;
  max-width: 240px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1b5e8a 0%, #5d97b8 25%, #e2d7be 48%, #df8a54 70%, #c5432d 86%, #7d1212 100%);
}
html[data-theme="dark"] .legend-bar {
  background: linear-gradient(90deg, #2473a3 0%, #499bc2 25%, #8a9ba8 48%, #e59356 70%, #de4c36 86%, #ff2e2e 100%);
}
.legend-ticks {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  gap: 8px;
  white-space: nowrap;
}

/* Map-only clean overlay mode */
body.map-only .topbar,
body.map-only .rail,
body.map-only .hero,
body.map-only .lookup-bar,
body.map-only .dossier-panel,
body.map-only .chapter,
body.map-only footer {
  display: none !important;
}
body.map-only .atlas-section { padding: 10px 0; border: 0; }
body.map-only .wrap { width: min(1160px, calc(100% - 20px)); }
body.map-only .atlas-grid { grid-template-columns: 1fr; }
body.map-only .map-stage { max-height: calc(var(--vh, 1vh) * 80); }

/* Right Column: Live Region Dossier */
.dossier-panel {
  min-width: 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.dossier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.dossier-kicker {
  margin: 0 0 3px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}
.dossier-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.32rem, 2vw, 1.68rem);
  line-height: 1.18;
}
.dossier-summary {
  margin: 0 0 14px;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--fg);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-cell {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg);
  min-width: 0;
}
.stat-k {
  display: block;
  font-size: 0.76rem;
  color: var(--mut);
  margin-bottom: 3px;
}
.stat-v {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.32rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-v.is-warm { color: var(--warm); }
.stat-v.is-cold { color: var(--cold); }
.stat-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--mut);
  margin-top: 2px;
}

/* 52-week waveform inside Dossier */
.wave-box {
  margin: 0 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.wave-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}
.wave-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
}
.wave-legend {
  display: flex;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--mut);
}
.dot-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-warm { background: var(--warm); }
.dot-cold { background: var(--cold); }
.wave-canvas {
  display: block;
  width: 100%;
  height: 165px;
}
.wave-note {
  margin: 5px 0 0;
  font-size: 0.76rem;
  color: var(--mut);
}

/* Quiet share row directly under the result */
.result-share {
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.share-label {
  font-size: 0.8rem;
  color: var(--mut);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.share-btn:hover { border-color: var(--warm); color: var(--warm); }
@media (pointer: coarse) {
  .share-btn { width: 44px; height: 44px; }
}
.share-status {
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 0.78rem;
  color: var(--cold);
}

/* Editorial Chapters */
.chapter {
  padding: 46px 0;
  border-bottom: 1px solid var(--line-soft);
}
.chapter-num {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
}
h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.52rem, 2.8vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 28ch;
}
h3 {
  margin: 26px 0 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.16rem, 1.8vw, 1.4rem);
  line-height: 1.25;
}
.chapter p {
  margin: 0 0 15px;
  max-width: var(--measure);
}

/* Wide data graphic containers */
.figure-block {
  margin: 24px 0 26px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.fig-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.fig-title {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.25;
}
.fig-sub {
  margin: 0;
  font-size: 0.86rem;
  color: var(--mut);
  max-width: 60ch;
}
.fig-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-filter {
  padding: 6px 11px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 500 0.8rem/1 var(--ui);
  cursor: pointer;
}
.chip-filter:hover { border-color: var(--warm); }
.chip-filter[data-active="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.chart-stage {
  position: relative;
  width: 100%;
  touch-action: pan-y;
}
.scatter-canvas {
  display: block;
  width: 100%;
  height: 410px;
  cursor: pointer;
}
.history-canvas {
  display: block;
  width: 100%;
  height: 360px;
}
.pov-canvas {
  display: block;
  width: 100%;
  height: 360px;
}
.ro-yearly-canvas {
  display: block;
  width: 100%;
  height: 220px;
}
.fig-caption {
  margin: 10px 0 0;
  font-size: 0.8rem;
  line-height: 1.48;
  color: var(--mut);
}

/* WHO Cause-of-death comparison bars */
.who-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.who-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.who-row {
  display: grid;
  grid-template-columns: 7.1rem minmax(0, 1fr) 6.5rem;
  gap: 8px;
  align-items: center;
  margin: 9px 0;
  font-size: 0.85rem;
}
.who-track {
  height: 11px;
  border-radius: 3px;
  background: var(--surface-alt);
  overflow: hidden;
}
.who-fill {
  height: 100%;
  border-radius: 3px;
}
.who-fill.is-warm { background: var(--warm); }
.who-fill.is-cold { background: var(--cold); }
.who-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Romania 42-county layout */
.ro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.ro-map-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 760 / 540;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  touch-action: pan-y;
}
.ro-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.ro-card {
  min-width: 0;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}
.ro-caveat {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--warm);
  background: var(--warm-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--fg);
}

/* Responsive accessible data tables (modern-web-guidance) */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin: 18px 0 12px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
caption {
  padding: 12px 14px;
  text-align: left;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  border-bottom: 1px solid var(--line-soft);
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--fg);
  font-weight: 600;
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody th, tbody td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
tbody th {
  font-weight: 600;
  white-space: nowrap;
}
td.num, th.num { text-align: right; }
tr.is-extra[hidden] { display: none !important; }
.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  min-height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font: 600 0.85rem/1 var(--ui);
  cursor: pointer;
}
.expand-btn:hover { border-color: var(--warm); color: var(--warm); }

/* Method & Sources lists */
.source-list {
  margin: 14px 0 0;
  padding-left: 20px;
  max-width: 66ch;
}
.source-list li {
  margin-bottom: 9px;
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Reading rail — right gutter only, hidden whenever gutter would touch content */
.rail {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rail a {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
}
.rail a::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--line);
  transition: transform 0.15s ease, background 0.15s ease;
}
.rail a:hover::before, .rail a[aria-current="true"]::before {
  background: var(--warm);
  transform: scale(1.35);
}
.rail-lbl {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.rail a:hover .rail-lbl, .rail a:focus-visible .rail-lbl {
  opacity: 1;
}
@media (max-width: 1280px) {
  .rail { display: none !important; }
}

/* Canonical footer (FOOTER-CONTRACT.md) */
footer.site-footer {
  padding: 28px 0 48px;
  font-size: 0.86rem;
  color: var(--mut);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}
.footer-inner a { color: var(--fg); font-weight: 500; }
.footer-inner a:hover { color: var(--warm); }

/* Responsive breakpoints */
@media (max-width: 1020px) {
  .atlas-grid, .ro-grid, .lookup-bar {
    grid-template-columns: 1fr;
  }
  .who-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .home { font-size: 0.82rem; gap: 5px; }
  .topnav {
    gap: 10px;
    padding-right: 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 84%, transparent 100%);
  }
  .lang-switch { padding: 6px 9px; font-size: 0.78rem; }
  .wrap { width: min(var(--col), calc(100% - 20px)); }
  .hero { padding: 16px 0 14px; }
  .proof-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dossier-panel { padding: 13px 13px; }
  .stat-grid { gap: 7px; }
  .stat-cell { padding: 8px 9px; }
  .stat-v { font-size: 1.14rem; }
  .figure-block { padding: 12px 12px; }
  .scatter-canvas { height: 320px; }
  .history-canvas, .pov-canvas { height: 290px; }
  .who-row { grid-template-columns: 5.4rem minmax(0, 1fr) 5.8rem; font-size: 0.78rem; }
  /* Mobile order: search -> dossier result -> map so answer stays immediately visible (FM-406) */
  .atlas-grid { display: flex; flex-direction: column; }
  .dossier-panel { order: 1; width: 100%; }
  .map-panel { order: 2; width: 100%; }
}

@media (max-width: 360px) {
  .topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .home-mark { display: none; }
  .tab-btn { padding: 6px 8px; font-size: 0.76rem; }
  .seg-btn { padding: 5px 7px; font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .topbar, .rail, .result-share, .lookup-bar, .map-toolbar, .pulse-bar { display: none !important; }
}
