/* -------------------------------------------------------------------------
 * AI Labor Disruption Dashboard — Stylesheet
 * Clean, minimal, responsive.  Light, print-true reading theme (L1).
 * ------------------------------------------------------------------------- */

:root {
  /* L1 (Credibility Audit RFC): Light, print-true palette */
  --bg: #faf7f0;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #d8d4cc;
  --accent: #b85c1e;
  --accent-light: rgba(184, 92, 30, 0.12);
  --accent-dark: #9e4d18;
  --trend-up: #2d7a3f;
  --trend-down: #c0392b;
  --trend-flat: #757575;
  --trend-good: #2d7a3f;
  --trend-bad: #c0392b;
  --conf-measured: #2d7a3f;
  --conf-extracted: #b8860b;
  --conf-unknown: #999999;
  --error-bg: #fdf0f0;
  --error-border: #e74c3c;
  --error-text: #c0392b;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.12);
  --radius: 8px;
  --bg-alt: #f0ece4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===========================  Navbar  =================================== */

.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 400; /* GAP-P1: was 100 — career sidebar (z-index 300) overlapped the navbar and intercepted clicks on "What Should I Do?" */
}
.navbar-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  white-space: nowrap;
}
.navbar-brand:hover {
  opacity: 0.85;
}
/* Override generic .navbar a styles so the brand link keeps its
   bold accent look instead of inheriting muted text-muted styling. */
.navbar a.navbar-brand {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  padding: 0;
}
.navbar a.navbar-brand:hover {
  background: transparent;
  opacity: 0.85;
}
.navbar a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.navbar a:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.navbar a.active {
  color: var(--accent);
  font-weight: 600;
}
/* FIX-5a: .nav-tour-link removed (tour.html deleted, 301→index.html). */

/* ========================  Navbar search  ================================ */

