/**
 * Shared primary search field — same look as BIP! Finder.
 */
.bip-search-box {
    width: 100%;
}

.bip-search-box .has-search {
    width: 100%;
    margin-bottom: 0 !important;
}

.bip-search-box .has-search .form-group {
    position: relative;
    height: 44px !important;
    margin-bottom: 0 !important;
    overflow: visible;
}

.bip-search-box .has-search .form-control {
    height: 44px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-left: 40px !important;
    border-radius: var(--bip-radius-panel, 10px) !important;
    box-sizing: border-box;
}

.bip-search-box .has-search .form-control-feedback {
    left: 0;
    right: auto;
    top: 0;
    width: 40px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 16px !important;
    z-index: 3;
    pointer-events: none;
    color: #ccc;
}

/* Results header + ordering (shared with Finder) */
.finder-results-hdr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.finder-results-hdr > [class*="col-"] {
    float: none;
    margin-bottom: 0;
}

/*
 * Toolbar on its own row (count | sort above):
 * - always on very small screens
 * - on small screens when filters are collapsed
 */
@media (max-width: 575px) {
    .finder-results-hdr > .finder-results-count-wrap {
        order: 1;
        flex: 1 1 0;
        width: auto;
        max-width: none;
        padding-right: 8px;
    }

    .finder-results-hdr > .finder-ordering-wrap {
        order: 2;
        flex: 0 1 auto;
        width: auto;
        max-width: none;
        padding-left: 8px;
    }

    .finder-results-hdr > .finder-results-toolbar-wrap {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        text-align: center;
    }
}

@media (max-width: 991px) {
    html.lib-collapse-filters .finder-results-hdr > .finder-results-count-wrap {
        order: 1;
        flex: 1 1 0;
        width: auto;
        max-width: none;
        padding-right: 8px;
    }

    html.lib-collapse-filters .finder-results-hdr > .finder-ordering-wrap {
        order: 2;
        flex: 0 1 auto;
        width: auto;
        max-width: none;
        padding-left: 8px;
    }

    html.lib-collapse-filters .finder-results-hdr > .finder-results-toolbar-wrap {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        text-align: center;
    }
}

.finder-ordering-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.finder-ordering-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.finder-ordering-control > .fa-arrow-down-wide-short {
    color: #777;
    font-size: 14px;
    line-height: 1;
}

.finder-ordering-field {
    margin: 0;
    display: inline-block;
}

.finder-ordering-select {
    display: inline-block;
    width: auto !important;
    min-width: 140px;
    height: 34px;
    color: #777;
    border-radius: var(--bip-radius-panel, 10px);
}

/* Library / Scholar search: extra space under the search box */
.bip-service-search .bip-search-box {
    margin-bottom: 28px;
}

.bip-service-search #results_hdr,
.bip-service-search #results_set {
    margin-top: 8px;
}

/* Synonym expansion suggestions */
.synonyms-panel {
    margin-top: 15px;
}

.synonyms-panel .panel {
    border-radius: var(--bip-radius-panel, 10px);
    border-color: #e5e7eb;
    box-shadow: none;
}

.synonyms-panel .panel-body {
    padding: 14px 16px;
}

.synonyms-panel-body {
    text-align: left;
}

.synonyms-expansion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.synonyms-expansion-spaced {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.synonyms-bang {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    margin-right: -10px;
    font-size: 3.75rem;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2.5px var(--main-color, #278f89);
    text-stroke: 2.5px var(--main-color, #278f89);
    transform: scale(1.2, 1.35);
    transform-origin: center;
    paint-order: stroke fill;
}

@supports not (-webkit-text-stroke: 2px black) {
    .synonyms-bang {
        color: var(--main-color, #278f89);
        background: transparent;
        border: 2.5px solid var(--main-color, #278f89);
        border-radius: var(--bip-radius-panel, 10px);
        font-size: 2.25rem;
        min-width: 2.5rem;
        padding: 0 0.45rem;
        transform: none;
    }
}

.synonyms-expansion-main {
    flex: 1 1 auto;
    min-width: 0;
}

.synonyms-message {
    margin: 0 0 6px;
    color: #555;
    line-height: 1.4;
}

.synonyms-message strong {
    color: var(--main-color, #278f89);
    font-weight: 600;
}

.synonyms-query {
    margin: 0;
    color: #333;
    font-style: italic;
    line-height: 1.45;
    word-break: break-word;
}

.synonyms-expansion-action {
    flex: 0 0 auto;
}

.synonyms-panel .expand-search-btn {
    border-radius: var(--bip-radius-panel, 10px);
    white-space: nowrap;
    padding: 6px 14px;
}

@media (max-width: 575px) {
    .synonyms-expansion {
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    .synonyms-bang {
        align-self: center;
        font-size: 3rem;
        transform: scale(1.15, 1.25);
    }

    .synonyms-expansion-main {
        flex: 1 1 calc(100% - 3.5rem);
    }

    .synonyms-expansion-action {
        flex: 1 1 100%;
        display: flex;
        justify-content: flex-end;
    }
}
