/* =============================================================
   Hantavirus 2026 — Outbreak Surveillance Dashboard
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  --red-50:  #fff1f3;
  --red-100: #ffd9de;
  --red-200: #ffaeb8;
  --red-300: #f47888;
  --red-400: #e94560;
  --red-500: #d62235;
  --red-600: #b41527;
  --red-700: #8a0f1d;
  --red-800: #5a0913;
  --red-900: #2f060c;

  --accent:        #d62235;
  --accent-bright: #ff3850;
  --accent-deep:   #8a0f1d;
  --accent-glow:   rgba(214, 34, 53, 0.55);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --radius:    8px;
  --radius-sm: 4px;
  --radius-lg: 12px;

  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  --eyebrow-track: 0.12em;
}

html[data-theme="dark"] {
  --bg:         #08090c;
  --bg-elev:    #0d0f14;
  --surface:    #11141b;
  --surface-2:  #161a23;
  --border:     rgba(255, 255, 255, 0.06);
  --border-2:   rgba(255, 255, 255, 0.12);
  --text:       #ecedf2;
  --text-2:     #a5acbb;
  --text-3:     #6b7287;
  --map-land:   #181c25;
  --map-line:   rgba(255, 255, 255, 0.05);
  --graticule:  rgba(255, 255, 255, 0.025);
  --shadow:     0 1px 0 rgba(255,255,255,0.02), 0 12px 32px rgba(0,0,0,0.45);
  --shadow-sm:  0 1px 0 rgba(255,255,255,0.02), 0 4px 12px rgba(0,0,0,0.30);
  --gradient-hero: linear-gradient(180deg, rgba(214,34,53,0.14), transparent 70%);
}

html[data-theme="light"] {
  --bg:         #f6f7f9;
  --bg-elev:    #ffffff;
  --surface:    #ffffff;
  --surface-2:  #fafbfc;
  --border:     rgba(13, 18, 32, 0.07);
  --border-2:   rgba(13, 18, 32, 0.16);
  --text:       #0d1220;
  --text-2:     #4b5266;
  --text-3:     #7e8598;
  --map-land:   #e4e7ee;
  --map-line:   rgba(13, 18, 32, 0.06);
  --graticule:  rgba(13, 18, 32, 0.04);
  --shadow:     0 1px 0 rgba(13,18,32,0.02), 0 8px 24px rgba(13,18,32,0.06);
  --shadow-sm:  0 1px 0 rgba(13,18,32,0.02), 0 2px 8px rgba(13,18,32,0.05);
  --gradient-hero: linear-gradient(180deg, rgba(214,34,53,0.08), transparent 70%);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11", "tnum";
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.35s ease, color 0.25s ease;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.012em; }

/* ---------- Advisory banner ---------- */
.advisory {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 24px;
  background: var(--red-900);
  border-bottom: 1px solid var(--red-800);
  color: var(--red-100);
  font-size: 12.5px; line-height: 1.5;
}
html[data-theme="light"] .advisory {
  background: var(--red-50); color: var(--red-700); border-bottom-color: var(--red-100);
}
.advisory-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--red-600); color: #fff;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  white-space: nowrap;
}
.advisory-text { max-width: 980px; }
.advisory-text strong { color: var(--red-50); font-weight: 600; }
html[data-theme="light"] .advisory-text strong { color: var(--red-700); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: 1320px; margin: 0 auto;
  padding: 14px 28px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
  color: inherit; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand-name { color: var(--accent); }
.mark { color: var(--accent); display: inline-flex; flex-shrink: 0; }
.brand-text { min-width: 0; flex: 1 1 auto; }
.brand-text h1 {
  font-size: 16px; font-weight: 800; letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-sans);
  text-transform: uppercase;
}
.brand-name { color: var(--text); transition: color 0.15s; }
.brand-tld  { color: var(--accent); font-weight: 700; }
.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px; color: var(--text-3); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topnav { display: flex; align-items: center; gap: 22px; }
.navlink {
  font-size: 13px; color: var(--text-2); font-weight: 500;
  transition: color 0.15s;
}
.navlink:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; }
html[data-theme="dark"]  .icon-sun  { display: block; }
html[data-theme="dark"]  .icon-moon { display: none; }
html[data-theme="light"] .icon-sun  { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* ---------- Hero (outbreak strip) ---------- */
.hero {
  position: relative;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 28px 28px 26px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.hero-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px;
  background: var(--accent); color: #fff;
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  position: relative;
}
.status-dot::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.6);
  animation: statusRing 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes statusRing {
  0%   { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 28px; line-height: 1.15;
  letter-spacing: -0.018em; font-weight: 600;
}
.hero-meta {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin-left: auto;
}
.hero-meta-item {
  display: flex; flex-direction: column; gap: 1px;
}
.hero-meta-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
}
.hero-meta-value {
  font-size: 13px; color: var(--text); font-weight: 500;
}