.nav-search {
  margin-left: auto;
  margin-right: 0.5rem;
}
.nav-search-box {
  position: relative;
}
#nav-search-input,
#briefing-search-input,
#career-search-input {
  width: 340px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 4px;
  font-size: 0.82rem;
  background: var(--bg, #faf7f0);
  color: var(--text, #1a1a1a);
}
#nav-search-input:focus,
#briefing-search-input:focus,
#career-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card-bg, #fff);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.nav-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--bg-alt, #f0ece4);
  color: var(--text-muted, #888);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.nav-search-clear:hover {
  background: var(--border, #d8d4cc);
  color: var(--text, #1a1a1a);
}
.nav-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 500;
  min-width: 300px;
  max-height: 350px;
  overflow-y: auto;
}

/* ========================  Methods nav dropdown  ========================== */

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.nav-dropdown-trigger:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.nav-dropdown-trigger.active {
  color: var(--accent);
  font-weight: 600;
}
.nav-dropdown-chevron {
  transition: transform 0.15s;
}
.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 300px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 0.5rem 0;
  z-index: 410;  /* above navbar (z-index 400) */
  display: flex;
  flex-direction: column;
}
.nav-dropdown-menu[hidden] {
  display: none;
}

.nav-dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ========================  Methods pages (shared)  ========================= */
/* Migrated verbatim from the inline <style> block in methodology.html so all
 * /methods/* pages share them. `.methodology-toc` is intentionally omitted
 * (Q6: no in-page TOC on any sub-page). */

.methodology-section { margin-bottom: 2.5rem; }
.methodology-section h2 { border-bottom: 2px solid var(--border, #ddd); padding-bottom: 0.3rem; margin-bottom: 1rem; font-size: 1.4rem; }
.methodology-section h3 { margin-top: 1.75rem; margin-bottom: 0.5rem; font-size: 1.15rem; scroll-margin-top: 5rem; }
.methodology-section p { line-height: 1.7; margin-bottom: 1rem; }
.methodology-section ul { line-height: 1.7; margin-bottom: 1rem; padding-left: 1.5rem; }
.methodology-section li { margin-bottom: 0.4rem; }
.methodology-section code { background: var(--bg-alt, #f0ece4); padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.9em; }
.methodology-section details { margin-top: 0.75rem; margin-bottom: 1rem; }
.methodology-section details summary { cursor: pointer; color: var(--text-muted); font-size: 0.9rem; }
.methodology-section details p { margin-top: 0.5rem; font-size: 0.88rem; color: var(--text-muted); }
.methodology-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.methodology-table th {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 2px solid var(--border, #ddd);
  font-weight: 600;
}
.methodology-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: top;
}
.methodology-table a { color: var(--accent, #b85c1e); }
.limitations-list li { margin-bottom: 0.75rem; line-height: 1.6; }
.cadence-list li { margin-bottom: 0.5rem; line-height: 1.5; }
.confidence-legend-item {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: rgba(0,0,0,0.02);
  border-radius: 6px;
}
.confidence-legend-item strong { display: block; margin-bottom: 0.25rem; color: var(--accent, #b85c1e); }
.geo-tier-card {
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  padding: 1rem;
  margin: 0.5rem 0;
}
.geo-tier-card h4 { margin: 0 0 0.3rem; }
.geo-tier-card .why { font-size: 0.85rem; color: var(--text-muted, #666); font-style: italic; }
.scenario-trigger-row {
  border-bottom: 1px solid rgba(0,0,0,0.04);
  padding: 0.75rem 0;
}
.scenario-trigger-row .trigger-name { font-weight: 600; }
.scenario-trigger-row .trigger-meta { font-size: 0.82rem; color: var(--text-muted, #666); margin-top: 0.3rem; }
.scenario-trigger-row .trigger-rationale { font-size: 0.85rem; margin-top: 0.3rem; line-height: 1.5; }

/* ========================  Methods hub browse grid  ========================= */

.methods-browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.methods-browse-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.methods-browse-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.methods-browse-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.methods-browse-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ========================  Methods spoke footer  =========================== */

.methods-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  font-size: 0.88rem;
}
.methods-footer a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.methods-footer a:hover {
  color: var(--accent);
  background: var(--accent-light);
}
.methods-footer a.active {
  color: var(--accent);
  font-weight: 600;
  cursor: default;
}

/* ===========================  Layout  =================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}
.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}
.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* About page: readable paragraph spacing */
.about-page h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
}
.about-page p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  font-size: 1rem;
}
.about-page ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  line-height: 1.7;
}
.about-page li {
  margin-bottom: 0.5rem;
}
.about-page a {
  color: var(--accent);
  text-decoration: none;
}
.about-page a:hover {
  text-decoration: underline;
}

/* ===========================  Freshness badge  ========================== */

.freshness-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  margin-top: 0.5rem;
}
.freshness-badge.freshness-stale {
  border-color: #f0b400;
  color: #b8860b;
}
.section-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.section-header:first-child {
  margin-top: 0;
}

/* ========================  Scenario hero  =============================== */

.scenario-hero {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.hero-title {
  font-size: 1.25rem;
  font-weight: 700;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ========================  Scenario stacked bar  ======================== */

.scenario-bar-wrap {
  position: relative;
  margin: 0 0 1.25rem;
  width: 100%;
}
.scenario-bar-wrap.scenario-bar-empty {
  padding: 1.5rem 1rem;
  text-align: center;
}
.scenario-bar-wrap .no-data {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}
/* Header above the bar: dominant scenario name + pct */
.scenario-bar-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.5rem;
}
.scenario-bar-header-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.scenario-bar-header-pct {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

/* The bar itself */
.scenario-bar-svg {
  display: block;
  width: 100%;
  height: auto;
  /* viewBox is 1000 x 56; cap rendered height so it stays a slim bar */
  max-height: 56px;
}
.scenario-bar-seg {
  stroke: var(--card-bg);
  stroke-width: 1px;
  transition: opacity 0.18s ease;
}
/* In-bar labels: two-line (name + pct) on wide segments, pct-only on narrow */
.scenario-bar-label {
  font-family: inherit;
  pointer-events: none;
}
.scenario-bar-label-name {
  font-size: 11px;
  font-weight: 600;
  fill: #fff;
}
.scenario-bar-label-pct {
  font-size: 13px;
  font-weight: 700;
  fill: #fff;
}

/* Tooltip peak-displacement line (new in redesign) */
.scenario-tooltip-peak {
  color: #cbd5e1;
  font-size: 0.72rem;
  margin-top: 3px;
  font-style: italic;
}

/* Legend */
.scenario-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 320px;
}
/* Horizontal legend under the stacked bar */
.scenario-legend.scenario-legend-bar {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  max-width: 100%;
}
.scenario-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}
.scenario-legend-item:hover,
.scenario-legend-item.active {
  background: var(--accent-light);
}
.scenario-legend-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.scenario-legend-label {
  flex: 1 1 auto;
  font-weight: 500;
  color: var(--text);
}
.scenario-legend-pct {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--accent);
}

/* Hover tooltip */
.scenario-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: var(--shadow);
  max-width: 240px;
  z-index: 20;
}
.scenario-tooltip-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
}
.scenario-tooltip-sub {
  color: #cbd5e1;
  font-size: 0.72rem;
  margin-bottom: 2px;
}
.scenario-tooltip-pct {
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 3px;
}
.scenario-tooltip-tagline {
  color: #e2e8f0;
  margin-bottom: 3px;
}
.scenario-tooltip-displacement {
  color: #94a3b8;
  font-size: 0.72rem;
}

.triggered-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.triggered-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.triggered-list {
  list-style: none;
}
.triggered-item {
  padding: 0.75rem;
  background: #161629; // already dark
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--accent);
}
.triggered-item-head {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 4px;
}
.triggered-indicator {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
}
.triggered-name {
  font-size: 0.85rem;
}
.triggered-item-body {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.triggered-explanation {
  font-size: 0.8rem;
  color: var(--text);
}
.no-triggered {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ========================  Scenario Sankey diagram  ==================== */

.scenario-sankey-wrap {
  position: relative;
  margin: 0 0 1.25rem;
  width: 100%;
}
.scenario-sankey-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
#scenario-sankey-stage {
  min-width: 640px;
}
.sankey-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
  font-family: inherit;
}
.sankey-link {
  fill: none;
  transition: opacity 0.16s ease;
}
.sankey-node rect {
  transition: opacity 0.16s ease;
}
.sankey-node:hover rect {
  opacity: 0.85;
}
.sankey-label {
  font-size: 11px;
  fill: var(--text, #1a1a1a);
  pointer-events: none;
}
.sankey-label-indicator {
  font-weight: 500;
}
.sankey-label-scenario {
  font-size: 12px;
  font-weight: 700;
}
.sankey-label-pct {
  font-size: 11px;
  font-weight: 600;
  fill: var(--accent, #b85c1e);
}
.scenario-tooltip-meta {
  color: #e2e8f0;
  font-size: 0.75rem;
  margin-top: 2px;
}
.scenario-tooltip-feed {
  color: #94a3b8;
  font-size: 0.72rem;
  margin-top: 4px;
}

/* Sparkline detail panel (shown when hovering/clicking a Sankey flow) */
.sankey-detail {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #161629;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sankey-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.sankey-detail-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
}
.sankey-detail-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #666666);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}
.sankey-detail-close:hover {
  color: var(--text, #1a1a1a);
}
.sankey-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sankey-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted, #666666);
}
.sankey-detail-proximity {
  margin: 0.15rem 0;
}
.sankey-detail-chart {
  width: 100%;
  height: 64px;
  display: block;
}
.sankey-detail-projection {
  font-size: 0.75rem;
  color: var(--text-muted, #666666);
  margin: 0;
}
.sankey-detail-projection.urgent {
  color: #f87171;
  font-weight: 600;
}
.sankey-detail-why {
  font-size: 0.78rem;
  color: var(--text-muted, #666666);
  margin: 0;
}
.sankey-detail-note {
  font-size: 0.8rem;
  color: var(--text, #1a1a1a);
  margin: 0;
}

/* Mobile fallback: hide the Sankey stage, show the legacy stacked bar. */
@media (max-width: 480px) {
  #scenario-sankey-stage {
    display: none;
  }
  .scenario-sankey-fallback {
    display: block !important;
  }
}

/* ====================  Monitored indicators section  ==================== */

.monitored-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.monitored-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.monitored-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

/* Constrained-width card grid for monitored indicators */
.monitored-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.monitored-card {
  padding: 0.75rem;
  background: #161629; // already dark
  border-radius: 6px;
  border-left: 3px solid #10b981; /* monitoring green by default */
}
.monitored-card-triggered {
  border-left-color: #dc2626; /* triggered red */
  background: rgba(220, 38, 38, 0.1);
}
.monitored-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: flex-start;
  margin-bottom: 4px;
}
.monitored-card-head .monitored-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1 1 100%;
}
.monitored-card-body {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.monitored-card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}
.monitored-explanation {
  font-size: 0.78rem;
  color: var(--text);
  margin: 0;
}
.monitored-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Compact time series chart on monitored indicator cards */
.monitored-chart {
  width: 100%;
  height: 60px;
  margin: 0.5rem 0 0.25rem 0;
  display: block;
}

/* Threshold crossing projection text below the chart */
.monitored-projection {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.monitored-projection.urgent {
  color: #f59e0b;
  font-weight: 500;
}

/* Tooltip wrapper around the Monitoring pill */
.status-badge-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.monitored-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  right: 0;
  z-index: 20;
  margin-bottom: 6px;
  padding: 0.4rem 0.65rem;
  background: #ffffff;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 400;
  white-space: nowrap;
  border-radius: 5px;
  box-shadow: var(--shadow-hover);
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}
.status-badge-wrap:hover .monitored-tooltip,
.status-badge-wrap:focus .monitored-tooltip {
  visibility: visible;
  opacity: 1;
}
.monitored-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 8px;
  border: 5px solid transparent;
  border-top-color: #d8d4cc;
}

/* Provenance tooltip (C-4a) — source and rationale for threshold choices */
.prov-info-icon {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: help;
  position: relative;
  vertical-align: super;
}
.prov-info-icon:hover, .prov-info-icon:focus {
  color: var(--accent);
}
.prov-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-width: 90vw;
  background: #ffffff;
  color: #e0e0e0;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.75rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  text-align: left;
  font-weight: normal;
  white-space: normal;
  pointer-events: none;
}
.prov-info-icon:hover .prov-tooltip,
.prov-info-icon:focus .prov-tooltip {
  display: block;
}
.prov-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #d8d4cc transparent transparent transparent;
}

/* Status badges — green "Monitoring", red "Triggered" */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}
.status-monitoring {
  background: rgba(74, 222, 128, 0.1);
  color: #047857;
  border: 1px solid #a7f3d0;
}
.status-triggered {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ====================  Changelog section (C-4d)  ==================== */
.changelog-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.changelog-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.changelog-content {
  max-height: 300px;
  overflow-y: auto;
}
.changelog-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.changelog-entry:last-child {
  border-bottom: none;
}
.changelog-entry-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.changelog-indicator {
  font-weight: 600;
  font-size: 0.82rem;
}
.changelog-delta {
  font-size: 0.78rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(184,92,30,0.15);
  color: #d97706;
}
.changelog-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}
.changelog-explanation {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}
.changelog-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================  Card grid  ================================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* =====================  Indicator Table  ================================ */
/* Replaces the card-grid for monitored indicators on the National Pulse.
 * Three columns: Indicator name | Latest value + year | Sparkline
 * Inspired by World Bank Open Data's indicator table layout. */

.indicator-table-container {
  margin-top: 0.5rem;
}

.indicator-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.indicator-table-theme-header th {
  background: var(--card-bg, #ffffff);
  color: var(--text, #1a1a1a);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border, #d8d4cc);
}

.indicator-table-col-header th {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted, #666666);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border, #d8d4cc);
}

.indicator-table-col-header th:nth-child(2) { text-align: right; }
.indicator-table-col-header th:nth-child(3) { text-align: center; }

.indicator-table-row {
  border-bottom: 1px solid var(--border, #d8d4cc);
  transition: background 0.1s;
}
.indicator-table-row:hover {
  background: rgba(107, 159, 214, 0.08);
}

.indicator-table-row.confidence-estimated {
  opacity: 0.85;
}

.indicator-table-name {
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text, #1a1a1a);
  max-width: 320px;
}

.indicator-table-value {
  padding: 0.6rem 0.75rem;
  text-align: right;
  white-space: nowrap;
}

.indicator-table-value-num {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1a1a1a);
}

.indicator-table-year {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted, #666666);
  margin-top: 0.1rem;
}

.indicator-table-spark {
  padding: 0.4rem 0.75rem;
  text-align: center;
  width: 130px;
}

.indicator-table-sparkline {
  width: 120px;
  height: 40px;
}

/* Provenance footer — plain italic text, no icons (Dan's constraint) */
.indicator-table-provenance {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted, #666666);
  margin-top: 0.4rem;
  padding: 0 0.75rem;
}

/* "Why this matters" collapsible section */
.indicator-table-why-details {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.indicator-table-why-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #6b9fd6);
}
.indicator-table-why-item {
  font-size: 0.78rem;
  color: var(--text-muted, #666666);
  line-height: 1.5;
  margin: 0.4rem 0;
}

/* Responsive: hide sparkline column on mobile, keep value */
@media (max-width: 767px) {
  .indicator-table-spark { display: none; }
  .indicator-table-name { max-width: none; }
}

/* =====================  Chart Tabs (Chart | Data | Download)  =========== */
/* Tab row under every chart. Inspired by Our World in Data's Data tab. */

.chart-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #2a3a5a);
  margin-top: 0.4rem;
}

.chart-tab {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #6b6b7a);
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}

.chart-tab:hover {
  color: var(--text, #1a1a1a);
}

.chart-tab.active {
  color: var(--accent, #1659E5);
  border-bottom-color: var(--accent, #1659E5);
}

.chart-data-table-container {
  margin-top: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
}

.chart-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.chart-data-table th {
  background: var(--card-bg, #1a2540);
  color: var(--text-muted, #666666);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border, #2a3a5a);
  position: sticky;
  top: 0;
}

.chart-data-table td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--border, #2a3a5a);
  font-variant-numeric: tabular-nums;
  color: var(--text, #1a1a1a);
}

.chart-data-table tr:hover td {
  background: rgba(107, 159, 214, 0.08);
}

/* Search group headers (METROS / OCCUPATIONS / INDICATORS) */
.search-group-header {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted, #666666);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem 0.25rem;
  border-top: 1px solid var(--border, #d8d4cc);
  background: var(--bg, #faf7f0);
}
.search-group-header:first-child {
  border-top: none;
}

/* ============================  Cards  =================================== */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  transition: box-shadow 0.15s;
}
.card:hover {
  box-shadow: var(--shadow-hover);
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metric-id {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* M4 (Credibility Audit RFC): linkable metric-ID badge — 11px mono, top-right,
 * clickable to methodology anchor, copy-link on hover. */
.metric-id-badge {
  font-family: 'SF Mono', 'Fira Mono', 'Cascadia Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
}
.metric-id-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.metric-id-copy-hint {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 10;
  margin-top: 2px;
}
.metric-id-badge:hover .metric-id-copy-hint {
  display: inline;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.card-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.card-value {
  font-size: 1.5rem;
  font-weight: 700;
}
.trend {
  font-size: 1rem;
}
.trend-up   { color: var(--trend-up); }
.trend-down { color: var(--trend-down); }
.trend-flat { color: var(--trend-flat); }
.trend-good { color: var(--trend-good); }
.trend-bad  { color: var(--trend-bad); }

.card-sparkline {
  width: 100%;
  height: 32px;
  margin: 0.5rem 0;
}

.card-timeseries {
  width: 100%;
  height: 80px;
  margin: 0.5rem 0;
}
.card-read {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.card-as-of {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: auto;
}

/* =======================  Confidence icons  ============================= */

.conf {
  font-size: 0.85rem;
  font-weight: 700;
  cursor: help;
}
.conf-measured  { color: var(--conf-measured); }
.conf-extracted { color: var(--conf-extracted); }
.conf-unknown   { color: var(--conf-unknown); }
.conf-estimated { color: #7c4fd6; }

/* =======================  Confidence source labels  ==================== */
/* Replaces old .conf / .conf-measured / .conf-extracted / .estimated-badge icons */
.card-source {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.card-source-inline {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* Cards with estimated data get a dashed left border and lighter opacity */
.metric-card.confidence-estimated {
  border-left: 4px dashed #b89df5;
  opacity: 0.85;
}
.metric-card.confidence-estimated .card-value {
  color: #7c4fd6;
}

/* Inline badge shown next to the value on estimated cards */
.estimated-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7c4fd6;
  background: rgba(107, 159, 214, 0.1);
  border: 1px solid #d4c8f5;
  border-radius: 3px;
  padding: 1px 5px;
  cursor: help;
}

/* =========================  Error banner  =============================== */

.error-banner {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* =======================  Metro explorer  =============================== */

.metro-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.metro-controls label {
  font-size: 0.85rem;
  font-weight: 600;
}
.metro-controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

table.metro-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.metro-table th {
  background: #1e1e34;
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.metro-table th:hover {
  background: #252542;
}
table.metro-table th.sorted-asc::after  { content: ' \25B2'; }
table.metro-table th.sorted-desc::after { content: ' \25BC'; }
table.metro-table td {
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
table.metro-table tr {
  cursor: pointer;
  transition: background 0.1s;
}
table.metro-table tr:hover {
  background: #f7f8fa;
}
table.metro-table .metro-name-cell {
  font-weight: 600;
}

/* Shading classes for choropleth-like background tinting */
.shade-0 { background: var(--card-bg); }
.shade-1 { background: #1e1e34; }
.shade-2 { background: #252542; }
.shade-3 { background: #a8c8e6; }
.shade-4 { background: #6a98cf; }
.shade-5 { background: var(--accent); color: #fff; }

/* ===========================  Modal  ==================================== */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.modal-header h2 {
  font-size: 1.2rem;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {}
.modal-metric-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.modal-metric-row:last-child {
  border-bottom: none;
}
.modal-metric-name {
  color: var(--text-muted);
}
.modal-metric-value {
  font-weight: 600;
}
.modal-loading, .modal-no-data {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem 0;
}

/* ========================  Community page  ============================== */

.community-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.community-input label {
  font-size: 0.9rem;
  font-weight: 600;
}
.community-input input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  width: 140px;
}
.community-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.community-input button {
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.community-input button:hover {
  background: var(--accent-dark);
}
.community-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.community-header {
  margin-bottom: 1.5rem;
}
.community-copy {
  font-size: 1rem;
}
.community-split {
  font-size: 0.85rem;
  color: var(--conf-extracted);
  font-style: italic;
  margin-top: 0.25rem;
}

.community-grid {
  grid-template-columns: repeat(3, 1fr);
}
.community-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.geo-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}
.geo-code {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: -0.25rem;
}
.cadence-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.community-metrics {}
.community-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 0.5rem;
}
.community-metric-row:last-child {
  border-bottom: none;
}
.cm7-action-label {
  font-size: 0.72rem;
  color: var(--accent, #b85c1e);
  margin-top: 0.2rem;
  line-height: 1.3;
}
.cm7-sparkline-container {
  margin-top: 0.3rem;
  height: 30px;
  width: 120px;
}
.coverage-disclosure {
  font-size: 0.72rem;
  color: var(--text-muted, #666666);
  margin-top: 0.2rem;
  padding: 0.3rem 0.4rem;
  border-left: 2px solid var(--border, #d8d4cc);
  line-height: 1.4;
}
.coverage-disclosure a {
  color: var(--accent, #b85c1e);
  text-decoration: underline;
}
.cm-name {
  color: var(--text-muted);
  flex: 1;
}
.cm-value {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.loading, .no-data {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}
.no-data-inline {
  color: var(--text-muted);
}
.community-empty-state {
  padding: 1rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
}
.community-empty-state p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
}
.community-empty-hint {
  font-size: 0.8rem !important;
  font-style: italic;
  opacity: 0.8;
}

/* =======================  Responsive  =================================== */

@media (max-width: 1024px) and (min-width: 769px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .card-grid,
  .community-grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 1rem;
  }
  .navbar {
    padding: 0 1rem;
    gap: 0.75rem;
    overflow-x: auto;
  }
  .navbar a {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
  }
  /* Methods nav dropdown: never open on mobile — trigger navigates to /methods */
  .nav-dropdown-menu {
    display: none !important;
  }
  .nav-dropdown-chevron {
    display: none;
  }
  .nav-dropdown-trigger {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
  }
  .scenario-hero {
    padding: 1rem;
  }
  table.metro-table {
    font-size: 0.75rem;
  }
  table.metro-table th,
  table.metro-table td {
    padding: 0.4rem 0.5rem;
  }
  .card-value {
    font-size: 1.25rem;
  }
  .community-input input {
    width: 120px;
  }
}

/* ========================  Research Library page  ============================== */

/* Scenario definitions */
.scenario-definitions-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.scenario-toggles-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.scenario-definitions-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}

.scenario-definitions-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.scenario-definitions-content {
  margin-top: 1rem;
}

.methodology-note {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  background: #f7f8fa;
  border-radius: 4px;
  border-left: 3px solid var(--accent);
}

.scenario-focus {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f7f8fa;
  border-radius: 4px;
}

.scenario-definition-card {
  padding: 0.75rem;
  background: #161629; // already dark
  border-radius: 6px;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--accent);
}

.scenario-definition-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.scenario-tagline {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.scenario-definition-card p {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.scenario-timeline,
.scenario-impact {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.scenario-signals ul {
  list-style: disc;
  padding-left: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.scenario-methodology-plain {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
  margin-top: 1rem;
  padding: 0.6rem 0.75rem;
  background: #161629; // already dark
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.scenario-methodology {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f7f8fa;
  border-radius: 4px;
}

.outlook-gauge-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.outlook-gauge {
  width: 100%;
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.gauge-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
.gauge-assessed {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gauge-bar-container {
  padding: 0 0.5rem;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.gauge-label-left,
.gauge-label-right {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.gauge-label-left {
  color: #c62828;
}
.gauge-label-right {
  color: #2e7d32;
}

.gauge-track {
  position: relative;
  width: 100%;
  height: 28px;
  background: #161629; // already dark
  border-radius: 14px;
  overflow: visible;
}

.gauge-gradient {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, #c62828 0%, #f57f17 50%, #2e7d32 100%);
  border-radius: 14px;
  opacity: 0.15;
}

.gauge-marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.gauge-marker-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.gauge-marker-label {
  position: absolute;
  top: 28px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.gauge-score {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.75rem;
  color: var(--text);
}

.gauge-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.gauge-breakdown {
  font-style: italic;
}

/* ---- Filters ---- */

.learn-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-btn.active {
  background: var(--accent, #6b9fd6);
  color: var(--bg, #ffffff);
  border-color: var(--accent, #6b9fd6);
}
.occupation-filter-pill {
  background: rgba(107, 159, 214, 0.15);
  border-color: var(--accent, #6b9fd6);
  color: var(--accent, #6b9fd6);
  cursor: pointer;
  user-select: none;
}
.occupation-filter-pill.active {
  background: var(--accent, #6b9fd6);
  color: var(--bg, #ffffff);
}
.occupation-filter-close {
  margin-left: 0.3rem;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---- Resource cards ---- */

.learn-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

/* RFC F4: Essential Reads section */
.essential-reads-section {
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

/* RFC F7: Community discussions seed content */
.discussion-thread-preview {
  padding: 0.75rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
}
.thread-topic { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.thread-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.thread-body { font-size: 0.85rem; line-height: 1.5; margin: 0.5rem 0; }
.thread-author { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; font-style: italic; }
.discussion-section-note { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; font-style: italic; }

.learn-resource-card {
  display: flex;
  flex-direction: column;
  border-left: 4px solid var(--border);
}
.learn-resource-card.perspective-optimistic,
.learn-resource-card.perspective-boomer {
  border-left-color: #2e7d32;
}
.learn-resource-card.perspective-pessimistic,
.learn-resource-card.perspective-doomer {
  border-left-color: #c62828;
}
.learn-resource-card.perspective-neutral {
  border-left-color: #f57f17;
}

.resource-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.resource-perspective {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}
.perspective-tag-optimistic,
.perspective-tag-boomer {
  background: rgba(74, 222, 128, 0.1);
  color: #2e7d32;
}
.perspective-tag-pessimistic,
.perspective-tag-doomer {
  background: rgba(248, 113, 113, 0.1);
  color: #c62828;
}
.perspective-tag-neutral {
  background: rgba(251, 191, 36, 0.1);
  /* QA-016: was #f57f17 (2.51:1 on this bg — WCAG-AA fail); #8a5a00 = 5.62:1 */
  color: #8a5a00;
}

.resource-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.resource-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.resource-title a {
  color: var(--text);
  text-decoration: none;
}
.resource-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.resource-authors {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.resource-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.resource-org {
  font-weight: 500;
}
.resource-year {
  font-weight: 500;
}

.resource-summary {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  .learn-resource-grid {
    grid-template-columns: 1fr;
  }
  .gauge-marker-label {
    font-size: 0.7rem;
  }
}

/* ========================  Metro Impact Heatmap  ========================= */

.heatmap-section {
  margin-bottom: 2rem;
}

.heatmap-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.heatmap-legend .legend-label {
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.heatmap-legend .legend-gradient-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.heatmap-legend .legend-gradient {
  width: 240px;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    #ffc878 0%,
    #e8782c 50%,
    #b42020 100%);
}

.heatmap-legend .legend-breaks {
  display: flex;
  justify-content: space-between;
  width: 240px;
  font-size: 0.6875rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
}

.heatmap-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* ========================  Research Library search  ============================= */

.learn-search-section {
  margin-bottom: 2rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-bar input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar button {
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.search-bar button:hover {
  background: var(--accent-dark);
}

.search-clear-btn {
  background: var(--border) !important;
  color: var(--text) !important;
}
.search-clear-btn:hover {
  background: #ccc !important;
}

.search-result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.search-result-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.search-result-title {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.search-result-title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.search-result-snippet {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.search-result-snippet mark {
  background: rgba(251, 191, 36, 0.1);
  color: var(--text);
  padding: 1px 2px;
  border-radius: 2px;
}

/* ========================  Column info icons  =========================== */

.col-info-icon {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: help;
  vertical-align: super;
  margin-left: 2px;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.col-info-icon:hover {
  opacity: 1;
  color: var(--accent);
}

/* ========================  Metro Impact Heatmap (US Map)  =============== */

.heatmap-section {
  margin-bottom: 2rem;
}

.heatmap-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.heatmap-legend .legend-label {
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.heatmap-legend .legend-gradient-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.heatmap-legend .legend-gradient {
  width: 240px;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    #ffc878 0%,
    #e8782c 50%,
    #b42020 100%);
}

.heatmap-legend .legend-breaks {
  display: flex;
  justify-content: space-between;
  width: 240px;
  font-size: 0.6875rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
}

.heatmap-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.heatmap-map {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

/* Loading skeleton for first load */
.heatmap-loading-skeleton {
  text-align: center;
  padding: 1rem;
}

.heatmap-skeleton-map {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 auto 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.heatmap-skeleton-map::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(74, 111, 165, 0.08) 50%,
    transparent 100%);
  animation: heatmap-shimmer 1.5s infinite;
}

@keyframes heatmap-shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

.heatmap-svg {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 8 / 5;
  min-height: 500px;
}

.heatmap-state {
  fill: #f5f1ea;
  stroke: rgba(0,0,0,0.25);
  stroke-width: 1;
}

.heatmap-state-border {
  fill: none;
  stroke: rgba(0,0,0,0.25);
  stroke-width: 1;
  stroke-linejoin: round;
}

.heatmap-marker {
  transition: r 0.15s, fill-opacity 0.15s, stroke 0.15s;
}

/* ========================  CBSA Choropleth + Centroid Dots  ============= */

/* Zoom controls — right side of map */
.zoom-controls {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  box-shadow: var(--shadow);
}

.zoom-btn:hover {
  background: var(--bg-alt, #f0ece4);
  border-color: var(--accent);
}

.zoom-btn:active {
  background: var(--accent-light);
}

.zoom-reset {
  font-size: 1rem;
}

/* CBSA polygon fill encodes score via color (choropleth) */
.heatmap-cbsa-path {
  transition: fill 0.4s ease, fill-opacity 0.15s, stroke 0.15s;
}

/* High-risk CBSA polygons (score >= 40) get a subtle red glow */
.high-risk-cbsa {
  filter: drop-shadow(0 0 2px rgba(214, 96, 77, 0.6));
}

/* Centroid dots — fixed radius, dot sits on top of polygon */
.heatmap-centroids circle {
  transition: fill 0.4s ease, fill-opacity 0.15s, stroke 0.15s;
}

/* Reduced-intensity pulse for high-impact centroid dots (score > 60) */
@keyframes centroid-pulse {
  0%, 100% { fill-opacity: 0.9; }
  50%      { fill-opacity: 1; }
}

.heatmap-centroids circle.high-impact {
  animation: centroid-pulse 2.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .heatmap-centroids circle.high-impact { animation: none; }
}

/* Tooltip for map markers */
.heatmap-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  z-index: 10;
  white-space: nowrap;
  transition: opacity 0.15s;
  box-shadow: var(--shadow);
}

.heatmap-tooltip .tooltip-name {
  font-weight: 700;
  margin-bottom: 2px;
}

.heatmap-tooltip .tooltip-score {
  font-size: 0.85rem;
}

.heatmap-tooltip .tooltip-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.heatmap-tooltip .tooltip-rank {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================  Chart tooltips  ============================== */

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  z-index: 10;
  white-space: nowrap;
  transition: opacity 0.1s;
  box-shadow: var(--shadow);
  line-height: 1.3;
}

.chart-tooltip-period {
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chart-tooltip-value {
  font-weight: 600;
}

/* ========================  Scenario subtitles  ========================== */

.scenario-subtitle {
  font-size: 0.78rem !important;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.3rem;
  margin-bottom: 0.25rem;
  padding: 0;
}

/* ========================  Responsive heatmap  ========================= */

@media (max-width: 768px) {
  .heatmap-legend .legend-gradient {
    width: 120px;
  }
  .heatmap-map {
    padding: 0.25rem;
  }
  .heatmap-controls .filter-btn {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
  }
}

/* ==================  Map region (National Pulse card)  ==================== */
/* Dan's map redesign: the map joins the National Pulse card. Toggle left,
 * search right, both directly above the map; legend below, centred. */

.np-map-region {
  width: 100%;
  margin-top: 8px;
}

.np-map-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.np-map-toolbar .filter-btn {
  background: var(--bg-alt, #f0ece4);
  border-color: var(--border);
  color: var(--text-muted);
}

.np-map-toolbar .filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.np-map-toolbar .filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.np-map-search {
  margin-left: auto;
}

.np-map-region .heatmap-legend {
  color: var(--text-muted);
}

.np-map-region .heatmap-legend .legend-label {
  color: var(--text-muted);
}

.np-map-region .heatmap-legend .legend-gradient {
  border: 1px solid var(--border);
}

.np-map-region .heatmap-summary {
  color: var(--text-muted);
}

/* Legend moved below the map, centred (Dan's map redesign). */
.np-map-legend {
  justify-content: center;
  margin-bottom: 0.75rem;
}

/* ---- Map cleanup v2 (approved) ---- */
/* The map container's outer edges must align with the chip cards:
 * .hero-tier-grid resolves through .hero-inner (width 100%, max-width
 * 1104px, centred by .hero-redesigned's align-items:center), so
 * .np-map-outer gets the same constraints. 1104px is the hero section's
 * usable width (1200px container - 2x24px container padding - 2x24px
 * hero padding, hero-width widening 2026-10-05). */

/* Community section (2026-10-03): wraps the layer toggle, search, and map
 * in one container with its own header — same grammar as .occ-impact. */
.community-section {
  width: 100%;
  max-width: 1104px;
  margin: 8px auto 0;
}
.community-section .np-map-outer { margin-top: 14px; }
.community-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0465af;
}
.community-title {
  font-size: 30px;
  font-weight: 700;
  margin: 8px 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.community-subtitle {
  font-size: 15px;
  line-height: 1.55;
  color: #494e52;
  max-width: 720px;
  margin: 0;
}

.np-map-outer {
  width: 100%;
  max-width: 1104px;
  margin-top: 8px; /* the old .np-map-region top margin, moved out here */
}
.np-map-outer .np-map-region { margin-top: 0; }

/* Per-layer legends: the stress and exposure layers use different color
 * scales, so each layer has its own legend; the mode-exposure /
 * mode-current classes on .np-map-region swap them. */
.np-map-region.mode-exposure .np-legend-stress { display: none; }
.np-map-region.mode-current .np-legend-stress { display: flex; }
.np-map-region.mode-exposure .np-legend-exposure { display: flex; }
.np-map-region.mode-current .np-legend-exposure { display: none; }

/* Exposure legend: three categorical swatches sharing the stress
 * legend's gradient skeleton. Colors are the exposure severity scale
 * (app.js severityFor('exposure_index')): <0.8x green, 0.8–1.25x amber,
 * >=1.25x red. */
.legend-gradient.exposure-gradient {
  display: flex;
  overflow: hidden;
}
.legend-gradient.exposure-gradient span { flex: 1; height: 100%; }
.legend-gradient.exposure-gradient .seg-low { background: #4ade80; }
.legend-gradient.exposure-gradient .seg-mod { background: #fbbf24; }
.legend-gradient.exposure-gradient .seg-high { background: #f87171; }

/* The layer control (UI): a visible two-segment pill, left-justified on
 * the toolbar row (search right). BOTH layer names are always visible so
 * the map is an honest choice between layers; the active segment fills
 * with the accent (same vocabulary as .np-map-toolbar .filter-btn.active
 * and the old index-classic .heatmap-mode-btn tabs). */
.np-layer-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-alt, #f0ece4);
}

.np-layer-switch .np-layer-seg {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.np-layer-switch .np-layer-seg + .np-layer-seg {
  border-left: 1px solid var(--border);
}

.np-layer-switch .np-layer-seg:hover {
  color: var(--accent);
}

.np-layer-switch .np-layer-seg.active {
  background: var(--accent);
  color: #fff;
}

.np-layer-switch .np-layer-seg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Combined layer explainer (exact sentence approved by Dan). */
.np-map-explainer {
  max-width: 1104px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}

/* ========================  Hero (Redesigned)  ============================= */

.hero-redesigned {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 -0.5rem 2rem;
  font-family: Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.hero-inner {
  width: 100%;
  max-width: 1104px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero-title-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-title-block h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  color: #1c1917;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.hero-meta {
  margin: 0;
  font-size: 16px;
  color: #78716c;
}

.hero-index-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero-index-number {
  font-size: 104px;
  font-weight: 800;
  line-height: 1;
  color: #1c1917;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-index-label-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 18px;
}

.hero-severity-badge {
  font-size: 18px;
  font-weight: 700;
  color: #16a34a;
}

.hero-severity-badge.severity-low { color: #16a34a; }
.hero-severity-badge.severity-moderate { color: #d97706; }
.hero-severity-badge.severity-high { color: #dc2626; }

/* ======================  Hero gradient gauge (1A)  ====================== */

.hero-gauge {
  position: relative;
  margin-top: 20px;
  width: 100%;
}

.hero-gauge-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #22c55e 0%, #22c55e 30%, #f59e0b 30%, #f59e0b 60%, #ef4444 60%, #ef4444 100%);
}

.hero-gauge-tick {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 26px;
  background: #1c1917;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.hero-gauge-zones {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
}

.hero-gauge-zone {
  height: 100%;
  cursor: pointer;
  outline: none;
}

.hero-gauge-zone:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: 7px;
}

.hero-gauge-scale {
  display: flex;
  position: relative;
  margin-top: 6px;
  height: 16px;
}

.hero-gauge-scale-label {
  position: absolute;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: #a8a29e;
  line-height: 1;
}

.hero-gauge-tooltip {
  position: absolute;
  top: calc(100% + 24px);
  transform: translateX(-50%);
  background: #1c1917;
  color: #ffffff;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  width: 260px;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hero-gauge-tooltip-label {
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-gauge-tooltip-desc {
  opacity: 0.9;
}

/* ===================  Methodology disclosure row (1A)  =================== */

.hero-method-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  color: #a8a29e;
  cursor: pointer;
  margin-top: 16px;
  user-select: none;
}

.hero-method-row:hover {
  color: var(--text-muted, #666666);
}

.hero-method-arrow {
  display: inline-block;
  width: 1em;
  text-align: center;
}

.hero-method-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 180ms ease, opacity 180ms ease;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #57534e;
  background: #f7f4ee;
  border-radius: 6px;
  padding: 0 16px;
}

.hero-method-panel.open {
  max-height: 200px;
  opacity: 1;
  padding-top: 14px;
  padding-bottom: 14px;
}

/* ===================  Hero metro-count footer (1A)  ==================== */

.hero-metro-footer {
  font-size: 13px;
  color: #a8a29e;
  margin-top: 28px;
}

.hero-index-scale {
  font-size: 18px;
  color: #57534e;
}

.hero-index-explainer {
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: #44403c;
}

.hero-risk-row {
  display: flex;
  gap: 40px;
  border-top: 1px solid #e7e2d8;
  padding-top: 32px;
}

.hero-risk-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 16px;
  border-left: 3px solid #e7e2d8;
}

.hero-risk-col.hero-risk-high { border-left-color: #ef4444; }
.hero-risk-col.hero-risk-moderate { border-left-color: #f59e0b; }
.hero-risk-col.hero-risk-low { border-left-color: #22c55e; }

.hero-risk-num {
  font-size: 32px;
  font-weight: 800;
  color: #1c1917;
  font-variant-numeric: tabular-nums;
}

.hero-risk-label {
  font-size: 14px;
  color: #78716c;
}

.hero-scenario-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.hero-scenario-line {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

.hero-scenario-line b {
  color: var(--accent);
}

.hero-stressed-line {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-methodology-link {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.hero-methodology-link:hover {
  color: var(--accent-dark);
}

@media (max-width: 768px) {
  .hero-redesigned { padding: 0.5rem; }
  .hero-title-block h1 { font-size: 28px; }
  .hero-index-number { font-size: 72px; }
  .hero-risk-row { flex-direction: column; gap: 20px; }
  .hero-risk-col { border-left-width: 3px; }
}

@media (max-width: 480px) {
  .hero-index-number { font-size: 56px; }
  .hero-title-block h1 { font-size: 24px; }
}

/* ========================  Marker Pulse Animation  ====================== */
/* Old marker-pulse keyframe retained for reference; centroid dots now use
   the reduced-intensity centroid-pulse keyframe defined above. */
@keyframes marker-pulse {
  0%, 100% { fill-opacity: 0.85; }
  50% { fill-opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .heatmap-marker.high-impact { animation: none; }
}

/* GAP-CO5056-G1: Spinner used by Get My Plan 200ms feedback guarantee. */
@keyframes aild-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .aild-spinner { animation: none; }
}

/* DEC-34: the A/B/C scenario button severity dots and active tints were
   removed with the scenario map tabs; the exposure/current mode buttons
   use the shared .filter-btn styling. */

/* ========================  Card Severity Borders  ======================= */

.metric-card.severity-stable {
  border-left: 4px solid var(--accent);
}
.metric-card.severity-warming {
  border-left: 4px solid #d97706;
}
.metric-card.severity-hot {
  border-left: 4px solid #dc2626;
}
.metric-card.severity-crisis {
  border-left: 4px solid #991b1b;
}

.card-why {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* ========================  Metro Detail Sidebar  ========================= */

.metro-sidebar {
  position: fixed;
  top: 0;
  right: -576px;
  width: 556px;
  max-width: 90vw;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 500;
  transition: right 0.3s ease;
  overflow-y: auto;
  visibility: hidden;
}

.metro-sidebar.open {
  right: 0;
  visibility: visible;
}

.metro-sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.25);
  z-index: 499;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.metro-sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.metro-sidebar-content {
  padding: 1.5rem;
}

.metro-sidebar-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  line-height: 1;
  z-index: 10;
}

.metro-sidebar-close:hover {
  color: var(--text);
}

.metro-sidebar-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  margin-bottom: 0.75rem;
  padding-right: 2rem;
  line-height: 1.3;
}

.metro-sidebar h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  padding-right: 2rem;
}

.metro-sidebar-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.metro-sidebar-section {
  margin-bottom: 1.5rem;
}

.metro-sidebar-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.metro-sidebar-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 1rem;
}

.metro-sidebar-metric-row:last-child {
  border-bottom: none;
}

.metro-sidebar-metric-name {
  color: var(--text);
  font-weight: 500;
  flex: 1;
}

.metro-sidebar-metric-why {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.metro-sidebar-metric-value {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.metro-sidebar-metric-row.null-data .metro-sidebar-metric-value {
  color: var(--text-muted);
}

/* ---- WP0.10: drivers-only sidebar (contribution bar, provenance,
 *      "Not counted", generated explanation) ---- */
.metro-sidebar-driver-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.8rem;
}
.metro-sidebar-driver-bar-name {
  flex: 0 0 42%;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metro-sidebar-driver-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(128, 128, 160, 0.18);
  overflow: hidden;
}
.metro-sidebar-driver-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #e8a33d;
}
.metro-sidebar-driver-bar-fill--multiplier {
  background: #4a6fa5;
}
.metro-sidebar-driver-bar-score {
  flex: 0 0 3.2em;
  text-align: right;
  font-weight: 600;
  color: var(--text);
}
.metro-sidebar-driver-bar-row--multiplier .metro-sidebar-driver-bar-name {
  color: var(--text-muted);
  font-style: italic;
}
.metro-sidebar-provenance {
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.metro-sidebar-provenance.provenance-measured {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.metro-sidebar-provenance.provenance-derived {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.metro-sidebar-provenance.provenance-modeled {
  background: rgba(107, 159, 214, 0.15);
  color: #6b9fd6;
  border: 1px solid rgba(107, 159, 214, 0.3);
}
.metro-sidebar-metric-period {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}
.metro-sidebar-not-counted {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.metro-sidebar-recompute-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.metro-sidebar-recompute-note--mismatch {
  color: #fbbf24;
}

@media (max-width: 768px) {
  .metro-sidebar {
    width: 100vw;
    right: -100vw;
  }
}

/* ========================  Heatmap Table View (C-6)  ==================== */

/* Chart View container */
.heatmap-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.heatmap-chart-title { font-size: 1.1rem; font-weight: 600; margin: 0; color: var(--text,#e8e8f0); }
.heatmap-chart-metric-toggle { display: flex; gap: 0.3rem; }
.heatmap-chart-metric-toggle button { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
.heatmap-chart-metric-toggle button.active { background: var(--accent,#1659E5); color: #fff; border-color: var(--accent,#1659E5); }
#heatmap-chart-canvas { display: block; width: 100%; max-height: 320px; border-radius: 6px; background: var(--card-bg,#1a2540); }
.heatmap-chart-read { font-size: 0.9rem; color: var(--text,#e8e8f0); margin-top: 0.5rem; line-height: 1.5; }
.heatmap-chart-provenance { font-size: 0.75rem; color: var(--text-muted,#666666); font-style: italic; margin-top: 0.4rem; }

/* ========================  Mobile Responsive Heatmap (C-6)  ============= */

@media (max-width: 480px) {
  .heatmap-section { padding: 0.5rem; }
  .heatmap-controls { flex-wrap: wrap; gap: 0.25rem; }
  .heatmap-controls button { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
}

/* ========================  Preview data banner (EW-4)  ================== */

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(251, 191, 36, 0.1);
  border-bottom: 1px solid #f59e0b;
  font-size: 0.85rem;
  color: #92400e;
}
.preview-banner a { color: #92400e; text-decoration: underline; }
.preview-banner button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #92400e;
  padding: 0 0.25rem;
}

/* Issue 7: Beta badge in navbar (replaces preview banner) */
.navbar-beta-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent, var(--accent));
  background: rgba(74, 111, 165, 0.15);
  border: 1px solid rgba(74, 111, 165, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 0.5rem;
  white-space: nowrap;
}

/* Issue 10: Scenario label in hero stats */
.hero-scenario-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted, #888);
  font-style: italic;
}

/* ========================  Phase 1 UX Quick Wins  ======================== */

/* Item 2: Hero info icon + tooltip (reuses prov-info-icon pattern) */
.hero-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  border: 1px solid var(--text-muted, #888);
  border-radius: 50%;
  cursor: help;
  position: relative;
  vertical-align: middle;
}
.hero-info-icon:hover, .hero-info-icon:focus {
  color: var(--accent, var(--accent));
  border-color: var(--accent, #6b9fd6);
}
.hero-info-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  max-width: 90vw;
  background: #ffffff;
  color: #e0e0e0;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.75rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  text-align: left;
  font-weight: normal;
  white-space: normal;
  pointer-events: auto;
}
.hero-info-icon:hover .hero-info-tooltip,
.hero-info-icon:focus .hero-info-tooltip {
  display: block;
}
.hero-info-tooltip a {
  color: #6b9eff;
  text-decoration: underline;
}

/* Item 3: Risk distribution colors */
.risk-high { color: #f87171; }
.risk-mod { color: #fbbf24; }
.risk-low { color: #34d399; }

/* Issue 9: Clickable risk distribution tiers */
.risk-tier-btn {
  cursor: pointer;
  transition: opacity 0.15s;
}
.risk-tier-btn:hover { opacity: 0.7; }
.risk-tier-active {
  text-decoration: underline;
  font-weight: 700;
  opacity: 1 !important;
}

/* Item 5: Card category label */
.card-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #888);
  background: rgba(0,0,0,0.04);
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
}

/* Item 7: Cross-page CTAs */
.section-cta {
  text-align: center;
  padding: 1rem 0;
  margin-bottom: 1rem;
}
.section-cta a {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(74, 111, 165, 0.15);
  color: var(--accent);
  border: 1px solid rgba(74, 111, 165, 0.3);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}
.section-cta a:hover {
  background: rgba(74, 111, 165, 0.25);
  border-color: rgba(74, 111, 165, 0.5);
}

/* Scenario status line under the bar */
.scenario-status-line {
  font-size: 0.82rem;
  color: var(--text-muted, #666666);
  font-style: italic;
  margin: 0.4rem 0 1rem;
  text-align: left;
}

/* Item 10: Section subtitle */
.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* Item 11: Closest to threshold badge */
.closest-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #f59e0b;
  font-weight: 500;
  white-space: nowrap;
}

/* Item 12: Proximity bar */
.proximity-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 0.5rem 0;
  overflow: hidden;
}
.proximity-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Item 13: Card methodology link */
.card-methodology-link {
  display: inline-block;
  font-size: 0.75rem;
  color: #6b7280;
  text-decoration: none;
  margin-top: 0.25rem;
}
.card-methodology-link:hover { color: var(--accent); text-decoration: underline; }

/* Circled info icon — reusable for info indicators */
.info-icon-circled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.6rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text-muted, #666666);
  border: 1px solid var(--text-muted, #666666);
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.2rem;
}

/* Item 14: Sidebar community link */
.sidebar-community-link {
  display: block;
  text-align: center;
  padding: 0.75rem;
  margin-top: 1rem;
  background: rgba(74, 111, 165, 0.15);
  border: 1px solid rgba(74, 111, 165, 0.3);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar-community-link:hover { background: rgba(74, 111, 165, 0.25); }

/* ====================  Phase 2 additions  ==================== */

/* A1: National summary statement */
.national-summary-container {
  margin: 0 0 1.5rem 0;
}
.national-summary {
  background: #ffffff;
  color: #1a1a1a;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.national-summary p {
  margin: 0;
}

/* B1: Metro search box */
.metro-search-container {
  margin-bottom: 1rem;
}
.metro-search-box {
  position: relative;
  display: flex;
  gap: 0.5rem;
  max-width: 500px;
}
#metro-search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--card-bg, #fff);
  color: var(--text, #222);
}
#metro-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.15);
}
#metro-search-btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}
#metro-search-btn:hover {
  background: #3a5a95;
}
.metro-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}
.metro-search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #f0f0f0);
  font-size: 0.9rem;
}
.metro-search-result-item:hover {
  background: rgba(74, 111, 165, 0.08);
}
.metro-search-result-item:last-child {
  border-bottom: none;
}
.metro-search-name {
  font-weight: 500;
}
.metro-search-score {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}
.metro-search-no-results {
  padding: 0.5rem 0.75rem;
  color: var(--text-muted, #888);
  font-size: 0.85rem;
  font-style: italic;
}
.metro-search-no-results a {
  color: var(--accent, #b85c1e);
  font-style: normal;
  text-decoration: underline;
  cursor: pointer;
}
.metro-search-fullname {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  margin-top: 0.1rem;
  white-space: normal;
  line-height: 1.2;
}

/* C3: Warning zone styling */
.monitored-card-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.status-badge.status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.monitored-note-warning {
  color: #d97706;
  font-style: italic;
}

/* E2: Compact mobile card variant */
@media (max-width: 767px) {
  .metric-card .card-why,
  .metric-card .card-read {
    display: none;
  }
  .metric-card.expanded .card-why,
  .metric-card.expanded .card-read {
    display: block;
  }
}

/* E3: Mobile scenario bar legibility */
@media (max-width: 767px) {
  .scenario-compact-grid {
    grid-template-columns: 1fr;
  }
  .monitored-grid {
    grid-template-columns: 1fr;
  }
  .scenario-toggles-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .monitored-caption {
    font-size: 0.8rem;
  }
}

/* B2: Sidebar national indicators section */
.metro-sidebar-national-section h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metro-sidebar-collapse-toggle {
  background: none;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1.4;
  color: var(--text-muted, #888);
}
.metro-sidebar-section-caption {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  margin: 0 0 0.5rem 0;
  font-style: italic;
}
.metro-sidebar-national-link {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
}
.metro-sidebar-national-link:hover {
  text-decoration: underline;
}

/* =====================  Context badge (J12)  ============================ */
.context-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(184,92,30,0.1);
  border-bottom: 1px solid rgba(184,92,30,0.25);
  font-size: 0.85rem;
  color: var(--text);
}
.context-badge-label {
  font-weight: 600;
  opacity: 0.7;
  font-size: 0.8rem;
}
.context-badge-item {
  color: var(--accent, #b85c1e);
  font-weight: 600;
}
.context-badge-sep {
  opacity: 0.4;
}
.context-badge-clear {
  margin-left: auto;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}
.context-badge-clear:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text);
}

/* =====================  Career assessment prompt (J1)  ================= */
#career-assessment-prompt {
  margin: 1.5rem 0 1rem;
}
.career-assessment-prompt {
  background: rgba(184,92,30,0.08);
  border: 1px solid rgba(184,92,30,0.3);
  border-radius: 8px;
  padding: 1rem 1.5rem;
}
.career-assessment-prompt.high {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.3);
}
.career-assessment-prompt h3 {
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.career-assessment-prompt p {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9rem;
  opacity: 0.85;
}
.assessment-cta {
  display: inline-block;
  font-weight: 600;
  color: var(--accent, #b85c1e);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid var(--accent, #b85c1e);
  border-radius: 6px;
  font-size: 0.9rem;
}
.assessment-cta:hover {
  background: rgba(184,92,30,0.15);
}

/* =====================  Community comparison + resources (J2)  ========= */
.community-comparison {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
}
.community-comparison h3 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 700;
}
.community-comparison-caption {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}
.community-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}
/* EP-5105-M2/R6: two-column metro-vs-national grid */
.community-comparison-grid-2col {
  grid-template-columns: 1fr;
  gap: 0;
}
.community-comparison-grid-2col .comparison-header,
.community-comparison-grid-2col .comparison-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
}
.community-comparison-grid-2col .comparison-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: transparent;
  border-radius: 0;
}
.community-comparison-grid-2col .comparison-row {
  border-bottom: 1px solid rgba(0,0,0,0.03);
  border-radius: 0;
  background: transparent;
  justify-content: unset;
}
.community-comparison-grid-2col .comparison-row:last-child {
  border-bottom: none;
}
.comparison-metro,
.comparison-national {
  font-weight: 600;
}
.comparison-national {
  opacity: 0.92;
}
.comparison-na {
  opacity: 0.55;
  font-weight: 400;
}
.comparison-confidence {
  font-style: italic;
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.7;
}
.comparison-methodology {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}
.comparison-methodology > summary {
  cursor: pointer;
  opacity: 0.75;
  font-size: 0.8rem;
  list-style: none;
}
.comparison-methodology > summary::before {
  content: "▸ ";
}
.comparison-methodology[open] > summary::before {
  content: "▾ ";
}
.comparison-methodology p {
  margin: 0.5rem 0 0;
  opacity: 0.78;
  line-height: 1.45;
}
.comparison-methodology code {
  font-size: 0.78rem;
}
@media (max-width: 600px) {
  .community-comparison-grid-2col .comparison-header,
  .community-comparison-grid-2col .comparison-row {
    grid-template-columns: 1fr 1fr;
  }
  .comparison-national {
    grid-column: 2 / -1;
  }
}
.comparison-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  font-size: 0.85rem;
}
.comparison-label {
  opacity: 0.8;
}
.comparison-value {
  font-weight: 600;
}
.community-resources {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
}
.community-resources h3 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 700;
}
.community-resources ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
}
.community-resources li {
  margin-bottom: 0.4rem;
}
.community-resources a {
  color: var(--accent, #b85c1e);
  text-decoration: none;
}
.community-resources a:hover {
  text-decoration: underline;
}

/* ===================== P1+P2 User Journey Enhancements ===================== */

/* P1-2: Deep-linking — no visual changes needed */

/* P1-4: Cite This dialog */
.cite-dialog-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.cite-dialog {
  background: var(--card-bg, #ffffff);
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  border: 1px solid var(--border, #d8d4cc);
}
.cite-dialog-close {
  position: absolute; top: 0.5rem; right: 0.75rem;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--text-muted, #666666);
}
.cite-dialog h3 { margin-top: 0; color: var(--accent, #6b9fd6); }
.cite-format-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.cite-format-tab {
  padding: 0.25rem 0.75rem; border: 1px solid var(--border, #d8d4cc); background: transparent;
  color: var(--text-secondary, #aaa); border-radius: 4px; cursor: pointer; font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.cite-format-tab:hover { background: rgba(107, 159, 214, 0.1); }
.cite-format-tab.active { background: var(--accent, #6b9fd6); color: var(--bg, #ffffff); border-color: var(--accent, #6b9fd6); }
.cite-text {
  width: 100%; background: rgba(0,0,0,0.2); color: var(--text, #1a1a1a);
  border: 1px solid var(--border, #d8d4cc); border-radius: 6px;
  padding: 0.75rem; font-size: 0.85rem; font-family: monospace;
  resize: vertical;
}
.cite-dialog-actions { margin-top: 0.75rem; display: flex; gap: 0.75rem; align-items: center; }
.cite-copy-btn { cursor: pointer; }
.cite-share-link { color: var(--accent, #6b9fd6); font-size: 0.85rem; }
.cite-permalink-label { font-size: 0.8rem; color: var(--text-muted, #666666); margin-top: 0.5rem; }
.cite-permalink {
  width: 100%; background: rgba(0,0,0,0.2); color: var(--text, #1a1a1a);
  border: 1px solid var(--border, #d8d4cc); border-radius: 4px;
  padding: 0.4rem; font-size: 0.8rem;
}

/* P1-1: Action guidance panel */
.action-guidance {
  margin-top: 1.5rem; padding: 1rem;
  border-radius: 8px; background: rgba(0,0,0,0.03);
  border: 1px solid var(--border, #d8d4cc);
}
.action-guidance-title { margin-top: 0; color: var(--accent, #6b9fd6); font-size: 1rem; }
.action-risk-badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 12px; font-size: 0.75rem; font-weight: 700;
  color: #1a1a1a; margin-bottom: 0.75rem;
}
.action-guidance h4 { font-size: 0.88rem; margin-top: 0.75rem; margin-bottom: 0.3rem; color: var(--text, #1a1a1a); }
.action-steps-list, .safe-careers-list, .reskilling-list {
  padding-left: 1.2rem; font-size: 0.82rem; line-height: 1.6;
}
.action-steps-list a, .safe-careers-list a, .reskilling-list a {
  color: var(--accent, #6b9fd6);
}
.action-reason { color: var(--text-muted, #666666); font-size: 0.78rem; }
.high-risk .action-guidance-title { color: #f87171; }
.moderate-risk .action-guidance-title { color: #fbbf24; }
.low-risk .action-guidance-title { color: #4ade80; }

/* Q9: Action guidance editorial disclosure (Credibility Audit RFC — P12) */
.action-disclosure { margin: 0.5rem 0 0.75rem; }
.action-disclosure summary {
  font-size: 0.78rem; color: var(--text-muted, #666666); cursor: pointer;
}
.action-disclosure p {
  font-size: 0.76rem; color: var(--text-muted, #666666);
  margin-top: 0.4rem; line-height: 1.5;
}

/* Pivot Paths section */
.pivot-paths-section {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px;
  background: rgba(107, 159, 214, 0.05);
}
.pivot-paths-title { margin-top: 0; color: var(--accent, #6b9fd6); font-size: 1rem; }
.pivot-paths-subtitle { font-size: 0.78rem; color: var(--text-muted, #666666); margin-bottom: 0.5rem; }
.pivot-paths-neighborhood-note { font-size: 0.78rem; color: var(--accent, #b85c1e); margin-bottom: 0.5rem; }
.pivot-paths-list { list-style: none; padding: 0; margin: 0; }
.pivot-path-item { padding: 0.5rem 0; border-bottom: 1px solid var(--border, #d8d4cc); }
.pivot-path-item:last-child { border-bottom: none; }
.pivot-path-link { color: var(--accent, #6b9fd6); text-decoration: none; font-weight: 500; }
.pivot-path-link:hover { text-decoration: underline; }
.pivot-path-similarity { font-size: 0.75rem; color: #4ade80; margin-left: 0.3rem; }
.pivot-path-exposure { font-size: 0.75rem; color: #4ade80; }
.pivot-path-meta { display: block; font-size: 0.72rem; color: var(--text-muted, #666666); margin-top: 0.15rem; }
.pivot-paths-note { font-size: 0.7rem; color: var(--text-muted, #666666); margin-top: 0.5rem; font-style: italic; }
.pivot-paths-empty { padding: 0.75rem; background: rgba(107, 159, 214, 0.05); border-radius: 6px; }
.pivot-paths-empty p { margin: 0; font-size: 0.82rem; color: var(--text-muted, #666666); }
.pivot-disclaimer { font-size: 0.75rem; color: var(--text-muted, #666666); margin-bottom: 0.5rem; }

/* F5: Career Neighborhood section */
.career-neighborhood-section {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px;
  background: rgba(74, 222, 128, 0.04);
}
.career-neighborhood-title { margin-top: 0; color: #4ade80; font-size: 1rem; }
.career-neighborhood-subtitle { font-size: 0.78rem; color: var(--text-muted, #666666); margin-bottom: 0.6rem; }
.career-neighborhood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.career-neighborhood-card {
  display: block;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.career-neighborhood-card:hover {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
}
.career-neighborhood-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.career-neighborhood-card-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent, #6b9fd6);
}
.career-neighborhood-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.career-neighborhood-badge.same-group { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.career-neighborhood-badge.cross-group { background: rgba(184, 92, 30, 0.15); color: #b85c1e; }
.career-neighborhood-card-scores {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}
.career-neighborhood-score { font-size: 0.73rem; color: var(--text-muted, #666666); }
.career-neighborhood-card-meta {
  font-size: 0.73rem;
  color: var(--text-muted, #666666);
  margin-bottom: 0.25rem;
}
.career-neighborhood-wage { font-weight: 500; color: var(--text, #1a1a1a); }
.career-neighborhood-delta { font-size: 0.7rem; }
.career-neighborhood-growth { color: #4ade80; }
.career-neighborhood-edu {
  font-size: 0.68rem;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  background: rgba(0,0,0,0.04);
}
.career-neighborhood-card-group { font-size: 0.68rem; color: var(--text-muted, #666666); }
.career-neighborhood-methodology { margin-top: 0.5rem; }
.career-neighborhood-methodology summary {
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-muted, #666666);
}
.career-neighborhood-methodology-text {
  font-size: 0.7rem;
  color: var(--text-muted, #666666);
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* F6: Grad school collapsible section */
.grad-school-section {
  margin: 1rem 0;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px;
  background: rgba(107, 159, 214, 0.04); /* AS9725-D4: subtle visual grouping with the adjacent occupations area */
  overflow: hidden;
}
.grad-school-toggle {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent, #b85c1e);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.grad-school-toggle:hover { background: rgba(184, 92, 30, 0.08); }
.grad-school-toggle .grad-school-chevron {
  font-size: 0.8rem;
  transition: transform 0.2s;
}
.grad-school-toggle.open .grad-school-chevron { transform: rotate(90deg); }
.grad-school-section.open .grad-school-content { display: block; }
.grad-school-content {
  padding: 0 1rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.grad-school-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.grad-school-card {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
}
.grad-school-card-title { font-weight: 600; font-size: 0.82rem; margin-bottom: 0.3rem; }
.grad-school-card-current .grad-school-card-title { color: var(--accent, #b85c1e); }
.grad-school-card-pivot .grad-school-card-title { color: #4ade80; }
.grad-school-card-list { list-style: none; padding: 0; margin: 0; font-size: 0.76rem; color: var(--text-muted, #666666); }
.grad-school-card-list li { padding: 0.15rem 0; }
.grad-school-note { font-size: 0.75rem; color: var(--text-muted, #666666); margin-top: 0.5rem; font-style: italic; }
@media (max-width: 600px) {
  .grad-school-comparison { grid-template-columns: 1fr; }
  .career-neighborhood-grid { grid-template-columns: 1fr; }
}

/* Risk Peak Window */
.risk-peak-window {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  font-size: 0.85rem;
}
.risk-peak-label { font-weight: 600; color: #f87171; }
.risk-peak-years { font-weight: 700; color: #f87171; font-size: 0.95rem; }
.risk-peak-context { color: var(--text-muted, #666666); font-size: 0.78rem; }
.risk-horizon-note { font-size: 0.72rem; color: var(--text-muted, #666666); margin-top: 0.4rem; font-style: italic; }

/* Cite This button */
.cite-this-btn {
  font-size: 0.75rem; padding: 0.2rem 0.5rem;
  border: 1px solid var(--border, #d8d4cc); border-radius: 4px;
  background: transparent; color: #595959;
  cursor: pointer; margin-right: 0.5rem; margin-top: 0.5rem;
  /* QA-016: was color #666 + opacity 0.7 (3.04:1 effective — WCAG-AA fail);
     #595959 at full opacity = 7.00:1 */
}
.cite-this-btn:hover { border-color: var(--accent-dark, #9e4d18); color: var(--accent-dark, #9e4d18); opacity: 1; }
.resource-actions { margin-top: 0.5rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.resource-read-external { font-size: 0.8rem; color: var(--accent, #6b9fd6); }
.resource-summary-toggle {
  font-size: 0.8rem; color: var(--accent, #6b9fd6);
  background: none; border: none; cursor: pointer; padding: 0;
  margin-top: 0.25rem;
}
.resource-summary-toggle:hover { text-decoration: underline; }

/* Feature 1+8: Non-blocking welcome banner (replaces blocking overlay) */
.welcome-banner {
  position: relative;
  background: var(--card-bg, #ffffff);
  border-bottom: 1px solid var(--accent, #6b9fd6);
  padding: 1rem 1.5rem 1.25rem;
  z-index: 100;
}
.welcome-banner-close {
  position: absolute; top: 0.5rem; right: 0.75rem;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--text-muted, #666666);
  line-height: 1; padding: 0.25rem;
}
.welcome-banner-close:hover { color: var(--text, #1a1a1a); }
.welcome-banner-title {
  margin: 0 0 0.25rem; font-size: 1.1rem; color: var(--accent, #6b9fd6);
}
.welcome-banner-subtitle {
  margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--text-muted, #666666);
}
.welcome-banner-tips {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem;
}
.welcome-tip {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text, #1a1a1a);
}
.welcome-tip-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--accent, #6b9fd6); color: #1a1a1a;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.welcome-tip-text a { color: var(--accent, #6b9fd6); }
.welcome-banner-personalize {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.welcome-banner-label { font-size: 0.8rem; color: var(--text-muted, #666666); }
.welcome-banner-input {
  padding: 0.35rem 0.6rem; font-size: 0.85rem; width: 100px;
  border: 1px solid var(--border, #d8d4cc); border-radius: 6px;
  background: rgba(0,0,0,0.2); color: var(--text, #1a1a1a); outline: none;
}
.welcome-banner-input:focus { border-color: var(--accent, #6b9fd6); }
.welcome-banner-btn {
  padding: 0.35rem 0.75rem; font-size: 0.82rem; font-weight: 600;
  border: none; border-radius: 6px; cursor: pointer;
  background: var(--accent, #6b9fd6); color: #1a1a1a;
}
.welcome-saved { font-size: 0.82rem; color: #4ade80; }
.welcome-saved a { color: var(--accent, #6b9fd6); }

/* Feature 2: Glossary tooltips */
.glossary-term {
  border-bottom: 1px dotted var(--accent, #6b9fd6);
  cursor: help; text-decoration: none;
  position: relative; display: inline;
}
.glossary-term:hover { color: var(--accent, #6b9fd6); }
.glossary-tooltip {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px; padding: 0.6rem 0.8rem;
  font-size: 0.8rem; line-height: 1.5;
  color: var(--text, #1a1a1a);
  min-width: 220px; max-width: 320px;
  z-index: 500; opacity: 0; visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.glossary-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--card-bg, #ffffff);
}
.glossary-term:hover .glossary-tooltip,
.glossary-term.active .glossary-tooltip {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.glossary-section {
  margin-top: 2rem; padding: 1rem;
  background: rgba(0,0,0,0.02); border-radius: 8px;
}
.glossary-section h2 { margin-top: 0; font-size: 1.1rem; color: var(--accent, #6b9fd6); }
.glossary-list { list-style: none; padding: 0; margin: 0; }
.glossary-list li {
  padding: 0.5rem 0; border-bottom: 1px solid var(--border, #d8d4cc);
  font-size: 0.85rem; line-height: 1.5;
}
.glossary-list li:last-child { border-bottom: none; }
.glossary-list strong { color: var(--accent, #6b9fd6); }

/* Feature 3: Action panel on community/national pages */
.community-action-panel {
  margin-top: 1.5rem; padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.03); border-radius: 8px;
  border-left: 3px solid var(--accent, #6b9fd6);
}
.community-action-panel h3 {
  margin: 0 0 0.5rem; font-size: 1rem; color: var(--accent, #6b9fd6);
}
.community-action-list { list-style: none; padding: 0; margin: 0; }
.community-action-list li {
  padding: 0.4rem 0; font-size: 0.85rem; line-height: 1.5;
}
.community-action-list a { color: var(--accent, #6b9fd6); }
.community-action-list a[target="_blank"]::after {
  content: ' \2197'; font-size: 0.75rem; opacity: 0.6;
}

/* Feature 5: Community preview card */
.community-preview-section {
  margin-top: 1.5rem; padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.02); border-radius: 8px;
  border: 1px solid var(--border, #d8d4cc);
}
.community-preview-section h3 {
  margin: 0 0 0.75rem; font-size: 1rem; color: var(--accent, #6b9fd6);
}
.community-resources-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.community-resources-list li {
  padding: 0.35rem 0; font-size: 0.84rem; line-height: 1.5;
}
.community-resources-list a { color: var(--accent, #6b9fd6); }
.community-discussions-preview {
  border-top: 1px solid var(--border, #d8d4cc); padding-top: 0.75rem;
}
.community-discussions-preview h4 {
  font-size: 0.88rem; margin: 0 0 0.5rem; color: var(--text, #1a1a1a);
}
.discussion-thread-preview {
  padding: 0.5rem; margin-bottom: 0.4rem;
  background: rgba(0,0,0,0.15); border-radius: 6px;
  font-size: 0.82rem; line-height: 1.4;
}
.discussion-thread-preview .thread-topic {
  color: var(--accent, #6b9fd6); font-weight: 600;
}
.discussion-thread-preview .thread-meta {
  font-size: 0.75rem; color: var(--text-muted, #666666); margin-top: 0.2rem;
}
.community-warn-widget {
  border-top: 1px solid var(--border, #d8d4cc); padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.community-warn-widget h4 {
  font-size: 0.88rem; margin: 0 0 0.4rem; color: var(--text, #1a1a1a);
}
.community-warn-empty {
  font-size: 0.82rem; color: #4ade80; font-style: italic;
}

/* Feature 6: Plain-English risk explanations */
.risk-explanation {
  padding: 0.6rem 0.8rem; margin: 0.5rem 0;
  background: rgba(0,0,0,0.03); border-radius: 6px;
  font-size: 0.85rem; line-height: 1.5;
  color: var(--text, #1a1a1a);
}

/* Gap 4: Worker-facing industry analysis */
.industry-comparison-section {
  padding: 0.6rem 0.8rem; margin: 0.5rem 0;
  background: rgba(0,0,0,0.03); border-radius: 6px;
  font-size: 0.85rem; line-height: 1.5;
  border-left: 3px solid var(--accent, #6b9fd6);
}
.industry-comparison-title {
  margin: 0 0 0.3rem; font-size: 0.95rem; color: var(--accent, #6b9fd6);
}
.industry-comparison-text {
  margin: 0 0 0.4rem; color: var(--text, #1a1a1a);
}
.industry-ratio {
  font-size: 0.8rem; color: var(--text-muted, #666666);
  margin: 0.3rem 0; padding: 0.3rem 0.4rem;
  border-left: 2px solid var(--border, #d8d4cc);
  line-height: 1.4;
}
.industry-checklist {
  list-style: none; padding: 0; margin: 0.4rem 0;
}
.industry-checklist li {
  padding: 0.3rem 0; border-bottom: 1px solid var(--border, #d8d4cc);
  font-size: 0.82rem; line-height: 1.4;
}
.industry-checklist li:last-child { border-bottom: none; }
.industry-comparison-link {
  margin: 0.4rem 0 0; font-size: 0.78rem;
}
.industry-comparison-link a {
  color: var(--accent, #b85c1e); text-decoration: underline;
}
.risk-explanation.low { border-left: 3px solid #4ade80; }
.risk-explanation.moderate { border-left: 3px solid #fbbf24; }
.risk-explanation.high { border-left: 3px solid #f87171; }
.risk-explanation.severe { border-left: 3px solid #dc2626; }
.risk-explanation.high-displacement { border-left: 3px solid #f87171; }
.risk-explanation.high-transformation { border-left: 3px solid #fbbf24; }
.risk-explanation.augmentation-dominant { border-left: 3px solid #4ade80; }
.risk-explanation.low-risk { border-left: 3px solid #4ade80; }
.risk-explanation.mixed { border-left: 3px solid #fbbf24; }
.risk-explanation details {
  margin-top: 0.4rem; font-size: 0.78rem; color: var(--text-muted, #666666);
}
.risk-explanation details summary {
  cursor: pointer; color: var(--accent, #6b9fd6); font-size: 0.78rem;
}
.risk-explanation details p { margin: 0.4rem 0 0; line-height: 1.5; }

/* Feature 7: 404 error recovery page */
.error-404-container {
  max-width: 640px; margin: 3rem auto; text-align: center;
  padding: 2rem;
}
.error-404-code {
  font-size: 3rem; font-weight: 800; color: var(--accent, #6b9fd6);
  margin-bottom: 0.5rem;
}
.error-404-message {
  font-size: 1.1rem; color: var(--text, #1a1a1a); margin-bottom: 1.5rem;
}
.error-404-search {
  display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem;
}
.error-404-search input {
  padding: 0.6rem 0.8rem; font-size: 0.9rem; width: 240px;
  border: 1px solid var(--border, #d8d4cc); border-radius: 6px;
  background: rgba(0,0,0,0.2); color: var(--text, #1a1a1a); outline: none;
}
.error-404-search input:focus { border-color: var(--accent, #6b9fd6); }
.error-404-search button {
  padding: 0.6rem 1.2rem; font-size: 0.9rem; font-weight: 600;
  border: none; border-radius: 6px; cursor: pointer;
  background: var(--accent, #6b9fd6); color: #1a1a1a;
}
.error-404-nav {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem; margin-top: 1.5rem;
}
.error-404-nav a {
  display: block; padding: 0.75rem 1rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px; color: var(--text, #1a1a1a);
  text-decoration: none; font-size: 0.88rem;
  transition: border-color 0.2s;
}
.error-404-nav a:hover { border-color: var(--accent, #6b9fd6); }
.error-404-nav a strong { display: block; color: var(--accent, #6b9fd6); font-size: 0.92rem; }

/* P1-9: Comparison tools */
.career-comparison-section {
  margin-top: 2rem; padding: 1rem;
  background: rgba(0,0,0,0.03); border-radius: 8px;
  border: 1px solid var(--border, #d8d4cc);
}
.comparison-controls {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem;
}
.comparison-controls input {
  flex: 1; min-width: 200px;
  padding: 0.4rem 0.6rem; border: 1px solid var(--accent, #6b9fd6);
  border-radius: 4px; background: rgba(0,0,0,0.04); color: inherit;
}
.comparison-selected-list { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.comp-chip {
  padding: 0.2rem 0.5rem; border-radius: 12px;
  background: rgba(107,159,214,0.15); border: 1px solid var(--accent, #6b9fd6);
  font-size: 0.8rem;
}
.comp-chip-remove { cursor: pointer; margin-left: 0.2rem; }
.comparison-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  margin-top: 0.5rem;
}
.comparison-table th, .comparison-table td {
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border, #d8d4cc);
  text-align: center;
}
.comparison-table th { background: rgba(0,0,0,0.04); font-weight: 600; }
.comparison-table .comparison-label {
  text-align: left; font-weight: 600; color: var(--text-muted, #666666);
}

/* P1-3: Data download */
.data-download-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin: 1rem 0;
}
.data-download-card {
  background: rgba(0,0,0,0.03); border-radius: 8px;
  padding: 1rem; border: 1px solid var(--border, #d8d4cc);
}
.data-download-card h4 { margin-top: 0; color: var(--accent, #6b9fd6); font-size: 0.95rem; }
.data-download-card p { font-size: 0.82rem; line-height: 1.5; margin-bottom: 0.5rem; }
.data-download-card .filter-btn { margin-right: 0.5rem; margin-bottom: 0.3rem; }

/* P1-5: Indicator-to-article mapping */
.indicator-mapping-section { margin: 2rem 0; }
.indicator-mapping-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem; margin-top: 1rem;
}
.indicator-mapping-card {
  background: var(--card-bg, #ffffff); border-radius: 8px;
  padding: 1rem; border: 1px solid var(--border, #d8d4cc);
}
.indicator-mapping-id {
  /* QA-011: demoted to a small secondary label below the plain-language title.
     QA-016: was --accent #b85c1e (3.82:1 on the pale-blue chip — WCAG-AA fail);
     #666666 = 4.79:1 here. */
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  background: rgba(107,159,214,0.2); color: var(--text-muted, #666666);
  margin-bottom: 0.3rem;
}
.indicator-mapping-name { font-size: 0.88rem; font-weight: 600; display: block; }
.indicator-mapping-articles {
  padding-left: 1rem; font-size: 0.8rem; line-height: 1.5; margin-top: 0.3rem;
}
.indicator-mapping-articles a { color: var(--accent, #6b9fd6); }
.indicator-mapping-link {
  display: block; margin-top: 0.5rem; font-size: 0.78rem;
  color: var(--accent, #6b9fd6);
}

/* P2-14: Social sharing */
.social-share-section {
  display: flex; align-items: center; gap: 0.4rem;
  margin: 1rem 0; padding: 0.5rem 0;
}
.social-share-label { font-size: 0.82rem; color: var(--text-muted, #666666); }
.social-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0,0,0,0.04); border: 1px solid var(--border, #d8d4cc);
  color: var(--text, #1a1a1a); font-size: 0.8rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.social-share-btn:hover {
  background: var(--accent, #6b9fd6); color: #1a1a1a; border-color: var(--accent, #6b9fd6);
}

/* P2-14: Press kit */
.press-kit-section { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border, #d8d4cc); }
.press-kit-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.press-kit-card {
  background: var(--card-bg, #ffffff); border-radius: 8px;
  padding: 1rem; border: 1px solid var(--border, #d8d4cc);
}
.press-kit-card h3 { margin-top: 0; color: var(--accent, #6b9fd6); font-size: 0.95rem; }
.press-kit-card p { font-size: 0.85rem; line-height: 1.5; }
.press-kit-card a { color: var(--accent, #6b9fd6); font-size: 0.82rem; }

/* P2-12: Subscribe */
.subscribe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; margin: 1rem 0;
}
.subscribe-card {
  background: var(--card-bg, #ffffff); border-radius: 8px;
  padding: 1rem; border: 1px solid var(--border, #d8d4cc);
}
.subscribe-card h3 { margin-top: 0; color: var(--accent, #6b9fd6); font-size: 0.95rem; }
.email-subscribe-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.email-subscribe-form input { flex: 1; min-width: 150px; }
.subscribe-status { font-size: 0.82rem; margin-top: 0.5rem; }

/* ========================  Metro Sidebar Enhancement (Phase 1)  ========= */

/* Metro title header */
.metro-sidebar-metro-title {
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}
.metro-sidebar-metro-title h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text, #1a1a2e);
}

/* Composite Impact Score container */
.metro-sidebar-impact-container {
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--card-bg, #fafafa);
}

.metro-sidebar-chart-caption {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted, #8a8aa0);
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* Impact score prominence header */
.metro-sidebar-impact-header {
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}

.metro-sidebar-impact-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.metro-sidebar-impact-score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.metro-sidebar-impact-score-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.metro-sidebar-impact-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.metro-sidebar-impact-badge {
  flex-shrink: 0;
}

.metro-sidebar-severity-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metro-sidebar-severity-badge.severity-high {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.metro-sidebar-severity-badge.severity-elevated {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.metro-sidebar-severity-badge.severity-moderate {
  background: rgba(74, 111, 165, 0.2);
  color: #6b9fd6;
  border: 1px solid rgba(74, 111, 165, 0.3);
}
.metro-sidebar-severity-badge.severity-low {
  background: rgba(42, 90, 58, 0.2);
  color: #4ade80;
  border: 1px solid rgba(42, 90, 58, 0.3);
}

.metro-sidebar-rank {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.metro-sidebar-rank strong {
  color: var(--text);
}

.metro-sidebar-percentile {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* RFC F3: Plain-language score interpretation */
.metro-sidebar-plain-summary {
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 0.5rem;
  color: var(--text);
  opacity: 0.85;
  padding: 0.5rem 0.6rem;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  border-left: 3px solid var(--accent, #b85c1e);
}

/* RFC F3: Inline metric context (comparison to national average) */
.metro-sidebar-metric-context {
  font-size: 0.78rem;
  color: var(--accent, #b85c1e);
  margin-top: 0.15rem;
  font-style: italic;
}

.metro-sidebar-sub-metrics {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Narrative callout box (shared base + sidebar metric why variant) */
.metro-narrative,
.metro-sidebar-metric-why {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted, #8a8aa0);
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent, #e8a33d);
  background: rgba(232, 163, 61, 0.05);
  border-radius: 0 4px 4px 0;
}

/* Unit label for key indicator metrics */
.metro-sidebar-metric-unit {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #8a8aa0);
  font-weight: 400;
  margin-top: 0.05rem;
  line-height: 1.3;
}

/* Per-metric cards in Key Indicators */
.metro-sidebar-metric-card {
  border: 1px solid var(--border, #e0ddd5);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--card-bg, #ffffff);
}

.metro-sidebar-metric-card:last-child {
  margin-bottom: 0;
}

.metro-sidebar-metric-card.null-data {
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.015);
}

.metro-sidebar-metric-card .metro-sidebar-metric-row {
  padding: 0;
  border-bottom: none;
}

/* Key Indicators outer container (mirrors impact-score block) */
.metro-sidebar-key-indicators-container {
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 10px;
  padding: 1rem;
  background: var(--card-bg, #fafafa);
}

.metro-sidebar-key-indicators-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  color: var(--text, #1a1a2e);
}

/* Generic sidebar sparkline component */
.metro-sidebar-sparkline {
  margin-top: 0.5rem;
  width: 100%;
  position: relative;
  overflow: visible;
}

.metro-sidebar-sparkline--large canvas,
.metro-sidebar-sparkline--large .metro-sidebar-sparkline-canvas {
  height: 60px;
}

.metro-sidebar-sparkline--compact canvas,
.metro-sidebar-sparkline--compact .metro-sidebar-sparkline-canvas {
  height: 50px;
}

.metro-sidebar-sparkline-canvas {
  display: block;
  width: 100%;
  border-radius: 4px;
}

/* Mini time-series charts in sidebar */
.metro-sidebar-mini-chart-container {
  margin: 0.25rem 0 0 0;
  padding-left: 0;
  width: 100%;
  position: relative;
  overflow: visible;
}

/* WARN events section */
.metro-sidebar-warn-chart-container {
  margin: 0.5rem 0;
  min-height: 80px;
}

.warn-limited-data-note {
  font-size: 0.75rem;
  color: var(--text-muted, #8a8aa0);
  margin: 0.35rem 0 0 0;
  font-style: italic;
}

.metro-sidebar-warn-event {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.metro-sidebar-warn-event:last-child {
  border-bottom: none;
}

.metro-sidebar-warn-company {
  font-weight: 600;
  color: var(--text);
}

.metro-sidebar-warn-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.metro-sidebar-warn-date {
  color: var(--text-muted);
}

.metro-sidebar-warn-more {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Local research section */
.metro-sidebar-research-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.metro-sidebar-research-item:last-child {
  border-bottom: none;
}

.metro-sidebar-research-title {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.35;
}

.metro-sidebar-research-title:hover {
  text-decoration: underline;
}

.metro-sidebar-research-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.metro-sidebar-research-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

/* ========================  Community Page Panels (Phase 2)  =========== */

.community-metro-panels {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.community-panel-header {
  margin-bottom: 1rem;
}

.community-panel-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.community-panel-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.community-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.community-panel-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.community-panel-card.available {
  border-left: 3px solid var(--accent);
}

.community-panel-card.national-fallback {
  border-left: 3px solid var(--text-muted);
  opacity: 0.85;
}

.community-panel-card.proxy-fallback {
  border-left: 3px solid #6b9fd6;
  opacity: 0.9;
}

.community-panel-card .card-proxy-label {
  font-size: 0.72rem;
  color: #6b9fd6;
  margin-top: 0.25rem;
  font-style: italic;
}

.community-panel-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.community-panel-card .card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.community-panel-card .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.community-panel-card .card-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.community-panel-card .card-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.community-panel-card .card-national-value {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.community-panel-card .card-why {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.5rem;
}

.community-panel-card canvas {
  width: 100%;
  height: 60px;
  margin: 0.5rem 0;
}

.community-panel-card .card-source {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.community-panel-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .community-panel-grid {
    grid-template-columns: 1fr;
  }
}

/* Gap 5: Your Action Plan */
.action-plan {
  margin-top: 1.5rem; padding: 1rem; border-radius: 8px;
  background: rgba(107,159,214,0.06); border: 1px solid rgba(107,159,214,0.15);
}
.action-plan-title { margin-top: 0; color: var(--accent, #6b9fd6); font-size: 1rem; }
.action-plan-subtitle { font-size: 0.78rem; opacity: 0.6; margin-top: 0.25rem; margin-bottom: 0.75rem; }
.action-plan-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.action-plan-step {
  display: flex; gap: 0.75rem; margin-bottom: 0.75rem; align-items: flex-start;
}
.action-plan-number {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent, #6b9fd6); color: var(--bg, #ffffff);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600;
}
.action-plan-content { flex: 1; font-size: 0.82rem; line-height: 1.5; color: var(--text, #1a1a1a); }
.action-plan-content strong { color: var(--text, #1a1a1a); }
.action-plan-content a { color: var(--accent, #6b9fd6); }
.action-plan-loading { margin-top: 1.5rem; padding: 1rem; border-radius: 8px; background: rgba(107,159,214,0.06); border: 1px solid rgba(107,159,214,0.15); }
.action-plan-loading .action-plan-subtitle { opacity: 0.5; }
.action-plan .no-data { font-size: 0.82rem; opacity: 0.6; font-style: italic; }

/* Gap 5: Mobile readability for action plan */
@media (max-width: 640px) {
  .action-plan-content { font-size: 0.88rem; line-height: 1.5; }
  .action-plan-number { font-size: 0.9rem; width: 24px; height: 24px; }
}

/* Gap 1: Taxonomy banner for alias-matched searches */
.taxonomy-banner {
  background: rgba(184, 92, 30, 0.08);
  border-left: 3px solid var(--accent, #b85c1e);
  padding: 0.75rem 1rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text, #1a1a1a);
}
.taxonomy-banner p { margin: 0; }
.taxonomy-banner a { color: var(--accent, #6b9fd6); }
.taxonomy-banner strong { color: var(--text, #1a1a1a); }

/* Gap 3: Community reframe — curated stories + coming-soon */
.community-stories-section { margin-top: 1.5rem; }
.stories-intro { font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.75rem; }
.story-filters { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.story-filter-select {
  padding: 0.4rem 0.6rem; border-radius: 4px; border: 1px solid var(--border, #d8d4cc);
  background: var(--bg, #ffffff); color: var(--text, #1a1a1a); font-size: 0.82rem;
}
.story-list { display: flex; flex-direction: column; gap: 0.75rem; }
.story-card {
  padding: 0.85rem 1rem; border-radius: 8px;
  background: rgba(107,159,214,0.04); border: 1px solid rgba(107,159,214,0.12);
}
.story-title { font-weight: 600; font-size: 0.9rem; color: var(--text, #1a1a1a); margin-bottom: 0.25rem; }
.story-meta { font-size: 0.78rem; opacity: 0.6; margin-bottom: 0.4rem; }
.story-body { font-size: 0.84rem; line-height: 1.5; color: var(--text, #1a1a1a); margin: 0 0 0.35rem 0; }
.story-author { font-size: 0.78rem; opacity: 0.55; }
.community-coming-soon {
  margin-top: 1.5rem; padding: 1.25rem; border-radius: 8px;
  background: rgba(184,92,30,0.06); border: 1px solid rgba(184,92,30,0.15);
}
.community-coming-soon h4 { margin-top: 0; color: var(--accent, #b85c1e); }
.community-coming-soon p { font-size: 0.85rem; line-height: 1.5; }
.community-signup-form { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.community-signup-input {
  flex: 1; padding: 0.5rem 0.75rem; border-radius: 4px;
  border: 1px solid var(--border, #d8d4cc); background: var(--bg, #ffffff);
  color: var(--text, #1a1a1a); font-size: 0.85rem;
}
.community-signup-btn {
  padding: 0.5rem 1rem; border-radius: 4px; border: none;
  background: var(--accent, #6b9fd6); color: var(--bg, #ffffff);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.community-signup-btn:disabled { opacity: 0.5; cursor: default; }
.community-signup-note { font-size: 0.78rem; opacity: 0.55; margin-top: 0.4rem; }

/* Gap 6: Salary personalization */
.salary-input-section { margin-bottom: 1rem; }
.salary-label { font-size: 0.85rem; color: var(--text, #1a1a1a); display: block; margin-bottom: 0.4rem; }
.salary-input-wrapper { display: flex; align-items: center; gap: 0.25rem; }
.salary-prefix { font-size: 0.9rem; opacity: 0.7; }
.salary-input-field {
  width: 120px; padding: 0.4rem 0.6rem; border-radius: 4px;
  border: 1px solid var(--border, #d8d4cc); background: var(--bg, #ffffff);
  color: var(--text, #1a1a1a); font-size: 0.85rem;
}
.salary-helper { font-size: 0.78rem; opacity: 0.55; line-height: 1.4; margin-top: 0.4rem; }
.salary-comparison-row { font-size: 0.82rem; line-height: 1.5; margin-top: 0.6rem; padding: 0.5rem 0.75rem; border-radius: 6px; background: rgba(107,159,214,0.04); }
.salary-comparison-row strong { color: var(--text, #1a1a1a); }
.salary-comparison-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.78rem; }
.salary-comparison-table th { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border, #d8d4cc); color: var(--text-muted, #666666); font-weight: 600; }
.salary-comparison-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid rgba(0,0,0,0.04); }

/* Gap 7: 90-Day Plan */
.ninety-day-plan {
  margin-top: 1.5rem; padding: 1rem; border-radius: 8px;
  background: rgba(74,222,128,0.04); border: 1px solid rgba(74,222,128,0.12);
}
.ninety-day-plan .plan-title { margin-top: 0; color: #4ade80; font-size: 1rem; }
.ninety-day-plan .plan-subtitle { font-size: 0.78rem; opacity: 0.6; margin-top: 0.25rem; margin-bottom: 0.75rem; }
.ninety-day-plan .plan-location-note { font-size: 0.78rem; opacity: 0.6; margin-bottom: 0.75rem; }
.ninety-day-plan .plan-section { margin-bottom: 0.75rem; }
.ninety-day-plan .plan-section-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--accent, #6b9fd6); }
.ninety-day-plan .plan-action-list { list-style: none; padding: 0; margin: 0; }
.ninety-day-plan .plan-action-list li {
  font-size: 0.82rem; line-height: 1.5; padding: 0.3rem 0 0.3rem 1.1rem;
  position: relative; color: var(--text, #1a1a1a);
}
.ninety-day-plan .plan-action-list li::before {
  content: '\2022'; position: absolute; left: 0; color: #4ade80; font-size: 0.9rem;
}

/* Gap 3d: PUMA score interpretation */
.puma-interpretation-section { margin-top: 0.75rem; }
.puma-interpretation { font-size: 0.78rem; line-height: 1.4; opacity: 0.75; margin-bottom: 0.4rem; }
.puma-interpretation strong { color: var(--text, #1a1a1a); }

/* Gap 1: Fallback states for data-driven components */
.fallback-banner { padding: 1rem; border-radius: 6px; margin: 0.5rem 0; }
.fallback-banner em { font-style: italic; opacity: 0.85; }
.fallback-stale { background: rgba(251,191,36,0.08); border: 1px dashed rgba(251,191,36,0.3); }
.fallback-stale .fallback-retry-btn { margin-left: 0.5rem; padding: 0.2rem 0.6rem; font-size: 0.82rem; border: 1px solid rgba(251,191,36,0.5); border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
.fallback-no-cache { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); }
.fallback-no-cache .fallback-retry-btn { margin-left: 0.5rem; padding: 0.2rem 0.6rem; font-size: 0.82rem; border: 1px solid rgba(248,113,113,0.4); border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
.fallback-empty-result { background: rgba(74,222,128,0.05); border: 1px solid rgba(74,222,128,0.15); }
/* Gap 1: Global health indicator */
/* Gap 3: "What Should I Do?" nav link */
.nav-action-link {
  font-weight: 600;
  color: var(--accent, #b85c1e);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent, #b85c1e);
  border-radius: 6px;
  margin-left: 0.5rem;
  text-decoration: none;
  display: inline-block;
  font-size: 0.85rem;
}
.nav-action-link:hover { background: rgba(184,92,30,0.15); }

/* FIX-4: Primary homepage CTA (formerly action.html, now career.html) */
.home-cta-section {
  margin: 1.5rem 0 2rem;
}
.home-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--accent, #b85c1e);
  border-radius: 10px;
  background: rgba(184, 92, 30, 0.06);
}
.home-cta-copy { flex: 1 1 auto; }
.home-cta-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text, #1a1a1a);
}
.home-cta-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted, #666666);
  margin: 0;
  line-height: 1.5;
}
.home-cta-button {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent, #b85c1e);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.home-cta-button:hover { background: #f0b558; }
.home-cta-button:active { transform: scale(0.98); }

@media (max-width: 640px) {
  .home-cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .home-cta-button { text-align: center; }
}

/* Gap 2: Safe-pocket badge */
.safe-pocket-badge {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: #4ade80;
}

/* Gap 4: Augmentation-to-displacement ratio badge */
.aug-disp-ratio-badge {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: #4ade80;
}
.aug-disp-ratio-displacement {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
  color: #f87171;
}
.ratio-tooltip {
  color: var(--text-muted, #666666);
  cursor: help;
  font-size: 0.75rem;
}

/* Gap 5b: Tiered Local Resources */
.resources-tier-toggle {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  background: var(--bg, #ffffff);
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 6px;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}
.resources-tier-toggle:hover { background: rgba(184,92,30,0.08); }
.resources-tier-toggle.open { background: rgba(184,92,30,0.12); }
.resources-tier-content {
  list-style: none;
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 0 0 0.5rem 0;
}
.resources-tier-content li { padding: 0.2rem 0; font-size: 0.85rem; }
.resources-tier-content a { color: var(--accent, #b85c1e); text-decoration: none; }

/* Gap 3: Risk badges for adjacent occupations table */
.risk-badge-green { display:inline-block; padding:1px 6px; border-radius:8px; font-size:0.72rem; background:rgba(74,222,128,0.15); color:#4ade80; }
.risk-badge-yellow { display:inline-block; padding:1px 6px; border-radius:8px; font-size:0.72rem; background:rgba(251,191,36,0.15); color:#fbbf24; }
.risk-badge-red { display:inline-block; padding:1px 6px; border-radius:8px; font-size:0.72rem; background:rgba(248,113,113,0.15); color:#f87171; }
.resources-tier-content a:hover { text-decoration: underline; }

/* Q3: Skeleton number placeholder (RFC: Credibility & Authority Audit — P5)
 * Fixed-height block with tabular-nums so numbers don't reflow on arrival.
 * Subtle shimmer animation; no text content while loading.
 * — is reserved exclusively for "not available". */
.skeleton-num {
  display: inline-block;
  min-height: 1em;
  min-width: 2.5em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(
    90deg,
    var(--bg-alt, #f0ece4) 0%,
    var(--border, #d8d4cc) 50%,
    var(--bg-alt, #f0ece4) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 3px;
  vertical-align: baseline;
}
@keyframes skeleton-shimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -200% 0; }
}
/* Reduce motion preference: disable the shimmer */
@media (prefers-reduced-motion: reduce) {
  .skeleton-num { animation: none; }
}

/* Q3: Legend line for "— = not available" under metrics strips */
.metrics-legend {
  font-family: var(--mono-font, 'SF Mono', Consolas, monospace);
  font-size: 11px;
  color: var(--text-muted, #666666);
  margin: 0.5rem 0 0 0;
  padding: 0;
}

/* Q1: Publisher site footer (RFC: Credibility & Authority Audit — P11) */
.site-footer {
  border-top: 1px solid var(--border, #d8d4cc);
  padding: 1.5rem 0;
  margin-top: 2rem;
}
.site-footer-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: var(--body-font, Georgia, 'Times New Roman', serif);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted, #666666);
  text-align: left;
}
.site-footer p {
  margin: 0 0 0.4rem 0;
}
.site-footer-publisher strong {
  color: var(--text, #1a1a1a);
}
.site-footer a {
  color: var(--accent, #6b9fd6);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}
.site-footer-citation {
  border-left: 2px solid var(--border, #d8d4cc);
  padding-left: 0.75rem;
  margin-top: 0.5rem;
}
.site-footer-citation-label {
  font-weight: 600;
}
.site-footer-citation-text {
  font-family: monospace;
  font-size: 0.85em;
}
.site-footer-byline {
  color: var(--text-muted, #666666);
}
.site-footer-licence {
  font-size: 0.85em;
  opacity: 0.85;
}

/* Q3: Skeleton placeholder for loading numbers (RFC: Credibility & Authority Audit — P5) */
.skeleton-num {
  display: inline-block;
  min-height: 1em;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
  background: var(--accent-light, rgba(107, 159, 214, 0.15));
  border-radius: 3px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  vertical-align: baseline;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}
/* Legend for em-dash = not available */
.na-legend {
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--text-muted, #666666);
  margin-top: 0.4rem;
  font-style: italic;
}

/* Q4: Browse table foot note (RFC: Credibility & Authority Audit — P6) */
.table-foot-note {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted, #666666);
  padding: 0.4rem 0.5rem;
  border-top: 1px solid var(--border, #d8d4cc);
  text-align: left;
}

/* Q7: Unit + vintage sub-line on career table headers (RFC: Credibility & Authority Audit — P8) */
.th-unit {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted, #666666);
  font-weight: 400;
  line-height: 1.3;
  margin-top: 0.1rem;
}

/* Q11: Legal review date line (RFC: Credibility & Authority Audit — P3) */
.legal-review-date {
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--text-muted, #666666);
  margin: 0.3rem 0 0.5rem;
}
.legal-reviewed-inline {
  font-size: 0.78rem;
  font-family: monospace;
  color: var(--text-muted, #666666);
}

/* Q12: Citation block + download licence (RFC: Credibility & Authority Audit — P2) */
.citation-block {
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-alt, #16162e);
}
.citation-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin: 0 0 0.3rem;
}
.citation-text {
  font-size: 0.82rem;
  font-family: monospace;
  color: var(--text, #1a1a1a);
  margin: 0 0 0.4rem;
  line-height: 1.5;
}
.citation-licence {
  font-size: 0.72rem;
  color: var(--text-muted, #666666);
  margin: 0;
}
.download-licence {
  font-size: 0.68rem;
  font-family: monospace;
  color: var(--text-muted, #666666);
  margin: 0.4rem 0 0;
}

/* M1: Source-note provenance component (RFC: Credibility & Authority Audit — P1, P6) */
.source-note {
  margin: 0.3rem 0;
}
.source-note summary {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted, #666666);
  cursor: pointer;
  line-height: 1.3;
}
.source-note summary:hover {
  color: var(--text, #1a1a1a);
}
.source-note-expanded {
  margin-top: 0.4rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border, #d8d4cc);
}
.source-note-field {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted, #666666);
  line-height: 1.5;
}
.source-note-label {
  font-weight: 600;
  color: var(--text, #1a1a1a);
}
.source-note a {
  color: var(--accent, #b85c1e);
  text-decoration: none;
}

/* M11 (Credibility Audit RFC): Stale/error state layer — three-state contract
 * for all metric mounts: fresh, stale (dimmed + "as of"), never-loaded. */
.stale-value {
  opacity: 0.7;
}
.stale-value::after {
  content: attr(data-stale-note);
  display: block;
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--text-muted, #666666);
  margin-top: 0.2rem;
  font-style: italic;
}
.never-loaded {
  opacity: 0.5;
}
.never-loaded-value {
  font-size: 0.85rem;
  color: var(--text-muted, #666666);
  font-style: italic;
}
.never-loaded-reason {
  font-size: 0.72rem;
  color: var(--text-muted, #666666);
  font-family: monospace;
}
.error-state-banner {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--error-border, #e74c3c);
  background: var(--error-bg, #fdf0f0);
  color: var(--error-text, #f87171);
  border-radius: 4px;
  font-size: 0.82rem;
  margin: 0.5rem 0;
}

/* =====================  Scenario-as-Lens styles  ======================== */

/* DEC-34: the .mode-odds button odds labels were removed with the
   scenario map tabs (odds were already hidden per DEC-01). */

/* Browsable indicator list section */
.indicator-list-section {
  margin-top: 1.5rem;
}
.indicator-list-section .section-header {
  margin-bottom: 0.25rem;
}

/* Indicator groups */
.indicator-group {
  margin-bottom: 1.25rem;
}
.indicator-group-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border, #d8d4cc);
}
.indicator-group-count {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted, #888);
}
.indicator-group-triggered .indicator-group-title {
  color: #dc2626;
}
.indicator-group-approaching .indicator-group-title {
  color: #d97706;
}
.indicator-group-quiet .indicator-group-title {
  color: var(--text-muted, #888);
}

/* Individual indicator rows */
.indicator-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border, #e8e4dc);
}
.indicator-row:last-child {
  border-bottom: none;
}
.indicator-row-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.indicator-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.indicator-scenario-tag {
  font-size: 0.78rem;
  color: var(--text-muted, #666);
  font-style: italic;
  white-space: nowrap;
}
.indicator-value-line {
  font-size: 0.85rem;
  margin: 0.15rem 0 0.25rem;
  color: var(--text, #1a1a1a);
}
.indicator-value-status {
  font-weight: 600;
  font-size: 0.82rem;
}
.indicator-value-status.indicator-triggered {
  color: #dc2626;
}
.indicator-value-status.indicator-approaching {
  color: #d97706;
}
.indicator-value-status.indicator-quiet {
  color: var(--text-muted, #888);
}
.indicator-summary {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
  margin: 0.2rem 0 0;
  line-height: 1.35;
}

/* Flow diagram link below the indicator list */
.indicator-list-flow-link a {
  color: var(--accent, #b85c1e);
  text-decoration: none;
}
.indicator-list-flow-link a:hover {
  text-decoration: underline;
}

/* ===========================  Occupation Impact  ======================== */
/* Design handoff: National Pulse — Occupation Impact Section (Aug 2026) */

.occ-impact {
  margin: 0 -0.5rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
}

.occ-impact-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0465af;
}

.occ-impact h2.occ-impact-title {
  font-size: 30px;
  font-weight: 700;
  margin: 8px 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.occ-impact-subtitle {
  font-size: 15px;
  line-height: 1.55;
  color: #494e52;
  max-width: 720px;
  margin: 0 0 22px;
}

/* Category filter chips */
.occ-impact-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.occ-impact-chip {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid #d5d8db;
  background: white;
  color: #373b40;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.occ-impact-chip:hover {
  border-color: #dfe1e4;
  background: #f6f9fb;
}
.occ-impact-chip.active {
  border-color: #0065b4;
  background: #0065b4;
  color: white;
}

/* 3-column grid of ranked list cards */
.occ-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.occ-impact-card {
  background: white;
  border: 1px solid #dfe1e4;
  border-radius: 10px;
  overflow: hidden;
}

.occ-impact-card-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid #e5e8eb;
}
.occ-impact-card-title {
  font-size: 14px;
  font-weight: 700;
}
.occ-impact-card-subtitle {
  font-size: 12px;
  color: #5f6469;
  margin-top: 3px;
  line-height: 1.4;
}

/* Ranked list rows */
.occ-impact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #eceff1;
  padding: 12px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}
.occ-impact-row:last-child {
  border-bottom: none;
}
.occ-impact-row:hover {
  background: #f6f9fb;
}

.occ-impact-rank {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  color: #8b9095;
  width: 16px;
  flex-shrink: 0;
  text-align: right;
}

.occ-impact-row-body {
  flex: 1;
  min-width: 0;
}

.occ-impact-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #141b24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.occ-impact-row-meta {
  font-size: 11.5px;
  color: #6d7277;
  margin-top: 2px;
}

.occ-impact-badge {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* Risk color coding for badges */
.occ-badge-low { background: #d0f7d6; color: #00410e; }
.occ-badge-mod { background: #ffe7b7; color: #603900; }
.occ-badge-high { background: #ffd7d0; color: #892122; }

/* Augmentation color coding (teal scale) */
.occ-badge-aug-low { background: #ddf0f0; color: #004447; }
.occ-badge-aug-mid { background: #bfeff2; color: #005055; }
.occ-badge-aug-high { background: #a6edf0; color: #004a53; }

.occ-impact-footnote {
  margin-top: 18px;
  font-size: 13px;
  color: #5f6469;
}
.occ-impact-footnote a {
  color: #0065b4;
  text-decoration: none;
}
.occ-impact-footnote a:hover {
  color: #004c9f;
}

/* Occupation detail sidebar (overlay) */
.occ-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 22, 26, 0.45);
  z-index: 5000;
  animation: occ-fade-in 0.15s ease;
}
@keyframes occ-fade-in { from { opacity: 0; } to { opacity: 1; } }

.occ-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 92vw;
  background: white;
  z-index: 5001;
  box-shadow: -12px 0 32px rgba(19, 22, 26, 0.12);
  overflow-y: auto;
  animation: occ-slide-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
@keyframes occ-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.occ-sidebar-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5e8eb;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.occ-sidebar-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.occ-sidebar-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0465af;
}

.occ-sidebar-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.25;
}

.occ-sidebar-close {
  background: #f0f2f4;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  color: #44484d;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.occ-sidebar-close:hover {
  background: #e9ebee;
}

.occ-sidebar-source-note {
  font-size: 12.5px;
  color: #595e63;
  margin-top: 10px;
  line-height: 1.4;
}

.occ-sidebar-body {
  padding: 20px 24px;
}

.occ-sidebar-section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5f6469;
  margin-bottom: 12px;
}

/* Score bars */
.occ-score-bar {
  margin-bottom: 12px;
}
.occ-score-bar:last-child { margin-bottom: 0; }

.occ-score-bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
}
.occ-score-bar-label { font-weight: 500; }
.occ-score-bar-value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 600;
}

.occ-score-bar-track {
  height: 7px;
  background: #e9ebee;
  border-radius: 4px;
  overflow: hidden;
}
.occ-score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.occ-fill-exposure { background: #0065b4; }
.occ-fill-displacement { background: #c53637; }
.occ-fill-augmentation { background: #008892; }

/* Risk-colored fills for exposure/displacement bars */
.occ-fill-risk-low { background: #319751; }
.occ-fill-risk-mod { background: #ce9200; }
.occ-fill-risk-high { background: #c53637; }

/* 6-quarter trend chart box */
.occ-trend-box {
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  padding: 14px 14px 10px;
  margin-bottom: 26px;
}

.occ-trend-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 11px;
  color: #51565b;
}
.occ-trend-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}

/* Workforce stat grid */
.occ-workforce-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 26px;
}

.occ-workforce-cell {
  background: #f3f5f8;
  border-radius: 8px;
  padding: 12px 14px;
}
.occ-workforce-label {
  font-size: 11px;
  color: #5f6469;
}
.occ-workforce-value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 600;
  margin-top: 3px;
}

/* CTA button */
.occ-sidebar-cta {
  display: block;
  text-align: center;
  background: #0065b4;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.occ-sidebar-cta:hover {
  background: #004c9f;
}

/* Skeleton loading state */
.occ-impact-skeleton {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #eceff1;
}
.occ-impact-skeleton-bar {
  height: 14px;
  background: #eceff1;
  border-radius: 4px;
  animation: occ-shimmer 1.5s infinite ease-in-out;
}
@keyframes occ-shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 900px) {
  .occ-impact-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
@media (max-width: 767px) {
  .occ-impact {
    padding: 0.5rem;
  }
  .occ-impact h2.occ-impact-title {
    font-size: 24px;
  }
  .occ-impact-chips {
    margin-bottom: 20px;
  }
  .occ-sidebar {
    width: 100%;
    max-width: 100vw;
  }
}

/* Responsive: indicator list on mobile */
@media (max-width: 767px) {
  .indicator-row-head {
    flex-direction: column;
    gap: 0.15rem;
  }
  .indicator-scenario-tag {
    white-space: normal;
  }
}

/* Contact page form (contact.html) */
.contact-form {
  max-width: 560px;
  margin: 1.5rem 0 0 0;
}
.contact-field {
  margin-bottom: 1rem;
}
.contact-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.95em;
}
.contact-field input,
.contact-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: var(--radius, 6px);
  font: inherit;
  background: var(--card-bg, #ffffff);
  color: var(--text, #1a1a1a);
}
.contact-field input:focus,
.contact-field textarea:focus {
  outline: 2px solid var(--accent, #6b9fd6);
  outline-offset: 1px;
}
.contact-req { color: #dc2626; }
.contact-opt { color: var(--text-muted, #666666); font-weight: 400; }
/* Honeypot: off-screen, NOT display:none (bots skip hidden fields). */
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-actions { margin-top: 1.25rem; }
.contact-actions button {
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius, 6px);
  background: var(--accent, #6b9fd6);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.contact-actions button:disabled { opacity: 0.6; cursor: default; }
.contact-status { margin-top: 0.9rem; font-size: 0.95em; min-height: 1.2em; }
.contact-status-ok { color: #15803d; }
.contact-status-error { color: #dc2626; }
.contact-note { font-size: 0.85em; color: var(--text-muted, #666666); margin-top: 1.5rem; }

/* ==========================================================================
 * UI overhaul shared components (frontend/uicomp.js) — .uicomp-* classes.
  * Used by the metric card, data states, interval displays, severity scale
 * and what-changed note. One definition here so every page matches.
 * ========================================================================== */

/* Provenance badge (measured / derived / modeled) */
.uicomp-prov {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.uicomp-prov-measured { color: #2d7a3f; background: rgba(45, 122, 63, 0.1); }
.uicomp-prov-derived  { color: #9a5b0b; background: rgba(184, 134, 11, 0.12); }
.uicomp-prov-modeled  { color: #6d28a8; background: rgba(109, 40, 168, 0.1); }

/* Card extras */
.uicomp-card-source { font-size: 0.78rem; color: var(--text-muted, #666666); margin: 0.15rem 0 0.6rem; }
.uicomp-card-period { font-size: 0.78rem; color: var(--text-muted, #666666); margin-left: 0.5rem; }
.uicomp-card-why { font-size: 0.85rem; margin: 0.6rem 0 0.2rem; }
.uicomp-card-link { font-size: 0.8rem; margin: 0.4rem 0 0; }
.uicomp-card-error { border-color: var(--error-border, #e74c3c); }

/* Data states — never a bare blank or "--%" */
.uicomp-state-msg { font-size: 0.85rem; color: var(--text-muted, #666666); margin: 0.4rem 0; }
.uicomp-skeleton { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.4rem 0; }
.uicomp-skeleton-line {
  display: block; height: 0.85rem; border-radius: 4px; width: 85%;
  background: linear-gradient(90deg, #e8e4dc 25%, #f3efe8 50%, #e8e4dc 75%);
  background-size: 200% 100%;
  animation: uicomp-shimmer 1.4s ease infinite;
}
.uicomp-skeleton-short { width: 55%; }
@keyframes uicomp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .uicomp-skeleton-line { animation: none; }
}

/* Interval display: whisker (points) and band (series) */
.uicomp-interval-wrap { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0; flex-wrap: wrap; }
.uicomp-whisker-line, .uicomp-whisker-cap { stroke: var(--accent, #b85c1e); stroke-width: 1.5; }
.uicomp-whisker-dot { fill: var(--accent-dark, #9e4d18); }
.uicomp-whisker-neutral .uicomp-whisker-line,
.uicomp-whisker-neutral .uicomp-whisker-cap { stroke: #8a8a8a; }
.uicomp-whisker-neutral .uicomp-whisker-dot { fill: #8a8a8a; }
.uicomp-interval { font-size: 0.76rem; color: var(--text-muted, #666666); }
.uicomp-interval-neutral { color: #6f6f6f; font-style: italic; }
.uicomp-band-area { fill: rgba(184, 92, 30, 0.18); stroke: none; }
.uicomp-band-line { fill: none; stroke: var(--accent, #b85c1e); stroke-width: 2; }
.uicomp-band-dot { fill: var(--accent-dark, #9e4d18); }
.uicomp-band-xlabel { font-size: 10px; fill: var(--text-muted, #666666); }
.uicomp-band-neutral .uicomp-band-area { fill: rgba(138, 138, 138, 0.2); }
.uicomp-band-neutral .uicomp-band-line { stroke: #8a8a8a; }
.uicomp-band-neutral .uicomp-band-dot { fill: #8a8a8a; }
.uicomp-band figcaption { font-size: 0.76rem; color: var(--text-muted, #666666); }

/* Trend */
.uicomp-trend { font-size: 0.78rem; }
.uicomp-trend-better { color: var(--trend-good, #2d7a3f); }
.uicomp-trend-worse { color: var(--trend-bad, #c0392b); }
.uicomp-trend-flat { color: var(--trend-flat, #757575); }

/* One severity scale (shared by map markers, sidebar, table, legend) */
.uicomp-sev-key { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; }
.uicomp-sev-swatch {
  display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.uicomp-sev-swatch.sev-low { background: #4ade80; }
.uicomp-sev-swatch.sev-moderate { background: #fbbf24; }
.uicomp-sev-swatch.sev-high { background: #f87171; }
.uicomp-sev-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; margin: 0.5rem 0; }

/* "What changed" note */
.uicomp-what-changed {
  border-left: 4px solid var(--accent, #b85c1e);
  background: var(--accent-light, rgba(184, 92, 30, 0.12));
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 1rem;
}

/* ==========================================================================
 * UI-1 exposure tier — hero tier tiles (index), community tier header,
  * occupation-impact ranking table and the map type toggle.
 * ========================================================================== */

/* Hero tier grid (index.html): three honest tier tiles. Exposure and
 * Adoption are live; Impact states inconclusive over the watched series. */
.hero-row-header {
  font-size: 15px; font-weight: 700; letter-spacing: .04em;
  color: var(--text); margin: 0 0 10px;
}
.hero-tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 1.25rem 0 1rem;
  width: 100%;
}
/* 4th chip (LABOR MARKET STRESS, 2026-10-03): four tiles at desktop;
 * 2-across at tablet, stacked at mobile (the <=900px rule below). */
@media (max-width: 1200px) {
  .hero-tier-grid { grid-template-columns: repeat(2, 1fr); }
}
/* QA-018 (perf/app-split): the hero tiles' static skeletons were shorter
 * than the rendered cards (exposure rendered empty at 10rem until its
 * fetch resolved, adoption's loading skeleton was not height-matched,
 * impact's 18rem skeleton was 7px short) — every tile jumped to its final
 * heights when data landed (measured CLS ~0.30). The final card heights
 * were re-measured 2026-10-04 after the chip-card alignment/padding pass
 * (taller 176px chart boxes, reduced padding): 344px @<=900px (stacked
 * grid), 384px @>900px (4-across) — the min-heights pin the tiles to
 * those heights from first paint, so skeleton -> content is shift-free. */
.hero-tier { min-width: 0; min-height: 24rem; }
/* Cleanup: flex column + margin-top:auto on the footer — the three
 * cards' footers (border line, 'Data updated', 'How we measure') share
 * the same top edge regardless of description/chart content above. */
/* Chip-card padding (2026-10-04 review, item 2): the generic .card 1rem
 * padding left only ~162px of content in the four-across desktop grid —
 * the Labor Market Impact card's 'Inconclusive' verdict word spilled past
 * the card edge. Reduced to 0.625rem on the FOUR chip cards only (all
 * four, for consistency — Dan's instruction); every other card keeps the
 * generic padding. */
.hero-tier .uicomp-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.625rem;
}
.hero-tier-card .exposure-foot { margin-top: auto; }
.hero-tier-card .card-value { font-size: 2rem; font-weight: 700; }
.hero-tier-sub {
  font-size: 0.85rem;
  color: var(--text-muted, #666666);
  line-height: 1.45;
  margin: 0.35rem 0 0;
}
.hero-tier-footnote {
  font-size: 0.76rem;
  color: var(--text-muted, #666666);
  margin: 0.4rem 0 0;
}
.hero-tier .uicomp-note { height: 100%; }
@media (max-width: 900px) {
  .hero-tier-grid { grid-template-columns: 1fr; }
  .hero-tier { min-height: 24rem; }
}

/* Exposure card v2 (DEC-43 fixed basket, mockup impact-card-waffle.html
 * card 1): kicker + big % with the wrapped sentence, a bordered 0-baseline
 * fixed-reference bar strip (uicomp.js barStripHTML) with native per-bar
 * tooltips, first/last release axis dates, italic caption, updated-date
 * footer. Palette is the site's own L1 tokens, not the mock's. */
.card-kicker {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted, #666666);
  line-height: 1.3;
}
.hero-tier-card .exposure-big {
  font-size: 1.9rem; /* mock 30px */
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* Chip cards (2026-10-04 review, item 2): the impact card's verdict word
 * 'Inconclusive' sits in the number slot — at the shared 1.9rem big-value
 * size it measures ~184px, wider than the reduced-padding content box
 * (~176px at the four-across width), so it spilled past the card's right
 * edge. The verdict word renders one step smaller (1.7rem ≈ 165px,
 * measured) so it fits INSIDE the card; the numeric values keep 1.9rem.
 * (Padding reduction alone was measured insufficient: 184px > 176px.) */
.hero-tier-card .card-value-verdict { font-size: 1.7rem; }
.exposure-unit { font-size: 1.25rem; font-weight: 600; }
.exposure-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text, #1a1a1a);
  margin: 0 0 0.75rem;
  /* Chip-card alignment (2026-10-04 review, item 1): the descriptions
   * under the four headlines ended at different heights (the old 3-line
   * min-height only fit the SHORT impact sentence), so each chart box
   * hung from a different baseline and the boxes' top/bottom edges never
   * agreed across the row. flex-grow pins every description's BOTTOM to
   * the same edge: the extra vertical space goes between the value and
   * the chart, so all four chart boxes (fixed height, below) start and
   * end at the same y in every layout. The min-height stays as the
   * short-description floor. */
  min-height: calc(3 * 1.45em);
  flex: 1 0 auto;
}
.exposure-ts {
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px;
  padding: 10px 12px 8px;
  margin: 0 0 6px;
}
.exposure-ts .uicomp-barstrip-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 64px;
}
.uicomp-barstrip-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}
.uicomp-barstrip-bar i {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: rgba(184, 92, 30, 0.38); /* fallback: accent 38% */
  background: color-mix(in srgb, var(--accent, #b85c1e) 38%, transparent);
}
.uicomp-barstrip-latest i,
.uicomp-barstrip-bar:hover i {
  background: var(--accent, #b85c1e);
}
.exposure-ts-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-muted, #666666);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.exposure-ts-caption {
  font-size: 0.66rem;
  font-style: italic;
  color: var(--text-muted, #666666);
  line-height: 1.4;
  margin: 6px 0 0;
}
.exposure-foot {
  font-size: 0.66rem;
  color: var(--text-muted, #666666);
  margin-top: 10px;
  border-top: 1px solid var(--border, #d8d4cc);
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
/* hero-width (2026-10-05): at the wider chip cards the foot's flex-wrap
 * became width-dependent — short 'Data updated' dates fit one row while
 * the long-date feet (adoption/impact) wrap to two, so foot tops (and
 * with them every chart box above) split into two misaligned groups
 * (24px apart). Reserve the two-row height on the hero tiles' feet so
 * the foot's border line — and therefore each chart's bottom edge —
 * lands at the same y in all four cards at ANY width; align-content
 * keeps one-row feet visually bottom-anchored (same look as before).
 * line-height pinned so the calc tracks the real row height. */
.hero-tier .exposure-foot {
  line-height: 1.5;
  min-height: calc(2 * 1.5em + 15px); /* two 1.5em rows + 8px wrap gap + 6px padding + 1px border */
  align-content: flex-end;
}
.exposure-foot .asof { font-variant-numeric: tabular-nums; }
.exposure-foot a {
  color: var(--accent, #b85c1e);
  text-decoration: none;
  white-space: nowrap;
}
.exposure-foot a:hover { text-decoration: underline; }
/* QA: the exposure tile's methods hint is a span (nested-interactive fix) — match link look */
.exposure-foot .exposure-methods-hint {
  color: var(--accent, #b85c1e);
  text-decoration: none;
  white-space: nowrap;
}
/* Mobile (mock card 2): smaller big number, tighter strip. */
@media (max-width: 640px) {
  .hero-tier-card .exposure-big { font-size: 1.6rem; } /* mock 26px */
  .exposure-ts .uicomp-barstrip-bars { gap: 5px; }
}

/* Adoption card v2 (same approved mock, card 2): identical skeleton to
 * the exposure card above — shared .card-kicker/.exposure-* classes —
 * but the strip carries ALL 22 biweekly BTOS waves as thin bars, so the
 * mock's .ts-bars.adoption 2.5px gap is scoped to this card via the
 * .adoption-ts wrapper; the shared exposure card CSS stays untouched.
 * Bar heights come from uicomp.barStripHTML with a fixed 25% top
 * reference (value/25% on the same 64px 0-baseline strip). */
.exposure-ts.adoption-ts .uicomp-barstrip-bars { gap: 2.5px; }
@media (max-width: 640px) {
  .exposure-ts.adoption-ts .uicomp-barstrip-bars { gap: 1.5px; }
}
/* Stress trend strip (2026-10-04, item 3): the monthly composite series
 * is 79 points since the 2020-2022 backfill (was 44) — the shared
 * strip's default 8px bar gap (exposure, ~6 points) would need 344px of
 * gap alone and collapse every bar to zero width. Same fix the adoption
 * strip got: a scoped tight gap (2.5px desktop / 1.5px mobile) so the
 * discrete bars fit the box. */
/* Stress trend strip (2026-10-04, item 3; re-tuned for the DEC-45 79-month
 * history): at the 4-across card width the strip content is ~148px, so the
 * bar budget is (148 - gaps) / N per bar. The old 2.5px gap (sized for 44
 * months) left 78 gaps x 2.5px = 195px of gap alone and flex shrank every
 * bar to ZERO width — 79 invisible bars in a working DOM. The adoption
 * strip (76 bars) reads fine at gap 1px (~0.83px bars); stress matches it:
 * gap 1px -> ~0.89px bars, same readable silhouette, same shared graph
 * type. (A trend line was the documented fallback but is NOT needed — the
 * sibling strip proves this density renders.) */
.exposure-ts.stress-ts .uicomp-barstrip-bars { gap: 1px; }
@media (max-width: 640px) {
  .exposure-ts.stress-ts .uicomp-barstrip-bars { gap: 1px; }
}

/* Two-era adoption strip (DEC-38 revision, 2026-10-04): the adoption
 * card's strip renders BOTH survey eras — muted-slate original-wording
 * segment left, dashed wording-break divider between, current-wording
 * segment right, caption naming the break. The orig segment color is
 * the mock's muted slate (#7a869a) — a DIFFERENT ERA marker, deliberately
 * not an accent state (hover keeps it slate: the eras must stay visually
 * distinct). 76 bars total, so the segment gets the mock's 1px gap
 * (the shipped 2.5px two-era total would leave every bar under 1px wide).
 * The .adoption-twoera class is only present when orig waves exist — a
 * payload without them renders the shipped single-era strip unchanged. */
.exposure-ts .uicomp-barstrip-divider {
  flex: 0 0 2px;
  height: 100%;
  background: repeating-linear-gradient(to bottom,
    var(--text-muted, #666666) 0 3px, transparent 3px 6px);
  margin: 0 3px;
}
.exposure-ts.adoption-ts.adoption-twoera .uicomp-barstrip-bars { gap: 1px; }
.exposure-ts.adoption-ts .uicomp-barstrip-bar.uicomp-barstrip-orig i,
.exposure-ts.adoption-ts .uicomp-barstrip-bar.uicomp-barstrip-orig:hover i {
  background: #7a869a;
}

/* Adoption sidebar — two labeled era blocks (DEC-38 revision). The dashed
 * wording-break divider + one footnote sit between the original-wording
 * block (its own 0-10 axis) and the current-wording block (0-30). */
.era-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted, #666666);
  font-size: 0.66rem;
  margin: 10px 0 4px;
}
.era-divider::before,
.era-divider::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--border, #d8d4cc);
}
.exsb-footnote {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted, #666666);
  margin: 4px 0 10px;
}

/* Cleanup: the four cards' embedded graphs share one box height AND
 * width — the labor chart drops 80px→64px to match the strips, all
 * boxes get a fixed equal height, and each box's caption/legend pins to
 * the bottom edge. Fixed height + flex column = the boxes align on BOTH
 * top and bottom edges across the row.
 * 2026-10-04 (item 6): 152px clipped the adoption caption's last line —
 * the full '*Share of US businesses…(every two weeks)' string wraps to
 * five caption lines at the four-across width (171px of content vs a
 * 150px box), so the caption ended mid-phrase at '(every two'. Height
 * raised to 176px for ALL four boxes (consistent geometry — do NOT size
 * one card differently) and verified: the caption's bottom edge is now
 * inside the box at every breakpoint.
 * 2026-10-05: the DEC-38 two-era caption sentence was REMOVED (Dan — the
 * card shows the trend; the sidebar explains the wording break), so the
 * 228px boxes raised for it revert to 176px; tile min-heights re-measured
 * below. The two-era strip keeps its 1px gap rule (76 bars need it). */
.hero-tier-card .exposure-ts,
.hero-tier-card .gaplines-box {
  height: 176px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero-tier-card .exposure-ts .exposure-ts-caption,
.hero-tier-card .gaplines-box .gaplines-legend {
  margin-top: auto;
}
.hero-tier-card .gaplines-box .gaplines-legend { padding-top: 4px; }

/* Labor-impact card v2 (same approved mock, card 3): two indexed lines
 * (AI-exposed vs all other industries, both 100 at 2015Q1) over the live
 * /api/v2/impact/gap-series payload, shaded pre-period + dashed onset
 * divider, dashed 2015-level reference, per-quarter hover hit rects with
 * the tooltip + guide line, legend under the box. Palette is the site's
 * own L1 tokens, not the mock's. preserveAspectRatio="none" is required
 * on the svg — without it the viewBox letterboxes and the edge hit zones
 * go dead. No y-axis, no caption: the mock removed both. */
.gaplines-box {
  position: relative;
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px;
  padding: 8px 10px 4px;
  margin: 0 0 6px;
}
.gaplines { display: block; width: 100%; height: 64px; } /* cleanup: matches the 64px strips */
.gaplines .pre { fill: color-mix(in srgb, var(--text, #1a1a1a) 4%, transparent); }
.gaplines .base {
  stroke: var(--text-muted, #666666);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.5;
}
.gaplines .base-lab { font-size: 8px; fill: var(--text-muted, #666666); opacity: 0.8; }
.gaplines .onset {
  stroke: var(--text-muted, #666666);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.6;
}
.gaplines .other { fill: none; stroke: var(--text-muted, #666666); stroke-width: 1.8; }
.gaplines .high { fill: none; stroke: var(--accent, #b85c1e); stroke-width: 2; }
.gaplines .lab { font-size: 8.5px; fill: var(--text-muted, #666666); }
.gaplines .guide { stroke: var(--text, #1a1a1a); stroke-width: 0.75; opacity: 0.5; }
.gaplines .gaphit { fill: transparent; }
.gaplines .gaphit:hover { fill: color-mix(in srgb, var(--text, #1a1a1a) 4%, transparent); }
.gaptip {
  position: absolute;
  transform: translate(-50%, 0);
  background: var(--text, #1a1a1a);
  color: var(--card-bg, #ffffff);
  font-size: 10px;
  line-height: 1.45;
  padding: 5px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 9;
  font-variant-numeric: tabular-nums;
}
.gaplines-legend {
  display: flex;
  gap: 14px;
  font-size: 0.66rem;
  color: var(--text-muted, #666666);
  margin: 2px 0 6px;
  flex-wrap: wrap;
}
.gaplines-legend .sw {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 5px;
}
.gaplines-legend .sw.high { background: var(--accent, #b85c1e); }
.gaplines-legend .sw.other { background: var(--text-muted, #666666); }
@media (max-width: 640px) {
  .gaplines { height: 64px; }
  .gaplines-legend { gap: 10px; }
}

/* Community briefing tier header (community.html): same three tiles over
 * the briefing sections, plus the what-changed note slot. */
.tier-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 1.25rem;
}
.tier-tile { min-width: 0; min-height: 9rem; }
.tier-tile .uicomp-card,
.tier-tile .tier-tile-card { height: 100%; margin: 0; }
.tier-tile-card .card-value { font-size: 1.6rem; font-weight: 700; }
.tier-tile-sub {
  font-size: 0.82rem;
  color: var(--text-muted, #666666);
  line-height: 1.45;
  margin: 0.35rem 0 0;
}
.tier-tile-pending .uicomp-note-text { font-size: 0.85rem; }
.tier-header .uicomp-what-changed { grid-column: 1 / -1; margin-bottom: 0; }
@media (max-width: 900px) {
  .tier-header { grid-template-columns: 1fr; }
}

/* Named placeholder note (uicomp.js noteHTML): title + state, never a
 * fake value. Shared by the hero tiles and the community tier header. */
.uicomp-note { border-style: dashed; }
.uicomp-note-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: #5f6469;
  background: rgba(95, 100, 105, 0.08);
  white-space: nowrap;
}
.uicomp-note-text {
  font-size: 0.88rem;
  color: #494e52;
  line-height: 1.5;
  margin: 0.5rem 0 0;
}
.uicomp-note-link { font-size: 0.8rem; margin: 0.5rem 0 0; }
.uicomp-note-error { border-color: var(--error-border, #e74c3c); border-style: solid; }

/* Occupation impact: ranked table (replaces the 3-card grid) */
.occ-impact-table-wrap { overflow-x: auto; }
.occ-impact-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #dfe1e4;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13.5px;
}
.occ-impact-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f6469;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e8eb;
  background: #f6f9fb;
  white-space: nowrap;
}
.occ-impact-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eceff1;
  vertical-align: top;
}
.occ-impact-table tbody tr.occ-impact-row { cursor: pointer; }
.occ-impact-table tbody tr.occ-impact-row:hover,
.occ-impact-table tbody tr.occ-impact-row:focus { background: #f6f9fb; }
.occ-impact-table tbody tr.occ-impact-row:focus-visible {
  outline: 2px solid #0065b4;
  outline-offset: -2px;
}
.occ-impact-table .num { text-align: right; white-space: nowrap; }
.occ-impact-table .occ-impact-rank { color: #8b9095; font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace; font-size: 12px; }
.occ-impact-row-title { font-weight: 600; color: #141b24; }
.occ-impact-exposed { display: block; font-size: 0.72rem; color: #6d7277; margin-top: 2px; }
@media (max-width: 767px) {
  .occ-impact-table th, .occ-impact-table td { padding: 9px 10px; }
}

/* Metric group containers (UI pruning: EWS / CLMC titled groups) */
.metric-group {
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 10px;
  padding: 1.25rem 1.5rem 1rem;
  margin: 1.5rem 0;
  background: var(--card-bg, rgba(255,255,255,0.03));
}
/* ---- UI-2: adoption tier (National Pulse section + hero era series) ---- */
.adoption-section { margin-top: 2.5rem; }

.uicomp-era-series {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}
.uicomp-era-block {
  flex: 1 1 12rem;
  min-width: 10rem;
}
.uicomp-era-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #55606b;
  margin: 0 0 0.25rem;
}
.uicomp-era-block .card-value { font-size: 1.35rem; }
.uicomp-era-break {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: #6d7277;
  background: #f4f6f8;
  border-left: 3px solid #b8c2cc;
  padding: 0.5rem 0.75rem;
  margin-top: 0.25rem;
  border-radius: 0 4px 4px 0;
}

.adoption-era-charts { margin-top: 1rem; }
.adoption-era-charts .uicomp-band {
  max-width: 640px;
  margin: 0 auto;
}
.adoption-era-chart { margin-bottom: 1.25rem; }
.adoption-chart-title { font-size: 0.95rem; margin: 0 0 0.35rem; color: #333; }
.adoption-rps-note,
.adoption-note {
  font-size: 0.8rem;
  color: #6d7277;
  margin: 0.75rem 0 0;
}
.adoption-subhead {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.6rem;
}
.adoption-subhead .uicomp-card-period { font-weight: 400; font-size: 0.75rem; }
.adoption-sector-sizes { margin-top: 0.35rem; }
.adoption-sector-sizes summary {
  font-size: 0.75rem;
  color: #0065b4;
  cursor: pointer;
}
.adoption-sector-sizes ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: #55606b;
  columns: 2;
}
.adoption-size-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
}
.adoption-suppressed {
  color: var(--text-muted, #666666);
  font-style: italic;
  font-size: 0.85em;
}
.adoption-state-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.3rem 1.25rem;
  font-size: 0.85rem;
}
.adoption-state-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px dotted #d5d8db;
  padding: 0.15rem 0;
}
.adoption-state-name { color: #333; }
.adoption-state-value { font-variant-numeric: tabular-nums; }

/* =====================  Worker Exposure sidebar  ======================== */
/* Content cards inside the #exposure-sidebar panel (the panel chrome
 * itself is the shared .metro-sidebar). Geometry/colors follow the
 * approved mock (work/mockups/exposure-sidebar.html). */
.exsb-card {
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
  background: var(--card-bg, #ffffff);
}
.exsb-card:first-child { margin-top: 0; }
.exsb-headline {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.exsb-sub { color: var(--text-muted, #666666); margin-top: 4px; }
.exsb-srcs { margin-top: 10px; font-size: 13px; line-height: 1.55; }
.exsb-srcs a {
  color: var(--accent, #b85c1e);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 92, 30, 0.35);
}
.exsb-srcs a:hover { border-bottom-color: var(--accent, #b85c1e); }
.exsb-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted, #666666);
}
.exsb-card h3 { margin: 2px 0 8px; font-size: 13px; }
.exsb-interp { font-size: 12.5px; margin-top: 10px; line-height: 1.55; }
.exsb-interp em { color: var(--text-muted, #666666); font-style: normal; }
.exsb-legend { margin-top: 8px; font-size: 12px; line-height: 1.9; }
.exsb-sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: -2px;
  margin-right: 6px;
}
.exsb-sw--dot { border-radius: 50%; }
.exsb-foot {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted, #666666);
  border-top: 1px solid var(--border, #d8d4cc);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
}
.exsb-foot a { color: var(--accent, #b85c1e); text-decoration: none; }
.exsb-foot a:hover { text-decoration: underline; }
.exsb-tooltip {
  position: fixed;
  pointer-events: none;
  background: #1a1d21;
  color: #fff;
  font-size: 11.5px;
  padding: 6px 9px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .08s;
  max-width: 260px;
  z-index: 510;
}
.exsb-card svg rect[data-t],
.exsb-card svg circle[data-t] { cursor: crosshair; }

/* The chip card that opens the panel (the other two tier cards stay
 * non-clickable). Focus ring only on keyboard focus. */
#hero-tile-exposure { cursor: pointer; }
#hero-tile-exposure:focus-visible {
  outline: 2px solid var(--accent, #b85c1e);
  outline-offset: 2px;
}

/* ---- Labor Market Impact sidebar (approved final mock) ----------------
 * Reuses the shared .exsb-* card chrome above; only the elements the
 * labor panel adds (Pearson details box, grouped test list, future list)
 * are styled here. */

#hero-tile-impact { cursor: pointer; }
#hero-tile-impact:focus-visible {
  outline: 2px solid var(--accent, #b85c1e);
  outline-offset: 2px;
}

/* Collapsible "How do we prove correlation?" (mock's .formula-details). */
.exsb-details { margin-top: 10px; }
.exsb-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, #b85c1e);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 92, 30, 0.35);
  display: inline-block;
  list-style: none;
}
.exsb-details summary::-webkit-details-marker { display: none; }
.exsb-details summary::after {
  content: " \25B8";
  margin-left: 5px;
  color: var(--text-muted, #666666);
  font-size: 11px;
}
.exsb-details[open] summary::after { content: " \25BE"; }
.exsb-details[open] summary {
  color: var(--text, #1a1d21);
  border-bottom-color: transparent;
}

/* THE PEARSON METHOD box (mock's .formula) — typeset fraction in pure
 * HTML/CSS, no MathJax. */
.exsb-formula {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--card-bg, #f6f7f9);
  border: 1px solid var(--border, #d8d4cc);
  border-radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
}
.exsb-f-head {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted, #666666);
  margin-bottom: 6px;
}
.exsb-f-math { text-align: center; font-size: 16px; font-style: italic; }
.exsb-formula sub { font-size: 10px; }
.exsb-frac {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  margin: 0 4px;
}
.exsb-frac-num {
  display: block;
  padding: 0 6px;
  border-bottom: 1.5px solid var(--text, #1a1d21);
}
.exsb-frac-den { display: block; padding: 0 6px; font-size: 14px; }
.exsb-f-plain {
  margin-top: 8px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.55;
}
.exsb-f-plain em { color: var(--text-muted, #666666); font-style: normal; }
.exsb-r { color: var(--accent, #b85c1e); font-weight: 700; }
.exsb-formula small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted, #666666);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 10.5px;
  line-height: 1.5;
}

/* Grouped test list (mock's ul.tests). */
.exsb-tests { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
.exsb-tests li { margin-top: 6px; }
.exsb-tests ul { margin: 4px 0 0; padding-left: 16px; }
.exsb-testgroup { font-weight: 700; }
.exsb-tests a {
  color: var(--accent, #b85c1e);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 92, 30, 0.35);
}

/* Ongoing-research numbered approaches (mock's .future). */
.exsb-future li { margin-top: 8px; }

/* ==========================================================================
 * LABOR MARKET STRESS sidebar (stress-sidebar.js, the 4th chip — mock
 * stress-sidebars.html Panel A). Reuses the shared .exsb-* card chrome;
 * only the elements the mock's Panel A adds are new here.
 * ========================================================================== */

/* Tier line inside the headline number (mock's .headline .lvl). */
.exsb-headline .lvl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #666666);
  margin-left: 8px;
}

/* The watchlist note boxes (mock's .watch). */
.stsb-watch {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f6f7f9;
  border: 1px solid var(--border, #e2e5e9);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.stsb-watch b {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-muted, #666666);
}
.stsb-watch:first-of-type { margin-top: 0; }

/* The chip card's tier badge (LOW/MODERATE/HIGH — text, never color-only). */
.stress-tier-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: 0.5em;
  margin-left: 6px;
}
.stress-tier-low {
  background: #e8f3ec;
  color: #1d6f3e;
}
.stress-tier-moderate {
  background: #fdf3e0;
  color: #8a5a00;
}
.stress-tier-high {
  background: #fbe9e7;
  color: #a93226;
}

