.custom-select {
    --custom-select-ink: var(--ink, #17312a);
    --custom-select-muted: var(--muted, #617069);
    --custom-select-line: var(--line, #dce5df);
    --custom-select-surface: var(--surface, #fff);
    --custom-select-primary: var(--primary, #0d7455);
    position: relative;
    z-index: 1;
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    vertical-align: middle;
}

.custom-select.is-open {
    z-index: 1000;
}

.custom-select__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.custom-select__trigger {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 40px 10px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--custom-select-line);
    border-radius: 13px;
    color: var(--custom-select-ink);
    background: var(--custom-select-surface);
    font: inherit;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.custom-select__trigger::after {
    position: absolute;
    top: 50%;
    right: 15px;
    width: 8px;
    height: 8px;
    border-right: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
    content: "";
    opacity: .72;
    transform: translateY(-68%) rotate(45deg);
    transition: transform .16s ease;
}

.custom-select__trigger[aria-expanded="true"]::after {
    transform: translateY(-20%) rotate(225deg);
}

.custom-select__trigger:hover {
    border-color: rgba(13, 116, 85, .38);
    border-color: color-mix(in srgb, var(--custom-select-primary), var(--custom-select-line) 42%);
}

.custom-select__trigger:focus-visible {
    outline: 3px solid rgba(13, 116, 85, .24);
    outline: 3px solid color-mix(in srgb, var(--custom-select-primary), transparent 76%);
    outline-offset: 2px;
    border-color: var(--custom-select-primary);
}

.custom-select__trigger:disabled {
    opacity: .56;
    cursor: not-allowed;
}

.custom-select__value {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select__menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 1001;
    display: flex;
    width: 100%;
    max-height: min(320px, 42vh);
    padding: 6px;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--custom-select-line);
    border-radius: 15px;
    background: var(--custom-select-surface);
    box-shadow: 0 16px 40px rgba(23, 49, 42, .17);
}

.custom-select__menu[hidden] {
    display: none !important;
}

.custom-select.is-above .custom-select__menu {
    top: auto;
    bottom: calc(100% + 7px);
}

.custom-select__option {
    position: relative;
    display: flex;
    min-height: 40px;
    padding: 9px 35px 9px 11px;
    align-items: center;
    border-radius: 9px;
    color: var(--custom-select-ink);
    line-height: 1.35;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.custom-select__option:hover,
.custom-select__option.is-active {
    background: rgba(13, 116, 85, .08);
    background: color-mix(in srgb, var(--custom-select-primary), white 91%);
}

.custom-select__option[aria-selected="true"] {
    color: var(--custom-select-primary);
    font-weight: 650;
}

.custom-select__option[aria-selected="true"]::after {
    position: absolute;
    right: 11px;
    color: var(--custom-select-primary);
    content: "✓";
    font-size: 14px;
    font-weight: 700;
}

.custom-select__option[aria-disabled="true"] {
    opacity: .48;
    cursor: not-allowed;
}

[dir="rtl"] .custom-select__trigger {
    padding-right: 14px;
    padding-left: 40px;
    text-align: right;
}

[dir="rtl"] .custom-select__trigger::after {
    right: auto;
    left: 15px;
}

[dir="rtl"] .custom-select__option {
    padding-right: 11px;
    padding-left: 35px;
}

[dir="rtl"] .custom-select__option[aria-selected="true"]::after {
    right: auto;
    left: 11px;
}

.custom-select--lab {
    --custom-select-ink: var(--lab-text, #17312a);
    --custom-select-muted: var(--lab-muted, #617069);
    --custom-select-line: rgba(18, 63, 51, .14);
    --custom-select-surface: #fff;
    --custom-select-primary: #1f7a5c;
}

.custom-select--lab .custom-select__trigger {
    min-height: 46px;
    padding: 12px 40px 12px 15px;
    border-radius: 14px;
    font-weight: 500;
}

.custom-select--lab .custom-select__menu {
    border-radius: 14px;
}

@media (prefers-reduced-motion: reduce) {
    .custom-select__trigger,
    .custom-select__trigger::after {
        transition: none;
    }
}
