:root {
  /* Enforce dark form controls and scrollbars across all browser engines */
  color-scheme: dark;

  /* Color Palette - Dark Theme (Default) */
  --bg-canvas: #090d16;
  --bg-surface: #111726;
  --bg-surface-elevated: #1a2236;
  --bg-surface-hover: #222d47;
  --bg-surface-active: #2b3959;

  --border-subtle: #1e293b;
  --border-default: #334155;
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d16;

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0284c7;
  --accent-primary-subtle: rgba(56, 189, 248, 0.12);

  --accent-success: #10b981;
  --accent-success-subtle: rgba(16, 185, 129, 0.12);
  --accent-warning: #f59e0b;
  --accent-warning-subtle: rgba(245, 158, 11, 0.12);
  --accent-danger: #ef4444;
  --accent-danger-subtle: rgba(239, 68, 68, 0.12);

  /* Form Control Tokens */
  --input-bg: var(--bg-surface);
  --input-bg-elevated: var(--bg-surface-elevated);
  --input-border: var(--border-default);
  --input-border-hover: #475569;
  --input-focus-ring: rgba(56, 189, 248, 0.2);
  --input-height-sm: 30px;
  --input-height-md: 40px;
  --input-font-sm: 0.8125rem;
  --shadow-dropdown: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.4);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-xs: 0.75rem;    /* 12px */
  --font-sm: 0.875rem;   /* 14px */
  --font-base: 1rem;     /* 16px */
  --font-lg: 1.125rem;   /* 18px */
  --font-xl: 1.25rem;    /* 20px */
  --font-2xl: 1.5rem;    /* 24px */
  --font-3xl: 2rem;      /* 32px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 56px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Mapping (Prepared for future toggle) */
[data-theme="light"] {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-surface-active: #cbd5e1;

  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-primary-subtle: rgba(2, 132, 199, 0.1);
}
