/* Shared semantic palette for template screens and body-level dialogs. */
html[data-kite-theme="dark"], html[data-kite-theme="dark"] #kite-root {
  color-scheme: dark;
  --bg:#101112; --surface:#191b1d; --surface-2:#202225; --hover:#2a2d30;
  --border:#3b3e42; --border-2:#303337; --line:#303337; --th-bg:#222427;
  --text:#f0f1f2; --text-2:#c0c4c8; --muted:#a0a6ad;
  --input-bg:#151719; --input-border:#484d52;
  --accent:#087454; --accent-2:#0a8a65; --accent-fg:#ffffff;
  --accent-soft:#17352c; --accent-text:#76dfb8;
  --chip-bg:#23332d; --chip-border:#3e6555; --chip-text:#91e3c4;
  --track:#303337; --shadow:0 18px 44px rgba(0,0,0,.55);
  --warn-bg:#30271b; --warn-border:#69522c; --warn-strong:#f0c477; --warn-text:#ddc298;
  --violet-soft:#30253e; --violet-text:#cbb3f4; --danger:#ffaaa2; --watch-bg:#30271b;
  --chrome-bg:#191b1d; --chrome-border:#3b3e42; --chrome-text:#c0c4c8;
  --chrome-strong:#f0f1f2; --chrome-hover:#2a2d30; --chrome-active-bg:#17352c;
  --chrome-active-text:#91e3c4; --chrome-muted:#a0a6ad;
  --chrome-input-bg:#151719; --chrome-input-border:#484d52;
  --chrome-badge-bg:#087454; --chrome-badge-fg:#fff;
  --chrome-avatar-bg:#17352c; --chrome-avatar-fg:#91e3c4; --chrome-online:#40c998;
  background:var(--bg); color:var(--text);
}
html[data-kite-theme="dark"] body { background:var(--bg); color:var(--text); }
html[data-kite-theme="dark"] :is(input,select,textarea) { color-scheme:dark; }
html[data-kite-theme="dark"] :is(button,a,input,select,textarea):focus-visible { outline:2px solid #76dfb8; outline-offset:2px; }
html[data-kite-theme="dark"] :is(.kite-notif-panel,.kite-clear-confirm,.kite-clear-confirm button,.kite-notif-btn) { background:var(--surface); color:var(--text); border-color:var(--border); }
html[data-kite-theme="dark"] :is(.kite-notif-head,.kite-notif-title) { color:var(--text); }
html[data-kite-theme="dark"] :is(.kite-notif-msg,.kite-notif-empty,.kite-clear-confirm p) { color:var(--text-2); }
html[data-kite-theme="dark"] :is(.kite-notif-head,.kite-notif-item) { border-color:var(--line); }
html[data-kite-theme="dark"] .kite-notif-clear { color:var(--accent-text); }
html[data-kite-theme="dark"] .kite-notif-error { color:var(--danger); }
html[data-kite-theme="dark"] .kite-clear-confirm button[data-confirm] { background:var(--accent); color:#fff; border-color:var(--accent); }
html[data-kite-theme="dark"] ::backdrop { background:rgba(0,0,0,.7); }
/* Existing React utility surfaces, including account-security dialogs. */
html[data-kite-theme="dark"] #root :is(.bg-white,.kite-panel,dialog) { background:var(--surface); border-color:var(--border); }
html[data-kite-theme="dark"] #root :is(.bg-slate-50,.bg-slate-100,main,header) { background:var(--surface-2); }
html[data-kite-theme="dark"] #root :is(.text-slate-950,.text-slate-900,.text-slate-800,h1,h2,h3) { color:var(--text); }
html[data-kite-theme="dark"] #root :is(.text-slate-700,.text-slate-600,.text-slate-500) { color:var(--text-2); }
html[data-kite-theme="dark"] #root :is(.border-slate-200,.border-slate-300,table th,table td) { border-color:var(--border); }
html[data-kite-theme="dark"] #root :is(input,select,textarea) { background:var(--input-bg); color:var(--text); border-color:var(--input-border); }
html[data-kite-theme="dark"] #root :is(table thead,table tbody tr:hover) { background:var(--surface-2); }
html[data-kite-theme="dark"] #root img { background-color:#fff; }
html[data-kite-theme="dark"] #root .kite-security-page,
html[data-kite-theme="dark"] #root .kite-security-page > main,
html[data-kite-theme="dark"] #root .kite-security-page header { background:var(--bg); }
html[data-kite-theme="dark"] #root :is(.text-emerald-700,.text-emerald-800) { color:var(--accent-text); }
html[data-kite-theme="dark"] #root :is(.bg-emerald-50,.bg-emerald-100) { background:var(--accent-soft); }
html[data-kite-theme="dark"] #root :is(.bg-amber-50,.bg-amber-100) { background:var(--warn-bg); }
html[data-kite-theme="dark"] #root :is(.text-amber-700,.text-amber-800,.text-amber-900) { color:var(--warn-strong); }
