/* The visible track follows the existing native or ARIA state. */
#app :is(.peer + .base-switch, input[role="switch"], button[role="switch"]) {
  --switch-thumb: #928777;
  position: relative;
  display: inline-block;
  flex: none;
  box-sizing: border-box;
  width: 44px;
  height: 24px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 2px solid #453c30;
  border-radius: 7px;
  background: #eee4ca;
  box-shadow: none;
  vertical-align: middle;
}

#app :is(.peer + .base-switch, input[role="switch"], button[role="switch"])::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 1px solid #514535;
  border-radius: 4px;
  background: var(--switch-thumb);
  transform: translateX(0);
  transition: transform 140ms ease-out, background-color 140ms ease-out;
  pointer-events: none;
}

#app button[role="switch"] > span.absolute { display: none; }
#app :is(.peer:checked + .base-switch, input[role="switch"]:checked, button[role="switch"][aria-checked="true"])::after {
  background: #ed872f;
  transform: translateX(20px);
}
#app :is(.peer:focus-visible + .base-switch, [role="switch"]:focus-visible) {
  outline: 2px solid #945017;
  outline-offset: 2px;
}
.dark #app :is(.peer + .base-switch, input[role="switch"], button[role="switch"]) {
  --switch-thumb: #948b7c;
  background: #c6baa1;
  border-color: #382f26;
}
.dark #app :is(.peer:focus-visible + .base-switch, [role="switch"]:focus-visible) { outline-color: #ffba71; }
@media (prefers-reduced-motion: reduce) {
  #app :is(.peer + .base-switch, [role="switch"])::after { transition: none; }
}