/* ---------- Layout shell ---------- */
.layout {
  max-width: 1320px; margin: 0 auto;
  padding: 32px 28px 80px;
  display: flex; flex-direction: column;
  gap: var(--space-12);
}

.section-head {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: var(--space-5);
  max-width: 80ch;
}
.section-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.section-head h2 {
  font-size: 22px; line-height: 1.25;
  letter-spacing: -0.014em;
}
.section-head p {
  margin: 4px 0 0; font-size: 14px; color: var(--text-2);
}

/* ---------- Indicators ---------- */
.indicators {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ind {
  position: relative;
  padding: 22px 24px;
  border-right: 1px solid var(--border);
}
.ind:last-child { border-right: 0; }
.ind-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
}
.ind-value {
  margin-top: 8px;
  font-family: var(--font-sans); font-size: 34px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
.ind-accent .ind-value { color: var(--accent-bright); }
.ind-value small { font-size: 18px; color: var(--text-3); margin-left: 1px; font-weight: 500; }
.ind-note { margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.45; }
.ind-accent .ind-value { color: var(--accent-bright); }

/* ---------- Toolbar (placed below the map) ---------- */
.toolbar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 600ms cubic-bezier(0.22, 1, 0.36, 1) 200ms both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-group.filters { margin-left: auto; gap: 8px; }

/* Tabs share the .ctrl button style so the whole toolbar feels unified. */
.ctrl-tab {
  height: 30px; padding: 0 14px;
  font: 500 12.5px/1 var(--font-sans);
  letter-spacing: 0.005em;
  color: var(--text-2);
}
.ctrl-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.ctrl-tab.is-active:hover { color: #fff; }

.filter {
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
}
.ctrl-select {
  height: 30px;
  appearance: none; -webkit-appearance: none;
  font: 500 12.5px/1 var(--font-sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0 26px 0 10px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 14px, calc(100% - 8px) 14px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s, color 0.15s;
}
.ctrl-select:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ctrl-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ctrl-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background-image: none;
  padding-right: 12px;
}
.filter-summary {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
  padding: 0 10px;
  height: 30px;
  display: inline-flex; align-items: center;
  border-left: 1px solid var(--border);
}

/* ---------- View switcher ---------- */
.view-wrap { position: relative; }
.view { display: none; }
.view.is-active { display: block; }

.view-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.view-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 22px 8px;
}
.view-card-head h2 { font-size: 15px; font-weight: 600; }
.view-card-head p  { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); max-width: 56ch; }

/* ---------- Table view ---------- */
.hist-table-wrap {
  position: relative;
  overflow-x: auto; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 540px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.hist-table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.hist-table-wrap::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.hist-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hist-table thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.hist-table th.num, .hist-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.hist-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.hist-table tbody tr:last-child td { border-bottom: 0; }
.hist-table tbody tr:hover td { background: var(--surface-2); }
.hist-table td.state { font-weight: 600; }
.hist-table td.note  { color: var(--text-2); font-size: 12.5px; }

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.badge.out-alive   { color: var(--good); border-color: rgba(46,165,138,0.4); }
.badge.out-dead    { color: var(--accent-bright); border-color: rgba(214,34,53,0.45); background: rgba(214,34,53,0.06); }
.badge.out-unknown { color: var(--text-3); }
.badge.badge-death       { color: var(--red-300); border-color: rgba(214,34,53,0.45); }
.badge.badge-case        { color: var(--red-300); }
.badge.badge-monitoring  { color: var(--text-2); }
.badge.badge-evacuation,
.badge.badge-advisory,
.badge.badge-index       { color: var(--text-2); }

.table-meta {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
}
.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
}
.table-foot .pager { display: flex; gap: 6px; }

