[data-scope='switch'][data-part='root'] {
  display: flex;
  align-items: center;
  position: relative;
  width: fit-content;

  --switch-track-diff: calc(var(--switch-track-width) - var(--switch-track-height));
  --switch-thumb-x: var(--switch-track-diff);
  --switch-track-width: 1.875rem;
  --switch-track-height: 1rem;
}

[data-scope='switch'][data-part='control'] {
  display: inline-flex;
  flex-shrink: 0;
  -webkit-box-pack: start;
  justify-content: flex-start;
  box-sizing: content-box;
  cursor: pointer;
  border-radius: 9999px;
  padding: 0.125rem;
  width: var(--switch-track-width);
  height: var(--switch-track-height);
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-duration: 150ms;

  --switch-bg: #cbd5e0;
  background: var(--switch-bg);
}

[data-scope='switch'][data-part='control'][data-state='checked'] {
  --switch-bg: #3182ce;
}

[data-scope='switch'][data-part='control'][data-focus] {
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.6);
}

[data-scope='switch'][data-part='control'][data-disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

[data-scope='switch'][data-part='thumb'] {
  background: white;
  transition-property: transform;
  transition-duration: 200ms;
  border-radius: inherit;
  width: var(--switch-track-height);
  height: var(--switch-track-height);
  position: relative;
}

[data-scope='switch'][data-part='thumb']:before {
  transition: background-color 0.2s ease-in-out;
  position: absolute;
  --thumb-size: calc(var(--switch-track-height) + 0.7rem);
  height: var(--thumb-size);
  width: var(--thumb-size);
  background-color: transparent;
  content: '';
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: inherit;
}

[data-scope='switch'][data-part='thumb'][data-hover]:before {
  background-color: rgba(0, 0, 0, 0.048);
}
[data-scope='switch'][data-part='thumb'][data-hover][data-state='checked']:before {
  background-color: rgba(144, 202, 249, 0.295);
}

[data-scope='switch'][data-part='thumb'][data-state='checked'] {
  transform: translateX(var(--switch-thumb-x));
}

[data-scope='switch'][data-part='label'] {
  user-select: none;
  margin-inline-start: 0.5rem;
}
