/* ============================================================
   Fire Tracker – Styles
   ============================================================ */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #0f172a;
  --color-surface: rgba(15, 23, 42, 0.92);
  --color-surface-light: rgba(30, 41, 59, 0.95);
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-accent: #FF5F05;
  --color-accent-glow: rgba(255, 95, 5, 0.25);
  --color-observed: #3b82f6;
  --color-predicted: #FF5F05;
  --color-border: rgba(148, 163, 184, 0.15);
  --color-divider: rgba(148, 163, 184, 0.1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(148, 163, 184, 0.08);
  --shadow-button: 0 2px 8px rgba(0, 0, 0, 0.3);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.header-right {
  display: flex;
  align-items: center;
}

/* Logo image in header */
.header-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* -- Fire selector -- */
.fire-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.fire-selector select {
  appearance: none;
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 8px 32px 8px 14px;
  font-size: 14px;
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.fire-selector select optgroup {
  font-style: normal;
  font-weight: normal;
}

.fire-selector select:hover,
.fire-selector select:focus {
  border-color: var(--color-accent);
}

.fire-selector::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #6b7280;
  pointer-events: none;
}

/* ---------- Map container ---------- */
.map-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

/* #wind-canvas is created and managed by WindParticleSystem in app.js.
   It injects its own position/size/opacity inline styles.
   We only enforce pointer-events and z-index here. */
#wind-canvas {
  pointer-events: none !important;
  z-index: 2;
}

/* ── Wind Speed Legend (windfinder style) ─────────────────────
   Vertical gradient bar with m/s labels.
   Positioned bottom-left of the map.
   Hidden by default; .visible class shown when wind layer active. */
#wind-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 6px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);

  /* hidden by default */
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease;
}

#wind-legend.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* "m/s" unit label at the top (clickable toggle) */
.wl-unit {
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #374151;
  text-transform: lowercase;
  margin-bottom: 2px;
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.wl-unit:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #111827;
}

/* Row: [labels] [gradient bar] */
.wl-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 5px;
}

/* Speed tick labels column (built by JS) */
.wl-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  min-width: 18px;
  height: 240px;   /* matches .wl-bar height */
}

.wl-tick {
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 600;
  color: #374151;
  line-height: 1;
  white-space: nowrap;
}

.wl-tick.dim {
  color: #9ca3af;
  font-weight: 500;
}

/* Gradient colour bar */
.wl-bar {
  width: 14px;
  height: 240px;   /* tall narrow bar like windfinder */
  border-radius: 6px;
  /* gradient overwritten inline by initWindLegend() in app.js */
  background: linear-gradient(
    to top,
    rgb( 17,  80, 120),  /*  0 m/s — dark navy */
    rgb( 20, 140, 200),  /*  3 m/s — blue */
    rgb( 50, 200, 170),  /*  6 m/s — teal */
    rgb(100, 220, 100),  /*  9 m/s — green */
    rgb(230, 220,  50),  /* 12 m/s — yellow */
    rgb(240, 130,  20),  /* 15 m/s — orange */
    rgb(230,  40,  40),  /* 18 m/s — red */
    rgb(190,  20,  90),  /* 21 m/s — deep red */
    rgb(150,  10, 140),  /* 24 m/s — magenta */
    rgb(110,   0, 160)   /* 27 m/s — violet */
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}


/* ---------- Legend bar ---------- */
.legend-row {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.legend-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 10px 24px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.legend-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #111827;
}

.legend-scale {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-label {
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
}

.legend-gradient {
  width: 120px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
}

.legend-gradient.burning {
  background: linear-gradient(to right,
      rgba(255, 241, 140, 0.30),
      rgba(255, 212, 94, 0.50),
      rgba(255, 181, 58, 0.55),
      rgba(255, 151, 36, 0.60),
      rgba(255, 122, 24, 0.65),
      rgba(255, 92, 16, 0.70),
      rgba(255, 59, 10, 0.75),
      rgba(245, 26, 6, 0.80),
      rgba(226, 10, 4, 0.85),
      rgba(205, 4, 4, 0.95));
}

.legend-gradient.burnt {
  background: linear-gradient(to right,
      rgba(148, 7, 13, 0.75),
      rgba(124, 5, 11, 0.73),
      rgba(103, 4, 10, 0.71),
      rgba(83, 3, 8, 0.69),
      rgba(65, 3, 6, 0.67),
      rgba(49, 2, 4, 0.65),
      rgba(36, 1, 3, 0.63),
      rgba(23, 1, 1, 0.61),
      rgba(13, 0, 0, 0.59),
      rgba(5, 0, 0, 0.57));
}

.fire-selector-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.location-search {
  position: relative;
}

.location-search--header {
  width: min(560px, 100%);
  min-width: 280px;
}

/* Header location search: icon + input */
.location-search-field {
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.location-search-field:focus-within {
  border-color: #1b4de4;
  box-shadow: 0 0 0 1px #1b4de4, 0 4px 14px rgba(27, 77, 228, 0.12);
}

.location-search-field.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.92;
}

.location-search-field.is-loading::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid #e5e7eb;
  border-top-color: #1b4de4;
  border-radius: 50%;
  animation: locationSearchSpin 0.65s linear infinite;
}

@keyframes locationSearchSpin {
  to { transform: rotate(360deg); }
}

.location-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6b7280;
  margin-right: 8px;
}

