/* Midnight: an additive skin; the existing light interface remains available. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6edf7; --muted: #9aacbf; --accent: #5ee0cc;
  --surface: #0b1220; --border: #26354a; --nav: #111e30;
  --night-panel: #121e2e; --night-raised: #19283b;
  --bs-body-color: var(--ink); --bs-body-bg: var(--surface);
  --bs-secondary-color: var(--muted); --bs-border-color: var(--border);
  --bs-link-color: var(--accent); --bs-link-hover-color: #a4f4e5;
}
.theme-toggle {flex-shrink:0}
.theme-toggle svg {width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-sun {display:none}
html[data-theme="dark"] .theme-sun {display:block}
html[data-theme="dark"] .theme-moon {display:none}
.auth-theme-toggle {position:fixed;right:20px;top:20px;z-index:5}
html[data-theme="dark"] body {background:var(--surface);color:var(--ink)}
html[data-theme="dark"] a {color:var(--accent)}
html[data-theme="dark"] :is(.panel,.stat-card,.auth-card,.machine-card,.remote-launcher,.recent-launch,.connection-notice,.dock-tools-menu) {background:var(--night-panel);border-color:var(--border);box-shadow:0 12px 36px #00000018}
html[data-theme="dark"] .topbar {background:#0f1929;border-color:var(--border)}
html[data-theme="dark"] :is(.topbar-brand,.device-name,.launch-machine-name strong,.workspace-empty h2,.launcher-empty h3,.client-metrics strong,.user-tools span) {color:var(--ink)}
html[data-theme="dark"] :is(.topbar-brand strong span,.machine-client,.machine-specs,.machine-id,.machine-id strong,.machine-footer,.launcher-results-heading,.results-caption,.section-heading span,.stat-card>span,.launcher-note,.manual-entry a,.activity-disclosure summary,.activity-disclosure summary span,.launch-machine-name>span,.recent-empty) {color:var(--muted)}
html[data-theme="dark"] :is(input,textarea,select,.form-control,.form-select,.search-field,.home-search,.launcher-search) {background:#0e1929;color:var(--ink);border-color:#35475f}
html[data-theme="dark"] :is(.search-field,.home-search,.launcher-search) input {background:transparent}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder {color:#90a3bb;opacity:1}
html[data-theme="dark"] :is(input,textarea,select):focus {outline:2px solid var(--accent);outline-offset:2px}
html[data-theme="dark"] :is(a,button,summary):focus-visible {outline:2px solid var(--accent);outline-offset:4px}
html[data-theme="dark"] :is(.btn-primary,.connect-button) {background:#5ee0cc;border-color:#5ee0cc;color:#08251f;box-shadow:0 3px 12px #5ee0cc16;font-weight:650}
html[data-theme="dark"] :is(.btn-primary,.connect-button):hover {background:#8aebdb;border-color:#8aebdb;color:#08251f}
html[data-theme="dark"] .btn-outline-primary {color:var(--accent);border-color:#397b78;background:transparent}
html[data-theme="dark"] .btn-outline-primary:hover {background:#193b3e;color:#b6fff0}
html[data-theme="dark"] :is(.btn-outline-secondary,.btn-light,.btn-secondary) {color:#c0ccdc;background:var(--night-raised);border-color:#3a4c65}
html[data-theme="dark"] :is(.btn-danger,.btn-outline-danger) {color:#ffb5bf;background:#421f31;border-color:#854157}
html[data-theme="dark"] .icon-button {color:#a9bed6;background:transparent}
html[data-theme="dark"] .icon-button:hover {color:#e6fff9;background:#22374b}
html[data-theme="dark"] :is(.brand-icon,.user-avatar,.client-avatar,.notice-symbol) {background:#1a3c41;color:#85f0dc}
html[data-theme="dark"] .launcher-intro {background:linear-gradient(145deg,#183b4b,#112536);border-right:1px solid var(--border)}
html[data-theme="dark"] .launcher-intro :is(.eyebrow,.launcher-scope) {color:#99dbd9}
html[data-theme="dark"] .launcher-intro>p:not(.eyebrow) {color:#b3cbdc}
html[data-theme="dark"] .launcher-emblem {background:#204653;border-color:#396274;color:#a4f2e6}
html[data-theme="dark"] :is(.launch-machine-icon,.launcher-search-heading kbd,.view-switch,.fleet-tabs b,.heading-count,.info-box) {background:var(--night-raised);color:#b5cbe4;border-color:var(--border)}
html[data-theme="dark"] :is(.launch-row,.launcher-more,.machine-id,.recent-empty) {border-color:var(--border)}
html[data-theme="dark"] :is(.state-badge,.state-badge.offline,.unavailable) {background:#243145;color:#bac8db;border-color:#35465d;box-shadow:none}
html[data-theme="dark"] :is(.state-badge.online,.launch-machine-icon.online) {background:#153c35;color:#86ebbc}
html[data-theme="dark"] .state-badge.pending {background:#40351f;color:#f1cd7d}
html[data-theme="dark"] .state-badge.disabled {background:#42283a;color:#ffb2c0}
html[data-theme="dark"] .machine-display {background:transparent}
html[data-theme="dark"] .computer-screen {background:#173144;border-color:#578294;color:#81e4d5;box-shadow:0 5px 0 #0a1622}
html[data-theme="dark"] :is(.computer-stand,.computer-stand:after) {background:#578294}
html[data-theme="dark"] :is(.offline,.disabled) .computer-screen {background:#202c3c;border-color:#53637a;color:#96a6bb}
html[data-theme="dark"] :is(.offline,.disabled) :is(.computer-stand,.computer-stand:after) {background:#53637a}
html[data-theme="dark"] .machine-card:hover {border-color:#457779;box-shadow:0 14px 32px #00000035}
html[data-theme="dark"] .view-switch a.selected {background:#2b4056;color:var(--accent)}
html[data-theme="dark"] .fleet-tabs a {color:var(--muted)}
html[data-theme="dark"] .fleet-tabs a.selected {color:var(--accent)}
html[data-theme="dark"] .table {--bs-table-bg:transparent;--bs-table-color:var(--ink);--bs-table-border-color:var(--border);--bs-table-striped-bg:#19283b;--bs-table-striped-color:var(--ink);--bs-table-hover-bg:#1d3043;--bs-table-hover-color:var(--ink);color:var(--ink)}
html[data-theme="dark"] .table th {background:#172638;color:#a8bed7}
html[data-theme="dark"] .table td {border-color:var(--border)}
html[data-theme="dark"] :is(.workspace-empty,.auth-shell) {background:var(--surface);border-color:#3a4c65}
html[data-theme="dark"] .auth-card {box-shadow:0 24px 80px #00000040}
html[data-theme="dark"] .sidebar.command-dock {background:#152338;border-color:#34485e;box-shadow:0 18px 50px #00000060}
html[data-theme="dark"] :is(.command-dock nav a.dock-link,.dock-tools>summary) {color:#b6c7dc}
html[data-theme="dark"] :is(.command-dock nav a.dock-link.active,.dock-tools[open]>summary,.dock-tools:has(a.active)>summary) {background:#224749;color:#9bf6e2}
html[data-theme="dark"] :is(.command-dock nav a.dock-link:hover,.dock-tools>summary:hover) {background:#263c51;color:#e6fff9}
html[data-theme="dark"] .command-dock nav .dock-tools-menu a {color:#bdcfe3}
html[data-theme="dark"] .command-dock nav .dock-tools-menu a:hover {background:#263c51;color:var(--accent)}
html[data-theme="dark"] :is(.command-dock a.active .dock-label small,.dock-tools[open] .dock-label small) {color:#a4d3d1}
html[data-theme="dark"] .alert-info {background:#172f43;border-color:#335b78;color:#bddfff}
html[data-theme="dark"] :is(.alert-warning,.alert-danger) {background:#3b2b2a;border-color:#775247;color:#ffd0b5}
html[data-theme="dark"] .alert-success {background:#17392f;border-color:#32654c;color:#b4efce}
html[data-theme="dark"] .errorlist {color:#ffadb9!important}
html[data-theme="dark"] :is(code,.text-danger) {color:#ffb2c7!important}
html[data-theme="dark"] .text-muted {color:var(--muted)!important}
html[data-theme="dark"] ::selection {background:#376b70;color:#fff}
@media(max-width:540px){.user-tools{gap:3px}.user-tools>span:not(.user-avatar){max-width:65px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .theme-toggle{width:29px;height:31px}.user-tools .user-avatar{display:none}.topbar-brand strong span{display:none}}
