.sw-checkbox {
  --size-checkbox: calc(var(--rhythm-2) - var(--rhythm-0_25));

  align-items: center;
  display: inline-flex;
  gap: var(--rhythm-1);
  max-width: 100%;
  position: relative;

  &.disabled {
    color: var(--color-neutral-light);
  }

  .sw-checkbox-control {
    -webkit-appearance: none;
    border: 1px solid var(--color-neutral-regular);
    border-radius: 1px;
    box-sizing: content-box;
    flex: 1 0 auto;
    margin: 0;
    height: var(--size-checkbox);
    width: var(--size-checkbox);
    transition: border-color var(--transition-superfast);

    &:checked {
      border-color: var(--border-color);
    }

    &:disabled {
      border-color: var(--color-neutral-light);
    }
  }

  svg {
    border: 1px solid transparent;
    fill: currentColor;
    pointer-events: none;
    position: absolute;
    height: var(--size-checkbox);
    width: var(--size-checkbox);
  }

  label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &:not(.disabled) {
    .sw-checkbox-control,
    label {
      cursor: pointer;
    }

    &:hover .sw-checkbox-control {
      border-color: var(--border-color);
    }
  }
}
