.emergency-modal {
  position: fixed; inset: 0;
  background: rgba(11,29,81,.85);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: emFadeIn .25s ease;
}
.emergency-modal[hidden] { display: none; }
@keyframes emFadeIn { from { opacity: 0; } to { opacity: 1; } }
.em-alert-card {
  background: #fff;
  border-radius: 18px;
  max-width: 520px; width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  border-top: 6px solid var(--red);
  animation: emPop .35s cubic-bezier(.16,.84,.44,1);
}
@keyframes emPop { from { transform: scale(.92) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.em-alert-icon { font-size: 56px; margin-bottom: 10px; animation: pulse 1.4s infinite; }
.em-alert-tag {
  display: inline-block;
  background: var(--red); color: #fff;
  padding: 4px 14px; border-radius: 4px;
  font-size: 12px; font-weight: 800; letter-spacing: 2px;
  margin-bottom: 12px;
}
.em-alert-card h2 { font-size: 24px; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--ink); margin-bottom: 10px; }
.em-alert-card p { color: var(--ink-soft); line-height: 1.5; margin-bottom: 14px; }
.em-alert-meta { background: var(--paper-2); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--ink); margin-bottom: 18px; text-align: left; }
.em-alert-meta div { padding: 2px 0; }
.em-alert-meta b { color: var(--ink); }
.em-alert-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.em-alert-foot { font-size: 11px; color: var(--ink-soft); margin: 0; }

