/* ============================================================================
   Hazard Map — hazards.terranalytics.com
   ============================================================================ */

/* Google Fonts loaded via <link> in app.R header for non-blocking load */

:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-card: #1e2433;
  --bg-card-hover: #252b3d;
  --border: #2a3142;
  --text-primary: #e8edf5;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body);
}

/* ── Disclaimer Header ─────────────────────────────────────────────────────── */

.disclaimer-bar {
  background: linear-gradient(90deg, #1a1000 0%, #2a1a00 50%, #1a1000 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.5rem 1.5rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #e6be5a;
  text-align: center;
  font-family: var(--font-body);
  position: sticky;
  top: 0;
  z-index: 1100;
}

.disclaimer-bar strong {
  color: #f59e0b;
  font-weight: 600;
}

.stale-banner {
  background: linear-gradient(90deg, #2a0a0a 0%, #3a1010 50%, #2a0a0a 100%);
  border-bottom: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.4rem 1.5rem;
  font-size: 0.72rem;
  color: #ff8a8a;
  text-align: center;
  font-family: var(--font-body);
}
.stale-banner i { margin-right: 0.4rem; color: #ef4444; }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */

.navbar {
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--font-display);
}

.navbar .navbar-brand {
  color: var(--accent-amber) !important;
  font-family: var(--font-display);
  font-weight: 600;
}

.navbar .nav-link {
  color: var(--text-secondary) !important;
  font-size: 0.85rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--text-primary) !important;
}

/* ── Home Page ──────────────────────────────────────────────────────────────── */

.home-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.home-hero {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.home-hero .hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.home-hero .hero-search {
  max-width: 480px;
  margin: 0 auto;
}

.home-hero .hero-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  width: 100%;
  font-family: var(--font-body);
}

.home-hero .hero-search input::placeholder { color: var(--text-muted); }
.home-hero .hero-search input:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

/* ── Section Labels ─────────────────────────────────────────────────────────── */

.section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-sub {
  font-weight: 400;
  color: var(--text-muted);
}

/* ── Earthquake Dashboard Row ───────────────────────────────────────────────── */

.home-row-eq {
  display: grid;
  grid-template-columns: 280px 1fr 1fr;
  gap: 1rem;
  min-height: 320px;
}

.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  transition: background 0.2s, border-color 0.2s;
}

/* Overview card: big number + bars */
.eq-overview-card {
  display: flex;
  flex-direction: column;
}

.eq-big-number {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.eq-big-val {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent-red);
  line-height: 1;
}

