.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface,#1b1e22);color:var(--gold);cursor:pointer;vertical-align:middle;margin-inline-start:8px;line-height:1}
.theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-moon{display:none}
[data-theme="light"] .theme-toggle .theme-sun{display:none}
[data-theme="light"] .theme-toggle .theme-moon{display:block}
.theme-toggle:focus-visible{outline:2px solid var(--gold);outline-offset:4px}
.theme-toggle:hover{background:var(--goldwash,#2d291f)}
:root[data-theme="light"]{color-scheme:light;--bg:#f7f6f2;--sidebar:#eeede7;--surface:#ffffff;--surface2:#efeee9;--line:#d8d9d2;--text:#232a30;--muted:#59646e;--gold:#80601d;--goldwash:#f4ead1;--blue:#28649a;--green:#286a43}
[data-theme="light"] .nav-button:hover,[data-theme="light"] .avatar,[data-theme="light"] .event-icon,[data-theme="light"] .chip{background:var(--surface2);color:var(--text)}
[data-theme="light"] .field input,[data-theme="light"] .field select,[data-theme="light"] .search,[data-theme="light"] input,[data-theme="light"] select{background:var(--surface);color:var(--text);border-color:var(--line)}
[data-theme="light"] .field label{color:var(--text)}
[data-theme="light"] .data-table th,[data-theme="light"] .channel,[data-theme="light"] .token-box{background:var(--bg)}
[data-theme="light"] .button.primary{background:#ddbd7d;border-color:#c9a961;color:#282114}
[data-theme="light"] .button.danger,[data-theme="light"] .pill.expired,[data-theme="light"] .pill.revoked,[data-theme="light"] .pill.unpaid{background:#fae9e8;color:#942b35;border-color:#e2b9bd}
[data-theme="light"] .form-error{color:#a22838}
[data-theme="light"] .state,[data-theme="light"] .pill,[data-theme="light"] .event-icon.success{background:#e6f2e9;color:#28633d}
[data-theme="light"] .state.open,[data-theme="light"] .pill.scheduled{background:#e5eff8;color:#235e90}
[data-theme="light"] .state.moving{background:#fbefcf;color:#765615}
[data-theme="light"] .state.unknown,[data-theme="light"] .state.offline{background:#e9ebed;color:#56606b}
[data-theme="light"] .note,[data-theme="light"] .support-banner{background:#fbf2de;color:#70541e;border-color:#dfcda4}
[data-theme="light"] .support-banner small{color:#70541e}
[data-theme="light"] dialog{border-color:var(--line);box-shadow:0 24px 80px #29313a26}
[data-theme="light"] dialog::backdrop{background:#25313b55}
[data-theme="light"] .gate-feedback{background:#f2f3ef}
[data-theme="light"] .gate-feedback.busy{background:#eaf2fa}
[data-theme="light"] .gate-feedback.success{background:#e8f3eb}
[data-theme="light"] .gate-feedback.warning{background:#fbf1db}
[data-theme="light"] .gate-feedback.error{background:#fbecee}
[data-theme="light"] .feedback-icon{background:#ffffffaa}
[data-theme="light"] .gate-feedback.error .feedback-icon{color:#a22838;background:#f5dce1}
[data-theme="light"] .local-badge{border-color:#dfcda4}
[data-theme="light"] .language-track{background:#eae9e3;border-color:#d4d4cb}
[data-theme="light"] .language-en,[data-theme="light"] .language-bg{color:#59616b}
/* Preserve DECK swatches in light mode; darken only action text for contrast. */
[data-theme="light"] .gate-card .gate-action{color:color-mix(in srgb,var(--accent,var(--blue)) 55%,#000)}
@media(max-width:720px){.topbar{height:auto;min-height:70px;gap:12px;padding-block:12px;flex-wrap:wrap}.top-actions{flex-wrap:wrap;min-width:0}.top-actions>.meta{display:none}.theme-toggle{margin-inline-start:0}}
/* Standalone maintenance surfaces. */
[data-theme="light"][data-maintenance="true"] .eyebrow{background:var(--goldwash);border-color:#dfcda4}
[data-theme="light"][data-maintenance="true"] .visual{background:radial-gradient(ellipse at 50% 40%,#e5d6b5aa,transparent 68%),#f0eee7}
[data-theme="light"][data-maintenance="true"] .visual-caption{color:var(--muted)}
html[data-maintenance="true"] header{flex-wrap:wrap}

/* Light surfaces need a stronger tint on hover, not a brightness filter. */
[data-theme="light"] .button:hover,[data-theme="light"] .gate-action:hover:enabled{filter:none}
[data-theme="light"] .button,[data-theme="light"] .gate-action,[data-theme="light"] .nav-button,[data-theme="light"] .icon-button,[data-theme="light"] .theme-toggle{transition:background-color .16s ease,border-color .16s ease,color .16s ease}
@media(hover:hover){
 [data-theme="light"] .nav-button:hover:not(:disabled){background:#dedfd7;color:#232a30}
 [data-theme="light"] .nav-button.active:hover:not(:disabled){background:#eadbb8;color:#705016}
 [data-theme="light"] .button:hover:not(:disabled){background:#e1e3dc;border-color:#aeb5ac;color:#232a30}
 [data-theme="light"] .button.primary:hover:not(:disabled){background:#d2ae65;border-color:#b58e43;color:#282114}
 [data-theme="light"] .button.danger:hover:not(:disabled){background:#f3d3d5;border-color:#c9848d;color:#85212f}
 [data-theme="light"] .gate-card .gate-action:hover:enabled{background:color-mix(in srgb,var(--accent,var(--blue)) 24%,white);border-color:var(--accent,var(--blue));color:color-mix(in srgb,var(--accent,var(--blue)) 88%,black)}
 [data-theme="light"] .icon-button:hover:not(:disabled),[data-theme="light"] .avatar:hover:not(:disabled){background:#dedfd7;color:#232a30}
 [data-theme="light"] .theme-toggle:hover:not(:disabled){background:#eadbb8;border-color:#b59960}
}
[data-theme="light"] .gate-card .gate-action:active:enabled{filter:none;background:color-mix(in srgb,var(--accent,var(--blue)) 28%,white);border-color:var(--accent,var(--blue))}
@media(prefers-reduced-motion:reduce){[data-theme="light"] .button,[data-theme="light"] .gate-action,[data-theme="light"] .nav-button,[data-theme="light"] .icon-button,[data-theme="light"] .theme-toggle{transition:none}}
[data-theme="light"] .readonly-value{background:var(--surface);color:var(--text);border-color:var(--line)}
