/* Friendly, map-first controls. Real activity and the explicit demo never share a layer. */
#map-home-card,#demo-player{position:fixed;z-index:620;bottom:calc(20px + env(safe-area-inset-bottom));left:12px;right:12px;max-width:520px;margin:auto;border:1px solid #fff;background:#fffdf7;border-radius:26px;padding:18px;box-shadow:0 6px 28px #153b282b;color:#183d32;box-sizing:border-box}
.home-heading,.demo-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.home-kicker{font-size:10px;letter-spacing:.1em;font-weight:750;color:#52675d}.home-heading h1,.demo-heading h2{font-size:24px;line-height:1.2;letter-spacing:-.7px;margin:5px 0 14px}.home-community{background:#e7eddf;border-radius:50%;width:46px;height:46px;display:grid;place-items:center;color:#204e3e;flex-shrink:0;text-decoration:none}
.home-shortcuts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.home-shortcuts>a,.home-shortcuts>button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:52px;border:1px solid #d5ddd2;background:#f2f5eb;border-radius:16px;color:#204e3e;text-decoration:none;font-size:14px;font-weight:650;padding:6px;box-sizing:border-box;margin:0}.home-shortcuts svg{flex-shrink:0}#home-live-status{font-size:12px;line-height:1.4;color:#52675d;margin:14px 0 8px}.home-real-item{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;text-align:left;min-height:44px;border:0;border-top:1px solid #d5ddd2;border-radius:0;background:none;padding:8px 0;font-size:13px}
#demo-start{margin:8px 0 0;display:flex;align-items:center;gap:12px;width:100%;background:#204e3e;color:#fffdf7;border-radius:16px;text-align:left;padding:12px 14px;min-height:58px;border:0;font-weight:650}#demo-start>span:first-of-type{flex:1}#demo-start small{display:block;font-size:11px;font-weight:400;color:#e1edd9;margin-top:4px}#demo-start svg{flex-shrink:0}
body.map-mode:not(:has(.sheet.expanded)):not(.water-timeline) .sheet{visibility:hidden}body.map-mode:has(.sheet.expanded) #map-home-card,body.water-timeline #map-home-card{display:none}body:not(.map-mode) #map-home-card,body:not(.map-mode) #demo-player{display:none}body.map-mode .map-actions{bottom:calc(330px + env(safe-area-inset-bottom))}body.map-mode:has(#home-real-items:not(:empty)) .map-actions{bottom:calc(418px + env(safe-area-inset-bottom))}
#demo-player{z-index:705;max-height:45dvh;overflow:auto;padding:16px 18px}#demo-player[hidden],#demo-map-badge[hidden]{display:none}.demo-heading h2{font-size:23px;margin-bottom:10px}#demo-close{width:44px;min-width:44px;min-height:44px;font-size:25px;padding:0;border:0;border-radius:50%;background:#e7eddf}#demo-stats{display:flex;gap:8px;margin:0 0 8px}#demo-stats>span{flex:1;display:flex;align-items:baseline;gap:6px;font-size:11px;color:#52675d;background:#edf1e8;border-radius:12px;padding:9px 7px}#demo-stats strong{font-size:22px;color:#183d32}.demo-transport{display:flex;gap:12px;align-items:center}.demo-transport>div{flex:1;min-width:0}#demo-time{font-size:12px;font-weight:650;display:block}#demo-hour{width:100%;min-height:44px;accent-color:#204e3e;padding:0;margin:0}#demo-play{width:48px;min-width:48px;height:48px;padding:0;border:0;border-radius:50%;background:#204e3e;color:white;font-size:18px}#demo-message{font-size:12px;margin:6px 0 10px;line-height:1.5}.demo-key{display:flex;justify-content:space-between;font-size:11px;color:#52675d}#demo-player details{border-top:1px solid #d5ddd2;margin-top:10px;font-size:12px}#demo-player summary{min-height:44px;display:flex;align-items:center;cursor:pointer}#demo-player details p{line-height:1.6;margin:0 0 8px}
#demo-map-badge{position:fixed;z-index:710;left:12px;right:12px;top:calc(88px + env(safe-area-inset-top));margin:auto;max-width:480px;background:#fff3d7;color:#6c4000;border:1px solid #bb8834;border-radius:20px;padding:10px 14px;box-sizing:border-box;font-size:11px;font-weight:800;letter-spacing:.02em;text-align:center;pointer-events:none}
.demo-pin{background:none!important;border:0!important;text-align:center}.demo-pin>span{display:grid;place-items:center;background:#a64c19;color:white;width:44px;height:44px;border:3px solid #fffdf7;box-sizing:border-box;border-radius:50% 50% 50% 12%;box-shadow:0 3px 14px #5e341c40;font-size:22px}.demo-pin.resolved>span{background:#23774b;border-radius:50%}.demo-pin.expired>span{background:#687784;border-radius:50%;opacity:.8}.demo-pin small{display:block;width:44px;background:#fff3d7;color:#6c4000;border-radius:8px;font-size:8px;font-weight:800;line-height:14px}.map-demo :is(.map-chips,.map-actions,.sheet,#map-home-card,#timeline-dock,#map-message,#connection-status,.incident-public-pin,.map-marker-wrapper,[data-water-colonia],[data-colonia],.map-camera-marker){display:none!important}.map-demo .leaflet-overlay-pane{visibility:hidden}.map-demo .leaflet-overlay-pane:has(.leaflet-interactive){visibility:hidden}.map-demo .leaflet-marker-icon:not(.demo-pin){display:none!important}/* Demo circles use the custom demo pane below. */
.map-demo #explore-menu{visibility:hidden}.map-demo .leaflet-control-zoom{visibility:visible}#map-home-card a:hover,#map-home-card button:hover{filter:brightness(.96)}.keyboard-open #map-home-card,body.incident-picking #map-home-card{visibility:hidden}body.drawer-open #map-home-card{visibility:hidden}
@media(min-width:700px){#map-home-card,#demo-player{left:24px;right:auto;margin:0;width:420px}#demo-map-badge{left:24px;right:auto;width:420px;top:94px}body.map-mode .map-actions{max-width:420px}.map-demo .leaflet-top.leaflet-right{top:24px}}
@media(max-height:650px){#map-home-card{padding:12px;max-height:42dvh;overflow:auto}.home-heading h1{font-size:20px;margin:4px 0 8px}.home-shortcuts>a,.home-shortcuts>button{min-height:44px}#home-live-status{margin:6px 0}#demo-start{min-height:48px;padding:8px 12px}.home-kicker{font-size:9px}body.map-mode .map-actions{bottom:calc(46dvh + 12px)}#demo-player{max-height:45dvh}}
@media(prefers-reduced-motion:reduce){.demo-pin{transition:none!important}}

/* Categories are in-map filters, not separate destinations. */
#explore-header .map-chips :is(#water-chip,#incidents-chip){display:none}
.category-row{display:flex;gap:6px;min-width:0}.category-row button{min-height:44px;padding:0 12px!important;box-shadow:0 2px 8px #153b2820;font-size:13px!important}.category-row button[aria-pressed=true],.home-shortcuts button[aria-pressed=true]{background:#204e3e;color:#fffdf7;border-color:#204e3e}
#map-category-filters{margin-top:8px}.category-period{display:flex;align-items:center;gap:4px;padding:3px 6px;background:#fffdf7;border:1px solid #d5ddd2;border-radius:22px;box-shadow:0 2px 8px #153b2820}.category-period button{font-size:12px;padding:0 10px;border:0;border-radius:20px;background:none;min-height:44px}.category-period button[aria-pressed=true]{background:#e7eddf;font-weight:750}.category-period span{font-size:11px;margin-left:auto;padding-right:8px;color:#52675d;white-space:nowrap}
.in-map-menu-filter{display:block;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid #d5ddd2;border-radius:0;min-height:52px;padding:10px 0;font-size:15px}#inline-incident-history{margin-top:14px;border-top:1px solid #d5ddd2;padding-top:8px}#inline-incident-history ul{padding-left:20px}#inline-incident-history li{font-size:14px;line-height:1.6;margin:8px 0}#incident-specialist{display:flex;align-items:center;justify-content:center;width:100%;padding:12px;background:#e7eddf;color:#183d32;border-radius:14px;border:0;min-height:48px;font-weight:650}
body.drawer-open #explore-header #map-category-filters,.map-demo #map-category-filters{display:none}body.map-mode .leaflet-top.leaflet-right{top:calc(202px + env(safe-area-inset-top))}body.map-demo .leaflet-top.leaflet-right{top:calc(144px + env(safe-area-inset-top))}
@media(min-width:700px){body.map-mode .leaflet-top.leaflet-right,body.map-demo .leaflet-top.leaflet-right{top:24px}}
#incident-specialist[hidden],#inline-incident-history[hidden]{display:none}
/* The filter bar reserves space above the water sheet. */
body.map-mode .sheet.expanded{max-height:calc(100dvh - 220px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
@media(max-width:360px){.category-row{gap:4px}.category-row button{padding:0 8px!important}.category-period span{font-size:10px;padding-right:3px}#layers-chip{padding:0 9px}}

/* Mobile: map first. Secondary controls are opt-in, not a permanent dashboard. */
#map-explore-toggle{display:none}
@media(max-width:699px){
 #explore-header{top:calc(8px + env(safe-area-inset-top));left:10px;right:10px}
 .search-pill{height:48px;padding:2px 4px 2px 12px}.rip-mark{font-size:19px}.map-chips{margin-top:6px;gap:6px}.category-row{gap:5px}.category-row button{padding:0 10px!important}.map-chips #layers-chip{padding:0 10px;font-size:12px}
 body.map-mode #map-home-card{display:none}
 body.map-mode #map-home-card.compact-open{display:block;bottom:calc(82px + env(safe-area-inset-bottom));max-height:52dvh;overflow:auto;padding:16px}
 #map-explore-toggle{position:fixed;z-index:625;display:flex;align-items:center;justify-content:center;left:50%;transform:translateX(-50%);bottom:calc(20px + env(safe-area-inset-bottom));min-height:48px;min-width:112px;padding:0 18px;border:1px solid #d5ddd2;border-radius:28px;background:#fffdf7;color:#183d32;font-size:14px;font-weight:700;box-shadow:0 3px 16px #153b2830}
 body.map-mode .map-actions,body.map-mode:has(#home-real-items:not(:empty)) .map-actions{bottom:calc(20px + env(safe-area-inset-bottom));left:14px;right:14px}
 #open-incident{width:52px;height:52px;border-radius:50%;padding:0;justify-content:center}#open-incident span{display:none}
 body.map-mode .leaflet-top.leaflet-right{top:calc(132px + env(safe-area-inset-top));right:14px}
 .camera-pin-label{width:44px;min-height:44px;border-width:2px;border-radius:50%;gap:0;box-sizing:border-box}.camera-pin-label>span{display:none}.map-camera-marker{width:44px!important}
 body.compact-home-open .map-actions{visibility:hidden}
 body:not(.map-mode) #map-explore-toggle,.map-demo #map-explore-toggle,.drawer-open #map-explore-toggle,.keyboard-open #map-explore-toggle,.incident-picking #map-explore-toggle,body:has(.sheet.expanded) #map-explore-toggle,body.water-timeline #map-explore-toggle{display:none}
 #layers-content #map-category-filters{margin:10px 0 16px}.category-period{box-shadow:none}
 body.map-mode .sheet.expanded{max-height:calc(100dvh - 156px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
 body.water-timeline .map-actions{bottom:calc(var(--dock-bottom) + 242px)}
 }

 /* Optional INEGI controls live inside Capas, not a persistent dashboard. */
#inegi-main-control{border-bottom:1px solid #d5ddd2;margin-bottom:12px;padding-bottom:10px;scroll-margin-top:65px}
#inegi-main-options>label{display:block;margin:12px 0 5px;font-size:13px;font-weight:650}
#inegi-main-layer{width:100%;max-width:100%;min-height:48px;border:1px solid #8eaa94;background:#fffdf7;color:#183d32;border-radius:12px;font-size:14px;box-sizing:border-box}
#inegi-main-status{font-size:12px;line-height:1.5;color:#52675d;margin:10px 0}
#inegi-main-show,#inegi-main-retry{width:100%;min-height:44px;padding:10px;margin:4px 0;border-radius:12px;background:#e7eddf;color:#183d32}
#inegi-main-options summary{min-height:44px;padding:10px 0;box-sizing:border-box;cursor:pointer;font-size:13px;font-weight:650}
#inegi-main-options details p,#inegi-main-list-note{font-size:12px;line-height:1.6;color:#52675d}
#inegi-main-list button{display:block;text-align:left;width:100%;min-height:44px;padding:8px 0;border-radius:0;border-bottom:1px solid #d5ddd2;background:none;font-size:13px}
#inegi-main-options[hidden],#inegi-main-retry[hidden]{display:none}
.inegi-main-popup h3{font-size:16px;margin:0 0 8px}.inegi-main-popup p{font-size:12px;line-height:1.5}.inegi-main-popup summary{min-height:44px;display:flex;align-items:center;font-weight:650;cursor:pointer}.inegi-main-popup dl{display:grid;grid-template-columns:1fr 1.5fr;gap:6px;font-size:12px;word-break:break-word}.inegi-main-popup dd{margin:0}

.map-demo .water-point-control{display:none!important}
 @media(max-width:699px){
  .water-point-control{margin-top:130px!important;border:0!important;border-radius:24px!important;box-shadow:0 2px 12px #153b2826}
  .water-point-control:has(>button:first-child:not([hidden])){width:44px;max-width:44px!important;height:44px}
  .water-point-control>button:first-child:not([hidden]){font-size:0;width:44px;height:44px;min-height:44px;min-width:44px;padding:0;border-radius:50%;background:#fffdf7;color:#204e3e}
  .water-point-control>button:first-child:not([hidden])::after{content:'◎';font-size:24px}
 }