.eq-big-unit {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.eq-largest {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.eq-largest-place {
  margin-left: 0.3rem;
}

/* Magnitude bars */
.mag-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.mag-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mag-bar-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.mag-bar-track {
  flex: 1;
  height: 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}

.mag-bar-fill {
  height: 100%;
  border-radius: 3px;
  min-width: 2px;
  transition: width 0.6s ease;
}

.mag-bar-count {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Feed card */
.eq-feed-card {
  display: flex;
  flex-direction: column;
}

.eq-feed-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.eq-feed-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.eq-feed-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.eq-feed-row:hover {
  background: var(--bg-card-hover);
}

.eq-feed-mag {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  width: 42px;
  flex-shrink: 0;
}

.eq-feed-place {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eq-feed-ago {
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.eq-feed-footer {
  margin-top: auto;
  padding-top: 0.6rem;
}

.eq-feed-footer a {
  font-size: 0.78rem;
  color: var(--accent-amber);
  text-decoration: none;
  cursor: pointer;
}

.eq-feed-footer a:hover {
  text-decoration: underline;
}

/* (mini-map card removed)
}

/* ── Hazard Selector ─────────────────────────────────────────────────────── */

.hazard-selector {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  justify-content: center;
}

.hazard-sel-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  position: relative;
}

.hazard-sel-btn:hover:not(.hazard-sel-disabled) {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.hazard-sel-btn.hazard-sel-active {
  background: var(--bg-card-hover);
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.hazard-sel-disabled {
  opacity: 0.35;
  cursor: default;
}

.hazard-sel-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.hazard-sel-name {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hazard-sel-count {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
}

.hazard-sel-live {
  font-family: var(--font-display);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 3px;
  padding: 0.05rem 0.25rem;
}

/* ── Value Props ────────────────────────────────────────────────────────────── */

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

.value-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.value-icon {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.value-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.value-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Map Page ───────────────────────────────────────────────────────────────── */

.map-container {
  display: flex;
  height: calc(100vh - 120px);
}

.map-sidebar {
  width: 360px;
  min-width: 360px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.map-main {
  flex: 1;
}

.map-main .leaflet-container {
  height: 100% !important;
  background: var(--bg-primary) !important;
}

/* ── Peak Maps Switcher ─────────────────────────────────────────────────────── */

.pm-switcher { position: relative; }

.pm-trigger {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font-display);
}

.pm-trigger:hover {
  border-color: var(--accent-amber);
  color: var(--text-primary);
}

.pm-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 220px;
  z-index: 1200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pm-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.pm-switcher:hover .pm-dropdown,
.pm-switcher:focus-within .pm-dropdown { display: block; }

.pm-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.pm-row:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.pm-current {
  background: rgba(245, 158, 11, 0.08);
  color: var(--accent-amber) !important;
}

.pm-logo { width: 22px; height: 22px; }

.pm-row-text { display: flex; flex-direction: column; }

.pm-name {
  font-weight: 600;
  font-family: var(--font-display);
}

.pm-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pm-divider {
  border-color: var(--border);
  margin: 0.3rem 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .home-row-eq {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .home-row-eq {
    grid-template-columns: 1fr;
  }
  .home-row-value {
    grid-template-columns: 1fr;
  }
  .map-sidebar {
    display: none;
    position: fixed; top: 60px; left: 0; bottom: 0; z-index: 1100;
    width: min(280px, 85vw); overflow-y: auto;
    background: var(--bg-secondary, #1a1f2e);
    border-right: 1px solid var(--border, #2d333b);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .map-sidebar.mobile-open {
    display: block !important;
  }
  .state-panel {
    display: none;
  }
  .mobile-layer-toggle {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  .home-hero h1 {
    font-size: 1.6rem;
  }
  .disclaimer-bar {
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ── Mobile layer toggle ──────────────────────────────────────────────────── */
.mobile-layer-toggle {
  display: none;
  position: fixed; bottom: 88px; right: 16px; z-index: 1050;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-amber, #f59e0b); color: #000;
  border: none; cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.mobile-layer-toggle:hover { transform: scale(1.1); }

/* ── Sidebar backdrop ─────────────────────────────────────────────────────── */
.hz-map-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 1090;
  background: rgba(0,0,0,0);
  transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.hz-map-backdrop.hz-backdrop-visible {
  display: block;
  background: rgba(0,0,0,0.45);
}

/* ── State Profile Panel ────────────────────────────────────────────────────── */
.state-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  min-width: 360px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 850;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}

.state-panel-header {
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 2;
}

.state-panel-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.state-panel-sub {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.state-panel-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  line-height: 1.4;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.state-panel-close:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.state-year-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.state-year-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 5px;
  font-size: 0.77rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-display);
}
.state-year-btn:hover { border-color: var(--accent-amber); color: var(--accent-amber); }
.state-year-btn.sy-active {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #000;
}

.hazard-row {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #1a2030;
}
.hazard-row:last-child { border-bottom: none; }

.hazard-row-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.hazard-row-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  flex: 1;
}

.hazard-risk-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hazard-bar-track {
  height: 3px;
  background: #1e2530;
  border-radius: 2px;
  margin-bottom: 0.3rem;
}
.hazard-bar-fill {
  height: 3px;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.hazard-stat {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.hazard-notable {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.1rem 0 0.1rem 0.55rem;
  border-left: 2px solid var(--border);
  margin-top: 0.1rem;
  line-height: 1.5;
}

.state-live-section {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  margin-top: auto;
}
.state-live-section h4 {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}
.state-live-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
}
.state-live-count {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.82rem;
  min-width: 28px;
  text-align: right;
}

/* ── Info Bubbles / Tooltips ───────────────────────────────────────────────── */

.hz-info-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  cursor: help;
}

.hz-info-tip .hz-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
  font-family: var(--font-display);
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.hz-info-tip:hover .hz-info-icon {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.hz-info-tip .hz-info-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e2433;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: normal;
  width: 260px;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  pointer-events: none;
  font-family: var(--font-body);
}

.hz-info-tip:hover .hz-info-text {
  display: block;
}

/* ── Seasonal Banner ──────────────────────────────────────────────────────── */

.seasonal-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.seasonal-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.seasonal-banner-label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

/* ── Risk explanation text in state profile ────────────────────────────────── */

.hazard-risk-explain {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.15rem;
  font-style: italic;
}

/* ── Source link in popups ──────────────────────────────────────────────────── */

.popup-source-link {
  color: #f59e0b;
  font-size: 0.72rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.popup-source-link:hover {
  text-decoration: underline;
}

/* ── Disclaimer per-hazard freshness ──────────────────────────────────────── */

.disclaimer-freshness {
  display: inline;
  font-size: 0.65rem;
  color: #b8973a;
}

/* ── Hero Autocomplete Dropdown ───────────────────────────────────────────── */

.hero-ac-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: 320px;
  overflow-y: auto;
}

.hero-ac-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: background 0.1s;
  font-family: var(--font-body);
}

.hero-ac-item:hover,
.hero-ac-item.hero-ac-active {
  background: var(--bg-card-hover);
}

.hero-ac-city {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-ac-state {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-ac-pop {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ── Mobile State Profile Sheet ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .state-panel.mobile-sheet {
    display: flex !important;
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: 70vh;
    border-left: none !important;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    z-index: 1200;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    overflow-y: auto;
  }
  .state-panel.mobile-sheet.mobile-sheet-open {
    transform: translateY(0);
  }
  /* Show drag handle */
  .state-panel.mobile-sheet::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0.5rem auto 0;
    flex-shrink: 0;
  }
}

/* ── Drought Layer ── */
.drought-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.drought-legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-secondary); }
.drought-legend-swatch { width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0; }

/* ── FEMA Flood Zone Legend ── */
.fema-flood-legend {
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 8px 10px;
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: 6px;
}
.fema-flood-legend-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0ea5e9;
  margin-bottom: 6px;
  font-family: var(--font-display);
}
.fema-flood-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.fema-flood-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.85;
}
.fema-flood-legend-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── City panel FEMA tip ── */
.city-panel-fema-tip {
  width: 100%;
  margin-top: 0.5rem;
  padding: 6px 10px;
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.12);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* =========================================================================
   Loading States
   ========================================================================= */

/* Pulse the active hazard button icon while dashboard is loading */
@keyframes hz-btn-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}
.hazard-sel-btn.hazard-sel-active .hazard-sel-icon {
  animation: hz-btn-pulse 1.2s ease-in-out infinite;
}

/* Hide the default Shiny busy spinner — we handle this ourselves */
.shiny-busy-indicator { display: none !important; }

/* ── Disconnect overlay ─────────────────────────────────────────────────── */
#shiny-disconnected-overlay {
  background: #0f1419ee !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
  z-index: 99998 !important;
}
#shiny-disconnected-overlay::before {
  content: 'Connection lost';
  font-size: 1.4rem;
  font-weight: 600;
  color: #f59e0b;
  margin-bottom: 0.5rem;
}
#shiny-disconnected-overlay::after {
  content: 'Attempting to reconnect\2026';
  font-size: 0.9rem;
  color: #e8edf5;
  opacity: 0.7;
}

/* Dashboard recalculating skeleton */
#home_dashboard.recalculating {
  position: relative;
  min-height: 200px;
}
#home_dashboard.recalculating::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 158, 11, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  border-radius: 8px;
  pointer-events: none;
}
@keyframes hz-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: no-preference) {
  #home_dashboard.recalculating::after {
    animation: hz-shimmer 1.4s ease infinite;
  }
}

/* Skeleton block placeholders shown while loading */
.hz-skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
}
@media (prefers-reduced-motion: no-preference) {
  .hz-skeleton { animation: hz-shimmer 1.4s ease infinite; }
}

/* =========================================================================
   Active-first hazard selector improvements
   ========================================================================= */
.hazard-sel-btn.hazard-sel-has-active {
  border-color: rgba(245,158,11,0.35);
  order: -1;
}

