/* ============================================================
   LagunaSafe — Dark Emergency Management Theme
   ============================================================ */

:root {
  /* ── Sol Aragones Official Brand ── */
  --sol-red:          #e10000;
  --sol-red-dark:     #c00000;
  --sol-red-dim:      rgba(225,0,0,0.15);
  --laguna-gold:      #fabd00;
  --laguna-gold-dim:  rgba(250,189,0,0.15);

  /* ── Dark Emergency Theme Surfaces (aligned with revamped.html palette) ── */
  --bg:          #0e141a;
  --surface:     #161c22;
  --surface2:    #1a2027;
  --border:      rgba(255,255,255,0.07);
  --border-light:rgba(255,255,255,0.04);

  --text:        #dde3ec;
  --text-mid:    #bac8dc;
  --text-dim:    #5b7b9a;

  /* ── UI Accent Colors ── */
  --blue:        #e10000;
  --blue-dim:    rgba(225,0,0,0.12);
  --water-blue:      #4ac0f1;
  --water-blue-dim:  rgba(74,192,241,0.13);
  --teal:        #e10000;

  --red:         #f85149;
  --red-dim:     rgba(248,81,73,0.15);
  --amber:       #fabd00;
  --amber-dim:   rgba(250,189,0,0.14);
  --green:       #3fb950;
  --green-dim:   rgba(63,185,80,0.13);
  --laguna-green: #fabd00;
  --orange:      #e08338;
  --purple:      #a371f7;

  /* ── Hazard Layer Colors (data viz — keep original hues) ── */
  --flood-h:     #3b82f6;
  --flood-m:     #60a5fa;
  --landslide:   #f59e0b;
  --volcanic-p:  #ef4444;
  --volcanic-e:  #f97316;
  --fault:       #a855f7;
  --evac-green:  #2ea043;
  --evac-green-dim: rgba(46,160,67,0.15);

  --topbar-h:    64px;
  --govbar-h:    0px;
  --ticker-h:    32px;
  --ticker-h-actual: var(--ticker-h);
  --bottom-h:    200px;
  --panel-w:     280px;
  --radius:      8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.6);
  --transition:  0.2s ease;

  --font:        'Inter', 'Public Sans', sans-serif;
  --font-brand:  'Public Sans', sans-serif;
  --font-headline: 'Public Sans', sans-serif;
}

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

html, body {
  height: 100%; overflow: hidden;
  /* Disable pull-to-refresh and overscroll bounce at the CSS layer.
     Works on Chrome Android 63+ and Safari 16+. The JS layer (passive:false +
     preventDefault) handles older Safari and edge cases. */
  overscroll-behavior: none;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: rgba(14,20,26,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.topbar-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* ── Laguna Seal ── */
.laguna-seal {
  width: 34px; height: 34px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.brand-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(225,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid #e10000;
  box-shadow: 0 0 8px rgba(225,0,0,0.35);
}
.brand-icon img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-headline);
  font-size: 1.05rem; font-weight: 900; line-height: 1;
  color: #e10000;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.brand-sub { font-size: 0.63rem; color: var(--text-mid); margin-top: 2px; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.7; }

/* ===== GOVERNOR BAR ===== (removed — slogan lives in sidebar intro) */
.gov-bar { display: none; }
.gov-slogan { display: none; }
.sol-gob, .sol-sol {
  font-style: normal; font-weight: 900;
  color: var(--laguna-gold); letter-spacing: 0.04em;
}

/* ===== SIDEBAR INTRO (revamped.html mb-8 px-2 section) ===== */
.sidebar-intro {
  padding: 6px 4px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}
.sidebar-intro-tag {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: #e10000;
  margin-bottom: 4px;
}
.sit-big {
  font-size: 0.85rem; font-weight: 900; letter-spacing: 0.1em;
}
.sidebar-intro-title {
  font-family: var(--font-headline);
  font-size: 1.15rem; font-weight: 800;
  color: var(--text); line-height: 1.2;
  margin-bottom: 2px;
}
.sidebar-intro-sub {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-mid); opacity: 0.7;
}

.topbar-search {
  flex: 1; max-width: 440px; position: relative;
  display: flex; align-items: center;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; padding: 0 12px; gap: 8px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search:focus-within {
  border-color: rgba(255,180,168,0.4);
  box-shadow: 0 0 0 3px rgba(225,0,0,0.12);
}
.topbar-search i { color: var(--text-mid); font-size: 0.85rem; }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.88rem; padding: 8px 0;
}
.topbar-search input::placeholder { color: var(--text-dim); }

.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); z-index: 2000;
  max-height: 220px; overflow-y: auto;
  display: none; box-shadow: var(--shadow);
}
.search-dropdown.open { display: block; }
.search-item {
  padding: 10px 14px; cursor: pointer; font-size: 0.875rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface); }
.search-item .si-risk { font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }

/* Wrapper: desktop — inline flex; mobile — fixed bar */
.topbar-search-actions {
  display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.topbar-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-mid); cursor: pointer; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.topbar-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: rgba(255,255,255,0.12); }
.topbar-btn.active { background: var(--blue-dim); color: var(--blue); border-color: var(--blue); }
/* ── Locate Me button — expanded state after GPS fix ── */
#locateMeBtn.located {
  width: auto; padding: 0 10px; gap: 5px;
  color: var(--blue); border-color: var(--blue);
  background: var(--blue-dim);
}
.locate-label {
  font-size: 0.72rem; font-weight: 600; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis;
  color: var(--blue);
}

.topbar-chat-btn { position: relative; }
.topbar-chat-btn:hover { background: var(--sol-red); color: #fff; border-color: var(--sol-red); }
.topbar-chat-btn.active { background: var(--sol-red); color: #fff; border-color: var(--sol-red); }
.topbar-chat-unread {
  position: absolute; top: -4px; right: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sol-red); border: 2px solid var(--bg);
}

.alert-bell {
  position: relative; cursor: pointer;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid); font-size: 0.95rem;
  transition: all var(--transition);
}
.alert-bell:hover { color: var(--amber); border-color: var(--amber); }
.alert-bell.has-alerts { color: var(--amber); border-color: var(--amber); animation: pulse 2s infinite; }
.alert-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.alert-badge.show { display: flex; }

/* ===== ALERT TICKER ===== */
.alert-ticker {
  height: var(--ticker-h); background: rgba(227,179,65,0.12);
  border-bottom: 1px solid rgba(227,179,65,0.3);
  align-items: center; overflow: hidden;
  position: fixed; top: calc(var(--topbar-h) + var(--govbar-h)); left: 0; right: 0;
  z-index: 998;
  display: none;
}
.alert-ticker.visible { display: flex; }
.ticker-label {
  flex-shrink: 0; padding: 0 14px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--amber); border-right: 1px solid rgba(227,179,65,0.3);
  height: 100%; display: flex; align-items: center; gap: 6px;
}
.ticker-track {
  flex: 1; overflow: hidden; display: flex; align-items: center;
}
/* Single scrolling wrapper — one animation, all items inline */
.ticker-scroll {
  display: flex; align-items: center;
  white-space: nowrap; flex-shrink: 0;
  animation: ticker-scroll 55s linear infinite;
  will-change: transform;
}
.ticker-scroll--slow { animation-duration: 90s; }
.ticker-item {
  font-size: 0.8rem; color: var(--text); white-space: nowrap;
  padding: 0 32px; flex-shrink: 0;
}
.ticker-item.ticker-clear { color: var(--text-mid); font-style: italic; }
.ticker-item .ticker-warn { color: var(--amber); margin-right: 5px; }

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  position: fixed;
  top: calc(var(--topbar-h) + var(--govbar-h) + var(--ticker-h-actual));
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* ===== SIDE PANELS ===== */
.side-panel {
  width: var(--panel-w);
  background: rgba(14,20,26,0.97);
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  transition: width var(--transition), opacity var(--transition);
  z-index: 100;
}
.right-panel { border-right: none; border-left: 1px solid rgba(255,255,255,0.05); }
.side-panel.collapsed { width: 0; opacity: 0; pointer-events: none; }

.panel-inner { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 10px; }

.panel-section {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
  transition: border-color var(--transition);
}
.panel-section:hover { border-color: rgba(255,255,255,0.08); }

.panel-section-title {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--laguna-gold); text-transform: uppercase;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
  opacity: 0.85;
}
.panel-section-title .panel-badge {
  margin-left: auto; font-size: 0.67rem; font-weight: 600;
  background: var(--blue-dim); color: #ffb4a8;
  padding: 1px 7px; border-radius: 10px; text-transform: none; letter-spacing: 0;
  border: 1px solid rgba(225,0,0,0.25);
  white-space: nowrap; flex-shrink: 0;
}

.field-label { font-size: 0.78rem; color: var(--text-mid); display: block; margin-bottom: 5px; }

