.toggle-switch + label + label + label > :first-child {
  appearance: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 1.5em;
  width: 3em;
  display: block;
  box-sizing: border-box;
  border-radius: 9999px;
  color: rgb(var(--color-primary));
}

.toggle-switch:checked + label + label + label > :first-child {
  color: rgb(var(--color-tertiary));
}

.toggle-switch:focus + label + label + label > :first-child {
  color: rgb(var(--color-secondary));
}

.toggle-switch + label:active + label + label > :first-child {
  color: rgb(var(--color-tertiary));
}

.toggle-switch + label + label:active + label > :first-child {
  color: rgb(var(--color-tertiary));
}

.toggle-switch + label + label + label:active > :first-child {
  color: rgb(var(--color-tertiary));
}

.toggle-switch + label + label + label > :first-child > :first-child {
  width: 100%;
  height: 100%;
  background-color: rgb(var(--color-primary) / 50%);
  border-radius: 9999px;
  display: block;
  box-sizing: border-box;
  background-clip: content-box;
  padding: 0.25em;
  appearance: none;
}

.toggle-switch:checked + label + label + label > :first-child > :first-child {
  background-color: rgb(var(--color-tertiary) / 50%);
}

.toggle-switch:focus + label + label + label > :first-child > :first-child {
  background-color: rgb(var(--color-secondary) / 50%);
}

.toggle-switch + label:active + label + label > :first-child > :first-child {
  background-color: rgb(var(--color-tertiary) / 50%);
}

.toggle-switch + label + label:active + label > :first-child > :first-child {
  background-color: rgb(var(--color-tertiary) / 50%);
}

.toggle-switch + label + label + label:active > :first-child > :first-child {
  background-color: rgb(var(--color-tertiary) / 50%);
}

.toggle-switch + label + label + label > :first-child > :first-child > :first-child {
  appearance: none;
  border-radius: 9999px;
  display: block;
  width: 100%;
  height: 100%;
  margin: -0.25em;
  box-sizing: border-box;
  background-clip: content-box;
}

.toggle-switch + label + label + label > :first-child > :first-child > :first-child > :first-child {
  width: 1.5em;
  height: 1.5em;
  margin: -0.25em 0 0 0;
  display: block;
  border-radius: 9999px;
  background-color: currentColor;
  appearance: none;
  aspect-ratio: 1 / 1;
  z-index: 1;
  position: relative;
  box-shadow: -100000.5em 0 0 100000em rgb(var(--color-primary) / 50%);
}

.toggle-switch:checked + label + label + label > :first-child > :first-child > :first-child > :first-child {
  margin-left: calc(100% - 1em);
}

.toggle-switch:indeterminate + label + label + label > :first-child > :first-child > :first-child > :first-child {
  margin-left: calc(50% - 0.5em);
}

.toggle-switch:checked + label + label + label > :first-child > :first-child > :first-child > :first-child {
  box-shadow: -100000.5em 0 0 100000em rgb(var(--color-tertiary) / 50%);
}

.toggle-switch:focus + label + label + label > :first-child > :first-child > :first-child > :first-child {
  box-shadow: -100000.5em 0 0 100000em rgb(var(--color-secondary) / 50%);
}

.toggle-switch + label:active + label + label > :first-child > :first-child > :first-child > :first-child {
  box-shadow: -100000.5em 0 0 100000em rgb(var(--color-tertiary) / 50%);
}

.toggle-switch + label + label:active + label > :first-child > :first-child > :first-child > :first-child {
  box-shadow: -100000.5em 0 0 100000em rgb(var(--color-tertiary) / 50%);
}

.toggle-switch + label + label + label:active > :first-child > :first-child > :first-child > :first-child {
  box-shadow: -100000.5em 0 0 100000em rgb(var(--color-tertiary) / 50%);
}

