.choice {
    display: block;
    min-width: 0;
    max-width: 100%;
}
.choice.row-action {
    padding: 0;
}
.choice-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}
.choice-control[aria-invalid='true'] {
    box-shadow: inset 0 0 0 1px var(--danger);
}
.choice-control:disabled {
    cursor: not-allowed;
}
.choice-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.choice-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: var(--muted);
}
.choice-arrow::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}
.choice-control[aria-expanded='true'] .choice-arrow::after {
    margin-top: 4px;
    transform: rotate(225deg);
}
.choice-error {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 6px;
}
.choice-error:empty {
    display: none;
}
.choice-popup {
    position: fixed;
    inset: auto;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
    border: 0;
    border-radius: var(--radius-large);
    color: var(--ink);
    background: var(--soft);
    box-shadow:
        inset 0 0 0 1px var(--line),
        0 12px 36px #0003;
    font: inherit;
    z-index: 100;
}
.choice-popup::backdrop {
    background: transparent;
}
dialog.choice-popup[open],
dialog.choice-popup[open]::backdrop {
    animation: none;
}
.choice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: calc(var(--radius-large) - 4px);
    color: var(--ink);
    font-size: 0.9375rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.choice-option.is-active {
    background: var(--surface);
    color: var(--accent-ink);
}
.choice-option[aria-selected='true'] {
    font-weight: 500;
}
.choice-option > svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-left: auto;
    color: var(--accent-ink);
}
.choice-option[aria-disabled='true'] {
    color: var(--muted);
    opacity: 0.6;
    cursor: not-allowed;
}
.choice-group {
    padding: 16px 12px 6px;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
}
@media (max-width: 760px) {
    .choice-control,
    .choice-option {
        font-size: 1rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .choice-control,
    .choice-popup,
    .choice-option {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
@media (forced-colors: active) {
    .choice-popup {
        outline: 1px solid CanvasText;
        outline-offset: -1px;
    }
    .choice-option.is-active {
        outline: 1px solid Highlight;
        outline-offset: -1px;
    }
}
@media (hover: hover) and (pointer: fine) {
    .choice-control:hover:not(:disabled) {
        background: var(--hover);
    }
}
