/* Explicit themes. Existing component layout is retained in both palettes. */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light;--bg:#f3f5f9;--panel:#fff;--panel2:#edf1f8;--line:#d7deea;--text:#17243b;--muted:#57677d;--accent:#365fde;--green:#08794e;--red:#c52f45}
.theme-toggle{white-space:nowrap}.login .theme-toggle{width:auto;margin-bottom:16px;float:right;padding:7px 10px;font-size:12px}
.side{overflow-y:auto}.split>*,.grid>*{min-width:0}.table{max-width:100%;overflow:auto}.metric small{display:block;margin-top:8px;color:var(--muted);font-size:11px;line-height:1.5;min-height:33px}
.online-metric{border-color:#249269}.online-metric b{color:var(--green)}
.presence-explanation{line-height:1.8}.presence-explanation [role=status]{display:inline-block;margin-left:12px}
.device-status .presence-label{display:block;margin-top:7px}.device-row.is-online{border-color:#30bd81;animation:device-online-pulse 2.4s ease-in-out infinite}
@keyframes device-online-pulse{0%,100%{border-color:#298360;box-shadow:0 0 0 1px #30bd8112}50%{border-color:#54dea2;box-shadow:0 0 0 2px #30bd8140,0 0 16px #30bd8129}}
@media(prefers-reduced-motion:reduce){.device-row.is-online{animation:none;border-color:#30bd81;box-shadow:0 0 0 1px #30bd8140}}
html[data-theme="light"] body{background:var(--bg);color:var(--text)}
html[data-theme="light"] :is(.side,.login,.device-row,.client-version-card,.admin-dialog){background:#fff;border-color:var(--line);color:var(--text)}
html[data-theme="light"] .login{box-shadow:0 24px 70px #23375625}
html[data-theme="light"] .top{background:linear-gradient(180deg,#f3f5f9fa 72%,#f3f5f900)}
html[data-theme="light"] .nav a{color:#4f617b}
html[data-theme="light"] .nav a:is(:hover,.on){background:#e7edff;color:#2145b3}
html[data-theme="light"] :is(.input,.field,select,textarea){background:#fbfcff;border-color:#bbc8da;color:#17243b}
html[data-theme="light"] :is(.input,.field,textarea)::placeholder{color:#6d7c91;opacity:1}
html[data-theme="light"] :is(.btn.ghost,.admin-dialog-close){background:#e6ebf4;color:#233a60}
html[data-theme="light"] .btn.danger{background:#b82f45;color:#fff}
html[data-theme="light"] .tag{background:#e7ecf4;color:#43536d}
html[data-theme="light"] .tag.ok{background:#dff4e9;color:#0c6844}
html[data-theme="light"] :is(.tag.bad,.err){background:#ffeaee;color:#a9253b}
html[data-theme="light"] :is(.scope-note,.date-field,th,.formgrid label,.login p,.security-note){color:var(--muted)}
html[data-theme="light"] details summary{color:#345984}
html[data-theme="light"] :is(.license-history-link,.license-device-link){color:#285ac3;text-decoration-color:#8ba4d9}
html[data-theme="light"] :is(.license-history-link,.license-device-link):hover{color:#103a98}
html[data-theme="light"] :is(.client-version-panel,.dialog-switch,.license-history-summary,.captcha,.quick-publish-result){background:#f5f7fb;border-color:#d0d9e7;color:var(--text)}
html[data-theme="light"] :is(.admin-dialog-note,.license-upstream-summary,.focus-license-banner){background:#edf3ff;border-color:#bfcfeb;color:#354e71}
html[data-theme="light"] .quick-publish-card{background:linear-gradient(135deg,#f3f7ff,#fff);border-color:#bfcfeb}
html[data-theme="light"] .device-note-readonly{color:#425776;border-color:#c6d1e1}
html[data-theme="light"] .admin-toast{background:linear-gradient(135deg,#e9f8ef,#fff);border-color:#8dc9aa;color:var(--text);box-shadow:0 15px 45px #19335125}
html[data-theme="light"] .admin-toast.error{background:linear-gradient(135deg,#fff0f1,#fff);border-color:#e6a9b3}
html[data-theme="light"] :is(.admin-toast-close,.admin-toast-close:hover){color:#54667e}
html[data-theme="light"] .notice{background:#e9f8ef;color:#20503d}
html[data-theme="light"] .notice.error{background:#fff0f1;color:#86263b}
html[data-theme="light"] .admin-dialog::backdrop{background:#172a4755}
html[data-theme="light"] .device-row.is-online{border-color:#139462}
@media(max-width:620px){.top{gap:12px;flex-wrap:wrap}.user{flex-wrap:wrap;justify-content:flex-end}.theme-toggle{font-size:12px}.metric small{min-height:0}}
