*{box-sizing:border-box}body{margin:0;background:#f3f7f9;color:#152b37;font-family:system-ui,sans-serif}header{background:#fff;display:flex;justify-content:space-between;align-items:center;padding:18px max(5vw,20px);border-bottom:1px solid #dce8ed}.brand{font-size:23px;font-weight:800;color:#0873a4}header span,.eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:#508093}main{max-width:1250px;margin:auto;padding:30px 24px}.hero{background:#073a53;color:white;border-radius:24px;padding:38px;display:grid;grid-template-columns:1.1fr 1fr;gap:32px;align-items:center}.hero h1{font-size:clamp(34px,4vw,55px);line-height:1.05;max-width:570px;margin:12px 0}.hero em{color:#70dbeb;font-style:normal}.hero p{color:#c7e3eb}.hero .eyebrow{color:#6ed7ea}.report{background:white;color:#193744;border-radius:18px;padding:23px}.report p{color:#193744;font-weight:700}.report small{display:block;color:#5d737d;margin-top:12px}.report label,label{font-size:13px;font-weight:700}select{padding:11px;border:1px solid #bed1d9;border-radius:9px;background:white;color:#173646}#colonia{display:block;width:100%;margin-top:7px}.actions{display:flex;gap:8px;flex-wrap:wrap}button{cursor:pointer;border:0;border-radius:9px;padding:12px 16px;min-height:44px;font-weight:700}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #ffb337;outline-offset:2px}#yes{background:#087bb8;color:#fff;flex:1}#no{background:#b72d3e;color:#fff;flex:1}#since button{background:#e7f3f7}.notice{background:#fff4d9;border-left:4px solid #d59516;padding:15px;margin:20px 0;border-radius:5px;font-size:14px}nav{display:flex;gap:8px;overflow:auto}nav button{background:transparent;white-space:nowrap;color:#58717b}nav button.active{background:#d6edf5;color:#075678}.content{background:white;padding:26px;border-radius:18px}.heading{display:flex;justify-content:space-between;gap:10px}.heading h2{font-size:26px;margin:5px 0}.heading p{margin:6px 0;color:#657f88}.legend{display:flex;gap:18px;flex-wrap:wrap;font-size:13px;margin:24px 0;color:#415b64}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}.card{border:1px solid #dae7eb;border-radius:12px;padding:17px;border-top:4px solid var(--c)}.card h3{margin:0 0 8px}.card p{font-size:13px;color:#58707a;margin:6px 0}.tag{font-weight:700}.blue{--c:#3b82f6}.red{--c:#ef4444}.yellow{--c:#eab308}.gray{--c:#aab7bf}.tablewrap{overflow:auto}table{border-collapse:collapse;font-size:13px}th,td{padding:5px;border-bottom:1px solid #edf2f4;text-align:left;white-space:nowrap}.cell{width:38px;height:38px;min-height:38px;padding:0;background:var(--c);color:#142b33}#controls{margin-bottom:20px}#hour{width:min(50%,450px)}footer{padding:20px;text-align:center;color:#718991;font-size:12px}@media(max-width:700px){.hero{grid-template-columns:1fr;padding:24px}.heading{flex-direction:column}header span{display:none}main{padding:16px}.content{padding:18px}}
/* Map-first mobile shell */
[hidden]{display:none!important}body{background:#dceaf0}#map{position:fixed;inset:0;z-index:0;background:#cfe4e8}.leaflet-control-attribution{font-size:10px!important}.map-top{position:fixed;z-index:500;top:max(16px,env(safe-area-inset-top));left:16px;display:grid;gap:2px;background:#073a53;color:white;border-radius:18px;padding:12px 16px;box-shadow:0 4px 18px #073a5355}.map-top strong{font-size:19px}.map-top small{font-size:10px;color:#77e6e5}.map-top span{font-size:11px;color:#d1eef1}.map-actions{position:fixed;z-index:500;right:12px;bottom:115px;display:flex;align-items:end;gap:8px;flex-direction:column}.map-actions button,#back-map{background:#073a53;color:white;box-shadow:0 4px 15px #073a5344}.map-actions .metrics-link{display:flex;align-items:center;min-height:44px;padding:10px 14px;background:#073a53;color:#fff;border-radius:12px;font-weight:700;text-decoration:none;box-shadow:0 4px 15px #073a5344}.map-actions .metrics-link:focus-visible{outline:3px solid #073a53;outline-offset:3px}.map-actions #locate{font-size:24px;width:50px;height:50px;padding:0;border-radius:50%;background:white;color:#075678}#map-message{position:fixed;z-index:500;top:85px;left:16px;max-width:75%;background:#fff;border-radius:8px;font-size:12px}#map-message:empty{display:none}.sheet{position:fixed;z-index:600;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,560px);background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -6px 28px #052f4344;max-height:70dvh;overflow:auto;padding:0 18px max(15px,env(safe-area-inset-bottom))}.sheet #sheet-toggle{display:block;width:100%;background:white;color:#073a53;font-size:16px}.handle{display:block;background:#a8c0c9;width:42px;height:4px;margin:0 auto 10px;border-radius:9px}.sheet .report{padding:8px 0}.sheet .report small{font-size:12px}.sheet #sheet-summary{font-size:14px;color:#496671}.sheet #source{font-size:13px}.map-pin{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;border:4px solid white;box-shadow:0 3px 12px #123a4e99;font-size:21px}.map-pin.blue{background:#078dd4}.map-pin.red{background:#cf4054}.map-pin.yellow{background:#f0bc39}.map-pin.gray{background:#8a9da5}.map-marker-wrapper{background:none!important;border:0!important}#dashboard{position:relative;z-index:1000;background:#f3f7f9;min-height:100dvh}#back-map{position:sticky;top:10px;z-index:2;margin:10px 0 0 15px}#dashboard .hero{min-height:0}#dashboard .hero>div:first-child{max-width:750px}@media(max-width:600px){#dashboard main{padding:16px}#dashboard .hero{padding:22px}#dashboard .hero h1{font-size:30px}.sheet.expanded{max-height:72dvh}.leaflet-top.leaflet-right{top:8px}.leaflet-control-attribution{max-width:85vw}}

.leaflet-top.leaflet-left .leaflet-control-attribution{margin-top:90px;background:#fff!important;padding:4px 7px;border-radius:6px;color:#233b45}#sheet-list{background:#e0f2f6;color:#075678}.map-note{font-size:12px;color:#526f7a}

/* Contain map gestures without trapping the scrollable detail sheet. */
body.map-mode { overflow:hidden; position:fixed; width:100%; height:100%; overscroll-behavior:none; }
#map { touch-action:none; overscroll-behavior:none; }
.sheet { overscroll-behavior:contain; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
.leaflet-control-attribution { font-size:11px!important; line-height:1.4; }
.leaflet-top.leaflet-left .leaflet-control-attribution { margin-top:85px; }
.leaflet-control-zoom a { min-width:44px; min-height:44px; line-height:44px!important; }
#map-message:not(:empty) { padding:8px 10px; box-shadow:0 2px 10px #073a5322; }
#location-manual,#location-close { display:block; margin-top:8px; background:#e0f2f6; color:#075678; }
/* Dismissible GPS feedback must be physically above the existing floating filters. */
#map-message.location-feedback { z-index:760; max-height:48dvh; overflow:auto; max-width:min(75%,430px); }
body:not(.map-mode) #map-message.location-feedback { display:none; }
#locate:disabled { opacity:.6; cursor:wait; }

#connection-status:not([hidden]) { position:fixed; z-index:800; top:145px; left:12px; right:12px; margin:0; padding:10px 12px; border-radius:10px; background:#fff4d9; color:#533c09; font-size:13px; box-shadow:0 3px 12px #073a5333; }
.leaflet-top.leaflet-left { z-index:700; }

.leaflet-top.leaflet-left .leaflet-control-attribution { margin-top:calc(85px + env(safe-area-inset-top)); }
#map-message { top:calc(115px + env(safe-area-inset-top)); }
#connection-status:not([hidden]) { top:calc(155px + env(safe-area-inset-top)); }
#colonia-history { max-height:9em; overflow:auto; padding-left:1.5em; font-size:13px; line-height:1.7; }
#history-section h2 { font-size:16px; margin-bottom:4px; }
#history-section p { font-size:12px; color:#526f7a; }
#close-sheet { background:#e0f2f6; color:#075678; }
#water-map-caption { font-size:12px; margin:0 0 8px; color:#294f60; }
#water-mode { display:block; width:100%; min-height:44px; margin:6px 0; }
#controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#controls input { flex:1; min-width:130px; min-height:44px; }
#hour-label { display:block; width:100%; font-size:13px; }
#since #send-water { background:#075678; color:white; width:100%; }
#since summary { min-height:44px; padding:12px 0; cursor:pointer; }
#since button[aria-pressed=true] { outline:3px solid #075678; outline-offset:-3px; }
#since summary:focus-visible { outline:3px solid #ffb337; }
.report button:disabled,#controls button:disabled { cursor:wait; opacity:.65; }
#catalog-search { display:block; width:100%; min-height:44px; margin:7px 0; padding:11px; border:1px solid #bed1d9; border-radius:9px; font:inherit; }
#catalog-status { font-size:13px; }
#catalog-results { list-style:none; padding:0; margin:8px 0; max-height:180px; overflow:auto; }
#catalog-results button { width:100%; text-align:left; margin:2px 0; background:#e0f2f6; color:#075678; }
#close-sheet { position:sticky; top:0; z-index:2; }
/* Reserve a dock, rather than painting the legend over map content/attribution. */
:root { --map-legend-height:160px; }
#map-legend { position:fixed; bottom:0; left:0; right:0; z-index:610; background:#fff; color:#193744; border-top:1px solid #bed1d9; padding:8px 12px max(8px,env(safe-area-inset-bottom)); font-size:12px; line-height:1.4; }
#map-legend h2 { font-size:13px; margin:0 0 3px; }
.water-halo-legend { max-width: min(250px, 65vw); background: rgba(255,255,255,.96); color:#193744; border:1px solid #bed1d9; border-radius:8px; padding:5px 8px; font-size:11px; line-height:1.3; box-shadow:0 1px 4px #0003; }
.water-halo-legend summary { cursor:pointer; font-weight:700; }
.water-halo-legend p { margin:4px 0 0; }
.leaflet-bottom .water-halo-legend { margin-bottom:90px; }
@media(min-width:700px) { .leaflet-bottom .water-halo-legend { position:fixed; right:16px; bottom:90px; margin:0; } }
#map-legend p { margin:3px 0 0; }
#map-legend ul { list-style:none; padding:0; margin:4px 0; display:grid; grid-template-columns:1fr 1fr; gap:3px 10px; }
#map-legend li { display:flex; align-items:center; gap:5px; }
.legend-swatch { flex:0 0 12px; height:12px; border:1px solid #193744; border-radius:50%; }
.legend-swatch.blue { background:#078dd4; }.legend-swatch.red { background:#cf4054; }.legend-swatch.yellow { background:#f0bc39; }.legend-swatch.gray { background:#8a9da5; }
body:not(.map-mode) #map-legend { display:none; }
body.map-mode #map { bottom:var(--map-legend-height); }
body.map-mode .sheet { bottom:var(--map-legend-height); max-height:calc(100dvh - var(--map-legend-height) - 125px); }
body.map-mode .map-actions { bottom:calc(var(--map-legend-height) + 115px); }
@media(min-width:700px) { #map-legend ul { grid-template-columns:repeat(4,max-content); gap:20px; } }
/* Keyboard focus stays visible on both the map and the scrollable nonmodal sheet. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
:focus-visible { outline:3px solid #073a53; outline-offset:3px; box-shadow:0 0 0 6px #fff; }
#map:focus-visible { outline-offset:-4px; }
.leaflet-interactive:focus-visible { outline:3px solid #073a53; filter:drop-shadow(0 0 3px #fff); }
.sheet { scroll-padding-top:65px; scroll-padding-bottom:12px; }
.sheet :is(button,input,select,a,summary) { scroll-margin-block:8px; }
.map-actions:focus-within { z-index:750; }
/* A22: compact, text-labeled evidence; color is never the sole indicator. */
#colonia-metrics { margin:12px 0; padding:8px 10px; border-left:4px solid #496671; background:#f3f7f9; overflow-wrap:anywhere; }
#colonia-metrics[data-color="gray"] { border-color:#8a9da5; }
#colonia-metrics h2 { font-size:1rem; margin:0 0 6px; }
#colonia-metrics p { font-size:13px; margin:6px 0; line-height:1.4; }
#colonia-metrics dl { margin:8px 0; }
#colonia-metrics dt { font-size:12px; font-weight:700; color:#496671; }
#colonia-metrics dd { font-size:14px; margin:0 0 7px; line-height:1.35; }
#colonia-metrics summary { min-height:44px; padding:10px 0; font-size:14px; font-weight:700; cursor:pointer; }

/* Keep native table context readable while the day columns scroll horizontally. */
#results .tablewrap { container-type:inline-size; }
#results table caption { position:sticky; left:0; width:100cqw; white-space:normal; text-align:left; padding:8px 4px 14px; line-height:1.6; }
