/*
 * Energy Markets Research — Design System
 * Anthropic / Transformer Circuits inspired aesthetic
 * Warm, clean, pastel, academic-but-modern
 *
 * Light theme only. No dark mode.
 * Import this file and remove all inline <style> blocks.
 */

/* ============================================================
   0. FONT IMPORTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Backgrounds — cool, light, airy */
  --bg-page:        #FAFBFC;
  --bg-card:        #FFFFFF;
  --bg-card-alt:    #F4F6F8;
  --bg-hero:        #F0F2F5;
  --bg-code:        #F4F6F8;

  /* Borders — subtle, cool gray */
  --border:         #DFE3E8;
  --border-light:   #EBEEF2;
  --border-strong:  #CDD2D9;

  /* Text — charcoal, not black */
  --text-primary:   #1C2024;
  --text-secondary: #4E5861;
  --text-muted:     #8893A0;
  --text-on-accent: #FFFFFF;

  /* Accent palette — soft, academic pastels */
  --accent-coral:        #C47A5A;
  --accent-coral-light:  #F5EBE4;
  --accent-blue:         #5A7FBA;
  --accent-blue-light:   #E8EFF8;
  --accent-green:        #4D8B6F;
  --accent-green-light:  #E5F0EA;
  --accent-yellow:       #B08C3E;
  --accent-yellow-light: #F8F1E0;
  --accent-red:          #B05454;
  --accent-red-light:    #F6EAEA;
  --accent-purple:       #7B6BA8;
  --accent-purple-light: #EDEBF4;

  /* Legacy accent aliases (used in some pages) */
  --accent-orange:  #C47A5A;
  --accent-cyan:    #5A7FBA;

  /* Shadows — barely visible, clean */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.03);
  --shadow-md:  0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 4px 12px rgba(0,0,0,0.06);

  /* Radii — straight-edge, minimal rounding */
  --radius-sm:  2px;
  --radius-md:  3px;
  --radius-lg:  4px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}


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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-coral);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #9B5F42;
  text-decoration: underline;
}

img { max-width: 100%; display: block; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-coral);
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

strong { font-weight: 600; }

/* Scroll anchor offset (for sticky nav if used) */
[id] { scroll-margin-top: 60px; }


/* ============================================================
   3. NAVIGATION
   ============================================================ */
nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

nav a.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
nav a.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

nav .nav-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

nav .nav-right {
  font-size: 11px;
  color: var(--text-muted);
}

/* Back link used outside nav (e.g. inside header) */
.back-link {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: inline-block;
  text-decoration: none;
  transition: color 0.15s;
}
.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}


/* ============================================================
   4. HEADER / HERO SECTION
   ============================================================ */
header {
  background: var(--bg-hero);
  padding: 48px 40px 40px;
  border-bottom: 1px solid var(--border);
}
header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
header h1 span {
  color: var(--accent-coral);
}
header p.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 780px;
  line-height: 1.65;
}

.hero {
  background: var(--bg-hero);
  padding: 64px 40px 56px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.hero-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-coral);
  margin-bottom: 12px;
  font-weight: 600;
}

.hero h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.hero .subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 700px;
  line-height: 1.65;
}


/* ============================================================
   5. VERDICT BADGE
   ============================================================ */
.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-coral-light);
  border: 1px solid rgba(196, 122, 90, 0.25);
  border-radius: 2px;
  padding: 10px 20px;
  margin-bottom: 28px;
}

.verdict-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-coral);
  flex-shrink: 0;
}

.verdict-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-coral);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Yellow variant */
.verdict-badge.yellow {
  background: var(--accent-yellow-light);
  border-color: rgba(176, 140, 62, 0.25);
}
.verdict-badge.yellow .verdict-dot { background: var(--accent-yellow); }
.verdict-badge.yellow .verdict-text { color: var(--accent-yellow); }

/* Red variant */
.verdict-badge.red {
  background: var(--accent-red-light);
  border-color: rgba(199, 80, 80, 0.3);
}
.verdict-badge.red .verdict-dot { background: var(--accent-red); }
.verdict-badge.red .verdict-text { color: var(--accent-red); }

/* Green variant */
.verdict-badge.green {
  background: var(--accent-green-light);
  border-color: rgba(74, 158, 109, 0.3);
}
.verdict-badge.green .verdict-dot { background: var(--accent-green); }
.verdict-badge.green .verdict-text { color: var(--accent-green); }