.location-search-field:focus-within .location-search-icon {
  color: #1b4de4;
}

.location-search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  border-radius: 0;
  padding: 0 8px 0 0;
  font-size: 14px;
  font-family: var(--font-family);
  font-weight: 500;
  color: #111827;
  outline: none;
  background: transparent;
  transition: color 0.15s ease;
}

.location-search-field input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.location-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.location-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 400;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.location-search-results.hidden {
  display: none;
}

.location-search-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.location-search-item:last-child {
  border-bottom: none;
}

.location-search-item:hover,
.location-search-item.active {
  background: #f0f6ff;
}

.location-search-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
}

.location-search-item-pin {
  flex-shrink: 0;
  margin-top: 1px;
  color: #1b4de4;
  opacity: 0.85;
}

.location-search-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.location-search-main {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.location-search-sub {
  display: block;
  margin-top: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}


/* ---------- Left map controls (zoom + wind legend) ---------- */
.left-map-controls {
  position: absolute;
  left: 16px;
  top: 50%;
  /* Shift up by half the zoom-controls height (2×40px buttons + 6px gap = 86px → 43px)
     so the zoom buttons sit at the true vertical centre, with the wind legend below. */
  transform: translateY(-43px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.zoom-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoom-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  color: #374151;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.zoom-btn:hover {
  background: #f9fafb;
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

.zoom-btn:active {
  transform: scale(0.93);
}

/* ---------- Timeline panel ---------- */
.timeline-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  width: 420px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -- Current datetime display -- */
.datetime-display {
  text-align: center;
}

.datetime-display .date {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #111827;
}

.datetime-display .time {
  font-size: 13px;
  color: #374151;
  margin-top: 2px;
}

.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

.phase-badge.observed {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-observed);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.phase-badge.predicted {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-predicted);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* -- Play controls row -- */
.play-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px var(--color-accent-glow);
}

.play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.play-btn:active {
  transform: scale(0.95);
}

.play-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* -- Slider area -- */
.slider-area {
  flex: 1;
  position: relative;
  height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Slider track background */
.slider-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  height: 6px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  overflow: hidden;
}

/* Observed portion (blue) */
.slider-observed-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.7));
  border-radius: 999px 0 0 999px;
  transition: width var(--transition-fast);
}

/* Now marker */
.now-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 22px;
  background: #6b7280;
  z-index: 2;
  pointer-events: none;
}

.now-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  top: 2px;
  z-index: 2;
  pointer-events: none;
}

/* The actual range input */
.time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  position: relative;
  z-index: 5;
  cursor: pointer;
  outline: none;
}

.time-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border-radius: 999px;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow), 0 2px 4px rgba(0, 0, 0, 0.2);
  margin-top: -5px;
  transition: box-shadow var(--transition-fast);
}

.time-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px var(--color-accent-glow), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Firefox slider */
.time-slider::-moz-range-track {
  height: 6px;
  background: transparent;
  border-radius: 999px;
  border: none;
}