/* ---------- Chart view ---------- */
.chart {
  width: 100%;
  padding: 12px 22px 22px;
}
.chart svg { width: 100%; height: 360px; display: block; }
.chart-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-2);
}
.chart-key { display: inline-flex; align-items: center; gap: 6px; }
.key-swatch {
  width: 10px; height: 10px; border-radius: 2px;
  display: inline-block;
}
.key-swatch.sw-alive   { background: #2ea58a; }
.key-swatch.sw-dead    { background: var(--accent-bright); }
.key-swatch.sw-unknown { background: var(--text-3); }
.seg.seg-alive   { fill: #2ea58a; }
.seg.seg-dead    { fill: var(--accent-bright); }
.seg.seg-unknown { fill: var(--text-3); opacity: 0.6; }
.bar-highlight .seg { filter: drop-shadow(0 0 6px var(--accent-glow)); }
.bar-highlight + .bar-label,
.bar.bar-highlight text { fill: var(--accent-bright); }

.y-axis path, .x-axis path { stroke: var(--border-2); }
.y-axis text, .x-axis text {
  fill: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
}
.y-axis line.grid-line {
  stroke: var(--border);
  stroke-dasharray: 2 3;
}
.chart-empty {
  font-family: var(--font-mono); font-size: 11px;
  fill: var(--text-3);
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
}

.legend-note {
  font-family: var(--font-mono); font-size: 9.5px;
  color: var(--text-3);
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Board (map + toolbar + side panel) ----------
 * Desktop layout (≥1081 px):
 *     ┌───────────────┬──────────┐
 *     │   VIEW (map)  │          │
 *     ├───────────────┤ TIMELINE │
 *     │   TOOLBAR     │          │
 *     └───────────────┴──────────┘
 * Mobile (≤1080 px): single column, ordered map → toolbar → timeline.       */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: 1fr auto;
  gap: var(--space-4);
  min-width: 0;
}
.board > .view-wrap { grid-column: 1; grid-row: 1; min-width: 0; }
.board > .toolbar   { grid-column: 1; grid-row: 2; margin-top: 0; }
.board > .panel     { grid-column: 2; grid-row: 1 / span 2; }

@media (max-width: 1080px) {
  .board {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .board > .view-wrap { order: 1; }
  .board > .toolbar   { order: 2; }
  .board > .panel     { order: 3; }
  .indicators { grid-template-columns: repeat(2, 1fr); }
  .indicators .ind:nth-child(2) { border-right: 0; }
  .indicators .ind:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .topnav .navlink { display: none; }
}

/* Tablet & below */
@media (max-width: 760px) {
  body { font-size: 14px; }

  /* Reorder the layout sections so the map is first under the hero. */
  .layout                                    { display: flex; flex-direction: column; }
  .layout > #map-section                     { order: 1; }
  .layout > .indicators                      { order: 2; }
  .layout > #us-monitoring                   { order: 3; }
  .layout > [aria-labelledby="ctx-heading"]  { order: 4; }
  .layout > #clinical                        { order: 5; }
  .layout > #prevention                      { order: 6; }
  .layout > [aria-labelledby="rep-heading"]  { order: 7; }
  .layout > #sources                         { order: 8; }
  .layout > [aria-labelledby="legal-heading"]{ order: 9; }
  .layout > .footer                          { order: 10; }

  /* Disable sticky topbar on mobile.
   *
   * iOS Safari combines `position: sticky` and rubber-band scrolling poorly:
   * during overscroll the topbar paints over the advisory band, making the
   * theme-toggle icon appear to "go over" the disclaimer. A regular static
   * header has none of these glitches and behaves identically once the user
   * scrolls down past it. */
  .topbar         {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .topbar-inner   { padding: 10px 14px; gap: 10px; }
  .brand          { gap: 10px; min-width: 0; flex: 1 1 auto; }
  .brand-text h1  { font-size: 14px; }
  .brand-text p   { display: none; }
  .topnav         { flex: 0 0 auto; }

  .advisory       {
    padding: 6px 12px; font-size: 11px; gap: 6px;
    text-align: left;
    line-height: 1.4;
  }
  .advisory-tag   { padding: 2px 6px; font-size: 9.5px; }
  .advisory-text  { font-size: 11px; }

  /* Compact hero strip on mobile so the map fits high in the viewport. */
  .hero-inner     {
    padding: 12px 14px;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .hero-status    { padding: 4px 8px; font-size: 10px; }
  .hero-title     {
    font-size: 16px; line-height: 1.25;
    flex: 1 1 100%;
    margin: 0;
    overflow-wrap: anywhere;
  }
  .hero-meta      { display: none; }  /* virus/status/as-of moves to indicators */

  .layout         { padding: 12px 14px 48px; gap: 28px; }

  /* Make the section header above the map small so the map dominates */
  #map-section > .section-head {
    margin-bottom: 8px;
  }
  #map-section > .section-head h2 { font-size: 16px; }
  #map-section > .section-head p  { display: none; }
  #map-section > .section-head .section-eyebrow { margin-bottom: 2px; }

  .section-head h2 { font-size: 17px; }
  .section-head p  { font-size: 12.5px; }

  .ind             { padding: 14px 16px; }
  .ind-value       { font-size: 24px; }
  .ind-value small { font-size: 14px; }

  /* Fixed pixel height for the map on mobile.
   *
   * Anything based on `vh` (or `dvh`/`svh`) changes when the mobile URL bar
   * collapses on scroll. That change fires the ResizeObserver and re-projects
   * the entire map every time — making it appear to "redraw" while scrolling.
   * Using a fixed pixel height makes the map size independent of viewport so
   * scroll doesn't trigger any re-projection at all. */
  .map-wrap        {
    min-height: 0;
    border-radius: var(--radius);
    height: 380px;
  }
  .map             { min-height: 0; height: 100%; }
  .map-head        { padding: 12px 14px 6px; }
  .map-head h2     { font-size: 14px; }
  .map-head p      { display: none; }
  .map-hint        { display: none; }

  /* .board handles map → toolbar → timeline order itself now. */
  .map-legend      {
    left: 10px; right: 10px; bottom: 10px;
    gap: 6px 10px; padding: 7px 10px;
    font-size: 9.5px;
    overflow-x: auto; white-space: nowrap;
  }

  .panel           { padding: 14px; max-height: none; }
  .event-list      { max-height: 420px; }

  /* Toolbar / filters wrap cleanly */
  .toolbar          { padding: 10px; gap: 10px; }
  .toolbar-group    { width: 100%; }
  .toolbar-group.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .toolbar-group.view-tabs .ctrl-tab { width: 100%; padding: 0 6px; }
  .toolbar-group.filters   { margin-left: 0; gap: 8px; }
  .filter           { flex: 1 1 calc(50% - 4px); display: flex; align-items: center; gap: 6px; }
  .filter .ctrl-select { width: 100%; }
  .filter-summary   {
    flex: 1 1 100%;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 6px 0 0;
    text-align: center;
  }

  /* Table view fills the viewport with horizontal swipe */
  .hist-table-wrap { max-height: 60vh; }
  .hist-table      { min-width: 520px; }
  .hist-table thead th,
  .hist-table tbody td { padding: 10px 12px; white-space: nowrap; }
  .hist-table th:first-child,
  .hist-table td:first-child {
    position: sticky; left: 0; background: var(--surface); z-index: 1;
    box-shadow: 1px 0 0 var(--border);
  }
  .hist-table thead th:first-child { background: var(--surface-2); }
  .view-card-head  { flex-direction: column; align-items: flex-start; padding: 14px 16px 6px; }
  .table-foot      { padding: 10px 16px; }
  .chart           { padding: 8px 12px 16px; }
  .chart svg       { height: 300px; }
  .chart-legend    { font-size: 10px; gap: 10px; }

  /* US monitoring table — proper horizontal swipe scrolling on mobile */
  .us-table-wrap { position: relative; }
  .us-table-wrap::after {
    /* Fading right edge hints that the table scrolls horizontally */
    content: "";
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--surface) 80%);
    opacity: 0.9;
  }
  .us-table {
    min-width: 560px;
    scroll-snap-align: start;
  }
  .us-table thead th,
  .us-table tbody td {
    padding: 11px 14px;
    white-space: nowrap;
  }
  .us-table td.note {
    font-size: 12px;
    white-space: normal;
    min-width: 220px;
  }
  /* Sticky first column so the state name stays visible while you swipe */
  .us-table th:first-child,
  .us-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 1;
    box-shadow: 1px 0 0 var(--border);
  }
  .us-table thead th:first-child { background: var(--surface-2); }

  /* Indicators — separate spaced cards on mobile so they breathe. */
  .indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .indicators .ind {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 14px 14px 18px;
    box-shadow: var(--shadow-sm);
  }
  .indicators .ind::before { border-radius: var(--radius) 0 0 var(--radius); }
  .ind-label { font-size: 10px; }
  .ind-value { font-size: 22px; }
  .ind-note  { font-size: 11px; line-height: 1.35; }

  /* Reporting / context cards stack */
  .reporting-grid, .context-grid, .clinical-grid {
    grid-template-columns: 1fr;
  }
  .clinical-grid .card-emergency, .clinical-grid .card-hfrs { grid-column: auto; }

  .prev-list       { grid-template-columns: 1fr; }
  .legal-grid      { grid-template-columns: 1fr; gap: 18px; }

  .footer-row      { font-size: 11.5px; }
  .tooltip         { min-width: 0; max-width: calc(100vw - 24px); }
}

/* Phones */
@media (max-width: 420px) {
  body { font-size: 13.5px; }
  .hero-title { font-size: 20px; }
  .hero-meta { gap: 10px 14px; }
  .hero-meta-item { min-width: 84px; }
  .indicators { grid-template-columns: 1fr; }
  .ind-value { font-size: 22px; }
  .section-head h2 { font-size: 17px; }
}

/* ------------------------------------------------------------------
 * Hard guarantee: no horizontal scrolling anywhere on any device.
 *
 * Root cause of the earlier "20 % cut off on the right" was the body
 * being a flex container with default `min-width: auto` children — so
 * children refused to shrink and overflowed past viewport. The body is
 * now a plain block element; every top-level container is pinned to
 * 100 % width and constrained by max-width: 100 vw.
 * ------------------------------------------------------------------ */
html { width: 100%; }
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}
body > .advisory,
body > .topbar,
body > .hero,
body > main,
body > footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.topbar-inner,
.hero-inner,
.layout {
  width: 100%;
  max-width: min(1320px, 100%);
  box-sizing: border-box;
}
.layout > section,
.layout > footer {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
img, svg, table, video, iframe { max-width: 100%; }
*, *::before, *::after { min-width: 0; }

/* Long-word breaking on every text-heavy container */
.advisory, .advisory-text,
.ev-note, .ev-title, .ev-place,
.card p, .card h3,
.ctx-note, .ctx-region,
.section-head p, .section-head h2,
.footer-row,
.legal-grid p, .legal-grid h3,
.reporting-grid p,
.us-table td.note,
.brand-text p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Map ---------- */
.map-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-height: 620px; overflow: hidden;
}
.map-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 22px 8px;
}
.map-head h2 { font-size: 15px; font-weight: 600; }
.map-head p  { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); max-width: 56ch; }
.map-controls { display: flex; gap: 4px; }
.ctrl {
  height: 28px; min-width: 32px; padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2);
  font-family: var(--font-mono); font-size: 12px;
  cursor: pointer; transition: 0.15s;
}
.ctrl:hover { border-color: var(--accent); color: var(--accent); }