/* ============================================================
   6. HERO METRICS
   ============================================================ */
.hero-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  min-width: 150px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.hero-metric:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.hero-metric .metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.hero-metric .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-metric .metric-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

.hero-metric.green .metric-value  { color: var(--accent-green); }
.hero-metric.yellow .metric-value { color: var(--accent-yellow); }
.hero-metric.red .metric-value    { color: var(--accent-red); }
.hero-metric.blue .metric-value   { color: var(--accent-blue); }

/* Stats row (index page) */
.stats-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
}
.stat-card .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-card .value .unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}
.stat-card.verdict {
  border-color: rgba(176, 140, 62, 0.3);
}
.stat-card.verdict .value {
  color: var(--accent-yellow);
  font-size: 16px;
  letter-spacing: 0.3px;
}


/* ============================================================
   7. MAIN CONTENT AREA
   ============================================================ */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 96px;
}


/* ============================================================
   8. SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  margin-top: 56px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.section-header:first-child { margin-top: 0; }

.section-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-coral);
  background: var(--accent-coral-light);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Section label (simpler variant used in overview/scenarios pages) */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-coral);
  margin-bottom: 14px;
  margin-top: 36px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}


/* ============================================================
   9. CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.card.featured {
  border-color: rgba(196, 122, 90, 0.25);
  background: #FDFCFA;
}
.card.featured:hover {
  border-color: var(--accent-coral);
  box-shadow: 0 2px 8px rgba(196, 122, 90, 0.06);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}
.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.card p:last-child {
  margin-bottom: 0;
}
.card li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 6px;
}
.card ul {
  padding-left: 18px;
  margin-top: 8px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* Card icon */
.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}
.card-icon.green  { background: var(--accent-green-light); }
.card-icon.blue   { background: var(--accent-blue-light); }
.card-icon.purple { background: var(--accent-purple-light); }
.card-icon.red    { background: var(--accent-red-light); }
.card-icon.yellow { background: var(--accent-yellow-light); }
.card-icon.cyan   { background: var(--accent-blue-light); }

/* Card meta & arrow */
.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.card-arrow {
  position: absolute;
  top: 28px;
  right: 24px;
  color: var(--text-muted);
  font-size: 18px;
  transition: color 0.15s, transform 0.15s;
}
.card:hover .card-arrow {
  color: var(--accent-coral);
  transform: translateX(3px);
}

/* Card title (used inside charts etc.) */
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}
.card-title span {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  margin-left: 8px;
}

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chart-grid .card.full { grid-column: 1 / -1; }


/* ============================================================
   10. BADGES
   ============================================================ */
.badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-block;
}
.badge.complete      { background: var(--accent-green-light); color: var(--accent-green); }
.badge.in-progress   { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.badge.not-started   { background: #EEF0F3; color: var(--text-muted); }
.badge.interactive   { background: var(--accent-blue-light); color: var(--accent-blue); }
.badge.new-badge     { background: var(--accent-coral-light); color: var(--accent-coral); }
.badge.financial     { background: var(--accent-red-light); color: var(--accent-red); }
.badge.tracker       { background: var(--accent-blue-light); color: var(--accent-blue); }


/* ============================================================
   11. TABLES — GAP TABLE
   ============================================================ */
.gap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.gap-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}
.gap-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}
.gap-table tr:last-child td { border-bottom: none; }
.gap-table tbody tr:nth-child(even) td {
  background: var(--bg-card-alt);
}
.gap-table tbody tr:hover td {
  background: #EDF0F4;
}
.gap-table .tech-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* Gaps table (overview page, same visual treatment) */
.gaps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.gaps-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.gaps-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-secondary);
}
.gaps-table tr:last-child td { border-bottom: none; }
.gaps-table tbody tr:nth-child(even) td {
  background: var(--bg-card-alt);
}
.gaps-table tbody tr:hover td {
  background: #EDF0F4;
}


