/**
 * GUIDE — Hydro Dashboard Styles
 * Shared condition meters, River Profile (.rdash-*), Reservoir Dashboard (.rvd-*)
 * Adapted to GUIDE cream/tan theme with CSS variable support for dark mode.
 */

/* ═══════════════════════════════════════════════════════
   SHARED: 6-Zone Condition Meter
   ═══════════════════════════════════════════════════════ */
.cond-meter {
  margin: 8px 0 4px;
}
.cond-meter-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  overflow: visible;
}
/* The tracks below are segmented, not blended: each band is a named condition, so the colour does
   not suggest values between two of them. */
.cond-meter-track--flow {
  background: linear-gradient(90deg, var(--guide-color-brick) 0% 16.7%, var(--guide-color-ochre) 16.7% 33.4%, var(--guide-color-moss) 33.4% 50%, var(--guide-color-lake) 50% 66.7%, var(--guide-color-plum) 66.7% 83.4%, var(--guide-color-clay) 83.4% 100.3%);
}
.cond-meter-track--pool {
  background: linear-gradient(90deg, var(--guide-color-brick) 0% 20%, var(--guide-color-clay) 20% 40%, var(--guide-color-ochre) 40% 70%, var(--guide-color-lake) 70% 85%, var(--guide-color-moss) 85% 100%);
}
.cond-meter-track--temp {
  background: linear-gradient(90deg, var(--guide-color-lake) 0% 20%, var(--guide-color-mt-teal) 20% 45%, var(--guide-color-moss) 45% 65%, var(--guide-color-ochre) 65% 85%, var(--guide-color-brick) 85% 100%);
}
.cond-meter-track--depth {
  background: linear-gradient(90deg, var(--guide-color-moss) 0% 34%, var(--guide-color-ochre) 34% 67%, var(--guide-color-brick) 67% 100%);
}
.cond-meter-track--do {
  background: linear-gradient(90deg, var(--guide-color-brick) 0% 30%, var(--guide-color-ochre) 30% 60%, var(--guide-color-moss) 60% 80%, var(--guide-color-lake) 80% 100%);
}
.cond-meter-track--ph {
  background: linear-gradient(90deg, var(--guide-color-brick) 0% 30%, var(--guide-color-moss) 30% 70%, var(--guide-color-plum) 70% 100%);
}
.cond-meter-track--turb {
  background: linear-gradient(90deg, var(--guide-color-lake) 0%, var(--guide-color-ochre) 50%, #92400e 100%);
}
.cond-meter-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 16px;
  background: var(--text-primary, #1A1A1F);
  border-radius: 2px;
  transform: translateX(-1.5px);
  box-shadow: 0 0 0 2px var(--bg-2, #fff);
  transition: left 0.4s ease;
}
.cond-meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  user-select: none;
}

/* ═══════════════════════════════════════════════════════
   DETAIL PANEL: Trend Badge Pill
   ═══════════════════════════════════════════════════════ */
.det-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  /* tokenised in place. The tokenised copy was briefly added to
     guide-primitives.css instead, which declared this class in two sheets. */
  font-size: var(--guide-fs-2xs, 11px);
  font-weight: var(--guide-fw-bold, 700);
  padding: 2px 8px;
  border-radius: var(--radius-lg);
  line-height: 1.4;
  white-space: nowrap;
  color: var(--tier-color, var(--guide-color-ink-soft, #4A5563));
  background: color-mix(in srgb, var(--tier-color, var(--guide-color-ink-soft)) 10%, transparent);
}

/* ═══════════════════════════════════════════════════════
   RIVER PROFILE DASHBOARD (.rdash-*)
   ═══════════════════════════════════════════════════════ */
.rdash-container {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}
.rdash-selector {
  margin-bottom: 16px;
}
.rdash-selector select {
  width: 100%;
  padding: 8px 12px;
  font-size: var(--guide-fs-md);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--text-primary, #1A1A1F);
  cursor: pointer;
}
.rdash-hero {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.rdash-hero-title {
  font-size: var(--guide-fs-xl);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 4px;
}
.rdash-hero-sub {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 12px;
}
.rdash-hero-value {
  font-size: var(--guide-fs-3xl);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.rdash-hero-unit {
  font-size: var(--guide-fs-md);
  font-weight: 500;
  color: var(--text-secondary, #4A4A52);
  margin-left: 4px;
}
.rdash-hero-advice {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4A4A52);
  margin-top: 8px;
  font-style: italic;
}
.rdash-condition-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
}
.rdash-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.rdash-kpi {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.rdash-kpi-val {
  font-size: var(--guide-fs-2xl);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.rdash-kpi-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
  margin-top: 2px;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
}
.rdash-gage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.rdash-gage-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
  transition: border-color 0.2s;
}
.rdash-gage-card:hover {
  border-color: var(--text-secondary, #4A4A52);
}
.rdash-gage-rank {
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--text-tertiary, #8A8A95);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.rdash-gage-name {
  font-size: var(--guide-fs-md);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.rdash-gage-flow {
  font-size: var(--guide-fs-xl);
  font-weight: 700;
}
.rdash-gage-unit {
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
  margin-left: 2px;
}
.rdash-chart-wrap {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.rdash-chart-title {
  font-size: var(--guide-fs-md);
  font-weight: 600;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.rdash-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, #4A4A52);
}
.rdash-loading .spinner {
  margin: 0 auto 12px;
}

/* ═══════════════════════════════════════════════════════
   RESERVOIR DASHBOARD (.rvd-*)
   ═══════════════════════════════════════════════════════ */
.rvd-container {
  padding: 16px;
  max-width: 1000px;
  margin: 0 auto;
}
.rvd-hero {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.rvd-hero-title {
  font-size: var(--guide-fs-xl);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 4px;
}
.rvd-hero-sub {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 12px;
}
.rvd-hero-value {
  font-size: var(--guide-fs-3xl);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.rvd-hero-unit {
  font-size: var(--guide-fs-md);
  font-weight: 500;
  color: var(--text-secondary, #4A4A52);
  margin-left: 4px;
}
.rvd-hero-status {
  font-size: var(--guide-fs-md);
  color: var(--text-secondary, #4A4A52);
  margin-top: 8px;
}
.rvd-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.rvd-kpi {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.rvd-kpi-val {
  font-size: var(--guide-fs-2xl);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.rvd-kpi-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
  margin-top: 2px;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
}
.rvd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-3, #F7F5F0);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.rvd-search {
  flex: 1;
  min-width: 140px;
  padding: 6px 10px;
  font-size: var(--guide-fs-md);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--text-primary, #1A1A1F);
}
/* .rvd-sort-select — now styled by unified charcoal select rule in components.css */
.rvd-range-btns {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-md, 8px);
}
.rvd-range-btn {
  padding: 4px 10px;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  border: 0;
  border-radius: var(--guide-radius-sm, 6px);
  background: transparent;
  color: var(--guide-color-ink-soft);
  cursor: pointer;
  transition: background 0.15s,
    color 0.15s;
}
.rvd-range-btn:hover { color: var(--guide-color-ink); }
.rvd-range-btn.active {
  background: var(--guide-color-raised);
  box-shadow: var(--guide-shadow-rest);
  color: var(--guide-color-ink);
}
.rvd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.rvd-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
  transition: border-color 0.2s;
}
.rvd-card:hover {
  border-color: var(--text-secondary, #4A4A52);
}
.rvd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.rvd-card-name {
  font-size: var(--guide-fs-base);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.rvd-card-region {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
}
.rvd-card-operator {
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.rvd-fill-bar {
  position: relative;
  height: 12px;
  background: var(--bg-3, #F7F5F0);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.rvd-fill-bar-inner {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.rvd-fill-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.rvd-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: var(--guide-fs-xs);
  margin-bottom: 8px;
}
.rvd-card-stat-label {
  color: var(--text-tertiary, #8A8A95);
}
.rvd-card-stat-val {
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  text-align: right;
}
.rvd-card-chart {
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  padding-top: 8px;
}
.rvd-card-chart svg {
  width: 100%;
  display: block;
}
.rvd-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  color: var(--text-secondary, #4A4A52);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 8px;
  background: var(--bg-3);
  cursor: pointer;
  transition: background 0.15s;
}
.rvd-export-btn:hover {
  background: var(--bg-3, #F7F5F0);
}
.rvd-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, #4A4A52);
}
.rvd-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-tertiary, #8A8A95);
  font-size: var(--guide-fs-md);
}

/* ═══════════════════════════════════════════════════════
   GAUGE REPORT (.gr-*) — FIN-style premium detail panels
   Light-theme native: elevated white cards, glass effects,
   accent left borders, gradient meters.
   ═══════════════════════════════════════════════════════ */

/* Report wrapper */
.gr-report {
  background: var(--bg-1, #F2EFE8);
  border-radius: var(--radius-lg, 12px);
  padding: 14px 12px 10px;
}

/* Report header — glass bar */
.gr-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--guide-color-raised);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-md, 8px);
}

/* Metadata tag pills */
.gr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
.gr-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--bg-3, #F7F5F0);
  color: var(--text-secondary, #4A4A52);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  white-space: nowrap;
  line-height: 1.4;
}

/* Individual parameter card */
.gr-param-card {
  background: var(--bg-3);
  border: 1px solid var(--border-default, var(--guide-color-border-default, rgba(0,0,0,0.10)));
  border-radius: var(--radius-lg);
  padding: 12px 14px 8px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.gr-param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.gr-param-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.06em;
  color: var(--text-muted, #706F6D);
}
.gr-param-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 6px;
}
.gr-param-value {
  font-size: var(--text-2xl);
  font-weight: 900;
  line-height: 1.1;
}
.gr-param-unit {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-muted, #706F6D);
}
.gr-updated {
  font-size: var(--text-xs);
  color: var(--text-muted, #706F6D);
  margin-top: 4px;
}

/* Outlook / conditions card */
.gr-outlook-card {
  background: var(--guide-color-raised);
  border: 1px solid var(--border-default, var(--guide-color-border-default, rgba(0,0,0,0.10)));
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.gr-outlook-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 3px;
}
.gr-outlook-desc {
  font-size: var(--text-xxs);
  color: var(--text-secondary, #4A4A52);
  line-height: 1.5;
}

/* Charts & Trends section header */
.gr-trends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.gr-trends-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}

/* Trend card grid */
.gr-trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.gr-trend-grid.gr-single {
  grid-template-columns: 1fr;
}
.gr-trend-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 10px 10px 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.gr-trend-icon {
  font-size: var(--text-md);
  margin-bottom: 1px;
}
.gr-trend-label {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.06em;
  color: var(--text-muted, #706F6D);
  margin-bottom: 2px;
}
.gr-trend-summary {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: 4px;
}
.gr-trend-sparkline {
  margin: 4px 0;
}

/* 1-yr stats (Lo / Avg / Hi) */
.gr-trend-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  padding-top: 4px;
}
.gr-trend-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--guide-fs-2xs);
}
.gr-trend-stat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gr-trend-stat-label {
  color: var(--text-muted, #706F6D);
  flex: 1;
}
.gr-trend-stat-value {
  color: var(--text-primary, #1A1A1F);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .rdash-kpi-strip,
  .rvd-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .rdash-gage-grid {
    grid-template-columns: 1fr;
  }
  .rvd-grid {
    grid-template-columns: 1fr;
  }
  .rvd-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ═══════════════════════════════════════════════════════
   FLOOD INTELLIGENCE — Stacked bars, risk badges, gauges
   ═══════════════════════════════════════════════════════ */
.dk-stacked-bar {
  display: flex;
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  margin: 10px 0 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}
.dk-seg {
  transition: flex 0.4s ease;
  min-width: 2px;
}
.dk-seg:first-child { border-radius: 9px 0 0 9px; }
.dk-seg:last-child  { border-radius: 0 9px 9px 0; }
.dk-seg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4A4A52);
  margin-top: 4px;
}
.dk-seg-label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dk-seg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dk-risk-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.3px;
  color: var(--guide-color-text-on-accent, #fff);
}
.dk-risk-badge--major    { background: var(--guide-color-brick); color: var(--guide-color-on-brick); }
.dk-risk-badge--moderate { background: var(--guide-color-brick); color: var(--guide-color-on-brick); }
.dk-risk-badge--minor    { background: var(--guide-color-clay); }
.dk-risk-badge--action   { background: var(--guide-color-ochre); }

/* ═══════════════════════════════════════════════════════
   MESONET INTELLIGENCE — Progress bars, fire gauge, regions
   ═══════════════════════════════════════════════════════ */
.dk-progress-bar {
  height: 10px;
  background: var(--bg-3, #F7F5F0);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.dk-progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}
.dk-progress-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  margin-top: 4px;
  text-align: center;
}

/* Fire Weather Index gauge */
.dk-fire-gauge { text-align: center; }
.dk-fire-gauge-bar {
  height: 12px;
  background: linear-gradient(90deg, var(--guide-color-moss) 0%, var(--guide-color-ochre) 33%, var(--guide-color-clay) 66%, var(--guide-color-mt-red-bright, #dc2626) 100%);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.dk-fire-gauge-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(var(--guide-wash-rgb, 0, 0, 0), 0.15);
  border-radius: 6px;
  transition: width 0.5s ease;
}
.dk-fire-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  margin-top: 3px;
}
.dk-fire-gauge-verdict {
  font-weight: 700;
  font-size: var(--guide-fs-md);
  margin-top: 6px;
}

/* Regional conditions grid */
.dk-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.dk-region-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  transition: border-color 0.2s;
}
.dk-region-card:hover {
  border-color: var(--text-secondary, #4A4A52);
}
.dk-region-header {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  padding-bottom: 4px;
}
.dk-region-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
}
.dk-region-stats span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.dk-region-count {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════
   PERCENTILE CONTEXT — Gauge detail panel enhancements
   ═══════════════════════════════════════════════════════ */
.gr-percentile-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin: 10px 0;
}
.gr-percentile-header {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 8px;
}
.gr-percentile-bar {
  position: relative;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--guide-color-mt-red-bright, #dc2626) 0%, var(--guide-color-clay) 10%, var(--guide-color-ochre) 25%, var(--guide-color-moss) 50%, var(--guide-color-lake) 75%, var(--guide-color-plum) 90%, var(--guide-color-mt-red-bright, #dc2626) 100%);
  margin: 6px 0;
}
.gr-percentile-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 24px;
  background: var(--text-primary, #1A1A1F);
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: var(--guide-shadow-rest);
}
.gr-percentile-label {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  white-space: nowrap;
}
.gr-percentile-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  margin-top: 2px;
}
.gr-percentile-text {
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4A4A52);
  margin-top: 6px;
  line-height: 1.4;
}
.gr-percentile-text strong {
  color: var(--text-primary, #1A1A1F);
}

/* Flood stage markers on gauge detail */
.gr-flood-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--guide-color-text-on-accent, #fff);
  background: var(--guide-color-status-crit);
  animation: pulse-badge 2s infinite;
}
.gr-flood-stages {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
  font-size: var(--guide-fs-2xs);
}
.gr-flood-stage-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-3, #F7F5F0);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.gr-flood-stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

@media (max-width: 600px) {
  .dk-region-grid { grid-template-columns: 1fr; }
  .dk-seg-legend { font-size: var(--guide-fs-2xs); }
}

/* ═══════════════════════════════════════════════════════
   DROUGHT HUB — Outlook Cards, Precip Widget, Basin Table
   ═══════════════════════════════════════════════════════ */

/* Drought Outlook (CPC forecast) */
.dh-outlook-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.dh-outlook-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 8px;
}
.dh-outlook-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.dh-outlook-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.dh-outlook-pill--persist  { background: #fef3c7; color: #92400e; border-color: var(--guide-color-ochre); }
.dh-outlook-pill--improve  { background: var(--guide-color-status-ok-bg); color: #166534; border-color: var(--guide-color-moss); }
.dh-outlook-pill--remove   { background: color-mix(in srgb, var(--guide-color-lake) 10%, transparent); color: var(--guide-color-deep-water); border-color: var(--guide-color-lake); }
.dh-outlook-pill--develop  { background: var(--guide-color-status-danger-bg); color: var(--guide-color-status-crit); border-color: var(--guide-color-status-crit); }
.dh-outlook-desc {
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4A4A52);
  line-height: 1.5;
  margin-bottom: 6px;
}
.dh-outlook-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-link);
  text-decoration: underline;
}
.dh-outlook-link:hover { text-decoration: none; }

/* Precipitation Widget */
.dh-precip-summary {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.dh-precip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 8px;
}
.dh-precip-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.dh-precip-kpi {
  text-align: center;
  padding: 6px 4px;
  background: var(--bg-3, #F7F5F0);
  border-radius: 8px;
}
.dh-precip-kpi-val {
  font-size: var(--guide-fs-lg);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.dh-precip-kpi-label {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.4px;
  color: var(--text-tertiary, #8A8A95);
  margin-top: 2px;
}
.dh-precip-regions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.dh-precip-region {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-3, #F7F5F0);
  border-radius: 6px;
  font-size: var(--guide-fs-xs);
}
.dh-precip-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-subtle, rgba(0,0,0,0.06));
  border-radius: 3px;
  overflow: hidden;
}
.dh-precip-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Basin Snowpack Table */
.dh-basin-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dh-basin-row {
  display: grid;
  grid-template-columns: 130px 1fr 50px 40px 48px;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: 6px;
  font-size: var(--guide-fs-xs);
  transition: background 0.15s;
}
.dh-basin-row:hover {
  background: var(--bg-3, #F7F5F0);
}
.dh-basin-name {
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dh-basin-bar-track {
  height: 8px;
  background: var(--bg-3, #F7F5F0);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.dh-basin-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.dh-basin-swe {
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dh-basin-pct {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dh-basin-count {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  text-align: right;
}

@media (max-width: 640px) {
  .dh-basin-row {
    grid-template-columns: 100px 1fr 45px 36px 40px;
    font-size: var(--guide-fs-2xs);
  }
  .dh-precip-kpis { grid-template-columns: repeat(2, 1fr); }
  .dh-precip-regions { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   BASIN GAUGE TABLE (.bhm-*) — sizes and counts, no health tier
   ═══════════════════════════════════════════════════════ */
.bhm-table {
  width: 100%;
  font-size: var(--guide-fs-13, 13px);
  border-radius: 8px;
  overflow: hidden;
  background: var(--guide-color-surface);
  border: 1px solid var(--guide-color-line);
}
.bhm-header,
.bhm-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 1fr 0.8fr 1fr;
  gap: 6px 10px;
  padding: 8px 12px;
  align-items: center;
}
.bhm-header {
  font-weight: 600;
  font-size: var(--guide-fs-12, 12px);
  color: var(--guide-color-ink-soft);
}
.bhm-row {
  border-top: 1px solid var(--guide-color-line);
  cursor: default;
}
.bhm-name {
  font-weight: 600;
  color: var(--guide-color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bhm-count,
.bhm-median,
.bhm-temp {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--guide-color-ink);
}
.bhm-of {
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-11, 11px);
}
.bhm-note {
  margin: 6px 0 0;
  font-size: var(--guide-fs-12, 12px);
  color: var(--guide-color-ink-soft);
}

@media (max-width: 640px) {
  .bhm-header, .bhm-row {
    grid-template-columns: 1.5fr 0.7fr 1fr 0.7fr 0.9fr;
    padding: 6px 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   HYDROLOGY COMMAND CENTER (.hh-*)
   ═══════════════════════════════════════════════════════════════════════ */
.hh-root {
  padding: 0 0 8px;
}

/* ── Statewide Conditions Banner ── */
.hh-conditions {
  margin-bottom: 12px;
}
.hh-conditions-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.8px;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.hh-conditions-title i {
  width: 14px;
  height: 14px;
}
.hh-kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.hh-kpi {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hh-kpi:hover {
  box-shadow: var(--guide-shadow-raised);
}
.hh-kpi-icon {
  flex-shrink: 0;
}
.hh-kpi-icon i {
  width: 18px;
  height: 18px;
}
.hh-kpi-data {
  min-width: 0;
}
.hh-kpi-val {
  font-size: var(--guide-fs-base);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.hh-kpi-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Basin Quick-Nav ── */
.hh-basins {
  margin-bottom: 10px;
}
.hh-basins-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 6px;
}
.hh-basins-label i {
  width: 12px;
  height: 12px;
}
.hh-basin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.hh-basin-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
  background: var(--guide-color-raised);
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.hh-basin-chip i {
  width: 12px;
  height: 12px;
}
.hh-basin-chip:hover {
  border-color: var(--guide-color-ink-soft);
  color: var(--guide-color-ink);
}
/* Selected: the action border and a 1px ring. A basin's own hue stays on the
   map and legend, where it identifies the basin. */
.hh-basin-chip--active {
  border-color: var(--guide-color-action);
  box-shadow: inset 0 0 0 1px var(--guide-color-action);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink);
  font-weight: 600;
}
.hh-basin-chip--active:hover {
  border-color: var(--guide-color-action);
  color: var(--guide-color-ink);
}

/* ── AI Summary + Alerts Row ── */
.hh-intel-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}
/* Phase A — wrap each action button so its (i) info button can sit beside it */
.hh-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.hh-btn-wrap > .guide-info-btn {
  flex: 0 0 auto;
}
/* Phase A — sidecar status pill */
.hh-sidecar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  border: 1px solid var(--border-default, rgba(0,0,0,0.08));
  background: var(--bg-3, #F7F5F0);
  color: var(--text-secondary, #4A4A52);
  white-space: nowrap;
  cursor: default;
  transition: background 150ms var(--motion-ease, ease);
}
.hh-sidecar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  box-shadow: 0 0 0 0 rgba(156,163,175,0);
}
.hh-sidecar-pill[data-state="up"] .hh-sidecar-dot {
  background: var(--status-normal, #16a34a);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-color-moss) 15%, transparent);
}
.hh-sidecar-pill[data-state="half"] .hh-sidecar-dot {
  background: var(--status-warn, #d97706);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-color-ochre) 15%, transparent);
}
.hh-sidecar-pill[data-state="down"] .hh-sidecar-dot {
  background: var(--status-critical, var(--guide-color-status-crit));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-color-status-crit) 12%, transparent);
}
.hh-sidecar-pill[data-state="up"] {
  border-color: color-mix(in srgb, var(--guide-color-moss) 25%, transparent);
  color: var(--status-normal, #16a34a);
  background: color-mix(in srgb, var(--guide-color-moss) 6%, transparent);
}
.hh-sidecar-pill[data-state="half"] {
  border-color: color-mix(in srgb, var(--guide-color-ochre) 25%, transparent);
  color: var(--status-warn, #d97706);
  background: color-mix(in srgb, var(--guide-color-ochre) 6%, transparent);
}
.hh-sidecar-pill[data-state="down"] {
  border-color: var(--guide-color-border-accent, color-mix(in srgb, var(--guide-color-status-crit) 25%, transparent));
  color: var(--status-critical, var(--guide-color-status-crit));
  background: color-mix(in srgb, var(--guide-color-status-crit) 6%, transparent);
}
/* Dark page: the status hues read ~3.3–4.0:1 on the dark pill — brighten the
   label ink (dots stay solid fills) so up/half/down all clear AA. */
[data-theme="dark"] .hh-sidecar-pill[data-state="up"] {
  color: #4ADE80;
  background: rgba(74,222,128,0.10);
  border-color: rgba(74,222,128,0.28);
}
[data-theme="dark"] .hh-sidecar-pill[data-state="half"] {
  color: var(--guide-color-status-watch);
  background: color-mix(in srgb, var(--guide-color-ochre-fill) 10%, transparent);
  border-color: color-mix(in srgb, var(--guide-color-ochre-fill) 28%, transparent);
}
[data-theme="dark"] .hh-sidecar-pill[data-state="down"] {
  color: #F87171;
  background: rgba(248,113,113,0.10);
  border-color: rgba(248,113,113,0.28);
}
.hh-ai-summary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--guide-color-line-strong);
  background: var(--guide-color-raised);
  color: var(--guide-color-action);
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
  width: 100%;
}
.hh-ai-summary-btn:hover {
  background: var(--guide-color-raised);
  border-color: var(--guide-color-ink-soft);
}
.hh-ai-summary-btn i {
  width: 14px;
  height: 14px;
}
.hh-alerts-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.hh-alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.hh-alert i {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.hh-alert--critical {
  background: color-mix(in srgb, var(--guide-color-status-crit) 10%, transparent);
  color: var(--guide-color-status-crit);
  border: 1px solid color-mix(in srgb, var(--guide-color-status-crit) 20%, transparent);
}
.hh-alert--warn {
  background: color-mix(in srgb, var(--guide-color-ochre) 10%, transparent);
  color: #92400E;
  border: 1px solid color-mix(in srgb, var(--guide-color-ochre) 20%, transparent);
}
.hh-alert--ok {
  background: color-mix(in srgb, var(--guide-color-moss) 8%, transparent);
  color: #166534;
  border: 1px solid color-mix(in srgb, var(--guide-color-moss) 15%, transparent);
}

/* ── Watchlist Card ── */
.hh-watchlist-card {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}
.hh-watchlist-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.hh-watchlist-head i {
  width: 14px;
  height: 14px;
}
.hh-watchlist-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
}
.hh-watch-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: var(--guide-fs-xs);
}
.hh-watch-item:hover {
  background: var(--surface-alt, rgba(0,0,0,0.04));
}
.hh-watch-item--alert {
  background: color-mix(in srgb, var(--guide-color-status-crit) 6%, transparent);
}
.hh-watch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hh-watch-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary, #1A1A1F);
  font-weight: 500;
}
.hh-watch-flow {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hh-watch-alert {
  font-size: var(--guide-fs-md);
  animation: hh-pulse 1.5s infinite;
}

/* ── Smart Filters ── */
.hh-filters {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.hh-filter-section {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hh-filter-label {
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--text-tertiary, #8A8A95);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.hh-filter-chips {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.hh-cond-chip, .hh-trend-chip {
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--guide-color-line-strong);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-2xs);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease,
    color 0.15s ease;
}
.hh-cond-chip:hover, .hh-trend-chip:hover {
  border-color: var(--guide-color-ink-soft);
  color: var(--guide-color-ink);
}
.hh-cond-chip--active,
.hh-trend-chip--active {
  border-color: var(--guide-color-action);
  box-shadow: inset 0 0 0 1px var(--guide-color-action);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink);
  font-weight: 600;
}
/* .hh-sort-select — now styled by unified charcoal select rule in components.css */
.hh-filter-actions {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.hh-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
  background: transparent;
  color: var(--text-secondary, #4A4A52);
  font-size: var(--guide-fs-2xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease;
}
.hh-bulk-btn:hover {
  background: var(--surface-alt, rgba(0,0,0,0.04));
  border-color: var(--text-secondary, #4A4A52);
}
.hh-bulk-btn i {
  width: 12px;
  height: 12px;
}

/* ── Insight Cards ── */
.hh-insights {
  margin-bottom: 10px;
}
.hh-insights-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.hh-insights-title i {
  width: 14px;
  height: 14px;
  color: var(--guide-color-ochre);
}
.hh-insight {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  margin-bottom: 6px;
  transition: transform 0.15s ease;
}
.hh-insight:hover {
  transform: translateX(2px);
}
.hh-insight--info {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
}
.hh-insight--warn {
  background: color-mix(in srgb, var(--guide-color-ochre) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-ochre) 12%, transparent);
}
.hh-insight--critical {
  background: color-mix(in srgb, var(--guide-color-status-crit) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-status-crit) 12%, transparent);
}
.hh-insight-icon {
  flex-shrink: 0;
  padding-top: 2px;
}
.hh-insight-icon i {
  width: 16px;
  height: 16px;
}
.hh-insight--info .hh-insight-icon { color: var(--guide-color-lake); }
.hh-insight--warn .hh-insight-icon { color: var(--guide-color-ochre); }
.hh-insight--critical .hh-insight-icon { color: var(--guide-color-status-crit); }
.hh-insight-body {
  flex: 1;
  min-width: 0;
}
.hh-insight-title {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 2px;
}
.hh-insight-desc {
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4A4A52);
  line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hh-basin-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hh-basin-chips::-webkit-scrollbar { display: none; }
  .hh-intel-row {
    flex-direction: column;
  }
  .hh-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .hh-filter-actions {
    margin-left: 0;
  }
  .hh-watchlist-body {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════════════════════════════
   PHASE B — Science Tools section + modal
   Montana Editorial polish: warm cream surfaces, tier-accent strip,
   monospaced numerics. Tiles respect prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════ */
.hh-sci-section {
  margin: 14px 0 10px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--radius-lg, 12px);
  padding: 12px 14px 14px;
  position: relative;
}
/* The teal-slate-gold rule that topped every models section is gone: a
   sheet is framed by its 1px line, not a decorative gradient. */
.hh-sci-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.hh-sci-header-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hh-sci-eyebrow {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--text-secondary, #4A4A52);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hh-sci-eyebrow i { width: 13px; height: 13px; color: var(--mt-teal, #0F766E); }
.hh-sci-hint {
  font-size: var(--guide-fs-xs);
  color: var(--text-tertiary, #6B6B73);
}

/* Compute legend — explains the on-device vs cloud dots once, so each tile
   only needs a quiet dot instead of a loud BROWSER/SERVER chip. */
.hh-sci-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: var(--guide-fs-xs);
  color: var(--text-tertiary, #6B6B73);
  white-space: nowrap;
}
.hh-sci-legend-item { display: inline-flex; align-items: center; gap: 6px; }

/* Shared compute dot — also used inside tiles. */
.hh-sci-tile-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
}
.hh-sci-tile-dot--browser,
.hh-sci-tile-compute--browser .hh-sci-tile-dot { background: var(--mt-teal, #0F766E); }
.hh-sci-tile-dot--server,
.hh-sci-tile-compute--server .hh-sci-tile-dot { background: transparent; border: 1.5px solid var(--mt-slate, #3B5A7A); }
[data-theme="dark"] .hh-sci-tile-dot--browser,
[data-theme="dark"] .hh-sci-tile-compute--browser .hh-sci-tile-dot { background: #34D8C4; }
[data-theme="dark"] .hh-sci-tile-dot--server,
[data-theme="dark"] .hh-sci-tile-compute--server .hh-sci-tile-dot { border-color: #8FB3DC; }

/* ─── Search box ──────────────────────────────────────────────────────── */
.hh-sci-search { position: relative; margin: 0 0 10px; }
.hh-sci-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-tertiary, #6B6B73);
  pointer-events: none;
}
.hh-sci-search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px;
  font-family: inherit;
  font-size: var(--guide-fs-sm);
  color: var(--text-primary, #1A1A1F);
  background: var(--bg-2, #fff);
  border: 1px solid var(--border-default, var(--guide-color-border-default, rgba(0,0,0,0.10)));
  border-radius: var(--radius-md, 8px);
  transition: border-color 150ms var(--motion-ease, ease), box-shadow 150ms var(--motion-ease, ease);
}
.hh-sci-search-input::placeholder { color: var(--text-tertiary, #9a9a9f); }
.hh-sci-search-input:focus-visible {
  outline: none;
  border-color: var(--mt-teal, #0F766E);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
}
.hh-sci-search-input::-webkit-search-cancel-button { display: none; }
.hh-sci-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 6px);
  color: var(--text-secondary, #4A4A52);
  cursor: pointer;
}
.hh-sci-search-clear:hover { background: var(--bg-3, rgba(0,0,0,0.05)); }
.hh-sci-search-clear i { width: 15px; height: 15px; }

/* ─── Toolbar: live count + hint ──────────────────────────────────────── */
.hh-sci-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.hh-sci-count {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-secondary, #4A4A52);
}
.hh-sci-toolbar-hint {
  font-size: var(--guide-fs-xs);
  color: var(--text-tertiary, #6B6B73);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hh-sci-toolbar-hint i { width: 13px; height: 13px; vertical-align: -2px; }

/* ─── Empty state ─────────────────────────────────────────────────────── */
.hh-sci-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary, #4A4A52);
}
.hh-sci-empty i { width: 26px; height: 26px; color: var(--text-tertiary, #9a9a9f); }
.hh-sci-empty p { margin: 8px 0 0; font-size: var(--guide-fs-sm); }
.hh-sci-empty-reset {
  border: none;
  background: transparent;
  color: var(--mt-teal, #0F766E);
  font: inherit;
  font-size: var(--guide-fs-sm);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
[data-theme="dark"] .hh-sci-empty-reset { color: #34D8C4; }

/* ─── Tool card grid — one uniform, polished card per tool ────────────── */
.hh-tool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--guide-sp-2, 8px);
  align-items: stretch;
}
@media (max-width: 560px) {
  .hh-tool-card-grid {
    grid-template-columns: 1fr;
    gap: var(--guide-sp-2, 8px);
  }
}

.hh-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 128px;
  padding: 15px 14px 13px;
  background: var(--guide-color-bg-2, #fff);
  border: 1px solid var(--guide-color-border-subtle, rgba(0,0,0,0.06));
  border-radius: var(--guide-radius-lg, 12px);
  box-shadow: var(--guide-shadow-rest);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: transform var(--guide-dur-base, 180ms) var(--guide-ease-out, ease),
              box-shadow var(--guide-dur-base, 180ms) var(--guide-ease-out, ease),
              border-color var(--guide-dur-base, 180ms) var(--guide-ease-out, ease);
}
/* Accent top edge carries the tool's signature colour. */
.hh-tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tile-accent, var(--guide-color-mt-teal, #0F766E));
  opacity: 0.85;
}
.hh-tool-card:hover {
  box-shadow: var(--guide-shadow-raised);
  border-color: var(--tile-accent, var(--guide-color-mt-teal, #0F766E)); /* fallback */
  border-color: color-mix(in srgb, var(--tile-accent, #0F766E) 55%, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.hh-tool-card:focus-visible {
  outline: 2px solid var(--tile-accent, var(--guide-color-mt-teal, #0F766E));
  outline-offset: 2px;
}
/* Gentle staggered reveal when the toolbox first paints. */
.hh-tool-card-grid > .hh-tool-card {
  animation: hh-tool-card-in var(--guide-dur-slow, 320ms) var(--guide-ease-out, ease) backwards;
  animation-delay: calc(var(--stagger-i, 0) * var(--guide-stagger, 60ms));
}
@media (prefers-reduced-motion: reduce) {
  .hh-tool-card { transition: none; }
  .hh-tool-card:hover { transform: none; }
  .hh-tool-card-grid > .hh-tool-card { animation: none; }
}

.hh-tool-card__top { display: contents; } /* its parts take the card's own grid cells */
.hh-tool-card__medallion {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--guide-radius-md, 8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tile-accent, var(--guide-color-mt-teal, #0F766E));
  background: var(--guide-color-bg-4, rgba(0,0,0,0.05)); /* fallback */
  background: color-mix(in srgb, var(--tile-accent, #0F766E) 13%, transparent);
}
.hh-tool-card__medallion i { width: 20px; height: 20px; }
/* Push the compute dot + info button to the right of the top row. */
.hh-tool-card__top .hh-sci-tile-compute { margin-left: auto; }

/* The card's one control. It is a <button> now rather than a <span>, because
   the CARD used to be role="button" and wrapped the ⓘ button — a control inside
   a control, and the app's largest a11y violation (27 nodes on /hub/streamflow).
   Everything here after the type ramp is undoing the UA button styling so the
   label looks exactly as it did as a span. */
.hh-tool-card__label {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  line-height: 1.25;
  color: var(--guide-color-ink);
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
/* Stretched hit area: the whole card stays clickable, but only ONE element is
   focusable for it. The ⓘ sits above this layer (see below) so it keeps its own
   click. Card must be position:relative for this to bound correctly — it
   already is. */
.hh-tool-card__label::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
/* Above the stretched layer, so the ⓘ is still its own target rather than being
   swallowed by the label's hit area. */
.hh-tool-card__top .guide-info-btn,
.hh-tool-card__top .hh-sci-tile-compute {
  position: relative;
  z-index: 1;
}
/* The focus ring belongs on the card, since the button's visible bounds are
   just the title text while its hit area is the whole tile. */
.hh-tool-card:focus-within {
  outline: 2px solid var(--guide-color-action);
  outline-offset: 2px;
}
.hh-tool-card__label:focus-visible { outline: none; }
.hh-tool-card__sub {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--guide-fs-xs);
  line-height: 1.3;
  color: var(--guide-color-ink-soft);
}
/* Quiet compute indicator — a single dot whose meaning the header legend
   teaches. The screen-reader text inside still announces on-device vs cloud. */
.hh-sci-tile-compute {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

/* ─── Models & visualizations grid (themed groups within one section) ──── */
.hh-models-section { margin-top: 14px; }

/* Hero section header — a designed band, not a bare list: a frosted accent
   medallion, an enlarged title, a readable lead-in, and a total-tools chip,
   plus a teal→gold underline tick. Shared by every hub's Models &
   Visualizations grid (one engine → an identical hero everywhere). The
   medallion mirrors .tu-story-card__icon so the section speaks the same hero
   language as the editorial story cards above it. */
.hh-models-section .hh-sci-header {
  position: relative;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--guide-color-line);
}
.hh-models-section .hh-sci-header-main { gap: 3px; flex: 1 1 auto; }
/* The section's name is its heading: the display serif, sentence case as
   written, ink. (It was 800-weight letter-spaced capitals under a teal-gold
   gradient underline.) */
.hh-models-section .hh-sci-eyebrow {
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-xl);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--guide-color-ink);
}
/* Icon now lives in the medallion — hide any legacy inline eyebrow icon. */
.hh-models-section .hh-sci-eyebrow i { display: none; }
.hh-models-section .hh-sci-hint {
  font-size: var(--guide-fs-sm);
  line-height: 1.5;
  color: var(--guide-color-ink-soft);
}

/* Icon tile: the action hue on the recessed paper ground, as on the hubs'
   door cards. */
/* Total-tools count chip — a quiet tabular pill anchored to the header's end. */
.hh-models-hero__count {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  line-height: 1.6;
  padding: 2px 10px;
  border-radius: var(--guide-radius-pill, 999px);
  font-variant-numeric: tabular-nums;
  color: var(--guide-color-ink-soft);
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
}

@media (max-width: 560px) {
  .hh-models-section .hh-sci-eyebrow { font-size: var(--guide-fs-xs); }
}

.hh-models-group { margin: 0 0 18px; }
.hh-models-group:last-child { margin-bottom: 0; }
.hh-models-group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--guide-color-text-secondary, #4A4A52);
}
.hh-models-group-label > i {
  width: 14px; height: 14px;
  color: var(--guide-color-ink-soft);
}
/* The group's count is a number, not a chip: the group heading already names
   the category, and a tint per group was a hue the data supplied for no reason. */
.hh-models-group-count {
  margin-left: auto;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--guide-color-ink-soft);
}
/* Tool render target inside the overlay body. */
.hh-model-mount { width: 100%; }
/* Loading state while a lazy tool module imports. */
.hh-models-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 8px;
  color: var(--guide-color-text-secondary, #4A4A52);
  font-size: var(--guide-fs-sm);
}
.hh-models-spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--guide-color-border-default, rgba(0,0,0,0.15));
  border-top-color: var(--guide-color-mt-teal, #0F766E);
  animation: hh-models-spin 700ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hh-models-spinner { animation-duration: 2s; }
}

/* ─── Modal shell ─────────────────────────────────────────────────────── */
/* ─── Fullscreen tool overlay ─────────────────────────────────────────── */
.hh-sci-modal {
  position: fixed;
  inset: 0;
  z-index: var(--guide-z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hh-sci-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--guide-scrim, rgba(17, 27, 36, 0.55));
  /* Mount animation (not a class toggle) so the overlay is always visible
     even when requestAnimationFrame is throttled. */
  animation: hh-modal-backdrop-in var(--guide-dur-base, 180ms) var(--guide-ease-out, ease) backwards;
}
.hh-sci-modal-card {
  position: relative;
  width: min(1180px, 100%);
  height: min(880px, 100%);
  max-height: 100%;
  background: var(--guide-color-bg-1, #F2EFE8);
  border: 1px solid var(--guide-color-border-subtle, rgba(0,0,0,0.06));
  border-radius: var(--guide-radius-xl, 14px);
  box-shadow: var(--guide-shadow-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: hh-modal-card-in var(--guide-dur-base, 180ms) var(--guide-ease-out, ease) backwards;
}
/* Accent sheen across the top of the overlay (tool colour). */
.hh-sci-modal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 1;
  background: var(--tile-accent, var(--guide-color-mt-teal, #0F766E));
}
.hh-sci-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--guide-color-border-subtle, rgba(0,0,0,0.08));
  background: var(--guide-color-bg-2, #fff);
}
.hh-sci-modal-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--guide-fs-base);
  font-weight: 800;
  color: var(--guide-color-text-primary, #1A1A1F);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hh-sci-modal-title i { width: 18px; height: 18px; flex: 0 0 auto; }
.hh-sci-modal-close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--guide-color-text-secondary, #4A4A52);
  padding: 6px;
  border-radius: var(--guide-radius-sm, 6px);
  display: inline-flex;
  transition: background var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease);
}
.hh-sci-modal-close:hover { background: var(--guide-color-bg-4, rgba(0,0,0,0.06)); }
.hh-sci-modal-close:focus-visible {
  outline: 2px solid var(--tile-accent, var(--guide-color-mt-teal, #0F766E));
  outline-offset: 2px;
}
.hh-sci-modal-close i { width: 20px; height: 20px; }
.hh-sci-modal-body {
  flex: 1 1 auto;
  padding: 18px;
  overflow-y: auto;
}
@media (prefers-reduced-motion: reduce) {
  .hh-sci-modal-backdrop,
  .hh-sci-modal-card { animation: none; }
}
@media (max-width: 560px) {
  .hh-sci-modal { padding: 0; }
  .hh-sci-modal-card {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
  }
}

/* ─── Inputs and outputs inside science tools ─────────────────────────── */
.hh-sci-card {
  background: var(--bg-2, #fff);
  border: 1px solid var(--border-default, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.hh-sci-card-title {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  color: var(--text-secondary, #4A4A52);
  margin: 0 0 8px;
}
.hh-sci-note { font-size: var(--guide-fs-xs); color: var(--text-tertiary, #6B6B73); margin: 0 0 8px; line-height: 1.4; }
.hh-sci-note code { font-family: var(--font-mono, monospace); font-size: var(--guide-fs-2xs); padding: 1px 4px; background: var(--bg-3, #F7F5F0); border-radius: 3px; }
.hh-sci-label { display: block; font-size: var(--guide-fs-2xs); font-weight: 600; color: var(--text-secondary, #4A4A52); margin: 6px 0 3px; }
.hh-sci-input {
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: var(--guide-fs-xs);
  padding: 5px 7px;
  border: 1px solid var(--border-default, rgba(0,0,0,0.12));
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-2, #fff);
  color: var(--text-primary, #1A1A1F);
}
.hh-sci-textarea { min-height: 70px; resize: vertical; line-height: 1.4; }
.hh-sci-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hh-sci-run, .hh-sci-secondary {
  font-family: inherit;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms var(--motion-ease, ease);
}
.hh-sci-run {
  background: var(--mt-teal, #0F766E);
  color: var(--guide-color-text-on-accent, #fff);
}
.hh-sci-run:hover { background: #0d655e; }
.hh-sci-secondary {
  background: var(--bg-3, #F7F5F0);
  color: var(--text-secondary, #4A4A52);
  border-color: var(--border-default, rgba(0,0,0,0.08));
}
.hh-sci-out { font-size: var(--guide-fs-xs); color: var(--text-primary, #1A1A1F); min-height: 40px; }
.hh-sci-empty { color: var(--text-tertiary, #6B6B73); font-style: italic; }
.hh-sci-error { color: var(--status-critical, var(--guide-color-status-crit)); font-weight: 600; }

/* Result computed from a generated input series. Sits ABOVE the numbers rather
   than under them: the figures below are real arithmetic over invented weather,
   and a reader who has already read the KPI has read the wrong thing. */
.hh-sci-synthetic {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--guide-radius-sm, 4px);
  background: rgba(162, 28, 175, 0.08);
  font-size: var(--guide-fs-2xs);
  line-height: 1.5;
}
.hh-sci-synthetic strong { color: #A21CAF; }
.hh-sci-pre {
  font-family: var(--font-mono, monospace);
  font-size: var(--guide-fs-2xs);
  background: var(--bg-3, #F7F5F0);
  padding: 8px;
  border-radius: 4px;
  overflow: auto;
  max-height: 280px;
  margin: 0;
}
.hh-sci-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  margin-top: 6px;
}
.hh-sci-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.hh-sci-kpi {
  background: var(--bg-3, #F7F5F0);
  border-radius: var(--radius-sm, 4px);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}
.hh-sci-kpi-label {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.4px;
  color: var(--text-tertiary, #6B6B73);
}
.hh-sci-kpi-val {
  font-family: var(--font-mono, monospace);
  font-size: var(--guide-fs-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #1A1A1F);
  margin-top: 2px;
}

/* ── Phase C — site metadata + DDF table + 2-col input row ── */
.hh-sci-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.hh-sci-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--guide-fs-xs);
  font-family: var(--font-mono, monospace);
}
.hh-sci-table th, .hh-sci-table td {
  text-align: right;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-default, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  font-variant-numeric: tabular-nums;
}
.hh-sci-table th {
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary, #4A4A52);
  background: var(--bg-3, #F7F5F0);
}
.hh-sci-table--matrix th { white-space: nowrap; }
.hh-sci-table--matrix td { color: var(--text-primary, #1A1A1F); }

/* ── Phase E — persona row (filters tile visibility) ── */
.hh-persona-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}
.hh-persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--guide-color-line-strong);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink-soft);
  cursor: pointer;
  transition: border-color 150ms var(--motion-ease, ease),
    color 150ms var(--motion-ease, ease);
}
.hh-persona-chip i { width: 13px; height: 13px; }
.hh-persona-chip:hover {
  border-color: var(--guide-color-ink-soft);
  color: var(--guide-color-ink);
}
.hh-persona-chip--active {
  border-color: var(--guide-color-action);
  box-shadow: inset 0 0 0 1px var(--guide-color-action);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink);
}
.hh-persona-chip--active i { color: var(--guide-color-action); }
@media (prefers-reduced-motion: reduce) {
  .hh-persona-chip { transition: none; }
}

/* ─── Phase F++ — Cockpit KPI strip at top of hub ──────────────────────── */
.hh-cockpit {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--bg-2, #fff);
  border: 1px solid var(--border-default, rgba(0,0,0,0.08));
  border-radius: var(--radius-lg, 12px);
  position: relative;
}
.hh-cockpit::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mt-red, #DC2626) 0%, var(--mt-gold, #C8932F) 50%, var(--mt-teal, #0F766E) 100%);
  border-top-left-radius: var(--radius-lg, 12px);
  border-top-right-radius: var(--radius-lg, 12px);
}
.hh-cockpit-kpi {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}
.hh-cockpit-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--guide-color-mt-blue, #3B5A7A);
}
.hh-cockpit-icon i { width: 18px; height: 18px; }
/* Semantic cockpit icon colors — moved from inline styles */
.hh-cockpit-icon--swe      { color: var(--guide-color-mt-blue, #3B5A7A); }
.hh-cockpit-icon--drought  { color: var(--guide-color-mt-amber, #D97706); }
.hh-cockpit-icon--lowflow  { color: var(--guide-color-severity-crit, var(--guide-color-status-crit)); }
.hh-cockpit-icon--reservoir{ color: var(--guide-color-mt-teal, #0F766E); }
.hh-cockpit-icon--flood    { color: var(--hh-flood-color, #7C3AED); }
.hh-cockpit-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hh-cockpit-val {
  font-family: var(--font-mono, monospace);
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.1;
}
.hh-cockpit-label {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  color: var(--text-tertiary, #6B6B73);
  margin-top: 2px;
}
@media (max-width: 700px) {
  .hh-cockpit {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gr-percentile-header [data-lucide],
.gr-percentile-header svg { width: 13px; height: 13px; vertical-align: -2px; }

/* One instream-flow right: name on the left, severity badge on the right. */
.gr-ifr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--guide-sp-2, 8px);
  padding: 4px 0;
  font-size: var(--guide-fs-sm, 13px);
}