.time-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow), 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* -- Tick marks -- */
.slider-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 12px);
  height: 30px;
  pointer-events: none;
  overflow: visible;
}

.tick {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.tick-bar {
  width: 1px;
  height: 8px;
  background: #6b7280;
}

.tick-bar.small {
  height: 4px;
  background: rgba(107, 114, 128, 0.4);
}

.tick-label {
  font-size: 9px;
  color: #374151;
  margin-top: 2px;
  white-space: nowrap;
}

/* -- Divider -- */
.panel-divider {
  height: 1px;
  background: #e5e7eb;
}

/* -- Layer toggle buttons -- */
.layer-toggles {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 8px;
}

.layer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  transition: all var(--transition-fast);
}

.layer-btn:hover {
  color: #111827;
}

.layer-btn.active {
  color: var(--color-accent);
}

.layer-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: all var(--transition-fast);
}

.layer-btn:hover .layer-icon {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

.layer-btn.active .layer-icon {
  border-color: var(--color-accent);
  background: rgba(249, 115, 22, 0.1);
}

.layer-icon svg {
  width: 20px;
  height: 20px;
}

.layer-label {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

.layer-btn.locked {
  cursor: not-allowed;
  pointer-events: none;
}

.layer-icon {
  position: relative;
}

.lock-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}

/* ---------- All Layers Panel ---------- */
.all-layers-panel {
  position: absolute;
  bottom: calc(20px + 280px + 3px); /* timeline bottom + timeline height + gap */
  right: 20px;
  z-index: 100;
  width: 420px;
  max-height: 60vh;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-xl);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.all-layers-panel:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.all-layers-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.all-layers-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.all-layers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.all-layers-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.all-layers-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #6b7280;
  transition: all var(--transition-fast);
}

.all-layers-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.all-layers-close svg {
  width: 16px;
  height: 16px;
}

/* Sections */
.layers-section {
  padding: 0 22px 16px;
}

.layers-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  padding: 14px 0 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.layers-section:first-of-type .layers-section-title {
  border-top: none;
}

/* Layer option row */
.layer-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.layer-option:hover {
  background: rgba(0, 0, 0, 0.03);
}

.layer-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.layer-option.disabled:hover {
  background: transparent;
}

/* Icon */
.layer-option-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.layer-option-icon svg {
  width: 22px;
  height: 22px;
}



.infra-icon {
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.icon-fire-stations {
  background: rgba(230, 57, 70, 0.22);
  color: #c1121f;
}

.icon-transmission-lines {
  background: rgba(0, 51, 0, 0.15);
  color: #003300;
}

.icon-power-plants {
  background: rgba(200, 247, 200, 0.35);
  color: #66BB6A;
}

.icon-cellular-towers {
  background: rgba(69, 123, 157, 0.22);
  color: #1d3557;
}

.icon-hydrants {
  background: rgba(33, 150, 243, 0.22);
  color: #0d47a1;
}

.icon-prvs {
  background: rgba(38, 198, 218, 0.22);
  color: #006064;
}

.icon-pump-stations {
  background: rgba(92, 107, 192, 0.22);
  color: #283593;
}

.icon-reservoirs {
  background: rgba(2, 136, 209, 0.22);
  color: #01579b;
}

.icon-substations {
  background: rgba(0, 128, 0, 0.15);
  color: #008000;
}

.icon-wind {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.icon-webcams {
  background: rgba(124, 58, 237, 0.18);
  color: #6d28d9;
}

/* Info text */
.layer-option-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer-option-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.layer-option-desc {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.3;
}

/* Toggle switch */
.layer-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  min-width: 44px;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: #d1d5db;
  transition: background 0.25s ease;
  cursor: pointer;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-input:checked+.toggle-slider {
  background: var(--color-accent);
}

.toggle-input:checked+.toggle-slider::before {
  transform: translateX(20px);
}

.toggle-input:disabled+.toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Loading overlay ---------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #6b7280;
}

/* ---------- Mapbox overrides ---------- */
.mapboxgl-ctrl-scale {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mapboxgl-ctrl-scale::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #fff;
  box-sizing: border-box;
}

.mapboxgl-ctrl-attrib {
  background: transparent !important;
  font-size: 10px;
}

.mapboxgl-ctrl-attrib a {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* ---------- Mapbox Popup (Infrastructure Layers) ---------- */
.mapboxgl-popup {
  animation: popupFadeIn 0.2s ease-out;
  z-index: 10; /* must be above #wind-canvas (z-index: 2) */
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mapboxgl-popup-content {
  background: rgba(10, 18, 36, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f1f5f9;
  border-radius: 12px;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  min-width: 220px;
  max-width: 340px;
}

/* Wider popup for Cameras layer */
.mapboxgl-popup.camera-web-popup .mapboxgl-popup-content {
  max-width: min(520px, calc(100vw - 40px));
  min-width: 280px;
}

.mapboxgl-popup-close-button {
  color: rgba(255, 255, 255, 0.4);
  font-size: 20px;
  padding: 6px 10px;
  line-height: 1;
  transition: all 0.2s ease;
  right: 2px;
  top: 2px;
  z-index: 2;
}

.mapboxgl-popup-close-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: rgba(10, 18, 36, 0.95);
}

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
  border-bottom-color: rgba(10, 18, 36, 0.95);
}

.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
  border-right-color: rgba(10, 18, 36, 0.95);
}

.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
  border-left-color: rgba(10, 18, 36, 0.95);
}