/* ============================================================
   12. TABLES — DATA TABLE (profitability/scenarios)
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td {
  background: var(--bg-card-alt);
}
.data-table tbody tr:hover td {
  background: #EDF0F4;
}
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table .positive { color: var(--accent-green); font-weight: 600; }
.data-table .negative { color: var(--accent-red); font-weight: 600; }
.data-table .caution  { color: var(--accent-yellow); font-weight: 600; }
.data-table .highlight-row td {
  background: var(--accent-coral-light);
  font-weight: 600;
  color: var(--text-primary);
}
.data-table .scenario-label {
  font-weight: 600;
  color: var(--text-primary);
}

/* Assumption table (scenarios page) */
.assumption-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}
.assumption-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.assumption-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-secondary);
}
.assumption-table tr:last-child td { border-bottom: none; }
.assumption-table tbody tr:hover td { background: var(--bg-card-alt); }
.assumption-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Compare table (scenarios page) */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.compare-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.compare-table th.bear-col { color: var(--accent-red); }
.compare-table th.base-col { color: var(--accent-yellow); }
.compare-table th.bull-col { color: var(--accent-green); }
.compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-secondary);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover td { background: var(--bg-card-alt); }
.compare-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}
.compare-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Disagree table (supply-analysis) */
.disagree-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.disagree-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.disagree-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.55;
}
.disagree-table tr:last-child td { border-bottom: none; }
.disagree-table .topic-name {
  font-weight: 600;
  color: var(--text-primary);
}


/* ============================================================
   13. STATUS BADGES (pill-shaped)
   ============================================================ */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.status-badge.green {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(77, 139, 111, 0.2);
}
.status-badge.yellow {
  background: var(--accent-yellow-light);
  color: var(--accent-yellow);
  border: 1px solid rgba(176, 140, 62, 0.2);
}
.status-badge.red {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid rgba(176, 84, 84, 0.2);
}
.status-badge.blue {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid rgba(90, 127, 186, 0.2);
}


/* ============================================================
   14. CONFIDENCE BADGES
   ============================================================ */
/* Block-level confidence badges (overview page) */
.conf {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
}
.conf.solid      { background: var(--accent-green-light); color: var(--accent-green); }
.conf.reasonable { background: var(--accent-blue-light);  color: var(--accent-blue); }
.conf.handwavy   { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.conf.vibes      { background: var(--accent-red-light);   color: var(--accent-red); }
.conf.unknown    { background: #EEF0F3;                   color: var(--text-muted); }

/* Inline confidence scale (C1-C5) */
.conf-inline {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}
.conf-inline.c1 { background: var(--accent-green-light);  color: var(--accent-green); }
.conf-inline.c2 { background: var(--accent-blue-light);   color: var(--accent-blue); }
.conf-inline.c3 { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.conf-inline.c4 { background: var(--accent-coral-light);  color: var(--accent-coral); }
.conf-inline.c5 { background: var(--accent-red-light);    color: var(--accent-red); }

/* Confidence tag (larger variant) */
.confidence-tag {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 500;
}
.confidence-tag.c1 {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(77, 139, 111, 0.2);
}
.confidence-tag.c2 {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid rgba(90, 127, 186, 0.2);
}
.confidence-tag.c3 {
  background: var(--accent-yellow-light);
  color: var(--accent-yellow);
  border: 1px solid rgba(176, 140, 62, 0.2);
}
.confidence-tag.c4 {
  background: var(--accent-coral-light);
  color: var(--accent-coral);
  border: 1px solid rgba(196, 122, 90, 0.2);
}
.confidence-tag.c5 {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid rgba(176, 84, 84, 0.2);
}

.confidence-row {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Confidence legend */
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}


/* ============================================================
   15. CHART CONTAINERS
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
}
.chart-container.tall   { height: 420px; }
.chart-container.medium { height: 350px; }
.chart-container.short  { height: 280px; }

.chart-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

canvas {
  border-radius: var(--radius-sm);
}


/* ============================================================
   16. BOTTLENECK / STAT GRIDS
   ============================================================ */
.bottleneck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.bottleneck-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.bottleneck-stat .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.bottleneck-stat .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.bottleneck-stat .stat-context {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.bottleneck-stat.warn   .stat-value { color: var(--accent-yellow); }
.bottleneck-stat.danger .stat-value { color: var(--accent-red); }
.bottleneck-stat.info   .stat-value { color: var(--accent-blue); }
.bottleneck-stat.ok     .stat-value { color: var(--accent-green); }
.bottleneck-stat.purple .stat-value { color: var(--accent-purple); }


/* ============================================================
   17. IMPLICATION CARDS
   ============================================================ */
.implication-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}
.implication-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.implication-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.implication-arrow {
  font-size: 14px;
  color: var(--accent-coral);
  flex-shrink: 0;
  margin-top: 2px;
  font-weight: 700;
}
.implication-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.implication-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Net assessment callout */
.net-assessment {
  background: var(--accent-yellow-light);
  border: 1px solid rgba(196, 146, 46, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.net-assessment strong {
  color: var(--accent-yellow);
  font-weight: 700;
}


/* ============================================================
   18. TREND ITEMS
   ============================================================ */
.trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.trend-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.trend-direction {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}
.trend-direction.up      { color: var(--accent-green); }
.trend-direction.down    { color: var(--accent-red); }
.trend-direction.stalled { color: var(--accent-yellow); }
.trend-direction.mixed   { color: var(--accent-purple); }

.trend-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.trend-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}


/* ============================================================
   19. GAP BAR VISUALIZATIONS
   ============================================================ */
.gap-bar-wrapper {
  margin-top: 16px;
}

.gap-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.gap-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
  text-align: right;
}

.gap-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.gap-bar-fill {
  height: 100%;
  border-radius: 4px;
  position: absolute;
  left: 0;
  top: 0;
  transition: width 0.4s ease;
}

.gap-bar-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text-muted);
  z-index: 2;
}
.gap-bar-target::after {
  content: attr(data-label);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

.gap-bar-value {
  font-size: 11px;
  font-weight: 600;
  min-width: 60px;
  text-align: left;
}

/* Simple bar (scenarios page) */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bar-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 100px;
  text-align: right;
  flex-shrink: 0;
}
.bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-on-accent);
  transition: width 0.4s ease;
}
.bar-fill.bear { background: var(--accent-red); }
.bar-fill.base { background: var(--accent-yellow); }
.bar-fill.bull { background: var(--accent-green); }


