:root {
  /* Color Scheme Native Hint */
  color-scheme: light dark;

  /* Color Palette - Notion/ClickUp Inspired (Light Theme) */
  --bg-main: #f7f7f8;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f1f3;
  --bg-subtle: #f9f9fa;
  --bg-sidebar: #fdfdfd;

  --border-color: #e5e5e7;
  --border-subtle: #eeeeee;
  --border-focus: #2563eb;

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-inverse: #ffffff;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-surface: #eff6ff;

  --success-text: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  --warning-text: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --danger-text: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --info-text: #0369a1;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;

  --skeleton-bg: #e4e4e7;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */

  /* Spacing */
  --spacing-2xs: 4px;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);

  /* Touch ergonomics */
  --min-touch-target: 44px;
}

/* Dark Theme Tokens */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-main: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-hover: #21262d;
  --bg-subtle: #13171f;
  --bg-sidebar: #0f141c;

  --border-color: #30363d;
  --border-subtle: #21262d;
  --border-focus: #58a6ff;

  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-inverse: #0d1117;

  --accent-primary: #388bfd;
  --accent-primary-hover: #58a6ff;
  --accent-surface: rgba(56, 139, 253, 0.15);

  --success-text: #3fb950;
  --success-bg: rgba(46, 160, 67, 0.15);
  --success-border: rgba(46, 160, 67, 0.35);

  --warning-text: #d29922;
  --warning-bg: rgba(187, 128, 9, 0.15);
  --warning-border: rgba(187, 128, 9, 0.35);

  --danger-text: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.15);
  --danger-border: rgba(248, 81, 73, 0.35);

  --info-text: #58a6ff;
  --info-bg: rgba(56, 139, 253, 0.15);
  --info-border: rgba(56, 139, 253, 0.35);

  --skeleton-bg: #21262d;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* System preference fallback when user hasn't explicitly picked light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg-main: #0d1117;
    --bg-surface: #161b22;
    --bg-surface-hover: #21262d;
    --bg-subtle: #13171f;
    --bg-sidebar: #0f141c;

    --border-color: #30363d;
    --border-subtle: #21262d;
    --border-focus: #58a6ff;

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-inverse: #0d1117;

    --accent-primary: #388bfd;
    --accent-primary-hover: #58a6ff;
    --accent-surface: rgba(56, 139, 253, 0.15);

    --success-text: #3fb950;
    --success-bg: rgba(46, 160, 67, 0.15);
    --success-border: rgba(46, 160, 67, 0.35);

    --warning-text: #d29922;
    --warning-bg: rgba(187, 128, 9, 0.15);
    --warning-border: rgba(187, 128, 9, 0.35);

    --danger-text: #f85149;
    --danger-bg: rgba(248, 81, 73, 0.15);
    --danger-border: rgba(248, 81, 73, 0.35);

    --info-text: #58a6ff;
    --info-bg: rgba(56, 139, 253, 0.15);
    --info-border: rgba(56, 139, 253, 0.35);

    --skeleton-bg: #21262d;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  }
}