.switch {
  position: relative;
  flex: none;
  width: var(--switch-width);
  height: var(--switch-height);
  background-color: var(--switch-track);
  border: 1px solid var(--switch-border);
  border-radius: var(--switch-height);
  box-shadow: var(--switch-inset);
  transition: background-color 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: var(--switch-height);
  height: var(--switch-height);
  background-color: var(--switch-thumb);
  border: 1px solid var(--switch-border);
  border-radius: 50%;
  box-shadow: var(--switch-thumb-shadow);
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.2s, border-color 0.2s;
}

.switch[aria-checked="true"] {
  background-color: var(--switch-track-on);
  border-color: var(--switch-border-on);
}

.switch[aria-checked="true"]::after {
  transform: translateX(calc(var(--switch-width) - var(--switch-height)));
  border-color: var(--switch-border-on);
}

.switch:hover::after {
  background-color: var(--switch-thumb-hover);
  border-color: var(--switch-thumb-border-hover);
}

.switch:focus-visible {
  outline: 2px solid var(--switch-focus);
  outline-offset: 2px;
}

.reduce-motion .switch,
.reduce-motion .switch::after {
  transition: none;
}
