/* LGS Storm Operations Center v3 */
:root { --navy:#0b2545; --blue:#133c67; --panel:#ffffff; --shadow:0 4px 18px rgba(0,0,0,.22); }
    * { box-sizing:border-box; }
    html, body { width:100%; height:100%; }
    body { margin:0; padding:0; font-family:Arial,sans-serif; background:#eef2f6; overflow:hidden; }
    #map { position:fixed; inset:0; width:100%; height:100%; }
    .leaflet-container { z-index:auto; }
    /* Keep marker popups above the fixed legend and storm-information panels. */
    .leaflet-popup-pane { z-index:20000 !important; }
    .leaflet-tooltip-pane { z-index:19999 !important; }
    .app-header { position:fixed; z-index:10000; top:12px; left:12px; right:12px; height:56px; background:linear-gradient(135deg,var(--navy),var(--blue)); color:#fff; border-radius:12px; box-shadow:var(--shadow); display:flex; align-items:center; padding:0 14px; gap:12px; }
    .brand-mark { width:38px; height:38px; border-radius:9px; background:#fff; color:var(--navy); display:grid; place-items:center; font-size:22px; font-weight:700; }
    .brand-copy { min-width:180px; }
    .brand-title { font-weight:700; font-size:17px; line-height:1.1; }
    .brand-subtitle { font-size:12px; opacity:.82; margin-top:2px; }
    .search-wrap { margin-left:auto; display:flex; gap:6px; align-items:center; min-width:260px; }
    #mapSearch { width:260px; max-width:34vw; border:0; border-radius:8px; padding:9px 10px; outline:none; }
    .header-btn,.quick-btn,.panel-close,.legend-toggle { border:0; cursor:pointer; border-radius:8px; font-weight:700; }
    .header-btn { background:#fff; color:var(--navy); padding:9px 11px; }
    .quick-actions { position:fixed; z-index:9999; top:78px; left:12px; display:flex; flex-wrap:wrap; gap:6px; max-width:720px; }
    .quick-btn { background:#fff; color:#18324f; padding:8px 10px; box-shadow:0 2px 9px rgba(0,0,0,.18); }
    .quick-btn:hover,.header-btn:hover { filter:brightness(.95); }
    .status { position:fixed; z-index:9998; top:122px; left:12px; background:var(--panel); padding:12px 14px; border-radius:12px; box-shadow:var(--shadow); font-size:13px; width:330px; max-height:calc(100vh - 144px); overflow:auto; }
    .status-title { display:flex; justify-content:space-between; align-items:center; gap:8px; }
    .status-heading { display:flex; align-items:center; gap:7px; min-width:0; }
    .status-live-dot { color:#22a447; font-size:12px; }
    .status-toggle { border:0; cursor:pointer; border-radius:8px; background:#eaf0f6; color:var(--navy); padding:5px 9px; font-weight:700; flex:0 0 auto; }
    .status-body { display:block; }
    .status.collapsed { width:auto; max-height:none; overflow:hidden; padding:8px 10px; }
    .status.collapsed .status-body { display:none; }
    .status.collapsed .status-title { gap:6px; }
    .status.collapsed .status-heading b { white-space:nowrap; }
    .status.collapsed .status-toggle { padding:5px 8px; }
    .status small { display:block; opacity:.78; margin-top:7px; }
    .status-grid { display:grid; grid-template-columns:1fr auto; gap:4px 14px; margin-top:8px; }
    .status-grid b { text-align:right; }
    .storm-card { margin-top:9px; padding-top:9px; border-top:1px solid #ddd; cursor:pointer; }
    .storm-card:hover { background:#f7f9fc; }
    .storm-card-title { font-weight:700; color:var(--navy); }
    .impact-badge { display:inline-block; margin-top:5px; padding:3px 7px; border-radius:10px; background:#f1e4ff; font-size:11px; }
    .legend { position:fixed; z-index:10001; bottom:12px; right:12px; background:#fff; border-radius:12px; box-shadow:var(--shadow); font-size:12px; line-height:1.3; width:295px; max-height:55vh; overflow:auto; }
    .legend-header { position:sticky; top:0; background:#fff; display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-bottom:1px solid #e2e2e2; }
    .legend-body { padding:10px 12px; }
    .legend.collapsed .legend-body { display:none; }
    .legend.collapsed { width:auto; }
    .legend-toggle { background:#eaf0f6; color:var(--navy); padding:4px 8px; }
    .legend-section { margin-top:9px; padding-top:7px; border-top:1px solid #e5e5e5; }
    .legend-section:first-child { margin-top:0; padding-top:0; border-top:0; }
    .legend-section-title { font-weight:700; color:var(--navy); margin-bottom:4px; }
    .legend-row { display:flex; align-items:center; gap:7px; margin:4px 0; }
    .swatch { display:inline-block; width:12px; height:12px; border-radius:50%; flex:0 0 auto; border:1px solid rgba(0,0,0,.25); }
    .swatch-line { width:22px; height:0; border-top:4px solid; border-radius:0; }
    .swatch-area { width:20px; height:12px; border-radius:3px; }
    .swatch-outline { background:#fff; border:4px solid #4b0082; }
    .side-panel { position:fixed; z-index:11000; top:12px; right:12px; width:360px; max-width:calc(100vw - 24px); height:calc(100vh - 24px); background:#fff; border-radius:12px; box-shadow:var(--shadow); transform:translateX(calc(100% + 24px)); transition:transform .25s ease; overflow:hidden; display:flex; flex-direction:column; }
    .side-panel.open { transform:translateX(0); }
    .side-panel-header { flex:0 0 auto; background:var(--navy); color:#fff; padding:14px; display:flex; justify-content:space-between; align-items:center; }
    .panel-close { background:#fff; color:var(--navy); padding:6px 9px; }
    .side-panel-body { padding:14px; flex:1 1 auto; min-height:0; overflow:auto; }
    .side-panel.results-mode .side-panel-body { display:flex; flex-direction:column; overflow:hidden; }
    .side-panel.results-mode .result-list { flex:1 1 auto; min-height:0; max-height:none; overflow-y:auto; margin-bottom:0; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
    .storm-detail { border-bottom:1px solid #ddd; padding:10px 0; }
    .result-list { margin-top:8px; max-height:240px; overflow:auto; }
    .result-item { padding:8px; border-bottom:1px solid #eee; cursor:pointer; }
    .result-item:hover { background:#f2f6fa; }
    .results-toolbar { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 10px; }
    .results-toolbar button { border:0; border-radius:7px; padding:7px 9px; cursor:pointer; font-weight:700; background:#eaf0f6; color:var(--navy); }
    .results-summary { background:#f4f7fa; border-left:4px solid var(--blue); padding:8px 10px; margin:8px 0; font-size:12px; }
    .result-card { padding:10px 8px; border-bottom:1px solid #e6e6e6; cursor:pointer; }
    .result-card:hover { background:#f2f6fa; }
    .result-meta { font-size:12px; line-height:1.45; margin-top:3px; }
    .result-meta a { color:#0b5cab; }
    .result-empty { padding:18px 8px; text-align:center; color:#555; }
    .forecast-label { background:rgba(255,255,255,.94); border:1px solid #333; border-radius:4px; color:#111; font-weight:bold; padding:2px 5px; box-shadow:none; white-space:nowrap; }
    .forecast-timeline { margin:8px 0 2px; padding-left:18px; }
    .forecast-timeline li { margin:4px 0; }
    .timing-note { background:#fff8df; border-left:4px solid #d99b00; padding:8px 10px; margin:8px 0; font-size:12px; }
    .leaflet-control-layers { font-size:13px; }
    /* On desktop, place zoom controls beneath the header on the right so the
       fixed search bar cannot cover them. */
    .leaflet-top.leaflet-left {
      top:78px;
      left:auto;
      right:12px;
    }
    .leaflet-top.leaflet-left .leaflet-control-zoom {
      margin:0 !important;
    }
    /* Keep the layer selector fully below the fixed header and search bar. */
    .leaflet-top.leaflet-right { top:0; right:12px; }
    .leaflet-top.leaflet-right .leaflet-control-layers {
      margin-top:138px !important;
    }

    /* Leaflet popups live inside the map stacking context, so temporarily fade
       dashboard overlays while a popup is open to keep the popup fully readable. */
    .status, .legend, .side-panel { transition: opacity .15s ease, visibility .15s ease; }
    body.map-popup-open .status,
    body.map-popup-open .legend,
    body.map-popup-open .side-panel,
    body.map-popup-open .mobile-panels-button,
    body.map-popup-open .mobile-panels-drawer {
      opacity:0 !important;
      visibility:hidden !important;
      pointer-events:none !important;
    }
    a { word-break:break-word; }
    .app-header, .quick-actions, .status, .legend, .side-panel { pointer-events:auto; }
    .leaflet-top, .leaflet-bottom { z-index:800; }
    .mobile-panels-button, .mobile-panels-drawer { display:none; }
    .mobile-panels-button { position:fixed; z-index:12050; border:0; border-radius:10px; background:var(--navy); color:#fff; box-shadow:var(--shadow); font-weight:700; cursor:pointer; padding:10px 13px; }
    .mobile-panels-drawer { position:fixed; z-index:12040; background:#fff; border-radius:12px; box-shadow:var(--shadow); overflow:auto; }
    .mobile-panels-header { position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:11px 12px; background:var(--navy); color:#fff; }
    .mobile-panels-close { border:0; border-radius:7px; padding:5px 8px; background:#fff; color:var(--navy); font-weight:700; cursor:pointer; }
    .mobile-panel-section { border-bottom:1px solid #e5e5e5; }
    .mobile-panel-section > button { width:100%; border:0; background:#fff; color:var(--navy); padding:12px; text-align:left; font-weight:700; cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
    .mobile-panel-content { display:none; padding:0 12px 12px; font-size:13px; }
    .mobile-panel-section.open .mobile-panel-content { display:block; }
    .mobile-panel-section.open > button .panel-chevron { transform:rotate(180deg); }
    .panel-chevron { transition:transform .15s ease; }
    .mobile-panel-actions { display:grid; grid-template-columns:1fr; gap:7px; }
    .mobile-panel-actions button { border:0; border-radius:8px; padding:9px 10px; background:#eaf0f6; color:var(--navy); font-weight:700; text-align:left; cursor:pointer; }
    .mobile-layer-row { display:flex; align-items:center; gap:8px; margin:8px 0; }
    .mobile-layer-row input { width:18px; height:18px; }
    @media (max-width:760px) {
      /* Mobile order: header/search, quick actions, Panels button, then zoom controls. */
      .leaflet-top.leaflet-left { top:212px; left:8px; right:auto; }
      .app-header { top:8px; left:8px; right:8px; height:auto; min-height:58px; flex-wrap:wrap; padding:9px 10px; gap:8px; }
      .brand-mark { width:34px; height:34px; font-size:18px; }
      .brand-copy { min-width:0; flex:1; }
      .brand-title { font-size:15px; }
      .search-wrap { order:3; width:100%; margin-left:0; min-width:0; }
      #mapSearch { max-width:none; width:100%; min-width:0; }
      .header-btn { flex:0 0 auto; }
      .quick-actions { top:126px; left:8px; right:8px; max-width:none; flex-wrap:nowrap; overflow-x:auto; padding-bottom:3px; }
      .quick-btn { white-space:nowrap; flex:0 0 auto; }
      .status, .legend { display:none !important; }
      .mobile-panels-button { display:block; top:174px; left:8px; }
      /* A full-screen Storm/Results panel needs the entire toolbar area. Hide the
         floating Panels button while that panel is open so Copy/CSV/Print stay tappable. */
      body.mobile-results-open .mobile-panels-button,
      body.mobile-results-open .mobile-panels-drawer {
        opacity:0 !important;
        visibility:hidden !important;
        pointer-events:none !important;
      }
      .mobile-panels-drawer { display:block; top:174px; left:8px; width:min(330px, calc(100vw - 16px)); max-height:calc(100vh - 182px); transform:translateX(calc(-100% - 16px)); transition:transform .22s ease; }
      .mobile-panels-drawer.open { transform:translateX(0); }
      .side-panel { top:8px; right:8px; width:calc(100vw - 16px); height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); }
      .side-panel.results-mode .side-panel-body { padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
      .side-panel.results-mode .result-list { padding-bottom:calc(28px + env(safe-area-inset-bottom)); scroll-padding-bottom:calc(28px + env(safe-area-inset-bottom)); touch-action:pan-y; }
      .side-panel.results-mode .result-card:last-child,
      .side-panel.results-mode .result-item:last-child { margin-bottom:calc(18px + env(safe-area-inset-bottom)); }
      .leaflet-control-layers { display:none; }
      .leaflet-control-zoom { margin:0 !important; }
    }


    .forecast-dock { position:fixed; z-index:10020; left:50%; bottom:14px; transform:translateX(-50%); width:min(760px,calc(100vw - 340px)); background:rgba(255,255,255,.96); border-radius:12px; box-shadow:var(--shadow); padding:9px 12px; }
    .forecast-dock-top { display:flex; align-items:center; gap:9px; margin-bottom:6px; }
    .forecast-dock-title { font-weight:700; color:var(--navy); white-space:nowrap; }
    .forecast-time-label { margin-left:auto; font-weight:700; color:#6a040f; }
    .forecast-play { border:0; border-radius:8px; background:var(--navy); color:#fff; padding:6px 9px; font-weight:700; cursor:pointer; }
    #forecastSlider { width:100%; accent-color:#6a040f; }
    .forecast-ticks { display:flex; justify-content:space-between; font-size:10px; color:#555; margin-top:2px; }
    .forecast-dock-note { font-size:10px; color:#666; margin-top:4px; }
    .forecast-focus-ring { pointer-events:none; }
    @media (max-width: 1100px) and (min-width:761px) { .forecast-dock { width:calc(100vw - 390px); } }
    @media (max-width:760px) {
      .forecast-dock { left:8px; right:8px; bottom:8px; transform:none; width:auto; padding:8px 10px; }
      .forecast-dock-title { font-size:12px; }
      .forecast-dock-note { display:none; }
      .forecast-ticks { font-size:9px; }
      .legend { bottom:88px; }
      .side-panel { padding-bottom:78px; }
    }
    @media print { .forecast-dock { display:none!important; } }

/* Sprint 1: Emergency Operations Center interface */
:root {
  --eoc-ink:#07131f;
  --eoc-navy:#0b1f33;
  --eoc-panel:#102a43;
  --eoc-line:rgba(255,255,255,.11);
  --eoc-text:#f7fbff;
  --eoc-muted:#9fb3c8;
  --eoc-cyan:#20c5d8;
  --eoc-gold:#f4b942;
  --eoc-green:#35d07f;
  --eoc-shadow:0 14px 38px rgba(2,12,22,.36);
}
body { font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:var(--eoc-ink); }
#map { background:#dce5eb; }
.app-header {
  top:0; left:0; right:0; height:72px; border-radius:0;
  background:linear-gradient(90deg,#07131f 0%,#0b2238 62%,#102f4b 100%);
  border-bottom:1px solid rgba(255,255,255,.12); box-shadow:0 8px 24px rgba(0,0,0,.28);
  padding:0 20px; gap:14px;
}
.brand-mark { width:44px; height:44px; border-radius:10px; background:linear-gradient(145deg,#fff,#dceaf4); box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); font-size:20px; }
.brand-title { font-size:18px; letter-spacing:.01em; }
.brand-subtitle { color:#b8cadb; font-size:11px; letter-spacing:.13em; text-transform:uppercase; font-weight:700; }
.live-badge { display:flex; align-items:center; gap:7px; margin-left:18px; padding:7px 10px; border:1px solid rgba(53,208,127,.34); background:rgba(53,208,127,.09); color:#b9f5d4; border-radius:999px; font-size:10px; letter-spacing:.12em; font-weight:800; }
.live-badge span { width:7px; height:7px; border-radius:50%; background:var(--eoc-green); box-shadow:0 0 0 5px rgba(53,208,127,.12); }
#mapSearch { background:rgba(255,255,255,.94); border:1px solid rgba(255,255,255,.16); border-radius:7px; }
.header-btn { background:var(--eoc-cyan); color:#061723; border-radius:7px; }
.quick-actions { top:84px; left:18px; max-width:none; gap:7px; align-items:center; padding:7px; border-radius:10px; background:rgba(7,19,31,.90); border:1px solid rgba(255,255,255,.09); box-shadow:var(--eoc-shadow); backdrop-filter:blur(12px); }
.quick-actions-label { color:#7890a7; font-size:9px; font-weight:900; letter-spacing:.15em; padding:0 7px 0 4px; }
.quick-btn { display:flex; align-items:center; gap:6px; background:rgba(255,255,255,.08); color:#e9f3fa; border:1px solid rgba(255,255,255,.09); box-shadow:none; border-radius:7px; padding:8px 10px; font-size:12px; }
.quick-btn:hover { background:rgba(255,255,255,.14); filter:none; }
.quick-primary { background:rgba(32,197,216,.16); color:#bdf7ff; border-color:rgba(32,197,216,.32); }
.quick-accent { background:rgba(244,185,66,.15); color:#ffe4a3; border-color:rgba(244,185,66,.28); }
.status-shell,.legend-shell { position:fixed; z-index:9998; left:18px; width:342px; }
.status-shell { top:146px; }
.legend-shell { bottom:122px; }
.rail-label { color:#dce9f2; background:#07131f; border:1px solid rgba(255,255,255,.09); border-bottom:0; border-radius:9px 9px 0 0; padding:8px 11px; font-size:9px; font-weight:900; letter-spacing:.16em; }
.status { position:relative; top:auto; left:auto; width:100%; max-height:calc(100vh - 440px); border-radius:0 0 10px 10px; background:rgba(11,31,51,.95); color:var(--eoc-text); border:1px solid rgba(255,255,255,.09); box-shadow:var(--eoc-shadow); }
.status-heading b { color:#fff; }
.status-toggle { background:rgba(255,255,255,.09); color:#eaf4fb; }
.status-grid { color:#c9d8e5; }
.status-grid strong,.status-grid b { color:#fff; }
.status small { color:#91a8bb; }
.legend { position:relative; left:auto; bottom:auto; width:100%; max-height:250px; border-radius:0 0 10px 10px; background:rgba(11,31,51,.95); color:#dce8f2; border:1px solid rgba(255,255,255,.09); box-shadow:var(--eoc-shadow); }
.legend-header b,.legend-section-title { color:#fff; }
.legend-section { border-color:rgba(255,255,255,.09); }
.legend-toggle { background:rgba(255,255,255,.09); color:#fff; }
.forecast-dock { bottom:18px; background:rgba(7,19,31,.94); color:#e9f4fb; border:1px solid rgba(255,255,255,.11); box-shadow:var(--eoc-shadow); }
.forecast-dock-title { color:#fff; letter-spacing:.03em; }
.forecast-time-label { color:#7ce7f3; }
.forecast-play { background:var(--eoc-cyan); color:#061723; }
.forecast-ticks,.forecast-dock-note { color:#a9bbca; }
#forecastSlider { accent-color:var(--eoc-cyan); }
.side-panel { top:0; right:0; height:100vh; border-radius:0; background:#f7fafc; box-shadow:-18px 0 48px rgba(0,0,0,.28); }
.side-panel-header { background:linear-gradient(90deg,#07131f,#102f4b); padding:18px; }
.panel-close { border-radius:6px; }
.leaflet-top.leaflet-left { top:146px; right:18px; }
.leaflet-top.leaflet-right .leaflet-control-layers { margin-top:146px !important; }
.leaflet-control-layers,.leaflet-bar { border:0!important; box-shadow:0 8px 22px rgba(0,0,0,.24)!important; }
@media (max-width:1000px) and (min-width:761px) {
  .live-badge { display:none; }
  .brand-copy { min-width:170px; }
  .status-shell,.legend-shell { width:310px; }
  .forecast-dock { width:calc(100vw - 350px); }
}
@media (max-width:760px) {
  .app-header { top:0; left:0; right:0; border-radius:0; min-height:114px; padding:10px 12px; }
  .live-badge { display:none; }
  .quick-actions { top:122px; left:8px; right:8px; background:rgba(7,19,31,.92); }
  .quick-actions-label { display:none; }
  .mobile-panels-button { top:174px; background:#07131f; border:1px solid rgba(255,255,255,.12); }
  .status-shell,.legend-shell { display:none!important; }
  .leaflet-top.leaflet-left { top:220px; }
  .forecast-dock { background:rgba(7,19,31,.96); }
}
@media print {
  .live-badge,.quick-actions-label,.rail-label { display:none!important; }
}

/* Sprint 1.1 — responsive grid rail fix
   The operating picture and map intelligence panels share a dedicated rail,
   preventing the toolbar from covering the Live Operations Summary. */
@media (min-width:761px) {
  .quick-actions {
    right:18px;
    max-width:calc(100vw - 36px);
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:thin;
  }
  .quick-actions .quick-btn,
  .quick-actions-label { flex:0 0 auto; }

  .eoc-left-rail {
    position:fixed;
    z-index:9998;
    top:146px;
    bottom:122px;
    left:18px;
    width:342px;
    display:grid;
    grid-template-rows:minmax(180px,1fr) minmax(150px,.72fr);
    gap:10px;
    pointer-events:none;
    min-height:0;
  }
  .status-shell,
  .legend-shell {
    position:relative;
    inset:auto;
    width:100%;
    min-height:0;
    display:flex;
    flex-direction:column;
    pointer-events:auto;
  }
  .rail-label { flex:0 0 auto; }
  .status,
  .legend {
    flex:1 1 auto;
    min-height:0;
    max-height:none;
    overflow:auto;
  }
  .status.collapsed,
  .legend.collapsed {
    flex:0 0 auto;
  }
}

@media (max-width:1000px) and (min-width:761px) {
  .eoc-left-rail { width:310px; }
}

@media (max-width:760px) {
  .eoc-left-rail { display:none!important; }
}

/* Sprint 1.2 — high-contrast panel palette
   Replaces the light white/purple panel treatment with readable navy panels. */
:root {
  --panel-bg:#0b1f33;
  --panel-bg-2:#102a43;
  --panel-text:#f4f9fd;
  --panel-muted:#b8cad9;
  --panel-border:rgba(255,255,255,.14);
  --panel-accent:#20c5d8;
  --panel-gold:#f4b942;
}

.status,
.legend,
.side-panel,
.mobile-panels-drawer,
.mobile-panel-section > button,
.mobile-panel-content,
.side-panel-body {
  background:var(--panel-bg)!important;
  color:var(--panel-text)!important;
}

.side-panel-header,
.mobile-panels-header,
.rail-label {
  background:#07131f!important;
  color:#fff!important;
}

.side-panel,
.mobile-panels-drawer,
.status,
.legend {
  border-color:var(--panel-border)!important;
}

.side-panel-body,
.mobile-panel-content,
.status-grid,
.legend-row,
.legend-section,
.result-list,
.result-item,
.result-card,
.results-summary,
.timing-note {
  color:var(--panel-text)!important;
}

.side-panel-body p,
.side-panel-body div,
.side-panel-body span,
.side-panel-body small,
.mobile-panel-content p,
.mobile-panel-content div,
.mobile-panel-content span,
.mobile-panel-content small {
  color:inherit;
}

.result-item,
.result-card {
  background:var(--panel-bg-2)!important;
  border-color:var(--panel-border)!important;
}
.result-item:hover,
.result-card:hover {
  background:#163754!important;
}
.results-summary {
  background:rgba(32,197,216,.12)!important;
  border-left-color:var(--panel-accent)!important;
}
.timing-note {
  background:rgba(244,185,66,.12)!important;
  border-left-color:var(--panel-gold)!important;
}
.result-empty,
.result-meta,
.result-meta a,
.status small,
.forecast-dock-note {
  color:var(--panel-muted)!important;
}
.result-meta a { color:#7ce7f3!important; }

/* Replace the pale-purple cone badge with a high-contrast cyan badge. */
.impact-badge {
  background:rgba(32,197,216,.16)!important;
  color:#c7f8ff!important;
  border:1px solid rgba(32,197,216,.38)!important;
  font-weight:800;
}

.panel-close,
.mobile-panels-close,
.status-toggle,
.legend-toggle,
.results-toolbar button,
.mobile-panel-actions button {
  background:rgba(255,255,255,.11)!important;
  color:#fff!important;
  border:1px solid var(--panel-border)!important;
}
.panel-close:hover,
.mobile-panels-close:hover,
.status-toggle:hover,
.legend-toggle:hover,
.results-toolbar button:hover,
.mobile-panel-actions button:hover {
  background:rgba(32,197,216,.22)!important;
}

.mobile-panel-section { border-color:var(--panel-border)!important; }
.mobile-panel-section > button { border-bottom-color:var(--panel-border)!important; }

/* Ensure headings and generated result content always remain visible. */
.side-panel h1,.side-panel h2,.side-panel h3,.side-panel h4,
.mobile-panels-drawer h1,.mobile-panels-drawer h2,.mobile-panels-drawer h3,
.status b,.legend b,.result-card b,.result-item b {
  color:#fff!important;
}

/* Sprint 1.3 — complete nested panel contrast fix */
.status .storm-card,
.status .storm-card:hover,
.status .storm-card:focus,
.legend-header,
.legend-body,
.legend-section,
.side-panel-body,
.side-panel .storm-detail,
.mobile-panel-content,
.mobile-panel-section,
.mobile-panel-section > button {
  background:#0b1f33!important;
  color:#f4f9fd!important;
}

.status .storm-card {
  margin-top:10px!important;
  padding:11px 10px!important;
  border:1px solid rgba(255,255,255,.14)!important;
  border-radius:9px!important;
}
.status .storm-card:hover {
  background:#163754!important;
}
.status .storm-card-title,
.status .storm-card div,
.status .storm-card span,
.status .storm-card small,
.legend-header,
.legend-header b,
.legend-body,
.legend-body div,
.legend-row,
.legend-section-title {
  color:#f4f9fd!important;
}
.status .storm-card-title {
  font-weight:800!important;
}
.status .impact-badge {
  background:#12677a!important;
  color:#ffffff!important;
  border:1px solid #56d9e9!important;
  text-shadow:none!important;
}

.legend-header {
  border-bottom:1px solid rgba(255,255,255,.14)!important;
}
.legend-body {
  border:0!important;
}
.legend-section {
  border-top-color:rgba(255,255,255,.14)!important;
}

/* Prevent inherited legacy light blocks inside panels. */
.status [style*="background:#fff"],
.status [style*="background: #fff"],
.legend [style*="background:#fff"],
.legend [style*="background: #fff"] {
  color:#f4f9fd;
}

/* Improve text visibility throughout the left rail. */
.eoc-left-rail,
.eoc-left-rail * {
  text-shadow:none;
}
.status-grid > div,
.status-grid > span,
.status-grid > b,
.status-grid > strong {
  color:#f4f9fd!important;
}

/* Sprint 1.4 — align Map Intelligence header and Map Color Key body */
.eoc-left-rail,
.status-shell,
.legend-shell,
.rail-label,
.status,
.legend,
.legend-header,
.legend-body {
  box-sizing:border-box!important;
}

.legend-shell,
.status-shell {
  left:auto!important;
  right:auto!important;
}

.legend {
  left:0!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  transform:none!important;
}

.rail-label {
  width:100%!important;
  margin:0!important;
}

.legend-header,
.legend-body {
  width:100%!important;
  margin:0!important;
}

/* Sprint 2 — Executive Dashboard */
.executive-status-body { padding-top:10px; }
.executive-metrics {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-bottom:10px;
}
.executive-metric {
  min-height:90px;
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-rows:1fr auto;
  align-items:center;
  gap:0 8px;
  padding:11px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:10px;
  color:#fff;
  background:linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,.025));
  text-align:left;
  cursor:pointer;
  font:inherit;
  transition:transform .14s ease,background .14s ease,border-color .14s ease;
}
.executive-metric:hover { transform:translateY(-1px); background:rgba(255,255,255,.11); border-color:rgba(255,255,255,.19); }
.metric-icon { grid-row:1; font-size:20px; filter:saturate(.85); }
.metric-value { grid-row:1; font-size:29px; line-height:1; font-weight:900; letter-spacing:-.04em; justify-self:end; }
.metric-label { grid-column:1/-1; font-size:9px; line-height:1.25; color:#b9ccdc; font-weight:900; letter-spacing:.09em; text-transform:uppercase; }
.metric-storm { border-color:rgba(32,197,216,.25); background:linear-gradient(145deg,rgba(32,197,216,.15),rgba(32,197,216,.035)); }
.metric-sub { border-color:rgba(53,208,127,.23); background:linear-gradient(145deg,rgba(53,208,127,.13),rgba(53,208,127,.025)); }
.metric-alert,.metric-warning { border-color:rgba(244,185,66,.28); background:linear-gradient(145deg,rgba(244,185,66,.16),rgba(244,185,66,.035)); }
.metric-danger { border-color:rgba(255,92,92,.35); background:linear-gradient(145deg,rgba(255,92,92,.18),rgba(255,92,92,.04)); }
.metric-normal { border-color:rgba(126,231,243,.22); }
.executive-feed-status {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  margin-bottom:9px;
  border:1px solid rgba(53,208,127,.18);
  border-radius:8px;
  background:rgba(53,208,127,.065);
  color:#b8cbd9;
  font-size:10px;
}
.executive-feed-status div { display:flex; align-items:center; gap:7px; color:#dff9ea; }
.feed-dot { width:7px; height:7px; border-radius:50%; background:#35d07f; box-shadow:0 0 0 4px rgba(53,208,127,.12); flex:0 0 auto; }
.executive-secondary-grid {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:5px 12px;
  padding:9px 10px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:8px;
  background:rgba(2,12,22,.18);
  color:#aebfd0;
  font-size:10px;
}
.executive-secondary-grid b { color:#eef7fd; font-size:11px; }
.executive-storm-list { margin-top:9px; }
.executive-storm-list .storm-card { margin-top:7px; }
.executive-storm-list .storm-card:first-child { margin-top:0; }

@media (max-width:1000px) and (min-width:761px) {
  .executive-metric { min-height:82px; padding:9px; }
  .metric-value { font-size:25px; }
}

/* Sprint 3 — Storm Intelligence briefing */
.side-panel { width:min(520px, calc(100vw - 24px)); }
.side-panel-body { background:#081725; color:#eaf4fb; }
.intel-briefing-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding-bottom:14px; border-bottom:1px solid rgba(255,255,255,.12); margin-bottom:14px; }
.intel-briefing-header h1,.intel-storm-heading h2 { margin:2px 0 0; color:#fff; line-height:1.1; }
.intel-briefing-header h1 { font-size:24px; }
.intel-kicker { display:block; color:#62d9ff; font-size:10px; font-weight:900; letter-spacing:.14em; }
.intel-update { text-align:right; color:#91a9ba; font-size:10px; line-height:1.35; }
.intel-update b { color:#dff5ff; font-size:11px; }
.intel-storm-card,.intel-impact-card,.intel-section,.intel-empty { background:linear-gradient(145deg,#102b42,#0b2032); border:1px solid rgba(117,210,255,.18); border-radius:14px; padding:15px; margin-bottom:13px; box-shadow:0 12px 30px rgba(0,0,0,.18); }
.intel-storm-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:13px; }
.intel-storm-heading h2 { font-size:21px; }
.intel-classification { flex:0 0 auto; border-radius:999px; padding:6px 9px; background:#0a7598; color:#fff; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.intel-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.intel-stat { min-height:70px; background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:10px; }
.intel-stat span { display:block; color:#91a9ba; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }
.intel-stat strong { color:#fff; font-size:15px; line-height:1.25; }
.intel-wide { grid-column:1/-1; min-height:auto; }
.intel-timeline { margin-top:13px; border-top:1px solid rgba(255,255,255,.1); padding-top:12px; }
.intel-section-title { color:#62d9ff; font-size:11px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; margin-bottom:9px; }
.intel-timeline-row { display:grid; grid-template-columns:70px 1fr; gap:8px; padding:7px 0; border-bottom:1px solid rgba(255,255,255,.07); font-size:12px; }
.intel-timeline-row b { color:#fff; }
.intel-timeline-row span { color:#bdd0dd; }
.intel-impact-card { display:grid; grid-template-columns:135px 1fr; gap:14px; align-items:stretch; }
.intel-impact-score { display:grid; align-content:center; justify-items:center; border-radius:12px; background:rgba(255,255,255,.055); padding:10px; text-align:center; }
.intel-impact-score>span { color:#a8bdca; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.intel-impact-score strong { color:#fff; font-size:44px; line-height:1; margin-top:4px; }
.intel-impact-score small { color:#8fa8b8; }
.intel-impact-score em { margin-top:7px; padding:4px 8px; border-radius:999px; font-size:10px; font-style:normal; font-weight:900; }
.impact-severe { background:#9e2135; color:#fff; }.impact-high { background:#b75b00; color:#fff; }.impact-elevated { background:#8b6d00; color:#fff; }.impact-guarded { background:#14647c; color:#fff; }.impact-low { background:#27643e; color:#fff; }
.intel-impact-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.intel-impact-metrics div { display:flex; flex-direction:column; justify-content:center; background:rgba(255,255,255,.055); border-radius:10px; padding:10px; }
.intel-impact-metrics b { color:#fff; font-size:22px; }
.intel-impact-metrics span { color:#a8bdca; font-size:10px; line-height:1.25; }
.intel-state-list { display:flex; flex-wrap:wrap; gap:7px; }
.intel-state-list span { background:#0b7799; color:#fff; border-radius:999px; padding:6px 10px; font-size:11px; font-weight:900; }
.intel-lists details { background:rgba(255,255,255,.045); border-radius:9px; padding:9px 11px; margin-bottom:8px; }
.intel-lists summary { cursor:pointer; color:#fff; font-weight:900; font-size:12px; }
.intel-lists ul { margin:9px 0 0; padding-left:18px; }
.intel-lists li { color:#d9e7ef; margin:5px 0; font-size:12px; }
.intel-lists li span { color:#62d9ff; font-weight:800; }
.intel-empty p,.intel-section p,.intel-section small { color:#a8bdca; }
@media (max-width:760px){
  .side-panel { width:calc(100vw - 16px); }
  .intel-impact-card { grid-template-columns:1fr; }
  .intel-impact-score { grid-template-columns:auto auto auto; column-gap:4px; }
  .intel-impact-score>span,.intel-impact-score em { grid-column:1/-1; }
}


/* Sprint 4 — Intelligent Deployment Planner */
.quick-deploy { border-color:rgba(53,208,127,.45)!important; }
.planner-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:13px; margin-bottom:10px; border:1px solid rgba(117,210,255,.18); border-radius:12px; background:linear-gradient(145deg,#102b42,#0b2032); }
.planner-controls label { color:#9fb5c4; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.planner-controls select { display:block; width:100%; margin-top:6px; border:1px solid rgba(117,210,255,.25); border-radius:8px; background:#071522; color:#fff; padding:9px; font-size:12px; }
.planner-context { color:#a9bfcd; font-size:11px; line-height:1.45; padding:0 2px 10px; }
.planner-context b { color:#e8f7ff; }
.planner-card { display:grid; grid-template-columns:34px 1fr; gap:10px; margin-bottom:10px; border:1px solid rgba(117,210,255,.18); border-radius:13px; background:linear-gradient(145deg,#102b42,#0b2032); padding:12px; cursor:pointer; transition:transform .15s ease,border-color .15s ease; }
.planner-card:hover { transform:translateY(-1px); border-color:rgba(98,217,255,.5); }
.planner-top { border-color:rgba(53,208,127,.55); box-shadow:0 0 0 1px rgba(53,208,127,.12),0 12px 30px rgba(0,0,0,.2); }
.planner-rank { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#092238; color:#62d9ff; font-weight:900; font-size:11px; }
.planner-top .planner-rank { background:#17633c; color:#eafff2; }
.planner-card-heading { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.planner-card-heading h3 { margin:2px 0 0; color:#fff; font-size:17px; }
.planner-card-heading>strong { color:#fff; font-size:24px; line-height:1; }
.planner-card-heading>strong small { color:#8fa8b8; font-size:10px; }
.planner-stars { color:#ffd166; font-size:11px; letter-spacing:.06em; }
.planner-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:10px; }
.planner-facts span { border-radius:8px; background:rgba(255,255,255,.05); padding:7px; color:#a8bdca; font-size:10px; }
.planner-facts b { display:block; color:#fff; font-size:13px; margin-bottom:2px; }
.planner-footer { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:9px; color:#8fa8b8; font-size:10px; }
.planner-footer em { border-radius:999px; padding:4px 7px; font-style:normal; font-weight:900; font-size:9px; }
.planner-risk-high { background:#9e2135; color:#fff; }.planner-risk-elevated { background:#a65a00; color:#fff; }.planner-risk-moderate { background:#756400; color:#fff; }.planner-risk-low { background:#27643e; color:#fff; }
@media(max-width:760px){.planner-controls{grid-template-columns:1fr}.planner-facts{grid-template-columns:1fr 1fr}.planner-card{grid-template-columns:28px 1fr;padding:10px}.planner-card-heading h3{font-size:15px}}


/* Optimized logo sizing */
.brand-mark{
  flex:0 0 175px !important;
  width:175px !important;
  height:56px !important;
  background:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  overflow:visible !important;
}
.brand-mark img{
  display:block;
  width:175px;
  height:auto;
  max-width:none;
  max-height:none;
}
.brand-copy{
  margin-left:6px;
}
@media (max-width:760px){
  .brand-mark{
    flex:0 0 135px !important;
    width:135px !important;
    height:42px !important;
  }
  .brand-mark img{
    width:135px;
  }
}
