.switch {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border-muted);
  border-radius: 0.1875rem;
  transition: 0.15s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 0.75rem;
  width: 0.75rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: var(--color-text-secondary);
  transition: 0.15s;
  border-radius: 1px;
}

.switch input:checked + .slider {
  background-color: var(--color-bg-base);
  border-color: var(--color-accent);
}

.switch input:checked + .slider:before {
  transform: translateX(1.125rem);
  background-color: var(--color-accent);
}

.switch input:disabled + .slider {
  opacity: 0.35;
  cursor: not-allowed;
}

.switch input:disabled + .slider:before {
  cursor: not-allowed;
}

.switch input:focus-visible + .slider {
  outline: 0.125rem solid var(--color-accent);
  outline-offset: 0.125rem;
}