/* ============================================================
   20. RISK CARDS
   ============================================================ */
.risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.risk-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.risk-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.risk-card .risk-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.risk-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.risk-rank.high   { background: var(--accent-red-light);    color: var(--accent-red); }
.risk-rank.medium { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.risk-rank.low    { background: var(--accent-green-light);  color: var(--accent-green); }

.risk-card .risk-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.risk-card .risk-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.risk-bar-wrapper { margin-bottom: 8px; }
.risk-bar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.risk-bar-track {
  height: 6px;
  background: var(--bg-card-alt);
  border-radius: 3px;
  overflow: hidden;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.risk-bar-fill.high   { background: var(--accent-red); }
.risk-bar-fill.medium { background: var(--accent-yellow); }
.risk-bar-fill.low    { background: var(--accent-green); }

.risk-impact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 4px;
}
.risk-impact.severe   { background: var(--accent-red-light);    color: var(--accent-red); }
.risk-impact.moderate { background: var(--accent-yellow-light); color: var(--accent-yellow); }


/* ============================================================
   21. TECHNOLOGY CARDS
   ============================================================ */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tech-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.tech-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tech-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}

.tech-card .tech-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tech-mini-stat {
  flex: 1;
  min-width: 80px;
}
.tech-mini-stat .mini-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.tech-mini-stat .mini-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.tech-mini-stat .mini-value.red    { color: var(--accent-red); }
.tech-mini-stat .mini-value.yellow { color: var(--accent-yellow); }
.tech-mini-stat .mini-value.green  { color: var(--accent-green); }
.tech-mini-stat .mini-value.blue   { color: var(--accent-blue); }
.tech-mini-stat .mini-unit {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.tech-card .tech-details {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 10px;
}
.tech-card .tech-details li { margin-bottom: 5px; }
.tech-card .tech-details ul { padding-left: 16px; margin-top: 6px; }

.tech-card .mini-chart-container {
  height: 160px;
  margin-top: 12px;
  position: relative;
}


/* ============================================================
   22. CORE QUESTION (overview page)
   ============================================================ */
.core-q {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.core-q h2 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.core-q .answer {
  font-size: 15px;
  color: var(--text-secondary);
}
.core-q .answer strong {
  color: var(--accent-yellow);
}


/* ============================================================
   23. EXPANDABLE QUESTION CARDS (overview page)
   ============================================================ */
details.question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
details.question[open] {
  border-color: var(--border-strong);
}
details.question summary {
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
details.question summary::-webkit-details-marker { display: none; }
details.question summary::before {
  content: '\25B6';
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  transition: transform 0.15s;
  flex-shrink: 0;
}
details.question[open] summary::before {
  transform: rotate(90deg);
}
details.question summary:hover {
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
}

.q-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.q-title .num {
  color: var(--text-muted);
  margin-right: 6px;
}

.q-body {
  padding: 0 20px 20px 42px;
  font-size: 14px;
  color: var(--text-secondary);
}
.q-body h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 16px 0 6px;
  font-weight: 600;
}
.q-body h4:first-child { margin-top: 0; }
.q-body ul { padding-left: 18px; margin: 4px 0; }
.q-body li { margin-bottom: 4px; }
.q-body .caveat { color: var(--accent-yellow); }
.q-body .source {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}


/* ============================================================
   24. ASSUMPTION CHAINS (overview page)
   ============================================================ */
.chain {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.chain h3 {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.chain-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0;
}
.chain-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.chain-step .arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}


/* ============================================================
   25. EXPANDABLE DETAILS (scenarios page)
   ============================================================ */
details.expandable {
  margin-top: 10px;
}
details.expandable summary {
  font-size: 12px;
  color: var(--accent-coral);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
details.expandable summary::-webkit-details-marker { display: none; }
details.expandable summary::before {
  content: '\25B6';
  font-size: 9px;
  color: var(--text-muted);
  margin-right: 6px;
  transition: transform 0.15s;
  display: inline-block;
}
details.expandable[open] summary::before {
  transform: rotate(90deg);
}
details.expandable .detail-body {
  padding: 10px 0 4px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}


/* ============================================================
   26. SCENARIO CARDS (scenarios page)
   ============================================================ */
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.scenario-card.bear { border-left: 4px solid var(--accent-red); }
.scenario-card.base { border-left: 4px solid var(--accent-yellow); }
.scenario-card.bull { border-left: 4px solid var(--accent-green); }

.scenario-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.scenario-header h2 {
  font-size: 18px;
  color: var(--text-primary);
}
.scenario-irr {
  font-size: 14px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}
.irr-bear { background: var(--accent-red-light); color: var(--accent-red); }
.irr-base { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.irr-bull { background: var(--accent-green-light); color: var(--accent-green); }

.scenario-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

/* Outcomes strip */
.outcomes-strip {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.outcome-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-width: 120px;
}
.outcome-box .ob-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.outcome-box .ob-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.outcome-box .ob-value.negative { color: var(--accent-red); }
.outcome-box .ob-value.caution  { color: var(--accent-yellow); }
.outcome-box .ob-value.positive { color: var(--accent-green); }


/* ============================================================
   27. DRIVER CARDS (scenarios page)
   ============================================================ */
.driver-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.driver-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.driver-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--accent-coral-light);
  color: var(--accent-coral);
}
.driver-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.driver-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.driver-impact {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  margin-top: 8px;
  background: var(--accent-red-light);
  color: var(--accent-red);
}

/* Summary card */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.summary-card h3 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.summary-card ul {
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-secondary);
}
.summary-card li {
  margin-bottom: 8px;
  line-height: 1.5;
}
.summary-card li strong {
  color: var(--accent-yellow);
}


/* ============================================================
   28. NARRATIVE BLOCK
   ============================================================ */
.narrative {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-strong);
}
.narrative strong {
  color: var(--text-secondary);
}