/* Popup card layout */
.popup-card {
  display: flex;
  flex-direction: column;
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-left: 3px solid #FF5F05;
  background: rgba(255, 255, 255, 0.04);
}

.popup-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.popup-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.popup-body {
  padding: 6px 0;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 16px;
  gap: 12px;
  transition: background 0.15s ease;
}

.popup-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.popup-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.popup-value {
  color: #e2e8f0;
  font-size: 12.5px;
  text-align: right;
  word-break: break-word;
}

/* ---------- Camera Popup ---------- */
.camera-popup .popup-header {
  padding: 14px 18px;
}

.camera-popup .popup-title {
  font-size: 15px;
}

.camera-popup-image-wrap {
  position: relative;
  width: 100%;
  min-height: 160px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.camera-popup-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

.camera-popup-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
}

.camera-popup-error {
  color: #94a3b8;
  font-size: 12px;
  padding: 24px 16px;
  text-align: center;
}

.camera-popup-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.camera-popup-link {
  font-size: 11px;
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.camera-popup-link:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* ============================================================
   Hamburger Menu Button
   ============================================================ */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.hamburger-btn:hover,
.hamburger-btn.active {
  background: #f9fafb;
  border-color: var(--color-accent);
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.hamburger-btn:hover .hamburger-line,
.hamburger-btn.active .hamburger-line {
  background: var(--color-accent);
}

/* ============================================================
   Hamburger Dropdown Menu  – light/white theme
   ============================================================ */
.hamburger-menu {
  position: absolute;
  top: 60px;              /* header height + small gap */
  right: 16px;
  z-index: 300;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 8px 0;
  animation: hmSlideIn 0.18s ease-out;
}

@keyframes hmSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hamburger-menu.hidden {
  display: none;
}

.hm-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #111827;
  padding: 12px 18px 6px;
}

.hm-link {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.hm-link:hover {
  background: #f9fafb;
  color: var(--color-accent);
}

/* Invisible full-screen overlay to catch outside clicks */
.hamburger-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
}

.hamburger-overlay.hidden {
  display: none;
}

/* ============================================================
   Consent / Terms Pop-up Modal
   ============================================================ */
.consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 16px;
  animation: consentFadeIn 0.35s ease-out;
}

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

.consent-backdrop.consent-hiding {
  animation: consentFadeOut 0.35s ease-in forwards;
}

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

.consent-modal {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: consentSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes consentSlideUp {
  from { transform: translateY(32px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Header strip – white theme */
.consent-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 28px 20px;
  background: #ffffff;
  border-bottom: 2px solid #f3f4f6;
}

/* Logo in consent modal */
.consent-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.consent-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
  line-height: 1.3;
  text-align: center;
  /* remove the gradient text since we're on white now */
  background: none;
  -webkit-text-fill-color: #111827;
}

/* Body */
.consent-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.consent-intro {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

/* Warning notice box */
.consent-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-left: 4px solid var(--color-accent);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #374151;
  line-height: 1.55;
}

.consent-notice-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.consent-notice strong {
  color: #b45309;
}

/* "By continuing…" text */
.consent-agree-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.55;
}

.consent-link {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(249,115,22,0.4);
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.consent-link:hover {
  color: #CC4C04;
}

/* Custom checkbox */
.consent-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
}

.consent-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  position: relative;
}

