er.querySelector('#autocomplete-list');
    const outputLinks = document.querySelectorAll(outputSelector);

    // Collect output names and their hrefs
    const outputs = Array.from(outputLinks).map(link => ({
        name: link.textContent.trim(),
        href: link.getAttribute("href"),
    }));

    let highlightedIndex = -1; // Index of the currently highlighted item

    function adjustAutocompleteWidth() {
        const searchBarWidth = searchBar.offsetWidth;
        autocompleteList.style.width = `$