.map {
  position: relative;
  flex: 1;
  min-height: 540px;
  touch-action: none;
}
.map svg { width: 100%; height: 100%; display: block; cursor: grab; }
.map svg:active { cursor: grabbing; }
.map-hint {
  position: absolute; top: 14px; left: 22px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
  pointer-events: none;
  opacity: 0.7;
}

.map-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--text-3); font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: var(--eyebrow-track);
}
.loader-bar {
  display: block; width: 110px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%; animation: shimmer 1.5s linear infinite;
}
.loader-bar:nth-child(2) { width: 70px; animation-delay: 0.2s; }
.loader-bar:nth-child(3) { width: 36px; animation-delay: 0.4s; }
@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* Map geographic shapes */
.country {
  fill: var(--map-land);
  stroke: var(--map-line);
  stroke-width: 0.45;
  shape-rendering: geometricPrecision;
  transition: fill 0.6s ease, stroke 0.2s ease, filter 0.25s ease;
}
.country.has-data { cursor: default; }
.country.has-data:hover {
  stroke: var(--red-300);
  stroke-width: 1;
  filter: brightness(1.18) drop-shadow(0 0 6px var(--accent-glow));
}
/* Death-driven shading — most countries stay at base land tone */
.country.lvl-1 { fill: color-mix(in srgb, var(--map-land) 88%, var(--red-800) 12%); }
.country.lvl-2 { fill: color-mix(in srgb, var(--map-land) 60%, var(--red-700) 40%); }
.country.lvl-3 { fill: color-mix(in srgb, var(--map-land) 30%, var(--red-600) 70%); }
html[data-theme="light"] .country.lvl-1 { fill: color-mix(in srgb, var(--map-land) 80%, var(--red-200) 20%); }
html[data-theme="light"] .country.lvl-2 { fill: var(--red-200); }
html[data-theme="light"] .country.lvl-3 { fill: var(--red-300); }
.graticule {
  fill: none;
  stroke: var(--graticule);
  stroke-width: 0.35;
  shape-rendering: geometricPrecision;
  animation: graticuleFade 1.6s ease both;
}
@keyframes graticuleFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.sphere {
  fill: transparent;
  stroke: var(--border-2);
  stroke-width: 0.6;
  filter: drop-shadow(0 0 14px rgba(214,34,53,0.10));
}
.vignette {
  pointer-events: none;
  opacity: 0.6;
  animation: vignetteBreathe 12s ease-in-out infinite;
}
@keyframes vignetteBreathe {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 0.45; }
}
html[data-theme="light"] .vignette { opacity: 0.12; animation: none; }

