.appearance-settings{padding:24px;max-width:620px}
.appearance-settings label{display:block;font-size:14px;font-weight:700;margin-bottom:8px}
.appearance-settings select{width:100%;max-width:320px;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text)}
.appearance-settings p{font-size:13px;color:var(--muted);line-height:1.6}
.setup-tabs{flex-wrap:wrap}.setup-tabs button{white-space:nowrap}
@media screen {
  html[data-theme="dark"]{--bg:#0b1726;--panel:#122338;--text:#e5edf7;--muted:#abbdd2;--line:#30445c;--blue:#79b8ff;--blue-soft:#203d5d;--green:#69d6a2;--red:#ff959c;--shadow:0 8px 24px rgba(0,0,0,.18)}
  html[data-theme="dark"] :is(.tabs,.live-metrics>div,.power-live-metrics>div,.login-card){background:var(--panel)}
  html[data-theme="dark"] :is(.metric-card,.metric-card.green,.metric-card.red){background:#152b43;border-color:var(--line)}
  html[data-theme="dark"] .metric-card.green{background:#142f30;border-color:#35615a}
  html[data-theme="dark"] .metric-card.red{background:#362a36;border-color:#654452}
  html[data-theme="dark"] :is(.tenant-table th,.report-table thead th,.meter-subtotal td,.meter-subtotal th,.meter-group-row td,.setup-meter-title,.setup-routing,.login-footer,.system-badge,.setup-notice,.event-pill){background:#1b3048;color:var(--text);border-color:var(--line)}
  html[data-theme="dark"] .report-table tfoot th{background:#3b361f;color:#f2e3ad}
  html[data-theme="dark"] :is(.tenant-table th,.tenant-table td,.report-table th,.report-table td,.setup-meter,.setup-breaker,.local-user,.system-facts,.system-facts>div,.system-meter,.reading-fields){border-color:var(--line)}
  html[data-theme="dark"] :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background:#0e1e30;color:var(--text);border-color:var(--line)}
  html[data-theme="dark"] #loginUsername{background:#0e1e30}
  html[data-theme="dark"] :is(input,textarea)::placeholder{color:#96abc3;opacity:1}
  html[data-theme="dark"] :is(.secondary-button,.icon-button,.rate-save-button,.period-toggle,.period-toggle button,.range-buttons button,.report-mode-tabs button,.power-metric-toggle button){background:#1b3048;color:var(--text);border-color:var(--line)}
  html[data-theme="dark"] :is(.primary-button,.secondary-button.selected,.period-toggle button.active,.range-buttons button.active,.report-mode-tabs button.active,.power-metric-toggle button.active){background:#236dc2;border-color:#4b95e7;color:#fff}
  html[data-theme="dark"] :is(.secondary-button,.icon-button,.rate-save-button):hover{background:#294560}
  html[data-theme="dark"] :is(button,input,select,textarea,summary):focus-visible{outline:2px solid #91c6ff;outline-offset:3px}
  html[data-theme="dark"] :is(.tab-button,.metric-label,.control-group label,.rate-editor label,.billing-editor>label,.setup-fields label,.setup-user-form label,.setup-save span,.setup-help,.local-user span,.system-card p,.system-panel p,.system-facts span,.empty-state,.meter-test-result,.breaker-readings>summary,.report-coverage-note,.billing-period-status,.live-metrics span,.snapshot-eyebrow,.phase-group-title,.phase-values span,.snapshot-chart-block h3,.pf-direction,.quality-stat span,.power-live-metrics span,.power-snapshot-stats span,.weather-stats span,.ai-summary,.password-toggle){color:var(--muted)}
  html[data-theme="dark"] .tab-button.active{color:var(--blue)}
  html[data-theme="dark"] :is(.live-metrics strong,.phase-values strong,.pf-gauge-value,.quality-stat strong,.power-live-metrics strong,.power-snapshot-stats strong,.power-gauge-value,.weather-stats strong,.setup-meter-title h3){color:var(--text)}
  html[data-theme="dark"] :is(.system-card strong,.tenant-num){color:var(--blue)}
  html[data-theme="dark"] :is(.live-dot.online,.snapshot-status,.negative-change,.quality-stat .good,.setup-message){color:#7be0ac}
  html[data-theme="dark"] :is(.live-dot.online,.snapshot-status){background:#17392f;border-color:#356650}
  html[data-theme="dark"] :is(.snapshot-status.warning,.event-pill.sag,.event-pill.watch,.offline-note){background:#3b3021;color:#ffd28a;border-color:#695234}
  html[data-theme="dark"] :is(.global-message,.live-dot:not(.online),.event-pill.interruption,.event-pill.alarm){background:#3e2632;color:#ffb1b5;border-color:#6f4052}
  html[data-theme="dark"] :is(.positive-change,.setup-message.error,#activationMessage){color:#ff959c}
  html[data-theme="dark"] .event-pill.swell{background:#302f56;color:#c1bdff}
  html[data-theme="dark"] .snapshot-status.no-data{background:#20344a;color:var(--muted)}
  html[data-theme="dark"] .billing-editor{border-color:#35615a}
  html[data-theme="dark"] .password-toggle:hover{background:#294560}
  html[data-theme="dark"] #setupEmailPage :is(p,label){color:var(--muted)}
  html[data-theme="dark"] #setupEmailPage :is(input:not([type=checkbox]),select,textarea){background:#0e1e30;color:var(--text);border-color:var(--line)}
  html[data-theme="dark"] #setupEmailPage :is(.email-notice,th){background:#1b3048;color:var(--text)}
  html[data-theme="dark"] #setupEmailPage :is(.email-schedule,fieldset,th,td){border-color:var(--line)}
  html[data-theme="dark"] #setupEmailPage .email-status{color:#7be0ac}
  html[data-theme="dark"] #setupEmailPage .email-status.error{color:#ff959c}
}
/* Printing stays light regardless of the browser's saved screen appearance. */
@media print {html{color-scheme:light!important}}
