/* Shared AURORA appearance control. These tokens stay within the existing palette. */
:root {
  --appearance-surface: #ffffff;
  --appearance-text: #252a3b;
  --appearance-muted: #657087;
  --appearance-accent: #715cb9;
  --appearance-soft: #f0ecfa;
  --appearance-edge: #e8ecf3;
  --appearance-shadow: 0 12px 36px #26355014, 0 2px 8px #26355006;
}
:root[data-theme="dark"] {
  --appearance-surface: #1c2130;
  --appearance-text: #edf0f7;
  --appearance-muted: #939fb7;
  --appearance-accent: #c1afea;
  --appearance-soft: #afa0da14;
  --appearance-edge: #ffffff0a;
  --appearance-shadow: 0 16px 48px #00000033, 0 2px 8px #00000014;
}
.aurora-theme-switcher { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; vertical-align: middle; min-width: 0; }
/* Reserve the control slot without flashing a native select before enhancement. */
select:is([data-site-theme], #appearance-select, [data-theme-select], [data-admin-theme], [data-aurora-theme]) { visibility: hidden; }
.aurora-theme-switcher .aurora-theme-trigger {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 80px; height: 38px; min-height: 38px; margin: 0; padding: 0 8px;
  border: 0; border-radius: 22px; background: transparent; box-shadow: none;
  color: var(--appearance-muted); font: 500 13px/1.2 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0; text-transform: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.aurora-theme-switcher .aurora-theme-trigger:hover,
.aurora-theme-switcher .aurora-theme-trigger[aria-expanded="true"] { background: var(--appearance-soft); color: var(--appearance-text); transform: none; }
.aurora-theme-switcher .aurora-theme-trigger:focus-visible,
.aurora-theme-menu .aurora-theme-option:focus-visible { outline: 2px solid var(--appearance-accent); outline-offset: 3px; }
.aurora-theme-icon { display: block; width: 17px; height: 17px; min-width: 17px; flex: 0 0 17px; stroke-width: 1.55; }
.aurora-theme-label { display: inline; color: inherit; font: inherit; }
.aurora-theme-menu {
  position: fixed; z-index: 10000; box-sizing: border-box; width: 240px; max-width: calc(100vw - 24px);
  margin: 0; padding: 6px; border: 1px solid var(--appearance-edge); border-radius: 16px;
  background: var(--appearance-surface); color: var(--appearance-text); box-shadow: var(--appearance-shadow);
  font-family: "Helvetica Neue", Arial, sans-serif; isolation: isolate;
}
.aurora-theme-menu[hidden], [data-aurora-theme-native] { display: none !important; }
.aurora-theme-menu[data-open="true"] { animation: aurora-theme-reveal 140ms ease-out both; }
.aurora-theme-menu .aurora-theme-option {
  appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  margin: 0; padding: 10px 12px; border: 0; border-radius: 11px;
  background: transparent; box-shadow: none; color: var(--appearance-muted);
  font: 400 13px/1.35 "Helvetica Neue", Arial, sans-serif; letter-spacing: 0; text-transform: none; text-align: left;
  cursor: pointer; transition: background-color 140ms ease, color 140ms ease;
}
.aurora-theme-menu .aurora-theme-option:hover,
.aurora-theme-menu .aurora-theme-option:focus-visible { background: var(--appearance-soft); color: var(--appearance-text); transform: none; }
.aurora-theme-menu .aurora-theme-option[aria-checked="true"] { background: var(--appearance-soft); color: var(--appearance-accent); }
.aurora-theme-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.aurora-theme-name { color: var(--appearance-text); font-size: 13px; font-weight: 500; line-height: 1.3; }
.aurora-theme-description { color: var(--appearance-muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
.aurora-theme-check { width: 15px; height: 15px; flex: 0 0 15px; color: var(--appearance-accent); }
.aurora-theme-option[aria-checked="false"] .aurora-theme-check { visibility: hidden; }
.settings-section > .aurora-theme-switcher { margin: 14px 0 22px; }
.auth-topbar > .aurora-theme-switcher { margin-left: auto; }
.topbar-controls > .aurora-theme-switcher { justify-content: center; }
html.aurora-theme-changing body,
html.aurora-theme-changing :is(header, aside, nav, main, section, article, footer, dialog, table, th, td, input, select, textarea, button, a, .header-shell, .panel, .card, .topbar, .aurora-theme-menu) {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: ease;
}
@keyframes aurora-theme-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media(max-width: 600px) {
  .site-header .header-utilities > .aurora-theme-switcher { grid-column: 2; grid-row: 1; justify-self: start; margin-right: 48px; }
}
@media(max-width: 380px) { .site-header .header-utilities > .aurora-theme-switcher { margin-right: 43px; } }
@media(prefers-reduced-motion: reduce) {
  .aurora-theme-menu[data-open="true"] { animation: none; }
  html.aurora-theme-changing *, .aurora-theme-switcher .aurora-theme-trigger, .aurora-theme-menu .aurora-theme-option { transition: none !important; }
}
