.spectrum-switch {
  display: inline-flex;
  align-items: flex-start;
  position: relative;
  min-block-size: 24px; /* Small size height */
  max-inline-size: 100%;
  vertical-align: top;
}

.spectrum-switch .spectrum-switch-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}

.spectrum-switch .spectrum-switch-input:disabled {
  cursor: default;
}

.spectrum-switch .spectrum-switch-switch {
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  width: 32px; /* Small size width */
  height: 16px; /* Small size height */
  background-color: var(--spectrum-gray-200);
  border-radius: 8px;
  transition:
    background 0.2s ease-in-out,
    border 0.2s ease-in-out;
}

.spectrum-switch .spectrum-switch-switch::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s ease-in-out;
  top: 0;
  left: 0;
  border-width: 2px;
  border-style: solid;
}

.spectrum-switch .spectrum-switch-switch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  margin: 0;
  transition:
    opacity 0.2s ease-out,
    margin 0.2s ease-out;
}

.spectrum-switch:hover .spectrum-switch-switch {
  background-color: #d9d9d9;
}

.spectrum-switch:hover .spectrum-switch-switch::before {
  border-color: #999;
}

.spectrum-switch .spectrum-switch-input:checked + .spectrum-switch-switch {
  background-color: #007acb;
}

.spectrum-switch .spectrum-switch-input:checked + .spectrum-switch-switch::before {
  background-color: var(--spectrum-gray-50);
  border-color: #007acb;
  transform: translateX(100%);
}

.spectrum-switch .spectrum-switch-input:focus-visible + .spectrum-switch-switch::after {
  margin: -3px;
}

.spectrum-switch .spectrum-switch-input:disabled + .spectrum-switch-switch {
  background-color: #ccc;
}

.spectrum-switch .spectrum-switch-input:disabled + .spectrum-switch-switch::before {
  border-color: #999;
}

.spectrum-switch .spectrum-switch-label {
  margin-inline: 8px;
  font-size: var(--spectrum-font-size-75); /* Small font size */
  line-height: 1.5;
  color: #333;
  transition: color 0.2s ease-in-out;
}