/* ============================================================
   29. TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding: 20px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 56px;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: 12px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-coral);
  z-index: 1;
}
.timeline-dot.active {
  background: var(--accent-coral);
}

.timeline-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-coral);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.timeline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Policy timeline (supply-analysis page) */
.policy-timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 12px;
}
.policy-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.policy-event {
  position: relative;
  margin-bottom: 20px;
  padding-left: 20px;
}
.policy-event::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-coral);
}


/* ============================================================
   30. TOGGLE SWITCH (D-TUoS reform)
   ============================================================ */
.toggle-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.toggle-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 28px;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(176, 84, 84, 0.15);
  border-radius: 14px;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-red);
  transition: transform 0.3s, background 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(77, 139, 111, 0.15);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(28px);
  background: var(--accent-green);
}

.toggle-label {
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.toggle-label.active   { color: var(--text-primary); }
.toggle-label.inactive { color: var(--text-muted); }

.toggle-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.toggle-metric-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: background 0.2s;
}
.toggle-metric-card .tm-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.toggle-metric-card .tm-value {
  font-size: 28px;
  font-weight: 700;
  transition: color 0.3s;
}
.toggle-metric-card .tm-change {
  font-size: 11px;
  margin-top: 6px;
  font-weight: 600;
}


/* ============================================================
   31. CONDITIONS LIST
   ============================================================ */