.hazard-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}

/* City search result panel */
.city-hazard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  animation: hz-fade-in 0.25s ease;
}
@keyframes hz-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.city-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.city-panel-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.city-panel-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: auto;
}
.city-panel-hazards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.city-risk-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
.city-risk-grade {
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font-display);
  border: 2px solid;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.city-risk-label {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.city-risk-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.city-panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
}
.city-panel-chip.active {
  border-color: rgba(245,158,11,0.4);
  color: var(--accent-amber);
  background: rgba(245,158,11,0.07);
}
.city-panel-chip.clickable {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.city-panel-chip.clickable:hover {
  background: rgba(245,158,11,0.14);
  border-color: var(--accent-amber);
}

/* ── Flood insurance info section ── */
.city-panel-flood-info {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.city-panel-flood-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}
.city-panel-flood-list {
  margin: 0; padding-left: 1.1rem;
}
.city-panel-flood-list li { margin-bottom: 0.2rem; }
.city-panel-flood-list b { color: var(--text-primary); }
.city-panel-flood-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.city-panel-flood-links a {
  font-size: 0.68rem;
  font-weight: 600;
  color: #0ea5e9;
  text-decoration: none;
}
.city-panel-flood-links a:hover { text-decoration: underline; }
.city-panel-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.35rem;
  border-radius: 4px;
  line-height: 1.3;
  margin-left: auto;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.city-panel-close:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.city-panel-none {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

.hz-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(6,182,212,0.4);
  background: rgba(6,182,212,0.08);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hz-btn-sm:hover {
  background: rgba(6,182,212,0.15);
  border-color: rgba(6,182,212,0.65);
}

/* ── Collapsed city panel (after "View on Map") ── */

.city-panel-collapsed {
  display: none !important;
}

.city-panel-minibar {
  display: flex;
  align-items: center;
  max-width: 440px;
  width: 100%;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  animation: hz-fade-in 0.2s ease;
}
.city-panel-minibar:hover {
  border-color: rgba(6,182,212,0.5);
}
.city-mini-expand {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent-cyan);
  opacity: 0.7;
}

/* ── Pill reorder override ── */

.hz-pills-reordered .hz-pill.hz-pill-has-active {
  order: unset;
}

/* =========================================================================
   Map-as-Home Layout
   ========================================================================= */

.hz-app {
  display: flex;
  height: calc(100vh - 120px);
  position: relative;
}

.map-main {
  position: relative;
}

/* ── Floating Overlay Controls ── */

.hz-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 800;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hz-overlay > * { pointer-events: auto; }

.hz-float-search {
  width: 100%;
  max-width: 440px;
  position: relative;
}
.hz-float-search input {
  width: 100%;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-family: var(--font-body);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.hz-float-search input::placeholder { color: var(--text-muted); }
.hz-float-search input:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.15), 0 2px 12px rgba(0,0,0,0.3);
}

/* Search loading state — amber border pulse while geocoding */
#hero_search.hz-searching {
  border-color: var(--accent-amber) !important;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.25), 0 2px 12px rgba(0,0,0,0.3) !important;
}

