:root {
  color-scheme: dark;
  color: #f3f0fa;
  background: #100f17;
  --page: #100f17;
  --text: #f3f0fa;
  --surface: #181620;
  --raised: #201d2b;
  --section: #14121c;
  --line: #373246;
  --muted: #b4adbf;
  --accent: #c1a8ff;
  --accent-ink: #e5d7ff;
  --action: #7345dc;
  --action-hover: #8052e7;
  --field: #0e0d15;
  --field-line: #514762;
  --placeholder: #ae9fbe;
  --selected: #241d33;
  --selected-line: #a484ef;
  --chip: #2a2138;
  --chip-line: #4f405f;
  --positive: #bbf0d7;
  --danger: #ffb5c9;
  --danger-surface: #301c27;
  --danger-line: #674154;
  --hero-core: #2d214d;
  --hero-mid: #171322;
  --hero-orbit: #bca3ff32;
  --card-ink: #f3f0fa;
  --card-muted: #c7b9d8;
  --card: #261e38;
  --card-chip: #ffffff19;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="light"] {
  color-scheme: light;
  color: #211932;
  background: #f6f3fb;
  --page: #f6f3fb;
  --text: #211932;
  --surface: #fff;
  --raised: #eee8f8;
  --section: #f0ebf8;
  --line: #d6cce5;
  --muted: #5c526b;
  --accent: #5d36a7;
  --accent-ink: #4d2d87;
  --action: #6740bb;
  --action-hover: #5832ab;
  --field: #fcfaff;
  --field-line: #a99abb;
  --placeholder: #665777;
  --selected: #ede4fb;
  --selected-line: #7651bc;
  --chip: #eee5fa;
  --chip-line: #cbb8e2;
  --positive: #2a654b;
  --danger: #9c3150;
  --danger-surface: #faeaf0;
  --danger-line: #dba3b7;
  --hero-core: #e6d9fc;
  --hero-mid: #f1e9fa;
  --hero-orbit: #673bb730;
  --card-ink: #372057;
  --card-muted: #5f4879;
  --card: #ebe2f9;
  --card-chip: #68479b18;
}

button.theme-toggle {
  display: inline-grid; flex: 0 0 42px; place-items: center;
  width: 42px; height: 42px; min-height: 42px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--accent-ink); background: var(--surface);
}
button.theme-toggle:hover:not(:disabled) { color: var(--text); background: var(--raised); }
button.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle svg {
  grid-area: 1 / 1; width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65;
  opacity: 0; transform: scale(.55) rotate(-25deg);
  transition: opacity .24s var(--ease), transform .3s var(--ease);
}
:root:not([data-theme="light"]) .theme-toggle .theme-sun,
[data-theme="light"] .theme-toggle .theme-moon { opacity: 1; transform: scale(1) rotate(0); }
.theme-switching::view-transition-old(root),
.theme-switching::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-switching::view-transition-new(root) { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle svg { transition: none; }
}
