/* Випадаючий список із пошуком — див. static/js/autocomplete-select.js */

.ac-wrap {
    position: relative;
    min-width: 0;
}
.input-group > .ac-wrap {
    flex: 1 1 auto;
    width: 1%;
}
.input-group > .ac-wrap:not(:last-child) .ac-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group > .ac-wrap:not(:first-child) .ac-input {
    margin-left: calc(var(--bs-border-width) * -1);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Справжній <select> лишається у формі й у потоці (без top/left — на своєму
   місці), щоб підказка браузера «Заповніть поле» вказувала під поле пошуку. */
select.ac-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.ac-input {
    cursor: pointer;
    text-overflow: ellipsis;
}
.ac-input:focus {
    cursor: text;
}

.ac-panel {
    position: fixed;
    z-index: 1090;  /* над модалками Bootstrap (1055) */
    display: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    background: var(--surface, #fff);
    border: 1px solid var(--grey-light);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(44, 44, 44, .14);
    font-size: .95rem;
}
.ac-panel.show {
    display: block;
}
.ac-panel.ac-panel-sm {
    font-size: .875rem;
}

.ac-item {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.3;
}
.ac-item.is-active {
    background: var(--burgundy-soft, #F5E9EC);
}
.ac-item.is-selected {
    color: var(--burgundy);
    font-weight: 600;
}
.ac-item.is-blank {
    color: var(--text-secondary);
    font-style: italic;
}
.ac-item.is-disabled {
    color: var(--text-secondary);
    opacity: .55;
    cursor: default;
}
.ac-item mark {
    padding: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--burgundy-light);
    text-underline-offset: 2px;
}

.ac-group {
    padding: 8px 10px 4px;
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ac-empty,
.ac-more {
    padding: 8px 10px;
    color: var(--text-secondary);
    font-size: .85em;
}
.ac-create {
    margin-top: 4px;
    padding: 7px 10px;
    border-top: 1px solid var(--grey-light);
    color: var(--burgundy);
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 0 6px 6px;
}
.ac-create:hover {
    background: var(--burgundy-soft, #F5E9EC);
}
.ac-more {
    border-top: 1px solid var(--grey-light);
    margin-top: 4px;
}
