/* Theme layer: load after design-tokens.css and before components.css. */
:root,
[data-theme="light"] { color-scheme: light; }

[data-theme="dark"] {
  color-scheme: dark;
  --bg-base: #17130F;
  --bg-surface: #211B16;
  --bg-elevated: #2A231D;
  --bg-soft: #332B24;
  --bg-control-idle: #40372F;
  --bg-translucent: rgb(33 27 22 / 88%);
  --overlay-hover: rgb(255 255 255 / 8%);
  --overlay-pressed: rgb(255 255 255 / 13%);
  --focus-halo: rgb(255 126 82 / 28%);
  --scrim: rgb(0 0 0 / 68%);
  --border-subtle: #42372E;
  --border-default: #A89D93;
  --border-disabled: #5C5148;
  --border-shadow: #0E0B09;
  --shadow-pop-color: #0E0B09;
  --text-primary: #FFF9F3;
  --text-secondary: #DDD4CC;
  --text-muted: #BDB2A9;
  --text-disabled: #756A61;
  --text-inverse: #201B14;
  --brand-primary: #FF7040;
  --accent: #FF8A62;
  --accent-solid: #FF7040;
  --accent-solid-hover: #FF8A62;
  --accent-solid-active: #D84A1C;
  --accent-soft: #50271C;
  --on-accent-active: #000000;
  --success-fg: #74E0AD;
  --warning-fg: #FFD06A;
  --danger-fg: #FF78B7;
  --info-fg: #79D9F2;
  --success-bg: #173628;
  --warning-bg: #3D2D12;
  --danger-bg: #43182C;
  --info-bg: #143340;
  --decor-coral-soft: #50271C;
  --decor-sun: #E9BE3D;
  --decor-sun-hover: #FFD967;
  --decor-sun-active: #BD941F;
  --decor-mint: #45B98A;
  --decor-sky: #4AA8E6;
  --decor-grape: #9278DA;
  --decor-sun-soft: #3D3217;
  --decor-mint-soft: #17392D;
  --decor-sky-soft: #173647;
  --decor-grape-soft: #30264B;
  --gradient-shimmer: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 10%) 50%, transparent 80%);

  /* on-* tokens are pinned per theme, not inherited from text-primary/text-inverse:
     those two flip meaning between themes (near-white vs ink), but the solid/decor
     backgrounds they sit on don't move with them, so the alias breaks silently. */
  --on-accent: #000000;
  --on-success: #FFFFFF;
  --on-warning: #FFFFFF;
  --on-danger: #FFFFFF;
  --on-info: #FFFFFF;
  --on-decor: #201B14;
}

[data-theme="high-contrast"] {
  color-scheme: light;
  --bg-base: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-soft: #F1F1F1;
  --bg-control-idle: #E1E1E1;
  --border-subtle: #565656;
  --border-default: #000000;
  --border-disabled: #666666;
  --border-shadow: #000000;
  --shadow-pop-color: #000000;
  --text-primary: #000000;
  --text-secondary: #151515;
  --text-muted: #2A2A2A;
  --text-disabled: #565656;
  --brand-primary: #D93000;
  --accent: #A82500;
  --accent-solid: #F04400;
  --accent-solid-hover: #FF5C1F;
  --accent-solid-active: #8F2200;
  --on-accent-active: #FFFFFF;
  --focus-ring: #005FCC;
  --focus-halo: rgb(0 95 204 / 24%);
  --stroke-default: 3px;
  --stroke-emphasis: 4px;
}

[data-brand="berry"] { --brand-primary: #F24191; --accent: #C51D6B; --accent-solid: #F24191; --accent-solid-hover: #FF6BAB; --accent-solid-active: #A11357; --accent-soft: #FFE3F0; --on-accent-active: #FFFFFF; --focus-ring: #C51D6B; --focus-halo: rgb(197 29 107 / 20%); }
[data-brand="ocean"] { --brand-primary: #17A7D2; --accent: #007A9F; --accent-solid: #25B9E6; --accent-solid-hover: #64CEF0; --accent-solid-active: #00647F; --accent-soft: #DFF7FF; --on-accent-active: #FFFFFF; --focus-ring: #007A9F; --focus-halo: rgb(0 122 159 / 20%); }
[data-brand="lime"] { --brand-primary: #8BCB24; --accent: #4F7C08; --accent-solid: #A7DE50; --accent-solid-hover: #BCEB72; --accent-solid-active: #5D8D11; --accent-soft: #EFFBD8; --on-accent-active: #000000; --focus-ring: #4F7C08; --focus-halo: rgb(79 124 8 / 20%); }

[data-density="compact"] { --control-sm: 2rem; --control-md: 2.375rem; --control-lg: 2.75rem; --space-4: .875rem; --space-5: 1rem; --space-6: 1.25rem; }

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] { color-scheme: dark; }
}