/* ── Map loading overlay (shown during heavy layer loads like drought) ── */
.map-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 20, 25, 0.62);
  backdrop-filter: blur(3px);
  pointer-events: none;
  gap: 10px;
  border-radius: 0;
}
.map-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-amber);
  border-radius: 50%;
  animation: map-layer-spin 0.75s linear infinite;
}
@keyframes map-layer-spin { to { transform: rotate(360deg); } }
.map-loading-label {
  color: var(--accent-amber);
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* City area panel inside overlay */
.hz-overlay .city-hazard-panel {
  max-width: 440px;
  width: 100%;
}

/* ── Bottom bar: pills + seasonal ── */

.hz-bottom-bar {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  z-index: 800;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hz-bottom-bar > * { pointer-events: auto; }

/* ── Hazard Pills ── */

.hz-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 720px;
}

.hz-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
  color: var(--text-secondary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.hz-pill:hover {
  border-color: rgba(245,158,11,0.5);
  background: rgba(30, 36, 51, 0.95);
  transform: translateY(-1px);
}
.hz-pill.hz-pill-active {
  border-color: var(--accent-amber);
  background: rgba(245,158,11,0.12);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(245,158,11,0.2);
}
.hz-pill.hz-pill-has-active {
  border-color: rgba(245,158,11,0.35);
  order: -1;
}

.hz-pill-icon { font-size: 0.7rem; flex-shrink: 0; }
.hz-pill-name { font-weight: 600; font-size: 0.75rem; font-family: var(--font-display); }
.hz-pill-count { font-weight: 700; font-size: 0.68rem; }
.hz-pill-live {
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 3px;
  padding: 0.02rem 0.2rem;
}

/* ── Seasonal Context Pill ── */

.hz-seasonal-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.62rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.hz-seasonal-label {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── Shared bottom-sheet base (HzSheet) ── */
.hz-sheet {
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.hz-sheet--dragging { transition: none !important; }

/* ── Dashboard Panel (slides from right) ── */

.hz-dash-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 480px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
.hz-dash-panel.hz-dash-open {
  transform: translateX(0);
}

.hz-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.hz-dash-title {
  font-family: var(--font-display);
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hz-dash-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  line-height: 1.4;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.hz-dash-close:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ── Dashboard hazard switcher (mobile only) ─────────────────────────────── */
.hz-dash-switcher {
  display: none; /* hidden on desktop */
}
@media (max-width: 900px) {
  .hz-dash-switcher {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 2px;
    padding: 5px 8px 6px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
  }
  .hz-dash-switcher::-webkit-scrollbar { display: none; }
  .hz-dsw-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    min-width: 52px;
  }
  .hz-dsw-btn:active { background: rgba(255,255,255,0.05); }
  .hz-dsw-btn.hz-dsw-active {
    background: rgba(255,255,255,0.07);
    border-color: var(--border);
  }
  .hz-dsw-icon { font-size: 1rem; line-height: 1; }
  .hz-dsw-label {
    font-size: 0.52rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
  }
  .hz-dsw-btn.hz-dsw-active .hz-dsw-label { color: var(--text-secondary); }
}

.hz-dash-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

/* Dashboard content: single-column layout inside the panel */
.hz-dash-body .home-row-eq {
  grid-template-columns: 1fr !important;
  gap: 0.75rem;
}
.hz-dash-body .section-label {
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  padding: 0.6rem 0.75rem;
  border-radius: 6px 6px 0 0;
  margin: 0 -0.75rem;
  margin-bottom: 0.4rem;
}
.hz-dash-body .home-card {
  padding: 1.1rem;
}

/* ── Section dividers in dashboard panel ───────────────────────────────────── */
.hz-section-divider {
  display: none;
}
.hz-dash-body .hz-section-divider {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.2rem;
}
.hz-dash-body .hz-section-divider:first-child {
  border-top: none;
  padding-top: 0;
}

/* ── Severity color classes ────────────────────────────────────────────────── */
.hz-severity-extreme  { color: #ef4444 !important; }
.hz-severity-severe   { color: #f97316 !important; }
.hz-severity-moderate { color: #facc15 !important; }
.hz-severity-minor    { color: var(--text-muted) !important; }

/* ── Feed row sub-elements ─────────────────────────────────────────────────── */
.eq-feed-felt {
  font-size: 0.6rem;
  color: #06b6d4;
  flex-shrink: 0;
  margin-left: 2px;
}
.eq-feed-tsunami {
  font-size: 0.6rem;
  font-weight: 700;
  color: #06b6d4;
  flex-shrink: 0;
}

/* ── Fetch time in section labels ──────────────────────────────────────────── */
.hz-fetch-time {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: auto;
  font-weight: 400;
  letter-spacing: normal;
}

/* ── City panel enrichment ─────────────────────────────────────────────────── */
.city-panel-notables {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.city-panel-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.city-notable-row {
  display: flex;
  align-items: baseline;
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
}
.city-notable-text {
  flex: 1;
}
.city-notable-date {
  font-size: 0.62rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 0.3rem;
}
.city-chip-cost-note {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

/* ── Dashboard skeleton loading ────────────────────────────────────────────── */
.hz-skeleton-card {
  height: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.75rem;
}
.hz-skeleton-row {
  height: 36px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  margin: 0.5rem 0.75rem;
  position: relative;
  overflow: hidden;
}
.hz-skeleton-hist {
  height: 54px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  margin-top: 0.75rem;
  position: relative;
  overflow: hidden;
}
.hz-skeleton-card::after,
.hz-skeleton-row::after,
.hz-skeleton-hist::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: hz-shimmer 1.4s ease-in-out infinite;
}

/* ── Dashboard panel responsive ── */
@media (max-width: 900px) {
  .hz-dash-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    top: auto;
    bottom: 0;
    height: 85vh;
    max-height: 85vh;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
  }
  /* Peek: show top 35vh of the panel */
  .hz-dash-panel.hz-dash-peek {
    transform: translateY(50vh);
  }
  .hz-dash-panel.hz-dash-open {
    transform: translateY(0);
  }
  .hz-pills {
    max-width: 100%;
    gap: 4px;
  }
  .hz-pill-name {
    font-size: 0.65rem;
  }
  .hz-seasonal-pill {
    display: none;
  }
}

/* Hide the single Map tab link in navbar — not needed with one panel */
.navbar .nav-link[data-value="Map"] {
  display: none;
}

/* ── Composite Risk Score Badge ───────────────────────────────────────────── */

.composite-score-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.12);
}

.composite-score-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid;
}

.composite-score-info {
  flex: 1;
  min-width: 0;
}

.composite-score-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.composite-score-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.composite-score-number {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ── Hazard row with sparkline ────────────────────────────────────────────── */

.hazard-trend {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Cost/Insurance Callout ───────────────────────────────────────────────── */

.hazard-cost-callout {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.35rem 0.55rem;
  margin-top: 0.2rem;
  background: rgba(245, 158, 11, 0.04);
  border-left: 2px solid rgba(245, 158, 11, 0.3);
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

.hazard-cost-callout strong {
  color: var(--accent-amber);
  font-weight: 600;
}

/* ── State Compare ────────────────────────────────────────────────────────── */

.state-compare-section {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.08);
}

.state-compare-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
}

.state-compare-trigger:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.state-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.compare-cell {
  text-align: center;
  padding: 0.3rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.compare-cell-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-display);
}

.compare-cell-value {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-top: 0.1rem;
}

.compare-picker {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.compare-state-tag {
  background: var(--accent-amber);
  color: #000;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-display);
}

.compare-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  font-family: var(--font-display);
  cursor: pointer;
  min-width: 140px;
}

.compare-composite {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.compare-composite-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.compare-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.compare-row:hover {
  background: rgba(255,255,255,0.02);
}

.compare-header {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.compare-header strong {
  font-size: 0.72rem;
  font-family: var(--font-display);
  color: var(--text-secondary);
}

.compare-hazard-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-secondary);
}

.compare-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
}

.compare-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.compare-score {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-muted);
  min-width: 22px;
  text-align: right;
}

.compare-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* =========================================================================
   Mobile Overhaul
   ========================================================================= */

/* Use dynamic viewport height for mobile browser chrome */
@supports (height: 100dvh) {
  .hz-app { height: calc(100dvh - 120px); }
}

@media (max-width: 900px) {
  /* ── Shrink disclaimer on mobile ── */
  .disclaimer-bar {
    font-size: 0.6rem;
    padding: 0.3rem 0.6rem;
    line-height: 1.35;
  }
  .disclaimer-bar .disclaimer-freshness { display: none; }

  /* ── App height: less chrome overhead on mobile ── */
  .hz-app { height: calc(100vh - 90px); }
  @supports (height: 100dvh) {
    .hz-app { height: calc(100dvh - 90px); }
  }

  /* ── Horizontal-scroll pills instead of wrapping ── */
  .hz-bottom-bar {
    bottom: 6px;
    left: 0;
    right: 0;
    gap: 0;
  }
  .hz-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding: 4px 8px;
    gap: 5px;
    justify-content: flex-start;
  }
  .hz-pills::-webkit-scrollbar { display: none; }
  .hz-pill {
    flex-shrink: 0;
    padding: 5px 10px;
  }
  .hz-pill-count { font-size: 0.6rem; }

  /* ── Layer toggle: right side, above pills, thumb zone ── */
  .mobile-layer-toggle {
    bottom: 88px;
    right: 16px;
    left: auto;
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  /* ── Search overlay: tighter on mobile ── */
  .hz-overlay {
    top: 6px;
    left: 6px;
    right: 6px;
  }
  .hz-float-search { max-width: 100%; }
  .hz-float-search input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
  }

  /* ── City panel: compact on mobile ── */
  .hz-overlay .city-hazard-panel {
    max-width: 100%;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0;
  }
  .city-panel-title { font-size: 0.85rem; }
  .city-panel-chip { font-size: 0.68rem; padding: 0.2rem 0.45rem; }
  .city-risk-badge { padding: 0.3rem 0.5rem; }
  .city-risk-grade { width: 28px; height: 28px; font-size: 0.75rem; }
  .city-panel-fema-tip { font-size: 0.65rem; }

  /* ── Dashboard slide-up: add drag handle ── */
  .hz-dash-panel::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 10px auto 4px;
    opacity: 0.6;
  }
  .hz-dash-head { padding: 0.5rem 0.75rem; }
  .hz-dash-body { padding: 0.5rem; }

  /* ── Collapsed city minibar: full width on mobile ── */
  .city-panel-minibar { max-width: 100%; }
}

