/* Shared appearance overrides, loaded after page styles. Video pixels are never filtered. */
:root { color-scheme: dark; }
:root[data-theme="light"] {
  color-scheme: light;
  --clr-bg: #f1f5f9;
  --clr-surface: #ffffff;
  --clr-surface-2: #eaf0f6;
  --clr-border: #cbd5e1;
  --clr-border-subtle: #dce4ee;
  --clr-text: #172033;
  --clr-text-muted: #526278;
  --clr-text-dim: #475569;
  --clr-primary: #0369a1;
  --clr-primary-dim: rgba(3,105,161,.09);
  --clr-accent: #4f46e5;
  --clr-normal: #15803d;
  --clr-warning: #a16207;
  --clr-danger: #b91c1c;
  --bg: #f1f5f9; --surface: #fff; --surface-2: #eaf0f6;
  --border: #cbd5e1; --text: #172033; --muted: #526278;
  --primary: #0369a1; --normal: #15803d; --warning: #a16207; --high: #c2410c; --danger: #b91c1c;
}
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:72px; min-height:44px; padding:6px; border:0; border-radius:999px; background:transparent; cursor:pointer; flex-shrink:0; }
.theme-switch-track { display:block; position:relative; width:60px; height:32px; border:1px solid #64748b; border-radius:999px; background:#1e293b; transition:background .2s,border-color .2s; }
.theme-switch-thumb { position:absolute; top:3px; left:3px; display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#e2e8f0; color:#334155; box-shadow:0 1px 4px #0003; transition:transform .2s; }
.theme-switch-thumb svg { grid-area:1 / 1; }
.theme-icon-sun { display:none; }
[data-theme="light"] .theme-switch-track { background:#bae6fd; border-color:#0284c7; }
[data-theme="light"] .theme-switch-thumb { transform:translateX(28px); background:#fff; color:#a16207; }
[data-theme="light"] .theme-icon-sun { display:block; }
[data-theme="light"] .theme-icon-moon { display:none; }
@media(prefers-reduced-motion:reduce) { .theme-switch-track,.theme-switch-thumb { transition:none; } }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--clr-primary, var(--primary)); }
.theme-toggle:focus-visible { outline: 2px solid var(--clr-primary, var(--primary)); outline-offset: 3px; }
.auth-theme-toolbar { display: flex; justify-content: flex-end; padding: 16px 24px 0; }
[data-theme="light"] :is(.sidebar, .topbar, .app-footer, .camera-full-view-dialog) { background: var(--clr-surface); }
[data-theme="light"] :is(.trend-chart-wrapper, .unified-chart-container, .no-current-data) { background: var(--clr-surface); }
[data-theme="light"] .public-main .panel { background: var(--surface); }
[data-theme="light"] .video-state { color: #cbd5e1; }
[data-theme="light"] .unified-alert-badge.status-high { color: #9a3412; }
[data-theme="light"] :is(.badge-normal, .badge-ok, .flash-success) { color: #166534; }
[data-theme="light"] :is(.badge-warning, .flash-warning) { color: #854d0e; }
[data-theme="light"] :is(.badge-danger, .badge-live, .flash-danger) { color: #991b1b; }
[data-theme="light"] .flash-info { color: #075985; }
[data-theme="light"] .auth-page-body { background: var(--clr-bg); color: var(--clr-text); color-scheme: light; }
[data-theme="light"] .auth-card { background: #fff; border-color: #cbd5e1; box-shadow: 0 18px 55px #0f172a12; }
[data-theme="light"] :is(.auth-intro h1, .auth-card .form-label) { color: #172033; }
[data-theme="light"] :is(.auth-subtitle, .auth-intro > p:last-child, .form-help-text, .auth-footer-helper, .auth-page-footer) { color: #526278; }
[data-theme="light"] :is(.auth-logo, .auth-tabs) { background: #f1f5f9; border-color: #cbd5e1; color: #0369a1; }
[data-theme="light"] .auth-tab { color: #475569; }
[data-theme="light"] .auth-tab:hover { background: #e2e8f0; color: #172033; }
[data-theme="light"] .auth-tab.active { background: #fff; color: #075985; }
[data-theme="light"] :is(.auth-eyebrow, .auth-footer-helper a, .password-toggle) { color: #0369a1; }
[data-theme="light"] .password-toggle:hover { background: #e0f2fe; }
[data-theme="light"] .auth-card .form-input { background: #fff; color: #172033; border-color: #94a3b8; }
[data-theme="light"] .auth-card .form-input::placeholder { color: #64748b; }
[data-theme="light"] .auth-card .form-input:focus { border-color: #0369a1; }
[data-theme="light"] .auth-message { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
[data-theme="light"] .auth-message-danger { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
[data-theme="light"] .auth-message-warning { background: #fffbeb; color: #854d0e; border-color: #fcd34d; }
[data-theme="light"] .auth-message-success { background: #f0fdf4; color: #166534; border-color: #86efac; }
[data-theme="light"] .auth-card .form-input[aria-invalid=true], [data-theme="light"] .auth-card .form-input:user-invalid { border-color: #b91c1c; }
[data-theme="light"] .notice { color: #854d0e; }
/* Keep offline notices legible on the deliberately dark video canvas. */
[data-theme="light"] :is(.camera-overlay, .camera-offline-overlay, .night-detection-notice) { color: #e2e8f0; }
@media (max-width: 600px) {
  .topbar-right { gap: 6px; }
  .topbar-right .header-date { display: none; }
  .theme-toggle { min-width: 40px; }
  .topbar-right .theme-toggle [data-theme-label] { display: none; }
  .public-header { flex-wrap: wrap; }
}
