/* Colorado Monitor — map + Liquid Glass styles (restored).
   Cool blue-gray frosted glass: translucent panels with backdrop blur,
   a bright inner rim and soft layered shadows. Page chrome lives in site.css. */
:root{
  /* Cool blue-gray "Liquid Glass" palette */
  --ink:#0f2231;              /* deep slate-blue text */
  --slate:#375064;            /* secondary text */
  --slate-soft:#6b8299;       /* muted captions */
  --paper:#eaf1f7;            /* airy cool background (fallback when no map behind) */
  --panel:#ffffff;
  --line:#d3e0ec;             /* soft cool hairline */
  --accent:#2b7fb8;           /* clear sky-blue, active states & links */
  --accent-deep:#1c5f8f;
  /* Glass surface tokens */
  --glass-bg:rgba(255,255,255,0.55);
  --glass-bg-strong:rgba(255,255,255,0.72);
  --glass-border:rgba(255,255,255,0.65);
  --glass-shadow:0 8px 30px rgba(15,34,49,0.16);
  --glass-rim:inset 0 1px 0 rgba(255,255,255,0.9);
  /* Hazard accents — kept distinct for safety recognition */
  --fire:#c1440e;
  --flood:#1f6f8b;
  --weather:#7a4fa3;
  --closure:#ff1e1e;
  --focus:#2b7fb8;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  background:#dce9f2;
}

.ui{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;}
a{color:var(--accent);}
a:focus-visible, button:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}

/* ===================== DISCLAIMER MODAL ===================== */
.disclaimer-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(15,34,49,0.4);
  backdrop-filter:blur(8px) saturate(140%);
  -webkit-backdrop-filter:blur(8px) saturate(140%);
  animation:disclaimerFade 0.3s ease;
}
.disclaimer-overlay.hidden{display:none;}
@keyframes disclaimerFade{from{opacity:0;}to{opacity:1;}}

.disclaimer-box{
  position:relative;
  max-width:440px;
  width:100%;
  text-align:center;
  padding:30px 28px 26px;
  border-radius:28px;
  background:linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.78) 100%);
  backdrop-filter:blur(30px) saturate(190%);
  -webkit-backdrop-filter:blur(30px) saturate(190%);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.95),
    0 20px 60px rgba(15,34,49,0.35);
  animation:disclaimerPop 0.32s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes disclaimerPop{from{transform:scale(0.9);opacity:0;}to{transform:scale(1);opacity:1;}}

.disclaimer-mark{
  border-radius:13px;
  box-shadow:0 4px 14px rgba(28,95,143,0.3);
  margin-bottom:14px;
}
.disclaimer-box h2{
  margin:0 0 14px;
  font-size:1.3rem;
  font-weight:700;
  letter-spacing:-0.02em;
  color:var(--ink);
}
.disclaimer-box p{
  margin:0 0 12px;
  font-size:0.9rem;
  line-height:1.55;
  color:var(--slate);
}
.disclaimer-emphasis{
  font-weight:700;
  color:var(--fire) !important;
  font-size:0.95rem !important;
  margin-top:16px !important;
}
.disclaimer-btn{
  margin-top:18px;
  width:100%;
  padding:13px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.95rem;
  font-weight:700;
  color:#fff;
  border:1px solid rgba(255,255,255,0.5);
  border-radius:999px;
  background:linear-gradient(180deg, #3d92c9, var(--accent-deep));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 14px rgba(28,95,143,0.4);
  cursor:pointer;
  transition:transform 0.12s ease, box-shadow 0.2s ease;
}
.disclaimer-btn:hover{box-shadow:inset 0 1px 0 rgba(255,255,255,0.4), 0 6px 20px rgba(28,95,143,0.5);}
.disclaimer-btn:active{transform:scale(0.97);}
.disclaimer-btn:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}

@media (max-width:640px){
  .disclaimer-box{padding:26px 22px 22px;border-radius:24px;}
  .disclaimer-box h2{font-size:1.15rem;}
}

