@media (max-width: 720px) {
  .n-hero-kpi-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem 1.15rem 1rem;
  }
  .n-hero-status-block {
    max-width: none;
    align-items: center;
    text-align: center;
  }
  .n-hero-status-card {
    justify-content: center;
  }
  .n-kpi-group {
    max-width: none;
    align-items: center;
    text-align: center;
  }
  .n-kpi-dominant-pair {
    justify-content: center;
    flex-wrap: wrap;
  }
  .n-kpi-metric-block {
    align-items: center;
    flex: 1 1 140px;
  }
  .n-kpi-pill-row {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .n-kpi-dominant-pair {
    flex-direction: column;
    align-items: center;
  }
  .n-kpi-metric-block {
    max-width: none;
    width: 100%;
  }
  .n-header-top { flex-direction: column; }
}

/* ── STALE / UNAVAILABLE METRIC VALUES ───────────────────────── */
.n-value-stale {
  opacity: 0.5;
  font-style: italic;
}

.n-value-unavailable {
  opacity: 0.4;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  letter-spacing: 0;
}

/* AQI chip value inherits color from JS */
#n-aqi-value {
  transition: color 0.4s;
}

/* Insight bar left border tracks CEI level */
.n-hero-card.n-hero-green  ~ .n-insight-bar { border-left-color: #22c55e; }
.n-hero-card.n-hero-yellow ~ .n-insight-bar { border-left-color: #eab308; }
.n-hero-card.n-hero-orange ~ .n-insight-bar { border-left-color: #f97316; }
.n-hero-card.n-hero-red    ~ .n-insight-bar { border-left-color: #ef4444; }

/* Site age stale indicator */
.n-site-age.n-value-stale {
  color: #f59e0b;
  opacity: 1;
}
.theme-light .n-site-age.n-value-stale { color: #b45309; }

/* ── KPI GROUP DIVIDER (between Air Quality and Wind & Weather) ── */
.n-kpi-group-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(148, 163, 184, 0.2);
  margin: 0.25rem 0.25rem;
  flex-shrink: 0;
}
.theme-light .n-kpi-group-divider { background: rgba(0, 0, 0, 0.1); }

/* ── STACKED PANEL HEADER (title + controls on separate lines) ─── */
.n-panel-header--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.n-pandora-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── SCATTER SUMMARY CARD ────────────────────────────────────── */
.n-scatter-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.n-scatter-stat-row {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
}

.n-scatter-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.n-scatter-stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #94a3b8;
  transition: color 0.3s;
}

.n-scatter-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}

.n-scatter-stat--good .n-scatter-stat-value { color: #22c55e; }
.n-scatter-stat--bad  .n-scatter-stat-value { color: #ef4444; }

.n-scatter-bar-wrap {
  height: 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.25);
  overflow: hidden;
}

.n-scatter-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 4px;
  transition: width 0.6s ease;
  width: 0%;
}

.n-scatter-insight {
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.5;
  margin: 0;
}

/* ── PANDORA WINDOW DATE LABEL ───────────────────────────────── */
.n-pandora-window-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  opacity: 0.5;
  margin: 0.1rem 0 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* ── PROFILE BODY (chart on top, insights row below) ─────────── */
.n-profile-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.n-profile-insights {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 10px;
}

.n-profile-insights-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0;
}

.n-profile-insights-body {
  font-size: 0.8rem;
  line-height: 1.55;
  opacity: 0.75;
  margin: 0;
}

/* Stat cards sit in a horizontal row */
.n-profile-stat-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.n-profile-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  background: rgba(168, 85, 247, 0.08);
  border-radius: 6px;
  border-left: 3px solid rgba(168, 85, 247, 0.5);
}

.n-profile-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.55;
}

.n-profile-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.n-profile-stat-sub {
  font-size: 0.72rem;
  opacity: 0.6;
  line-height: 1.4;
}

.n-profile-insights-note {
  font-size: 0.73rem;
  opacity: 0.55;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

@media (max-width: 900px) {
  .n-profile-stat-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .n-profile-stat-list { grid-template-columns: 1fr; }
}

/* ── PER-CHART TIME CONTROLS ─────────────────────────────────── */
.n-chart-time-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.n-chart-time-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.5;
  white-space: nowrap;
}

/* ── TRANSITIONS ─────────────────────────────────────────────── */
.n-hero-card,
.n-hero-status-value,
.n-hero-status-dot,
.n-hero-summary,
.n-aqi-chip,
.n-metric-card,
.n-panel {
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* ── Intro / welcome modal ──────────────────────────────────── */
