:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #000000;
  --rail: #090909;
  --ink: #e9ece3;
  --muted: #adb6ac;
  --accent: #e49476;
  --line: #292929;
  --selection: #704832;
  --button-hover: #c8d2bf;
  --header-bg: #000000f5;
  --badge-bg: #152011;
  --badge-ink: #bad2ae;
  --badge-line: #465740;
  --green-bg: #101710;
  --green-ink: #b8cdb0;
  --sand-bg: #19120e;
  --sand-ink: #dfb995;
  --blue-bg: #10171b;
  --blue-ink: #adcbd4;
  --node-bg: #ffffff08;
  --node-border: #8d7964;
  --branch-bg: #ffffff0b;
  --branch-border: #ffffff24;
  --connector: #424c40;
  --workflow-glow: #00000030;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
  color-scheme: dark;
  --paper: #000000;
  --rail: #090909;
  --ink: #e9ece3;
  --muted: #adb6ac;
  --accent: #e49476;
  --line: #292929;
  --selection: #704832;
  --button-hover: #c8d2bf;
  --header-bg: #000000f5;
  --badge-bg: #152011;
  --badge-ink: #bad2ae;
  --badge-line: #465740;
  --green-bg: #101710;
  --green-ink: #b8cdb0;
  --sand-bg: #19120e;
  --sand-ink: #dfb995;
  --blue-bg: #10171b;
  --blue-ink: #adcbd4;
  --node-bg: #ffffff08;
  --node-border: #8d7964;
  --branch-bg: #ffffff0b;
  --branch-border: #ffffff24;
  --connector: #424c40;
  --workflow-glow: #00000030;
  }
}
.theme-toggle { display: none; position: absolute; top: 32px; right: 20px; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--accent); background: var(--paper); }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
@media (max-width: 960px) {
  .theme-toggle { position: static; flex-shrink: 0; margin-left: auto; width: 36px; height: 36px; }
  .sidebar-top { gap: 12px; }
  .identity { min-width: 0; }
  .menu-toggle { margin-left: 0; }
}
@media (max-width: 480px) {
  .menu-label { display: none; }
  .menu-toggle { padding: 6px; min-width: 32px; justify-content: center; }
}
@media print {
  :root, :root[data-theme], :root:not([data-theme]) { color-scheme: light; --paper: #fff; --rail: #f2f2ee; --ink: #111; --muted: #444; --accent: #a9432b; --line: #ddd; --badge-bg: #e9eee4; --badge-ink: #465e3d; --badge-line: #d8e1d0; }
  .js .theme-toggle { display: none; }
}
