:root {
  color-scheme: dark light;

  --bg: #0d1117;
  --bg-deep: #0a0e14;
  --surface: #161b22;
  --surface-2: #1f2630;
  --surface-3: #252d38;
  --surface-raised: #121820;
  --surface-glass: rgba(22, 27, 34, .88);
  --surface-muted: rgba(31, 38, 48, .72);
  --surface-card: linear-gradient(165deg, rgba(37, 45, 56, .55) 0%, rgba(22, 27, 34, .92) 48%, rgba(18, 24, 32, .96) 100%);
  --surface-control: linear-gradient(180deg, rgba(37, 45, 56, .72) 0%, rgba(31, 38, 48, .88) 100%);
  --surface-tile: linear-gradient(160deg, rgba(37, 45, 56, .5) 0%, rgba(31, 38, 48, .9) 100%);
  --overlay: rgba(13, 17, 23, .74);
  --ink: #e6edf3;
  --ink-dim: #8b949e;
  --ink-faint: #6e7681;
  --ink-invert: #ffffff;
  --line: #30363d;
  --line-soft: rgba(139, 148, 158, .2);
  --line-strong: #58a6ff;
  --line-bright: rgba(139, 148, 158, .42);
  --accent: #1f6feb;
  --accent-2: #39c5bb;
  --accent-hi: #388bfd;
  --accent-lo: #1957c2;
  --accent-gradient: linear-gradient(165deg, var(--accent-hi) 0%, var(--accent) 52%, var(--accent-lo) 100%);
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --grok: #39c5bb;
  --claude: #ffb86b;
  --codex: #79c0ff;
  --image: #56d364;
  --model: #e3b341;
  --power: #a5d6ff;
  --high: #ff7b72;
  --focus: #58a6ff;
  --hand-primary: #79c0ff;
  --hand-secondary: #39c5bb;
  --hand-active: #ffffff;
  --camera-surface: #05080d;
  --camera-grid: rgba(121, 192, 255, .12);
  --camera-overlay: rgba(5, 8, 13, .64);
  --camera-line: rgba(230, 237, 243, .28);
  --camera-ink: #e6edf3;
  --camera-ink-dim: rgba(230, 237, 243, .62);
  --camera-halo: rgba(121, 192, 255, .72);
  --shadow: 0 1px 2px rgb(0 0 0 / .28), 0 4px 12px rgb(0 0 0 / .22);
  --shadow-soft: 0 1px 2px rgb(0 0 0 / .2), 0 8px 24px rgb(0 0 0 / .18);
  --shadow-raised: 0 4px 12px rgb(0 0 0 / .28), 0 22px 48px rgb(0 0 0 / .4);
  --shadow-overlay: 0 8px 20px rgb(0 0 0 / .36), 0 28px 64px rgb(0 0 0 / .48);
  --shadow-focus: 0 0 0 3px rgb(88 166 255 / .28);
  --shadow-ok: 0 0 0 1px rgb(63 185 80 / .92), 0 0 12px rgb(63 185 80 / .28);
  --shadow-err: 0 0 0 1px rgb(248 81 73 / .96), 0 0 12px rgb(248 81 73 / .28);
  --shadow-warn: 0 0 0 1px rgb(210 153 34 / .82), 0 0 12px rgb(210 153 34 / .24);
  --glow-ok: 0 0 0 1px rgb(63 185 80 / .45), 0 0 10px rgb(63 185 80 / .55);
  --glow-warn: 0 0 0 1px rgb(210 153 34 / .4), 0 0 10px rgb(210 153 34 / .5);
  --glow-err: 0 0 0 1px rgb(248 81 73 / .45), 0 0 10px rgb(248 81 73 / .55);
  --glow-faint: 0 0 6px rgb(110 118 129 / .35);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --border-w: 1px;
  --spinner-border: 2px;
  --hover-lift: -1px;
  --hover-press: 1px;
  --gap: 12px;
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-lg: 20px;
  --gap-xl: 28px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-title: 17px;
  --fs-body: 14px;
  --fs-mini: 12px;
  --fs-display: 20px;
  --fs-label: 11px;
  --lh-tight: 1.15;
  --lh-body: 1.45;
  --tracking-title: .01em;
  --tracking-label: .06em;
  --weight-title: 700;
  --weight-display: 720;

  --shell-max: 1220px;
  --shell-pad: 20px;
  --topbar-min: 68px;
  --logo-size: 44px;
  --control-h: 40px;
  --control-h-lg: 52px;
  --capsule-dot: 9px;
  --spinner-size: 14px;
  --project-list-max: 42vh;
  --memo-max: 140px;
  --card-pad: 16px;
  --drawer-pad: 14px;
  --toast-w: 360px;
  --audit-drawer-w: 460px;
  --command-w: 720px;
  --command-results-max-h: 56vh;
  --workspace-side-min: 320px;
  --app-tile-min-h: 84px;
  --app-start-min-w: 76px;
  --audit-chip-max-w: 32%;
  --proc-col-pid: 64px;
  --proc-col-cpu: 68px;
  --proc-col-memory: 90px;
  --proc-col-command-min: 220px;
  --proc-row-min: 720px;
  --proc-col-pid-compact: 56px;
  --proc-col-cpu-compact: 60px;
  --proc-col-memory-compact: 80px;
  --proc-col-command-min-compact: 160px;
  --proc-row-min-compact: 620px;
  --bp-tablet: 899px;
  --opacity-busy: .62;
  --opacity-disabled: .48;
  --scrollbar-size: 6px;
  --scrollbar-radius: 999px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(139, 148, 158, .35);
  --scrollbar-thumb-hover: rgba(139, 148, 158, .55);
  --t: 160ms ease;
  --t-slow: 800ms ease;
  --primary-hover-brightness: 1.08;
  --success-hold-ms: 800;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light dark;

    --bg: #f5f7f8;
    --bg-deep: #eef1f3;
    --surface: #ffffff;
    --surface-2: #eef2f4;
    --surface-3: #e4eaee;
    --surface-raised: #ffffff;
    --surface-glass: rgba(255, 255, 255, .9);
    --surface-muted: rgba(238, 242, 244, .78);
    --surface-card: linear-gradient(165deg, rgba(255, 255, 255, .98) 0%, rgba(245, 248, 250, .96) 100%);
    --surface-control: linear-gradient(180deg, #ffffff 0%, #eef2f4 100%);
    --surface-tile: linear-gradient(160deg, #ffffff 0%, #eef2f4 100%);
    --overlay: rgba(245, 247, 248, .74);
    --ink: #11181f;
    --ink-dim: #52616f;
    --ink-faint: #778491;
    --ink-invert: #ffffff;
    --line: #ccd6dd;
    --line-soft: rgba(82, 97, 111, .2);
    --line-strong: #0969da;
    --line-bright: rgba(82, 97, 111, .36);
    --accent: #0969da;
    --accent-2: #008f8a;
    --accent-hi: #218bff;
    --accent-lo: #0550ae;
    --accent-gradient: linear-gradient(165deg, var(--accent-hi) 0%, var(--accent) 52%, var(--accent-lo) 100%);
    --ok: #1a7f37;
    --warn: #9a6700;
    --err: #cf222e;
    --grok: #008f8a;
    --claude: #b45b20;
    --codex: #0969da;
    --image: #1a7f37;
    --model: #8a6a00;
    --power: #0969da;
    --high: #cf222e;
    --focus: #0969da;
    --shadow: 0 1px 2px rgb(27 31 36 / .08), 0 4px 14px rgb(27 31 36 / .08);
    --shadow-soft: 0 1px 2px rgb(27 31 36 / .06), 0 8px 22px rgb(27 31 36 / .08);
    --shadow-raised: 0 4px 12px rgb(27 31 36 / .1), 0 18px 40px rgb(27 31 36 / .14);
    --shadow-overlay: 0 8px 20px rgb(27 31 36 / .12), 0 28px 56px rgb(27 31 36 / .16);
    --shadow-focus: 0 0 0 3px rgb(9 105 218 / .2);
    --shadow-ok: 0 0 0 1px rgb(26 127 55 / .86), 0 0 10px rgb(26 127 55 / .2);
    --shadow-err: 0 0 0 1px rgb(207 34 46 / .92), 0 0 10px rgb(207 34 46 / .2);
    --shadow-warn: 0 0 0 1px rgb(154 103 0 / .78), 0 0 10px rgb(154 103 0 / .18);
    --glow-ok: 0 0 0 1px rgb(26 127 55 / .35), 0 0 8px rgb(26 127 55 / .4);
    --glow-warn: 0 0 0 1px rgb(154 103 0 / .3), 0 0 8px rgb(154 103 0 / .35);
    --glow-err: 0 0 0 1px rgb(207 34 46 / .35), 0 0 8px rgb(207 34 46 / .4);
    --glow-faint: 0 0 5px rgb(119 132 145 / .3);
    --scrollbar-thumb: rgba(82, 97, 111, .32);
    --scrollbar-thumb-hover: rgba(82, 97, 111, .5);
  }
}
