:root,
:root[data-theme="light"] {
  color-scheme: light;
  --theme-page: #f1f5f9;
  --theme-surface: #ffffff;
  --theme-surface-raised: #f8fafc;
  --theme-text: #172338;
  --theme-muted: #475569;
  --theme-line: #c4cfdd;
  --theme-input: #ffffff;
  --theme-button: #e8edf3;
  --theme-button-hover: #dce4ed;
  --theme-shadow: 0 14px 34px #1d2b3a1f;
  --theme-focus: #2563eb;
  --theme-success: #257145;
  --theme-warning: #754600;
  --theme-danger: #9c2334;
  --theme-link: #1e4cb0;
  --theme-orange: #9a3412;
  --theme-danger-bg: #fce8eb;
  --theme-warning-bg: #fff2da;
  --theme-success-bg: #e5f5eb;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-page: #09090b;
  --theme-surface: #18181b;
  --theme-surface-raised: #27272a;
  --theme-text: #f4f4f5;
  --theme-muted: #a1a1aa;
  --theme-line: #3f3f46;
  --theme-input: #111113;
  --theme-button: #27272a;
  --theme-button-hover: #3f3f46;
  --theme-shadow: 0 18px 40px #0006;
  --theme-focus: #a78bfa;
  --theme-success: #86efac;
  --theme-warning: #facc15;
  --theme-danger: #ffadb7;
  --theme-link: #9ac3ff;
  --theme-orange: #ffb77b;
  --theme-danger-bg: #3f2129;
  --theme-warning-bg: #392d1c;
  --theme-success-bg: #173327;
}

.app-theme-switch {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  background: var(--theme-button);
  color: var(--theme-muted);
  box-shadow: none;
  cursor: pointer;
}
.app-theme-switch:hover { background: var(--theme-button-hover); }
.app-theme-switch:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }
.app-theme-switch__icon { width: 20px; height: 20px; fill: currentColor; }
:root[data-theme="light"] .app-theme-switch { color: #b56a00; background: #fff4c2; border-color: #e5b84d; }
:root[data-theme="light"] .app-theme-switch__icon { filter: drop-shadow(0 0 5px #fbbf24); }

body { background: var(--theme-page); color: var(--theme-text); }
a { color: var(--theme-link); }
:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }

:root[data-theme="navy"] {
  color-scheme: dark;
  --theme-page: #0c1527;
  --theme-surface: #16243d;
  --theme-surface-raised: #1d2f4d;
  --theme-text: #f0f5ff;
  --theme-muted: #b7c8e3;
  --theme-line: #526785;
  --theme-input: #101c31;
  --theme-button: #23395a;
  --theme-button-hover: #304c73;
  --theme-shadow: 0 16px 38px #050a1680;
  --theme-focus: #a9d8ff;
  --theme-success: #a3edc6;
  --theme-warning: #ffda8b;
  --theme-danger: #ffc0c6;
  --theme-link: #b2d8ff;
  --theme-orange: #ffc28f;
  --theme-danger-bg: #462434;
  --theme-warning-bg: #3b2e20;
  --theme-success-bg: #19382f;
}

:root[data-theme="contrast"] {
  color-scheme: dark;
  --theme-page: #020202;
  --theme-surface: #121212;
  --theme-surface-raised: #1b1b1b;
  --theme-text: #ffffff;
  --theme-muted: #e4e4e4;
  --theme-line: #a6a6a6;
  --theme-input: #080808;
  --theme-button: #232323;
  --theme-button-hover: #343434;
  --theme-shadow: none;
  --theme-focus: #ffea70;
  --theme-success: #a9ffb8;
  --theme-warning: #ffe66c;
  --theme-danger: #ffb4bc;
  --theme-link: #b4dfff;
  --theme-orange: #ffca9b;
  --theme-danger-bg: #370e18;
  --theme-warning-bg: #342600;
  --theme-success-bg: #0c2915;
}

:root[data-theme="glass"] {
 color-scheme:dark;
 --theme-page:#0b0b10; --theme-surface:#171820; --theme-surface-raised:#22232c;
 --theme-text:#f7f7fa; --theme-muted:#c4c6d1; --theme-line:#656775;
 --theme-input:#14151d; --theme-button:#252630; --theme-button-hover:#373947;
 --theme-shadow:0 15px 34px #0009; --theme-focus:#ffd5ca;
 --theme-success:#9ff1c7; --theme-warning:#ffda98; --theme-danger:#ffaf97;
 --theme-link:#b7caff; --theme-orange:#ffd1a0; --theme-danger-bg:#2b1513;
 --theme-warning-bg:#25201c; --theme-success-bg:#182b26;
}
