.apple-switch {
  --apple-switch-accent: #4f83dd;
  --active-p: 0;
  --grab-p: 0;
  --thumb-x: 0px;
  --thumb-size: 20px;
  --thumb-travel: 16px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #343b48;
  font: inherit;
  font-size: .75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.apple-switch--neutral {
  --apple-switch-accent: #34c759;
}

.apple-switch--accent {
  --apple-switch-accent: #4f83dd;
}

.apple-switch__description {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.apple-switch__label {
  order: 0;
}

.apple-switch[data-label-side="right"] .apple-switch__label {
  order: 1;
}

.apple-switch__track {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 26px;
  --thumb-size: 20px;
  --thumb-travel: 16px;
  overflow: visible;
  border: 1px solid rgba(60, 70, 86, .07);
  border-radius: 999px;
  background: #d1d1d6;
  box-shadow: inset 0 1px 1px rgba(34, 45, 61, .07),
    0 0 calc(var(--active-p) * 11px) color-mix(in srgb, var(--apple-switch-accent) calc(var(--active-p) * 24%), transparent);
  transition: background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.apple-switch--sm .apple-switch__track {
  width: 36px;
  height: 22px;
  --thumb-size: 16px;
  --thumb-travel: 14px;
}

.apple-switch--lg .apple-switch__track {
  width: 50px;
  height: 30px;
  --thumb-size: 24px;
  --thumb-travel: 20px;
}

.apple-switch__fill {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--apple-switch-accent);
  opacity: var(--active-p);
  transform: scaleX(var(--active-p));
  transform-origin: left center;
  pointer-events: none;
}

.apple-switch__thumb {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 2px;
  display: block;
  width: calc(var(--thumb-size) + var(--grab-p) * 8px);
  height: var(--thumb-size);
  margin-left: calc(var(--grab-p) * -4px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .24), 0 1px 1px rgba(0, 0, 0, .08);
  opacity: calc(1 - var(--grab-p) * .8);
  transform: translate3d(var(--thumb-x), -50%, 0);
  transform-origin: center;
  will-change: width, margin-left, opacity, transform;
  pointer-events: none;
}

.apple-switch__thumb::before {
  position: absolute;
  inset: -2px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: inherit;
  background: rgba(255, 255, 255, .68);
  opacity: calc(var(--grab-p) * .92);
  transform: scale(calc(.72 + var(--grab-p) * .28));
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  content: "";
  pointer-events: none;
}

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

#footer.footer-night-mode .apple-switch {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .apple-switch__track,
  .apple-switch__fill,
  .apple-switch__thumb,
  .apple-switch__thumb::before {
    transition: none !important;
  }
}