/* ── Extra-small phones ── */
@media (max-width: 480px) {
  .disclaimer-bar { display: none; }
  .hz-app { height: calc(100vh - 56px); }
  @supports (height: 100dvh) {
    .hz-app { height: calc(100dvh - 56px); }
  }

  .hz-pill-name { font-size: 0.6rem; }
  .hz-pill-live { display: none; }
  .hz-pill { padding: 4px 7px; gap: 2px; }

  .hz-overlay .city-hazard-panel { padding: 0.5rem 0.65rem; }
  .city-panel-header { margin-bottom: 0.4rem; }
  .city-panel-hazards { gap: 0.3rem; }

  .hz-dash-panel { height: 80vh; max-height: 80vh; }

  /* Navbar tighter */
  .navbar { padding: 0.25rem 0.5rem !important; }
  .navbar .navbar-brand { font-size: 0.85rem !important; }
  .pm-switcher { display: none; }
}

/* ── Accessibility ──────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-to-content {
  position: absolute; top: -100%; left: 16px; z-index: 100000;
  padding: 8px 16px; background: #f59e0b; color: #0f1419;
  border-radius: 0 0 6px 6px; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: top 0.2s ease;
}
.skip-to-content:focus { top: 0; }
*:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }

/* ── Mobile tap targets (44px minimum per WCAG 2.5.5) ──────────────────── */
@media (max-width: 767.98px) {
  .nav-pills .nav-link, .nav-tabs .nav-link { min-height: 44px; padding: 10px 16px; }
  .navbar-nav .nav-link { min-height: 44px; }
  .btn, .btn-sm { min-height: 44px; }
  .dropdown-item { min-height: 44px; padding: 10px 16px; }
  .leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
  .form-check-input { width: 20px; height: 20px; }
  .form-check-label { min-height: 44px; display: flex; align-items: center; }
  .hz-pill { min-height: 44px; padding: 8px 12px; }
}

/* ── Overflow-x prevention ────────────────────────────────────────────────── */
html, body { overflow-x: hidden !important; max-width: 100vw !important; }

/* ── Mobile fixes Round 2 — compare panel, popups, disclaimers (March 2026) ── */
@media (max-width: 900px) {
  .state-panel { width: 100% !important; min-width: 0 !important; }
}
@media (max-width: 600px) {
  .compare-row { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .compare-picker { flex-direction: column !important; gap: 0.5rem !important; }
  .compare-select { width: 100% !important; min-width: 0 !important; }
  .disclaimer-bar { display: block !important; max-height: 60px; overflow-y: auto; font-size: 0.65rem !important; padding: 0.25rem 0.5rem !important; }
  /* snap heights override — peek shows ~28vh on small phones */
  .hz-dash-panel { height: 80vh !important; max-height: 80vh !important; }
  .hz-pills { padding-left: 12px !important; }
  .stale-banner { padding: 0.3rem 0.6rem !important; font-size: 0.65rem !important; }
}

/* ── Reset Map button ───────────────────────────────────────────────────── */
.hz-reset-map-btn {
  position: absolute;
  bottom: 80px;
  left: 16px;
  z-index: 1050;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1a1f2eee;
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 6px;
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.hz-reset-map-btn:hover {
  background: #f59e0b;
  color: #0f1419;
}

/* ── Flood Zone lookup ──────────────────────────────────────────────────── */
.city-flood-zone {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0;
}

/* ── State search dropdown ──────────────────────────────────────────────── */
.hz-state-search { position: absolute; top: 70px; right: 16px; z-index: 1050; max-width: calc(100vw - 32px); }
.hz-state-search .selectize-input { background: #1a1f2eee !important; border-color: rgba(245,158,11,0.3) !important; min-width: 240px; max-width: min(260px, calc(100vw - 32px)); }

/* =========================================================================
   HAZARDS — MOBILE REVAMP (April 2026)
   ========================================================================= */

/* ── Compact disclaimer: clean 24px strip on very small screens ── */
@media (max-width: 480px) {
  .disclaimer-bar {
    display: block !important;
    max-height: 24px !important;
    overflow: hidden !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0.12rem 0.6rem !important;
    font-size: 0.52rem !important;
    line-height: 1.4 !important;
  }
  .disclaimer-bar .disclaimer-freshness { display: none !important; }
}

/* ── Navbar slim on scroll ── */
.navbar { transition: padding 0.2s ease; }
.hz-navbar-slim .navbar {
  padding-top: 0.1rem !important;
  padding-bottom: 0.1rem !important;
}
.hz-navbar-slim .navbar .navbar-brand { font-size: 0.9rem !important; }

/* ── Search fullscreen palette on mobile ── */
.hz-search-close {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1510;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hz-app.hz-search-active .hz-search-close { display: block; }

  .hz-app.hz-search-active .hz-float-search {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    z-index: 1500 !important;
    padding: 8px 10px;
    background: rgba(15, 20, 25, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }
  .hz-app.hz-search-active .hz-float-search input {
    font-size: 1rem !important;
    padding: 0.7rem 1rem !important;
    border-radius: 8px !important;
  }
  .hz-app.hz-search-active .hero-ac-dropdown {
    top: 60px !important;
    left: 10px !important;
    right: 10px !important;
    border-radius: 0 0 10px 10px !important;
    max-height: calc(100dvh - 80px);
    z-index: 1500;
  }
  /* Backdrop dim behind search overlay */
  .hz-app.hz-search-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.65);
    z-index: 1400;
    pointer-events: none;
  }
}

/* ── Pill bar: scroll gradient affordance ── */
.hz-pills-wrap {
  position: relative;
  max-width: 100%;
}
@media (max-width: 900px) {
  .hz-pills-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, transparent, rgba(15, 20, 25, 0.9));
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s;
  }
  .hz-pills-wrap.at-end::after { opacity: 0; }
}