select {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  color: var(--text); border-radius: 8px; padding: 9px 12px;
  font-size: 0.85rem; cursor: pointer; outline: none;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23bac8dc' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select:hover, select:focus { border-color: rgba(225,0,0,0.45); box-shadow: 0 0 0 3px rgba(225,0,0,0.1); }
select option { background: #1a2027; color: var(--text); }

/* ===== LAYER TOGGLES ===== */
.layer-toggles { display: flex; flex-direction: column; gap: 4px; }
.layer-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  cursor: pointer; transition: background var(--transition);
  font-size: 0.83rem; color: var(--text-mid);
}
.layer-toggle:hover { background: rgba(255,255,255,0.04); }
.layer-toggle input { display: none; }
.toggle-dot {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
  border: 2px solid currentColor; transition: all var(--transition);
  position: relative;
}
.layer-toggle input:checked + .toggle-dot::after {
  content: ''; position: absolute; inset: 2px;
  background: currentColor; border-radius: 1px;
}
.layer-toggle input:checked ~ span { color: var(--text); }
.layer-toggle.flood { color: var(--flood-h); }
.layer-toggle.landslide { color: var(--landslide); }
.layer-toggle.volcanic { color: var(--volcanic-p); }
.layer-toggle.fault { color: var(--purple); }
.layer-toggle.evacuation { color: var(--evac-green); }
.layer-toggle.incidents { color: var(--orange); }
.layer-toggle i { font-size: 0.8rem; }

/* ===== MAP VIEW BUTTONS ===== */
.map-view-btns { display: flex; gap: 6px; }
.map-view-btn {
  flex: 1; padding: 8px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-mid); cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--transition); font-family: var(--font);
}
.map-view-btn:hover { border-color: rgba(225,0,0,0.4); color: #ffb4a8; }
.map-view-btn.active { background: rgba(225,0,0,0.15); border-color: rgba(225,0,0,0.5); color: #ffb4a8; }

/* ===== RADIUS CONTROL ===== */
.radius-control { margin-bottom: 10px; }
input[type="range"] {
  width: 100%; margin-top: 6px; accent-color: var(--blue);
  cursor: pointer;
}
.btn-search-services {
  width: 100%; padding: 10px; border-radius: 8px;
  background: var(--sol-red); border: none; color: #fff;
  font-size: 0.83rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all var(--transition); font-family: var(--font);
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(225,0,0,0.35);
}
.btn-search-services:hover { background: var(--sol-red-dark); box-shadow: 0 4px 20px rgba(225,0,0,0.5); transform: translateY(-1px); }
.btn-search-services:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== LEGEND ===== */
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.79rem; color: var(--text-mid);
}
.legend-dot {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.1);
}
.legend-group-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-mid);
  margin: 8px 0 4px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 6px;
}
.legend-group-label i { color: #3b82f6; }
#floodLegend .legend-dot { border-radius: 50%; }
.legend-dot.flood-high { background: rgba(59,130,246,0.5); border-color: #3b82f6; }
.legend-dot.flood-mod  { background: rgba(96,165,250,0.4); border-color: #60a5fa; }
.legend-dot.landslide  { background: rgba(245,158,11,0.4); border-color: #f59e0b; }
.legend-dot.volcanic-pdz { background: rgba(239,68,68,0.4); border-color: #ef4444; }
.legend-dot.volcanic-edz { background: rgba(249,115,22,0.35); border-color: #f97316; }
.legend-dot.fault      { background: rgba(168,85,247,0.35); border-color: #a855f7; }
.legend-icon { width: 14px; text-align: center; font-size: 0.85rem; }
.legend-icon.evac { color: var(--evac-green); }
.legend-icon.incident { color: var(--orange); }

/* ===== MAP WRAP ===== */
.map-wrap { flex: 1; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; z-index: 1; }

/* ===== RISK INDICATOR ===== */
.risk-indicator {
  position: absolute; top: 36px; left: 50%; transform: translateX(-50%);
  background: rgba(14,20,26,0.88); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 8px 20px; z-index: 500; text-align: center;
  min-width: 180px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.risk-label { font-size: 0.68rem; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.08em; }
.risk-value {
  font-family: var(--font-brand); font-size: 1rem; font-weight: 700;
  margin: 2px 0; color: var(--text-mid);
}
.risk-value.LOW     { color: var(--green); }
.risk-value.MODERATE { color: var(--amber); }
.risk-value.HIGH    { color: var(--orange); }
.risk-value.VERY\ HIGH { color: var(--red); }
.risk-value.CRITICAL { color: var(--red); animation: pulse 1s infinite; }
/* Dominant risk type overrides level color */
.risk-value.risk-type-flood     { color: #60a5fa; }
.risk-value.risk-type-landslide { color: #fbbf24; }
.risk-value.risk-type-volcanic  { color: #f87171; }
.risk-value.risk-type-fault     { color: #c084fc; }
.risk-location { font-size: 0.82rem; color: #ffffff; }

/* ===== FAB REPORT ===== */
.fab-report {
  position: absolute; bottom: 16px; right: 16px; z-index: 500;
  background: var(--red); color: #fff; border: none;
  border-radius: 28px; padding: 10px 18px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(248,81,73,0.4);
  transition: all var(--transition); font-family: var(--font);
}
.fab-report:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(248,81,73,0.5); }
.fab-report.pinning { background: var(--amber); animation: pulse 1s infinite; }

/* ===== RIGHT PANEL CONTENT ===== */
.location-name {
  font-family: var(--font-brand); font-size: 1rem; font-weight: 700;
  color: var(--text); margin-bottom: 3px;
}
.location-meta { font-size: 0.78rem; color: var(--text-mid); margin-bottom: 8px; }
.risk-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.risk-badges-mobile { display: none; }
.risk-badge {
  font-size: 0.68rem; font-weight: 600; padding: 3px 8px;
  border-radius: 4px; display: flex; align-items: center; gap: 4px;
}
.risk-badge.flood    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.risk-badge.landslide{ background: rgba(245,158,11,0.15); color: #fbbf24; }
.risk-badge.volcanic { background: rgba(239,68,68,0.15);  color: #f87171; }
.risk-badge.fault    { background: rgba(168,85,247,0.15); color: #c084fc; }

/* ===== WEATHER WIDGET ===== */
.weather-widget {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem;
}
.weather-loading { color: var(--text-mid); font-size: 0.83rem; }
.weather-icon { font-size: 1.8rem; }
.weather-temp { font-size: 1.4rem; font-weight: 700; }
.weather-desc { font-size: 0.78rem; color: var(--text-mid); margin-top: 2px; }
.weather-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.weather-meta span { font-size: 0.72rem; color: var(--text-mid); display: flex; align-items: center; gap: 3px; }

/* ===== HOTLINES ===== */
.hotlines-list { display: flex; flex-direction: column; gap: 5px; }
.hotline-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  transition: all var(--transition);
}
.hotline-item:hover { border-color: rgba(225,0,0,0.35); background: rgba(225,0,0,0.04); }
.hotline-item.priority { border-color: var(--red); background: var(--red-dim); }
.hotline-icon { width: 24px; text-align: center; color: var(--blue); font-size: 0.85rem; flex-shrink: 0; }
.hotline-item.priority .hotline-icon { color: var(--red); }
.hotline-info { flex: 1; min-width: 0; }
.hotline-label { font-size: 0.78rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hotline-numbers { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.hotline-number {
  font-size: 0.72rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: color var(--transition);
}
.hotline-number.landline { color: var(--blue); }
.hotline-number.mobile { color: var(--amber); }
.hotline-number:hover { opacity: 0.8; }
.hotline-item.priority .hotline-number.landline { color: var(--red); }
.hotline-item.priority .hotline-number.mobile { color: var(--amber); }
.hotline-call-group { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.hotline-call {
  background: none; border: none; color: var(--text-mid); cursor: pointer;
  font-size: 0.75rem; padding: 3px 5px; border-radius: 4px;
  transition: color var(--transition);
}
.hotline-call:hover { color: var(--blue); }
.hotline-call.mobile:hover { color: var(--green); }

/* ===== SERVICES ===== */
.services-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.service-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 8px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer; transition: all var(--transition);
}
.service-item:hover { border-color: rgba(225,0,0,0.35); background: rgba(225,0,0,0.04); }
.service-item.active { border-color: var(--red); background: rgba(248,81,73,0.08); }
.service-item.active .service-name { color: var(--red); font-weight: 600; }
.service-type-icon {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 0.95rem;
}
.service-type-icon.hospital    { background: rgba(31,143,232,0.15);  color: var(--blue); }
.service-type-icon.police      { background: rgba(248,81,73,0.15);   color: var(--red); }
.service-type-icon.fire        { background: rgba(248,81,73,0.15);   color: var(--red); }
.service-type-icon.evacuation  { background: var(--evac-green-dim);  color: var(--evac-green); }
.service-type-icon.pharmacy    { background: rgba(163,113,247,0.15); color: var(--purple); }
.service-type-icon.government  { background: rgba(227,179,65,0.15);  color: var(--amber); }
.service-info { flex: 1; min-width: 0; }
.service-name { font-size: 0.8rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-dist { font-size: 0.72rem; color: var(--text-mid); }
.svc-muni { color: var(--laguna-gold); font-weight: 500; }
.empty-state {
  text-align: center; padding: 20px; color: var(--text-dim);
  font-size: 0.83rem;
}
.empty-state i { font-size: 1.5rem; margin-bottom: 8px; display: block; }

/* ===== REPORT INCIDENT SIDEBAR BUTTON ===== */
.btn-report-sidebar {
  width: 100%; padding: 11px; border-radius: 8px;
  background: var(--sol-red); border: none; color: #fff;
  font-size: 0.83rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition); font-family: var(--font);
  letter-spacing: 0.03em; text-transform: uppercase;
  box-shadow: 0 2px 16px rgba(225,0,0,0.4);
}
.btn-report-sidebar:hover { background: var(--sol-red-dark); transform: translateY(-1px); box-shadow: 0 4px 24px rgba(225,0,0,0.55); }

/* ===== BOTTOM BAR ===== */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(14,20,26,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 900;
  transition: transform var(--transition);
}
.bottom-bar.collapsed { transform: translateY(calc(var(--bottom-h) - 36px)); }

.bottom-tabs {
  height: 38px; display: flex; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.btab {
  flex: 1; height: 100%; background: none; border: none;
  color: rgba(255,255,255,0.45); font-size: 0.75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border-bottom: 2px solid transparent; transition: all var(--transition);
  font-family: var(--font); font-weight: 500;
}
.btab:hover { color: var(--text-mid); }
.btab.active { color: var(--sol-red); border-bottom-color: var(--sol-red); }
.btab-collapse {
  width: 40px; height: 100%; background: none; border: none; border-left: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.35); cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition);
}
.btab-collapse:hover { color: var(--text-mid); }

.bottom-content { height: var(--bottom-h); overflow: hidden; }
.tab-pane { display: none; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px; }
.tab-pane.active { display: block; }

/* ===== ALERTS LIST ===== */
.alerts-list { display: flex; flex-direction: column; gap: 6px; }
.alert-card {
  padding: 10px 12px; border-radius: 6px;
  border-left: 3px solid;
  background: var(--surface2);
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-card.critical { border-color: var(--red); background: var(--red-dim); }
.alert-card.high     { border-color: var(--orange); }
.alert-card.moderate { border-color: var(--amber); background: var(--amber-dim); }
.alert-card.low      { border-color: var(--green); background: var(--green-dim); }
.alert-icon { font-size: 1rem; flex-shrink: 0; padding-top: 1px; }
.alert-card.critical .alert-icon { color: var(--red); }
.alert-card.high     .alert-icon { color: var(--orange); }
.alert-card.moderate .alert-icon { color: var(--amber); }
.alert-card.low      .alert-icon { color: var(--green); }
.alert-body { flex: 1; }
.alert-source-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 3px; margin-bottom: 3px;
  background: rgba(255,255,255,0.08); color: var(--text-mid); border: 1px solid rgba(255,255,255,0.1);
}
.alert-title { font-size: 0.83rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.alert-detail { font-size: 0.77rem; color: var(--text-mid); }
.alert-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 3px; }

/* ===== INCIDENTS ===== */
.tab-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.mobile-sheet .tab-toolbar { display: none; }
.incidents-list { display: flex; flex-direction: column; gap: 6px; }
.incident-card {
  padding: 10px 12px; border-radius: 6px; border-left: 3px solid var(--border);
  background: var(--surface2); display: flex; gap: 10px; align-items: flex-start;
}
.incident-card.critical { border-color: var(--red); }
.incident-card.high     { border-color: var(--orange); }
.incident-card.moderate { border-color: var(--amber); }
.incident-card.low      { border-color: var(--green); }
.incident-type-icon { font-size: 1.1rem; flex-shrink: 0; padding-top: 1px; }
.incident-body { flex: 1; }
.incident-title { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.incident-loc { font-size: 0.75rem; color: var(--text-mid); }
.incident-desc { font-size: 0.77rem; color: var(--text-mid); margin-top: 2px; }
.incident-meta { font-size: 0.7rem; color: var(--text-dim); margin-top: 3px; }
.incident-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-icon-sm {
  width: 26px; height: 26px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-mid); cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-icon-sm:hover { color: var(--blue); border-color: var(--blue); }
.btn-icon-sm.danger:hover { color: var(--red); border-color: var(--red); }

/* ===== WEATHER FULL ===== */
.weather-full { padding: 4px 0; }
.weather-full-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.weather-stat { background: var(--surface2); border: 1px solid var(--border-light); border-radius: 6px; padding: 10px; text-align: center; }
.weather-stat .ws-val { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.weather-stat .ws-lbl { font-size: 0.72rem; color: var(--text-mid); margin-top: 2px; }

/* ===== RESOURCES ===== */
.resources-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.resource-card {
  background: var(--surface2); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.resource-card i { font-size: 1.3rem; color: var(--blue); }
.resource-card strong { font-size: 1.1rem; color: var(--text); }
.resource-card span { font-size: 0.72rem; color: var(--text-mid); }
.resource-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.resource-link {
  font-size: 0.78rem; color: #fff; text-decoration: none;
  background: var(--blue-dim); padding: 5px 10px; border-radius: 4px;
  display: flex; align-items: center; gap: 5px;
  transition: opacity var(--transition);
}
.resource-link:hover { opacity: 0.8; }

/* ─── Resources tab (per-municipality) ─── */
.resources-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 14px;
}
.res-stat {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.res-stat i { font-size: 0.95rem; color: var(--laguna-gold); }
.res-stat strong { font-size: 1rem; color: var(--text); line-height: 1; }
.res-stat span { font-size: 0.62rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.02em; }

.res-block { margin-bottom: 14px; }
.res-section-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-mid);
  display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.res-section-title i { color: var(--sol-red); }
.res-badge { background: var(--sol-red); color: #fff; font-size: 0.64rem; border-radius: 10px; padding: 0 6px; min-width: 16px; text-align: center; }
.res-badge:empty { display: none; }

.res-list { display: flex; flex-direction: column; gap: 6px; }
.res-empty { font-size: 0.78rem; color: var(--text-dim); padding: 12px; text-align: center; background: var(--surface2); border-radius: 8px; }
.res-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  transition: border-color 0.15s;
}
.res-item:hover { border-color: var(--sol-red); }
.res-ico {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem;
}
.res-ico.evac { background: #1A7A45; }
.res-ico.police { background: #1565c0; }
.res-ico.fire { background: #e53935; }
.res-ico.hospital, .res-ico.rhu { background: #00897b; }
.res-ico.other { background: #607d8b; }
.res-info { flex: 1; min-width: 0; }
.res-name { font-size: 0.84rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-sub { font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-go {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-mid);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  transition: all 0.15s;
}
.res-go:hover { background: var(--sol-red); color: #fff; border-color: var(--sol-red); }
.res-go.call:hover { background: var(--green); border-color: var(--green); }
.res-note { font-size: 0.68rem; color: var(--text-dim); padding: 8px 4px 2px; line-height: 1.4; }
.res-note i { color: var(--laguna-gold); margin-right: 4px; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 2000; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: rgba(22,28,34,0.98); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; width: 520px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
}
.modal-box.small { width: 380px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header h2 i { color: var(--amber); }
.modal-close {
  background: none; border: none; color: var(--text-mid);
  cursor: pointer; font-size: 1.1rem; transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-hint { font-size: 0.82rem; color: var(--text-mid); margin-bottom: 14px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-mid); margin-bottom: 6px;
}
.form-group .req { color: var(--red); }
.form-group em { font-weight: 400; color: var(--text-dim); }
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 9px 12px;
  font-size: 0.875rem; outline: none; font-family: var(--font);
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--blue); }
.form-group textarea { resize: vertical; min-height: 80px; }

.location-row { display: flex; gap: 8px; }
.location-row input { flex: 1; }
.coords-display { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }

.severity-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.sev-btn {
  padding: 6px 14px; border-radius: 6px; border: 1.5px solid;
  cursor: pointer; font-size: 0.8rem; font-weight: 600; font-family: var(--font);
  transition: all var(--transition); background: none;
}
.sev-btn.low      { border-color: var(--green); color: var(--green); }
.sev-btn.moderate { border-color: var(--amber); color: var(--amber); }
.sev-btn.high     { border-color: var(--orange); color: var(--orange); }
.sev-btn.critical { border-color: var(--red);   color: var(--red); }
.sev-btn.active.low      { background: var(--green-dim); }
.sev-btn.active.moderate { background: var(--amber-dim); }
.sev-btn.active.high     { background: rgba(240,136,62,0.15); }
.sev-btn.active.critical { background: var(--red-dim); }

.btn-cancel {
  padding: 9px 18px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-mid); cursor: pointer; font-size: 0.875rem;
  font-family: var(--font); transition: all var(--transition);
}
.btn-cancel:hover { border-color: var(--text-mid); color: var(--text); }
.btn-submit {
  padding: 9px 20px; border-radius: 6px;
  background: var(--blue); border: none;
  color: #fff; cursor: pointer; font-size: 0.875rem; font-weight: 600;
  font-family: var(--font); display: flex; align-items: center; gap: 7px;
  transition: opacity var(--transition);
  white-space: nowrap; /* prevent icon + text from wrapping onto separate lines */
}
.btn-submit:hover { opacity: 0.85; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Photo upload ── */
.photo-upload-area {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px; border: 2px dashed var(--border); border-radius: 8px;
  cursor: pointer; color: var(--text-dim); font-size: 0.8rem; transition: border-color 0.2s;
}
.photo-upload-area:hover { border-color: var(--blue); color: var(--text-mid); }
.photo-upload-area i { font-size: 1.4rem; margin-bottom: 2px; }
.photo-upload-area em { font-size: 0.72rem; }
.photo-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-preview-item {
  position: relative; width: 72px; height: 72px; border-radius: 6px;
  overflow: hidden; border: 1px solid var(--border);
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-remove {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6);
  border: none; color: #fff; border-radius: 50%; width: 18px; height: 18px;
  font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.photo-uploading { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }
.btn-sm {
  padding: 6px 12px; border-radius: 6px; background: var(--blue);
  border: none; color: #fff; cursor: pointer; font-size: 0.78rem; font-weight: 600;
  display: flex; align-items: center; gap: 5px; font-family: var(--font);
  transition: opacity var(--transition);
}
.btn-sm:hover { opacity: 0.85; }
.btn-sm.outline { background: var(--surface2); border: 1px solid var(--border); color: var(--text-mid); }
.btn-sm.outline:hover { border-color: var(--red); color: var(--red); opacity: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 220px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 20px; font-size: 0.875rem;
  color: var(--text); z-index: 3000; pointer-events: none;
  opacity: 0; transition: opacity 0.3s ease;
  box-shadow: var(--shadow); white-space: nowrap;
}
.toast.show { opacity: 1; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
.toast.warning { border-color: var(--amber);  color: var(--amber); }

/* ===== LEAFLET OVERRIDES ===== */
.leaflet-popup-content-wrapper {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); color: var(--text);
}
.leaflet-popup-tip { background: var(--surface2); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); font-size: 0.85rem; }
.popup-title { font-weight: 700; margin-bottom: 4px; }
.popup-desc  { color: var(--text-mid); font-size: 0.8rem; line-height: 1.5; }
.popup-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; margin-bottom: 6px;
}
.popup-badge.flood    { background: rgba(59,130,246,0.2); color: #60a5fa; }
.popup-badge.landslide{ background: rgba(245,158,11,0.2); color: #fbbf24; }
.popup-badge.volcanic { background: rgba(239,68,68,0.2);  color: #f87171; }
.popup-badge.fault    { background: rgba(168,85,247,0.2); color: #c084fc; }
.popup-muni { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; }
.leaflet-control-zoom a {
  background: var(--surface2) !important; border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.leaflet-control-zoom a:hover { background: var(--border) !important; }
.leaflet-control-attribution {
  background: rgba(13,17,23,0.75) !important; color: var(--text-dim) !important;
  font-size: 0.65rem !important;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

/* Custom markers */
.evac-marker, .incident-marker {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.8rem;
}
.evac-marker { background: var(--evac-green-dim); border: 2px solid var(--evac-green); color: var(--evac-green); width: 28px; height: 28px; }
.incident-marker { background: rgba(240,136,62,0.2); border: 2px solid var(--orange); color: var(--orange); width: 28px; height: 28px; }
.pinning-marker { background: rgba(248,81,73,0.2); border: 2px solid var(--red); color: var(--red); width: 32px; height: 32px; font-size: 1rem; }

/* ===== PINNING OVERLAY ===== */
.pinning-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  z-index: 600; text-align: center;
  background: rgba(13,17,23,0.85); border: 1px solid var(--amber);
  border-radius: 10px; padding: 12px 20px; color: var(--amber);
  font-size: 0.9rem; font-weight: 600;
}
.pinning-hint i { font-size: 1.5rem; display: block; margin-bottom: 6px; }

/* ===== CHAT FAB (map floating button) ===== */
.fab-chat-map {
  position: absolute; bottom: 16px; right: 100px; z-index: 500;
  background: var(--sol-red); color: #fff; border: none;
  border-radius: 28px; padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,48,135,0.5);
  transition: all var(--transition); font-family: var(--font);
  border: 1px solid var(--laguna-gold);
}
.fab-chat-map:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200,16,46,0.6); background: var(--sol-red-dark); }
.fab-chat-map i { font-size: 0.875rem; }

/* ===== CHAT WINDOW ===== */
.chat-window {
  position: fixed; bottom: calc(var(--bottom-h) + 48px); right: 24px;
  width: 400px; height: 530px;
  font-size: 14px;
  background: rgba(14,20,26,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: 2px solid var(--laguna-gold);
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.8), 0 0 0 1px rgba(250,189,0,0.12);
  display: flex; flex-direction: column;
  z-index: 2500;
  transform: translateY(24px) scale(0.96);
  opacity: 0; pointer-events: none;
  transition: all 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}
.chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: all;
}

/* ── Chat Header ── */
.chat-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(225,0,0,0.9) 0%, rgba(192,0,0,0.9) 100%);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(201,168,37,0.2); border: 2px solid var(--laguna-gold);
  overflow: hidden;
}
.chat-avatar img {
  width: 100%; height: 100%; object-fit: contain;
  display: flex; align-items: center; justify-content: center;
  color: var(--laguna-gold); font-size: 1rem; flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-title { font-size: 0.875rem; font-weight: 700; color: #fff; font-family: var(--font-brand); }
.chat-status { font-size: 0.7rem; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.chat-location-chip {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px; padding: 2px 9px; margin-top: 2px;
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.chat-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}
.chat-dot.orange { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

.chat-mode-toggle {
  display: flex; gap: 4px; flex-shrink: 0;
}
.chat-mode-btn {
  padding: 5px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
  font-size: 0.72rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: all var(--transition); font-family: var(--font);
}
.chat-mode-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.chat-mode-btn.active { background: rgba(201,168,37,0.25); color: var(--laguna-gold); border-color: var(--laguna-gold); }

.chat-close-btn {
  background: none; border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; font-size: 1rem; padding: 4px;
  transition: color var(--transition); flex-shrink: 0;
}
.chat-close-btn:hover { color: #fff; }

/* ── Chat Mode Panel ── */
.chat-mode-panel {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* ── Messages ── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-msg {
  display: flex; gap: 8px; align-items: flex-end; max-width: 88%;
}
.chat-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.chat-msg.bot, .chat-msg.agent, .chat-msg.system { align-self: flex-start; }

.chat-msg-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
}
.chat-msg.bot .chat-msg-avatar   { background: var(--sol-red-dim); color: var(--sol-red); }
.chat-msg.agent .chat-msg-avatar { background: var(--green-dim); color: var(--green); }

.chat-bubble {
  padding: 9px 13px; border-radius: 16px; max-width: 100%;
  font-size: 0.825rem; line-height: 1.55; word-break: break-word;
}
.chat-msg.user  .chat-bubble { background: var(--sol-red); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-msg.bot   .chat-bubble { background: var(--surface2); color: var(--text); border: 1px solid var(--border-light); border-radius: 16px 16px 16px 4px; }
.chat-msg.agent .chat-bubble { background: var(--surface2); color: var(--text); border: 1px solid var(--border-light); border-radius: 16px 16px 16px 4px; }
.chat-msg.system .chat-bubble {
  background: rgba(201,168,37,0.08); border: 1px solid rgba(201,168,37,0.2);
  color: var(--amber); font-size: 0.75rem; border-radius: 8px;
  text-align: center; width: 100%; align-self: center; max-width: 100%;
}
.chat-msg-time { font-size: 0.65rem; color: var(--text-dim); margin-top: 3px; text-align: right; }
.chat-msg.user .chat-msg-time { text-align: right; }

/* Typing indicator */
.chat-typing { display: flex; align-items: center; gap: 4px; padding: 10px 13px; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-mid);
  animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Quick Replies ── */
.chat-quick-replies {
  padding: 0 12px 8px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.quick-reply-chip {
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-mid); font-size: 0.75rem; cursor: pointer;
  transition: all var(--transition); font-family: var(--font);
  white-space: nowrap;
}
.quick-reply-chip:hover { border-color: var(--laguna-gold); color: var(--laguna-gold); background: var(--laguna-gold-dim); }

/* ── Chat Footer / Input ── */
.chat-footer { padding: 8px 12px; border-top: 1px solid var(--border-light); flex-shrink: 0; }
.chat-input-row { display: flex; gap: 6px; align-items: center; }
.chat-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 22px; padding: 9px 14px;
  color: var(--text); font-size: 0.825rem; outline: none;
  font-family: var(--font); transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--sol-red); }
.chat-input::placeholder { color: var(--text-dim); }
.chat-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sol-red); border: none; color: #fff;
  cursor: pointer; font-size: 0.85rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.chat-send-btn:hover { background: var(--sol-red-dark); transform: scale(1.08); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.chat-attach-btn {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.chat-attach-btn:hover { border-color: var(--text-mid); color: var(--text-mid); }

.chat-escalate-hint { font-size: 0.7rem; color: var(--text-dim); text-align: center; margin-top: 5px; }
.chat-link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: inherit; font-family: var(--font); text-decoration: underline; padding: 0; }
.chat-link-btn:hover { color: var(--laguna-gold); }

/* ── Human Agent Panel ── */
.agent-queue-card {
  margin: 12px; padding: 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.queue-spinner { font-size: 1.4rem; color: var(--amber); }
.queue-title { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.queue-sub { font-size: 0.75rem; color: var(--text-mid); margin-top: 2px; }

.agent-connected-banner {
  margin: 10px 12px 0; padding: 8px 12px; border-radius: 8px;
  background: var(--green-dim); border: 1px solid var(--green);
  color: var(--green); font-size: 0.78rem;
  display: flex; align-items: center; gap: 7px;
}

/* ── Offline Form ── */
.human-offline-form {
  padding: 14px 14px 0; flex: 1; overflow-y: auto;
}
.offline-title { font-size: 0.83rem; font-weight: 700; color: var(--amber); margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.offline-sub { font-size: 0.75rem; color: var(--text-mid); margin-bottom: 12px; line-height: 1.5; }
.chat-input-field {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text);
  font-size: 0.825rem; outline: none; font-family: var(--font);
  margin-bottom: 8px; transition: border-color var(--transition);
  display: block;
}
.chat-input-field:focus { border-color: var(--blue); }
.chat-input-field::placeholder { color: var(--text-dim); }
textarea.chat-input-field { resize: vertical; min-height: 70px; }
.offline-send-btn {
  width: 100%; padding: 10px; border-radius: 8px;
  background: var(--sol-red); border: none; color: #fff;
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font); transition: opacity var(--transition);
  margin-bottom: 10px;
}
.offline-send-btn:hover { opacity: 0.85; }

/* ── Chat Image Attachment Preview ── */
.chat-attachment-preview {
  margin: 6px 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-light); max-width: 200px;
}
.chat-attachment-preview img { width: 100%; display: block; }

/* ===== MUNICIPALITY SERVICES ===== */
.muni-services-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.muni-service-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border-light);
  cursor: pointer; transition: all var(--transition);
}
.muni-service-item:hover { border-color: var(--blue); }
.muni-service-info { flex: 1; min-width: 0; }
.muni-service-name { font-size: 0.8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muni-service-addr { font-size: 0.72rem; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muni-service-phone { font-size: 0.72rem; color: var(--blue); margin-top: 1px; }
.muni-service-call {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
  background: var(--green-dim); border: 1px solid var(--green);
  color: var(--green); cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.muni-service-call:hover { background: var(--green); color: #fff; }
.muni-service-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.muni-service-call-mobile {
  background: var(--blue-dim); border-color: var(--blue); color: var(--blue);
}
.muni-service-call-mobile:hover { background: var(--blue); color: #fff; }
.muni-service-mobile-num { color: var(--blue); }
.muni-services-group-label {
  font-size: 0.68rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 6px 0 3px; margin-top: 2px;
}
.muni-services-group-label:first-child { margin-top: 0; }

/* ===== UPDATES TAB ===== */
.updates-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0 10px; font-size: 0.78rem; color: var(--text-mid);
  border-bottom: 1px solid var(--border-light); margin-bottom: 10px;
}
.updates-header i { color: var(--blue); }
.updates-list { display: flex; flex-direction: column; gap: 8px; }
.update-card {
  background: var(--surface2); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 12px; position: relative; overflow: hidden;
}
.update-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.update-card.power::before { background: var(--amber); }
.update-card.water::before { background: var(--water-blue); }
.update-card-header {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 8px;
}
.update-type-icon {
  width: 30px; height: 30px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.update-type-icon.power { background: var(--amber-dim); color: var(--amber); }
.update-type-icon.water { background: var(--water-blue-dim); color: var(--water-blue); }
.update-card-title { font-size: 0.82rem; font-weight: 600; color: var(--text); flex: 1; line-height: 1.4; }
.update-status-badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px;
}
.update-status-badge.scheduled { background: var(--water-blue-dim); color: var(--water-blue); }
.update-status-badge.ongoing   { background: rgba(248,81,73,0.15);   color: var(--red); animation: pulse 2s infinite; }
.update-status-badge.completed { background: rgba(63,185,80,0.15);   color: var(--green); }
.update-affected {
  font-size: 0.75rem; color: var(--text-mid); margin-bottom: 6px;
  display: flex; align-items: flex-start; gap: 5px;
}
.update-affected i { color: var(--text-dim); margin-top: 1px; flex-shrink: 0; }
.update-meta {
  display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.72rem; color: var(--text);
}
.update-meta span { display: flex; align-items: center; gap: 3px; }
.update-reason {
  font-size: 0.75rem; color: var(--text-mid); margin-bottom: 8px; line-height: 1.5;
  border-top: 1px solid var(--border-light); padding-top: 7px; margin-top: 7px;
}
.update-contact {
  font-size: 0.72rem; color: var(--water-blue); display: flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: bold;
}
.update-card.power .update-contact { color: var(--amber); }
.update-empty {
  text-align: center; padding: 24px 16px; color: var(--text-dim); font-size: 0.83rem;
}
.update-empty i { font-size: 1.6rem; display: block; margin-bottom: 8px; color: var(--text-dim); }

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes user-loc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,144,226,0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(74,144,226,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,144,226,0); }
}

/* ===== MUNICIPALITY SELECTION MARKER ===== */
@keyframes muni-pulse {
  0%   { transform: translate(-50%,-50%) scale(1);   opacity: 0.9; }
  50%  { transform: translate(-50%,-50%) scale(1.35); opacity: 0.4; }
  100% { transform: translate(-50%,-50%) scale(1);   opacity: 0.9; }
}
.muni-selection-marker {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--sol-red);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--sol-red), 0 4px 12px rgba(200,16,46,0.6);
}
.muni-selection-pulse {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--sol-red);
  border: 2px solid var(--sol-red);
  animation: muni-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
/* Municipality tooltip */
.muni-tooltip {
  background: rgba(9,15,26,0.92) !important;
  border: 1px solid var(--sol-red) !important;
  border-radius: 8px !important;
  color: #e2eaf5 !important;
  font-size: 0.8rem !important;
  padding: 6px 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6) !important;
  white-space: nowrap;
}
.muni-tooltip::before { display: none !important; }
.leaflet-tooltip-top.muni-tooltip::before {
  display: block !important;
  border-top-color: var(--sol-red) !important;
}

/* ── Chat unread badge ── */
.chat-unread {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ===== MOBILE PANEL CLOSE & BACKDROP ===== */
.mobile-panel-close {
  display: none; position: absolute; top: 10px; right: 10px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-mid); cursor: pointer; font-size: 1rem;
  align-items: center; justify-content: center;
  transition: all var(--transition);
}
.mobile-panel-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

.mobile-backdrop {
  display: none; position: fixed; top: 0; bottom: 0; right: 0;
  left: min(300px, 85vw);
  background: rgba(0,0,0,0.5); z-index: 799;
}
.mobile-backdrop.visible { display: block; }

/* hamburger + mobile theme toggle: hidden on desktop */
.topbar-hamburger { display: none; }
.topbar-theme-mobile { display: none; }

/* ===== TOPBAR INTRO (mobile only) ===== */
.topbar-intro-mobile {
  display: none; /* shown via mobile media query */
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 4px 0 0;
  gap: 1px;
}
.topbar-intro-brand {
  font-family: var(--font-headline);
  font-size: 0.95rem; font-weight: 900;
  color: #fff; letter-spacing: -0.01em;
  text-transform: uppercase;
}
.topbar-intro-tag {
  font-size: 0.70rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #e10000;
}
.topbar-intro-title {
  font-family: var(--font-headline);
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-mid);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-intro-sub {
  font-weight: 400; opacity: 0.65;
}

/* Gov text inline in topbar — mobile only */
.topbar-gov-inline {
  display: none; /* hidden on desktop */
  align-items: center; gap: 4px;
  font-size: 0.66rem; color: rgba(255,255,255,0.82); font-weight: 500;
  white-space: nowrap; flex-shrink: 1; overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== MOBILE STATUS CARD ===== */
.mobile-status-card { display: none; }
.mobile-weather-card { display: none; }

/* ===== MOBILE BOTTOM NAV — Floating Island ===== */
.mobile-bottom-nav {
  display: none; /* shown only on mobile via media query */
  position: fixed;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 95%;
  max-width: 448px;
  height: 60px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 9999px;
  border: none !important;
  padding: 0 8px;
  box-shadow: 0 12px 40px rgba(26,28,28,0.08);
  z-index: 1009;
  justify-content: space-around;
  align-items: center;
}

/* ===== MAIN SHEET TABS ===== */
.main-sheet-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  scrollbar-width: none;
}
.main-sheet-tabs::-webkit-scrollbar { display: none; }
.main-sheet-tabs .btab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  font-size: 0.6rem;
  font-weight: 500;
  min-height: 48px;
  min-width: 60px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.02em;
}
.main-sheet-tabs .btab i { font-size: 1rem; }
.main-sheet-tabs .btab.active {
  color: var(--laguna-gold);
  border-bottom-color: var(--laguna-gold);
}

/* ===== MAIN SHEET BODY ===== */
.main-sheet-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: rgba(0,0,0,0.45);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
  min-height: 48px;
  padding: 0 2px 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 9999px;
}
.mnav-btn .mnav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.mnav-btn i,
.mnav-btn .material-symbols-outlined { font-size: 1.5rem; transition: transform 0.15s ease; color: rgba(0,0,0,0.4); }
.mnav-btn.active { color: var(--sol-red); }
.mnav-btn.active .mnav-icon-wrap { background: rgba(225,0,0,0.1); }
.mnav-btn.active i,
.mnav-btn.active .material-symbols-outlined { transform: scale(1.1); color: var(--sol-red); }
.mnav-btn:active .mnav-icon-wrap { background: rgba(0,0,0,0.06); }
.mnav-btn:active i,
.mnav-btn:active .material-symbols-outlined { transform: scale(0.9); }

.mnav-badge {
  position: absolute;
  top: -3px; right: -4px;
  background: #e10000; color: #fff;
  border-radius: 10px; font-size: 0.55rem;
  padding: 1px 4px; min-width: 16px;
  text-align: center; pointer-events: none;
  box-shadow: 0 0 6px rgba(225,0,0,0.5);
}

/* ===== MOBILE SHEETS (hotlines + any future sheet) ===== */
.mobile-sheet {
  display: none; /* flex on mobile via media query */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(22,28,34,0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 1010;
  max-height: 82vh;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overscroll-behavior: none;
}
.mobile-sheet.sheet-open { transform: translateY(0); }

.sheet-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sheet-header h3 {
  margin: 0; font-size: 0.92rem; font-weight: 600;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.sheet-header h3 i { color: var(--laguna-gold); }
.sheet-section-title {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 8px;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-section-title i { color: var(--laguna-gold); }
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain; /* scroll stops at boundary, never chains to sheet drag */
  padding: 12px 16px 80px; /* 80px clears the 64px bottom nav */
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
/* Hotlines sheet: two equal scrollable halves */
.sheet-halves {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
}
.sheet-half {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet-half + .sheet-half {
  border-left: 1px solid var(--border);
}
.sheet-half .sheet-section-title {
  border-top: none;
  border-bottom: 1px solid var(--border);
}
.sheet-half .sheet-body {
  padding-bottom: 72px;
}
.sheet-close {
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem; cursor: pointer;
  padding: 6px 8px; border-radius: 6px;
  transition: color 0.15s;
}
.sheet-close:hover { color: var(--text); }

/* ===== RESPONSIVE ===== */

/* ── Tablets (≤900px) ── */
@media (max-width: 900px) {
  :root { --panel-w: 220px; }
}

/* Quick-action buttons — mobile left panel */
.mobile-only-section { display: none; }
.section-quick-actions { background: none; border: none; padding: 0; border-radius: 0; }
.panel-fab-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 10px; border: none; border-radius: 8px;
  font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition);
}
.panel-fab-chat   { background: var(--sol-red); color: #fff; }
.panel-fab-chat:hover { background: var(--sol-red-dark); transform: translateY(-1px); }
.panel-fab-report { background: var(--red); color: #fff; }
.panel-fab-report:hover { background: #c0392b; transform: translateY(-1px); }

/* ── Mobile (≤700px) ── */
@media (max-width: 700px) {
  /* Topbar: icon + intro block + hamburger */
  .topbar-hamburger { display: flex; }
  .topbar-theme-mobile { display: flex; }
  .brand-text { display: none; }
  .topbar-intro-mobile { display: flex; }
  .topbar-intro-brand,
  .topbar-intro-tag { line-height: 1.1; }
  .topbar-intro-title { display: none; }
  /* Gov bar hidden on mobile — branding lives in intro block */
  .gov-bar { display: none; }
  :root { --govbar-h: 0px; }
  .topbar-gov-inline { display: none; }

  /* Hide scrolling ticker on mobile — replaced by status card */
  .alert-ticker { display: none !important; }
  :root { --ticker-h-actual: 0px; }

  /* Mobile status card — floating above bottom nav */
  .mobile-status-card {
    position: fixed;
    bottom: calc(57px + 24px);
    right: 16px;
    width: 140px;
    height: 112px;
    background: rgba(14,20,26,0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 998;
    transition: background 0.15s;
  }
  .mobile-status-card:active { background: rgba(14,20,26,0.97); }
  .msc-top { display: flex; flex-direction: column; gap: 3px; }
  .msc-bottom { display: flex; flex-direction: column; gap: 1px; }
  .msc-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #e10000; margin-bottom: 6px;
    animation: mscPulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
  }
  .msc-dot.clear { background: #53e16f; }
  .msc-label { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(100,116,139,1); }
  .msc-title { font-size: 0.75rem; font-weight: 800; font-family: var(--font-headline); color: #e1e2e8; letter-spacing: 0.01em; line-height: 1.1; }
  .msc-sublabel { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(100,116,139,1); }
  .msc-count { font-size: 0.82rem; font-weight: 800; font-family: var(--font-headline); color: #53e16f; letter-spacing: 0.04em; }
  .msc-count.clear { color: #53e16f; }

  /* Mobile weather card — floating left, same base style as status card */
  .mobile-weather-card {
    position: fixed;
    bottom: calc(68px + 14px);
    right: calc(16px + 140px + 10px);
    width: 140px;
    height: 112px;
    background: rgba(38,45,52,0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 998;
    transition: background 0.15s;
  }
  .mobile-weather-card:active { background: rgba(14,20,26,0.97); }
  .mwc-top { display: flex; flex-direction: column; gap: 3px; }
  .mwc-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 4px; }
  .mwc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
  .mwc-temp { white-space: nowrap; }
  .mwc-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mwc-temp {
    font-size: 1.3rem; font-weight: 700;
    font-family: var(--font-headline);
    color: #e1e2e8; line-height: 1;
  }
  .mwc-desc {
    font-size: 0.65rem; color: var(--text-mid);
    line-height: 1.2; margin-top: 1px;
  }
  .msc-top { display: flex; flex-direction: column; gap: 3px; }
  .msc-bottom { display: flex; flex-direction: column; gap: 1px; }
  .msc-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #e10000; margin-bottom: 6px;
    animation: mscPulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
  }
  .msc-dot.clear { background: #53e16f; }
  @keyframes mscPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225,0,0,0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(225,0,0,0); }
  }
  .msc-label {
    font-size: 0.58rem; font-weight: 600; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(100,116,139,1);
  }
  .msc-title {
    font-size: 0.6rem; font-weight: 800;
    font-family: var(--font-headline);
    color: rgba(255,242,240,0.85); letter-spacing: 0.08em;
    text-transform: uppercase; line-height: 1.2;
  }
  .msc-count {
    font-size: 0.82rem; font-weight: 800;
    font-family: var(--font-headline);
    color: #fff2f0; letter-spacing: 0.04em;
  }
  .msc-count.clear { color: #a5f3b4; }

  /* All key layout elements are position:fixed — body scroll cannot affect them */
  .app-layout {
    top: 0;
    bottom: 64px; /* clear the new mobile bottom nav */
  }
  .risk-indicator { top: calc(var(--topbar-h) + 50px); }

  /* Search + actions bar: hidden entirely on mobile */
  #topbarSearchActions {
    display: none !important;
  }

  /* Right panel: keep as side drawer */
  .right-panel {
    display: none;
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 800;
    width: min(300px, 85vw);
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
  }
  .right-panel.mobile-open { display: flex; z-index: 1001; padding-top: var(--topbar-h); }

  /* Left panel: bottom sheet */
  .left-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 200px) !important;
    max-height: calc(100vh - 200px) !important;
    min-height: 0 !important;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1010;
    display: flex !important; /* always in DOM, controlled by transform */
    overflow: hidden;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.45);
    padding-top: 0 !important;
  }
  .left-panel.sheet-open { transform: translateY(0); }
  /* Drag handle via pseudo-element */
  .left-panel::before {
    content: '';
    display: block;
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.22);
    border-radius: 2px;
    z-index: 2;
    pointer-events: none;
  }
  .left-panel .panel-inner {
    flex: 1;
    min-height: 0;
    padding-top: 28px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    width: 100%;
  }
  /* Hide close button — drag handle + swipe used instead */
  .left-panel .mobile-panel-close { display: none; }

  /* 2-row panel layout */
  .panel-rows-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 4px 12px 20px;
  }
  .section-location { grid-column: 1 / -1; }
  .risk-badges-mobile:not(:empty) { display: flex; margin-top: 8px; }
  .section-mapview  { grid-column: 1 / -1; }
  .section-hazards  { grid-column: 1 / -1; }
  .section-nearby   { grid-column: 1 / -1; }
  .section-legend   { display: none; } /* hidden on mobile */
  .btn-report-sidebar { display: none; } /* hidden on mobile — panel quick-actions has the Report button */
  .sidebar-intro { display: none; } /* hidden on mobile — compact sheet layout */

  /* Compact hazard toggles: 2-column grid */
  .section-hazards .layer-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  /* Backdrop: covers only below the topbar so hamburger stays clickable */
  .mobile-backdrop {
    left: 0;
    top: var(--topbar-h);
    z-index: 1008;
  }

  /* Existing bottom bar: hidden on mobile (replaced by mobile-bottom-nav) */
  .bottom-bar { display: none !important; }

  /* Show new mobile bottom nav */
  .mobile-bottom-nav { display: flex; }

  /* Sheet height: tops sit just below the risk indicator.
     Risk indicator viewport top = topbar + topbar + 50px (its CSS top within map).
     Add ~68px for ri height + gap. */
  :root { --sheet-max-h: calc(100vh - var(--topbar-h) - var(--topbar-h) - 200px); }

  /* Show all mobile sheets (hidden via transform until sheet-open) */
  .mobile-sheet { display: flex; max-height: var(--sheet-max-h); }

  /* mainSheet + servicesSheet: sit just below risk indicator */
  #mainSheet, #servicesSheet {
    height: var(--sheet-max-h);
    max-height: var(--sheet-max-h);
  }

  /* hotlinesSheet: same height as leftPanel */
  #hotlinesSheet {
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
  }

  /* Sheets cover the bottom nav — no need to pad for it */
  .sheet-body { padding-bottom: 16px; }
  .sheet-half .sheet-body { padding-bottom: 16px; }
  .main-sheet-body .tab-pane { padding-bottom: 16px; }

  /* Main sheet: #bottomContent — flex column so tab-pane can fill and scroll */
  .main-sheet-body > .bottom-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .main-sheet-body .tab-pane {
    padding: 12px 14px 20px;
  }
  .main-sheet-body .tab-pane.active {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }

  /* Chat window — full-width bottom sheet, above floating island nav.
     bottom offset = 64px nav + 24px gap = 88px; subtract that so top aligns with other sheets. */
  .chat-window {
    width: 100vw; right: 0; left: 0; bottom: calc(64px + 24px);
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
    border-radius: 16px 16px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    border-top: none;
    background: transparent;
  }
  .chat-window .chat-header { border-radius: 16px 16px 0 0; }
  .chat-window .chat-mode-panel { background: rgba(14,20,26,0.97); }

  /* Quick-actions section — 2 columns, full panel width */
  .mobile-only-section { display: block; }
  .section-quick-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Hide floating FABs — replaced by panel buttons on mobile */
  .fab-chat-map, .fab-report { display: none !important; }

  /* FABs — fixed to viewport above the bottom nav */
  .fab-chat-map, .fab-report { position: fixed; }
  .fab-chat-map { right: 24px; bottom: calc(102px + 14px); }
  .fab-report   { right: 16px; bottom: calc(64px + 14px); }
  /* Hide floating chat FAB on mobile (Chat is in bottom nav) */
  #fabChat { display: none !important; }

  /* Chat open: hide bottom nav, drop chat to bottom edge, hide FABs */
  body.mobile-chat-open .mobile-bottom-nav { display: none !important; }
  body.mobile-chat-open .chat-window { bottom: 0; height: calc(100vh - 200px); max-height: calc(100vh - 200px); border-radius: 0; }
  body.mobile-chat-open .fab-chat-map,
  body.mobile-chat-open .fab-report { display: none; }

  /* Touch targets — min 44×44px */
  .topbar-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .muni-service-call { width: 40px; height: 40px; }
  .map-view-btn { min-height: 40px; }
  .layer-toggle { min-height: 40px; }

  /* Modals — full-screen bottom sheet */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    height: calc(100vh - 200px); max-height: calc(100vh - 200px); border-radius: 16px 16px 0 0;
    width: 100%; max-width: 100%; margin: 0;
  }

  /* Prevent iOS Safari auto-zoom on input focus (triggers when font-size < 16px).
     Use px, not rem — rem depends on root font-size which user settings can change. */
  .chat-input,
  .chat-input-field,
  input[type="text"],
  input[type="tel"],
  input[type="search"],
  textarea {
    font-size: 16px !important;
  }

}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .laguna-seal { width: 28px; height: 28px; }
  .brand-name { font-size: 0.88rem; }

  /* Chat window: same top-edge rule on small phones */
  .chat-window { height: calc(100vh - 200px); max-height: calc(100vh - 200px); bottom: calc(64px + 24px); }

  /* Left panel: same height as other sheets on small phones */
  .left-panel { height: calc(100vh - 200px) !important; max-height: calc(100vh - 200px) !important; }

  /* Report modal footer: stack buttons so they never squeeze each other */
  .modal-footer { flex-wrap: wrap; }
  .btn-cancel,
  .btn-submit { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   LIGHT / DARK THEME SUPPORT
   "Compassionate Vanguard" design system (stitch reference)
   html.dark  = dark emergency theme (default)
   html.light = light editorial theme
   ============================================================ */

/* ═══ DARK MODE — floating island nav ═══ */
html.dark .mobile-bottom-nav {
  background: rgba(28,25,23,0.93);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

/* ═══ LIGHT MODE — red island nav ═══ */
html.light .mobile-bottom-nav {
  background: #d32f2f;
  box-shadow: 0 12px 40px rgba(175,16,26,0.18);
}
html.light .mnav-btn {
  color: #fff;
}
html.light .mnav-btn .material-symbols-outlined,
html.light .mnav-btn i {
  color: #fff;
}
html.light .mnav-btn.active,
html.light .mnav-btn:active {
  color: #fff2f0;
}
html.light .mnav-btn.active .material-symbols-outlined,
html.light .mnav-btn:active .material-symbols-outlined {
  color: #fff2f0;
}
html.light .mnav-btn:active .mnav-icon-wrap {
  background: rgba(255,242,240,0.15);
}
html.dark .mnav-btn { color: #fff; }
html.dark .mnav-btn i,
html.dark .mnav-btn .material-symbols-outlined { color: #fff; }
html.dark .mnav-btn:active .mnav-icon-wrap { background: rgba(255,255,255,0.1); }

/* ═══ LIGHT MODE — CSS variable overrides ═══
   Surface hierarchy (stitch DESIGN.md §2):
   base=#f9f9f9 · section=#f3f3f4 · card=#ffffff · elevated=#e2e2e2 */
html.light {
  --bg:            #f9f9f9;   /* surface */
  --surface:       #f9f9f9;
  --surface2:      #f3f3f4;   /* surface-container-low */
  --surface-card:  #ffffff;   /* surface-container-lowest */
  --border:        rgba(228,190,186,0.15); /* outline-variant @15% — ghost border rule */
  --border-light:  rgba(228,190,186,0.08);
  --text:          #1a1c1c;   /* on-surface — never pure black */
  --text-mid:      #5b403d;   /* on-surface-variant */
  --text-dim:      #8f6f6c;   /* outline */
  --shadow:        0 12px 40px rgba(26,28,28,0.06); /* ambient shadow rule */
  --sol-red:       #af101a;   /* primary */
  --sol-red-dark:  #930010;
  --laguna-gold:   #c9a825;
  --font-headline: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
html.light body {
  background: #f9f9f9;
  color: #1a1c1c;
  font-family: 'Inter', sans-serif;
}

/* ─── Light: Scrollbar ─── */
html.light ::-webkit-scrollbar-thumb { background: #e2e2e2; }

/* ─── Light: Topbar ───
   Ref: stitch desktop header — bg-white/90 backdrop-blur-xl
   shadow: 0 12px 40px rgba(175,16,26,0.04) */
html.light .topbar {
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: none;
  box-shadow: 0 12px 40px rgba(175,16,26,0.04);
}
html.light .brand-name { color: #af101a; font-family: 'Plus Jakarta Sans', sans-serif; font-style: italic; }
html.light .brand-sub  { color: #5b403d; }
html.light .topbar-intro-brand { color: #af101a; }
html.light .topbar-intro-tag  { color: #1a1c1c; }
html.light .topbar-intro-title { color: #1a1c1c; }
html.light .topbar-intro-sub  { color: #5b403d; }
html.light .sit-big            { color: #af101a; }

html.light .topbar-btn {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
  color: #5b403d;
}
html.light .toast { background: #ffffff; border-color: rgba(175,16,26,0.2); color: #1a1c1c; }
html.light .toast.success { background: #fff2f0; border-color: #af101a; color: #af101a; }
html.light .toast.error   { background: #fff2f0; border-color: #af101a; color: #af101a; }
html.light .topbar-btn:hover {
  background: rgba(0,0,0,0.06);
  color: #1a1c1c;
  border-color: rgba(0,0,0,0.1);
}
/* stitch mobile view — red icon, round, stone hover, press scale */
html.light .topbar-hamburger,
html.light .topbar-theme-mobile {
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: #af101a;
  transition: background 0.15s, transform 0.1s;
}
html.light .topbar-hamburger:hover,
html.light .topbar-theme-mobile:hover {
  background: #f3f3f4;
  border: none;
  color: #af101a;
}
html.light .topbar-hamburger:active,
html.light .topbar-theme-mobile:active {
  transform: scale(0.95);
  background: #e8e8e8;
  border: none;
}
html.light .topbar-btn.active {
  background: rgba(175,16,26,0.08);
  color: #af101a;
  border-color: rgba(175,16,26,0.2);
}
html.light .alert-bell {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
  color: #5b403d;
}
html.light .alert-bell:hover { color: #af101a; border-color: rgba(175,16,26,0.3); }

/* ─── Light: Search input ─── */
html.light .topbar-search {
  background: #ffffff;
  border: 1.5px solid rgba(143,111,108,0.35);
  box-shadow: 0 1px 4px rgba(26,28,28,0.04);
}
html.light .topbar-search:focus-within {
  border-color: #af101a;
  box-shadow: 0 0 0 3px rgba(175,16,26,0.1);
}
html.light .topbar-search i { color: #8f6f6c; }
html.light .topbar-search input { color: #1a1c1c; }
html.light .topbar-search input::placeholder { color: #8f6f6c; }

/* theme toggle icon */
html.light #themeToggleBtn {
  background: rgba(175,16,26,0.06);
  border-color: rgba(175,16,26,0.15);
}
html.light #themeToggleBtn .material-symbols-outlined { color: #af101a; }

/* ─── Light: Alert ticker ─── */
html.light .alert-ticker {
  background: rgba(175,16,26,0.05);
  border-bottom: none;
  box-shadow: inset 0 -1px 0 rgba(175,16,26,0.1);
}
html.light .ticker-label { color: #af101a; background: rgba(175,16,26,0.08); }
html.light .ticker-item  { color: #1a1c1c !important; }
html.light .ticker-item .ticker-warn { color: #af101a; }
html.light .ticker-track { color: #1a1c1c; }

/* ─── Light: Left panel ───
   Ref: stitch desktop aside — bg-slate-50 border-r border-outline-variant/10 */
html.light .side-panel {
  background: #f9f9f9;
  border-right: 1px solid rgba(228,190,186,0.15);
}
html.light .right-panel {
  background: #f9f9f9;
  border-left: 1px solid rgba(228,190,186,0.15);
  border-right: none;
}

/* ─── Light: Panel sections ───
   "No-Line Rule": no 1px borders — use color shifts + ambient shadow */
html.light .panel-section {
  background: #ffffff;
  border: none;
  box-shadow: 0 12px 40px rgba(26,28,28,0.04);
  border-radius: 12px;
}
html.light .panel-section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.67rem;
  color: #64748b;  /* slate-500 */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 1;
}
html.light .panel-section-title .panel-badge { background: rgba(175,16,26,0.08); color: #af101a; }

/* sidebar intro */
html.light .sidebar-intro { border-bottom: none; }
html.light .sidebar-intro-tag { color: #1a1c1c; }
html.light .sidebar-intro-title { color: #1a1c1c; font-family: 'Plus Jakarta Sans', sans-serif; }
html.light .sidebar-intro-sub  { color: #5b403d; }

/* ─── Light: Dropdowns / selects ─── */
html.light select,
html.light .field-label { color: #1a1c1c; }
html.light select {
  background: #ffffff;
  border: 1.5px solid rgba(143,111,108,0.35);
  box-shadow: 0 1px 4px rgba(26,28,28,0.04);
  color: #1a1c1c;
}
html.light select:focus {
  border-color: #af101a;
  box-shadow: 0 0 0 3px rgba(175,16,26,0.1);
}
html.light select option { background: #ffffff; color: #1a1c1c; }

/* ─── Light: Map view toggle ───
   Ref: stitch desktop — bg-surface-container-high wrapper, active=white+primary */
html.light .map-view-btns {
  background: #e8e8e8;
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
}
html.light .map-view-btn {
  background: transparent;
  border: none;
  color: #5b403d;
}
html.light .map-view-btn:hover { background: rgba(255,255,255,0.5); color: #1a1c1c; }
html.light .map-view-btn.active {
  background: #ffffff;
  color: #af101a;
  border: none;
  box-shadow: 0 2px 8px rgba(26,28,28,0.08);
}

/* layer-toggle / section-hazards: no light override — dark mode colors carry over */

/* ─── Light: Legend ─── */
html.light .legend-item { color: #5b403d; }

/* ─── Light: Radius slider / nearby btn ─── */
html.light .field-label  { color: #5b403d; }
html.light input[type="range"] { accent-color: #af101a; }

/* ─── Light: Report button (sidebar) ─── */
html.light .btn-report-sidebar {
  background: linear-gradient(135deg, #af101a, #d32f2f);
  color: #fff;
  box-shadow: 0 8px 24px rgba(175,16,26,0.2);
  border: none;
}

/* ─── Light: Map container ─── */
html.light .map-wrap { background: #eeeeee; } /* surface-container */

/* ─── Light: Risk indicator (floating) ───
   Ref: stitch desktop map overlay — bg-white/80 backdrop-blur-md rounded-2xl */
html.light .risk-indicator {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  box-shadow: 0 12px 40px rgba(26,28,28,0.08);
  color: #1a1c1c;
}
html.light .risk-label { color: #5b403d; }
html.light .risk-value          { color: var(--text-mid); }
html.light .risk-value.LOW      { color: #3fb950; }
html.light .risk-value.MODERATE { color: #fabd00; }
html.light .risk-value.HIGH     { color: #e08338; }
html.light .risk-value.VERY\ HIGH { color: #f85149; }
html.light .risk-value.CRITICAL { color: #f85149; }
html.light .risk-value.risk-type-flood     { color: #60a5fa; }
html.light .risk-value.risk-type-landslide { color: #fbbf24; }
html.light .risk-value.risk-type-volcanic  { color: #f87171; }
html.light .risk-value.risk-type-fault     { color: #c084fc; }
html.light .risk-location { color: #5b403d; }

/* ─── Light: Incidents list — same surface as updatesList ─── */
html.light .incident-card {
  background: var(--surface2);
  border-left-color: var(--red);
}
html.light .incident-card.critical { border-left-color: var(--red); }
html.light .incident-card.high     { border-left-color: var(--orange); }
html.light .incident-card.moderate { border-left-color: var(--amber); }
html.light .inc-title,
html.light .incident-card .inc-type { color: #1a1c1c; }
html.light .incident-card .inc-meta,
html.light .inc-meta { color: #5b403d; }

/* ─── Light: Hazard section — tinted background like hotline-item priority ─── */
html.light .section-hazards .panel-section { background: var(--red-dim); }
html.light .section-hazards .layer-toggle  { background: rgba(248,81,73,0.06); }
html.light .section-hazards .layer-toggle:hover { background: rgba(248,81,73,0.12); }

/* ─── Light: Resource links — red + white like btn-search-services ─── */
html.light .resource-link {
  background: var(--sol-red);
  color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(175,16,26,0.25);
}
html.light .resource-link:hover { background: var(--sol-red-dark); opacity: 1; }
html.light .resource-card strong { color: #1a1c1c; }
html.light .resource-card span   { color: #5b403d; }

/* ─── Light: Weather card text — readable white on red gradient ─── */
html.light .weather-desc { color: rgba(255,255,255,0.8); }
html.light .weather-icon { color: #ffffff; }
html.light .weather-meta span { color: rgba(255,255,255,0.75); }
html.light .weather-loading { color: rgba(255,255,255,0.8); }
html.light .weather-location-label { color: #1a1c1c !important; font-weight: 600; }
/* Weather card location label — same size/font as dark mode, only color overridden */
html.light #weatherCard .panel-section-title,
html.light #weatherCard .location-name {
  color: rgba(255,255,255,0.7);
}

/* risk-badge: no light override — dark mode colors carry over */

/* ─── Light: Right panel — Weather card ───
   Ref: stitch desktop right-aside — gradient from primary to primary-container */
html.light #weatherCard.panel-section {
  background: linear-gradient(135deg, #af101a 0%, #d32f2f 100%);
  border: none;
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(175,16,26,0.2);
  overflow: hidden;
  position: relative;
}
html.light #weatherCard .panel-section-title {
  color: rgba(255,255,255,0.8);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
html.light .weather-widget { color: #ffffff; }
html.light .weather-temp   { color: #ffffff; }
html.light .weather-icon   { color: rgba(255,255,255,0.9); font-size: 2rem; }
html.light .weather-meta span { color: rgba(255,255,255,0.75); }
html.light .weather-loading   { color: rgba(255,255,255,0.75); }

/* ─── Light: Hotlines list ───
   Ref: stitch desktop — bg-white rounded-2xl, icon in bg-slate-100 circle */
html.light .hotlines-list { gap: 8px; }
html.light .hotline-item {
  background: #ffffff;
  border: none;
  border-radius: 16px;
  box-shadow: none;
  padding: 12px 14px;
}
html.light .hotline-item:hover { background: #f8fafc; transform: none; border: none; }
html.light .hotline-item.priority { background: #fff1f2; border: none; }
html.light .hotline-icon {
  width: 36px; height: 36px;
  background: #f1f5f9;  /* slate-100 */
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #64748b;
}
html.light .hotline-item:hover .hotline-icon { background: rgba(175,16,26,0.08); color: #af101a; }
html.light .hotline-item.priority .hotline-icon { background: #fee2e2; color: #b91c1c; }
html.light .hotline-label { color: #1a1c1c; font-weight: 600; }
html.light .hotline-number { color: #5b403d; }

/* ─── Light: Location name / meta ─── */
html.light .location-name { color: #1a1c1c; font-family: 'Plus Jakarta Sans', sans-serif; }
html.light .location-meta { color: #5b403d; }

/* ─── Light: Bottom bar (desktop) ─── */
html.light .bottom-bar {
  background: rgba(255,255,255,0.92);
  border-top: none;
  box-shadow: 0 -12px 40px rgba(26,28,28,0.06);
}
html.light .bottom-tabs  { border-bottom: none; background: #f3f3f4; }
html.light .btab          { color: #5b403d; }
html.light .btab:hover    { color: #af101a; background: rgba(175,16,26,0.05); }
html.light .btab.active   { color: #af101a; border-bottom-color: #af101a; }
html.light .btab-collapse { color: #5b403d; background: #f3f3f4; }
html.light .bottom-content { background: #ffffff; }

/* ─── Light: Mobile sheets ─── */
html.light .mobile-sheet {
  background: #ffffff;
  border-top: none;
  box-shadow: 0 -12px 40px rgba(26,28,28,0.08);
}
html.light .sheet-header {
  background: #ffffff;
  border-bottom: none;
  box-shadow: inset 0 -1px 0 #f3f3f4;
}
html.light .sheet-title { color: #1a1c1c; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
html.light .sheet-close { color: #5b403d; background: #f3f3f4; }
html.light .main-sheet-tabs { border-bottom: none; background: #f9f9f9; }
html.light .main-sheet-tabs .btab { color: #8f6f6c; border-bottom: 2px solid transparent; }
html.light .main-sheet-tabs .btab.active { color: #af101a; border-bottom-color: #af101a; }

/* sheet content */
html.light .alerts-list .alert-item { background: #ffffff; border: none; border-radius: 12px; box-shadow: 0 2px 8px rgba(26,28,28,0.04); }
html.light .alert-item .alert-title { color: #1a1c1c; }
html.light .alert-item .alert-desc  { color: #5b403d; }
html.light .incidents-list .incident-card { background: var(--surface2); border: 1px solid var(--border-light); border-radius: 8px; box-shadow: none; }
html.light .incident-card .inc-title { color: #1a1c1c; }
html.light .incident-card .inc-meta  { color: #5b403d; }

/* ─── Light: Chat window ─── */
html.light .chat-window {
  background: transparent;
  border: none;
  box-shadow: 0 12px 40px rgba(26,28,28,0.1);
}
html.light .chat-header { background: linear-gradient(135deg, #af101a, #d32f2f); border-bottom: none; }
html.light .chat-window .chat-mode-panel { background: #ffffff; }
html.light .chat-messages { background: #f9f9f9; }
html.light .chat-msg.bot .chat-bubble { background: #ffffff; color: #1a1c1c; box-shadow: 0 2px 8px rgba(26,28,28,0.06); }
html.light .chat-msg.user .chat-bubble { background: #af101a; color: #fff; }
html.light .chat-input-area { background: #ffffff; border-top: none; box-shadow: inset 0 1px 0 #f3f3f4; }
html.light .chat-input { background: #ffffff; color: #1a1c1c; border: 1.5px solid rgba(143,111,108,0.35); }
html.light .chat-input:focus { border-color: #af101a; box-shadow: 0 0 0 3px rgba(175,16,26,0.1); }
html.light .chat-input::placeholder { color: #8f6f6c; }
html.light .chat-system-msg { color: #5b403d; background: rgba(175,16,26,0.05); border-radius: 8px; }

/* ─── Light: Modals ─── */
html.light .modal-overlay { background: rgba(26,28,28,0.3); }
html.light .modal-box {
  background: #ffffff;
  border: none;
  box-shadow: 0 24px 60px rgba(26,28,28,0.12);
}
html.light .modal-header {
  background: #f9f9f9;
  border-bottom: none;
  box-shadow: inset 0 -1px 0 #f3f3f4;
}
html.light .modal-title { color: #1a1c1c; font-family: 'Plus Jakarta Sans', sans-serif; }
html.light .modal-close { color: #5b403d; background: #f3f3f4; border: none; }
html.light .form-group label { color: #5b403d; }
html.light .form-input,
html.light .form-select,
html.light .form-textarea {
  background: #f3f3f4;
  color: #1a1c1c;
  border: none;
  border-radius: 10px;
}
html.light .form-input:focus,
html.light .form-select:focus,
html.light .form-textarea:focus { background: #f9f9f9; box-shadow: 0 0 0 2px rgba(175,16,26,0.2); }

/* ─── Light: Mobile weather/status floating cards ─── */
/* status card — red background, white text in light mode only */
html.light .mobile-status-card {
  background: #af101a;
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 24px rgba(175,16,26,0.3);
}
html.light .msc-dot        { background: #22c55e; animation: mscPulseGreen 1.2s infinite; }
html.light .msc-dot.clear  { background: #22c55e; animation: mscPulseGreen 1.2s infinite; }
@keyframes mscPulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
html.light .msc-label      { color: #1a1c1c; }
html.light .msc-title      { color: #fff2f0; }
html.light .msc-sublabel   { color: rgba(255,242,240,0.7); }
html.light .msc-count      { color: #fff2f0; }
html.light .msc-count.clear { color: #a5f3b4; }
html.light .mobile-weather-card {
  background: rgba(255,255,255,0.92);
  border: none;
  color: #1a1c1c;
  box-shadow: 0 12px 40px rgba(26,28,28,0.06);
}
html.light .mwc-temp { color: #1a1c1c; }
html.light .mwc-desc { color: #5b403d; }

/* ─── Light: Mobile panel close btn ─── */
html.light .mobile-panel-close { color: #5b403d; background: #f3f3f4; border: none; }

/* ─── Light: FAB buttons ─── */
html.light .fab-chat-map {
  background: linear-gradient(135deg, #af101a, #d32f2f);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(175,16,26,0.25);
}
html.light .fab-report {
  background: linear-gradient(135deg, #af101a, #d32f2f);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(175,16,26,0.25);
}

/* ─── Light: Panel quick action buttons ─── */
html.light .panel-fab-chat   { background: linear-gradient(135deg, #af101a, #d32f2f); }
html.light .panel-fab-report { background: linear-gradient(135deg, #af101a, #d32f2f); }

/* ─── Light: Leaflet map overlays ─── */
html.light .leaflet-popup-content-wrapper {
  background: #ffffff;
  color: #1a1c1c;
  box-shadow: 0 12px 40px rgba(26,28,28,0.1);
  border: none;
  border-radius: 16px;
}
html.light .leaflet-popup-tip { background: #ffffff; }

/* ─── Theme toggle ─── */
#themeToggleBtn { transition: all var(--transition); }
html.dark #themeToggleBtn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
html.dark #themeToggleBtn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }

.leaflet-bottom { bottom: 7px; }
.leaflet-control-attribution { display: none !important; }

/* ─── Selection Marker Popup ─── */
.sel-popup-wrapper .leaflet-popup-content-wrapper {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 0;
  overflow: hidden;
}
.sel-popup-wrapper .leaflet-popup-tip { background: var(--surface); }
.sel-popup-wrapper .leaflet-popup-content { margin: 0; width: auto !important; }

.sel-popup { padding: 14px 16px; font-family: inherit; min-width: 220px; }
.sp-section-label {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em;
  color: var(--text-dim); text-transform: uppercase; margin-bottom: 4px;
}
.sp-brgy-title {
  font-size: 0.95rem; font-weight: 700; margin-bottom: 2px;
  display: flex; align-items: center; gap: 6px;
}
.sp-muni-sub { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; }
.sp-stats { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.sp-stat {
  display: flex; align-items: center; gap: 8px; font-size: 0.82rem;
}
.sp-stat.sm { font-size: 0.76rem; opacity: 0.85; }
.sp-stat i  { width: 14px; text-align: center; opacity: 0.65; flex-shrink: 0; }
.sp-stat.senior i { color: #fabd00; opacity: 1; }
.sp-stat.pwd    i { color: #3b82f6; opacity: 1; }
.sp-stat em {
  font-style: normal; font-size: 0.72rem;
  color: var(--text-dim); margin-left: 3px;
}
.sp-no-data {
  font-size: 0.75rem; color: var(--text-dim);
  font-style: italic; margin: 6px 0;
}
.sp-divider {
  height: 1px; background: rgba(255,255,255,0.08);
  margin: 10px 0;
}
.sp-source {
  font-size: 0.67rem; color: var(--text-dim);
  margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 6px;
}

/* ─── Barangay Pins ─── */
.brgy-pin {
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; cursor: pointer;
  transform: translate(-2px, -2px);
}
.brgy-pin-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bp-color, #4a90d9);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.brgy-pin-label {
  font-size: 0.66rem; font-weight: 700; color: #fff;
  background: rgba(10,16,24,0.78);
  padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--bp-color, #4a90d9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
}
.brgy-pin:hover .brgy-pin-dot { transform: scale(1.3); }
.brgy-pin:hover .brgy-pin-label { background: var(--bp-color, #4a90d9); }
.brgy-pin.approx .brgy-pin-dot { border-style: dashed; opacity: 0.85; }
.brgy-pin.approx .brgy-pin-label { border-style: dashed; opacity: 0.9; }

/* ─── Live Events detailed feed ─── */
.live-feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); margin-left: auto; flex-shrink: 0; }
.live-feed-dot.active { background: var(--green); box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: sensor-pulse 2.5s infinite; }
.live-feed-dot.loading { background: var(--laguna-gold); animation: sensor-pulse 0.8s infinite; }
.live-feed-refresh { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.72rem; padding: 2px 4px; margin-left: 6px; }
.live-feed-refresh:hover { color: var(--laguna-gold); }

.live-events-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.le-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-mid);
  border-radius: 7px; padding: 6px 8px; cursor: pointer; font-size: 0.74rem; font-weight: 600;
  transition: all 0.15s;
}
.le-tab:hover { color: var(--text); }
.le-tab.active { background: var(--sol-red-dim); border-color: var(--sol-red); color: var(--text); }
.le-badge { font-size: 0.64rem; background: var(--sol-red); color: #fff; border-radius: 10px; padding: 0 5px; min-width: 14px; text-align: center; }
.le-badge:empty { display: none; }

.le-toggle-row { margin-bottom: 8px; }
.le-show-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-dim); cursor: pointer; }
.le-show-toggle input { accent-color: var(--sol-red); width: 14px; height: 14px; }

.live-events-feed { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.le-empty { font-size: 0.78rem; color: var(--text-dim); text-align: center; padding: 16px 8px; }
.le-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; transition: border-color 0.15s, transform 0.1s;
}
.le-item:hover { border-color: var(--sol-red); transform: translateX(2px); }
.le-mag {
  min-width: 38px; height: 30px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.78rem;
}
.le-body { min-width: 0; flex: 1; }
.le-title { font-size: 0.8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-meta { font-size: 0.7rem; color: var(--text-dim); }

/* ─── 3D Terrain launch button ─── */
.btn-3d-terrain {
  width: 100%; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: #fff; border: none; font-weight: 700; font-size: 0.8rem;
  box-shadow: 0 2px 10px rgba(21,101,192,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-3d-terrain:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(21,101,192,0.55); }
.btn-3d-terrain i { font-size: 0.95rem; }

/* ─── 3D Terrain overlay ─── */
.terrain3d-overlay {
  position: fixed; inset: 0; z-index: 5000;
  display: none; background: #0a1520;
}
.terrain3d-overlay.open { display: block; }
#terrain3dMap { position: absolute; inset: 0; }

.terrain3d-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(10,21,32,0.92), rgba(10,21,32,0));
}
.terrain3d-title { color: #fff; font-weight: 800; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.terrain3d-title i { color: #4dabf7; }
.terrain3d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.t3d-btn {
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 0.8rem;
  display: flex; align-items: center; gap: 6px; transition: background 0.15s;
}
.t3d-btn:hover { background: rgba(255,255,255,0.22); }
.t3d-btn.active { background: #1565c0; border-color: #1565c0; }
.t3d-btn.t3d-close { background: rgba(225,0,0,0.85); border-color: transparent; }
.t3d-btn.t3d-close:hover { background: #e10000; }
.t3d-rp { display: flex; background: rgba(255,255,255,0.1); border-radius: 8px; padding: 2px; gap: 2px; }
.t3d-rp-btn {
  background: transparent; color: #cdd9e5; border: none; cursor: pointer;
  font-size: 0.74rem; font-weight: 700; padding: 5px 9px; border-radius: 6px; transition: all 0.15s;
}
.t3d-rp-btn:hover { color: #fff; }
.t3d-rp-btn.active { background: #1565c0; color: #fff; }

.terrain3d-legend {
  position: absolute; bottom: 18px; left: 16px; z-index: 10;
  background: rgba(10,21,32,0.85); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  padding: 12px 14px; color: #e6edf3; min-width: 190px;
}
.t3d-legend-title { font-size: 0.78rem; font-weight: 700; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.t3d-legend-title i { color: #4dabf7; }
.t3d-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; padding: 2px 0; }
.t3d-legend-item span { width: 16px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.t3d-legend-hint { font-size: 0.68rem; opacity: 0.6; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 6px; }

.terrain3d-live {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 12; display: flex; align-items: center; gap: 10px;
  background: rgba(10,21,32,0.9); backdrop-filter: blur(6px);
  border: 1.5px solid #22c55e; border-radius: 22px;
  padding: 8px 16px; color: #e6edf3; font-size: 0.82rem; max-width: 90vw;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.t3d-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.t3d-live-dot.pulsing { animation: t3d-pulse 1.1s infinite; }
@keyframes t3d-pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 9px rgba(255,23,68,0); opacity: 0.7; }
  100% { box-shadow: 0 0 0 0 rgba(255,23,68,0); opacity: 1; }
}

.terrain3d-loading {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #0a1520; color: #4dabf7; font-size: 1rem; font-weight: 600;
}
.terrain3d-loading i { font-size: 2.5rem; }
@media (max-width: 600px) {
  .terrain3d-title span { font-size: 0.82rem; }
  .t3d-btn { padding: 6px 9px; font-size: 0.72rem; }
}

/* Critical facility markers (NOAH-style) */
.facility-pin {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.72rem;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.45);
  cursor: pointer; transition: transform 0.15s;
}
.facility-pin:hover { transform: scale(1.2); }

/* Town-centre marker */
.town-center-pin {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--laguna-gold); color: #1a1a1a;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  cursor: pointer; font-size: 0.85rem;
  transition: transform 0.15s;
}
.town-center-pin:hover { transform: scale(1.18); }

/* ─── Barangay Popup ─── */
.brgy-popup { font-family: inherit; min-width: 180px; }
.brgy-popup-wrap .leaflet-popup-content-wrapper {
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
}
.brgy-popup-wrap .leaflet-popup-tip { background: var(--surface); }
.bp-name {
  font-weight: 700; font-size: 0.9rem; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bp-name i { color: var(--sol-red); margin-right: 4px; }
.bp-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; padding: 3px 0;
}
.bp-row i { width: 14px; text-align: center; opacity: 0.7; }
.bp-row.senior i { color: #fabd00; opacity: 1; }
.bp-row.pwd    i { color: #3b82f6; opacity: 1; }
.bp-row em { color: var(--text-dim); font-style: normal; font-size: 0.75rem; }
.bp-source {
  margin-top: 8px; font-size: 0.68rem;
  color: var(--text-dim); border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 5px;
}

/* Barangay choropleth legend */
.brgy-legend {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; margin-top: 6px; font-size: 0.7rem;
}
.brgy-legend-dot {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}

/* ─── Demographics Card ─── */
.demo-pills {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px;
}
.demo-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: 8px;
  padding: 8px 12px; font-size: 0.82rem;
}
.demo-pill i { opacity: 0.6; width: 14px; text-align: center; }
.demo-pill strong { font-size: 1rem; font-weight: 700; }
.demo-pill span { color: var(--text-dim); font-size: 0.75rem; margin-left: 2px; }
.demo-pill.senior { border-left: 3px solid #fabd00; }
.demo-pill.senior i { color: #fabd00; opacity: 1; }
.demo-pill.pwd    { border-left: 3px solid #3b82f6; }
.demo-pill.pwd    i { color: #3b82f6; opacity: 1; }

.demo-brgy-details { margin-top: 6px; }
.demo-brgy-details summary {
  cursor: pointer; font-size: 0.78rem; color: var(--text-mid);
  padding: 4px 2px; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.demo-brgy-details summary:hover { color: var(--text); }
.demo-brgy-details[open] summary { color: var(--text); margin-bottom: 8px; }
.demo-brgy-table-wrap { overflow-x: auto; }
.demo-brgy-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
}
.demo-brgy-table th {
  text-align: left; padding: 4px 8px; color: var(--text-dim);
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.72rem;
}
.demo-brgy-table td {
  padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.demo-brgy-table tr:last-child td { border-bottom: none; }
.demo-brgy-table tr:hover td { background: rgba(255,255,255,0.03); }

/* ─── Live Events (Earthquakes + EONET) ─── */
.layer-toggle.eq-live    .toggle-dot { background: #fabd00; }
.layer-toggle.eonet-live .toggle-dot { background: #a855f7; }
.layer-toggle.eq-live    input:checked ~ .toggle-dot { background: #fabd00; box-shadow: 0 0 0 3px rgba(250,189,0,0.25); }
.layer-toggle.eonet-live input:checked ~ .toggle-dot { background: #a855f7; box-shadow: 0 0 0 3px rgba(168,85,247,0.25); }

.eonet-marker {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid currentColor;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer; transition: transform 0.15s;
}
.eonet-marker:hover { transform: scale(1.15); }

/* ─── Air Quality row ─── */
.aq-row {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0 2px; flex-wrap: wrap;
}
.aq-label, .aq-uv-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.aq-badge, .aq-uv-badge {
  font-size: 0.75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  cursor: help;
}

/* ─── Live Sensors ─── */
.section-sensors { padding-bottom: 6px; }

/* Pulsing dot in section header */
.sensor-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim); margin-left: 6px; flex-shrink: 0;
  display: inline-block; vertical-align: middle;
}
.sensor-live-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: sensor-pulse 2s infinite;
}
.sensor-live-dot.loading {
  background: var(--laguna-gold);
  animation: sensor-pulse 0.8s infinite;
}
@keyframes sensor-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Sensor layer toggles */
.layer-toggle.sensor-rain .toggle-dot { background: #3b82f6; }
.layer-toggle.sensor-water .toggle-dot { background: #0ea5e9; }
.layer-toggle.sensor-rain  input:checked ~ .toggle-dot { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }
.layer-toggle.sensor-water input:checked ~ .toggle-dot { background: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,0.25); }

.sensor-count { font-size: 0.7rem; opacity: 0.6; margin-left: 2px; }

.sensor-status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0 2px; min-height: 22px;
}
.sensor-refresh-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.75rem; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s;
  flex-shrink: 0;
}
.sensor-refresh-btn:hover { color: var(--laguna-gold); }

/* Map markers */
.sensor-marker {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px;
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  cursor: pointer; transition: transform 0.15s;
}
.sensor-marker:hover { transform: scale(1.15); z-index: 1000; }

/* Legend dots for sensors */
.legend-dot.sensor-normal-dot   { background: #22c55e; }
.legend-dot.sensor-advisory-dot { background: #fabd00; }
.legend-dot.sensor-warning-dot  { background: #ef4444; }
