/* Shared selection controls: the original select remains the form value. */
.u-select {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    color: #304b59;
    text-align: start;
}
.u-select[hidden], .u-select-error[hidden], .u-select-menu [hidden] { display: none !important; }
.u-select-error { display: block; margin: 6px 0 0; color: #a74f45; font: 400 11px/1.7 Alexandria, Arial, sans-serif; }
.u-select .u-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
}
.u-select .u-select-trigger {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid #d8e2e7;
    border-radius: 9px;
    background: #fbfcfd;
    color: #304b59;
    font: 400 13px/1.65 Alexandria, Arial, sans-serif;
    letter-spacing: 0;
    text-align: start;
    box-shadow: 0 1px 2px #18303903;
    cursor: pointer;
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.u-select .u-select-trigger:hover:not(:disabled) {
    filter: none;
    background: #fff;
    border-color: #9dabb3;
}
.u-select .u-select-trigger:focus-visible,
.u-select .u-select-trigger[aria-expanded="true"] {
    outline: none;
    border-color: #bc7952;
    background: #fff;
    box-shadow: 0 0 0 3px #bc795217;
}
.u-select .u-select-trigger[aria-invalid="true"] { border-color: #b45e55; }
.u-select .u-select-trigger:disabled {
    opacity: 1;
    background: #f0f3f5;
    border-color: #e3e8eb;
    color: #8b98a2;
    cursor: not-allowed;
    box-shadow: none;
}
.u-select .u-select-value {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: inherit;
    font: inherit;
}
.u-select .u-select-chevron { width: 15px; height: 15px; flex: 0 0 15px; color: #8395a0; transition: transform .16s; }
.u-select .u-select-trigger[aria-expanded="true"] .u-select-chevron { transform: rotate(180deg); color: #ad633e; }
.u-select-menu {
    position: fixed;
    inset: auto;
    z-index: 10020;
    box-sizing: border-box;
    width: 280px;
    max-width: calc(100vw - 24px);
    max-height: min(390px, calc(100dvh - 24px));
    margin: 0;
    padding: 6px;
    overflow: hidden;
    border: 1px solid #d8e2e7;
    border-radius: 13px;
    background: #fff;
    color: #304b59;
    font: 400 13px/1.65 Alexandria, Arial, sans-serif;
    text-align: start;
    box-shadow: 0 16px 48px #102c3b24, 0 3px 10px #102c3b0b;
    isolation: isolate;
}
.u-select-menu[hidden] { display: none !important; }
.u-select-menu::backdrop { background: transparent; }
.u-select-menu .u-select-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 2px 8px 6px;
    border-bottom: 1px solid #edf1f3;
    margin-bottom: 5px;
}
.u-select-menu .u-select-title { color: #7b8e98; font: 500 10px/1.6 Alexandria, Arial, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-select-menu .u-select-close {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8596a0;
    cursor: pointer;
}
.u-select-menu .u-select-close:hover { background: #f0f4f5; color: #304b59; filter: none; }
.u-select-menu .u-select-close svg { width: 15px; height: 15px; }
.u-select-menu .u-select-search {
    display: block;
    box-sizing: border-box;
    width: calc(100% - 8px);
    min-height: 40px;
    height: 40px;
    margin: 7px 4px;
    padding: 8px 11px;
    border: 1px solid #dce4e8;
    border-radius: 8px;
    background: #f6f8f9;
    color: #304b59;
    font: 400 12px/1.6 Alexandria, Arial, sans-serif;
    outline: none;
}
.u-select-menu .u-select-search::placeholder { color: #8a9ba5; }
.u-select-menu .u-select-search:focus { border-color: #be825e; background: #fff; box-shadow: 0 0 0 2px #be825e12; }
.u-select-menu .u-select-options {
    max-height: 276px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c6d1d7 transparent;
    padding: 2px;
    outline: none;
}
.u-select-menu .u-select-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    min-height: 41px;
    margin: 2px 0;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #304b59;
    font: 400 12px/1.7 Alexandria, Arial, sans-serif;
    text-align: start;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.u-select-menu .u-select-option:hover:not([aria-disabled="true"]),
.u-select-menu .u-select-option.is-active { background: #f0f4f6; filter: none; }
.u-select-menu .u-select-option.is-selected,
.u-select-menu .u-select-option[aria-selected="true"] { background: #fcf1e8; color: #a7532e; font-weight: 500; }
.u-select-menu .u-select-option.is-selected.is-active { border-color: #e7c5ad; }
.u-select-menu .u-select-option[aria-disabled="true"] { color: #a3afb6; background: transparent; cursor: not-allowed; }
.u-select-menu .u-select-check { width: 16px; height: 16px; flex: 0 0 16px; color: #b16b42; }
.u-select-menu .u-select-empty { padding: 22px 12px; margin: 0; color: #80939e; font: 400 12px/1.8 Alexandria, Arial, sans-serif; text-align: center; }
.u-select-menu .u-select-group { margin: 6px 8px 2px; padding-top: 5px; color: #8597a1; font: 500 10px/1.7 Alexandria, Arial, sans-serif; }
.u-select-menu :focus-visible { outline: 2px solid #bf8059; outline-offset: 1px; }
/* Embedded search fields keep their existing label, icon and outer boundary. */
#search-form .v9-field .u-select-trigger {
    min-height: 30px;
    height: 30px;
    padding: 3px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #25323c;
    font-size: 14px;
}
#search-form .v9-field .u-select-trigger:disabled { color: #84909a; }
#search-form .v9-control:has(.u-select) > svg { display: none; }
.pref-field .u-select-trigger { min-height: 49px; }
.pt-sort .u-select, .cr-sort .u-select { width: 182px; max-width: 100%; }
.ac-console .u-select .u-select-trigger { color: #294646; font-size: 12px; background: #fafbf9; border-color: #dde3df; }
select[multiple], select[size]:not([size="1"]):not([size="0"]) { max-height: 280px; scrollbar-width: thin; }
.h6-menu { max-height: min(540px, calc(100dvh - 110px)); overflow-y: auto !important; scrollbar-width: thin; scrollbar-color: #c6d1d7 transparent; }
@media (max-width: 640px) {
    .u-select .u-select-trigger { min-height: 46px; font-size: 14px; }
    .u-select-menu { max-width: calc(100vw - 20px); border-radius: 12px; }
    .u-select-menu .u-select-option { min-height: 44px; font-size: 13px; }
    .u-select-menu .u-select-search { font-size: 16px; height: 44px; }
    .u-select-menu .u-select-close { width: 32px; height: 32px; min-height: 32px; flex-basis: 32px; }
    #search-form .v9-field .u-select-trigger { height: 34px; min-height: 34px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .u-select .u-select-trigger, .u-select .u-select-chevron, .u-select-menu .u-select-option { transition: none; }
}
