/* Dark theme (default) */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #121212;
  --surface: #1E1E24;
  --surface-raised: #2A2A32;
  --divider: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(255, 255, 255, 0.28);
  --border-dashed: rgba(255, 255, 255, 0.18);
  --backdrop: rgba(0, 0, 0, 0.6);

  /* Text */
  --text: #FFFFFF;
  --text-muted: #A0A0A0;
  --text-faint: #5C5C64;
  --placeholder: #4A4A52;

  /* Primary action (same in both themes) */
  --primary: #6A0DAD;
  --on-primary: #FFFFFF;

  /* Progress levels: fill / text */
  --accent-ok: #00E676;
  --accent-warn: #FFC400;
  --accent-high: #FF9100;
  --accent-over: #FF5252;
  --text-ok: var(--accent-ok);
  --text-warn: var(--accent-warn);
  --text-high: var(--accent-high);
  --text-over: var(--accent-over);

  /* Category tones (Notion dark palette) */
  --tone-gray: #9B9B9B;
  --tone-brown: #BA856A;
  --tone-orange: #E0884A;
  --tone-yellow: #DFAB01;
  --tone-green: #4DAB9A;
  --tone-blue: #529CCA;
  --tone-purple: #9A6DD7;
  --tone-pink: #E255A1;
  --tone-red: #FF7369;

  /* Shape & rhythm */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --gap: 16px;
  --card-pad: clamp(12px, 4vw, 16px);
  --grid-gap: clamp(6px, 2vw, 8px);
  --tap: 56px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  --font-num: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, sans-serif;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Light theme (Notion Light) */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-raised: #EBEBE8;
  --divider: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(0, 0, 0, 0.32);
  --border-dashed: rgba(0, 0, 0, 0.2);
  --backdrop: rgba(0, 0, 0, 0.35);

  --text: #191919;
  --text-muted: #6B6B6B;
  --text-faint: #A5A5A2;
  --placeholder: #B4B4B0;

  /* Fills keep brand hue; text variants are darker for contrast on white */
  --accent-ok: #00C853;
  --accent-warn: #FFB300;
  --accent-high: #FB8C00;
  --accent-over: #F44336;
  --text-ok: #00873C;
  --text-warn: #9A7200;
  --text-high: #B85A00;
  --text-over: #D32F2F;

  --tone-gray: #787774;
  --tone-brown: #9F6B53;
  --tone-orange: #D9730D;
  --tone-yellow: #CB912F;
  --tone-green: #448361;
  --tone-blue: #337EA9;
  --tone-purple: #9065B0;
  --tone-pink: #C14C8A;
  --tone-red: #D44C47;
}

/* Charts (bars): lifted primary so purple reads on dark surfaces */
:root { --chart-bar: #9B4DDB; }
:root[data-theme="light"] { --chart-bar: #6A0DAD; }
