/* Shared appearance tokens. Dark is also the fallback before the boot script. */
:root {
  color-scheme: dark;
  --canvas: #0b1424;
  --surface: #101e31;
  --surface-subtle: #142337;
  --surface-raised: #1a2c43;
  --ink: #e1e9f4;
  --muted: #9aadc4;
  --muted-strong: #b8c9df;
  --accent: #94b1ff;
  --accent-fill: #365edb;
  --accent-hover: #426de9;
  --on-accent: #ffffff;
  --soft: #1d3152;
  --line: #293c53;
  --line-strong: #49617d;
  --green: #6edbb3;
  --success-bg: #16392f;
  --danger: #ff9ba8;
  --danger-bg: #3b2332;
  --danger-fill: #ac3549;
  --danger-hover: #bc3a50;
  --amber: #edc07d;
  --warning-bg: #392f21;
  --cyan: #87d5ed;
  --info-bg: #163445;
  --violet: #c5b0ff;
  --violet-bg: #30264a;
  --focus: #a5bfff;
  --shadow: #00000045;
  --scrim: #030a15a6;
  --nav: #121d35;
  --ops-cyan: var(--cyan);
  --ops-green: var(--green);
  --ops-amber: var(--amber);
  --ops-red: var(--danger);
  --ops-muted: var(--muted);
  --ops-line: var(--line);
  --ops-surface: var(--surface);
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f4f6fa;
  --surface-raised: #eaf0f8;
  --ink: #243047;
  --muted: #64748b;
  --muted-strong: #4d617e;
  --accent: #3458cf;
  --accent-fill: #3458cf;
  --accent-hover: #2948b1;
  --soft: #edf2ff;
  --line: #e1e7ef;
  --line-strong: #bdc9da;
  --green: #247257;
  --success-bg: #eaf5ef;
  --danger: #b53248;
  --danger-bg: #fceef1;
  --danger-fill: #ad3547;
  --danger-hover: #952b3b;
  --amber: #876015;
  --warning-bg: #fbf3e4;
  --cyan: #216e87;
  --info-bg: #eaf5fa;
  --violet: #7444b5;
  --violet-bg: #f3edfc;
  --focus: #5d7fe0;
  --shadow: #15213922;
  --scrim: #15213955;
}
html,body,.workspace { background: var(--canvas); color: var(--ink); }
.sidebar,.login-identity {
  color-scheme: dark;
  --line: #29384e;
  --muted: #9aadc4;
  --muted-strong: #b8c9df;
  --accent: #a9c1ff;
  --surface: #121d35;
  --surface-subtle: #1a2947;
  --soft: #23385f;
  --green: #6edbb3;
}
dialog { background: var(--surface); }
input,select,textarea { color-scheme: inherit; }
input::placeholder,textarea::placeholder { color: var(--muted); opacity: 1; }
::selection { background: var(--soft); color: var(--ink); }
.topbar-tools { display: flex; align-items: center; gap: 22px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; min-height: 34px; padding: 6px 10px; background: var(--surface); color: var(--muted-strong); font-size: 11px; white-space: nowrap; }
.theme-toggle .icon { font-size: 16px; }
.theme-toggle:hover { background: var(--surface-raised); color: var(--ink); }
.login-theme { position: absolute; top: 24px; right: 24px; z-index: 2; }
.primary { background: var(--accent-fill); color: var(--on-accent); }
.primary:hover { background: var(--accent-hover); }
.destructive { background: var(--danger-fill); color: var(--on-accent); }
.destructive:hover { background: var(--danger-hover); }
@media(max-width:700px) {
  .topbar-tools { gap: 10px; }
  .theme-toggle { min-height: 36px; }
  .topbar .breadcrumb-brand,.topbar .breadcrumb-slash { display: none; }
  .login-theme { top: 20px; right: 18px; }
}
