
:root {
  --sw-slide: var(--motion-d-switch);
  --sw-ease: var(--motion-ease-in-out);
  --sw-press: var(--motion-d-switch-press);
}

:is(.mp-seg-thumb, .wf-rings-thumb) {
  transform: translateX(calc(var(--seg-shift) * var(--seg-direction, 1)));
  transition-property: var(--seg-transition-properties, transform);
  transition-duration: var(--motion-d-content);
  transition-timing-function: var(--motion-ease-spring);
}

[dir="rtl"] :is(.mp-seg-thumb, .wf-rings-thumb) { --seg-direction: -1; }

.toggle-row input[type="checkbox"]::before,
.mp-switch-track::before {
  transition: transform var(--sw-slide) var(--sw-ease);
}
.toggle-row input[type="checkbox"],
.mp-switch-track {
  transition: background-color var(--sw-slide) var(--sw-ease);
}

.toggle-row input[type="checkbox"].sw-moving::before,
.mp-switch input.sw-moving + .mp-switch-track::before {
  animation: sw-thumb-press var(--sw-press) var(--sw-ease);
}

@keyframes sw-thumb-press {
  0% { scale: var(--sw-from, 1); }
  28% { scale: 0.84; }
  62% { scale: 0.88; }
  100% { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .toggle-row input[type="checkbox"]::before,
  .mp-switch-track::before,
  .toggle-row input[type="checkbox"],
  .mp-switch-track { transition: none; }
  .toggle-row input[type="checkbox"].sw-moving::before,
  .mp-switch input.sw-moving + .mp-switch-track::before { animation: none; }
}