/* Country hover label */
.country-label-bg {
  fill: var(--surface);
  stroke: var(--border-2);
  stroke-width: 1;
}
.country-label-text {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
  letter-spacing: -0.005em;
}


/* ---------- Event markers — strongly differentiated by type ---------- */
.marker {
  shape-rendering: geometricPrecision;
}
.marker:hover { cursor: pointer; }
.marker-hit { cursor: pointer; }

/* DEATH — solid red bullseye with bright outer halo */
.marker-death .marker-core      { fill: #ff3850; }
.marker-death .marker-outline   { fill: none; stroke: #ffffff; stroke-width: 1.5; }
.marker-death .marker-outer     { fill: none; stroke: #ff3850; stroke-width: 1; opacity: 0.6; }

/* CASE — solid filled disk, no outline */
.marker-case .marker-core       { fill: var(--accent); }
.marker-case .marker-outline    { display: none; }

/* MONITORING — hollow ring only (no fill) — very distinct from death/case */
.marker-monitoring .marker-core    { fill: transparent; }
.marker-monitoring .marker-outline { fill: none; stroke: var(--accent); stroke-width: 1.5; }

/* EVAC / ADVISORY / INDEX — small subtle markers */
.marker-evacuation .marker-core,
.marker-advisory   .marker-core,
.marker-index      .marker-core {
  fill: var(--text-2);
  opacity: 0.7;
}
.marker-evacuation .marker-outline,
.marker-advisory   .marker-outline,
.marker-index      .marker-outline { display: none; }

/* Historical state proportional bubbles:
   outer transparent-red ring = total cases;
   inner solid red core       = deaths.                                */
.marker-state .marker-outer { fill: rgba(214, 34, 53, 0.10); stroke: var(--red-400); stroke-width: 0.8; }
.marker-state .marker-core  { fill: var(--accent-bright); }
.marker-state .marker-outline { display: none; }

/* Hover lift */
.marker:hover .marker-core,
.marker:hover .marker-outer,
.marker:hover .marker-outline {
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

/* ---------- Ambient radar scan ----------
 * Emanates from the worst hotspot. Pure decoration that makes the map feel
 * "live" without competing with the data markers themselves. */
.ambient-aura {
  fill: var(--accent);
  opacity: 0.06;
  animation: ambientAura 4.2s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes ambientAura {
  0%, 100% { transform: scale(0.9); opacity: 0.04; }
  50%      { transform: scale(1.15); opacity: 0.10; }
}
.ambient-scan {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  pointer-events: none;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

/* Continuous breathing halo behind every death marker — soft, slow */
.marker-breathe {
  fill: #ff3850;
  opacity: 0;
  pointer-events: none;
  animation: markerBreathe 2.6s ease-in-out infinite;
  animation-delay: var(--breathe-delay, 0s);
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes markerBreathe {
  0%, 100% { transform: scale(0.55); opacity: 0;    }
  50%      { transform: scale(1.7);  opacity: 0.45; }
}

/* Continuous concentric pulse — smooth, slow, calm */
.marker-ring {
  fill: none;
  stroke-width: 1;
  stroke: var(--accent);
  opacity: 0;
  animation: ringPulse 3.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: var(--pulse-delay, 0s);
  transform-origin: center;
  transform-box: fill-box;
  will-change: transform, opacity;
  pointer-events: none;
}
.marker-ring-2 {
  stroke-width: 0.7;
  opacity: 0;
}
.marker-death .marker-ring   { stroke: #ff5b6e; }
.marker-case  .marker-ring   { stroke: var(--accent); }
.marker-state .marker-ring   { stroke: var(--accent-bright); }
@keyframes ringPulse {
  0%   { transform: scale(0.85); opacity: 0;    stroke-width: 1.2; }
  12%  { opacity: 0.7; }
  100% { transform: scale(3.0);  opacity: 0;    stroke-width: 0.3; }
}

/* Elastic entry — markers pop in with a tiny bounce */
.marker.is-entering > circle:not(.marker-hit) {
  animation: markerEnter 700ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: var(--enter-delay, 0ms);
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes markerEnter {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
.marker.is-entering { animation: markerGroupFade 700ms ease both; animation-delay: var(--enter-delay, 0ms); }
@keyframes markerGroupFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Hover lift */
.marker { transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); }
.marker:hover {
  transform-box: fill-box;
  transform-origin: center;
}
.marker:hover > circle:not(.marker-hit):not(.marker-ring) {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.22s ease;
  transform-origin: center;
  transform-box: fill-box;
  transform: scale(1.18);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* Selected flash */
.marker.flash .marker-core {
  animation: flashOnce 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes flashOnce {
  0%   { transform: scale(0.4); filter: drop-shadow(0 0 16px var(--accent-glow)); }
  60%  { transform: scale(1.9); filter: drop-shadow(0 0 22px var(--accent-glow)); }
  100% { transform: scale(1);   filter: drop-shadow(0 0 0  transparent); }
}

/* ---------- Map legend ---------- */
.map-legend {
  position: absolute; left: 22px; bottom: 22px;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 700ms cubic-bezier(0.22, 1, 0.36, 1) 800ms both;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.legend-title { color: var(--text-3); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-mark {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
}
.legend-mark.l-death { background: radial-gradient(circle, #ff5b6e, var(--red-600) 60%, transparent 100%); }
.legend-mark.l-case  { background: radial-gradient(circle, #ff8090, var(--red-500) 60%, transparent 100%); }
.legend-mark.l-mon   { background: radial-gradient(circle, #ffb1bc, var(--red-400) 60%, transparent 100%); }
.legend-mark.l-other { background: radial-gradient(circle, #ffdce0, var(--red-300) 60%, transparent 100%); }

/* New legend marks mirror the SVG marker styles */
.legend-mark.mk-death {
  background: #ff3850;
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px rgba(255,56,80,0.6);
}
.legend-mark.mk-case  { background: var(--accent); }
.legend-mark.mk-mon   {
  background: transparent;
  border: 1.5px solid var(--accent);
}
.legend-mark.mk-other { background: var(--text-3); opacity: 0.6; }
.legend-mark.mk-state-outer {
  width: 14px; height: 14px;
  background: rgba(214,34,53,0.10);
  border: 1px solid var(--red-400);
}
.legend-mark.mk-state-inner {
  width: 8px; height: 8px;
  background: var(--accent-bright);
}

/* ---------- Side timeline panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: 760px;
}
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head p  { margin: 4px 0 0; font-size: 12px; color: var(--text-2); }
.event-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
}
.event-list::-webkit-scrollbar { width: 6px; }
.event-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.ev {
  position: relative;
  display: grid; grid-template-columns: 24px 1fr;
  gap: 10px; padding: 10px 6px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
}
.ev:hover { background: var(--surface-2); }
.ev-rail { position: relative; }
.ev-rail::before {
  content: ""; position: absolute;
  left: 9px; top: 8px; bottom: -10px;
  width: 1px; background: var(--border-2);
}
.ev:last-child .ev-rail::before { display: none; }
.ev-dot {
  position: absolute; left: 5px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface);
}
.ev-death .ev-dot      { background: var(--red-500); }
.ev-case  .ev-dot      { background: var(--red-400); }
.ev-monitoring .ev-dot { background: var(--red-300); }
.ev-evacuation .ev-dot { background: var(--red-200); }
.ev-advisory   .ev-dot { background: var(--red-300); }
.ev-index      .ev-dot { background: var(--red-100); }

.ev-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
}
.ev-kind {
  padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.kind-death       { color: var(--red-300); border-color: rgba(214,34,53,0.35); }
.kind-case        { color: var(--red-400); border-color: rgba(214,34,53,0.30); }
.kind-monitoring  { color: var(--red-300); border-color: rgba(214,34,53,0.20); }
.kind-evacuation,
.kind-advisory,
.kind-index       { color: var(--text-2); }

.ev-title { margin-top: 2px; font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.ev-place { font-size: 12px; color: var(--text-2); }
.ev-note  { margin: 6px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* ---------- US monitoring table ---------- */
.us-table-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.us-table-wrap::-webkit-scrollbar { height: 8px; }
.us-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.us-table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}
.us-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.us-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.us-table thead th {
  text-align: left;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.us-table th.num, .us-table td.num { text-align: right; }
.us-table tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.us-table tbody tr:last-child td { border-bottom: 0; }
.us-table tbody tr:hover td { background: var(--surface-2); }
.us-table td.state { font-weight: 600; }
.us-table td.cases {
  font-family: var(--font-mono); color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}
.us-table td.note { color: var(--text-2); font-size: 12.5px; }

/* ---------- Regional context ---------- */
.context-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4);
}
@media (max-width: 920px) { .context-grid { grid-template-columns: 1fr; } }
.ctx-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.ctx-region { font-size: 15px; font-weight: 600; }
.ctx-virus {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--accent);
}
.ctx-rows {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.ctx-rows span {
  display: block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
}
.ctx-rows strong {
  font-family: var(--font-sans); font-size: 22px; font-weight: 600;
  letter-spacing: -0.015em; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ctx-note { margin: 14px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.ctx-source {
  margin-top: auto; padding-top: 12px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-3);
}

/* ---------- Clinical & prevention ---------- */
.clinical-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4);
}
.clinical-grid .card-emergency { grid-column: 1 / -1; }
.clinical-grid .card-hfrs      { grid-column: span 2; }
@media (max-width: 980px) {
  .clinical-grid { grid-template-columns: 1fr; }
  .clinical-grid .card-emergency, .clinical-grid .card-hfrs { grid-column: auto; }
}
.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.card-eyebrow + p, .card-eyebrow + ul { margin-top: 0; }
.card p { margin: 0 0 16px; font-size: 14px; color: var(--text); line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text); line-height: 1.65; }
.card ul li { margin-bottom: 4px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }

.card-symptoms-early { border-left: 2px solid var(--red-300); }
.card-symptoms-late  { border-left: 2px solid var(--red-500); }

.card-emergency {
  background: linear-gradient(180deg, var(--red-800), var(--red-900));
  border-color: var(--red-700);
  color: var(--red-50);
}
html[data-theme="light"] .card-emergency {
  background: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-700);
}
.card-emergency .card-eyebrow { color: var(--red-200); }
html[data-theme="light"] .card-emergency .card-eyebrow { color: var(--red-600); }
.card-emergency p { color: inherit; }

/* Prevention list */
.prev-list {
  list-style: none; padding: 0; margin: 0;
  counter-reset: prev;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3);
}
@media (max-width: 820px) { .prev-list { grid-template-columns: 1fr; } }
.prev-item {
  position: relative;
  padding: 20px 22px 20px 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  counter-increment: prev;
}
.prev-item::before {
  content: counter(prev, decimal-leading-zero);
  position: absolute; left: 22px; top: 19px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.prev-item h3 { font-size: 14px; font-weight: 600; }
.prev-item p  { margin: 6px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.55; }

/* ---------- Reporting + Sources + Legal ---------- */
.reporting-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4);
}
@media (max-width: 920px) { .reporting-grid { grid-template-columns: 1fr; } }
.reporting-grid p { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.reporting-grid p strong { color: var(--text); font-weight: 600; }

.src-list {
  list-style: none; padding: 0; margin: 0 0 18px;
  font-family: var(--font-serif); font-size: 14.5px;
  color: var(--text-2); line-height: 1.7;
}
.src-list li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--border);
}
.src-list li:last-child { border-bottom: 0; }
.src-list li::before {
  content: ""; position: absolute;
  left: 0; top: 19px;
  width: 8px; height: 1px;
  background: var(--accent);
}
.src-list em { color: var(--text); font-style: italic; }
.src-method {
  font-family: var(--font-serif); font-size: 14px; color: var(--text-2);
  border-left: 2px solid var(--accent);
  padding: 4px 16px;
  margin: 0;
  line-height: 1.6;
}
.src-method strong { color: var(--text); font-weight: 600; }

.legal-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5) var(--space-8);
}
@media (max-width: 760px) { .legal-grid { grid-template-columns: 1fr; } }
.legal-grid h3 {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0; margin-bottom: 6px;
  color: var(--text);
}
.legal-grid p {
  margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.footer-row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.footer-fine { margin-top: 6px; }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed; z-index: 99; pointer-events: none;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  min-width: 240px; max-width: 320px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  transition: opacity 0.12s;
  transform: translate(12px, 12px);
}
html[data-theme="light"] .tooltip {
  box-shadow: 0 10px 28px rgba(13, 18, 32, 0.15);
}
.tooltip[hidden] { display: none; }
.tt-name {
  font-weight: 600; font-size: 13.5px;
  letter-spacing: -0.008em;
  margin-bottom: 2px;
}
.tt-place { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.tt-note  { font-size: 12.5px; color: var(--text); line-height: 1.5; margin-bottom: 10px; }
.tt-meta {
  display: flex; gap: 8px; align-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: var(--eyebrow-track); text-transform: uppercase;
}
.tt-date { color: var(--text-3); }
.tt-kind {
  padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--border-2);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