/* ── Live dot animation on active pill ── */
@keyframes hz-live-dot {
  0%, 100% { opacity: 1; transform: scale(1) translateY(-50%); }
  50% { opacity: 0.3; transform: scale(0.65) translateY(-50%); }
}
@media (max-width: 900px) {
  .hz-pill.hz-pill-active .hz-pill-live {
    position: relative;
    padding-left: 0.55rem;
  }
  .hz-pill.hz-pill-active .hz-pill-live::before {
    content: '';
    position: absolute;
    left: 0.05rem;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    animation: hz-live-dot 1.2s ease-in-out infinite;
  }
}

/* ── Dashboard footer: "Back to Map" + "Share" (mobile only) ── */
.hz-dash-footer { display: none; }
@media (max-width: 900px) {
  .hz-dash-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0.5rem));
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
  }
  .hz-dash-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
    flex: 1;
  }
  .hz-dash-footer-btn:active {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
  }
  .hz-share-btn {
    flex: 0 0 auto;
    min-width: 80px;
  }
}

/* ── State panel header actions group ── */
.state-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.state-panel-share {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.state-panel-share:hover {
  color: var(--accent-amber);
  border-color: rgba(245,158,11,0.4);
}

/* ── overscroll-behavior: contain on all scrollable panels ── */
.hz-dash-panel,
.hz-dash-body,
.state-panel {
  overscroll-behavior: contain;
}

/* ── Safe area insets ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .hz-bottom-bar {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  @media (max-width: 900px) {
    .hz-dash-panel { padding-bottom: env(safe-area-inset-bottom); }
    .state-panel.mobile-sheet.mobile-sheet-open { padding-bottom: env(safe-area-inset-bottom); }
  }
}

/* ── Prevent rubber-band scroll bleed on map container ── */
@media (max-width: 900px) {
  .hz-app { overscroll-behavior: none; }
}

/* ── Tooltip touch toast ── */
#hz-tip-toast {
  display: none;
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent-amber);
  border-radius: 10px;
  padding: 0.7rem 1rem 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  z-index: 2000;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.55);
  animation: hz-fade-in 0.2s ease;
}
#hz-tip-toast.hz-tip-show { display: block; }
.hz-tip-toast-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}
.hz-tip-toast-close {
  display: block;
  text-align: right;
  font-size: 0.62rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Layer sidebar: detail text truncation + keyboard focus ─────────────── */
.hz-layer-detail {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.map-sidebar input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 3px;
  border-radius: 2px;
}
@media (max-width: 900px) {
  .hz-layer-detail { display: none; }
}

/* ── City panel as mobile bottom sheet on extra-small phones ── */
@media (max-width: 480px) {
  .hz-overlay .city-hazard-panel {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    max-width: 100% !important;
    border-radius: 14px 14px 0 0 !important;
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    z-index: 1300;
    max-height: 55vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  /* Drag handle for city panel sheet */
  .hz-overlay .city-hazard-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0.45rem auto 0.6rem;
    opacity: 0.45;
  }
}


/* ── Pill reorder toast ────────────────────────────────────────────────────── */
.hz-reorder-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a1f2e;
  border: 1px solid rgba(245,158,11,0.35);
  color: #b8c4d4;
  font-size: 0.72rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  z-index: 2100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.hz-reorder-toast.hz-reorder-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Sidebar layers ─────────────────────────────────────────────────────────── */
#sidebar-layers {
  display: block;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0;
}

/* Timeline tab strip */
.state-timeline-tabs {
  display: flex;
  gap: 4px;
  padding: 0.55rem 0.75rem 0.4rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.state-tl-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.state-tl-btn:hover { color: var(--accent-amber); border-color: var(--accent-amber); }
.state-tl-btn.stl-active {
  background: rgba(245,158,11,0.12);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  font-weight: 600;
}

/* Incident feed scroll area */
.state-incident-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 0;
  overscroll-behavior: contain;
}
.sinc-empty {
  padding: 1.25rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* Individual incident item */
.state-incident-item {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.state-incident-item:last-child { border-bottom: none; }

.sinc-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.sinc-row:hover { background: rgba(255,255,255,0.03); }

.sinc-badge {
  font-size: 0.78rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.sinc-detail { flex: 1; min-width: 0; }
.sinc-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sinc-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.sinc-arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: center;
}
.sinc-headline {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sinc-more {
  padding: 0.35rem 0.75rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Seasonal risk model (right panel) ──────────────────────────────────────── */
.seasonal-model {
  background: linear-gradient(135deg, #252c40 0%, #1e2843 100%);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 10px;
  margin: 0.85rem 0.85rem 0;
  padding: 0.85rem;
  position: relative;
  overflow: hidden;
}
.seasonal-model::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(245,158,11,0.10) 0%, transparent 60%);
  pointer-events: none;
}
.seasonal-model-hdr {
  margin-bottom: 0.6rem;
}
.seasonal-model-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.seasonal-model-sub {
  font-size: 0.64rem;
  color: #64748b;
}

.seasonal-cards {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.seasonal-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px;
  padding: 0.5rem 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  transition: border-color 0.2s;
}
.seasonal-card--hot {
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.04);
}
.seasonal-card--hot:first-child {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.04);
}

.seasonal-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  padding-top: 1px;
}
.seasonal-body { flex: 1; min-width: 0; }
.seasonal-name {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 1px;
  line-height: 1.25;
}
.seasonal-window {
  font-size: 0.61rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.seasonal-peak-badge {
  display: inline-block;
  font-size: 0.59rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 4px;
  vertical-align: middle;
}
.seasonal-bar-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.seasonal-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.seasonal-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.seasonal-risk-chip {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.seasonal-footer {
  margin-top: 0.55rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.4rem;
  line-height: 1.4;
}

/* =========================================================================
   Component Styles (stat-box, feed-card, risk-chip, hazard-card, divider)
   ========================================================================= */

/* ── Stat Box (from 00_utils.R) ──────────────────────────────────────────── */
.stat-box {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.85rem 0.75rem;
  text-align: center;
  min-width: 0;
  transition: background 0.15s;
}
.stat-box:hover { background: var(--bg-card-hover); }
.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* ── Feed Card (from 00_utils.R) ─────────────────────────────────────────── */
.feed-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid var(--border);
}
.feed-card:hover { background: var(--bg-card-hover); }
.feed-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.feed-card-text { flex: 1; min-width: 0; }
.feed-card-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.feed-card-body { flex: 1; min-width: 0; }
.feed-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.feed-card-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.feed-card-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

/* ── Risk Chip (from 00_utils.R) ─────────────────────────────────────────── */
.risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
}

