:root,
[data-theme="light"] {
  color-scheme: light;

  /* Surfaces */
  --bg-canvas: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f8fafc;
  --bg-surface-hover: #eef2f6;
  --bg-surface-active: #e6edf7;
  --bg-input: #ffffff;
  --bg-backdrop: rgba(15, 23, 42, 0.42);
  --bg-skeleton-base: #e2e8f0;
  --bg-skeleton-shine: #f1f5f9;

  /* Ink & Borders */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Brand & Semantic Accents */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-soft-border: #bfdbfe;
  --on-accent: #ffffff;

  --star-color: #d97706;
  --star-soft: #fef3c7;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-text: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --on-danger: #ffffff;

  --warning-text: #b45309;
  --warning-soft: #fffbeb;
  --success-text: #047857;
  --success-soft: #ecfdf5;

  /* Toast & Elevated Inverse Bar */
  --toast-bg: #1e293b;
  --toast-text: #f8fafc;
  --toast-action: #60a5fa;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 36px -8px rgba(15, 23, 42, 0.16), 0 6px 14px -4px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg-canvas: #0d1117;
  --bg-surface: #151b23;
  --bg-surface-subtle: #1b222c;
  --bg-surface-hover: #222b38;
  --bg-surface-active: #1e2d44;
  --bg-input: #0f141b;
  --bg-backdrop: rgba(2, 6, 12, 0.68);
  --bg-skeleton-base: #1e2631;
  --bg-skeleton-shine: #283241;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-subtle: #26303d;
  --border-strong: #364457;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-soft-border: rgba(96, 165, 250, 0.36);
  --on-accent: #ffffff;

  --star-color: #fbbf24;
  --star-soft: rgba(245, 158, 11, 0.16);

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-text: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --danger-border: rgba(248, 113, 113, 0.35);
  --on-danger: #ffffff;

  --warning-text: #fbbf24;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --success-text: #34d399;
  --success-soft: rgba(16, 185, 129, 0.14);

  --toast-bg: #263142;
  --toast-text: #f8fafc;
  --toast-action: #60a5fa;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 20px -4px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 44px -8px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.35);
}

:root {
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Fixed Type Scale (Product Register) */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.625rem;

  /* 4px Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Layout Dimensions */
  --topbar-height: 60px;
  --sidebar-width: 264px;

  /* Motion */
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 150ms;
  --duration-normal: 220ms;

  /* Z-index layers */
  --z-base: 1;
  --z-topbar: 20;
  --z-backdrop: 30;
  --z-sidebar: 40;
  --z-popover: 60;
  --z-toast: 80;
}
