

.em-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 36px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--border-strong, #444);
  cursor: pointer;
  transition: background 0.15s ease;
  
  vertical-align: middle;
}

.em-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-secondary, #ccc);
  transition: transform 0.15s ease, background 0.15s ease;
}
.em-switch:checked {
  background: var(--accent, #5b8def);
}
.em-switch:checked::before {
  transform: translateX(16px);
  background: #fff;
}
.em-switch:hover:not(:disabled) {
  background: color-mix(in srgb, var(--border-strong, #444) 70%, #fff 30%);
}
.em-switch:checked:hover:not(:disabled) {
  background: var(--accent-hover, #4a7de0);
}
.em-switch:focus-visible {
  outline: 2px solid var(--accent, #5b8def);
  outline-offset: 2px;
}

.em-switch:disabled {
  opacity: 0.5;
  cursor: default;
}


.em-switch--sm {
  width: 30px;
  height: 16px;
}
.em-switch--sm::before {
  width: 12px;
  height: 12px;
}
.em-switch--sm:checked::before {
  transform: translateX(14px);
}

@media (prefers-reduced-motion: reduce) {
  .em-switch,
  .em-switch::before {
    transition: none;
  }
}