/* ── Hazard Card (from 00_utils.R) ───────────────────────────────────────── */
.hazard-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--border);
}
.hazard-card-header {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.hazard-card-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Trend Arrow (from 00_utils.R) ───────────────────────────────────────── */
.trend-arrow {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Section Divider (from 00_utils.R) ───────────────────────────────────── */
.hz-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 1.25rem 0;
}

/* ── Dashboard Hero Stat Row ──────────────────────────────────────────── */
.dash-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.dash-hero-stats .stat-box {
  padding: 0.65rem 0.5rem;
  border-radius: 6px;
}
.dash-hero-stats .stat-value { font-size: 1.15rem; }
.dash-hero-stats .stat-label { font-size: 0.68rem; }

/* ── Dashboard Feed Cards (replaces eq-feed-row inside dashboards) ── */
.dash-feed-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dash-feed-cards .feed-card {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
}

/* ── Dashboard Explore CTA ─────────────────────────────────────────── */
.dash-explore-cta {
  display: block;
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.dash-explore-cta:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text-primary);
}
.dash-explore-cta i { margin-right: 0.4rem; }

/* ── Dashboard Source Attribution ───────────────────────────────────── */
.dash-source {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 0.75rem 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 0.5rem;
}
.dash-source a { color: var(--text-secondary); text-decoration: underline; text-decoration-color: rgba(255,255,255,0.15); }
.dash-source a:hover { color: var(--accent-amber); }

/* =========================================================================
   Situation Room — Complete Visual Design
   ========================================================================= */

.situation-room {
  padding: 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Hero Section ── */
.sr-hero {
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 40%, #1e2433 100%);
  padding: 2.5rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.sr-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(245,158,11,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(239,68,68,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.sr-hero-content { position: relative; z-index: 1; }
.sr-hero-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.sr-hero-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 0.6rem;
  line-height: 1.4;
}
.sr-hero-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

/* ── Active Threats ── */
.sr-alerts {
  margin: 1.5rem 1.5rem 0;
  background: linear-gradient(135deg, rgba(239,68,68,0.08) 0%, rgba(245,158,11,0.05) 100%);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}
.sr-alerts-clear {
  background: linear-gradient(135deg, rgba(34,197,94,0.06) 0%, var(--bg-card) 100%);
  border-color: rgba(34,197,94,0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
}
.sr-clear-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #22c55e;
}
.sr-clear-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.sr-alerts-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.sr-alerts-pulse {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: sr-pulse 2s ease infinite;
  box-shadow: 0 0 8px rgba(239,68,68,0.5);
}
@keyframes sr-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 16px rgba(239,68,68,0.7); }
}
.sr-alerts-count {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: #fca5a5;
  text-transform: uppercase;
}
.sr-alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}
.sr-alert-card {
  background: rgba(0,0,0,0.25);
  border: 1px solid color-mix(in srgb, var(--alert-color) 30%, transparent);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-body);
}
.sr-alert-card:hover {
  background: rgba(0,0,0,0.35);
  border-color: var(--alert-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sr-alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--alert-color) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--alert-color);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sr-alert-info { flex: 1; min-width: 0; }
.sr-alert-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--alert-color);
  line-height: 1.1;
}
.sr-alert-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.sr-alert-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.sr-alert-card:hover .sr-alert-arrow { opacity: 1; color: var(--alert-color); }

/* ── Live Activity Mini-Map ── */
.sr-minimap-wrap {
  margin: 0 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  cursor: pointer;
}
.sr-minimap-wrap::after {
  content: 'Click to explore on full map →';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(15,20,25,0.9) 0%, rgba(15,20,25,0.6) 60%, transparent 100%);
  color: var(--accent-amber);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2rem 1rem 0.6rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}
.sr-minimap-wrap:hover::after { opacity: 1; }
.sr-minimap-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
}
.sr-minimap-live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: sr-pulse 2s ease infinite;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
}
.sr-minimap-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.sr-minimap-wrap .leaflet-container {
  background: var(--bg-primary) !important;
}
.sr-minimap-legend {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 1rem;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 5;
}
.sr-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.sr-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .sr-minimap-wrap { margin: 0 1rem; border-radius: 10px; }
}
@media (max-width: 480px) {
  .sr-minimap-wrap { margin: 0 0.75rem; border-radius: 8px; }
  .sr-minimap-legend { flex-wrap: wrap; gap: 0.5rem; }
}

