/* ============================================
   IRAN CONFLICT MONITOR — STYLE SYSTEM
   Dark intelligence dashboard theme
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Dark surfaces */
  --bg-base: #13141a;
  --bg-surface: #1a1b23;
  --bg-elevated: #22232d;
  --bg-card: #1e1f28;
  --bg-hover: #282936;

  /* Light mode surfaces */
  --bg-base-light: #f0f1f5;
  --bg-surface-light: #ffffff;
  --bg-elevated-light: #f8f9fb;
  --bg-card-light: #ffffff;
  --bg-hover-light: #edeef2;

  /* Text - dark */
  --text-primary: #e8e9ed;
  --text-secondary: #9a9ba5;
  --text-muted: #6b6c76;

  /* Text - light */
  --text-primary-light: #13141a;
  --text-secondary-light: #555662;
  --text-muted-light: #8a8b95;

  /* Status colors */
  --color-confirmed: #27ae60;
  --color-partial: #f39c12;
  --color-disputed: #e74c3c;
  --color-speculation: #6b6c76;
  --color-analysis: #3498db;

  /* Source bias colors */
  --source-independent: #3498db;
  --source-western: #9b59b6;
  --source-gulf: #1abc9c;
  --source-uae: #1abc9c;
  --source-official: #2c3e50;
  --source-thinktank: #8e44ad;
  --source-financial: #16a085;
  --source-reference: #7f8c8d;
  --source-proiran: #c0392b;
  --source-proisrael: #2980b9;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-subtle-light: rgba(0, 0, 0, 0.08);

  /* Spacing */
  --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;

  /* Type scale */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.1vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.84rem + 0.15vw, 1rem);
  --text-lg: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --text-xl: clamp(1.125rem, 1.05rem + 0.3vw, 1.375rem);
  --text-2xl: clamp(1.375rem, 1.25rem + 0.5vw, 1.75rem);
  --text-3xl: clamp(1.75rem, 1.5rem + 0.8vw, 2.25rem);

  /* Font stacks */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Grid background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Radar sweep effect */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    transparent 350deg,
    rgba(231, 76, 60, 0.015) 355deg,
    transparent 360deg
  );
  animation: radarSweep 12s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- LIGHT THEME --- */
[data-theme="light"] body {
  background: var(--bg-base-light);
  color: var(--text-primary-light);
}

[data-theme="light"] body::before {
  background:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

[data-theme="light"] body::after {
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    transparent 350deg,
    rgba(231, 76, 60, 0.03) 355deg,
    transparent 360deg
  );
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-analysis);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-4);
}

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(19, 20, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-6);
}