header{
  padding:16px 20px 0;
  background:var(--glass-bg-strong);
  backdrop-filter:blur(20px) saturate(160%);
  -webkit-backdrop-filter:blur(20px) saturate(160%);
  border-bottom:1px solid var(--glass-border);
  box-shadow:var(--glass-rim), 0 1px 12px rgba(15,34,49,0.06);
  position:relative;
  z-index:500;
  text-align:center;
}
header h1{
  margin:0 0 3px;
  font-size:1.5rem;
  font-weight:700;
  letter-spacing:-0.02em;
}
.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:11px;
  margin-bottom:3px;
}
.brand h1{margin:0;}
.brand-mark{
  flex-shrink:0;
  border-radius:11px;
  box-shadow:0 2px 8px rgba(28,95,143,0.28);
}
header p.sub{margin:0 0 12px;font-size:0.85rem;color:var(--slate-soft);}

/* ---- Map layout ---- */
.map-wrap{
  position:relative;
  height: calc(100vh - 122px);
  min-height:480px;
}
@media (max-width: 860px){
  .map-wrap{height:80vh;}
}

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

/* ---- Floating legend: full Liquid Glass treatment ---- */
.map-legend{
  position:absolute;
  top:16px;
  left:16px;
  z-index:1000;
  width:300px;
  max-width:calc(100vw - 32px);
  max-height:calc(100% - 32px);
  border-radius:28px;
  /* Layered translucency: a soft vertical sheen over the frosted base */
  background:linear-gradient(180deg, rgba(255,255,255,0.58) 0%, rgba(255,255,255,0.34) 40%, rgba(255,255,255,0.44) 100%);
  backdrop-filter:blur(30px) saturate(190%);
  -webkit-backdrop-filter:blur(30px) saturate(190%);
  border:1px solid rgba(255,255,255,0.7);
  /* Depth: crisp inner rim + tight contact shadow + wide ambient shadow */
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.95),
    inset 0 -1px 1px rgba(255,255,255,0.35),
    0 2px 6px rgba(15,34,49,0.08),
    0 16px 40px rgba(15,34,49,0.18);
  overflow:hidden;              /* keeps the specular sheen inside the rounded corners */
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  isolation:isolate;
  display:flex;
  flex-direction:column;
}
/* Specular highlight — the soft light streak across the top, like real glass */
.map-legend::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height:45%;
  background:linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0) 100%);
  pointer-events:none;
  z-index:0;
}

.map-legend-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:15px 18px 13px;
  cursor:pointer;
  font-weight:600;
  font-size:0.92rem;
  letter-spacing:-0.01em;
  color:var(--ink);
  position:relative;
  z-index:2;
  border-bottom:1px solid rgba(255,255,255,0.45);
  flex-shrink:0;
}
.map-legend-header .chevron{
  transition:transform 0.25s cubic-bezier(0.4,0,0.2,1);
  font-size:0.7rem;
  color:var(--slate-soft);
  /* little glass capsule around the chevron */
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(255,255,255,0.75);
  border-radius:999px;
  width:24px;height:24px;
  display:flex;align-items:center;justify-content:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9);
}
.map-legend.collapsed .map-legend-header{border-bottom:none;}
.map-legend.collapsed .map-legend-header .chevron{transform:rotate(-90deg);}
.map-legend.collapsed .map-legend-body{display:none;}
.map-legend-body{
  padding:10px 14px 16px;
  position:relative;
  z-index:1;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.map-legend-body::-webkit-scrollbar{width:6px;}
.map-legend-body::-webkit-scrollbar-thumb{background:rgba(15,34,49,0.18);border-radius:99px;}
.map-legend-body::-webkit-scrollbar-track{background:transparent;}

/* ---- Collapsible sub-groups (Layers / Alerts) ---- */
.legend-group{
  margin-bottom:8px;
  border-radius:16px;
  background:rgba(255,255,255,0.4);
  border:1px solid rgba(255,255,255,0.6);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.8);
  overflow:hidden;
}
.legend-group-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 14px;
  cursor:pointer;
  font-weight:700;
  font-size:0.82rem;
  letter-spacing:0.01em;
  color:var(--ink);
  user-select:none;
  transition:background 0.15s ease;
}
.legend-group-header:hover{background:rgba(255,255,255,0.35);}
.legend-group-header .chevron-sm{
  font-size:0.7rem;
  color:var(--slate-soft);
  transition:transform 0.2s ease;
}
.legend-group.collapsed .chevron-sm{transform:rotate(-90deg);}
.legend-group.collapsed .legend-group-body{display:none;}
.legend-group-body{padding:4px 10px 10px;}

