/* ==========================================================================
   Tonga Seabed Mining Policy Tracker — "Moana Watch"
   Ocean-derived palette: deep navy/teal surfaces, cyan-teal accent,
   coral for opposition/danger, amber for pending, sea-green for support.
   ========================================================================== */

/* ---- Base reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, svg, canvas { display: block; max-width: 100%; }
ul[role='list'], ol[role='list'] { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.2; font-family: var(--font-display); }
p, li { text-wrap: pretty; }
table { border-collapse: collapse; width: 100%; }
a { color: inherit; }
button { cursor: pointer; background: none; border: none; }
::selection { background: color-mix(in oklab, var(--color-primary) 30%, transparent); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--radius-sm); }

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

/* ---- Design tokens ---- */
:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.25vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.9vw, 1.75rem);

  /* Spacing (4px system) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;

  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 0.875rem; --radius-full: 9999px;
  --transition-interactive: 160ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --sidebar-w: 248px;
  --header-h: 64px;
}

/* Light mode */
:root, [data-theme='light'] {
  --color-bg: #F2F8F7;
  --color-surface: #FFFFFF;
  --color-surface-2: #EAF4F2;
  --color-surface-offset: #DFEEEB;
  --color-border: #C7DEDA;
  --color-divider: #D6E9E5;
  --color-text: #0E2B2C;
  --color-text-muted: #4E6E70;
  --color-text-faint: #8CA9AA;
  --color-text-inverse: #F2F8F7;

  --color-primary: #0E7C86;
  --color-primary-hover: #0A5D66;
  --color-primary-active: #084850;
  --color-primary-highlight: #D2EBEA;

  --color-coral: #D9634F;
  --color-coral-highlight: #F7DCD6;
  --color-amber: #B8801E;
  --color-amber-highlight: #F3E4C4;
  --color-green: #3F8F5D;
  --color-green-highlight: #D9EEE1;
  --color-blue: #2E6FA3;
  --color-blue-highlight: #D7E7F2;

  --shadow-sm: 0 1px 2px rgba(14, 43, 44, 0.06);
  --shadow-md: 0 6px 16px rgba(14, 43, 44, 0.08);
  --shadow-lg: 0 16px 36px rgba(14, 43, 44, 0.14);
}

/* Dark mode */
[data-theme='dark'] {
  --color-bg: #071B1D;
  --color-surface: #0C2529;
  --color-surface-2: #102E33;
  --color-surface-offset: #13343A;
  --color-border: #1E4247;
  --color-divider: #163A3F;
  --color-text: #DCEDEC;
  --color-text-muted: #8FB4B4;
  --color-text-faint: #5C8586;
  --color-text-inverse: #071B1D;

  --color-primary: #4FC3C9;
  --color-primary-hover: #6FD4D8;
  --color-primary-active: #8CE0E3;
  --color-primary-highlight: #16393C;

  --color-coral: #F08877;
  --color-coral-highlight: #3A2320;
  --color-amber: #E0AE4E;
  --color-amber-highlight: #3A2E15;
  --color-green: #6FBF8B;
  --color-green-highlight: #173328;
  --color-blue: #6DA9DC;
  --color-blue-highlight: #17293a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #071B1D; --color-surface: #0C2529; --color-surface-2: #102E33;
    --color-surface-offset: #13343A; --color-border: #1E4247; --color-divider: #163A3F;
    --color-text: #DCEDEC; --color-text-muted: #8FB4B4; --color-text-faint: #5C8586;
    --color-text-inverse: #071B1D;
    --color-primary: #4FC3C9; --color-primary-hover: #6FD4D8; --color-primary-active: #8CE0E3;
    --color-primary-highlight: #16393C;
    --color-coral: #F08877; --color-coral-highlight: #3A2320;
    --color-amber: #E0AE4E; --color-amber-highlight: #3A2E15;
    --color-green: #6FBF8B; --color-green-highlight: #173328;
    --color-blue: #6DA9DC; --color-blue-highlight: #17293A;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow-md: 0 6px 16px rgba(0,0,0,0.35); --shadow-lg: 0 16px 36px rgba(0,0,0,0.5);
  }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  height: 100dvh;
}

/* Sidebar */
.sidebar {
  grid-row: 1 / -1;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
  gap: var(--space-6);
  z-index: 20;
}