.consent-checkbox:checked + .consent-checkbox-custom {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.consent-checkbox:checked + .consent-checkbox-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.consent-checkbox-text {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  line-height: 1.4;
}

/* Footer */
.consent-footer {
  padding: 0 28px 24px;
}

.consent-continue-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #FF5F05, #ef4444);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-family);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast),
              box-shadow var(--transition-fast);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
}

.consent-continue-btn:not(:disabled):hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.45);
}

.consent-continue-btn:not(:disabled):active {
  transform: translateY(0);
}

.consent-continue-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================================
   Interventions & Infrastructure Risk Panel
   ============================================================ */

/* Panel container — floats above the timeline-panel widget */
.interventions-panel {
  position: absolute;
  /* Timeline is bottom:20px, ~280px tall. */
  bottom: calc(20px + 280px + 3px); /* timeline bottom + timeline height + gap */
  right: 20px;
  z-index: 100;
  width: 420px;
  max-height: 60vh;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-xl);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Slide in from below */
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.interventions-panel:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.interventions-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

/* Header */
.interventions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  flex-shrink: 0;
}

.interventions-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.interventions-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.interventions-header-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-accent);
}

.interventions-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
  margin: 0;
}

.interventions-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0;
}

.interventions-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #6b7280;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.interventions-close:hover {
  background: #e5e7eb;
  color: #111827;
}
.interventions-close svg { width: 16px; height: 16px; }

/* Single scrollable body that wraps both steps */
.interventions-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Step container */
.interventions-step {
  padding: 12px 18px;
}

/* Options section locked until a boundary is applied */
.iv-options-locked {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

/* Divider between draw section and options section */
#interventions-step-options {
  border-top: 1px solid #f0f0f0;
}

.interventions-step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-bottom: 14px;
}

/* Draw instructions */
.draw-instructions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.draw-instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  line-height: 1.45;
}

.draw-step-num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(255, 95, 5, 0.12);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Draw buttons row */
.draw-btn-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.draw-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.draw-action-btn--primary {
  background: var(--color-accent);
  border: none;
  color: #fff;
  box-shadow: 0 2px 12px rgba(255,95,5,0.3);
}
.draw-action-btn--primary:hover {
  background: #e05504;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(255,95,5,0.4);
}
.draw-action-btn--primary.drawing {
  background: #374151;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.draw-action-btn--ghost {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
}
.draw-action-btn--ghost:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Draw status */
.draw-status {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.draw-status.status-drawing {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}
.draw-status.status-complete {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #15803d;
}
.draw-status.hidden { display: none; }

/* Apply button */
.draw-apply-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px rgba(22,163,74,0.3);
}
.draw-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(22,163,74,0.4);
}
.draw-apply-btn.hidden { display: none; }

/* Polygon summary badge */
.polygon-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #15803d;
  font-weight: 500;
}

.polygon-summary svg { flex-shrink: 0; stroke: #15803d; }

/* Action options */
.action-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.action-option {
  cursor: pointer;
}
.action-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.action-option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  transition: all var(--transition-fast);
}

.action-option:hover .action-option-card {
  border-color: #d1d5db;
  background: #fff;
}

.action-option input:checked + .action-option-card {
  border-color: var(--color-accent);
  background: rgba(255, 95, 5, 0.04);
  box-shadow: 0 0 0 3px rgba(255,95,5,0.1);
}

.action-option-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-option-icon svg {
  width: 16px;
  height: 16px;
}

