.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.toggle-switch.is-disabled {
  opacity: 0.55;
}

/* Size tokens */
.toggle-switch.is-sm{
  --ts-w: 32px;
  --ts-h: 18px;
  --ts-pad: 2px;
  --ts-thumb: 14px;
}

.toggle-switch.is-md {
  --ts-w: 36px;
  --ts-h: 20px;
  --ts-pad: 2px;
  --ts-thumb: 16px;
}

/* button wrapper */
.ts-switch {
  position: relative;
  width: var(--ts-w);
  height: var(--ts-h);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.ts-switch:disabled {
  cursor: not-allowed;
}

/* track */
.ts-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #E1E4EA; /* off */
  transition: background-color 120ms ease;
}

/* thumb */
.ts-thumb {
  position: absolute;
  top: var(--ts-pad);
  left: var(--ts-pad);
  width: var(--ts-thumb);
  height: var(--ts-thumb);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform 120ms ease;
}

/* travel = w - (2*pad) - thumb */
.ts-switch.is-on .ts-thumb {
  transform: translateX(calc(var(--ts-w) - (var(--ts-pad) * 2) - var(--ts-thumb)));
}

.ts-switch.is-on .ts-track {
  background: #1e9f22;
}

.ts-switch:focus-visible .ts-track {
  outline: 2px solid rgba(255, 140, 0, 0.55);
  outline-offset: 2px;
}

.ts-label {
  color: #8D92A5;
  user-select: none;
  white-space: nowrap;
}