:root {
  --surface: #fff;
  --edge: var(--ink);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151320;
  --surface: #201d30;
  --soft: #1a1829;
  --track: #2c2842;
  --ink: #f3efff;
  --text: #ded6f0;
  --muted: #c3b9d8;
  --faint: #b0a5c8;
  --edge: #776e94;
  --violet-dark: #c4b7ff;
  --green-ink: #92e0b6;
  --lilac: #2c2546;
  --mint: #193730;
  --butter: #362d20;
  --sky: #242d4a;
  --peach: #372633;
  --stk-lilac: #41345f;
  --stk-mint: #254b3f;
  --stk-yellow: #554322;
  --stk-sky: #303c64;
  --stk-peach: #573745;
  --bar-bg: rgba(27, 24, 40, .96);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: var(--line-thin);
  border-radius: 50%;
  background: var(--surface);
  font-family: system-ui, sans-serif;
  font-size: 23px;
  line-height: 1;
}

.theme-toggle::before { content: "☾"; }
.theme-toggle[aria-pressed="true"]::before { content: "☀"; }
.theme-toggle:hover { background: var(--track); }

[data-theme="dark"] :focus-visible { outline-color: var(--violet-dark); }
[data-theme="dark"] .mark i { color: var(--violet-dark); }
[data-theme="dark"] .search input::placeholder { color: var(--faint); }

[data-theme="dark"] .hero-float {
  border-color: var(--edge);
  background: linear-gradient(150deg, var(--surface), var(--lilac));
  box-shadow: 0 12px 30px #08071055;
}

[data-theme="dark"] :is(.hero-float.gpt, .hero-float.grok) img {
  filter: invert(1);
}

[data-theme="dark"] .status,
[data-theme="dark"] .field .input-error { color: #ffb4ad; }
[data-theme="dark"] .field input[aria-invalid="true"],
[data-theme="dark"] .note.purchase-alert {
  background: #3e222d;
  border-color: #dc827c;
  color: #ffb4ad;
}
[data-theme="dark"] .nav-next:disabled {
  background: var(--track);
  color: var(--muted);
}