.action-icon-burn {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.action-icon-water {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.action-icon-retardant {
  background: rgba(192, 38, 211, 0.12);
  color: #c026d3;
}

.action-option-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-option-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.action-option-desc {
  display: none;
}

.action-option-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all var(--transition-fast);
}
.action-option-check svg {
  width: 12px;
  height: 12px;
}

.action-option input:checked + .action-option-card .action-option-check {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Water gallons + datetime sections */
.water-gallons-section,
.datetime-section {
  margin-bottom: 14px;
}

.datetime-row {
  display: flex;
  gap: 8px;
}

.containment-tz-abbr {
  flex-shrink: 0;
  padding: 0 10px 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.water-gallons-section.hidden { display: none; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s;
}
.field-input-wrap:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,95,5,0.1);
}

.field-input-icon {
  padding: 0 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.field-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px 10px 0;
  font-size: 13px;
  font-family: var(--font-family);
  color: #111827;
  background: transparent;
  min-width: 0;
}
.field-input::placeholder { color: #9ca3af; }

/* color-scheme for datetime picker */
.field-input[type="datetime-local"] {
  color-scheme: light;
}

/* Submit button */
.containment-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #FF5F05, #ef4444);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px rgba(255,95,5,0.3);
  margin-top: 4px;
}
.containment-submit-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,95,5,0.4);
}
.containment-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.containment-submit-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

/* Result feedback */
.containment-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}
.containment-result.hidden { display: none; }
.containment-result.result-success {
  background: rgba(22,163,74,0.1);
  border: 1px solid rgba(22,163,74,0.25);
  color: #15803d;
}
.containment-result.result-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #b91c1c;
}

/* Drawing mode cursor style */
.mapboxgl-canvas-container.drawing-mode {
  cursor: crosshair !important;
}

/* Active state for interventions button */
.layer-btn.interventions-active {
  color: var(--color-accent);
}
.layer-btn.interventions-active .layer-icon {
  border-color: var(--color-accent);
  background: rgba(249, 115, 22, 0.1);
}

/* ── Draw / Apply / Cancel buttons ───────────────────────── */

#interventions-step-draw {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Draw button — single outlined button */
.iv-draw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.iv-draw-btn:hover {
  border-color: #FF5F05;
  color: #FF5F05;
  background: rgba(255,95,5,0.04);
}

/* Post-draw row: Apply + Cancel side by side */
#iv-post-draw {
  display: flex;
  gap: 8px;
}

.iv-apply-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  background: #16a34a;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 10px rgba(22,163,74,0.25);
}
.iv-apply-btn:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22,163,74,0.35);
}

.iv-cancel-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.iv-cancel-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}



/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .header {
    padding: 0 12px;
  }

  .header-center {
    padding: 0 8px;
  }

  .location-search--header {
    min-width: 170px;
  }

  .location-search-field {
    height: 36px;
    padding-left: 10px;
  }

  .location-search-field input {
    font-size: 12px;
  }

  .location-search-icon svg {
    width: 16px;
    height: 16px;
  }

  .legend-row {
    gap: 6px;
  }

  .legend-bar {
    gap: 16px;
    padding: 8px 16px;
  }

  .timeline-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 12px;
    padding: 14px;
  }

  .interventions-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: calc(12px + 280px + 6px);
  }

  .all-layers-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: calc(12px + 280px + 6px);
  }

  .consent-modal {
    border-radius: 16px;
  }

  .consent-header {
    padding: 20px 20px 16px;
  }

  .consent-body {
    padding: 20px;
  }

  .consent-footer {
    padding: 0 20px 20px;
  }
}

/* ---------- Map Tools: Coordinates Display ---------- */
.coords-display {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-family: 'Inter', monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  user-select: none;
}

/* ---------- Map Tools: Right-Click Context Menu ---------- */
.map-context-menu {
  position: absolute;
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
  padding: 4px 0;
  min-width: 180px;
  backdrop-filter: blur(12px);
}
.map-context-menu.hidden { display: none; }

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 14px;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.ctx-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

/* ---------- Map Tools: Ruler ---------- */
.ruler-tooltip {
  position: absolute;
  z-index: 10;
  background: rgba(15, 23, 42, 0.85);
  color: #f1f5f9;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(12px, -50%);
  backdrop-filter: blur(4px);
}

.ruler-clear-btn {
  position: absolute;
  z-index: 10;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-family);
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ruler-clear-btn:hover {
  background: var(--color-surface-light);
}
.ruler-clear-btn.hidden { display: none; }