:root {
    --ui-select-accent: #145bff;
    --ui-select-background: #fff;
    --ui-select-border: var(--app-border, var(--catalog-line, #d5e4f2));
    --ui-select-color: #294364;
    --ui-select-highlight: #e4f5ff;
    --ui-select-hover: #f0f7ff;
    --ui-select-muted: #60758d;
}

[data-bs-theme="dark"] {
    --ui-select-background: #102a43;
    --ui-select-border: var(--app-border, #294564);
    --ui-select-color: #edf7ff;
    --ui-select-highlight: #173e63;
    --ui-select-hover: #163553;
    --ui-select-muted: #9db3c8;
}

select.ui-select:not(.tomselected) {
    border-radius: 12px;
    font-size: 16px;
}

.ui-select-choice {
    align-items: center;
    display: flex;
    min-width: 0;
}

.ui-select-choice__flag {
    border-radius: .2rem;
    box-shadow: 0 0 0 1px rgba(84, 116, 143, .16);
    flex: 0 0 24px;
    height: 18px;
    margin-right: 9px;
    object-fit: cover;
    width: 24px;
}

.ui-select-choice__text {
    min-width: 0;
    overflow-wrap: break-word;
}

.ui-select.ts-wrapper {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    font: inherit;
    min-height: 0;
    padding: 0;
    position: relative;
    width: 100%;
}

.ui-select.ts-wrapper.single .ts-control,
.ui-select.ts-wrapper.multi .ts-control {
    align-items: center;
    background: var(--ui-select-background);
    background-image: none;
    border: 1px solid var(--ui-select-border);
    border-radius: 12px;
    box-shadow: none;
    color: var(--ui-select-color);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    min-height: 44px;
    padding: 9px 38px 9px 12px;
}

.ui-select.ts-wrapper.single .ts-control::after {
    border: solid var(--ui-select-muted);
    border-width: 0 2px 2px 0;
    height: 7px;
    margin-top: -5px;
    right: 16px;
    transform: rotate(45deg);
    width: 7px;
}

.ui-select.ts-wrapper.single.dropdown-active .ts-control::after {
    margin-top: -1px;
    transform: rotate(225deg);
}

.ui-select.ts-wrapper.focus .ts-control {
    border-color: var(--ui-select-accent);
    box-shadow: 0 0 0 3px rgba(20, 91, 255, .1);
}

.ui-select.ts-wrapper.disabled .ts-control {
    cursor: not-allowed;
    opacity: .6;
}

.ui-select.ts-wrapper.is-invalid .ts-control,
.has-error .ui-select.ts-wrapper .ts-control {
    border-color: #d74338;
}

.ui-select.ts-wrapper .ts-control > .item {
    max-width: 100%;
    overflow-wrap: break-word;
}

.ui-select.ts-wrapper .ts-control > input {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--ui-select-color);
    font: inherit;
    font-size: 16px;
    height: auto;
    line-height: 1.5;
    margin: 0;
    min-height: 24px;
    outline: 0;
    padding: 0;
}

.ui-select.ts-wrapper.multi .ts-control > .item {
    background: var(--ui-select-highlight);
    border: 0;
    border-radius: 8px;
    color: var(--ui-select-color);
    margin: 3px 6px 3px 0;
    padding: 4px 8px;
}

.ui-select.ts-wrapper.multi .ts-control .remove {
    border-color: var(--ui-select-border);
    border-radius: 0 8px 8px 0;
    color: inherit;
    font-size: 18px;
    line-height: 24px;
    margin-left: 8px;
    padding: 0 6px;
    text-decoration: none;
}

.ui-select-dropdown.ts-dropdown {
    background: var(--ui-select-background);
    border: 1px solid var(--ui-select-border);
    border-radius: 14px;
    box-sizing: border-box;
    box-shadow: 0 12px 32px rgba(7, 39, 80, .16);
    color: var(--ui-select-color);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    padding: 5px;
    position: absolute;
    z-index: 2100;
}

.ui-select-dropdown .ts-dropdown-content {
    max-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.ui-select-dropdown .option {
    background: transparent;
    border-radius: 10px;
    color: var(--ui-select-color);
    cursor: pointer;
    font-weight: 550;
    min-height: 44px;
    overflow-wrap: break-word;
    padding: 10px 34px 10px 12px;
    position: relative;
}

.ui-select-dropdown .option.active {
    background: var(--ui-select-hover);
    color: var(--ui-select-color);
}

.ui-select-dropdown .option.selected {
    background: var(--ui-select-highlight);
    color: var(--ui-select-color);
    font-weight: 700;
}

.ui-select-dropdown .option.selected::after {
    color: var(--ui-select-accent);
    content: "✓";
    position: absolute;
    right: 12px;
    top: 10px;
}

.ui-select-dropdown .option[aria-disabled="true"] {
    color: var(--ui-select-muted);
    cursor: not-allowed;
    opacity: .65;
}

.ui-select-dropdown .optgroup-header,
.ui-select-dropdown .no-results {
    background: transparent;
    color: var(--ui-select-muted);
    font-size: 14px;
    padding: 10px 12px;
}
