:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-switch {
  display: grid; place-items: center; justify-self: end; min-height: 44px; padding: 0 .1rem;
  cursor: pointer; background: none; border: 0; border-radius: 2rem;
}
.switch-track {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 1fr; place-items: center;
  width: 3.75rem; height: 2rem; padding: 2px; border: 1px solid light-dark(#b9b5a8,#686e78);
  border-radius: 2rem; background: light-dark(#e8e5dc,#303641);
}
.switch-track::before {
  content: ""; position: absolute; z-index: -1; left: 2px; top: 2px; bottom: 2px; width: calc(50% - 2px);
  border-radius: 50%; background: light-dark(#fffdf5,#535e70); transform: translateX(0);
  box-shadow: 0 1px 3px #1113;
}
.switch-track svg { width: 1rem; height: 1rem; }
.switch-track svg:first-child { color: light-dark(#80531f,#a6aab2); }
.switch-track svg:last-child { color: light-dark(#777366,#fff1cf); }
.theme-switch:hover .switch-track { border-color: var(--muted); }
.theme-switch[hidden] { display: none; }
:root[data-theme="dark"] .switch-track::before { transform: translateX(100%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .switch-track::before { transform: translateX(100%); }
}
@media (prefers-reduced-motion: no-preference) {
  .switch-track::before { transition: transform .24s cubic-bezier(.22,.8,.25,1), background-color .24s; }
}
