.ec-select-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ec-select-host {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    contain: inline-size;
}

.ec-select-host:empty {
    display: none;
}

.ec-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    height: 32px;
    padding: 0 10px !important;
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius, 4px);
    background: var(--bg-color);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.ec-select-trigger:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.ec-select-trigger:focus-visible,
.ec-select-panel button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.ec-select-field select.is-invalid+.ec-select-host .ec-select-trigger {
    border-color: var(--red);
}

.ec-select-value {
    display: flex;
    flex: 1 1 0;
    width: 0;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.ec-select-tag,
.ec-select-count {
    flex: none;
}

.ec-select-single {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-select-chevron {
    flex: none;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 4px 0;
    border-color: #888 transparent transparent;
}

.ec-select-trigger[aria-expanded="true"] .ec-select-chevron {
    transform: rotate(180deg);
}

.ec-select-portal {
    position: fixed;
    z-index: 2100;
    box-sizing: border-box;
    color: var(--text);
}

.ec-select-panel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius, 4px);
    background: var(--card-bg);
    box-shadow: 0 6px 20px #0002;
}

.ec-select-search {
    flex: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin-bottom: 6px;
    color: inherit;
}

.ec-select-options {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    max-height: 240px;
    overscroll-behavior: contain;
}

.ec-select-row {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-left: calc(var(--depth, 0) * 18px);
}

.ec-select-option {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    padding: 6px 8px !important;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ec-select-option:hover,
.ec-select-option[aria-pressed="true"] {
    background: var(--bg-color);
}

.ec-select-option:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ec-select-check {
    width: 15px;
    height: 15px;
    flex: none;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    line-height: 13px;
    text-align: center;
}

.ec-select-option[aria-pressed="true"] .ec-select-check::after {
    content: '✓';
}

.ec-select-tree-connector {
    flex: none;
    color: var(--grey);
    font-size: 12px;
}

.ec-select-clear {
    flex: none;
    margin-top: 6px;
    padding: 4px 8px !important;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.ec-select-status {
    margin: 8px;
}

.ec-select-portal [hidden],
.ec-select-host [hidden],
.ec-select-portal[hidden],
select[data-ec-select][hidden] {
    display: none !important;
}

.ec-select-field>select[data-ec-select]:has(+ .ec-select-host:not(:empty)) {
    display: none !important;
}

.ec-select-option.ec-select-add-new,
.ec-select-option.ec-select-add-new:hover,
.ec-select-option.ec-select-add-new[aria-pressed="true"] {
    background: var(--bg-blue-light) !important;
}