[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;
  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-disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

[data-scope="switch"][data-part="control"][data-focus] {
  outline: 2px solid blue;
  outline-offset: 2px;
}

[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"][data-state="checked"] {
  transform: translateX(var(--switch-thumb-x));
}

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