/* Surface hierarchy is shared by every portal screen; the brand artwork stays unchanged. */
html[data-theme]{--canvas:#edf3ec;--surface:#ffffff;--soft:#e3eddf;--ink:#203b2d;--muted:#526c59;--line:#c9d8c6;--accent:#285b40;--accent-ink:#fff;--deep:#193e31;--deep-ink:#f4faef;--deep-muted:#c0d6c3;--highlight:#b9d69b;--chart:#337b54;--chart2:#3e7c96;--chart3:#ad722c;--chart4:#8661a3;--chart5:#b9574e;--shadow:0 10px 30px #193e3108;color-scheme:light}
html[data-theme=night]{--canvas:#101b27;--surface:#192939;--soft:#21374a;--ink:#edf6ff;--muted:#b5c9d9;--line:#3c566d;--accent:#8ce2e4;--accent-ink:#112c35;--deep:#09131e;--deep-ink:#f1f8ff;--deep-muted:#b0c5d8;--highlight:#8ce2e4;--chart:#8ce2e4;--chart2:#91b8ff;--chart3:#f1bf7e;--chart4:#c7a6ed;--chart5:#f3a29c;--shadow:0 10px 30px #00000018;color-scheme:dark}
html[data-theme=mineral]{--canvas:#f6f1e9;--surface:#fffdf8;--soft:#efe4d5;--ink:#49362c;--muted:#77604f;--line:#dac9b7;--accent:#94472e;--accent-ink:#fffaf2;--deep:#3e302b;--deep-ink:#fff8ea;--deep-muted:#dbc6b3;--highlight:#f2c698;--chart:#a55033;--chart2:#397d85;--chart3:#ac7b22;--chart4:#8569a4;--chart5:#b35169;--shadow:0 10px 30px #52372208;color-scheme:light}
html[data-theme] body{background:var(--canvas);color:var(--ink)}
html[data-theme] :is(button,a,input,select,summary):focus-visible{outline:3px solid var(--chart);outline-offset:3px}
html[data-theme] :is(.login-side,.dashboard-body,.dashboard-content){background:var(--canvas);color:var(--ink)}
html[data-theme] .intro{background:var(--deep);color:var(--deep-ink)}
html[data-theme] .intro h1>span{color:var(--highlight)}
html[data-theme] .intro :is(.eyebrow,.intro-content>p,.intro-features,.intro-footer,.intro-footer>span){color:var(--deep-muted)}
html[data-theme] .login-top{gap:14px;flex-wrap:wrap;border-color:var(--line)}
html[data-theme] .login-top .portal-label{margin-inline-end:auto}
html[data-theme] .login-side :is(.portal-heading p,.form-description,.login-footer,.simulation-note,.forgot-password,.remember-option small,.demo-credentials,.muted){color:var(--muted)}
html[data-theme] :is(.portal-heading h2,.customer-login h2,.demo-entry-heading h2,.demo-facility-copy strong){color:var(--ink)}
html[data-theme] :is(input,select){background-color:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] input::placeholder{color:var(--muted);opacity:1}
html[data-theme] .language-picker{background:var(--surface);border-color:var(--line);color:var(--ink);min-height:44px}
html[data-theme] .language-picker select{background:var(--surface);color:var(--ink)}
html[data-theme] :is(.demo-toggle,.demo-facility-card,.demo-help,.install-dialog,.install-reminder,.pwa-notice){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] :is(.demo-toggle small,.demo-facility-copy small,.demo-help p,.install-description,.install-footnote,.install-message){color:var(--muted)}
html[data-theme] :is(.demo-card-action,.forgot-password:hover,.demo-credentials b){color:var(--accent)}
html[data-theme] .primary-button{background:var(--accent);color:var(--accent-ink)}
html[data-theme] .primary-button:hover{filter:brightness(.92)}
html[data-theme] :is(.demo-badge,.demo-banner,.login-icon){background:var(--soft);color:var(--ink);border-color:var(--line)}
html[data-theme] .dashboard .sidebar{background:var(--deep);color:var(--deep-ink);border-color:var(--deep)}
html[data-theme] .dashboard .sidebar :is(.brand,.sidebar-bottom>button){color:var(--deep-ink)}
html[data-theme] .dashboard .sidebar :is(.workspace-label,.sidebar-bottom p){color:var(--deep-muted)}
html[data-theme] .dashboard .sidebar>nav{background:var(--deep);border-color:var(--line)}
html[data-theme] .dashboard .sidebar>nav button{color:var(--deep-muted);min-height:44px}
html[data-theme] .dashboard .sidebar>nav button:hover{background:#ffffff12;color:var(--deep-ink)}
html[data-theme] .dashboard .sidebar>nav button.active{background:var(--highlight);color:var(--deep);font-weight:750}
html[data-theme] .dashboard .topbar{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .topbar-actions{gap:12px;flex-wrap:wrap}
html[data-theme] :is(.facility-identity summary,.facility-identity summary strong,.facility-details strong,.facility-details-label){color:var(--ink)}
html[data-theme] :is(.facility-identity summary small,.facility-details small,.identity-label){color:var(--muted)}
html[data-theme] .facility-details{background:var(--surface);border-color:var(--line);color:var(--ink);box-shadow:var(--shadow)}
html[data-theme] .topbar-logout{background:var(--soft);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.metric,.panel){background:var(--surface);border-color:var(--line);box-shadow:var(--shadow);color:var(--ink)}
html[data-theme] .metrics>.metric:first-child{background:var(--deep);border-color:var(--deep);color:var(--deep-ink)}
html[data-theme] .metrics>.metric:first-child :is(span,small,svg,.working){color:var(--deep-muted)}
html[data-theme] .metrics>.metric:first-child .working{color:var(--highlight)}
html[data-theme] :is(.metric>span,.metric small,.metric em,.panel-heading p,.chart-live,.chart-footer,.dashboard-footer,.page-heading p){color:var(--muted)}
html[data-theme] :is(.metric>span svg,.panel-heading>svg){color:var(--chart)}
html[data-theme] :is(.chart-footer,.panel-heading,.alarm-row){border-color:var(--line)}
html[data-theme] :is(th,.report-period){background:var(--soft);color:var(--ink);border-color:var(--line)}
html[data-theme] td{border-color:var(--line);color:var(--ink)}
html[data-theme] :is(td small,.record-time small,.record-id,.alarm-row small,.alarm-row time){color:var(--muted)}
html[data-theme] :is(.complete,.resolved,.alarm-icon){background:var(--soft);color:var(--accent)}
html[data-theme] .alarm-row strong{color:var(--ink)}
html[data-theme] .production-page{color:var(--ink);--report-accent:var(--accent)}
html[data-theme] :is(.report-intro p,.report-section-heading p,.report-legend li,.report-unit,.report-auto-group,.concrete-source){color:var(--muted)}
html[data-theme] :is(.report-filters label,.report-chart-controls label,.date-filter-fields label){color:var(--ink)}
html[data-theme] :is(.report-button,.date-presets button,.date-picker-toggle,.pagination button,.report-reset,.report-chart-controls button){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] :is(.report-button,.date-presets button,.date-picker-toggle,.pagination button,.report-reset):hover{background:var(--soft);border-color:var(--accent)}
html[data-theme] :is(.date-presets button.selected,.report-chart-controls button.active){background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
html[data-theme] :is(.report-filters select,.report-chart-controls select,.report-filters input,.date-filter-fields input){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.report-auto-group strong,.concrete-material-card,.concrete-record-detail){background:var(--soft);border-color:var(--line);color:var(--ink)}
html[data-theme] :is(.concrete-material-card h3,.concrete-material-card p,.concrete-consumed,.concrete-record-body,.chart-data summary,.pagination){color:var(--ink)}
html[data-theme] .recharts-cartesian-axis-tick-value{fill:var(--muted)}
html[data-theme] .recharts-cartesian-grid line{stroke:var(--line)}
html[data-theme] .recharts-default-tooltip{background:var(--surface)!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme] .recharts-tooltip-label{color:var(--ink)}
html[data-theme] .recharts-tooltip-cursor{fill:var(--soft);fill-opacity:.65}
html[data-theme] .login-side .brand{color:var(--ink)}
html[data-theme] .login-top{color:var(--muted)}
html[data-theme] .intro .mini-reading em{color:var(--deep-muted)}
html[data-theme] .production-page tfoot{background:var(--soft);color:var(--ink)}
html[data-theme] :is(.report-raw-toolbar p,.report-raw>summary small,.concrete-source dt,.concrete-detail-empty){color:var(--muted)}
html[data-theme] :is(.concrete-record-detail>summary,.concrete-source dd){color:var(--ink)}
html[data-theme] .concrete-record-body{background:var(--surface);border-color:var(--line)}
html[data-theme] .chart-data th[scope=row],html[data-theme] .production-page .concrete-detail-scroll th[scope=row]{background:var(--surface);color:var(--ink)}
html[data-theme] :is(.report-raw>summary,.concrete-record-detail>summary,.chart-data summary):hover{background:var(--soft)}
html[data-theme] .report-summary .metric{border-top-color:var(--line)}
html[data-theme] .report-summary .metric strong{color:var(--ink)}
html[data-theme] .report-summary .metric :is(span,small){color:var(--muted)}
html[data-theme] .report-summary .metric:first-child{background:var(--deep);border-color:var(--deep);border-top-color:var(--highlight)}
html[data-theme] .report-summary .metric:first-child strong{color:var(--highlight)}
html[data-theme] .report-summary .metric:first-child :is(span,small){color:var(--deep-muted)}
html[data-theme] .report-chart-panel .panel-heading h2{color:var(--ink)}
html[data-theme] .report-chart-panel .panel-heading p{color:var(--muted)}
html[data-theme] .report-unit{background:var(--soft);color:var(--ink)}
html[data-theme] :is(.install-control>button,.install-help-button,.install-reminder-action,.install-done){background:var(--soft);color:var(--ink);border-color:var(--line)}
.page-display-controls{display:flex;gap:10px;align-items:center}
@media(max-width:760px){
 html[data-theme] .page-heading{flex-wrap:wrap}
 html[data-theme] .page-display-controls{margin-inline-start:auto}
 html[data-theme] .dashboard-header{background:var(--deep);color:var(--deep-ink)}
 html[data-theme] .dashboard .sidebar>.brand{color:var(--deep-ink)}
 html[data-theme] .dashboard .sidebar>nav{background:var(--deep)}
 html[data-theme] .dashboard .dashboard-body>.dashboard-content{background:var(--canvas)}
 html[data-theme] .dashboard .topbar .facility-identity{background:#234a39;border:1px solid #40634e;border-radius:10px;margin-block:0 8px;color:var(--deep-ink)}
 html[data-theme] .dashboard .topbar .facility-identity>summary{padding:9px 36px 9px 12px;padding-inline:12px 36px;min-height:60px}
 html[data-theme] .dashboard .topbar .facility-identity>summary:focus-visible{outline-color:var(--highlight)}
 html[data-theme] .dashboard .topbar .facility-identity summary strong{color:var(--deep-ink)}
 html[data-theme] .dashboard .topbar .facility-identity :is(summary small,.facility-details-label){color:var(--deep-muted)}
 html[data-theme] .dashboard .topbar .facility-identity .facility-details-label{inset-inline-end:13px}
 html[data-theme] .dashboard .topbar .facility-details{background:#234a39;border-color:#40634e;box-shadow:none}
 html[data-theme] .dashboard .topbar .facility-details strong{color:var(--deep-ink)}
 html[data-theme] .dashboard .topbar .facility-details :is(small,.identity-label){color:var(--deep-muted)}
 html[data-theme] .topbar-actions{gap:6px}
 html[data-theme] .dashboard .topbar-actions .language-picker{padding:4px;min-height:44px}
 html[data-theme] .dashboard .topbar-actions .language-picker select{max-width:72px}
 html[data-theme] .login-top{gap:8px;flex-wrap:nowrap}
 html[data-theme] .login-top .mobile-brand{min-width:0}
 html[data-theme] .login-top .brand{font-size:22px;gap:6px}
 html[data-theme] .login-top .brand-symbol{width:31px;height:31px}
 html[data-theme] .login-top .brand-sub{letter-spacing:1.6px}
}
@media(max-width:360px){html[data-theme] .login-top .brand{font-size:18px}html[data-theme] .login-top .brand-symbol{width:27px;height:27px}html[data-theme] .login-top .language-picker svg{display:none}html[data-theme] .login-top .language-picker select{max-width:64px}}
@media print{html[data-theme] body,html[data-theme] .dashboard,html[data-theme] .dashboard-content{background:white;color:#203b2d}}
