/* web/style.css - Mission Control Theme */
:root {
  --bg-primary: #0a0d14;
  --bg-surface: #121824;
  --bg-surface-elevated: #1a2333;
  --bg-border: #26334a;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-yellow: #eab308;
  --accent-green: #22c55e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #7f8ea3;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-border);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-badge {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-family: var(--font-mono);
}

nav {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.nav-tab.active {
  color: #fff;
  background: var(--accent-blue);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.role-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.role-admin {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.role-viewer {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

/* Main Workspace */
main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.view-panel.active {
  display: flex;
}

/* Fullscreen Map View */
#view-map {
  flex-direction: row;
}

#map-container,
.leaflet-container {
  flex: 1;
  height: 100%;
  position: relative;
  background-color: #0b111e !important;
}

/* Dark Mode Filter for OpenStreetMap Tiles */
.leaflet-osm-dark {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Storm Front Live Doppler Radar Floating Overlay */
.map-overlay-card {
  position: absolute;
  top: 14px;
  left: 60px;
  z-index: 1000;
  background: rgba(18, 24, 36, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

/* Temporary Scenario Testing Bar */
.map-test-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(18, 24, 36, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-size: 12px;
}

.btn-test-scenario {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-test-scenario:hover {
  background: var(--bg-border);
  color: var(--accent-blue);
}

.btn-test-scenario.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: #60a5fa;
}

/* Tropical Radar Zoom.earth Style Layout */
#view-tropical {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #06090e;
}

.tropical-layout {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

#tropical-map-container {
  flex: 1;
  height: 100%;
  position: relative;
}

.tropical-floating-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  max-width: 380px;
  width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: rgba(10, 14, 22, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.tropical-basin-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tropical-basin-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tropical-basin-pill:hover,
.tropical-basin-pill.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-blue);
  color: #93c5fd;
}

.tropical-card {
  background: rgba(26, 35, 51, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tropical-card:hover {
  background: rgba(38, 51, 74, 0.9);
  border-color: var(--accent-blue);
}

.tropical-card.selected {
  border-color: #60a5fa;
  background: rgba(30, 58, 138, 0.35);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.radar-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-radar {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-radar:hover {
  background: var(--bg-border);
}

.btn-radar.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: #60a5fa;
}

.radar-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-dot 1.8s infinite;
}

.btn-radar:not(.active) .radar-pulse {
  background-color: var(--text-dim);
  box-shadow: none;
  animation: none;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.radar-timestamp {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-radar-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.2s ease;
}

.btn-radar-icon:hover {
  background: var(--bg-border);
  color: var(--accent-blue);
}

.btn-radar-icon.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: #60a5fa;
}

.radar-playback-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.radar-playback-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent-blue);
  cursor: pointer;
  height: 4px;
}

.radar-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.radar-slider-row input[type="range"] {
  width: 90px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

#map-sidebar {
  width: 380px;
  background: var(--bg-surface);
  border-left: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 500;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.alert-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.alert-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.alert-card.extreme { border-left: 4px solid var(--accent-red); }
.alert-card.severe { border-left: 4px solid var(--accent-orange); }
.alert-card.moderate { border-left: 4px solid var(--accent-yellow); }

.alert-card-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.alert-card-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Tropical Cyclone Vector View */
#view-tropical {
  padding: 24px;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.radar-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: 24px;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Management Console Container */
.console-container {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  padding: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--bg-border);
  font-weight: 600;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Buttons & Inputs */
button, .btn {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--bg-border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:hover, .btn:hover {
  background: var(--bg-border);
}

.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

input, select, textarea {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--bg-border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-blue);
}

/* Login Screen Modal */
#login-screen {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 20, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(4px);
}

.login-box {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.auth-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-bottom: 2px solid var(--accent-blue);
}

.auth-tab-btn:hover:not(.active) {
  color: var(--text-main);
}

/* Lockout Screen Modal */
#lockout-screen {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 20, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lockout-box {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lockout-icon {
  font-size: 48px;
}

/* Leaflet Dark Mode Control & Popup Overrides */
.leaflet-control-layers {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid var(--bg-border) !important;
  color: var(--text-main) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
}

.leaflet-control-layers-expanded {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-main) !important;
}

.leaflet-control-layers-separator {
  border-top: 1px solid var(--bg-border) !important;
}

/* Threat Marker Animations */
@keyframes pulseRed {
  0% { stroke: #ffffff; stroke-width: 1.5; stroke-opacity: 1; }
  50% { stroke: #ef4444; stroke-width: 6; stroke-opacity: 0.6; }
  100% { stroke: #ffffff; stroke-width: 1.5; stroke-opacity: 1; }
}

@keyframes pulseOrange {
  0% { stroke: #ffffff; stroke-width: 1.5; stroke-opacity: 1; }
  50% { stroke: #f97316; stroke-width: 5; stroke-opacity: 0.6; }
  100% { stroke: #ffffff; stroke-width: 1.5; stroke-opacity: 1; }
}

.pulse-extreme {
  animation: pulseRed 1.5s infinite ease-in-out;
}

.pulse-severe {
  animation: pulseOrange 2s infinite ease-in-out;
}

/* Modals & Popovers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  padding: 16px;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

/* Accessibility Focus Visible */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Responsive Mobile Layout */
@media (max-width: 900px) {
  header {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  #view-map {
    flex-direction: column !important;
  }
  #map-container {
    height: 55vh !important;
    min-height: 250px;
    flex: none;
  }
  #map-sidebar {
    width: 100% !important;
    height: 45vh !important;
    border-left: none !important;
    border-top: 1px solid var(--bg-border);
    flex: none;
  }
  .map-overlay-card {
    top: 8px;
    left: 58px;
    padding: 6px 10px;
  }
  .radar-slider-row input[type="range"] {
    width: 75px;
    min-height: 36px;
  }
  .console-container {
    padding: 12px;
  }
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  min-width: 280px;
  max-width: 440px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toast-slide-in 0.25s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-item.toast-success { border-left: 4px solid var(--accent-green); }
.toast-item.toast-error { border-left: 4px solid var(--accent-red); }
.toast-item.toast-info { border-left: 4px solid var(--accent-blue); }
.toast-item.toast-warning { border-left: 4px solid var(--accent-yellow); }

@keyframes toast-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Feed Provider Toggle Cards */
.feed-toggle-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.feed-toggle-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.feed-toggle-card input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
}

.feed-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Facility Proximity Radius & Spotlight Control Bar */
#facility-radius-bar,
.facility-radius-bar {
  position: absolute;
  top: 124px !important;
  left: 60px !important;
  background: rgba(18, 24, 36, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  padding: 8px 12px;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  min-width: 250px;
}

.radius-val-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

/* NOAA TWO Invest Genesis Badge & "X" Marker */
.noaa-invest-x {
  pointer-events: none;
}

.noaa-genesis-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* Sidebar Alert Scope Filter Pills */
.alert-scope-filter-bar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-border);
}

.scope-filter-pill {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.scope-filter-pill:hover {
  background: var(--bg-border);
  color: var(--text-main);
}

.scope-filter-pill.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 700;
}

.sidebar-category-header {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 8px 12px 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-category-header.inland {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.08);
  border-left: 3px solid #fb923c;
  margin-top: 8px;
}

.sidebar-category-header.marine {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  margin-top: 14px;
}

/* Layer Control Visual Grouping & Structured Section Dividers */
.leaflet-control-layers-expanded {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75) !important;
  padding: 10px 12px !important;
  width: 290px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  color: var(--text-main) !important;
}

.leaflet-control-layers-section-header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 6px 3px 6px;
  margin-top: 8px;
  margin-bottom: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  user-select: none;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.leaflet-control-layers-section-header.inland-hdr {
  color: #fb923c;
}

.leaflet-control-layers-section-header.marine-hdr {
  color: #38bdf8;
}

.leaflet-control-layers-overlays label {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  transition: background 0.15s ease !important;
}

.leaflet-control-layers-overlays label:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.leaflet-control-layers-overlays label input[type="checkbox"] {
  margin: 0 !important;
  cursor: pointer !important;
  accent-color: var(--accent-blue) !important;
}

/* Embedded Panel Sections in Leaflet Layer Control */
.layer-control-panel-section {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.panel-hdr-title {
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.3px;
}

.panel-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.radar-ts-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.panel-slider-row, .radar-playback-compact-row, .radar-opacity-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-slider {
  height: 5px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.compact-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 2px;
}

.compact-toggle-label input[type="checkbox"] {
  accent-color: var(--accent-blue);
}

.btn-radar-mini {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.2;
}

.btn-radar-mini:hover {
  background: var(--accent-blue);
  color: #fff;
}

.slider-sublabel {
  font-size: 10px;
  color: var(--text-dim);
}

.slider-subval {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

/* Genesis Invest Dot Marker */
.invest-dot-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 8px currentColor;
  cursor: pointer;
}

/* Genesis Badge Modern Floating Pill */
.noaa-genesis-badge-wrap {
  background: transparent !important;
  border: none !important;
}

.noaa-genesis-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1.5px solid;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.noaa-genesis-badge.high {
  border-color: #ef4444;
  color: #f87171;
}

.noaa-genesis-badge.med {
  border-color: #f97316;
  color: #fb923c;
}

.noaa-genesis-badge.low {
  border-color: #eab308;
  color: #facc15;
}

/* 7-Day Disturbance Percentage Badge Overlaid on Polygon */
.disturbance-prob-icon-container {
  background: transparent !important;
  border: none !important;
}

.disturbance-prob-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease;
}

.disturbance-prob-badge:hover {
  transform: scale(1.1);
}

.disturbance-prob-badge .prob-val {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.disturbance-prob-badge .prob-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-top: 1px;
}

.disturbance-prob-badge.low {
  border: 1.5px solid #eab308;
  color: #facc15;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}

.disturbance-prob-badge.medium {
  border: 1.5px solid #f97316;
  color: #fb923c;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.disturbance-prob-badge.high {
  border: 1.5px solid #ef4444;
  color: #f87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  animation: badgePulseRed 1.8s infinite ease-in-out;
}

@keyframes badgePulseRed {
  0% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
  100% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
}

/* Tropical Storm Marker Pin */
.tropical-storm-marker-icon {
  background: transparent !important;
  border: none !important;
}

.tropical-storm-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid #ffffff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

.tropical-storm-pin.hurricane {
  border-color: #ef4444;
  background: rgba(185, 28, 28, 0.9);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.6);
}

.tropical-storm-pin.ts {
  border-color: #f97316;
  background: rgba(194, 65, 12, 0.9);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.5);
}

/* Multi-Alert Overlapping Map Popup */
.leaflet-popup-content-wrapper {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--bg-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
  font-family: var(--font-sans) !important;
}

.leaflet-popup-tip {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid var(--bg-border) !important;
}

.multi-alert-popup {
  max-width: 360px;
  width: 340px;
  font-size: 12px;
}

.multi-alert-header {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--bg-border);
}

.multi-alert-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.multi-alert-subtitle {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.multi-alert-items-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.multi-alert-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease;
}

.multi-alert-card.extreme { border-left: 4px solid var(--accent-red); }
.multi-alert-card.severe { border-left: 4px solid var(--accent-orange); }
.multi-alert-card.moderate { border-left: 4px solid var(--accent-yellow); }
.multi-alert-card.tropical { border-left: 4px solid #38bdf8; }
.multi-alert-card.facility { border-left: 4px solid var(--accent-green); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.card-top .badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.badge.extreme { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge.severe { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.badge.moderate { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge.green { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

.item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.card-headline {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.card-meta {
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.btn-detail-sm {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s ease;
}

.btn-detail-sm:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

/* --- TROPICAL CYCLONE FORECAST CONE, TRACK, WAYPOINTS, & MOVEMENT ARROW --- */
.past-track-dot {
  width: 8px;
  height: 8px;
  background: #ea580c;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(234, 88, 12, 0.85);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.past-track-dot:hover {
  transform: scale(1.4);
  background: #f97316;
}

.tropical-waypoint-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.tropical-wp-node {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #ef4444;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
}

.tropical-wp-node:hover {
  transform: scale(1.3);
  z-index: 999;
}

.wp-stage-letter {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-family: var(--font-mono, monospace);
}

.wp-time-tag {
  position: absolute;
  top: -18px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
}

.tropical-movement-arrow-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.tropical-motion-badge {
  color: #38bdf8;
  font-size: 16px;
  line-height: 1;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
  margin-bottom: 2px;
}

.tropical-motion-pill {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.3px;
}

.cyclone-spin {
  display: inline-block;
  animation: spinCyclone 4s linear infinite;
}

@keyframes spinCyclone {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tropical-storm-pin .storm-wind-tag {
  background: rgba(0, 0, 0, 0.35);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.tropical-waypoint-popup {
  padding: 4px 2px;
  font-family: inherit;
  font-size: 12px;
  color: #f1f5f9;
}

.tropical-waypoint-popup .wp-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}

.tropical-waypoint-popup .wp-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  text-align: center;
  line-height: 18px;
}

.tropical-waypoint-popup .wp-time,
.tropical-waypoint-popup .wp-winds,
.tropical-waypoint-popup .wp-gusts,
.tropical-waypoint-popup .wp-loc {
  margin-bottom: 4px;
  font-size: 11.5px;
  color: #cbd5e1;
}

/* ==========================================================================
   MODERN LEFT-SIDE MAP LAYER DOCK & DRAWER CONTROLLER
   Supports 3 Responsive States: Floating Button, Expanded Drawer, Collapsed Rail
   ========================================================================== */

#map-layer-dock {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
  font-family: var(--font-sans);
  display: flex;
}

/* 1. EXPANDED DRAWER MODE (DEFAULT) */
.layer-dock-drawer {
  pointer-events: auto;
  width: 280px;
  height: 100%;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--bg-border);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: slideInLeft 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.layer-dock-header {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.layer-dock-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.layer-dock-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-dock-mode {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-dock-mode:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #ffffff;
}

.layer-dock-scroll {
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-border) transparent;
}

.dock-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dock-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dock-section-title.basemaps { color: #94a3b8; }
.dock-section-title.assets { color: #38bdf8; }
.dock-section-title.radar { color: #4ade80; }
.dock-section-title.tropical { color: #fb923c; }
.dock-section-title.inland { color: #facc15; }

.dock-layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.dock-layer-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.dock-layer-row.has-flyout {
  cursor: pointer;
}

.dock-layer-row.has-flyout:hover {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
}

.dock-layer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  min-width: 0;
}

.dock-layer-chevron {
  font-size: 13px;
  color: #60a5fa;
  font-weight: 700;
  margin-left: 6px;
}

/* 2. COLLAPSED ICON RAIL MODE */
.layer-dock-rail {
  pointer-events: auto;
  width: 52px;
  height: 100%;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--bg-border);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  gap: 5px;
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
  animation: fadeIn 0.15s ease;
}

.layer-dock-rail::-webkit-scrollbar {
  display: none;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: scale(1.05);
}

.rail-btn.active {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.rail-btn.active::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.rail-btn.has-chevron::after {
  content: '›';
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 10px;
  font-weight: 800;
  color: #60a5fa;
}

.rail-divider {
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 2px 0;
  flex-shrink: 0;
}

/* 3. RIGHT-EXPANDING FLYOUT POPOVER (DRAWER & RAIL MODES) */
.dock-flyout-popover {
  position: fixed;
  min-width: 270px;
  max-width: 320px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85);
  padding: 12px 14px;
  z-index: 1050;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: flyoutIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.dock-flyout-popover.open {
  display: flex;
}

.dock-flyout-popover::before {
  content: '';
  position: absolute;
  left: -6px;
  top: var(--flyout-arrow-top, 16px);
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid rgba(59, 130, 246, 0.45);
  border-bottom: 1px solid rgba(59, 130, 246, 0.45);
  transform: rotate(45deg);
}

/* Feed Box Controls: Minimalist Info Circle & Under-Toggle Interval */
.feed-toggle-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feed-toggle-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 38px;
}

.feed-interval-caption {
  font-size: 10px;
  font-weight: 600;
  color: #60a5fa;
  opacity: 0.9;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.feed-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding-top: 1px;
}

.feed-title-line strong {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

.info-circle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.2px solid rgba(148, 163, 184, 0.6);
  color: #94a3b8;
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
  cursor: pointer;
}

.info-tooltip-trigger:hover .info-circle-icon,
.info-tooltip-trigger:focus .info-circle-icon {
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.4);
}

.flyout-title {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flyout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flyout-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  line-height: 1;
}

.flyout-close-btn:hover {
  color: #fff;
}

/* 4. MODERN FLAT SWITCH TOGGLES */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: #cbd5e1;
  transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
  background-color: #3b82f6;
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(14px);
  background-color: #ffffff;
}

/* Basemap Radio List in Flyout */
.basemap-radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}

.basemap-radio-option:hover,
.basemap-radio-option.selected {
  background: rgba(59, 130, 246, 0.2);
  color: #ffffff;
}

.basemap-radio-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  transition: all 0.15s ease;
}

.basemap-radio-option.selected .basemap-radio-circle {
  border-color: #60a5fa;
  background: #60a5fa;
  box-shadow: 0 0 6px #60a5fa;
}

/* --- INTERACTIVE PLAIN-ENGLISH TOOLTIPS --- */
.info-tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 5px;
  font-size: 12px;
  color: var(--accent-blue);
  user-select: none;
}

.info-tooltip-bubble {
  visibility: hidden;
  opacity: 0;
  width: 280px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: var(--text-main);
  text-align: left;
  border-radius: 8px;
  padding: 10px 12px;
  position: absolute;
  z-index: 1200;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.info-tooltip-bubble strong {
  color: #60a5fa;
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.info-tooltip-bubble .tooltip-warn {
  color: #fb923c;
  display: block;
  margin-top: 4px;
  font-weight: 600;
}

.info-tooltip-trigger:hover .info-tooltip-bubble,
.info-tooltip-trigger.active .info-tooltip-bubble {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* --- GROUPS & DIRECTORY EDIT MODE & CONTEXT MENUS --- */
.groups-edit-mode-active {
  border-color: #f59e0b !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25) !important;
}

.groups-edit-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.group-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 4px;
}

.group-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.group-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  z-index: 1100;
  display: none;
  flex-direction: column;
  min-width: 120px;
  overflow: hidden;
}

.group-menu-dropdown.show {
  display: flex;
}

.group-menu-item {
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--text-main);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.group-menu-item:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.group-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Drag-Drop Styles */
.group-tree-row.dragging {
  opacity: 0.4;
}

.group-tree-row.drag-over {
  border-top: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.facility-in-group-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #94a3b8;
  border-radius: 4px;
}

.facility-in-group-row:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

/* Animations */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes flyoutIn {
  from { opacity: 0; transform: translateX(-8px) scale(0.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- MODERN FACILITY INSERT FORM & ADDRESS AUTOCOMPLETE --- */
.facility-form-card {
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card-title-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 8px;
}

.modern-facility-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.form-section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 -4px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.form-row-grid {
  display: grid;
  gap: 12px;
}

.form-row-grid.three-cols {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-row-grid.four-cols {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.req-star {
  color: #ef4444;
  font-weight: 700;
}

.helper-hint {
  font-size: 10.5px;
  font-weight: 400;
  color: #94a3b8;
}

.address-autofill-wrapper {
  position: relative;
  width: 100%;
}

.address-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.address-typeahead-input {
  width: 100%;
  padding-left: 32px !important;
  padding-right: 32px !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  border-radius: 6px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.address-typeahead-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
}

.address-input-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0.85;
  user-select: none;
}

.address-spinner {
  position: absolute;
  right: 10px;
  font-size: 13px;
  animation: spin 1s infinite linear;
  pointer-events: none;
}

.address-clear-btn {
  position: absolute;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.address-clear-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

.address-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 16px rgba(59, 130, 246, 0.15);
  backdrop-filter: blur(16px);
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
  animation: fadeIn 0.15s ease;
}

.address-suggestion-item {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, border-left 0.15s ease;
  user-select: none;
}

.address-suggestion-item:last-child {
  border-bottom: none;
}

.address-suggestion-item:hover,
.address-suggestion-item.selected {
  background: rgba(59, 130, 246, 0.18);
  border-left: 4px solid #38bdf8;
}

.sugg-icon {
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  color: #38bdf8;
}

.sugg-content {
  flex: 1;
  min-width: 0;
}

.sugg-primary-line {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sugg-secondary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.sugg-county-tag {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sugg-coords-pill {
  font-size: 10px;
  font-family: monospace;
  color: #64748b;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.address-suggestion-empty {
  padding: 14px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}

.address-suggestion-loading {
  padding: 14px 16px;
  text-align: center;
  color: #60a5fa;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.form-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-save-facility {
  padding: 8px 24px;
  font-weight: 700;
  font-size: 13px;
  min-width: 140px;
}

/* Feed Alert Types List in System Settings */
.feed-alert-types-box {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
}

.feed-types-title {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.feed-types-list {
  margin: 0;
  padding-left: 16px;
  color: #94a3b8;
  line-height: 1.45;
  font-size: 10.5px;
}

.feed-types-list li {
  margin-bottom: 2px;
}

/* Alert Type Checkboxes in Settings */
.alert-type-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 11px;
  padding: 1px 0;
  user-select: none;
  transition: color 0.15s ease;
}

.alert-type-label:hover {
  color: #ffffff;
}

.alert-type-label input[type="checkbox"] {
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* Facility Grid Inline Editing Styles */
.grid-edit-input,
.grid-edit-select {
  width: 100%;
  padding: 3px 6px;
  font-size: 11.5px;
  background: var(--bg-surface-elevated, #0f172a);
  border: 1px solid var(--accent-blue);
  border-radius: 4px;
  color: var(--text-main);
  box-sizing: border-box;
}

.grid-edit-input:focus,
.grid-edit-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

/* Facility Zone & UGC Badges */
.zone-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.zone-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.zone-badge.wfo {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.zone-badge.county {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.zone-badge.zone {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.zone-badge.fire {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.zone-badge.loading {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  font-style: italic;
}

/* Drag & Drop Visuals */
.group-tree-row.drag-over {
  background: rgba(59, 130, 246, 0.2) !important;
  outline: 2px dashed #60a5fa !important;
}

.group-tree-row.drag-unnest-hint {
  outline: 2px dashed #f59e0b !important;
  background: rgba(245, 158, 11, 0.15) !important;
}

.root-drop-zone {
  border: 2px dashed var(--bg-border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.root-drop-zone.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* Settings Master Edit Sticky Bar */
.settings-master-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-border);
  flex-wrap: wrap;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-master-bar.is-sticky-editing {
  position: sticky;
  top: 12px;
  z-index: 300;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.2s ease;
}

