/* Autocomplete shell */
.avcp-ac {
    position: absolute;
    z-index: 1050; /* above content, below modals */
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(0,0,0,.12);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Each row */
.avcp-ac-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
}
.avcp-ac-item:hover,
.avcp-ac-item[aria-selected="true"] {
    background: #f6f8fa;
}
.avcp-ac-item .ac-title {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
}
.avcp-ac-item .ac-sub {
    margin-top: 2px;
    font-size: 13px;
    color: #6b7280;
}

/* Footer row */
.avcp-ac-footer {
    padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between;
    color: #6b7280;
    background: #fafafa;
    font-size: 13px;
}
.avcp-ac-powered {
    display: inline-flex; align-items: center; gap: 6px;
    color: #9aa0a6;
    font-size: 12px;
}

/* Hide border on last item when footer exists */
.avcp-ac-item:last-of-type { border-bottom: none; }

/* Autocomplete panel sticks to the input even when page scrolls */
#avcp-ac-panel{
    position: fixed;           /* anchor to viewport */
    z-index: 2000;             /* above header + content */
    width: 520px;              /* will be overridden by JS to match input */
    max-height: 70vh;          /* safety; JS will refine */
    overflow: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: .5rem;
    background: #fff;
}

@media (min-width: 992px) {
    .search-nav {
        max-width: 75%;
        margin-left: auto; /* push it right */
    }
}

#avcp-autocomplete {
    position: fixed !important;       /* anchored to viewport using JS-computed coords */
    z-index: 1100;         /* above navbar (higher than .dropdown-menu’s 1000) */
    max-height: 70vh;
    overflow: auto;
    width: 640px;          /* JS will override width when aligning with input */
    border-radius: .75rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    background: #fff;
}

/* Keep header on one line and align everything */
.gs-row { cursor: pointer; }

/* Consistent icon sizing, no shrink */
.gs-actions img.gs-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: inline-block;
}

/* Make the + button compact and keep it aligned */
.gs-toggle {
    padding: 0 .4rem;
    line-height: 1;
}

/* Avoid title wrapping tight layouts */
.gs-title { white-space: nowrap; }

#avcp-gs-results .gs-row .h5 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 120px); /* leaves room for your + and icons */
    display: block;
}

/* list rows */
.gs-linked-item .gs-icon { width: 20px; height: 20px; object-fit: contain; }