:root{
  --bg:#f4f7f6;--card:#ffffff;--text:#102a25;--muted:#64756f;--line:#dce6e2;
  --green:#0f6b55;--green2:#0d8a6a;--green3:#eaf6f1;--teal:#1f8f85;--amber:#c78625;
  --red:#b54747;--blue:#4569b2;--purple:#7a5aae;--shadow:0 10px 30px rgba(17,64,51,.07);
  --radius:14px;--max:1680px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);font-size:14px;line-height:1.45}
a{color:inherit}

/* Centered network identity only — no navigation strip. */
.topbar{position:sticky;top:0;z-index:100;background:linear-gradient(105deg,#0d6a52 0%,#0d7c60 50%,#148779 100%);color:white;box-shadow:0 2px 15px rgba(0,0,0,.12)}
.topbar-inner{max-width:var(--max);margin:auto;display:flex;align-items:center;justify-content:center;padding:18px 26px;position:relative;min-height:76px}
.brand{display:flex;align-items:center;justify-content:center;gap:12px;text-decoration:none;font-size:23px;letter-spacing:-.3px;text-align:center}
.brand-light{font-weight:300}.brand-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.14);font-size:22px;border:1px solid rgba(255,255,255,.22)}
.topbar-controls{position:absolute;right:26px;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:8px}
.unit-switch{display:inline-flex;padding:2px;border:1px solid rgba(255,255,255,.28);border-radius:9px;background:rgba(255,255,255,.10);backdrop-filter:blur(6px)}
.unit-button{border:0;background:transparent;color:rgba(255,255,255,.82);font:inherit;font-size:11px;font-weight:750;padding:7px 10px;border-radius:7px;cursor:pointer}.unit-button:hover{background:rgba(255,255,255,.10)}.unit-button.active{background:white;color:var(--green);box-shadow:0 1px 3px rgba(0,0,0,.15)}
.system-status-button{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.28);border-radius:9px;background:rgba(255,255,255,.10);color:white;padding:8px 10px;font:inherit;font-size:11px;font-weight:750;cursor:pointer}.system-status-button:hover{background:rgba(255,255,255,.16)}
.status-dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:#a9b5b1;box-shadow:0 0 0 3px rgba(255,255,255,.08)}.status-dot.ok{background:#79e0b7}.status-dot.warn{background:#ffd166}.status-dot.error{background:#ff8585}
.system-status-panel{position:absolute;right:26px;top:calc(100% + 8px);width:min(430px,calc(100vw - 32px));background:white;color:var(--text);border:1px solid #d8e3df;border-radius:12px;box-shadow:0 18px 50px rgba(0,0,0,.2);padding:14px;z-index:200}
.status-panel-head{display:flex;align-items:center;justify-content:space-between;padding-bottom:9px;border-bottom:1px solid #e7eeeb}.status-panel-head strong{font-size:14px}.status-close{border:0;background:transparent;color:#667a73;font-size:20px;line-height:1;cursor:pointer}.status-panel-body{padding:10px 0;font-size:12px;color:#50665f}.status-summary{display:grid;grid-template-columns:1fr auto;gap:6px 12px;padding:5px 0}.status-summary strong{color:#23483e}.status-issues{margin:8px 0 0;padding:0;list-style:none}.status-issues li{margin:6px 0;padding:8px 9px;border-radius:8px;background:#fff4e7;color:#7a5420}.status-issues li.error{background:#fff0f0;color:#8c3434}.admin-log-link{display:block;border-top:1px solid #e7eeeb;padding-top:10px;color:var(--green);font-size:11px;font-weight:700;text-decoration:none}.admin-log-link:hover{text-decoration:underline}

main{max-width:var(--max);margin:auto;padding:24px 26px 28px}
.app-alert{border:1px solid #efc8c8;background:#fff0f0;color:#8c3434;border-radius:10px;padding:10px 13px;margin-bottom:16px;font-size:12px}
.eyebrow{margin:0;color:#3e786a;font-size:10px;letter-spacing:.16em;font-weight:800}
.helper{color:var(--muted);font-size:11px}

.top-grid{display:grid;grid-template-columns:minmax(360px,4fr) minmax(680px,8fr);gap:20px;margin-bottom:20px}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 20px 13px}
.card-head h2{margin:3px 0 0;font-size:18px;letter-spacing:-.25px}
.actions{display:flex;gap:8px;align-items:center}
.button,.icon-button,.text-button,.mode-button{font:inherit;cursor:pointer}
.button{border:1px solid #c9d9d3;background:var(--green);color:white;border-radius:8px;padding:8px 12px;font-weight:650;font-size:12px}
.button:hover{background:#0a5b48}.button.secondary{background:white;color:var(--green)}.button.secondary:hover{background:#f1f7f4}
.icon-button{width:34px;height:34px;border:1px solid #d0ddd8;border-radius:8px;background:white;color:#35584e}.icon-button:hover{background:#f1f6f4}
.text-button{border:0;background:transparent;color:var(--green);font-weight:750;font-size:11px;padding:4px 0}.text-button:hover{text-decoration:underline}

/* Map */
.map-card{min-height:510px;display:flex;flex-direction:column}
.map{height:425px;min-height:425px;width:100%;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:#edf2f0}
.map-fallback{height:425px;position:relative;background:linear-gradient(#f3f7f5,#e9f1ee);border-top:1px solid var(--line);border-bottom:1px solid var(--line);overflow:hidden}
.map-fallback:before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(18,87,67,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(18,87,67,.045) 1px,transparent 1px);background-size:44px 44px}
.fallback-dot{position:absolute;transform:translate(-50%,-50%);width:18px;height:18px;border-radius:50%;border:3px solid white;box-shadow:0 2px 8px rgba(0,0,0,.25);cursor:pointer}
.fallback-label{position:absolute;transform:translate(-50%,12px);white-space:nowrap;background:white;border:1px solid var(--line);border-radius:6px;padding:3px 6px;font-size:10px;box-shadow:0 2px 10px rgba(0,0,0,.08)}
.map-card>.helper{padding:0 20px 16px;margin:12px 0 0}
.maplibregl-map{font-family:inherit}.maplibregl-popup-content{border:1px solid #d5e2dd;border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.1);padding:8px 10px}
.map-marker{width:20px;height:20px;border-radius:50%;border:3px solid white;background:var(--marker-color,#0f6b55);box-shadow:0 2px 8px rgba(0,0,0,.3);cursor:pointer;transition:transform .15s ease}.map-marker.active{transform:scale(1.25);box-shadow:0 0 0 4px rgba(15,107,85,.16),0 3px 10px rgba(0,0,0,.28)}

/* Station summary */
.summary-card{min-width:0}.summary-head{padding-bottom:8px}.table-wrap{overflow:auto}.summary-table-wrap{max-height:390px}
.data-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.data-table th{position:sticky;top:0;background:#f6f9f8;color:#526a62;text-align:left;font-weight:700;padding:11px 12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:nowrap;z-index:2}
.data-table th small{font-weight:500;color:#7b8d87}.data-table th[data-sort]{cursor:pointer}
.data-table td{padding:13px 12px;border-bottom:1px solid #edf1ef;vertical-align:middle}.data-table tr[data-id]{cursor:pointer}.data-table tbody tr:hover{background:#f8fbfa}.data-table tbody tr.selected{background:#eef8f4}.data-table tbody tr.selected td:first-child{box-shadow:inset 4px 0 var(--station-color,#14745b)}
.station-name{display:flex;align-items:center;gap:9px;font-weight:700;color:#143b31}.swatch{width:10px;height:10px;border-radius:50%;flex:none}.subline{display:block;color:#7a8b85;font-size:10px;margin-top:3px;padding-left:19px}.delta{display:inline-flex;align-items:center;gap:3px;font-weight:650}.delta.up{color:#20825f}.delta.down{color:#b45151}.delta.flat{color:#71827c}.sort{font-size:10px;color:#71827c}
.selection-row{display:flex;gap:10px;align-items:flex-start;padding:14px 18px 18px;font-size:11px;color:var(--muted);border-top:1px solid #edf2f0}.chips{display:flex;gap:7px;flex-wrap:wrap}.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid #d4e2dd;border-radius:999px;padding:4px 8px;background:#f8fbfa;color:#2f4b43;font-weight:650}.chip button{border:0;background:none;cursor:pointer;color:inherit;padding:0;line-height:1}

/* Charts */
.charts-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.chart-card{min-width:0}.chart-card.fullscreen{position:fixed;z-index:500;inset:12px;overflow:auto;box-shadow:0 20px 80px rgba(0,0,0,.28)}.chart-card.fullscreen .chart{height:calc(100vh - 250px);min-height:540px}
.chart-toolbar{display:grid;grid-template-columns:auto 1.05fr .95fr .95fr;gap:10px;padding:0 18px 10px;align-items:end}.chart-toolbar.ka-toolbar{grid-template-columns:auto 1fr}
.chart-toolbar label{display:flex;flex-direction:column;gap:4px;color:#697b75;font-size:10px;font-weight:700}.chart-toolbar select,.chart-toolbar input{width:100%;border:1px solid #cedbd6;border-radius:7px;background:white;color:#29463e;padding:7px 8px;font:inherit;font-size:11px;min-height:34px}
.toolbar-group{display:flex;flex-direction:column;gap:4px}.toolbar-label{color:#697b75;font-size:10px;font-weight:700}
.segmented{display:inline-flex;border:1px solid #cbdad4;background:#f8fbfa;border-radius:8px;padding:2px;min-height:34px}
.mode-button{border:0;background:transparent;color:#557067;border-radius:6px;padding:6px 14px;font-size:11px;font-weight:750;min-width:62px}.mode-button:hover{background:#edf5f2}.mode-button.active{background:var(--green);color:white;box-shadow:0 1px 3px rgba(15,107,85,.18)}
.inline-stat{border:1px solid #d7e2de;border-radius:8px;padding:7px 11px;display:flex;justify-content:space-between;align-items:center;color:#6f817b;font-size:10px;min-height:34px}.inline-stat strong{color:#28483f;font-size:11px}
.chart-options{display:flex;flex-wrap:wrap;gap:15px;align-items:center;padding:0 18px 9px;font-size:11px;color:#5d716a}.chart-options label{display:flex;align-items:center;gap:6px}
.legend{display:flex;gap:12px;flex-wrap:wrap;padding:0 18px 7px;min-height:25px;font-size:10px;color:#51665f}.legend-item{display:flex;align-items:center;gap:5px}.legend-line{width:18px;height:3px;border-radius:2px}.legend-dash{width:18px;border-top:2px dashed currentColor}.legend-forecast{width:18px;border-top:3px dotted currentColor}
.chart{height:430px;padding:0 8px 2px;position:relative;min-width:0}.chart svg{display:block;width:100%;height:100%;overflow:visible}.chart-empty{height:100%;display:grid;place-items:center;text-align:center;color:#70827b;padding:30px}.chart-empty strong{display:block;color:#345349;margin-bottom:5px}.chart-note{padding:0 18px 15px;margin:3px 0 0}.chart-tooltip{position:fixed;z-index:9999;pointer-events:none;background:#173c33;color:white;border-radius:7px;padding:7px 9px;font-size:10px;box-shadow:0 4px 16px rgba(0,0,0,.25);max-width:240px;display:none}
.axis-label{font-size:10px;fill:#72847e}.axis-section-label{font-size:10px;fill:#35584e;font-weight:800;letter-spacing:.04em}.forecast-section-label{fill:#1f7a5f}.grid-line{stroke:#e5ece9;stroke-width:1}.axis-line{stroke:#bac9c4;stroke-width:1}.forecast-divider{stroke:#85a99d;stroke-width:1.3;stroke-dasharray:4 4}.forecast-zone{fill:#f0f8f4}.data-line{fill:none;stroke-width:2.3;stroke-linejoin:round;stroke-linecap:round}.forecast-line{fill:none;stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:6 4}.data-point{stroke:white;stroke-width:1.3}.data-point.estimated{fill:white;stroke-width:2}.forecast-point{fill:white;stroke-width:2.1}.bar{opacity:.82}.estimated-bar{opacity:.58;stroke:#5d716a;stroke-width:.6;stroke-dasharray:2 2}.forecast-bar{opacity:.66;stroke:#285f50;stroke-width:.8;stroke-dasharray:3 2}.ref-bar{opacity:.58;stroke:#2b7466;stroke-width:.7}.ref-line{stroke-dasharray:6 4;stroke-width:1.9;fill:none}

/* Forecast table — chart is intentionally integrated into the two main figures above. */
.forecast-section{margin-top:20px}.forecast-head{padding-bottom:10px}.forecast-controls{display:grid;grid-template-columns:1.4fr 1.1fr .7fr .9fr;gap:10px;padding:0 18px 12px}.forecast-controls label{display:flex;flex-direction:column;gap:4px;color:#697b75;font-size:10px;font-weight:700}.forecast-controls select,.forecast-controls input{width:100%;border:1px solid #cedbd6;border-radius:7px;background:white;color:#29463e;padding:7px 8px;font:inherit;font-size:11px;min-height:34px}.forecast-controls input:disabled{background:#f3f7f5;color:#526a62}.forecast-source{font-size:10px;color:#72847e}.forecast-table-wrap{padding:0 18px 12px}.forecast-table-wrap .data-table{min-width:650px}.compact-table td{padding-top:11px;padding-bottom:11px}

/* Centered permissions footer. */
.site-footer{max-width:none;margin:24px 0 0;padding:22px 28px 30px;border-top:1px solid #dbe5e1;background:#f1f3f4;color:#5f756d;font-size:12.5px;line-height:1.5;text-align:center}.footer-permissions{max-width:1100px;margin:0 auto}.site-footer strong{display:block;font-size:14px;color:#35584e;margin-bottom:4px}.site-footer p{margin:4px 0}.site-footer a{color:#0b8c6e}
.muted{color:#73847f}.nowrap{white-space:nowrap}

@media(max-width:1180px){.top-grid{grid-template-columns:1fr}.charts-grid{grid-template-columns:1fr}.map-card{min-height:auto}.map{height:380px;min-height:380px}.summary-table-wrap{max-height:none}.chart{height:440px}.forecast-controls{grid-template-columns:1fr 1fr}}
@media(max-width:760px){body{font-size:13px}.topbar-inner{padding:12px 12px 58px;min-height:108px}.brand{font-size:18px}.brand-icon{width:34px;height:34px}.topbar-controls{right:50%;top:auto;bottom:10px;transform:translateX(50%);width:max-content}.system-status-panel{right:16px;top:calc(100% + 6px)}main{padding:16px}.card-head{padding:15px}.top-grid,.charts-grid{gap:14px}.chart-toolbar{grid-template-columns:1fr 1fr;padding:0 14px 10px}.chart-toolbar.ka-toolbar{grid-template-columns:1fr}.toolbar-group{grid-column:1/-1}.chart-options,.legend{padding-left:14px;padding-right:14px}.chart{height:370px}.map,.map-fallback{height:330px;min-height:330px}.summary-head{align-items:flex-start;flex-direction:column}.actions{width:100%}.summary-head .actions .button{flex:1}.selection-row{flex-direction:column}.forecast-controls{grid-template-columns:1fr}.forecast-table-wrap{padding-left:14px;padding-right:14px}.site-footer{padding:20px 18px 26px;font-size:12px}.data-table{min-width:760px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
