:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-2: #eceff3;
  --color-border: #d9dee5;
  --color-border-input: #7b8694;
  --color-text: #161a20;
  --color-text-muted: #5a6473;
  --color-accent: #2456c8;
  --color-accent-hover: #1c47a6;
  --color-on-accent: #ffffff;
  --color-danger: #b42323;
  --color-on-danger: #ffffff;
  --color-success: #1d6f45;
  --color-warning: #8a5a00;
  --color-info: #2456c8;
  --color-status-online: #1d6f45;
  --color-status-offline: #b42323;
  --color-status-upgrading: #8a5a00;
  --color-status-idle: #5a6473;
  --color-takeover: #8a2f8f;
  --color-focus: #2456c8;
  --color-canvas: #2b3038;
  --color-player-bg: #000000;
  --color-player-text: #f4f6f8;
  --font-sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 12px; --leading-xs: 16px; --weight-xs: 500;
  --text-sm: 14px; --leading-sm: 20px; --weight-sm: 400;
  --text-base: 16px; --leading-base: 24px; --weight-base: 400;
  --text-lg: 18px; --leading-lg: 26px; --weight-lg: 600;
  --text-xl: 22px; --leading-xl: 30px; --weight-xl: 600;
  --text-2xl: 28px; --leading-2xl: 34px; --weight-2xl: 700;
  --text-display: 40px; --leading-display: 44px; --weight-display: 700;
  --text-code: 32px; --leading-code: 40px; --weight-code: 600;
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-pop: 0 12px 32px rgba(16,24,40,.18);
  --shadow-focus: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-focus);
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 320ms;
  --motion-ease: cubic-bezier(.2,.8,.2,1);
  --layout-sidebar: 232px;
  --layout-sidebar-collapsed: 64px;
  --layout-header: 56px;
  --layout-content-max: 1440px;
  --layout-gutter: 24px;
  --layout-gutter-mobile: 16px;
  --layout-table-row: 44px;
  color-scheme: light;
}

[data-theme="dark"] {
  --color-bg: #10151d;
  --color-surface: #1a212c;
  --color-surface-2: #232c39;
  --color-border: #2b3444;
  --color-border-input: #8a96a6;
  --color-text: #e8edf4;
  --color-text-muted: #9fabbb;
  --color-accent: #5b8dee;
  --color-accent-hover: #7aa3f3;
  --color-on-accent: #0b1220;
  --color-danger: #ef6b7c;
  --color-on-danger: #1a0407;
  --color-success: #3fcf7a;
  --color-warning: #f0b445;
  --color-info: #5b8dee;
  --color-status-online: #3fcf7a;
  --color-status-offline: #ef6b7c;
  --color-status-upgrading: #f0b445;
  --color-status-idle: #9fabbb;
  --color-takeover: #d08be0;
  --color-focus: #7aa3f3;
  --color-canvas: #0b0e13;
  --color-player-bg: #000000;
  --color-player-text: #f4f6f8;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #10151d;
    --color-surface: #1a212c;
    --color-surface-2: #232c39;
    --color-border: #2b3444;
    --color-border-input: #8a96a6;
    --color-text: #e8edf4;
    --color-text-muted: #9fabbb;
    --color-accent: #5b8dee;
    --color-accent-hover: #7aa3f3;
    --color-on-accent: #0b1220;
    --color-danger: #ef6b7c;
    --color-on-danger: #1a0407;
    --color-success: #3fcf7a;
    --color-warning: #f0b445;
    --color-info: #5b8dee;
    --color-status-online: #3fcf7a;
    --color-status-offline: #ef6b7c;
    --color-status-upgrading: #f0b445;
    --color-status-idle: #9fabbb;
    --color-takeover: #d08be0;
    --color-focus: #7aa3f3;
    --color-canvas: #0b0e13;
    --color-player-bg: #000000;
    --color-player-text: #f4f6f8;
    color-scheme: dark;
  }
}

html { font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--leading-base); color: var(--color-text); background: var(--color-bg); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0ms !important; animation-duration: 0ms !important; } }