/* ---- Layer toggles: glass capsules ---- */
.layer-toggle{
  display:flex;
  align-items:center;
  gap:11px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.86rem;
  font-weight:500;
  padding:10px 12px;
  margin-bottom:3px;
  border-radius:999px;              /* full pill */
  cursor:pointer;
  color:var(--ink);
  border:1px solid transparent;
  transition:background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}
.layer-toggle:hover{
  background:rgba(255,255,255,0.6);
  border-color:rgba(255,255,255,0.8);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 8px rgba(15,34,49,0.08);
}
.layer-toggle:active{transform:scale(0.985);}
/* Row reads as "on" when its checkbox is checked */
.layer-toggle:has(input:checked){
  background:rgba(255,255,255,0.66);
  border-color:rgba(255,255,255,0.85);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.95), 0 2px 10px rgba(15,34,49,0.07);
}

/* ---- Custom glass checkbox (replaces the default browser box) ---- */
.layer-toggle input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  margin:0;
  flex-shrink:0;
  width:22px;height:22px;
  border-radius:50%;              /* fully round */
  background:rgba(255,255,255,0.55);
  border:1.5px solid rgba(15,34,49,0.22);
  box-shadow:inset 0 1px 2px rgba(255,255,255,0.9), inset 0 -1px 2px rgba(15,34,49,0.05);
  cursor:pointer;
  position:relative;
  transition:background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.layer-toggle input[type="checkbox"]:checked{
  background:
    /* crisp SVG checkmark — scales cleanly at any resolution */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 8' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat,
    linear-gradient(180deg, #3d92c9, var(--accent-deep));
  border-color:rgba(255,255,255,0.5);
  box-shadow:inset 0 1px 1px rgba(255,255,255,0.55), 0 2px 8px rgba(28,95,143,0.4);
}
.layer-toggle input[type="checkbox"]:focus-visible{
  outline:2px solid var(--focus);
  outline-offset:2px;
}

/* Color swatch: a small glass bead */
.swatch{
  width:13px;height:13px;
  border-radius:5px;
  flex-shrink:0;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.6),
    0 0 0 1px rgba(255,255,255,0.75),
    0 1px 3px rgba(15,34,49,0.2);
}
.swatch.fire{background:var(--fire);}
.swatch.flood{background:var(--flood);}
.swatch.weather{background:var(--weather);}
.swatch.closure{background:var(--closure);}

h2.section{
  font-size:0.68rem;
  text-transform:uppercase;
  letter-spacing:0.1em;
  color:var(--slate-soft);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  margin:20px 0 6px;
  padding-left:12px;
  font-weight:700;
}
.feed-item{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.82rem;
  padding:10px 12px;
  margin-bottom:5px;
  border-radius:14px;
  background:rgba(255,255,255,0.45);
  border:1px solid rgba(255,255,255,0.6);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.8);
  line-height:1.4;
}
.feed-item .tag{
  display:inline-block;
  font-size:0.62rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.05em;
  padding:2px 9px;
  border-radius:999px;
  color:#fff;
  margin-bottom:5px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.3);
}
.tag.fire{background:var(--fire);}
.tag.flood{background:var(--flood);}
.tag.weather{background:var(--weather);}
.tag.closure{background:var(--closure);}
.feed-item .title{font-weight:600;}
.feed-item .meta{color:var(--slate-soft);font-size:0.75rem;margin-top:2px;}
.empty, .loading{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.8rem;
  color:var(--slate-soft);
  padding:8px;
  font-style:italic;
}