[data-theme="light"] .site-header {
  background: rgba(240, 241, 245, 0.92);
  border-bottom-color: var(--border-subtle-light);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-icon { flex-shrink: 0; }

.logo-text h1 {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

[data-theme="light"] .subtitle {
  color: var(--text-secondary-light);
}

/* LIVE badge */
.live-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(231, 76, 60, 0.12);
  color: var(--color-disputed);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-disputed);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.last-updated {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

[data-theme="light"] .last-updated {
  color: var(--text-secondary-light);
}

.last-updated strong {
  color: var(--color-disputed);
}

/* Language toggle */
.lang-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

[data-theme="light"] .lang-toggle {
  background: var(--bg-elevated-light);
  border-color: var(--border-subtle-light);
  color: var(--text-secondary-light);
}

.lang-toggle:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

[data-theme="light"] .lang-toggle:hover {
  color: var(--text-primary-light);
  border-color: rgba(0,0,0,0.2);
}

.lang-label {
  line-height: 1;
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

[data-theme="light"] .theme-toggle {
  background: var(--bg-elevated-light);
  border-color: var(--border-subtle-light);
  color: var(--text-secondary-light);
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

[data-theme="light"] .theme-toggle:hover {
  color: var(--text-primary-light);
  border-color: rgba(0,0,0,0.2);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-analysis);
  outline-offset: 2px;
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* --- STATUS BAR --- */
.status-bar {
  position: relative;
  z-index: 10;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

[data-theme="light"] .status-bar {
  background: var(--bg-surface-light);
  border-bottom-color: var(--border-subtle-light);
}

.status-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: max-content;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  min-width: max-content;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

[data-theme="light"] .stat-label {
  color: var(--text-muted-light);
}

.stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

[data-theme="light"] .stat-sub {
  color: var(--text-muted-light);
}

.stat-critical .stat-value { color: var(--color-disputed); }
.stat-warning .stat-value { color: var(--color-partial); }

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

[data-theme="light"] .stat-divider {
  background: var(--border-subtle-light);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- MAIN CONTENT --- */
main {
  position: relative;
  z-index: 1;
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Section blocks */
.section-block {
  margin-bottom: var(--space-12);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

[data-theme="light"] .section-title {
  color: var(--text-primary-light);
}

.section-title svg {
  color: var(--color-disputed);
  flex-shrink: 0;
}

.section-title-analysis svg { color: var(--color-analysis); }
.section-title-advice svg { color: var(--color-partial); }

/* --- NEWS CARDS --- */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid transparent;
  transition: background var(--duration-fast) var(--ease-out);
  content-visibility: auto;
  contain-intrinsic-size: 0 180px;
}

[data-theme="light"] .news-card {
  background: var(--bg-card-light);
  border-color: var(--border-subtle-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.news-card:hover {
  background: var(--bg-hover);
}

[data-theme="light"] .news-card:hover {
  background: var(--bg-hover-light);
}

.news-card.status-confirmed { border-left-color: var(--color-confirmed); }
.news-card.status-partial { border-left-color: var(--color-partial); }
.news-card.status-disputed { border-left-color: var(--color-disputed); }
.news-card.status-speculation { border-left-color: var(--color-speculation); }

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.card-timestamp {
  display: inline-block;
  margin-left: auto;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  opacity: 0.7;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .card-timestamp {
    margin-left: 0;
    width: 100%;
    margin-top: 2px;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.badge-confirmed {
  background: rgba(39, 174, 96, 0.12);
  color: var(--color-confirmed);
  border: 1px solid rgba(39, 174, 96, 0.25);
}

.badge-partial {
  background: rgba(243, 156, 18, 0.12);
  color: var(--color-partial);
  border: 1px solid rgba(243, 156, 18, 0.25);
}

.badge-disputed {
  background: rgba(231, 76, 60, 0.12);
  color: var(--color-disputed);
  border: 1px solid rgba(231, 76, 60, 0.25);
}

.badge-speculation {
  background: rgba(107, 108, 118, 0.12);
  color: var(--color-speculation);
  border: 1px solid rgba(107, 108, 118, 0.25);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: var(--space-3);
}

.card-summary {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-3);
  max-width: 80ch;
}

[data-theme="light"] .card-summary {
  color: var(--text-secondary-light);
}

/* Cross-check notes */
.cross-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-partial);
  font-style: italic;
  line-height: 1.55;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: rgba(243, 156, 18, 0.06);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(243, 156, 18, 0.3);
}

.cross-check svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Source pills */
.card-sources {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

[data-theme="light"] .source-pill {
  color: var(--text-secondary-light);
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border-subtle-light);
}

.source-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

[data-theme="light"] .source-pill:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary-light);
  border-color: rgba(0,0,0,0.15);
}

.source-pill:focus-visible {
  outline: 2px solid var(--color-analysis);
  outline-offset: 2px;
}

.bias-tag {
  font-size: 0.65rem;
  padding: 0 4px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.source-independent .bias-tag { background: rgba(52, 152, 219, 0.15); color: #5dade2; }
.source-western .bias-tag { background: rgba(155, 89, 182, 0.15); color: #bb8fce; }
.source-gulf .bias-tag,
.source-uae .bias-tag { background: rgba(26, 188, 156, 0.15); color: #48c9b0; }
.source-official .bias-tag { background: rgba(44, 62, 80, 0.25); color: #85929e; }
.source-thinktank .bias-tag { background: rgba(142, 68, 173, 0.15); color: #c39bd3; }
.source-financial .bias-tag { background: rgba(22, 160, 133, 0.15); color: #45b39d; }
.source-reference .bias-tag { background: rgba(127, 140, 141, 0.15); color: #aab7b8; }
.source-proiran .bias-tag { background: rgba(192, 57, 43, 0.15); color: #e57373; }
.source-proisrael .bias-tag { background: rgba(41, 128, 185, 0.15); color: #7fb3d8; }

[data-theme="light"] .source-independent .bias-tag { color: #2980b9; }
[data-theme="light"] .source-western .bias-tag { color: #7d3c98; }
[data-theme="light"] .source-gulf .bias-tag,
[data-theme="light"] .source-uae .bias-tag { color: #17a589; }
[data-theme="light"] .source-official .bias-tag { color: #5d6d7e; }
[data-theme="light"] .source-thinktank .bias-tag { color: #76448a; }
[data-theme="light"] .source-financial .bias-tag { color: #117a65; }
[data-theme="light"] .source-reference .bias-tag { color: #707b7c; }
[data-theme="light"] .source-proiran .bias-tag { color: #c0392b; }
[data-theme="light"] .source-proisrael .bias-tag { color: #2471a3; }

/* --- ANALYSIS SECTION --- */
.analysis-section {
  border: 1px solid rgba(52, 152, 219, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  background: rgba(52, 152, 219, 0.03);
}

[data-theme="light"] .analysis-section {
  background: rgba(52, 152, 219, 0.04);
  border-color: rgba(52, 152, 219, 0.15);
}

.analysis-summary {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 80ch;
}

[data-theme="light"] .analysis-summary {
  color: var(--text-secondary-light);
}

.outcomes-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-5);
}

.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.outcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  border-top: 3px solid transparent;
}

[data-theme="light"] .outcome-card {
  background: var(--bg-card-light);
  border-color: var(--border-subtle-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.outcome-green { border-top-color: var(--color-confirmed); }
.outcome-amber { border-top-color: var(--color-partial); }
.outcome-red { border-top-color: var(--color-disputed); }
.outcome-gray { border-top-color: var(--color-speculation); }

.outcome-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.outcome-prob {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.outcome-green .outcome-prob { color: var(--color-confirmed); }
.outcome-amber .outcome-prob { color: var(--color-partial); }
.outcome-red .outcome-prob { color: var(--color-disputed); }
.outcome-gray .outcome-prob { color: var(--color-speculation); }

.outcome-prob-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

[data-theme="light"] .outcome-prob-bar {
  background: rgba(0, 0, 0, 0.06);
}

.outcome-prob-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s var(--ease-out);
}

.outcome-green .outcome-prob-fill { background: var(--color-confirmed); }
.outcome-amber .outcome-prob-fill { background: var(--color-partial); }
.outcome-red .outcome-prob-fill { background: var(--color-disputed); }
.outcome-gray .outcome-prob-fill { background: var(--color-speculation); }

.outcome-card h4 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.outcome-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

[data-theme="light"] .outcome-card p {
  color: var(--text-secondary-light);
}

.outcome-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

[data-theme="light"] .outcome-meta {
  color: var(--text-muted-light);
  border-top-color: var(--border-subtle-light);
}

/* Cross-check block */
.cross-check-block {
  background: rgba(243, 156, 18, 0.06);
  border: 1px solid rgba(243, 156, 18, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.cross-check-block h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-partial);
  margin-bottom: var(--space-4);
}

.cross-check-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cross-check-block li {
  position: relative;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

[data-theme="light"] .cross-check-block li {
  color: var(--text-secondary-light);
}

.cross-check-block li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-partial);
  font-weight: 700;
}

/* --- ADVICE SECTION --- */
.advice-section {
  border: 1px solid rgba(243, 156, 18, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  background: rgba(243, 156, 18, 0.02);
}

[data-theme="light"] .advice-section {
  background: rgba(243, 156, 18, 0.03);
  border-color: rgba(243, 156, 18, 0.15);
}

.advice-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-5);
}

[data-theme="light"] .advice-subtitle {
  color: var(--text-secondary-light);
}

.threat-badge {
  margin-bottom: var(--space-6);
}

.threat-level {
  display: inline-flex;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.threat-amber {
  background: rgba(243, 156, 18, 0.12);
  color: var(--color-partial);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.threat-red {
  background: rgba(231, 76, 60, 0.12);
  color: var(--color-disputed);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.advice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.advice-points h3,
.advice-recommendation h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.icon-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.icon-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

[data-theme="light"] .icon-list li {
  color: var(--text-secondary-light);
}

.li-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.li-shield { background: var(--color-confirmed); }
.li-check { background: var(--color-confirmed); }
.li-warn { background: var(--color-partial); }
.li-info { background: var(--color-analysis); }
.li-down { background: var(--color-confirmed); }

.recommendation-box {
  background: rgba(39, 174, 96, 0.06);
  border: 1px solid rgba(39, 174, 96, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.recommendation-box h3 {
  color: var(--color-confirmed);
  margin-bottom: var(--space-3) !important;
}

.recommendation-box p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

[data-theme="light"] .recommendation-box p {
  color: var(--text-secondary-light);
}

/* When to leave / stay grid */
.when-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.when-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

[data-theme="light"] .when-card {
  background: var(--bg-card-light);
  border-color: var(--border-subtle-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.when-leave { border-top: 3px solid var(--color-disputed); }
.when-stay { border-top: 3px solid var(--color-confirmed); }

.when-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.when-leave h3 { color: var(--color-disputed); }
.when-stay h3 { color: var(--color-confirmed); }

.when-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.when-card li {
  position: relative;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

[data-theme="light"] .when-card li {
  color: var(--text-secondary-light);
}

.when-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.when-leave li::before { background: var(--color-disputed); opacity: 0.5; }
.when-stay li::before { background: var(--color-confirmed); opacity: 0.5; }

/* --- FOOTER --- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-8) var(--space-6);
  background: var(--bg-surface);
}

[data-theme="light"] .site-footer {
  background: var(--bg-surface-light);
  border-top-color: var(--border-subtle-light);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 70ch;
  margin: 0 auto var(--space-4);
}

[data-theme="light"] .footer-disclaimer {
  color: var(--text-muted-light);
}

.footer-attribution {
  font-size: var(--text-xs);
}

.footer-attribution a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

[data-theme="light"] .footer-attribution a {
  color: var(--text-muted-light);
}

.footer-attribution a:hover {
  color: var(--text-secondary);
}

.footer-attribution a:focus-visible {
  outline: 2px solid var(--color-analysis);
  outline-offset: 2px;
}

/* --- SCROLL REVEAL ANIMATION --- */
.news-card,
.outcome-card,
.when-card {
  opacity: 0;
  animation: fadeInCard 0.5s var(--ease-out) forwards;
}

@keyframes fadeInCard {
  from { opacity: 0; clip-path: inset(8px 0 0 0); }
  to { opacity: 1; clip-path: inset(0); }
}

/* Stagger */
.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }
.news-card:nth-child(7) { animation-delay: 0.35s; }
.news-card:nth-child(8) { animation-delay: 0.4s; }
.news-card:nth-child(9) { animation-delay: 0.45s; }
.news-card:nth-child(10) { animation-delay: 0.5s; }
.news-card:nth-child(11) { animation-delay: 0.55s; }
.news-card:nth-child(12) { animation-delay: 0.6s; }
.news-card:nth-child(13) { animation-delay: 0.65s; }
.news-card:nth-child(14) { animation-delay: 0.7s; }
.news-card:nth-child(15) { animation-delay: 0.75s; }
.news-card:nth-child(16) { animation-delay: 0.8s; }

.outcome-card:nth-child(1) { animation-delay: 0.1s; }
.outcome-card:nth-child(2) { animation-delay: 0.2s; }
.outcome-card:nth-child(3) { animation-delay: 0.3s; }
.outcome-card:nth-child(4) { animation-delay: 0.4s; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .header-left {
    flex-wrap: wrap;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .status-bar {
    padding: var(--space-2) var(--space-3);
  }

  .content-wrapper {
    padding: var(--space-5) var(--space-3);
  }

  .news-card {
    padding: var(--space-4);
  }

  .analysis-section,
  .advice-section {
    padding: var(--space-5);
  }

  .advice-grid {
    grid-template-columns: 1fr;
  }

  .when-grid {
    grid-template-columns: 1fr;
  }

  .outcomes-grid {
    grid-template-columns: 1fr;
  }

  .card-sources {
    gap: var(--space-1);
  }

  .source-pill {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: var(--text-lg);
  }

  .section-title {
    font-size: var(--text-lg);
  }

  .card-title {
    font-size: var(--text-base);
  }

  .stat-item {
    padding: var(--space-1) var(--space-2);
  }
}

/* --- JS-DRIVEN SCROLL REVEAL --- */
.reveal-target {
  opacity: 0;
  clip-path: inset(8px 0 0 0);
  transition: opacity 0.5s var(--ease-out), clip-path 0.5s var(--ease-out);
}

.reveal-target.revealed {
  opacity: 1;
  clip-path: inset(0);
}

/* Override the CSS animation when JS is controlling things */
.reveal-target.news-card,
.reveal-target.outcome-card,
.reveal-target.when-card {
  animation: none;
}

/* ============================================
   REBUILD ADDITIONS — March 8 2026
   Collapsible sections, Evidence grid,
   Outcome reasoning, Threat factors,
   Decision framework
   ============================================ */

/* --- COLLAPSIBLE SECTIONS --- */
.collapsible-section {
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.collapsible-section > summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-lg);
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-out);
  position: relative;
}

.collapsible-section > summary::-webkit-details-marker { display: none; }

.collapsible-section > summary .chevron {
  margin-left: auto;
  transition: transform var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
}

.collapsible-section[open] > summary .chevron {
  transform: rotate(180deg);
}

.collapsible-analysis > summary {
  background: rgba(52, 152, 219, 0.08);
  color: #3498db;
  border-bottom: 1px solid rgba(52, 152, 219, 0.2);
}
.collapsible-analysis > summary:hover {
  background: rgba(52, 152, 219, 0.14);
}

.collapsible-advice > summary {
  background: rgba(241, 196, 15, 0.08);
  color: #f1c40f;
  border-bottom: 1px solid rgba(241, 196, 15, 0.2);
}
.collapsible-advice > summary:hover {
  background: rgba(241, 196, 15, 0.14);
}

.collapsible-section > summary svg:first-child {
  flex-shrink: 0;
}

/* Remove extra top margin inside collapsed content */
.collapsible-section .section-block {
  margin-top: 0;
  border-top: none;
  border-radius: 0;
}

/* --- EVIDENCE ASSESSMENT GRID --- */
.evidence-assessment {
  margin: var(--space-6) 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.evidence-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
}

.evidence-cell {
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
}

.evidence-cell:nth-child(1) { border-top: none; border-left: none; }
.evidence-cell:nth-child(2) { border-top: none; border-right: none; }
.evidence-cell:nth-child(3) { border-bottom: none; border-left: none; }
.evidence-cell:nth-child(4) { border-bottom: none; border-right: none; }

.evidence-cell-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.evidence-western .evidence-cell-label { color: #9b59b6; }
.evidence-proiran .evidence-cell-label { color: var(--source-proiran); }
.evidence-converge .evidence-cell-label { color: var(--color-confirmed); }
.evidence-diverge .evidence-cell-label { color: var(--color-partial); }

.evidence-cell ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.evidence-cell ul li {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: var(--space-3);
  position: relative;
}

.evidence-cell ul li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.ev-claim {
  font-weight: 600;
  color: var(--text-primary);
}

.ev-false {
  color: var(--color-disputed);
}

/* --- OUTCOME REASONING SUBSECTIONS --- */
.outcome-reasoning {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.reasoning-section {
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.reasoning-for {
  background: rgba(39, 174, 96, 0.07);
  border-left: 2px solid rgba(39, 174, 96, 0.4);
}

.reasoning-against {
  background: rgba(231, 76, 60, 0.07);
  border-left: 2px solid rgba(231, 76, 60, 0.3);
}

.reasoning-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
  color: var(--text-muted);
}

.reasoning-for .reasoning-label { color: rgba(39, 174, 96, 0.8); }
.reasoning-against .reasoning-label { color: rgba(231, 76, 60, 0.7); }

.reasoning-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reasoning-section ul li {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: var(--space-3);
  position: relative;
}

.reasoning-section ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.reasoning-why {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.55;
  padding: var(--space-2) var(--space-3);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--color-analysis);
}

.reasoning-why strong {
  color: var(--color-analysis);
}

/* --- THREAT ASSESSMENT FACTORS --- */
.threat-assessment {
  margin: var(--space-5) 0;
}

.threat-assessment-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.threat-factors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  counter-reset: none;
}

.threat-factor {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.threat-factor-good {
  background: rgba(39, 174, 96, 0.06);
  border-color: rgba(39, 174, 96, 0.2);
}

.threat-factor-warn {
  background: rgba(231, 76, 60, 0.07);
  border-color: rgba(231, 76, 60, 0.25);
}

.factor-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 800;
  font-family: var(--font-mono);
}

.threat-factor-good .factor-num {
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
}

.threat-factor-warn .factor-num {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.factor-content {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.factor-content strong {
  color: var(--text-primary);
}

/* --- DECISION FRAMEWORK --- */
.decision-framework {
  margin: var(--space-5) 0;
}

.decision-framework-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.decision-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.decision-item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.decision-leave {
  background: rgba(231, 76, 60, 0.06);
  border-color: rgba(231, 76, 60, 0.2);
}

.decision-stay {
  background: rgba(39, 174, 96, 0.06);
  border-color: rgba(39, 174, 96, 0.2);
}

.decision-trigger {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.decision-leave .decision-trigger { color: #e74c3c; }
.decision-stay .decision-trigger { color: #27ae60; }

.decision-why {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-2);
}

.decision-action {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  font-style: italic;
}

.decision-leave .decision-action { color: rgba(231, 76, 60, 0.8); }
.decision-stay .decision-action { color: rgba(39, 174, 96, 0.8); }

/* --- MOBILE: SOURCE PILLS HORIZONTAL SCROLL --- */
@media (max-width: 600px) {
  .card-sources {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-1);
    scrollbar-width: none;
    gap: var(--space-1);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .card-sources::-webkit-scrollbar { display: none; }

  .source-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .collapsible-section > summary {
    min-height: 44px;
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-4);
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .evidence-cell:nth-child(n) {
    border-left: none;
    border-right: none;
  }

  .evidence-cell:first-child { border-top: none; }
  .evidence-cell:last-child { border-bottom: none; }

  .threat-factor { flex-direction: row; }

  .decision-item { padding: var(--space-3); }
}

/* --- LIGHT THEME VARIANTS --- */
[data-theme="light"] .collapsible-analysis > summary {
  background: rgba(52, 152, 219, 0.06);
  border-color: rgba(52, 152, 219, 0.15);
}

[data-theme="light"] .collapsible-advice > summary {
  background: rgba(241, 196, 15, 0.06);
  border-color: rgba(241, 196, 15, 0.15);
}

[data-theme="light"] .evidence-assessment {
  border-color: var(--border-subtle-light);
}

[data-theme="light"] .evidence-title {
  background: var(--bg-elevated-light);
  border-color: var(--border-subtle-light);
}

[data-theme="light"] .evidence-cell {
  border-color: var(--border-subtle-light);
}

[data-theme="light"] .evidence-cell ul li {
  color: var(--text-secondary-light);
}

[data-theme="light"] .ev-claim {
  color: var(--text-primary-light);
}

[data-theme="light"] .reasoning-why {
  background: rgba(0,0,0,0.03);
  color: var(--text-secondary-light);
}

[data-theme="light"] .threat-factor-good {
  background: rgba(39, 174, 96, 0.05);
}

[data-theme="light"] .threat-factor-warn {
  background: rgba(231, 76, 60, 0.05);
}

[data-theme="light"] .factor-content {
  color: var(--text-secondary-light);
}

[data-theme="light"] .factor-content strong {
  color: var(--text-primary-light);
}

[data-theme="light"] .decision-leave {
  background: rgba(231, 76, 60, 0.04);
}

[data-theme="light"] .decision-stay {
  background: rgba(39, 174, 96, 0.04);
}

[data-theme="light"] .decision-why,
[data-theme="light"] .decision-action {
  color: var(--text-secondary-light);
}

[data-theme="light"] .reasoning-section ul li,
[data-theme="light"] .reasoning-why {
  color: var(--text-secondary-light);
}

[data-theme="light"] .outcome-reasoning {
  border-color: var(--border-subtle-light);
}

[data-theme="light"] .reasoning-why {
  background: rgba(0,0,0,0.02);
}
