/* Keep the indicator and selected text clear of the control edge, including modal forms. */
:root {
    --bkg-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23718291' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
}
html[data-theme="dark"],html[data-bs-theme="dark"],html[data-bkg-theme="dark"],body.dark-theme,body.dark-mode {
    --bkg-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23b7c5d1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
}
html body select:not([multiple]):not([size]):not([data-bkg-native-select]),
html body select[size="1"]:not([multiple]):not([data-bkg-native-select]),
html body select[size="0"]:not([multiple]):not([data-bkg-native-select]) {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box;
    background-image: var(--bkg-select-arrow) !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px 14px !important;
    padding-inline-end: 42px !important;
}
html body select:not([multiple]):not([size]):not([data-bkg-native-select]):is(.is-valid,.is-invalid),
html body .was-validated select.form-select:not([multiple]):not([size]):is(:valid,:invalid) {
    background-image: var(--bkg-select-arrow),var(--bs-form-select-bg-icon,none) !important;
    background-position: right 14px center,right 40px center !important;
    background-size: 14px 14px,16px 16px !important;
    padding-inline-end: 64px !important;
}
html[dir="rtl"] body select:not([multiple]):not([size]):not([data-bkg-native-select]),
html[dir="rtl"] body select[size="1"]:not([multiple]):not([data-bkg-native-select]) {
    background-position: left 14px center !important;
}
html body button.dropdown-toggle:not(.dropdown-toggle-split) { padding-inline-end:14px !important; }
html body .dropdown-toggle:not(.dropdown-toggle-split)::after { margin-inline-start:10px !important; margin-inline-end:2px !important; flex-shrink:0; }
html body .select2-container .select2-selection--single .select2-selection__arrow { right:12px; width:18px; }
html body .select2-container .select2-selection--single .select2-selection__rendered { padding-inline-end:42px; }
html body .choices[data-type*="select-one"]::after { right:14px; }
html body .appointment-select-wrap .appointment-select-chevron { display:none !important; }

/* Native file buttons share the field's full inner height, including sm/multiple fields. */
html body input[type="file"]:not([hidden]):not(.d-none):not(.visually-hidden):not(.sr-only) {
    box-sizing: border-box;
    height: var(--bkg-ui-control-height, 40px) !important;
    min-height: var(--bkg-ui-control-height, 40px) !important;
    max-width: 100%;
    min-width: 0;
    padding: 0 !important;
    line-height: calc(var(--bkg-ui-control-height, 40px) - 2px) !important;
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}
html body input[type="file"]::file-selector-button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 12px 0 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-inline-end: 1px solid color-mix(in srgb, currentColor 24%, transparent) !important;
    border-radius: 0 !important;
    background: color-mix(in srgb, currentColor 8%, transparent) !important;
    color: inherit !important;
    font: inherit;
    line-height: inherit !important;
    vertical-align: top;
    white-space: nowrap !important;
    flex-shrink: 0;
    cursor: pointer;
}
html body input[type="file"]:disabled::file-selector-button { cursor: default; }
@media(forced-colors:active) {
    html body select:not([multiple]):not([data-bkg-native-select]) { appearance:auto !important; background-image:none !important; }
    html body input[type="file"]::file-selector-button { background:ButtonFace !important; color:ButtonText !important; border-inline-end-color:ButtonText !important; }
}