.config-note{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.75rem;
  background:rgba(43,127,184,0.09);
  border:1px solid rgba(255,255,255,0.55);
  border-radius:18px;
  padding:12px 14px;
  margin-top:14px;
  line-height:1.45;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.7);
}
.config-note code{font-size:0.72rem;background:rgba(43,127,184,0.14);padding:2px 6px;border-radius:6px;}

.updated{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.78rem;
  color:var(--slate);
  padding:9px 18px;
  background:var(--glass-bg-strong);
  backdrop-filter:blur(20px) saturate(160%);
  -webkit-backdrop-filter:blur(20px) saturate(160%);
  border-bottom:1px solid var(--glass-border);
  position:relative;
  z-index:400;
}
.updated button{
  font-family:inherit;
  font-size:0.78rem;
  font-weight:600;
  background:rgba(255,255,255,0.6);
  border:1px solid var(--glass-border);
  border-radius:999px;
  padding:3px 12px;
  margin-left:8px;
  cursor:pointer;
  color:var(--accent-deep);
  box-shadow:var(--glass-rim);
  transition:background 0.15s ease, transform 0.1s ease;
}
.updated button:hover{background:#fff;}
.updated button:active{transform:scale(0.96);}

/* Radar tiles live in their own pane so we can tune them WITHOUT the base-map
   dimming below also washing out the radar itself.
   Note on pixelation: NEXRAD data is inherently coarse (~1km resolution), and
   hard contrast boosts amplify its compression artifacts. So we keep saturation
   up (colors stay vivid) but ease off contrast, and apply a gentle blur that
   smooths the blocky tile edges without erasing storm structure. */
.leaflet-radar-pane{
  filter:saturate(1.6) contrast(1.05) blur(1.5px);
}
/* Zoomed in past the radar's native resolution, blocks get bigger — blur a bit
   more so it reads as soft precipitation rather than a grid of squares. */
.radar-zoomed .leaflet-radar-pane{
  filter:saturate(1.6) contrast(1.05) blur(3px);
}
/* Let the browser interpolate tiles smoothly instead of nearest-neighbor blocks. */
.leaflet-radar-pane img{
  image-rendering:auto;
  image-rendering:-webkit-optimize-contrast;
}

/* When radar is on, desaturate the busy topo base map so storm cells dominate.
   This targets only the base tile pane — the radar sits in its own pane above. */
.radar-active .leaflet-tile-pane{
  filter:saturate(0.45) brightness(1.08);
  transition:filter 0.3s ease;
}
.leaflet-tile-pane{transition:filter 0.3s ease;}

/* Fire emoji markers (shown when zoomed out, or when a fire has no mapped perimeter) */
.fire-emoji-marker{
  background:none !important;
  border:none !important;
}
.fire-emoji{
  font-size:22px;
  line-height:32px;
  text-align:center;
  width:32px;
  height:32px;
  cursor:pointer;
  /* Soft warm glow so the flame reads clearly over busy terrain */
  filter:drop-shadow(0 0 6px rgba(193,68,14,0.85)) drop-shadow(0 1px 2px rgba(0,0,0,0.35));
  transition:transform 0.15s ease;
}
.fire-emoji:hover{
  transform:scale(1.25);
}

/* External-source row in the legend (looks like a layer, opens elsewhere) */
.layer-link{
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px 12px;
  margin-top:2px;
  border-radius:999px;
  text-decoration:none;
  color:var(--ink);
  border:1px solid transparent;
  transition:background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}
.layer-link:hover{
  background:rgba(255,255,255,0.6);
  border-color:rgba(255,255,255,0.8);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 8px rgba(15,34,49,0.08);
}
.layer-link:active{transform:scale(0.985);}
.layer-link-icon{
  font-size:15px;
  width:20px;
  text-align:center;
  flex-shrink:0;
}
.layer-link-text{display:flex;flex-direction:column;line-height:1.25;}
.layer-link-title{
  font-size:0.86rem;
  font-weight:500;
}
.layer-link-sub{
  font-size:0.68rem;
  color:var(--slate-soft);
}

/* Base map picker in the legend */
.basemap-picker{
  padding:10px 12px 6px;
}
.basemap-picker label{
  display:block;
  font-size:0.68rem;
  text-transform:uppercase;
  letter-spacing:0.09em;
  color:var(--slate-soft);
  font-weight:700;
  margin-bottom:6px;
}
.basemap-picker select{
  width:100%;
  appearance:none;
  -webkit-appearance:none;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.85rem;
  font-weight:500;
  color:var(--ink);
  padding:9px 32px 9px 13px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.85);
  background:rgba(255,255,255,0.62);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9), 0 1px 4px rgba(15,34,49,0.06);
  cursor:pointer;
  /* custom chevron */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b8299' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
}
.basemap-picker select:hover{background-color:rgba(255,255,255,0.8);}
.basemap-picker select:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}

