/* SegmentedControl — choice among short options, rendered from an expanded
   ChoiceType. Single choice (radios) or multiple (checkboxes, toggling pills
   independently). The inputs stay real (a11y + form binding) but hidden; the
   labels are the pills. Wraps to a second row when the labels don't fit
   (the "Garde contre" fallback under ~360px) rather than shrinking the text. */
.ab-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ab-space-2xs);
}

.ab-segmented__option {
    flex: 1 1 auto;
    margin: 0;
    cursor: pointer;
}

.ab-segmented__option input[type="radio"],
.ab-segmented__option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ab-segmented__label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ab-tap-target);
    padding: 0 var(--ab-space-sm);
    border: 1px solid var(--ab-color-border);
    border-radius: var(--ab-radius-sm);
    background-color: var(--ab-color-surface-1);
    color: var(--ab-color-text);
    font-size: var(--ab-text-body);
    text-align: center;
    white-space: nowrap;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.ab-segmented__option:hover .ab-segmented__label {
    border-color: var(--ab-color-action);
}

.ab-segmented__option:has(input:checked) .ab-segmented__label {
    border-color: var(--ab-color-action);
    background-color: var(--ab-color-action-soft);
    color: var(--ab-color-action);
}

.ab-segmented__option:has(input:focus-visible) .ab-segmented__label {
    outline: 2px solid var(--ab-color-action-focus);
    outline-offset: 2px;
}