.sidebar-brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.logo { color: var(--color-primary); flex-shrink: 0; }
.logo-bg { color: var(--color-primary); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); letter-spacing: -0.01em; }
.brand-sub { font-size: var(--text-xs); color: var(--color-text-muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.nav-link svg { flex-shrink: 0; opacity: 0.85; }
.nav-link:hover { background: var(--color-surface-2); color: var(--color-text); }
.nav-link.active { background: var(--color-primary-highlight); color: var(--color-primary); font-weight: 600; }

.sidebar-footer { padding: var(--space-3) var(--space-2); border-top: 1px solid var(--color-divider); }
.sidebar-footer p { font-size: var(--text-xs); color: var(--color-text-faint); line-height: 1.5; }

/* Header */
.header {
  grid-column: 2;
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-6);
  background: color-mix(in oklab, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.menu-toggle { display: none; padding: var(--space-2); border-radius: var(--radius-sm); color: var(--color-text); }
.header-title { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; }
.header-title h1 { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; }
.header-updated { font-size: var(--text-xs); color: var(--color-text-faint); font-variant-numeric: tabular-nums; }
.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.live-pill {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-size: var(--text-xs); color: var(--color-text-muted);
  white-space: nowrap;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-amber); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: background var(--transition-interactive);
}
.theme-toggle:hover { background: var(--color-surface-offset); }

/* Main */
.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-8) var(--space-6) var(--space-20);
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

.view-section { padding-top: var(--space-4); margin-bottom: var(--space-16); scroll-margin-top: calc(var(--header-h) + var(--space-2)); }
.view-section:first-child { margin-bottom: var(--space-12); }

.section-head { margin-bottom: var(--space-6); max-width: 780px; }
.section-head h2 { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-1); letter-spacing: -0.01em; }
.section-lede { font-size: var(--text-base); color: var(--color-text-muted); max-width: 780px; margin-bottom: var(--space-8); }
.muted { color: var(--color-text-muted); }
.muted.small { font-size: var(--text-xs); }
.subhead { font-size: var(--text-base); font-weight: 700; margin: var(--space-10) 0 var(--space-4); }

/* ==========================================================================
   KPI cards
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--color-border);
  content-visibility: auto;
  contain-intrinsic-size: 0 140px;
}
.kpi-card.tone-good { border-top-color: var(--color-green); }
.kpi-card.tone-warn { border-top-color: var(--color-amber); }
.kpi-card.tone-danger { border-top-color: var(--color-coral); }
.kpi-card.tone-neutral { border-top-color: var(--color-primary); }

.kpi-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.kpi-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; margin-bottom: var(--space-2); letter-spacing: -0.01em; }
.kpi-detail { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; margin-bottom: var(--space-3); }
.kpi-source a { font-size: var(--text-xs); color: var(--color-primary); text-decoration: none; }
.kpi-source a:hover { text-decoration: underline; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head { padding: var(--space-5) var(--space-5) var(--space-3); }
.card-head h2, .card-head h3 { font-size: var(--text-base); font-weight: 700; }
.card-body { padding: 0 var(--space-5) var(--space-5); }
.summary-card { margin-top: var(--space-8); }
.summary-card .card-body p { color: var(--color-text-muted); line-height: 1.7; max-width: 68ch; }

.overview-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); }
.span-2 { grid-column: span 1; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.small { height: 160px; }

/* ==========================================================================
   Timeline component
   ========================================================================== */
.timeline { position: relative; padding-left: var(--space-6); }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--color-divider); }
.timeline-item { position: relative; padding-bottom: var(--space-8); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); border: 2px solid var(--color-surface); box-shadow: 0 0 0 2px var(--color-primary-highlight); }
.timeline-item.highlight .timeline-dot { background: var(--color-coral); box-shadow: 0 0 0 2px var(--color-coral-highlight); }
.timeline-date { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; margin-bottom: var(--space-1); }
.timeline-item.highlight .timeline-date { color: var(--color-coral); }
.timeline-title { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-1); }
.timeline-detail { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; margin-bottom: var(--space-2); max-width: 68ch; }
.timeline-source a { font-size: var(--text-xs); color: var(--color-primary); text-decoration: none; }
.timeline-source a:hover { text-decoration: underline; }

.timeline.compact .timeline-item { padding-bottom: var(--space-6); }
.mini-timeline .timeline-item { padding-bottom: var(--space-5); }
.mini-timeline .timeline-title { font-size: var(--text-sm); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.data-table { font-size: var(--text-sm); }
.data-table thead { position: sticky; top: 0; z-index: 1; background: var(--color-surface-2); }
.data-table th { text-align: left; padding: var(--space-3) var(--space-4); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.data-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-divider); vertical-align: top; line-height: 1.55; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.highlight td { background: var(--color-coral-highlight); }
.data-table td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table a { color: var(--color-primary); text-decoration: none; font-size: var(--text-xs); }
.data-table a:hover { text-decoration: underline; }
.outcome-badge { display: inline-block; padding: 2px var(--space-2); border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }

/* ==========================================================================
   Status grid (TOML section)
   ========================================================================== */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-4); }
.status-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.status-card h3 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-1); }
.status-card .status-summary { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); line-height: 1.6; }
.status-list { display: flex; flex-direction: column; gap: var(--space-3); }
.status-row { padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-divider); }
.status-row:last-child { border-bottom: none; padding-bottom: 0; }
.status-row-label { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: var(--space-1); }
.status-row-value { font-size: var(--text-sm); line-height: 1.55; }
.status-row-value a { font-size: var(--text-xs); color: var(--color-primary); text-decoration: none; margin-left: var(--space-1); white-space: nowrap; }
.status-row-value a:hover { text-decoration: underline; }

/* ==========================================================================
   Country grid (moratorium bloc)
   ========================================================================== */