/* Permanent fire label (name + acreage), shown on the map when zoomed in */
.fire-label-marker{
  background:none !important;
  border:none !important;
  width:auto !important;
  height:auto !important;
}
.fire-label{
  display:inline-flex;
  flex-direction:column;
  align-items:flex-start;
  white-space:nowrap;
  padding:5px 11px;
  border-radius:14px;
  background:rgba(255,255,255,0.9);
  backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),
    0 2px 10px rgba(15,34,49,0.25);
  transform:translate(-50%, -50%);
  cursor:pointer;
  transition:transform 0.15s ease;
}
.fire-label:hover{
  transform:translate(-50%, -50%) scale(1.05);
}
.fire-label-name{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.78rem;
  font-weight:700;
  color:#8c2f08;
  letter-spacing:-0.01em;
}
.fire-label-sub{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.68rem;
  font-weight:500;
  color:var(--slate);
  margin-top:1px;
}

.leaflet-popup-content-wrapper{
  background:var(--glass-bg-strong);
  backdrop-filter:blur(20px) saturate(180%);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  border:1px solid var(--glass-border);
  border-radius:14px;
  box-shadow:var(--glass-rim), var(--glass-shadow);
}
.leaflet-popup-tip{
  background:var(--glass-bg-strong);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
}
.leaflet-popup-content{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;font-size:0.82rem;}
.leaflet-popup-content b{display:block;margin-bottom:3px;}

/* ---- Resource pages (Evacuation Zones, Official Resources, Get Involved, Guides, Sources) ---- */
main.resources{max-width:920px;margin:0 auto;padding:34px 20px 70px;position:relative;z-index:1;}