.conditions-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}
.conditions-list li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-yellow);
  line-height: 1.45;
}
.conditions-list li .cond-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}
.cond-status.pending { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.cond-status.notmet  { background: var(--accent-red-light);    color: var(--accent-red); }


/* ============================================================
   32. PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.progress-bar .fill.green  { background: var(--accent-green); }
.progress-bar .fill.yellow { background: var(--accent-yellow); }
.progress-bar .fill.red    { background: var(--accent-red); }


/* ============================================================
   33. SOURCE / DISCLAIMER SECTIONS
   ============================================================ */
.disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 32px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  line-height: 1.6;
  background: var(--bg-card-alt);
}

.source-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}


/* ============================================================
   34. FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 24px 32px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-page);
}
footer a {
  color: var(--accent-coral);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}


/* ============================================================
   35. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .hero-metrics { gap: 12px; }
  .hero-metric {
    min-width: 120px;
    padding: 14px 18px;
  }
  .hero-metric .metric-value { font-size: 24px; }
  .toggle-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .conditions-list {
    grid-template-columns: 1fr;
  }
  .risk-grid {
    grid-template-columns: 1fr;
  }
  .tech-grid {
    grid-template-columns: 1fr;
  }
  main {
    padding: 24px 16px 60px;
  }
  .hero {
    padding: 36px 16px 32px;
  }
  nav {
    padding: 12px 16px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  header { padding: 28px 16px; }
  header h1 { font-size: 22px; }

  .hero h1 { font-size: 24px; }
  .hero .subtitle { font-size: 14px; }

  main { padding: 20px 16px 48px; }

  .card-grid {
    grid-template-columns: 1fr;
  }
  .stats-row { gap: 8px; }
  .stat-card {
    min-width: 100px;
    padding: 12px 14px;
  }
  .stat-card .value { font-size: 20px; }
  .stat-card.verdict .value { font-size: 14px; }

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

  .section-header {
    margin-top: 36px;
  }

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

  .q-body { padding-left: 28px; }
  .chain-step { flex-wrap: wrap; }
}

/* Small mobile */
@media (max-width: 480px) {
  body { font-size: 14px; }

  header { padding: 20px 12px; }
  header h1 { font-size: 20px; }

  .hero { padding: 28px 12px 24px; }
  .hero h1 { font-size: 22px; }

  main { padding: 16px 12px 40px; }

  nav { padding: 10px 12px; }
  nav .nav-title { display: none; }

  .card { padding: 20px 16px; }

  .hero-metric {
    min-width: 100%;
    padding: 12px 16px;
  }
  .hero-metric .metric-value { font-size: 22px; }

  .gap-bar-label {
    min-width: 80px;
    font-size: 11px;
  }

  .toggle-metrics {
    grid-template-columns: 1fr;
  }

  .scenario-card { padding: 20px 16px; }
  .outcomes-strip { gap: 8px; }
  .outcome-box {
    min-width: 90px;
    padding: 8px 10px;
  }
  .outcome-box .ob-value { font-size: 15px; }

  .compare-table { font-size: 12px; }
  .compare-table td,
  .compare-table th { padding: 8px 6px; }
  .assumption-table td:first-child { white-space: normal; }

  .bar-label {
    width: 70px;
    font-size: 11px;
  }

  footer { padding: 20px 12px; }
}


/* ============================================================
   36. METHODOLOGY DROPDOWNS ("How was this built?")
   ============================================================ */
details.methodology {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-purple);
  border-radius: var(--radius-md);
  margin-top: 20px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
details.methodology[open] {
  border-color: var(--accent-purple);
  border-left-width: 3px;
  box-shadow: var(--shadow-md);
}
details.methodology summary {
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-purple);
  transition: background 0.15s;
  user-select: none;
}
details.methodology summary::-webkit-details-marker { display: none; }
details.methodology summary::before {
  content: '\1F52C';  /* microscope emoji */
  font-size: 14px;
  flex-shrink: 0;
}
details.methodology summary::after {
  content: '\25B6';
  font-size: 9px;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
details.methodology[open] summary::after {
  transform: rotate(90deg);
}
details.methodology summary:hover {
  background: var(--accent-purple-light);
  border-radius: var(--radius-md);
}

.methodology-body {
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--border-light);
}

