:root {
  --bg: #d4edd0;
  --ink: #4d9f83;
  --panel: rgba(255, 255, 255, 0.9);
  --accent-1: #f98187;
  --accent-2: #4d9f83;
  --accent-3: #f9b28c;
  --ban: #f98187;
  --no-ban: #4d9f83;
  --shadow: 0 18px 40px rgba(77, 159, 131, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #ffffff 0%, var(--bg) 45%, #d4edd0 100%);
  font-family: "Space Grotesk", sans-serif;
  position: relative;
  overflow-x: hidden;
}

.background-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.shape-a {
  width: 420px;
  height: 420px;
  background: var(--accent-2);
  top: -140px;
  left: -120px;
}

.shape-b {
  width: 360px;
  height: 360px;
  background: var(--accent-3);
  bottom: -100px;
  right: -110px;
}

.dashboard {
  width: min(1200px, 92vw);
  margin: 2.2rem auto 2.4rem;
  position: relative;
  z-index: 1;
}

.top-nav {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  border: 1px solid rgba(77, 159, 131, 0.25);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.nav-link.active {
  background: rgba(173, 151, 202, 0.25);
  border-color: rgba(173, 151, 202, 0.55);
}

.hero {
  background: rgba(255, 255, 255, 0.92);
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(77, 159, 131, 0.15);
  margin-bottom: 2.5rem;
}

.hero h1 {
  margin: 0.1rem 0 0.5rem;
  font-family: "Archivo Black", sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.05;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: #1a3d32;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-1);
  font-size: 0.82rem;
}

.subhead {
  margin: 0;
  max-width: 760px;
  color: #2d4a42;
  font-size: 1.04rem;
  line-height: 1.5;
}

.controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.4rem 0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.control-group select {
  border: 1px solid rgba(77, 159, 131, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.62rem 0.72rem;
  min-width: 200px;
  font-size: 0.95rem;
  font-family: inherit;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--panel);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(77, 159, 131, 0.14);
  border-radius: 14px;
  padding: 0.95rem 1rem 1rem;
  box-shadow: var(--shadow);
}

.stat-card h2 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat-card .value {
  margin: 0;
  font-weight: 700;
  font-size: 1.85rem;
}

.stat-card .caption {
  margin: 0.2rem 0 0;
  color: rgba(77, 159, 131, 0.78);
  font-size: 0.86rem;
}

.ban h2 {
  color: var(--ban);
}

.no-ban h2 {
  color: var(--no-ban);
}

.stat-card.no-ban .value {
  color: var(--accent-1);
}

.gap h2 {
  color: var(--accent-2);
}

.viz-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
}

.focal-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(77, 159, 131, 0.14);
  border-radius: 16px;
  padding: 0.9rem 1rem 0.8rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.panel-head p {
  margin: 0.25rem 0 0.7rem;
  color: rgba(77, 159, 131, 0.82);
  font-size: 0.92rem;
}

.map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.map-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 50px;
  height: 28px;
  background: rgba(173, 151, 202, 0.55);
  border-radius: 999px;
  transition: background 0.25s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 9px rgba(77, 159, 131, 0.24);
  transition: transform 0.25s ease;
}

.map-toggle input:checked + .slider {
  background: rgba(249, 129, 135, 0.78);
}

.map-toggle input:checked + .slider::before {
  transform: translateX(22px);
}

.map {
  width: 100%;
  height: 520px;
  min-width: 0;
}

.legend-row {
  margin: 0.3rem 0 0.35rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.1rem 0.8rem 0.1rem 0.8rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 700;
  padding: 0.33rem 0.72rem;
  border: 1px solid rgba(77, 159, 131, 0.24);
}

.ban-chip {
  background: rgba(249, 129, 135, 0.2);
}

.no-ban-chip {
  background: rgba(77, 159, 131, 0.2);
}

.status-legend {
  display: none;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(77, 159, 131, 0.24);
  display: inline-block;
}

.swatch-ban {
  background: #f98187;
}

.swatch-supportive {
  background: #4d9f83;
}

.timeline-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.timeline-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
}

#divergenceChart {
  width: 100%;
  height: 100%;
}

.state-summary {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(77, 159, 131, 0.2);
  padding-top: 0.6rem;
}

