/* Semantic overrides shared by the shell, login and retained workspace pages. */
html[data-theme="dark"], html[data-theme="dark"] body {
  color-scheme: dark;
  --bg: #101820;
  --panel: #18232e;
  --panel-border: #354555;
  --line: #354555;
  --text: #d0dbe7;
  --ink: #d0dbe7;
  --muted: #a8b8ca;
  --green: #8fbce5;
  --cyan: #8fbce5;
  --orange: #e4b073;
  --red: #f18c9a;
  --focus: #8fbce5;
  --soft: #202e3c;
  --brand-blue: #8fbce5;
  --surface: #18232e;
  --surface-soft: #202e3c;
  --surface-hover: #293b4c;
  --surface-stage: #111d28;
  --surface-glass: #18232ee8;
  --surface-red: #3b2832;
  --surface-green: #20392f;
  --surface-warning: #3b3226;
  --text-heading: #f0f4fa;
  --text-body: #d0dbe7;
  --text-secondary: #a8b8ca;
  --text-quiet: #96a9bf;
  --text-link: #8fbce5;
  --text-danger: #f18c9a;
  --text-success: #91d5b0;
  --text-warning: #e9be85;
  --border: #354555;
  --border-strong: #526b80;
  --chart-grid: #354555;
  --chart-text: #a5b5c5;
  --chart-temp: #f18c9a;
  --chart-humidity: #8fbce5;
  --chart-temp-secondary: #e4b073;
  --chart-humidity-secondary: #b0a9e5;
}

.theme-picker {display:inline-flex;align-items:center;gap:6px;flex-shrink:0;color:var(--muted,#657487);font-size:12px}
.theme-picker>span {display:flex;align-items:center}
body .theme-picker select {width:auto;min-height:34px;padding:5px 6px;max-width:112px;border:1px solid var(--border,#dce2e9);background:var(--surface,#fff);color:var(--text-heading,#25384a);font-size:12px;cursor:pointer;border-radius:4px}
.app-topbar>.theme-picker {margin-left:auto}
.app-topbar>.theme-picker+.workspace-account {margin-left:0}
.auth-access {position:relative}
.auth-access>.theme-picker {position:absolute;top:20px;right:24px}
html[data-theme="dark"] body {background:var(--bg);color:var(--text)}
html[data-theme="dark"] :is(input,select,textarea,button):focus-visible {outline-color:var(--focus)}
html[data-theme="dark"] :is(input,select,textarea) {accent-color:var(--focus)}
html[data-theme="dark"] :is(dialog,.account-notice) {background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme="dark"] dialog::backdrop {background:#030a12b3}
html[data-theme="dark"] .directory-building {background:var(--surface)!important}
html[data-theme="dark"] .directory-building.active {background:var(--surface-red)!important}
html[data-theme="dark"] .pairing-node[aria-pressed="true"] {background:var(--surface-red)!important}
html[data-theme="dark"] .pairing-badge {color:var(--muted)!important}
html[data-theme="dark"] .pairing-badge.online {color:var(--text-success)!important}
html[data-theme="dark"] .floor-buttons button[aria-pressed="true"] {background:#244e75;color:#fff}
html[data-theme="dark"] :is(.account-state,.access-pill) {background:var(--surface-green);color:var(--text-success)}
html[data-theme="dark"] .account-state.disabled {background:var(--surface-red);color:var(--text-danger)}
html[data-theme="dark"] .monitor-body .metric-value strong {color:var(--text-heading)}
html[data-theme="dark"] .monitor-body .metric-head {color:var(--text-secondary)}
html[data-theme="dark"] .monitor-body .comfort-value {color:var(--text-heading)}
html[data-theme="dark"] :is(.connection.offline,.naming-tag,.unnamed-count) {color:var(--text-warning);background:var(--surface-warning);border-color:#68543c}
html[data-theme="dark"] :is(.discovery-symbol,.handoff-symbol) {background:var(--surface-hover)}
html[data-theme="dark"] .theme-picker option {color:var(--text);background:var(--surface)}
html[data-theme="dark"] :is(.account-form label,.account-registry th,.account-caption) {color:var(--muted)}
html[data-theme="dark"] :is(.account-form input,.account-form select,.account-registry select) {background:var(--surface-soft);color:var(--text);border-color:var(--border)}
html[data-theme="dark"] .deployment-plan svg>rect {fill:var(--surface-stage)}
html[data-theme="dark"] .deployment-plan [data-room] polygon {fill:var(--surface);stroke:var(--border-strong)}
html[data-theme="dark"] .deployment-plan [data-room][aria-pressed="true"] polygon {fill:var(--surface-red);stroke:var(--text-danger)}
html[data-theme="dark"] .deployment-plan svg text {fill:var(--text-secondary)}
html[data-theme="dark"] :is(.temp-line,.s2-temp-line) {background:var(--chart-temp)}
html[data-theme="dark"] .humidity-line {background:var(--chart-humidity)}
html[data-theme="dark"] .s2-temp-line {background:var(--chart-temp-secondary)}
html[data-theme="dark"] .s2-humidity-line {background:var(--chart-humidity-secondary)}
@media(max-width:760px) {
  .app-topbar {gap:8px}
  .app-topbar>.theme-picker>span {display:none}
  body .app-topbar .theme-picker select {max-width:90px;padding:5px 2px;font-size:11px}
  .auth-access>.theme-picker {top:12px;right:16px}
}
@media(max-width:560px) {
  .app-layout .app-topbar {padding-inline:12px}
  .app-layout .app-topbar .app-page-context {display:none}
  .app-layout .app-topbar .workspace-logout {font-size:11px;padding-inline:4px}
}