.emergency-banner{
  position:relative;
  background:linear-gradient(140deg, rgba(15,34,49,0.94) 0%, rgba(28,95,143,0.9) 55%, rgba(43,127,184,0.85) 100%);
  color:#fff;
  border-radius:28px;
  padding:26px 28px;
  margin-bottom:38px;
  overflow:hidden;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  border:1px solid rgba(255,255,255,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 4px 12px rgba(15,34,49,0.16),
    0 20px 46px rgba(15,34,49,0.26);
}
/* Specular sweep across the banner, like light catching glass */
.emergency-banner::before{
  content:"";
  position:absolute;
  top:0;left:0;right:0;height:55%;
  background:linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 100%);
  pointer-events:none;
}
.emergency-banner .big{font-size:1.45rem;font-weight:700;letter-spacing:-0.015em;position:relative;}
.emergency-banner .row{display:flex;flex-wrap:wrap;gap:14px;margin-top:16px;font-size:0.88rem;position:relative;}
/* Each emergency number becomes its own little glass capsule */
.emergency-banner .row div{
  background:rgba(255,255,255,0.13);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:16px;
  padding:10px 14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.25);
  flex:1 1 150px;
}
.emergency-banner .row div b{display:block;font-size:1.3rem;letter-spacing:-0.01em;}
.emergency-banner .row div span{color:#c9dcea;font-size:0.75rem;line-height:1.35;display:block;margin-top:2px;}

.resources section{margin-bottom:42px;}
.resources h2{
  font-size:1.25rem;
  font-weight:700;
  letter-spacing:-0.015em;
  padding-bottom:10px;
  margin-bottom:18px;
  border-bottom:1px solid rgba(255,255,255,0.7);
  box-shadow:0 1px 0 rgba(15,34,49,0.06);
}
.resources h2 .eyebrow{
  display:inline-block;
  vertical-align:middle;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.63rem;
  text-transform:uppercase;
  letter-spacing:0.1em;
  color:var(--accent-deep);
  font-weight:700;
  margin-bottom:6px;
  margin-right:14px;
  padding:3px 10px;
  border-radius:999px;
  background:rgba(255,255,255,0.65);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9);
}

.card-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:16px;
}
.card{
  position:relative;
  background:linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.52) 100%);
  backdrop-filter:blur(24px) saturate(180%);
  -webkit-backdrop-filter:blur(24px) saturate(180%);
  border:1px solid rgba(255,255,255,0.8);
  border-radius:24px;
  padding:18px 20px;
  overflow:hidden;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.95),
    0 2px 6px rgba(15,34,49,0.06),
    0 12px 32px rgba(15,34,49,0.12);
  transition:transform 0.18s ease, box-shadow 0.18s ease;
}
/* Specular highlight on each card */
.card::before{
  content:"";
  position:absolute;
  top:0;left:0;right:0;height:50%;
  background:linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0) 100%);
  pointer-events:none;
}
.card > *{position:relative;}
.card:hover{
  transform:translateY(-3px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.95),
    0 4px 10px rgba(15,34,49,0.08),
    0 20px 44px rgba(15,34,49,0.18);
}
.card .label{font-size:0.65rem;text-transform:uppercase;letter-spacing:0.08em;color:var(--slate-soft);font-weight:700;margin-bottom:6px;}
.card .name{font-weight:700;font-size:0.97rem;margin-bottom:4px;letter-spacing:-0.01em;}
.card .detail{font-size:0.84rem;color:var(--slate);line-height:1.5;}
.card .phone{
  display:inline-block;
  font-size:1.1rem;
  font-weight:700;
  color:var(--accent-deep);
  margin:6px 0;
  padding:3px 12px;
  border-radius:999px;
  background:rgba(43,127,184,0.1);
  border:1px solid rgba(255,255,255,0.7);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.85);
}

/* Hazard-colored left edge, now a soft glowing rail rather than a hard bar */
.accent-fire, .accent-flood, .accent-weather, .accent-closure{
  border-left-width:5px;
  border-left-style:solid;
}
.accent-fire{border-left-color:var(--fire);}
.accent-flood{border-left-color:var(--flood);}
.accent-weather{border-left-color:var(--weather);}
.accent-closure{border-left-color:var(--closure);}

table.simple{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.86rem;
  background:linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.5));
  backdrop-filter:blur(24px) saturate(180%);
  -webkit-backdrop-filter:blur(24px) saturate(180%);
  border:1px solid rgba(255,255,255,0.8);
  border-radius:22px;
  overflow:hidden;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.95),
    0 12px 32px rgba(15,34,49,0.12);
}
table.simple th{
  text-align:left;
  background:linear-gradient(180deg, rgba(43,127,184,0.95), rgba(28,95,143,0.95));
  color:#fff;
  padding:12px 15px;
  font-size:0.68rem;
  text-transform:uppercase;
  letter-spacing:0.07em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.25);
}
table.simple td{padding:12px 15px;border-top:1px solid rgba(255,255,255,0.65);}
table.simple tr:nth-child(even) td{background:rgba(255,255,255,0.35);}