.state-summary h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.state-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.state-summary-grid p {
  margin: 0;
  font-size: 0.88rem;
}

.state-summary-grid span {
  color: rgba(77, 159, 131, 0.82);
}

.insight-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 300px;
}

.race-disparity-wrap {
  position: relative;
  width: 100%;
  height: 300px;
}

.race-disparity-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.data-note {
  margin: 1rem 0 0.2rem;
  font-size: 0.86rem;
  color: rgba(77, 159, 131, 0.8);
}

.solution-grid {
  margin-top: 1.1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.solutions-viz {
  margin-top: 1rem;
}

.solution-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
}

.solution-card p {
  margin: 0 0 0.55rem;
  line-height: 1.45;
}

.solution-impact {
  font-weight: 700;
  color: var(--accent-2);
}

.roadmap {
  margin-top: 1rem;
}

.roadmap h2 {
  margin-top: 0.1rem;
}

.roadmap ol {
  margin: 0.45rem 0 0.2rem;
  padding-left: 1.1rem;
}

.roadmap li {
  margin-bottom: 0.45rem;
}

@media (max-width: 1024px) {
  .viz-grid {
    grid-template-columns: 1fr;
  }

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

  .timeline-panel {
    height: auto;
  }

  .timeline-wrap {
    flex: none;
    height: 340px;
  }
}

@media (max-width: 760px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .map {
    height: 420px;
  }

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

  .top-nav {
    flex-wrap: wrap;
  }

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

/* ── Solutions page redesign ── */

.nordic-panel {
  margin-top: 1rem;
  border-left: 4px solid rgba(173, 151, 202, 0.65);
}

.nordic-header {
  margin-bottom: 1.1rem;
}

.nordic-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.6rem;
  margin: 0.2rem 0 0.15rem;
  color: #1a3d32;
}

.nordic-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: rgba(173, 151, 202, 0.9);
  margin: 0 0 0.6rem;
}

.nordic-desc {
  margin: 0;
  font-size: 0.95rem;
  color: #2d4a42;
}

.nordic-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
}

.nordic-features li {
  padding: 0.55rem 0 0.55rem 1.4rem;
  position: relative;
  font-size: 0.93rem;
  line-height: 1.4;
  border-top: 1px solid rgba(173, 151, 202, 0.2);
}

.nordic-features li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: rgba(173, 151, 202, 0.85);
  font-weight: 700;
}

/* Section headings */
.solutions-section,
.top5-section {
  margin-top: 2rem;
}

.section-label {
  margin-bottom: 1rem;
}

.section-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.45rem;
  margin: 0.2rem 0 0;
  color: #1a3d32;
}

.section-desc {
  margin: 0.3rem 0 0;
  font-size: 0.93rem;
  color: rgba(77, 159, 131, 0.82);
}

/* Tactic cards grid (12 solutions) */
.solutions-grid-new {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tactic-card {
  border-top: 3px solid var(--accent-2);
}

.tactic-card h3 {
  font-family: "Archivo Black", sans-serif;
  font-size: 0.92rem;
  margin: 0 0 0.6rem;
  color: #1a3d32;
  letter-spacing: 0.01em;
}

.tactic-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.tactic-card ul li {
  font-size: 0.87rem;
  line-height: 1.48;
  margin-bottom: 0.3rem;
  color: #2d4a42;
}

/* Top 5 country cards */
.top5-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.country-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.country-mmr {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.mmr-number {
  font-family: "Archivo Black", sans-serif;
  font-size: 3.2rem;
  color: var(--accent-1);
  line-height: 1;
}

.mmr-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(77, 159, 131, 0.7);
  margin-top: 0.15rem;
}

.country-info h3 {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
  color: #1a3d32;
}

.country-tactic {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-2);
  margin: 0 0 0.35rem;
}

.country-detail {
  font-size: 0.84rem;
  line-height: 1.48;
  color: #2d4a42;
  margin: 0;
}

@media (max-width: 1024px) {
  .solutions-grid-new {
    grid-template-columns: repeat(2, 1fr);
  }

  .top5-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .solutions-grid-new {
    grid-template-columns: 1fr;
  }

  .top5-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
