:root {
  color-scheme: light;

  --font-ui: "Prompt", "Sarabun", "Helvetica Neue", Arial, sans-serif;
  --radius-control: 0.75rem;
  --radius-card: 1rem;
  --radius-pill: 9999px;
  --duration-fast: 120ms;
  --duration-standard: 180ms;
  --duration-emphasis: 240ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  --shadow-card: 0 1px 2px rgb(33 26 36 / 0.06), 0 8px 20px rgb(33 26 36 / 0.04);
  --shadow-raised: 0 8px 24px rgb(33 26 36 / 0.12);
  --shadow-overlay: 0 16px 40px rgb(33 26 36 / 0.18);
  --shadow-action: 0 8px 18px rgb(0 102 107 / 0.2);

  /* Verified PEA CI values used only as restrained brand anchors. */
  --color-brand-primary: 116 4 95;
  --color-brand-secondary: 199 145 27;
  --color-brand-on-primary: 255 255 255;

  /* Application actions. */
  --color-action-primary: 0 102 107;
  --color-action-primary-hover: 0 84 90;
  --color-action-primary-active: 0 70 75;
  --color-action-secondary: 243 234 241;
  --color-action-secondary-content: 116 4 95;
  --color-action-destructive: 185 28 28;
  --color-action-destructive-hover: 153 27 27;
  --color-action-destructive-active: 127 29 29;
  --color-action-on-destructive: 255 255 255;
  --color-action-disabled: 213 209 216;
  --color-focus-ring: 124 58 237;

  /* Surfaces. */
  --color-page: 247 247 250;
  --color-surface: 255 255 255;
  --color-surface-raised: 255 255 255;
  --color-surface-muted: 240 241 245;
  --color-overlay: 33 26 36;

  /* Content. */
  --color-content-primary: 33 26 36;
  --color-content-secondary: 81 74 85;
  --color-content-muted: 105 97 110;
  --color-content-on-primary: 255 255 255;
  --color-content-disabled: 92 84 97;

  /* Borders and focus. */
  --color-border-default: 213 208 216;
  --color-border-strong: 130 119 134;
  --color-border-focus: 124 58 237;

  /* General semantic states. */
  --color-status-success: 4 120 87;
  --color-status-success-surface: 236 253 245;
  --color-status-success-content: 6 95 70;
  --color-status-warning: 180 83 9;
  --color-status-warning-surface: 255 251 235;
  --color-status-warning-content: 146 64 14;
  --color-status-error: 185 28 28;
  --color-status-error-surface: 254 242 242;
  --color-status-error-content: 153 27 27;
  --color-status-info: 29 78 216;
  --color-status-info-surface: 239 246 255;
  --color-status-info-content: 30 64 175;

  /* Submission business states remain distinct from general semantics. */
  --color-status-pending-ai: 37 99 235;
  --color-status-pending-ai-surface: 239 246 255;
  --color-status-pending-ai-content: 30 64 175;
  --color-status-pending-review: 217 119 6;
  --color-status-pending-review-surface: 255 251 235;
  --color-status-pending-review-content: 146 64 14;
  --color-status-approved: 5 150 105;
  --color-status-approved-surface: 236 253 245;
  --color-status-approved-content: 6 95 70;
  --color-status-rejected: 220 38 38;
  --color-status-rejected-surface: 254 242 242;
  --color-status-rejected-content: 153 27 27;
  --color-status-provider-failure: 124 58 237;
  --color-status-provider-failure-surface: 245 243 255;
  --color-status-provider-failure-content: 91 33 182;

  /* Motivation, activity, rewards, and rank. */
  --color-activity-progress: 95 133 0;
  --color-activity-energy: 184 240 0;
  --color-activity-streak: 194 65 12;
  --color-achievement: 109 40 217;
  --color-reward-highlight: 122 82 0;
  --color-reward-surface: 255 247 224;
  --color-leaderboard-first: 122 82 0;
  --color-leaderboard-second: 95 100 112;
  --color-leaderboard-third: 154 77 36;

  /* Temporary aliases preserve unmigrated page-level styling through UI Batches 2-4. */
  --color-legacy-pea-green: 4 120 87;
  --color-legacy-pea-green-dark: 6 95 70;
  --color-legacy-pea-teal: 17 138 178;
  --color-legacy-pea-canvas: 246 248 250;
  --color-legacy-pea-surface: 255 255 255;
  --color-legacy-pea-slate: 15 23 42;
  --color-legacy-pea-muted: 100 116 139;
}

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

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.24), 0 8px 20px rgb(0 0 0 / 0.16);
  --shadow-raised: 0 8px 24px rgb(0 0 0 / 0.34);
  --shadow-overlay: 0 16px 40px rgb(0 0 0 / 0.46);
  --shadow-action: 0 8px 18px rgb(45 212 191 / 0.16);

  --color-brand-primary: 116 4 95;
  --color-brand-secondary: 199 145 27;
  --color-brand-on-primary: 255 255 255;

  --color-action-primary: 45 212 191;
  --color-action-primary-hover: 94 234 212;
  --color-action-primary-active: 20 184 166;
  --color-action-secondary: 53 45 57;
  --color-action-secondary-content: 250 247 251;
  --color-action-destructive: 248 113 113;
  --color-action-destructive-hover: 252 165 165;
  --color-action-destructive-active: 239 68 68;
  --color-action-on-destructive: 43 7 7;
  --color-action-disabled: 77 67 82;
  --color-focus-ring: 196 181 253;

  --color-page: 23 19 26;
  --color-surface: 33 27 37;
  --color-surface-raised: 44 36 48;
  --color-surface-muted: 53 45 57;
  --color-overlay: 15 12 17;

  --color-content-primary: 250 247 251;
  --color-content-secondary: 214 205 216;
  --color-content-muted: 175 164 178;
  --color-content-on-primary: 13 31 32;
  --color-content-disabled: 200 189 203;

  --color-border-default: 77 67 82;
  --color-border-strong: 119 106 123;
  --color-border-focus: 196 181 253;

  --color-status-success: 52 211 153;
  --color-status-success-surface: 2 44 34;
  --color-status-success-content: 167 243 208;
  --color-status-warning: 251 191 36;
  --color-status-warning-surface: 69 26 3;
  --color-status-warning-content: 253 230 138;
  --color-status-error: 248 113 113;
  --color-status-error-surface: 69 10 10;
  --color-status-error-content: 254 202 202;
  --color-status-info: 96 165 250;
  --color-status-info-surface: 23 37 84;
  --color-status-info-content: 191 219 254;

  --color-status-pending-ai: 96 165 250;
  --color-status-pending-ai-surface: 23 37 84;
  --color-status-pending-ai-content: 191 219 254;
  --color-status-pending-review: 251 191 36;
  --color-status-pending-review-surface: 69 26 3;
  --color-status-pending-review-content: 253 230 138;
  --color-status-approved: 52 211 153;
  --color-status-approved-surface: 2 44 34;
  --color-status-approved-content: 167 243 208;
  --color-status-rejected: 248 113 113;
  --color-status-rejected-surface: 69 10 10;
  --color-status-rejected-content: 254 202 202;
  --color-status-provider-failure: 167 139 250;
  --color-status-provider-failure-surface: 46 16 101;
  --color-status-provider-failure-content: 221 214 254;

  --color-activity-progress: 163 230 53;
  --color-activity-energy: 163 230 53;
  --color-activity-streak: 251 146 60;
  --color-achievement: 196 181 253;
  --color-reward-highlight: 243 196 92;
  --color-reward-surface: 59 43 11;
  --color-leaderboard-first: 243 196 92;
  --color-leaderboard-second: 203 213 225;
  --color-leaderboard-third: 253 186 116;

  --color-legacy-pea-green: 45 212 191;
  --color-legacy-pea-green-dark: 20 184 166;
  --color-legacy-pea-teal: 96 165 250;
  --color-legacy-pea-canvas: 23 19 26;
  --color-legacy-pea-surface: 33 27 37;
  --color-legacy-pea-slate: 250 247 251;
  --color-legacy-pea-muted: 175 164 178;
}
