
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root{
  --bg:#031522;
  --bg-2:#071d2b;
  --panel:#062131;
  --panel-2:#082939;
  --line:rgba(132,190,207,.16);
  --line-strong:rgba(132,190,207,.28);
  --text:#ecf7fa;
  --muted:#86a6b2;
  --cyan:#5fd4c7;
  --cyan-2:#31aeb2;
  --accent:#f4c95d;
  --shadow:0 18px 50px rgba(0,0,0,.28);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0}
body{
  overflow:hidden;
  background:
    radial-gradient(circle at 40% 12%, rgba(22,94,114,.24), transparent 30%),
    linear-gradient(145deg,var(--bg),#020c14 70%);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

button,input,select{font:inherit}
button{color:inherit}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}

.app-shell{
  height:100vh;
  display:grid;
  grid-template-columns:280px minmax(420px,1fr) 330px;
  grid-template-rows:72px minmax(0,1fr);
  grid-template-areas:
    "header header header"
    "left map right";
}

.topbar{
  grid-area:header;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  background:linear-gradient(90deg,#031a29,#06283a 55%,#031a29);
  border-bottom:1px solid rgba(109,191,211,.22);
  box-shadow:0 6px 28px rgba(0,0,0,.2);
}
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand-mark{
  width:40px;height:40px;display:grid;place-items:center;color:#8ee7dc;
  border:1px solid rgba(95,212,199,.35);border-radius:12px;
  background:rgba(95,212,199,.07)
}
.brand-mark svg{width:29px;height:29px}
.brand-line{display:flex;gap:10px;align-items:center;min-width:0}
.brand h1{
  font-family:"Space Grotesk",sans-serif;
  font-size:20px;line-height:1;margin:0;letter-spacing:.2px;white-space:nowrap
}
.brand p{font-size:11px;color:var(--muted);margin:5px 0 0}
.beta{
  font-size:9px;letter-spacing:.12em;font-weight:800;color:#8ff0e5;
  border:1px solid rgba(95,212,199,.34);padding:4px 6px;border-radius:999px
}
.top-actions{display:flex;align-items:center;gap:10px}
.status-chip{
  font-size:10px;font-weight:700;letter-spacing:.08em;color:#9bd8d1;
  display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:999px;
  background:rgba(69,155,151,.08);border:1px solid rgba(87,205,193,.2)
}
.pulse{width:7px;height:7px;background:#55dfb3;border-radius:50%;box-shadow:0 0 0 5px rgba(85,223,179,.08)}
.icon-btn{
  width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.03);
  display:grid;place-items:center;cursor:pointer
}
.icon-btn:hover{background:rgba(95,212,199,.08);border-color:rgba(95,212,199,.3)}
.icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}

.panel{
  min-width:0;background:linear-gradient(180deg,rgba(6,33,49,.98),rgba(3,23,35,.98));
  position:relative;z-index:10
}
.left-panel{grid-area:left;border-right:1px solid var(--line)}
.right-panel{grid-area:right;border-left:1px solid var(--line)}
.panel-scroll{height:100%;overflow:auto;padding:16px}
.panel-scroll::-webkit-scrollbar{width:6px}
.panel-scroll::-webkit-scrollbar-thumb{background:#173f50;border-radius:99px}
.panel-section{padding:2px 0 17px;margin-bottom:15px;border-bottom:1px solid var(--line)}
.panel-section.compact{border-bottom:0;margin-bottom:0}
.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.eyebrow{display:block;color:#6ea0af;font-size:9px;line-height:1.2;letter-spacing:.14em;font-weight:800}
h2{font-family:"Space Grotesk";font-size:17px;line-height:1.2;margin:4px 0 0}
h3{font-size:11px;line-height:1.3;letter-spacing:.05em;margin:0;color:#c5dde4}
.count-badge,.chart-tag,.live-dot{
  white-space:nowrap;font-size:9px;font-weight:800;letter-spacing:.07em;padding:5px 7px;border-radius:7px;
  background:rgba(95,212,199,.08);border:1px solid rgba(95,212,199,.2);color:#83dfd4
}
.live-dot{color:#67e4ad;border-color:rgba(103,228,173,.18);background:rgba(103,228,173,.07)}

.segmented{
  display:grid;grid-template-columns:repeat(3,1fr);padding:3px;margin-top:13px;
  background:rgba(0,0,0,.16);border:1px solid var(--line);border-radius:11px
}
.seg{
  cursor:pointer;border:0;border-radius:8px;padding:8px 4px;background:transparent;color:#7599a6;
  font-size:10px;font-weight:700
}
.seg.active{background:linear-gradient(180deg,#17495a,#113948);color:#dff9f6;box-shadow:0 2px 12px rgba(0,0,0,.18)}

.section-title-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.tiny-btn{cursor:pointer;background:none;border:0;color:#68b8bd;font-size:9px;padding:2px}
.legend-list{display:flex;flex-direction:column;gap:3px}
.legend-row{
  min-height:31px;display:grid;grid-template-columns:18px 1fr auto;align-items:center;gap:8px;
  padding:4px 5px;border-radius:8px;cursor:pointer;transition:.18s ease
}
.legend-row:hover{background:rgba(255,255,255,.035)}
.legend-row.is-off{opacity:.42}
.legend-swatch{width:14px;height:14px;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.15)}
.legend-name{font-size:10px;color:#c7dce2;line-height:1.3}
.legend-value{font-size:9px;color:#6d98a6}
.legend-check{
  width:14px;height:14px;border-radius:4px;border:1px solid #42616d;display:grid;place-items:center;font-size:8px
}
.legend-row:not(.is-off) .legend-check{background:#2d6772;border-color:#438d92;color:white}
.field-label,.range-row label{display:block;font-size:9px;color:#759ba8;margin:12px 0 6px;font-weight:700}
.select{
  width:100%;padding:9px 10px;border-radius:9px;border:1px solid var(--line);color:#d7e9ed;
  background:#071c29
}
.range-row{display:flex;align-items:center;justify-content:space-between}
.range-row strong{font-size:10px;color:#6fd7cc}
.range{width:100%;accent-color:#53c8be}
.button-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}
.action-btn{
  border:1px solid var(--line);border-radius:9px;background:#0a2938;color:#bad2d9;padding:9px;
  font-size:10px;font-weight:700;cursor:pointer
}
.action-btn:hover{border-color:#3c7c86;background:#0d3344}
.action-btn.primary{background:linear-gradient(180deg,#146070,#0d4656);border-color:#247181;color:white}
.info-note{display:flex;gap:10px;padding:10px;border-radius:11px;background:rgba(244,201,93,.055);border:1px solid rgba(244,201,93,.14)}
.info-icon{
  flex:0 0 auto;width:19px;height:19px;border-radius:50%;display:grid;place-items:center;
  background:rgba(244,201,93,.16);color:#f0ce78;font-weight:800;font-size:10px
}
.info-note strong{font-size:10px;color:#e6d7a2}
.info-note p{margin:4px 0 0;color:#7597a2;font-size:9px;line-height:1.5}

.map-stage{grid-area:map;position:relative;min-width:0;overflow:hidden;background:#0b2431}
#map{position:absolute;inset:0}
.maplibregl-map{font-family:Inter,sans-serif}
.maplibregl-ctrl-group{
  background:#082334!important;border:1px solid rgba(114,184,201,.23)!important;box-shadow:var(--shadow)!important
}
.maplibregl-ctrl-group button{filter:invert(.92) hue-rotate(150deg)}
.maplibregl-ctrl-scale{
  background:rgba(3,20,30,.72)!important;color:#c1d8de!important;border-color:#89abb4!important;font-size:9px!important
}
.maplibregl-popup-content{
  min-width:225px;background:#062333;color:#dcecf0;border:1px solid rgba(109,197,203,.24);
  border-radius:13px;box-shadow:0 18px 45px rgba(0,0,0,.34);padding:0;overflow:hidden
}
.maplibregl-popup-tip{border-top-color:#062333!important;border-bottom-color:#062333!important}
.maplibregl-popup-close-button{color:#a9c7ce;font-size:20px;padding:7px 10px}
.popup-head{padding:12px 14px;background:linear-gradient(135deg,rgba(62,160,159,.16),rgba(255,255,255,.01));border-bottom:1px solid var(--line)}
.popup-head span{font-size:8px;color:#75a4b2;letter-spacing:.12em;font-weight:800}
.popup-head h4{font-family:"Space Grotesk";margin:4px 22px 0 0;font-size:14px}
.popup-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 14px}
.popup-grid small{display:block;font-size:8px;color:#6f96a3;margin-bottom:3px}
.popup-grid strong{font-size:10px;color:#d6eaee}

.glass{
  background:rgba(4,25,37,.82);border:1px solid rgba(130,193,208,.22);
  box-shadow:0 12px 34px rgba(0,0,0,.22);backdrop-filter:blur(13px)
}
.map-search{
  position:absolute;z-index:5;top:16px;left:50%;transform:translateX(-50%);
  width:min(420px,calc(100% - 110px));height:43px;border-radius:13px;
  display:flex;align-items:center;padding:0 11px;gap:8px
}
.map-search svg{width:17px;height:17px;fill:none;stroke:#7aa8b5;stroke-width:1.8}
.map-search input{min-width:0;flex:1;background:transparent;border:0;outline:0;color:#e8f4f6;font-size:11px}
.map-search input::placeholder{color:#648b98}
.map-search kbd{font-size:8px;color:#638d99;border:1px solid #31515b;padding:3px 5px;border-radius:5px;background:#071a25}
.search-results{
  display:none;position:absolute;left:0;right:0;top:49px;padding:6px;background:#062230;border:1px solid var(--line);
  border-radius:11px;box-shadow:var(--shadow)
}
.search-results.show{display:block}
.search-item{padding:9px;border-radius:8px;cursor:pointer;font-size:10px;color:#c7dce2}
.search-item:hover{background:#0d3545}
.search-item small{display:block;margin-top:2px;color:#638d9a;font-size:8px}

.map-toolbar{
  position:absolute;z-index:5;right:12px;top:72px;border-radius:12px;padding:4px;display:flex;flex-direction:column;gap:3px
}
.map-toolbar button{
  width:36px;height:34px;border:0;border-radius:8px;background:transparent;color:#c7dfe5;font-size:10px;font-weight:800;cursor:pointer
}
.map-toolbar button:hover,.map-toolbar button.active{background:rgba(95,212,199,.12);color:#81dfd4}

.map-footer{
  position:absolute;z-index:5;left:50%;transform:translateX(-50%);bottom:12px;border-radius:11px;
  display:flex;align-items:center;gap:10px;padding:7px 10px
}
.map-footer>div{display:flex;align-items:center;gap:7px}
.map-footer .separator{width:1px;height:17px;background:var(--line)}
.footer-label{font-size:7px;color:#638c98;font-weight:800;letter-spacing:.1em}
.map-footer strong{font-size:9px;color:#c7dce1;font-weight:600}
.map-footer select{border:0;background:transparent;color:#a9cbd1;font-size:9px;outline:none}
.map-footer select option{color:#10232b}

.kpi-wrap{padding-bottom:12px}
.kpi-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.kpi-card{
  min-height:88px;padding:11px;border-radius:12px;background:
    linear-gradient(145deg,rgba(13,60,77,.68),rgba(7,35,49,.78));
  border:1px solid rgba(104,178,194,.14)
}
.kpi-card span{display:block;font-size:8px;color:#75a0ad}
.kpi-card strong{display:block;font-family:"Space Grotesk";font-size:21px;margin:8px 0 0;color:#e7f4f6}
.kpi-card small{display:block;color:#59818e;font-size:8px;margin-top:1px}

.chart-card,.selection-card{
  position:relative;padding:13px;margin-top:10px;border-radius:14px;
  border:1px solid var(--line);background:linear-gradient(155deg,rgba(10,47,63,.66),rgba(5,29,42,.85))
}
.chart-heading{display:flex;justify-content:space-between;gap:10px;align-items:start}
.chart-heading h3{font-family:"Space Grotesk";font-size:13px;color:#dbecef;margin-top:4px;letter-spacing:0}
.donut-wrap{height:205px;position:relative;margin-top:8px}
.donut-center{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;pointer-events:none}
.donut-center strong{font-family:"Space Grotesk";font-size:20px}
.donut-center span{font-size:8px;color:#7099a5}
.mini-legend{display:grid;grid-template-columns:1fr 1fr;gap:5px 8px}
.mini-item{display:flex;align-items:center;gap:6px;min-width:0}
.mini-dot{width:7px;height:7px;border-radius:2px;flex:0 0 auto}
.mini-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:8px;color:#83a5b0}
.mini-item strong{margin-left:auto;font-size:8px;color:#c3d8dd}
.bar-wrap{height:170px;margin-top:10px}
.selection-card h3{font-family:"Space Grotesk";font-size:13px;margin:6px 0;color:#dbecef;letter-spacing:0}
.selection-card p{margin:0;color:#7799a4;font-size:9px;line-height:1.55}
.selection-details{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.selection-details div{padding:8px;border:1px solid var(--line);border-radius:9px}
.selection-details small{display:block;font-size:7px;color:#618c99}
.selection-details strong{display:block;font-size:9px;margin-top:3px;color:#d2e7eb}

@media (max-width:1100px){
  .app-shell{grid-template-columns:250px minmax(390px,1fr);grid-template-areas:"header header" "left map"}
  .right-panel{
    position:absolute;right:0;top:72px;bottom:0;width:310px;z-index:12;
    transform:translateX(calc(100% - 12px));transition:.25s ease;box-shadow:-18px 0 40px rgba(0,0,0,.22)
  }
  .right-panel:hover{transform:translateX(0)}
}
@media (max-width:760px){
  body{overflow:auto}
  .app-shell{
    min-height:100vh;height:auto;display:grid;
    grid-template-columns:1fr;grid-template-rows:64px 68vh auto auto;
    grid-template-areas:"header" "map" "left" "right"
  }
  .topbar{position:sticky;top:0}
  .brand h1{font-size:15px}
  .brand p,.beta,.status-chip{display:none}
  .left-panel,.right-panel{position:relative;inset:auto;width:auto;transform:none;border:0;border-top:1px solid var(--line)}
  .right-panel:hover{transform:none}
  .panel-scroll{height:auto;overflow:visible}
  .map-search{top:10px;width:calc(100% - 30px)}
  .map-toolbar{top:62px}
  .map-footer{bottom:8px}
}
