/* Native inputs remain the source of truth, including script changes and form resets. */
.application-shell label.choice-badge {
    --choice-mark-opacity: 0;
    --choice-mark-border: var(--text-soft);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 2.75rem;
    max-width: 100%;
    margin: .2rem .25rem .2rem 0;
    padding: .6rem .85rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface-muted);
    color: var(--text);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
    cursor: pointer;
    vertical-align: middle;
}
.application-shell input.choice-badge-input {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    width: 1px !important;
    height: 1px !important;
    min-inline-size: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    clip-path: inset(50%) !important;
}
.application-shell .choice-badge > span:not(.choice-badge-mark):not(.sr-only) { min-width: 0; }
.application-shell .choice-badge .choice-badge-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
    border: 1.5px solid var(--choice-mark-border);
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) calc(var(--choice-mark-opacity) * 100%), transparent);
    color: color-mix(in srgb, var(--surface-solid) calc(var(--choice-mark-opacity) * 100%), transparent);
    font-size: .8rem;
    font-weight: 800;
}
.application-shell label.choice-badge:has(input:checked),
.application-shell input.choice-badge-input:checked + label.choice-badge-after,
.application-shell label.choice-badge-before:has(+ input.choice-badge-input:checked),
.application-shell label.choice-badge:has(input:indeterminate),
.application-shell input.choice-badge-input:indeterminate + label.choice-badge-after,
.application-shell label.choice-badge-before:has(+ input.choice-badge-input:indeterminate) {
    --choice-mark-opacity: 1;
    --choice-mark-border: var(--brand);
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 10%, var(--surface-solid));
    box-shadow: inset 0 0 0 1px var(--brand);
}
.application-shell label.choice-badge:has(input:indeterminate) .choice-badge-mark,
.application-shell input.choice-badge-input:indeterminate + label.choice-badge-after .choice-badge-mark,
.application-shell label.choice-badge-before:has(+ input.choice-badge-input:indeterminate) .choice-badge-mark { font-size: 0; }
.application-shell label.choice-badge:has(input:indeterminate) .choice-badge-mark::after,
.application-shell input.choice-badge-input:indeterminate + label.choice-badge-after .choice-badge-mark::after,
.application-shell label.choice-badge-before:has(+ input.choice-badge-input:indeterminate) .choice-badge-mark::after { content: ''; width: .55rem; border-top: 2px solid currentColor; }
.application-shell label.choice-badge:has(input:focus-visible),
.application-shell input.choice-badge-input:focus-visible + label.choice-badge-after,
.application-shell label.choice-badge-before:has(+ input.choice-badge-input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent);
    outline-offset: 3px;
}
.application-shell label.choice-badge:has(input:disabled),
.application-shell input.choice-badge-input:disabled + label.choice-badge-after,
.application-shell label.choice-badge-before:has(+ input.choice-badge-input:disabled) { opacity: .6; cursor: not-allowed; }
.application-shell label.choice-badge-icon-only { justify-content: center; min-width: 2.75rem; padding: .6rem; }
.application-shell .choice-badge-field { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; border: 0; background: transparent; box-shadow: none; }
.application-shell .choice-badge-field > .organization-field-hint,
.application-shell .choice-badge-field > ul { flex-basis: 100%; }
.application-shell .choice-badge[hidden] { display: none; }
