/* Switch toggle — reusable iOS-style toggle */
.trait-grid__switch {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;

  & input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  & input:checked + .trait-grid__switch-track {
    background: var(--color-primary);
    border-color: var(--color-primary);
  }

  & input:checked + .trait-grid__switch-track::after {
    transform: translateX(14px);
  }
}

.trait-grid__switch-track {
  position: relative;
  width: 30px;
  height: 16px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition:
    background 0.2s,
    border-color 0.2s;
  flex-shrink: 0;

  &::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--color-text-inverse);
    border-radius: 50%;
    transition: transform 0.2s;
  }
}
