@font-face{font-family:Inter;src:url('/static/inter.woff2') format('woff2');font-style:normal;font-weight:100 900;font-display:swap}
:root{--sidebar:#004c48;--sidebar-dark:#00423f;--ink:#15213b;--muted:#617089;--green:#09a34b;--red:#df292d;--border:#dbe3ef;--paper:#f5f8ff}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,Arial,sans-serif;color:var(--ink)}body{background:#f3f7ff;font-size:15px;font-variant-numeric:tabular-nums}button,select,input{font:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #24b47a;outline-offset:3px}[hidden]{display:none!important}
.app-shell{display:flex;min-height:100vh;max-width:100vw}.sidebar{position:relative;z-index:20;width:230px;min-width:230px;flex:none;min-height:100vh;display:flex;flex-direction:column;background:linear-gradient(152deg,#005b58 0%,#00524f 32%,#003d3b 100%);color:#fff;overflow:hidden;box-shadow:2px 0 12px #113b3b10}
.site-brand{display:flex;align-items:center;flex-direction:column;text-decoration:none;color:white;padding:12px 13px 24px;margin:0 16px;border-bottom:1px solid #a4d4c04f;position:relative;z-index:1}.brand-logo{height:72px;width:72px;object-fit:contain}.brand-name{text-align:center;line-height:1.55;font-size:15px;font-weight:650;margin-top:6px;white-space:nowrap}.main-nav{margin:25px 10px;display:flex;gap:7px;flex-direction:column;position:relative;z-index:1}.nav-link{width:100%;color:#f5fffc;font-weight:580;border:0;background:transparent;border-radius:12px;min-height:46px;text-align:left;text-decoration:none;display:flex;align-items:center;padding:0 18px;gap:15px;font-size:16px}.nav-link:hover{background:#ffffff18}.nav-link.active{background:linear-gradient(105deg,#12b37d,#04905b);box-shadow:0 6px 18px #013e4035}.nav-icon{width:23px;height:23px;flex:none}.nav-icon svg{width:23px;height:23px;stroke-linecap:round;stroke-linejoin:round}.nav-count{margin-left:auto;border-radius:50px;background:#e33a37;font-size:11px;min-width:19px;text-align:center;padding:2px 5px}.sidebar-flourish{position:absolute;bottom:63px;left:-55px;width:230px;height:240px;opacity:.14;pointer-events:none}.sidebar-flourish span{position:absolute;background:#30df77;width:150px;height:77px;border-radius:95% 0 95% 0;transform:rotate(-48deg);left:30px;top:20px}.sidebar-flourish span+span{top:125px;left:70px;transform:rotate(-13deg)}.mqtt-footer{margin-top:auto;padding:15px 12px 18px;position:relative;z-index:1;border-top:1px solid #d2f1da3b}.mqtt-badge{min-height:52px;display:flex;align-items:center;justify-content:center;border-radius:11px;font-size:18px;font-weight:730;color:white;letter-spacing:-.02em;transition:background-color .18s}.mqtt-online{background:#04a329}.mqtt-offline{background:#cf2c32}
.main-overview{min-height:100vh;flex:1;min-width:0;position:relative;display:grid;grid-template-columns:minmax(0,1fr);background:#f3f7ff}.map-stage{height:100vh;min-height:650px;position:relative;overflow:hidden;background:#f1f5ed;touch-action:none}.map-world,.marker-layer{position:absolute;inset:0}.marker-layer{pointer-events:none}.map-controls{position:absolute;top:23px;right:18px;display:flex;flex-direction:column;gap:0;filter:drop-shadow(0 3px 4px #24443b26);z-index:4}.map-controls button{width:42px;height:42px;color:#182844;background:white;border:1px solid #d3dce2;font-size:29px;line-height:1;font-weight:530}.map-controls button:first-child{border-radius:10px 10px 0 0}.map-controls button:nth-child(2){border-radius:0 0 10px 10px}.map-controls button:last-child{margin-top:10px;border-radius:10px;font-size:27px}.map-controls button:hover{background:#ebf9ee}.map-legend{position:absolute;z-index:4;left:20px;bottom:29px;background:#fff;box-shadow:0 4px 15px #142d3f33;border:1px solid #d2d9df;border-radius:15px;padding:14px 16px;width:285px;pointer-events:auto}.map-legend h2{font-size:17px;letter-spacing:-.035em;line-height:1.35;margin:0 0 9px;padding-bottom:8px;border-bottom:1px solid #dce3e9}.legend-row{display:flex;align-items:center;gap:15px;padding:5px 4px;font-size:14px}.legend-symbol{width:19px;text-align:center;color:#173b63;font-size:19px}.unlocated{position:absolute;top:15px;left:20px;z-index:5;padding:12px;background:#ffffffea;border-radius:9px;max-width:285px;font-size:12px;box-shadow:0 2px 8px #132c3644}.unlocated button{background:#eff7f1;border:1px solid #c4ddcc;border-radius:6px;padding:5px 8px;margin:4px 4px 0 0;color:#153a33}.api-error{position:fixed;z-index:40;bottom:17px;left:50%;transform:translateX(-50%);background:#fff0ee;color:#9c2532;border:1px solid #eab6b6;border-radius:12px;padding:12px 20px}
.main-history{flex:1;min-width:0;height:100vh;min-height:700px;overflow:hidden;padding:9px 15px 17px;background:#f3f7ff;display:flex;flex-direction:column;gap:18px}.filter-toolbar{min-height:52px;display:flex;align-items:center;gap:24px;padding:0 16px}.filter-group{display:flex;align-items:center;gap:16px}.filter-group :is(label,.filter-label){font-size:15px;font-weight:670;white-space:nowrap}.filter-group :is(select,.metric-trigger){border:1px solid #cad7e7;box-shadow:0 2px 4px #2639590c;border-radius:11px;background:#fff;padding:10px 48px 10px 20px;color:var(--ink);min-width:230px;font-weight:600;cursor:pointer}.select-wrap{position:relative;display:block}.filter-icon{position:absolute;z-index:1;left:14px;top:50%;transform:translateY(-50%);width:20px;height:20px;color:#25365e;fill:#25365e;pointer-events:none}.filter-group :is(select,.metric-trigger){padding-left:46px}.filter-separator{height:29px;width:1px;background:#a9b6c7}.panel-v4{border-radius:18px;background:white;border:1px solid #dae4f2;box-shadow:0 4px 12px #182f4c15;padding:18px 22px}.panel-v4 h2{font-size:26px;letter-spacing:-.045em;margin:0 0 8px;line-height:1.2}.history-chart{flex:0 0 clamp(320px,43vh,465px);min-height:0;display:flex;flex-direction:column}.chart-wrapper{position:relative;min-height:0;flex:1;margin:7px 0 0}.chart-wrapper canvas{width:100%;height:100%;display:block}.history-table{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}.history-table-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.history-table-header h2{margin:0}.export-btn{border:1px solid #12a53e;background:#ebffe9;color:#087b25;padding:9px 18px;display:flex;align-items:center;gap:8px;border-radius:9px;font-weight:680;white-space:nowrap}.export-btn:hover{background:#d8f8db}.export-btn svg{height:19px;width:19px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}.table-scroll{overflow:auto;flex:1;min-height:0}.history-table table{width:100%;border-collapse:collapse;white-space:nowrap;text-align:left;font-size:14px}.history-table thead{background:#eaf0f8;position:sticky;top:0;z-index:1}.history-table th{font-size:13px;font-weight:700;padding:12px 14px}.history-table th:first-child{border-radius:9px 0 0 9px}.history-table th:last-child{border-radius:0 9px 9px 0}.history-table th small{font-size:11px;font-weight:600}.history-table td{border-bottom:1px solid #e3eaf3;padding:10px 14px}.history-table td:nth-child(n+2):nth-child(-n+7){text-align:center;font-weight:700}.history-table tbody tr:hover{background:#f6fbf6}.history-table td.empty-row{text-align:center;font-weight:400;color:#687995;padding:24px}.status-pill{display:inline-block;font-size:12px;font-weight:750;border-radius:999px;padding:6px 12px;background:#d2f8d7;color:#06792b}.status-pill.offline{background:#ffe0e1;color:#c5222b}.table-note{font-size:11px;color:#8a95a8;margin:7px 0 0}
.modal{width:min(480px,calc(100vw - 20px));border:1px solid #d5e2e7;border-radius:16px;padding:19px 22px;box-shadow:0 16px 45px #0c244455;color:#142536}.modal::backdrop{background:#09202791}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #e4ebef;padding-bottom:12px}.modal h2{margin:0;font-size:21px}.icon-close{border:0;background:transparent;color:#5a6578;font-size:27px}.event-list{max-height:58vh;overflow:auto}.event-item{padding:13px 0;border-bottom:1px solid #edf1f4;font-size:14px}.hint{color:#67798b;font-size:13px}.threshold-item{display:flex;align-items:center;justify-content:space-between;margin:12px 0;gap:10px;font-size:14px}.threshold-item input{padding:8px 10px;border:1px solid #cddbe0;border-radius:7px;width:140px}.modal-actions{display:flex;justify-content:end;gap:10px;margin-top:20px}.modal-actions button{padding:9px 16px;border-radius:8px}.subtle-button{border:1px solid #d1dedb;background:white}.primary-button{border:0;background:#009d64;color:white}.toast{position:fixed;right:20px;bottom:20px;z-index:90;max-width:min(420px,80vw);border-radius:12px;background:#163c34;color:#fff;padding:13px 18px;box-shadow:0 4px 18px #0002;font-size:13px}
@media(max-width:1170px){.sidebar{width:204px;min-width:204px}.filter-group :is(select,.metric-trigger){min-width:170px;padding-right:30px}}
@media(max-width:970px){.sidebar{width:175px;min-width:175px}.site-brand{margin:0 8px}.brand-name{font-size:12px}.nav-link{font-size:13px;gap:8px;padding:0 12px}.main-overview{display:block}.map-stage{height:100vh}.map-legend{width:245px}.filter-toolbar{gap:10px}.filter-group{gap:7px}.filter-group :is(select,.metric-trigger){min-width:120px}.panel-v4{padding:15px}}
@media(max-width:680px){.main-history{height:auto;min-height:calc(100dvh - 54px);overflow:visible}.history-table{min-height:400px;height:440px;flex:none}.app-shell{display:block}.sidebar{position:relative;height:auto;min-height:0;width:100%;flex-direction:row;align-items:center;justify-content:space-between;overflow:visible;padding:6px 10px}.site-brand{padding:0;margin:0;border:0;flex-direction:row;gap:5px}.brand-logo{width:40px;height:40px}.brand-name{font-size:10px;text-align:left;line-height:1.2;margin:0}.main-nav{flex-direction:row;margin:0;gap:4px}.nav-link{font-size:0;padding:7px;min-height:37px;width:auto}.nav-icon,.nav-icon svg{width:21px;height:21px}.nav-count{font-size:10px;position:absolute;right:-3px;top:-3px}.sidebar-flourish{display:none}.mqtt-footer{border:0;padding:0;margin:0}.mqtt-badge{min-height:32px;font-size:11px;border-radius:7px;padding:3px 5px}.main-overview{min-height:calc(100dvh - 54px)}.map-stage{height:calc(100dvh - 54px);min-height:540px}.map-legend{bottom:12px;left:10px;width:220px;padding:10px}.map-legend h2{font-size:13px}.legend-row{font-size:11px}.map-controls{top:12px;right:10px}.main-history{padding:8px;gap:10px}.filter-toolbar{flex-wrap:wrap;gap:6px;padding:0}.filter-group :is(label,.filter-label){font-size:12px}.filter-group :is(select,.metric-trigger){font-size:12px;padding:8px;min-width:120px}.filter-separator{display:none}.history-chart{flex-basis:310px}.history-table{min-height:390px}.panel-v4 h2{font-size:21px}.history-table th,.history-table td{padding:9px}.table-note{font-size:10px}}

/* V5: visual alignment to the two supplied reference screenshots. */
:root{--ink:#0c1630;--green:#00ad32;--paper:#f3f7ff}
body{background:#f3f7ff;color:var(--ink);font-weight:450}
.sidebar{background:linear-gradient(148deg,#004e4a 0%,#00544f 37%,#003e3c 100%)}
.site-brand{padding-bottom:18px}
.main-nav{margin-top:24px;gap:7px}
.nav-link{min-height:49px;font-size:17px;font-weight:600;gap:15px}
.nav-link.active{background:linear-gradient(105deg,#0cb787,#03986c)}
.nav-icon,.nav-icon svg{height:24px;width:24px}
.brand-name{font-size:16px;letter-spacing:-.015em;line-height:1.48}
.mqtt-badge{font-size:20px;min-height:54px;background:#00aa27}
.mqtt-offline{background:#d9272e}
/* Full-height map. */
.map-stage{background:#f6f8f3}


.map-legend{bottom:27px;left:19px;width:271px;border-radius:13px;padding:14px 15px}
.map-legend h2{font-size:18px;font-weight:800;letter-spacing:-.04em}
.legend-row{font-size:15px;padding:6px 3px;gap:13px}
.legend-symbol{height:22px;width:22px}
.legend-symbol svg{height:21px;width:21px;stroke:#1b2b54}

.map-controls{top:23px;right:19px}
/* History exact spatial rhythm: filters -> chart -> expanded history card. */
.main-history{min-height:100vh;height:auto;overflow:visible;padding:0 16px 29px;gap:18px;background:#f3f7ff}
.filter-toolbar{min-height:51px;flex:0 0 51px;padding:0 16px;gap:35px}
.filter-group{gap:25px}
.filter-group :is(label,.filter-label){font-size:17px;font-weight:700}
.filter-group :is(select,.metric-trigger){appearance:none;-webkit-appearance:none;min-width:245px;height:48px;border-radius:11px;background:linear-gradient(180deg,#fff,#f5f8ff);border:1px solid #cdd7e7;box-shadow:0 2px 3px #cbd8e5;padding:8px 46px 8px 61px;font-size:18px;font-weight:630}
.select-wrap:after{content:'';position:absolute;right:22px;top:44%;width:10px;height:10px;border-right:2.5px solid #152c5a;border-bottom:2.5px solid #152c5a;transform:rotate(45deg);pointer-events:none}
.filter-icon{left:19px;width:23px;height:23px}
.filter-separator{height:40px;width:1px;background:#c5d0df}
.panel-v4{border-radius:19px;padding:18px 21px}
.main-history .panel-v4 h2{font-family:inherit;font-size:23px;font-weight:600;letter-spacing:-.015em}
.history-chart{flex:0 0 clamp(300px,40vh,380px)}

.chart-wrapper{margin-top:11px}

.history-table-header{margin-bottom:17px}
.export-btn{font-size:18px;border-radius:9px;background:#eaffea;padding:11px 20px}
.export-btn svg{height:23px;width:23px}
.history-table{min-height:0;flex:1 0 auto}
.history-table table{font-size:16px}
.history-table th{padding:13px 14px;font-size:15px}
.head-icon{display:inline-flex;align-items:center;gap:9px;white-space:nowrap}
.head-icon>svg{width:22px;height:22px;color:#193166;flex:none}
.history-table th small{font-size:12px}
.history-table td{padding:9px 14px;font-size:16px}
.status-pill{display:inline-flex;align-items:center;gap:7px;background:#d4fad5;color:#007b27;font-size:14px;padding:5px 13px;min-width:144px;justify-content:center}
.status-pill.offline{background:#ffe0e2;color:#c61921}
.status-pill svg{width:21px;height:18px;stroke:currentColor}
.table-note{font-size:11px;color:#7e8ba2}
/* Cả hai trang dùng chung bốn mục điều hướng. */
body[data-page="lich-su"] .sidebar-flourish{bottom:12px}

@media(max-width:970px) and (min-width:681px){
 .sidebar{width:175px;min-width:175px}
 .nav-link{font-size:13px;gap:8px;padding:0 12px}

 .filter-group :is(label,.filter-label){font-size:13px}.filter-group :is(select,.metric-trigger){font-size:13px;min-width:150px}

}
@media(max-width:680px){
 .nav-link{font-size:0;min-height:36px;gap:2px}
 .brand-name{font-size:10px}
 .mqtt-badge{min-height:32px;font-size:11px}
 .main-history{height:auto;min-height:calc(100dvh - 54px);padding:6px 9px 12px;gap:10px}
 .filter-toolbar{flex-wrap:wrap;min-height:48px;height:auto;flex-basis:auto;padding:0 4px;gap:7px}
 .filter-group{gap:5px;flex:1;min-width:0}
 .filter-group :is(label,.filter-label){font-size:10px}
 .filter-group :is(select,.metric-trigger){min-width:0;width:100%;font-size:12px;height:39px;padding:4px 18px 4px 28px}
 .filter-icon{left:6px;width:16px;height:16px}
 .select-wrap{flex:1;min-width:0}
 .select-wrap:after{right:9px;width:6px;height:6px;border-width:1.8px}
 .filter-separator{display:none}
 .history-chart{flex-basis:330px}
 .main-history .panel-v4 h2{font-size:19px}
 .history-table{height:auto;flex:none;min-height:0}
 .history-table table{font-size:12px}.history-table th,.history-table td{font-size:11px;padding:8px 10px}
 .head-icon{gap:4px}.head-icon svg{width:15px;height:15px}
 .status-pill{min-width:112px;font-size:11px}
 .status-pill svg{width:16px;height:14px}
 .export-btn{font-size:13px;padding:8px 10px}.export-btn svg{width:17px;height:17px}

 .map-legend{left:10px;bottom:12px;width:220px;padding:10px}
 .map-legend h2{font-size:13px}.legend-row{font-size:11px}
}

.history-table .table-scroll{flex:0 0 auto;overflow:auto}
.history-pagination{
 display:flex;justify-content:center;align-items:center;gap:12px;
 margin-top:auto;padding-top:14px;font-size:14px;font-weight:600;color:#334155;
}
.history-pagination button{
 display:grid;place-items:center;width:34px;height:34px;border:1px solid #cdd7e7;
 border-radius:8px;background:#fff;color:#183052;
}
.history-pagination button:hover:not(:disabled){background:#edf4ff}
.history-pagination button:disabled{opacity:.45;cursor:default}
#history-page-number{min-width:54px;text-align:center}
.history-table .table-note{margin-top:10px}

/* Decorative leaf follows the broad botanical silhouette in the reference. */
.sidebar-flourish{left:-45px;bottom:63px;width:265px;height:270px;opacity:.17}
.sidebar-flourish span{width:185px;height:95px;left:22px;top:16px}
.sidebar-flourish span+span{left:75px;top:132px}
@media(max-width:680px){.sidebar-flourish{display:none}}


.status-pill.offline svg{width:1.25em;height:1.25em;flex:none}
#open-notifications{position:relative}

/* The map and legend share the same station pin. */
.map-symbols{position:absolute}
.station-on-map{position:absolute}
.station-on-map.poor{--aqi-wave-color:#ff7e00}
.station-on-map.bad{--aqi-wave-color:#ff0000}
.station-on-map.very-bad{--aqi-wave-color:#8f3f97}
.station-on-map.hazardous{--aqi-wave-color:#7e0023}
.station-on-map.aqi-warning::before,.station-on-map.aqi-warning::after{
 content:"";position:absolute;left:0;top:0;translate:-50% -50%;
 width:clamp(130px,23vw,300px);aspect-ratio:1;pointer-events:none;
}
.station-on-map.aqi-warning::before{
 background:radial-gradient(circle closest-side,
  color-mix(in srgb,var(--aqi-wave-color) 23%,transparent) 0%,
  color-mix(in srgb,var(--aqi-wave-color) 14%,transparent) 34%,
  color-mix(in srgb,var(--aqi-wave-color) 6%,transparent) 64%,
  transparent 100%);
}
.station-on-map.aqi-warning::after{
 background:radial-gradient(circle closest-side,
  color-mix(in srgb,var(--aqi-wave-color) 48%,transparent) 0%,
  color-mix(in srgb,var(--aqi-wave-color) 34%,transparent) 30%,
  color-mix(in srgb,var(--aqi-wave-color) 16%,transparent) 57%,
  color-mix(in srgb,var(--aqi-wave-color) 4%,transparent) 82%,
  transparent 100%);
 animation:aqi-map-wave 3.6s ease-out infinite;
 animation-delay:var(--aqi-wave-delay);
}
@keyframes aqi-map-wave{
 0%{transform:scale(.16);opacity:0}
 18%{transform:scale(.36);opacity:1}
 58%{transform:scale(.76);opacity:.76}
 86%,100%{transform:scale(1.12);opacity:0}
}
@media(prefers-reduced-motion:reduce){.station-on-map.aqi-warning::after{display:none}}
.station-on-map.aqi-warning .station-marker,.station-on-map.aqi-warning .station-mini{z-index:1}
.station-on-map.is-selected{z-index:2}
.station-marker,.station-mini{pointer-events:auto}
.station-marker{
 display:flex;align-items:center;gap:6px;position:absolute;top:-39px;left:-16px;
 color:#0ba93f;border:0;background:none;padding:0;white-space:nowrap;
}
.station-marker.offline,.legend-pin.offline{color:#e52e2c}
.station-on-map.opens-left .station-marker{left:auto;right:-16px;flex-direction:row-reverse}
.map-pin{width:32px;height:40px;flex:none;filter:drop-shadow(0 2px 3px #143f3059)}
.legend-pin{width:22px;height:25px;flex:none;color:#0ba93f;filter:drop-shadow(0 1px 1px #143f303d)}
.station-label{
 max-width:144px;overflow:hidden;text-overflow:ellipsis;
 padding:5px 8px;border:1px solid #cfd9dc;border-radius:8px;
 background:#fff;box-shadow:0 2px 6px #223c4a26;color:#14213a;font-size:13px;font-weight:750;
}
.is-selected .station-label{border-color:#0ba93f}
.is-selected .offline .station-label{border-color:#e52e2c}
.station-mini{
 position:absolute;top:0;left:23px;width:var(--station-card-width);
 border:1px solid #cfd9dc;border-radius:13px;background:#fff;
 box-shadow:0 4px 13px #1b355333;padding:11px 12px;color:#14213a;
}
.opens-left .station-mini{left:auto;right:23px}
.mini-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(59px,auto);gap:7px;align-items:center}
.mini-readings{display:grid;gap:4px;line-height:1.25;font-size:12px;letter-spacing:-.02em}
.mini-reading{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.mini-reading svg{width:15px;height:15px;flex:none;color:#1e2d4b}
.aqi-mini{
 display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;
 border-radius:10px;color:#000;padding:6px 5px;font-weight:700;
 font-size:13px;min-height:76px;max-width:78px;
}
.aqi-mini strong{font-size:26px;line-height:1.1}
.aqi-mini.good{background:#00e400}
.aqi-mini.average{background:#ffff00}
.aqi-mini.poor{background:#ff7e00}
.aqi-mini.bad{background:#ff0000}
.aqi-mini.very-bad{background:#8f3f97;color:#fff}
.aqi-mini.hazardous{background:#7e0023;color:#fff}
.aqi-mini.unknown{background:#eff2f5;color:#52617e}
.mini-aqi-grade{font-size:11px;line-height:1.2;margin-top:3px}
.mini-position{
 display:flex;flex-wrap:wrap;gap:2px 7px;border-top:1px solid #e1e7ed;
 padding-top:7px;margin-top:8px;font-size:11px;color:#445569;
}
.mini-position>div{min-width:0;overflow-wrap:anywhere}

/* Line chart styling from the PZEM dashboard. */
.metric-icon{
 width:18px;height:18px;flex:none;fill:none;stroke:currentColor;
 stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
.metric-trigger{display:flex;align-items:center;cursor:pointer;font-family:inherit;color:var(--ink)}
.metric-trigger::-webkit-details-marker{display:none}
.metric-trigger:focus-visible{outline:3px solid #24b47a;outline-offset:3px}
.metric-trigger .filter-icon{width:23px;height:23px}
#metric-current{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metric-picker[open]:after{transform:rotate(225deg);top:51%}
.metric-options{
 position:absolute;top:calc(100% + 5px);left:0;z-index:5;min-width:100%;width:max-content;
 padding:5px;border:1px solid #cdd7e7;border-radius:10px;background:#fff;box-shadow:0 4px 14px #172a4833;
}
.metric-options button{
 display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 9px;
 border:0;border-radius:6px;background:transparent;color:var(--ink);font-size:14px;
}
.metric-options button[aria-pressed="true"],.metric-options button:hover{background:#edf4ff}
.live-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.live-heading select{font:inherit;padding:5px 8px;border:1px solid #bbc8d6;border-radius:6px}
.chart-frame{
 display:flex;flex:1;min-height:0;flex-direction:column;margin-top:6px;padding:9px 11px 0;
 border:1px solid rgba(15,23,42,.10);border-radius:9px;background:rgba(255,255,255,.84);
}
.chart-wrapper{margin-top:4px}
#chart-legend{
 display:flex;flex-wrap:wrap;align-items:center;justify-content:center;
 gap:5px 16px;color:#334155;font-size:13px;line-height:1.25;
}
#chart-legend span{display:inline-flex;align-items:center;gap:6px}
#chart-legend .metric-icon,.chart-tooltip .metric-icon{width:15px;height:15px}
#chart-legend .gap-key{display:inline-block;flex:none;width:17px;border-top:2px dashed #64748b}
.chart-tooltip{
 position:absolute;z-index:2;max-width:100%;border-radius:6px;padding:8px 10px;
 background:rgba(255,255,255,.98);color:#334155;border:1px solid rgba(15,23,42,.14);
 font-size:12px;pointer-events:none;box-shadow:0 3px 8px #0f172a17;
}
.chart-tooltip>strong{display:block;color:#0f172a;margin-bottom:4px}
.chart-tooltip>span{display:flex;align-items:center;gap:6px}
@media(max-width:680px){
 .metric-trigger .filter-icon{width:16px;height:16px}
 .metric-options button{font-size:12px}
 .station-label{max-width:110px;font-size:11px}
 .station-mini{padding:9px}
 .mini-readings{font-size:11px}
 .chart-frame{padding:7px 4px 0}
 #chart-legend{gap:4px 9px;font-size:11px}
}

.map-status{position:absolute;top:22px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 150px);padding:8px 12px;border-radius:8px;background:#fff;color:#334155;text-align:center;pointer-events:none}