/* Pipeline visualization */
.method-pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 16px 0;
}
.method-step {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}
.method-step:not(:last-child) {
  border-bottom: 1px dashed var(--border-light);
}
.method-step .step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  font-weight: 700;
}
.method-step .step-content {
  flex: 1;
  min-width: 0;
}
.method-step .step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.method-step .step-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.method-step .step-detail code {
  font-size: 11px;
  background: var(--bg-code);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent-purple);
}

/* Limitations callout */
.method-limitations {
  background: var(--accent-yellow-light);
  border: 1px solid rgba(176, 140, 62, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.method-limitations strong {
  color: var(--accent-yellow);
  font-weight: 600;
}

/* Whimsy: nerd rating */
.nerd-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-card-alt);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}
.nerd-meter .nerd-dots {
  display: inline-flex;
  gap: 2px;
}
.nerd-meter .nerd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}
.nerd-meter .nerd-dot.filled {
  background: var(--accent-purple);
}

/* Responsive */
@media (max-width: 768px) {
  details.methodology summary { padding: 12px 14px; font-size: 12px; }
  .methodology-body { padding: 0 14px 16px; }
  .method-step { gap: 10px; }
}


/* ============================================================
   37. UNIT TOGGLE (Per-MW ↔ Total Project)
   ============================================================ */
.unit-toggle {
  display: inline-flex;
  gap: 0;
  margin: 0 0 0 auto;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
}
.unit-toggle .ut-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.unit-toggle .ut-btn:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
}
.unit-toggle .ut-btn.active {
  background: var(--accent-coral);
  color: white;
}
.unit-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.unit-toggle-wrap .ut-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* Unit-aware display spans */
.u-mw { display: inline; }
.u-total { display: none; }
body.show-total .u-mw { display: none; }
body.show-total .u-total { display: inline; }

/* Secondary unit hint (always visible, just smaller) */
.unit-secondary {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

@media (max-width: 600px) {
  .unit-toggle .ut-btn { padding: 4px 10px; font-size: 11px; }
}

/* ============================================================
   38. PRINT STYLES
   ============================================================ */
@media print {
  nav { display: none; }
  body { background: #fff; }
  .card, .hero-metric, .bottleneck-stat, .tech-card, .risk-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .card:hover, .tech-card:hover, .risk-card:hover {
    box-shadow: none;
    transform: none;
  }
}


/* ============================================================
   37. CHART.JS RECOMMENDED PALETTE & OVERRIDES
   ============================================================

   Chart.js colors must be set in JavaScript, not CSS.
   Use these values when configuring charts:

   Chart.defaults.color = '#8893A0';                    // tick label color
   Chart.defaults.borderColor = 'rgba(0,0,0,0.05)';    // grid line color
   Chart.defaults.font.family = "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif";
   Chart.defaults.font.size = 12;

   Tooltip configuration:
     backgroundColor: '#1C2024'
     titleColor:      '#FFFFFF'
     bodyColor:       '#CCCCCC'
     borderColor:     '#DFE3E8'
     borderWidth:     1
     padding:         12

   Data colors (use in this order):
     coral:   '#C47A5A'    (primary)
     blue:    '#5A7FBA'    (secondary)
     green:   '#4D8B6F'
     purple:  '#7B6BA8'
     yellow:  '#B08C3E'
     grey:    '#9AA3AE'

   Semi-transparent variants (for area fills, bar backgrounds):
     coral:   'rgba(196, 122, 90, 0.12)'
     blue:    'rgba(90, 127, 186, 0.12)'
     green:   'rgba(77, 139, 111, 0.12)'
     purple:  'rgba(123, 107, 168, 0.12)'
     yellow:  'rgba(176, 140, 62, 0.12)'

   Legend:
     labels.padding = 16
     labels.usePointStyle = true
     labels.pointStyleWidth = 12

   Example JS setup:
   ────────────────
   Chart.defaults.color = '#8893A0';
   Chart.defaults.borderColor = 'rgba(0,0,0,0.05)';
   Chart.defaults.font.family = "'Inter', -apple-system, sans-serif";
   Chart.defaults.font.size = 12;
   Chart.defaults.plugins.legend.labels.padding = 16;
   Chart.defaults.plugins.legend.labels.usePointStyle = true;
   Chart.defaults.plugins.legend.labels.pointStyleWidth = 12;

   const COLORS = {
     coral:  '#C47A5A',
     blue:   '#5A7FBA',
     green:  '#4D8B6F',
     purple: '#7B6BA8',
     yellow: '#B08C3E',
     grey:   '#9AA3AE'
   };

   ============================================================ */
