.tn-autocomplete-shell {
    position: relative;
    z-index: 40;
    width: min(760px, 100%);
}

.tn-autocomplete-shell--home {
    width: min(670px, 100%);
}

/* The homepage hero normally clips its decorative image at the section edge.
   Temporarily lift that boundary while its suggestion panel is open. */
.tn-hero.tn-autocomplete-open {
    z-index: 4;
    overflow: visible;
}

.tn-autocomplete-shell .tn-search,
.tn-autocomplete-shell .tn-search-hero-form {
    width: 100%;
}

.tn-autocomplete-shell.is-open .tn-search,
.tn-autocomplete-shell.is-open .tn-search-hero-form {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.tn-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 80;
    overflow: auto;
    max-height: min(540px, calc(100vh - 180px));
    border: 1px solid #d7e2f1;
    border-radius: 12px;
    background: #fff;
    color: #071946;
    box-shadow: 0 22px 55px rgba(7, 25, 67, .22);
    text-align: left;
}

.tn-autocomplete[hidden] {
    display: none;
}

.tn-autocomplete__group + .tn-autocomplete__group {
    border-top: 1px solid #e6edf7;
}

.tn-autocomplete__heading {
    padding: 8px 16px 5px;
    color: #657493;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .035em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tn-autocomplete__option {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 53px;
    padding: 6px 16px;
    border-left: 4px solid transparent;
    color: #08194b;
    text-decoration: none;
}

.tn-autocomplete__option:hover,
.tn-autocomplete__option.is-active {
    border-left-color: #2161ff;
    background: #eaf3ff;
    color: #08194b;
}

.tn-autocomplete__visual {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    object-fit: cover;
}

.tn-autocomplete__visual--icon {
    display: grid;
    place-items: center;
    background: #edf4ff;
    color: #2461df;
    font-size: 18px;
}

.tn-autocomplete__copy {
    min-width: 0;
}

.tn-autocomplete__name,
.tn-autocomplete__subtitle {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tn-autocomplete__name {
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
}

.tn-autocomplete__subtitle {
    margin-top: 2px;
    color: #62708e;
    font-size: 12px;
    line-height: 1.2;
}

.tn-autocomplete__badge {
    border-radius: 999px;
    background: #e5f6eb;
    color: #08734b;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.tn-autocomplete__group--directory .tn-autocomplete__badge {
    background: #eee8ff;
    color: #6540cc;
}

.tn-autocomplete__group--guides .tn-autocomplete__badge {
    background: #fff3d6;
    color: #9b6400;
}

.tn-autocomplete__all {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px;
    padding: 12px 14px;
    border-left: 4px solid transparent;
    border-radius: 7px;
    background: #eaf3ff;
    color: #0f55d9;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.tn-autocomplete__all:hover,
.tn-autocomplete__all.is-active {
    border-left-color: #2161ff;
    background: #dcecff;
    color: #0a46b8;
}

.tn-autocomplete__empty {
    padding: 18px;
    color: #5e6d8b;
    font-size: 13px;
}

@media (max-width: 680px) {
    .tn-autocomplete {
        max-height: min(470px, calc(100vh - 130px));
    }

    .tn-autocomplete__option {
        grid-template-columns: 36px minmax(0, 1fr);
        padding: 7px 11px;
    }

    .tn-autocomplete__visual {
        width: 34px;
        height: 34px;
    }

    .tn-autocomplete__badge {
        display: none;
    }
}
