/* Operations theme is scoped to the city map; apartment materials keep their own palette. */
:root{
  --map-ink:#213548;
  --map-muted:#506476;
  --map-accent:#075ea6;
  --map-border:#d2dfe8;
  --map-strong-border:#95afc3;
  --map-surface:#fff;
  --map-soft:#f4f8fb;
  --map-tint:#eaf4fe;
  --map-active:#d9ecfc;
  --map-critical:#a92540;
  --map-warning:#8b4d05;
}
#geo-monitor-summary{display:none}
body[data-scene="city"] .command-grid{gap:18px}
body[data-scene="city"] .command-grid>.map-panel,
body[data-scene="city"] .command-grid>.geo-panel{height:920px;border:1px solid var(--map-border);border-radius:8px;box-shadow:0 12px 32px #23435b20}
body[data-scene="city"] .map-panel{--text:var(--map-ink);--muted:var(--map-muted);--border:var(--map-border);--blue:var(--map-accent);--red:var(--map-critical);--amber:var(--map-warning);background:var(--map-surface);color:var(--map-ink)}
body[data-scene="city"] #scene-loading{background:var(--map-soft);color:var(--map-muted)}
body[data-scene="city"] #scene-loading .loader{border-color:var(--map-border);border-top-color:var(--map-accent)}
body[data-scene="city"] :is(#map-inventory-scope,.geo-filters select){
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23506476' stroke-width='1.6'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
}
body[data-scene="city"] .map-panel>.panel-heading{padding:25px 24px 16px;background:linear-gradient(110deg,var(--map-soft),var(--map-surface) 72%)}
body[data-scene="city"] .map-panel .panel-heading h2{font-size:22px;letter-spacing:0;color:var(--map-ink);font-weight:500}
body[data-scene="city"] .map-panel .panel-heading p{color:var(--map-muted);font-size:14px}
body[data-scene="city"] .map-heading-controls{gap:10px}
body[data-scene="city"] #map-inventory-scope{background-color:var(--map-surface);color:var(--map-ink);border-color:var(--map-border);font-size:13px}
body[data-scene="city"] .map-panel .segmented{background:var(--map-soft);border-color:var(--map-border)}
body[data-scene="city"] .map-panel .segmented button{font-size:14px;color:var(--map-muted)}
body[data-scene="city"] .map-panel .segmented button.selected{background:var(--map-accent);color:#fff;box-shadow:inset 0 0 0 1px var(--map-accent)}
body[data-scene="city"] #geo-monitor-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0 24px 17px;padding:15px 0 10px;border:1px solid var(--map-border);border-radius:5px;background:var(--map-soft);flex-shrink:0}
.geo-monitor-metric{padding:0 17px;min-width:0;border-right:1px solid var(--map-border)}
.geo-monitor-metric:nth-child(4){border:0}
.geo-monitor-metric>span{display:block;font-size:14px;line-height:1.5;color:var(--map-muted);white-space:nowrap}
.geo-monitor-metric>strong{display:block;margin-top:6px;font-weight:400;font-size:30px;line-height:1.2;letter-spacing:-.03em;color:var(--map-accent);font-variant-numeric:tabular-nums}
.geo-monitor-metric>strong small{font-weight:400;font-size:12px;letter-spacing:0;color:var(--map-muted);margin-left:6px}
.geo-monitor-metric.is-p1>strong{color:var(--map-critical)}
.geo-monitor-metric.is-p2>strong{color:var(--map-warning)}
.geo-monitor-metric:nth-child(4)>strong{color:var(--map-ink)}
.geo-monitor-caption{grid-column:1/-1;padding:12px 17px 0;margin:0!important;color:var(--map-muted)!important;font-size:12px!important;line-height:1.5}
body[data-scene="city"] .geo-filters{padding:0 24px 14px;gap:12px}
body[data-scene="city"] .geo-filters label{font-size:13px;color:var(--map-muted)}
body[data-scene="city"] .geo-filters select{border-color:var(--map-border);background-color:var(--map-surface);color:var(--map-ink);font-size:14px}
body[data-scene="city"] .geo-filters option{background:var(--map-surface);color:var(--map-ink)}
body[data-scene="city"] .geo-filters select:focus-visible{outline-color:var(--map-accent)}
body[data-scene="city"] .scene-toolbar{padding:0 24px 10px;background:var(--map-surface);gap:10px}
body[data-scene="city"] .scene-breadcrumb{font-size:14px;color:var(--map-muted)}
body[data-scene="city"] .scene-breadcrumb .text-btn{color:var(--map-accent);font-size:14px}
body[data-scene="city"] .scene-breadcrumb strong{color:var(--map-ink)}
body[data-scene="city"] .crumb-divider{color:var(--map-muted)}
body[data-scene="city"] .scene-tools{gap:5px}
body[data-scene="city"] .map-panel .icon-btn{color:var(--map-muted);border:1px solid var(--map-border);width:34px;height:34px;border-radius:4px}
body[data-scene="city"] .map-panel .icon-btn:hover,
body[data-scene="city"] .map-panel .icon-btn.active{color:var(--map-ink);background:var(--map-tint);border-color:var(--map-accent)}
body[data-scene="city"] .map-panel .icon-btn:disabled{opacity:.45}
body[data-scene="city"] .geo-terrain-button{border-color:var(--map-border);color:var(--map-muted);background:var(--map-surface);font-size:13px;min-height:34px;margin-right:0}
body[data-scene="city"] .geo-terrain-button[aria-pressed="true"]{color:var(--map-accent);background:var(--map-tint);border-color:var(--map-accent)}
body[data-scene="city"] #scene-container{border-block:1px solid var(--map-border);background:var(--map-soft)}
body[data-scene="city"] #geo-city-map{background:var(--map-soft);color:var(--map-ink)}
/* Match the softly coloured WebGL basemap when using the two-dimensional renderer. */
body[data-scene="city"] #geo-city-map .leaflet-tile-pane{filter:saturate(.47) contrast(.93) brightness(1.03)}
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-group,
body[data-scene="city"] #geo-city-map .leaflet-bar{border:1px solid var(--map-strong-border);background:var(--map-surface);box-shadow:0 3px 14px #23435b20;border-radius:4px}
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-group button,
body[data-scene="city"] #geo-city-map .leaflet-bar a{background:var(--map-surface);color:var(--map-ink);border-color:var(--map-border)}
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-group button:hover,
body[data-scene="city"] #geo-city-map .leaflet-bar a:hover{background:var(--map-tint);color:var(--map-ink)}
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-icon{filter:none}
body[data-scene="city"] #geo-city-map .leaflet-control-attribution,
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-attrib{background:#ffffffef;color:var(--map-muted);font-size:11px;border-top:1px solid var(--map-border)}
body[data-scene="city"] #geo-city-map .leaflet-control-attribution a,
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-attrib a{color:var(--map-accent)}
body[data-scene="city"] #geo-city-map .leaflet-control-scale-line,
body[data-scene="city"] #geo-city-map .maplibregl-ctrl-scale{background:#ffffffef;color:var(--map-muted);border-color:var(--map-strong-border);font-size:11px;text-shadow:none}
body[data-scene="city"] .geo-map-status{top:13px;left:14px;max-width:calc(100% - 76px);border-color:var(--map-border);border-radius:4px;background:#ffffffef;color:var(--map-muted);padding:7px 11px;font-size:12px;box-shadow:0 4px 14px #23435b20}
body[data-scene="city"] .scene-orientation{color:var(--map-muted);bottom:32px;right:18px}
body[data-scene="city"] .scene-orientation svg{fill:var(--map-accent);stroke:var(--map-accent)}
body[data-scene="city"] .scene-bottom{flex-wrap:wrap;justify-content:flex-start;gap:7px 16px;padding:13px 23px;background:var(--map-soft);border-color:var(--map-border);color:var(--map-muted);font-size:12px}
body[data-scene="city"] #scene-legend{gap:16px;flex:1 0 auto}
body[data-scene="city"] #scene-footnote{font-size:11px;text-align:left;color:var(--map-muted)}
body[data-scene="city"] .legend-dot{width:8px;height:8px}
body[data-scene="city"] .legend-dot.collected{background:var(--map-accent);border:1px solid var(--map-accent);box-shadow:0 0 7px #23435b20}
body[data-scene="city"] .legend-dot.proxy{background:transparent;border:1px dashed var(--map-strong-border);border-radius:1px;transform:rotate(45deg)}
body[data-scene="city"] .legend-dot.critical{background:var(--map-critical);border-color:#da8291}
body[data-scene="city"] .legend-dot.warning{background:var(--map-warning);border-color:#d5a15c}
body[data-scene="city"] .geo-panel{--amber:var(--map-warning);--red:var(--map-critical);background:var(--map-surface);color:var(--map-ink)}
body[data-scene="city"] .geo-panel>.panel-heading{border-color:var(--map-border);padding:24px 22px 20px;background:linear-gradient(125deg,var(--map-soft),var(--map-surface))}
body[data-scene="city"] .geo-panel h2{color:var(--map-ink);font-size:21px;font-weight:500}
body[data-scene="city"] #geo-coverage-summary{font-size:13px;line-height:1.8;color:var(--map-muted)}
body[data-scene="city"] .geo-property-list{scrollbar-color:#38536b #0c1b2a}
body[data-scene="city"] .geo-property-item{gap:13px;padding:20px 22px;background:var(--map-surface);border-color:var(--map-border);color:var(--map-ink);transition:background .18s,box-shadow .18s}
body[data-scene="city"] .geo-property-item:hover{background:var(--map-tint)}
body[data-scene="city"] .geo-property-item.is-selected{background:var(--map-active);box-shadow:inset 3px 0 var(--map-accent)}
body[data-scene="city"] .geo-property-item.is-p1.is-selected{box-shadow:inset 3px 0 var(--map-critical)}
body[data-scene="city"] .geo-property-item.is-p2.is-selected{box-shadow:inset 3px 0 var(--map-warning)}
body[data-scene="city"] .geo-property-index{background:var(--map-tint);color:var(--map-accent);border-color:var(--map-strong-border);border-radius:50%;width:29px;height:29px;font-size:13px}
body[data-scene="city"] .geo-property-item.is-p1 .geo-property-index{color:var(--map-critical);background:#ffedf0;border-color:#da8291}
body[data-scene="city"] .geo-property-item.is-p2 .geo-property-index{color:var(--map-warning);background:#fff2de;border-color:#d5a15c}
body[data-scene="city"] .geo-property-item strong{color:var(--map-ink);font-size:16px;font-weight:500}
body[data-scene="city"] .geo-property-region{color:var(--map-muted);font-size:13px;line-height:1.65}
body[data-scene="city"] .geo-property-status{margin-top:11px;gap:6px}
body[data-scene="city"] .geo-property-item .tag{font-size:12px;line-height:1.5;margin-top:0;padding:4px 6px;border-radius:3px}
body[data-scene="city"] .geo-property-item .tag.neutral{background:var(--map-surface);border-color:var(--map-border);color:var(--map-muted)}
body[data-scene="city"] .geo-property-item .tag.red{background:#ffedf0;border-color:#da8291;color:var(--map-critical)}
body[data-scene="city"] .geo-property-item .tag.amber{background:#fff2de;border-color:#d5a15c;color:var(--map-warning)}
body[data-scene="city"] .geo-panel-note{background:var(--map-soft);border-color:var(--map-border);color:var(--map-muted);font-size:12px;line-height:1.8;padding:15px 22px}
body[data-scene="city"] .geo-list-empty{color:var(--map-muted)}
body[data-scene="city"] .scene-detail{border-color:var(--map-strong-border);border-radius:6px;background:#ffffffef;color:var(--map-ink);box-shadow:0 12px 40px #23435b20}
body[data-scene="city"] .scene-detail p{color:var(--map-muted);font-size:13px}
body[data-scene="city"] .scene-detail .button{border-color:var(--map-border);background:var(--map-tint);color:var(--map-ink);font-size:13px}
body[data-scene="city"] .scene-detail .button:hover{background:var(--map-tint);border-color:var(--map-accent)}
@media(min-width:1600px){body[data-scene="city"] .command-grid{grid-template-columns:minmax(0,1fr)390px;gap:20px}}
@media(max-width:1100px){
 body[data-scene="city"] .command-grid{grid-template-columns:1fr;gap:16px}
 body[data-scene="city"] .command-grid>.map-panel{height:auto}
 body[data-scene="city"] .command-grid #scene-container{flex:none;height:540px;min-height:540px}
 body[data-scene="city"] .command-grid>.geo-panel{height:auto;max-height:580px}
 body[data-scene="city"] .geo-property-list{max-height:390px;flex:0 1 auto}
}
@media(max-width:650px){
 body[data-scene="city"] .map-panel>.panel-heading{align-items:flex-start;gap:15px;padding:22px 18px 16px;flex-direction:column}
 body[data-scene="city"] .map-heading-controls{width:100%;justify-content:space-between}
 body[data-scene="city"] #geo-monitor-summary{margin:0 18px 17px;grid-template-columns:repeat(2,minmax(0,1fr));padding:0}
 .geo-monitor-metric{padding:13px 15px;border-bottom:1px solid var(--map-border)}
 .geo-monitor-metric:nth-child(2){border-right:0}
 .geo-monitor-metric:nth-child(4){border-bottom:1px solid var(--map-border)}
 .geo-monitor-metric>span{font-size:13px}
 .geo-monitor-metric>strong{font-size:27px}
 .geo-monitor-caption{padding:11px 15px!important}
 body[data-scene="city"] .geo-filters{padding-inline:18px;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 body[data-scene="city"] .geo-filters .geo-status-field{grid-column:1/-1}
 body[data-scene="city"] .scene-toolbar{padding-inline:18px}
 body[data-scene="city"] .scene-tools{gap:3px}
 body[data-scene="city"] .scene-tools .icon-btn{width:32px;height:32px}
 body[data-scene="city"] .geo-terrain-button{padding:5px 8px}
 body[data-scene="city"] .command-grid #scene-container{height:480px;min-height:480px}
 body[data-scene="city"] .scene-bottom{padding:12px 18px}
 body[data-scene="city"] #scene-legend{gap:11px;font-size:11px}
 body[data-scene="city"] .geo-panel>.panel-heading{padding:22px 20px 18px}
 body[data-scene="city"] .geo-property-item{padding:18px 20px}
}
@media(prefers-reduced-motion:reduce){.geo-map-marker.is-p1::after{animation:none!important}}

body[data-scene="city"] .geo-group-item{align-items:center}
body[data-scene="city"] .geo-group-item .geo-property-main{flex:1;min-width:0}
body[data-scene="city"] .geo-group-item .geo-property-region{display:block;margin-top:3px}
body[data-scene="city"] #scene-breadcrumb{display:flex;flex-wrap:wrap;align-items:center;gap:5px;min-width:0}
body[data-scene="city"] #scene-breadcrumb .text-btn{white-space:normal;text-align:left}
.geo-point-options{display:grid;gap:6px;max-height:240px;overflow-y:auto}

/* Keep the map and navigation together. Selections expand below the canvas. */
body[data-page="overview"] main#app{padding-top:22px}
body[data-page="overview"] .page-heading{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;margin-bottom:18px}
body[data-page="overview"] .page-heading :is(.eyebrow,#page-description){display:none}
body[data-page="overview"] .page-heading h1{font-size:clamp(25px,2.7vw,38px);line-height:1.25}
body[data-page="overview"] .heading-actions{padding:0;gap:8px;max-width:none}
body[data-page="overview"] .heading-actions .city-chip{width:auto}
#overview-page>.command-grid{align-items:start;margin-bottom:24px}
#overview-page .command-grid>.map-panel{min-width:0;height:auto}
#overview-page .map-panel>#scene-container{flex:none;height:clamp(435px,59vh,700px);min-height:0}
#overview-page .command-grid>.geo-panel{height:auto}
@media(min-width:1101px){
  #overview-page .command-grid>.geo-panel{align-self:stretch;contain:size;max-height:calc(59vh + 430px)}
}
body[data-scene="apartment"] #overview-page>.command-grid{grid-template-columns:minmax(0,1fr)}
#overview-page .map-panel>.apartment-actions{position:static;max-width:none;margin:0;padding:10px clamp(12px,2vw,24px);background:#1c1d1f}
#overview-page #twin-empty{overflow-y:auto;justify-content:safe center}
#overview-page #twin-empty>*{flex-shrink:0}
#overview-page>.twin-panel{height:auto;margin-bottom:24px}
#overview-page>.twin-panel .twin-panel-scroll{max-height:560px}
#overview-page>.twin-controls{margin-top:15px}
#overview-page #geo-monitor-summary{margin:14px clamp(14px,2vw,24px)}
#overview-page .map-panel>#scene-detail{
  position:relative;inset:auto;width:auto;max-width:none;flex:none;z-index:auto;
  margin:12px clamp(12px,2vw,24px);padding:clamp(16px,2vw,24px);
  overflow-wrap:anywhere;backdrop-filter:none;box-shadow:none;
}
#overview-page #scene-detail h3{font-size:19px;padding-right:32px}
#overview-page #scene-detail p{margin:5px 0 10px}
#overview-page #scene-detail dl{display:flex;flex-wrap:wrap;gap:8px 30px}
#overview-page #scene-detail .button{width:auto}
.geo-detail-heading{padding-right:24px}
.geo-detail-actions,.geo-detail-links{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.geo-device-plan{margin:16px 0}
.geo-device-plan table,table.geo-device-plan{width:100%;border-collapse:collapse;font-size:14px}
#scene-detail .geo-device-plan :is(th,td){padding:8px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--map-border);background:var(--map-surface);color:var(--map-ink)}
#scene-detail .geo-device-plan thead th{background:var(--map-soft);color:var(--map-muted);font-weight:500}
#scene-detail .geo-device-plan th[scope="row"]{color:var(--map-ink);font-weight:500}
#scene-detail .geo-device-plan :is(th,td):last-child{text-align:right;font-variant-numeric:tabular-nums}
.geo-detail-evidence{margin:12px 0;color:inherit;font-size:13px}
.geo-detail-evidence summary{cursor:pointer}
.geo-detail-links a{color:var(--map-accent);text-decoration:underline}
#overview-plan-pane{background:#fff;color:var(--map-ink);scroll-margin-top:150px;min-width:0}
.overview-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px clamp(12px,2vw,22px);border-bottom:1px solid var(--map-border)}
.overview-plan-heading h2{font-size:18px}
.overview-plan-heading .button{color:var(--map-ink);background:white;border-color:var(--map-border);min-height:36px}
#overview-page .map-panel:fullscreen{height:100dvh;width:100vw;overflow-y:auto;overscroll-behavior:contain;border-radius:0}
#overview-page .map-panel:fullscreen>*{flex-shrink:0}
#overview-page .map-panel:fullscreen>#scene-container{height:auto;min-height:45vh;flex:1 0 45vh}

@media(max-width:760px){
  #overview-page .command-grid>.map-panel>#scene-container{height:clamp(335px,49svh,480px)}
  #overview-page #scene-legend{min-width:0;flex:1 1 100%}
}
@media(max-width:640px){
  body[data-page="overview"] main#app{padding-top:calc(var(--header-height) + 12px)}
  body[data-page="overview"] .page-heading{display:block;margin-bottom:13px}
  body[data-page="overview"] .heading-actions{margin-top:9px}
  body[data-page="overview"] .heading-actions .button{flex:none;min-height:34px;padding:4px 9px;font-size:12px}
  body[data-scene="city"] #overview-page .map-panel>.panel-heading{gap:8px;padding:13px 13px 10px}
  body[data-scene="city"] #overview-page .map-panel>.panel-heading h2{font-size:19px}
  body[data-scene="city"] #overview-page .map-panel>.panel-heading p{margin-top:2px;font-size:12px}
  body[data-scene="city"] #overview-page .geo-filters{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:0 13px 6px}
  body[data-scene="city"] #overview-page .geo-filters label{display:flex;gap:3px;font-size:11px}
  body[data-scene="city"] #overview-page .geo-status-field{grid-column:auto}
  #overview-page .geo-filters select{min-height:36px;font-size:12px;padding:5px 18px 5px;background-position:right 2px center;background-size:13px}
  #overview-page .map-panel .scene-toolbar{padding:0 12px 7px;min-height:38px}
  #overview-page .map-heading-controls{flex-wrap:nowrap}
  #overview-page #map-inventory-scope{width:min(160px,52%)}
  #overview-page .geo-monitor-metric{padding:9px 11px}
  #overview-page .geo-monitor-metric>strong{font-size:22px;margin-top:2px}
  #overview-plan-pane{scroll-margin-top:85px}
  #overview-page #scene-detail .geo-detail-actions .button{flex:1 1 auto}
}