.country-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.country-card { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-sm); }
.country-card.stance-moratorium { border-left-color: var(--color-coral); }
.country-card.stance-pause { border-left-color: var(--color-amber); }
.country-card.stance-ban { border-left-color: var(--color-coral); }
.country-card.stance-caution { border-left-color: var(--color-amber); }
.country-card.stance-mining { border-left-color: var(--color-blue); }
.country-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); gap: var(--space-2); }
.country-name { font-weight: 700; font-size: var(--text-sm); }
.stance-badge { font-size: var(--text-xs); font-weight: 700; padding: 2px var(--space-2); border-radius: var(--radius-full); text-transform: capitalize; white-space: nowrap; }
.stance-badge.stance-moratorium, .stance-badge.stance-ban { background: var(--color-coral-highlight); color: var(--color-coral); }
.stance-badge.stance-pause, .stance-badge.stance-caution { background: var(--color-amber-highlight); color: var(--color-amber); }
.stance-badge.stance-mining { background: var(--color-blue-highlight); color: var(--color-blue); }
.country-detail { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.55; margin-bottom: var(--space-2); }
.country-source a { font-size: var(--text-xs); color: var(--color-primary); text-decoration: none; }
.country-source a:hover { text-decoration: underline; }

/* ==========================================================================
   Press release list
   ========================================================================== */
.press-list { display: flex; flex-direction: column; gap: var(--space-3); }
.press-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 130px 1fr; gap: var(--space-4); }
.press-item.highlight { border-color: var(--color-primary); background: color-mix(in oklab, var(--color-primary-highlight) 55%, var(--color-surface)); }
.press-date { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.press-issuer { font-size: var(--text-xs); color: var(--color-primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; margin-top: var(--space-1); }
.press-title { font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.press-excerpt { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; font-style: italic; margin-bottom: var(--space-2); }
.press-item a { font-size: var(--text-xs); color: var(--color-primary); text-decoration: none; }
.press-item a:hover { text-decoration: underline; }

/* ==========================================================================
   Sentiment section
   ========================================================================== */
.sentiment-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-8); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider); }
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: var(--text-sm); color: var(--color-text-muted); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.big-stat { text-align: center; padding: var(--space-4) 0; }
.big-stat .stat-value { font-size: var(--text-xl); display: block; }
.big-stat .stat-caption { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

.compare-list { display: flex; flex-direction: column; gap: var(--space-4); }
.compare-row { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.compare-dimension { padding: var(--space-3) var(--space-5); background: var(--color-surface-2); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); }
.compare-cols { display: grid; grid-template-columns: 1fr 1fr; }
.compare-col { padding: var(--space-4) var(--space-5); }
.compare-col.gov { border-right: 1px solid var(--color-divider); }
.compare-col.gov::before { content: 'Government'; }
.compare-col.civil::before { content: 'Civil society'; }
.compare-col::before { display: block; font-size: var(--text-xs); font-weight: 700; margin-bottom: var(--space-2); }
.compare-col.gov::before { color: var(--color-blue); }
.compare-col.civil::before { color: var(--color-coral); }
.compare-text { font-size: var(--text-sm); line-height: 1.6; margin-bottom: var(--space-2); }
.compare-meta { font-size: var(--text-xs); color: var(--color-text-faint); display: flex; justify-content: space-between; gap: var(--space-2); }
.compare-meta a { color: var(--color-primary); text-decoration: none; }
.compare-meta a:hover { text-decoration: underline; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.person-card { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-sm); }
.person-card.for { border-left-color: var(--color-blue); }
.person-card.against { border-left-color: var(--color-coral); }
.person-name { font-weight: 700; font-size: var(--text-sm); }
.person-role { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-2); }
.person-quote { font-size: var(--text-sm); font-style: italic; color: var(--color-text); line-height: 1.55; margin-bottom: var(--space-2); }
.person-meta { font-size: var(--text-xs); color: var(--color-text-faint); display: flex; justify-content: space-between; gap: var(--space-2); }
.person-meta a { color: var(--color-primary); text-decoration: none; }
.person-meta a:hover { text-decoration: underline; }

.dashboard-footer { margin-top: var(--space-16); padding-top: var(--space-6); border-top: 1px solid var(--color-divider); }
.dashboard-footer p { font-size: var(--text-xs); color: var(--color-text-faint); max-width: 70ch; line-height: 1.6; }

/* Performance for dense card grids */
.status-grid > *, .country-grid > *, .people-grid > * {
  content-visibility: auto;
  contain-intrinsic-size: 0 200px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .overview-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .sentiment-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100dvh; width: 280px;
    transform: translateX(-100%);
    transition: transform var(--transition-interactive);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .header { grid-column: 1; }
  .main { grid-column: 1; padding: var(--space-6) var(--space-4) var(--space-16); }
  .menu-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
  .live-pill { display: none; }
  .compare-cols { grid-template-columns: 1fr; }
  .compare-col.gov { border-right: none; border-bottom: 1px solid var(--color-divider); }
  .press-item { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header { padding: 0 var(--space-4); gap: var(--space-2); }
  .header-title h1 { font-size: var(--text-base); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