.emergency-banner {
  position: fixed;
  top: var(--topbar-h);
  left: var(--sidebar-w);
  right: 0;
  background: linear-gradient(90deg, var(--red), #b91c1c);
  color: #fff;
  padding: 8px 16px;
  display: flex; gap: 14px; align-items: center;
  font-size: 13px; font-weight: 600;
  z-index: 1090;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.emergency-banner .em-tag {
  background: #fff; color: var(--red);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 800;
  letter-spacing: 1px;
}
.emergency-banner .em-msg { flex: 1; }
.emergency-banner button { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; }

.em-panel {
  position: fixed; left: 12px; top: calc(var(--topbar-h) + 12px); width: 360px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-2); z-index: 1080;
  max-height: calc(100vh - var(--topbar-h) - 24px); overflow: auto;
  animation: emPanelSlide .22s ease;
}
@keyframes emPanelSlide { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.em-panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, var(--red), #991b1b);
  color: #fff;
}
.em-panel-head h3 { color: #fff; font-size: 15px; }
.em-tabs { display: flex; border-bottom: 1px solid var(--line); }
.em-tab { flex: 1; padding: 10px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); border: none; background: transparent; border-bottom: 2px solid transparent; }
.em-tab.active { color: var(--red); border-bottom-color: var(--red); }
.em-tab-body { padding: 14px; }
.em-card {
  padding: 12px; border-radius: 10px; background: var(--paper-2);
  border-left: 3px solid var(--red);
  margin-bottom: 10px; font-size: 12px;
}
.em-card .em-card-head { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.em-card .em-card-meta { color: var(--ink-soft); font-size: 11px; }
.em-card.sev-low { border-left-color: var(--amber); }
.em-card.sev-medium { border-left-color: #f97316; }
.em-card.sev-high { border-left-color: var(--coral); }
.em-card.sev-critical { border-left-color: var(--red); background: #fef2f2; }

.parish-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.parish-card {
  background: var(--paper-2); border-radius: 8px; padding: 8px;
  border-left: 3px solid var(--green);
  font-size: 11px;
}
.parish-card .pc-name { font-weight: 700; font-size: 12px; color: var(--ink); }
.parish-card .pc-status { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; }
.parish-card.dmg-minor { border-left-color: var(--amber); }
.parish-card.dmg-moderate { border-left-color: #f97316; }
.parish-card.dmg-major { border-left-color: var(--coral); }
.parish-card.dmg-severe { border-left-color: var(--red); background: #fef2f2; }

.hurricane-card {
  background: linear-gradient(135deg, #1e3a8a, #312e81);
  color: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.hurricane-card .hc-name { font-size: 18px; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; }
.hurricane-card .hc-cat { background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; display: inline-block; margin-top: 4px; }
.hurricane-card .hc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; font-size: 11px; }
.hurricane-card .hc-stat b { display: block; font-size: 14px; }
.hurricane-card .hc-stat span { opacity: .7; }

.shelter-pin {
  background: var(--green); color: #fff;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
}
.shelter-pin span { transform: rotate(45deg); font-size: 14px; }

.report-pin {
  width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.report-pin.t-incident { background: var(--coral); }
.report-pin.t-closure { background: var(--red); }
.report-pin.t-flood { background: #0ea5e9; }
.report-pin.t-gully { background: #06b6d4; }
.report-pin.t-landslide { background: #92400e; }
.report-pin.t-downed_tree { background: var(--amber); }
.report-pin.t-damage { background: #7c2d12; }
.report-pin.t-other { background: var(--ink-soft); }

.cam-pin {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Wind arrow markers */
.wind-arrow {
  position: relative;
  width: 44px; height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  transform-origin: 50% 28px;
  pointer-events: auto;
}
.wind-arrow svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.wind-arrow .wind-speed {
  background: rgba(255,255,255,.92);
  color: #1f2937;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  margin-top: 2px;
  border: 1px solid rgba(0,0,0,.1);
  transform: rotate(0deg);
}

/* Parish weather pin */
.parish-wx {
  background: rgba(255,255,255,.95);
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 50px; height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  cursor: pointer;
}
.parish-wx .pwx-emoji { font-size: 18px; line-height: 1; }
.parish-wx .pwx-temp { font-size: 11px; font-weight: 800; color: var(--ink); }

/* Hurricane spinning eye */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Wind speed side panel — slides in from left when Wind layer is active */
.wind-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 12px;
  width: 280px;
  max-height: calc(100vh - var(--topbar-h) - 180px);
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  z-index: 700;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: windSlide .25s ease;
}
.wind-panel[hidden] { display: none !important; }
@keyframes windSlide { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.wind-panel-head {
  background: linear-gradient(135deg, #0d9488, #134e4a);
  color: #fff;
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.wind-panel-head .icon-btn { color: #fff; font-size: 22px; }
.wind-panel-head .icon-btn:hover { background: rgba(255,255,255,.2); }

.wind-scale {
  padding: 10px 14px 4px;
  border-bottom: 1px solid var(--line);
}
.ws-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}
.ws-swatch {
  width: 22px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.08);
}
.ws-label { flex: 1; color: var(--ink); font-weight: 600; }
.ws-range { color: var(--ink-soft); font-size: 11px; }

.wind-parishes-head {
  padding: 12px 14px 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.wind-parishes {
  list-style: none; margin: 0; padding: 0 0 8px;
  overflow-y: auto;
  flex: 1;
}
.wind-parishes li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  border-bottom: 1px solid #f5f7fb;
  cursor: pointer;
}
.wind-parishes li:hover { background: #f5f7fb; }
.wind-parishes li:last-child { border-bottom: 0; }
.wp-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,.05);
}
.wp-arrow {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.wp-name { flex: 1; color: var(--ink); font-weight: 500; }
.wp-speed { font-weight: 700; color: var(--ink); }
.wp-speed .unit { font-weight: 400; color: var(--ink-soft); font-size: 11px; margin-left: 2px; }

.wind-foot {
  padding: 8px 14px;
  font-size: 10px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

/* Avoid colliding with the emergency dashboard when both could appear */
body.em-open .wind-panel { top: calc(var(--topbar-h) + 12px + 60vh); max-height: 30vh; }

@media (max-width: 720px) {
  .wind-panel { width: calc(100% - 24px); }
}

/* Radar layer crossfade — makes adjacent frames blend like real flowing rain */
.leaflet-layer.radar-frame {
  transition: opacity 450ms ease;
  pointer-events: none;
}
.leaflet-layer.radar-frame .leaflet-tile {
  transition: none;  /* container handles fade, not individual tiles */
}

/* Radar controls overlay */
.radar-controls {
  display: flex; gap: 6px; align-items: center;
  background: rgba(255,255,255,.96);
  font-size: 12px;
}
.radar-controls .rc-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.radar-controls .rc-btn:hover { background: var(--paper-2); }
.radar-controls #radarTime { font-weight: 700; color: var(--ink); min-width: 50px; text-align: center; }
.radar-controls #radarSlider { accent-color: var(--coral); }

.flood-zone { opacity: .35; }

/* Severity-coded marker cluster */
.marker-cluster-sm { background: rgba(22,163,74,.6); }
.marker-cluster-md { background: rgba(245,158,11,.6); }
.marker-cluster-lg { background: rgba(220,38,38,.6); color: #fff; }

@media (max-width: 900px) {
  .em-panel { right: 8px; left: 8px; width: auto; top: calc(var(--topbar-h) + 8px); }
  .emergency-banner { left: 0; }
}