.note{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.82rem;
  background:linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
  backdrop-filter:blur(20px) saturate(160%);
  -webkit-backdrop-filter:blur(20px) saturate(160%);
  border:1px solid rgba(255,255,255,0.8);
  border-left:5px solid var(--accent);
  border-radius:20px;
  padding:14px 18px;
  line-height:1.55;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.9),
    0 6px 20px rgba(15,34,49,0.09);
}

footer{
  position:relative;
  z-index:1;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.72rem;
  color:var(--slate-soft);
  padding:16px 20px 30px;
  border-top:1px solid rgba(255,255,255,0.7);
  max-width:920px;
  margin:0 auto;
}
footer.map-footer{
  max-width:none;
  padding:10px 20px;
  background:var(--glass-bg-strong);
  backdrop-filter:blur(20px) saturate(160%);
  -webkit-backdrop-filter:blur(20px) saturate(160%);
  border-top:1px solid var(--glass-border);
}
/* ============================================================
   MOBILE (phones, ≤ 640px): reshape the map UI for small screens.
   The floating legend becomes a bottom sheet — collapsed to a handle
   by default so the map is fully visible, sliding up when tapped.
   ============================================================ */
@media (max-width: 640px){
  header{padding:12px 14px 0;}
  header h1{font-size:1.25rem;}
  .brand-mark{width:38px;height:38px;}
  .brand{gap:9px;}
  header p.sub{font-size:0.78rem;margin-bottom:10px;}

  .updated{padding:8px 14px;font-size:0.74rem;}

  /* Map fills the screen below the header/updated bar */
  .map-wrap{height:calc(100vh - 150px);min-height:360px;}

  /* Legend as a bottom sheet */
  .map-legend{
    top:auto;
    bottom:0;
    left:0;
    right:0;
    width:100%;
    max-width:100%;
    max-height:72%;
    border-radius:22px 22px 0 0;
    /* a touch more opaque on mobile so text stays readable over any map */
    background:linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.7) 100%);
    box-shadow:0 -6px 30px rgba(15,34,49,0.22), inset 0 1px 1px rgba(255,255,255,0.95);
  }
  /* Grab-handle bar at the top of the sheet */
  .map-legend::after{
    content:"";
    position:absolute;
    top:8px;
    left:50%;
    transform:translateX(-50%);
    width:38px;
    height:5px;
    border-radius:999px;
    background:rgba(15,34,49,0.22);
    z-index:3;
    pointer-events:none;
  }
  .map-legend-header{
    padding:18px 20px 12px;   /* extra top room for the handle */
    font-size:1rem;
  }
  /* Collapsed: show just the header strip as a tappable bar */
  .map-legend.collapsed{
    max-height:none;
  }
  .map-legend-body{
    padding:6px 14px 20px;   /* bottom padding clears the home indicator */
  }

  /* Bigger touch targets */
  .layer-toggle{padding:12px 12px;font-size:0.92rem;}
  .layer-toggle input[type="checkbox"]{width:26px;height:26px;}
  .legend-group-header{padding:14px;font-size:0.9rem;}

  /* Resource pages: tighten padding */
  main.resources{padding:22px 14px 50px;}
  .emergency-banner{padding:20px 18px;border-radius:22px;}
  .emergency-banner .big{font-size:1.2rem;}
  .emergency-banner .row{gap:10px;}
  .resources h2{font-size:1.1rem;}
  .card{border-radius:20px;}

  /* Popups a bit wider so they don't feel cramped */
  .leaflet-popup-content{font-size:0.86rem;}
}

/* Very small phones */
@media (max-width: 380px){
  header h1{font-size:1.12rem;}
  .emergency-banner .row div{flex:1 1 100%;}
}