/* ── Top Hazard Detail Cards ── */
.sr-top-hazards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
}
.sr-hazard-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  border-top: 3px solid var(--hz-color);
  position: relative;
  overflow: hidden;
}
.sr-hazard-detail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hz-color) 8%, transparent) 0%, transparent 100%);
  pointer-events: none;
}
.sr-hazard-detail:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border-color: color-mix(in srgb, var(--hz-color) 40%, var(--border));
}
.sr-hd-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--hz-color);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  position: relative;
}
.sr-hd-body { position: relative; }
.sr-hd-big {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.sr-hd-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.sr-hd-unit {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.sr-hd-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-hd-bars {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.sr-hd-bar-item {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .sr-top-hazards { padding: 1rem; grid-template-columns: 1fr; }
}

/* ── Section Titles ── */
.sr-section-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sr-title-dot {
  width: 4px;
  height: 18px;
  background: var(--accent-amber);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Headlines ── */
.sr-headlines {
  padding: 1.5rem;
}
.sr-headline-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sr-headline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid var(--hz-color);
}
.sr-headline-card:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--hz-color);
  transform: translateX(3px);
}
.sr-headline-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--hz-color) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hz-color);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.sr-headline-text {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.4;
}
.sr-headline-arrow {
  color: var(--text-muted);
  font-size: 0.65rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.sr-headline-card:hover .sr-headline-arrow { opacity: 1; color: var(--hz-color); }

/* ── National Snapshot ── */
.sr-snapshot {
  padding: 0 1.5rem 1.5rem;
}
.sr-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}
.sr-grid .stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 0.75rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.sr-grid .stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  /* border-top from inline style handles this */
}
.sr-grid .stat-box:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.sr-grid .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
}
.sr-grid .stat-box i {
  font-size: 1rem !important;
  margin-bottom: 0.4rem !important;
  opacity: 0.7;
}

/* ── Explore ── */
.sr-explore {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.sr-explore-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.sr-explore-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 0.75rem;
  transition: border-color 0.2s;
}
.sr-explore-search:focus-within {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.12);
}
.sr-search-icon {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-right: 0.5rem;
}
.sr-explore-search .sr-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0.7rem 0;
  outline: none;
  font-family: var(--font-body);
}
.sr-explore-search .sr-search-input::placeholder { color: var(--text-muted); }
.sr-explore-search .sr-search-btn {
  background: var(--accent-amber);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font-display);
  transition: opacity 0.15s;
}
.sr-explore-search .sr-search-btn:hover { opacity: 0.85; }
.sr-explore-state {
  width: 220px;
  flex-shrink: 0;
}
.sr-explore-state .form-group { margin-bottom: 0; }
.sr-explore-state select,
.sr-explore-state .form-select {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  font-size: 0.82rem;
  padding: 0.55rem 0.75rem;
  height: auto;
}

.sr-quick-actions {
  display: flex;
  gap: 0.5rem;
}
.sr-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  transition: all 0.15s;
}
.sr-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-amber);
}
.sr-action-btn.sr-action-primary {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
  color: var(--accent-amber);
}
.sr-action-btn.sr-action-primary:hover {
  background: rgba(245,158,11,0.18);
}

/* ── Bottom Row (seasonal + sources) ── */
.sr-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0 1.5rem 1rem;
}
.sr-seasonal-card,
.sr-sources-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.sr-seasonal-header,
.sr-sources-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}
.sr-seasonal-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 0.4rem;
}
.sr-seasonal-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.sr-sources-list { display: flex; flex-direction: column; gap: 0.25rem; }
.sr-source-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0;
  font-size: 0.75rem;
}
.sr-source-row.sr-stale { color: #fca5a5; }
.sr-source-name {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 70px;
}
.sr-source-age {
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Footer ── */
.sr-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
}
.sr-footer a { color: var(--accent-amber); text-decoration: none; }
.sr-footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sr-hero { padding: 1.5rem 1.2rem 1.2rem; }
  .sr-hero-title { font-size: 1.4rem; }
  .sr-alerts { margin: 1rem 1rem 0; }
  .sr-alerts-grid { grid-template-columns: repeat(2, 1fr); }
  .sr-headlines { padding: 1.2rem 1rem; }
  .sr-snapshot { padding: 0 1rem 1.2rem; }
  .sr-grid { grid-template-columns: repeat(2, 1fr); }
  .sr-explore { padding: 1.2rem 1rem; }
  .sr-explore-row { flex-direction: column; }
  .sr-explore-state { width: 100%; }
  .sr-bottom-row { grid-template-columns: 1fr; padding: 0 1rem 1rem; }
}
@media (max-width: 480px) {
  .sr-hero { padding: 1.2rem 1rem 1rem; }
  .sr-hero-title { font-size: 1.2rem; }
  .sr-grid { gap: 0.4rem; }
  .sr-grid .stat-value { font-size: 1.2rem; }
  .sr-grid .stat-box { padding: 0.7rem 0.5rem; }
  .sr-alerts-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Accordion Dark Theme
   ========================================================================= */

.accordion { --bs-accordion-bg: var(--bg-card); --bs-accordion-border-color: var(--border); }
.accordion-button {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.88rem;
  padding: 0.7rem 1rem;
  box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
  background: var(--bg-card-hover) !important;
  color: var(--accent-amber) !important;
}
.accordion-button::after {
  filter: invert(1) brightness(0.7);
}
.accordion-body {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
}
.accordion-item {
  border-color: var(--border) !important;
  background: transparent;
}
.accordion-item:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.accordion-item:last-child { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }

/* State panel accordion — tighter spacing inside the slide-out panel */
.state-panel .accordion { margin: 0.5rem 0; }
.state-panel .accordion-button { font-size: 0.84rem; padding: 0.6rem 0.85rem; }
.state-panel .accordion-body { padding: 0.65rem 0.85rem; }
.state-panel .accordion-button .fa,
.state-panel .accordion-button .fas,
.state-panel .accordion-button .far { margin-right: 6px; font-size: 0.78rem; color: var(--accent-amber); }

/* =========================================================================
   Active Pill Pulse Indicator
   ========================================================================= */

.hz-pill-has-active::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: hz-dot-pulse 2s ease infinite;
  flex-shrink: 0;
}
@keyframes hz-dot-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* =========================================================================
   Disclaimer Freshness Toggle
   ========================================================================= */

.disclaimer-bar details { display: inline; }
.disclaimer-bar summary {
  cursor: pointer;
  display: inline;
  list-style: none;
}
.disclaimer-bar summary::-webkit-details-marker { display: none; }
.disclaimer-bar summary::marker { display: none; content: ''; }
.disclaimer-freshness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem 1rem;
  margin-top: 0.5rem;
  text-align: left;
  font-size: 0.7rem;
}
