.autocomplete-dropdown {
    position: absolute;
    z-index: 10010;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 4px;
    display: none;
    min-width: 120px;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 6px 12px;
    color: #FFFFFF;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: rgba(183, 255, 105, 0.15);
    color: #B7FF69;
}

body.light-theme .autocomplete-dropdown {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .autocomplete-item {
    color: #000000;
}

body.light-theme .autocomplete-item:hover,
body.light-theme .autocomplete-item.selected {
    background-color: rgba(72, 0, 150, 0.1);
    color: #480096;
}

/* 🎯 Метки в автодополнении — другой цвет */
.autocomplete-item.is-label {
    color: #EE67C6;
    font-weight: 600;
}

.autocomplete-item.is-label:hover,
.autocomplete-item.is-label.selected {
    background-color: rgba(238, 103, 198, 0.15);
    color: #EE67C6;
}

body.light-theme .autocomplete-item.is-label {
    color: #119839;
}

body.light-theme .autocomplete-item.is-label:hover,
body.light-theme .autocomplete-item.is-label.selected {
    background-color: rgba(17, 152, 57, 0.1);
    color: #119839;
}

/* 🎯 Функции библиотеки Handyfar.inc — как вызовы функций в редакторе */
.autocomplete-item.is-func {
    color: #EE67C6;
    font-weight: 600;
}

.autocomplete-item.is-func:hover,
.autocomplete-item.is-func.selected {
    background-color: rgba(238, 103, 198, 0.15);
    color: #EE67C6;
}

body.light-theme .autocomplete-item.is-func {
    color: #A31586;
}

body.light-theme .autocomplete-item.is-func:hover,
body.light-theme .autocomplete-item.is-func.selected {
    background-color: rgba(163, 21, 134, 0.1);
    color: #A31586;
}

/* 🎯 Константы клавиш Handykey.inc (KB_*) — как константы */
.autocomplete-item.is-const {
    color: #B4C6E7;
    font-weight: 600;
}

.autocomplete-item.is-const:hover,
.autocomplete-item.is-const.selected {
    background-color: rgba(180, 198, 231, 0.15);
    color: #B4C6E7;
}

body.light-theme .autocomplete-item.is-const {
    color: #2F5496;
}

body.light-theme .autocomplete-item.is-const:hover,
body.light-theme .autocomplete-item.is-const.selected {
    background-color: rgba(47, 84, 150, 0.1);
    color: #2F5496;
}

/* 🎯 Поля структур в автодополнении */
.autocomplete-item.is-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.autocomplete-item.is-field .autocomplete-field-name {
    color: #B4C6E7;
    font-weight: 600;
}

.autocomplete-item.is-field .autocomplete-field-tag {
    font-size: 11px;
    opacity: 0.55;
    text-transform: lowercase;
}

/* 🎯 Поля объединений (UNION) — другой цвет и пометка */
.autocomplete-item.is-union-field .autocomplete-field-name {
    color: #C792EA;
    font-weight: 600;
}

.autocomplete-item.is-union-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.autocomplete-item.is-union-field .autocomplete-field-tag {
    font-size: 11px;
    opacity: 0.55;
    text-transform: lowercase;
}

body.light-theme .autocomplete-item.is-field .autocomplete-field-name {
    color: #2F5496;
}

body.light-theme .autocomplete-item.is-union-field .autocomplete-field-name {
    color: #7B2FA8;
}
