.bp-finder {
    --bp-blue: #2f5cbf;
    --bp-orange: #ff7a00;
    --bp-ink: #101827;
    --bp-muted: #647087;
    display: grid;
    grid-template-columns: 350px minmax(0,1fr);
    width: 100%;
    max-width: none!important;
    background: #fff;
    color: var(--bp-ink);
    font-family: inherit;
    min-height: 0;
    isolation: isolate;
}

.bp-finder * {
    box-sizing: border-box;
}

.bp-finder [hidden] {
    display: none!important;
}

.bp-finder button,.bp-finder input,.bp-finder select {
    font: inherit;
}

.bp-finder button,.bp-finder a {
    cursor: pointer;
}

.bp-finder button:focus-visible,.bp-finder a:focus-visible,.bp-finder input:focus-visible,.bp-finder select:focus-visible {
    outline: 3px solid #92b6fb;
    outline-offset: 3px;
}

.bp-finder-sidebar {
    padding: 26px 24px;
    border-right: 1px solid #e2e8f0;
    min-width: 0;
}

.bp-finder-crumb {
    font-size: 12px;
    color: var(--bp-muted);
    margin-bottom: 27px;
}

.bp-finder-crumb a {
    color: inherit;
    text-decoration: none;
}

.bp-finder h1 {
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 10px;
    font-weight: 800;
}

.bp-finder-sidebar>p {
    font-size: 13px;
    color: var(--bp-muted);
}

.bp-finder-fields {
    display: grid;
    gap: 13px;
    margin: 25px 0 18px;
}

.bp-finder label {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.bp-finder input,.bp-finder select {
    display: block;
    width: 100%;
    height: 44px;
    margin-top: 6px;
    border: 1px solid #dce3ed;
    border-radius: 7px;
    background: #fff;
    color: var(--bp-ink);
    padding: 10px 12px;
    font-size: 14px;
}

.bp-finder select {
    appearance: none;
    padding-right: 35px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23647087'%3E%3Cpath d='m5 7 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 18px;
    background-position: right 10px center;
}

.bp-finder-count {
    min-height: 22px;
    font-variant-numeric: tabular-nums;
}

.bp-finder-list {
    position: relative;
}

.bp-finder-card {
    padding: 17px 13px;
    margin-bottom: 7px;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    background: #fff;
}

.bp-finder-card.is-active {
    border-color: #c4d4f3;
    background: #f8faff;
    box-shadow: inset 3px 0 var(--bp-blue);
}

.bp-finder-card.is-featured {
    border: 2px solid var(--bp-orange);
}

.bp-finder-card.is-featured.is-active {
    border-color: var(--bp-orange);
    box-shadow: inset 3px 0 var(--bp-orange);
}

.bp-finder-card>button {
    display: block;
    border: 0;
    background: none;
    text-align: left;
    padding: 0;
    width: 100%;
    color: var(--bp-ink);
}

.bp-finder-card strong {
    display: block;
    font-weight: 800;
    font-size: 15px;
}

.bp-finder-card button span {
    display: block;
    font-size: 12px;
    color: var(--bp-muted);
    margin-top: 3px;
}

.bp-finder-card small {
    display: block;
    font-size: 11px;
    margin-top: 6px;
    color: var(--bp-muted);
}

.bp-finder-card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 13px;
    font-size: 11px;
    color: var(--bp-muted);
}

.bp-finder-card a {
    color: var(--bp-blue);
    font-weight: 800;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
}

.bp-finder-map-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #f3f5f7;
}

.bp-finder-map {
    position: absolute;
    inset: 0;
}

.bp-finder-overview {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #fff;
    border: 1px solid #dce3ed;
    border-radius: 7px;
    padding: 11px 13px;
    color: var(--bp-ink);
    font-size: 12px!important;
    box-shadow: 0 2px 8px #10244112;
}

.bp-finder-map-status {
    position: absolute;
    left: 16px;
    right: 56px;
    top: 65px;
    background: #fff;
    padding: 10px 14px;
    font-size: 12px;
    box-shadow: 0 2px 8px #10244112;
}

.bp-finder-popup {
    position: absolute;
    bottom: 34px;
    left: 20px;
    width: 290px;
    max-width: calc(100% - 40px);
    padding: 22px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 30px #10244120;
}

.bp-finder-popup h2 {
    margin: 0 22px 7px 0;
    font-size: 20px;
    line-height: 1.3;
}

.bp-finder-popup p,.bp-finder-popup small {
    font-size: 12px;
    color: var(--bp-muted);
    margin: 0 0 13px;
    display: block;
}

.bp-finder-popup>button {
    position: absolute;
    right: 7px;
    top: 7px;
    border: 0;
    background: none;
    font-size: 24px;
    width: 34px;
    height: 34px;
    color: var(--bp-muted);
}

.bp-finder-popup>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bp-orange);
    color: #fff;
    padding: 11px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.bp-finder-switch {
    display: none;
}

.bp-map-pin {
    border: 0!important;
    background: none!important;
    box-shadow: none!important;
    padding: 0 7px!important;
    width: 44px;
    height: 38px;
    color: #2f5cbf!important;
    cursor: pointer;
}

.bp-map-pin svg {
    width: 30px;
    height: 38px;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 2px 3px #1a355a38);
}

.bp-map-pin.is-selected {
    color: #ff7a00!important;
    z-index: 2;
}

.bp-map-pin:after {
    content: '';
    position: absolute;
    inset: -3px 0;
}

.bp-map-cluster {
    width: 34px;
    height: 34px;
    border: 2px solid white!important;
    border-radius: 50%!important;
    background: #2f5cbf!important;
    color: #fff!important;
    box-shadow: 0 2px 8px #10244130!important;
    padding: 0!important;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.bp-map-cluster:after {
    content: '';
    position: absolute;
    inset: -5px;
}

.bp-finder .maplibregl-ctrl-attrib {
    font-size: 10px;
}

.bp-finder .maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
}

@media(max-width:700px) {
    .bp-finder {
        display: block;
        min-height: 0;
    }

    .bp-finder-sidebar {
        padding: 22px 16px 0;
        border: 0;
    }

    .bp-finder h1 {
        font-size: 28px;
    }

    .bp-finder-crumb {
        margin-bottom: 20px;
    }

    .bp-finder input,.bp-finder select {
        font-size: 16px;
    }

    .bp-finder-switch {
        display: flex;
        background: #eef2f8;
        border-radius: 8px;
        padding: 4px;
        margin-bottom: 16px;
    }

    .bp-finder-switch button {
        flex: 1;
        border: 0;
        background: none;
        border-radius: 6px;
        height: 42px;
        color: var(--bp-muted);
        font-size: 13px;
        font-weight: 700;
    }

    .bp-finder-switch button[aria-pressed=true] {
        background: #fff;
        color: var(--bp-blue);
        box-shadow: 0 2px 6px #10244114;
    }

    .bp-finder-list {
        max-height: none;
        overflow: visible;
        padding-bottom: 15px;
    }

    .bp-finder-map-panel {
        display: none;
        min-height: 510px;
    }

    .bp-finder[data-view=map] .bp-finder-map-panel {
        display: block;
    }

    .bp-finder[data-view=map] .bp-finder-list,.bp-finder[data-view=map] .bp-finder-count {
        display: none;
    }

    .bp-finder-card>button {
        min-height: 44px;
    }

    .bp-finder-card a {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
    }

    .bp-finder-popup>button {
        width: 44px;
        height: 44px;
    }

    .bp-finder .maplibregl-ctrl-group button {
        width: 44px;
        height: 44px;
    }

}

/* Reuse the plugin's accessible searchable dropdown on the finder too. */
.bp-finder {
    --bp-line: #dce3ed;
}

.bp-finder .bp-native-select {
    display: none!important;
}

.bp-finder .bp-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    text-align: left;
    background: #fff;
    border: 1px solid #dce3ed;
    border-radius: 7px;
    padding: 10px 34px 10px 12px;
    min-height: 44px;
    color: var(--bp-ink);
    font-size: 14px;
    position: relative;
}

.bp-finder .bp-select-search {
    margin: 0 0 5px;
    font-size: 14px;
}

.bp-finder .bp-select-options button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 5px;
    text-align: left;
    font-size: 14px;
    padding: 9px 10px;
    min-height: 40px;
    background: #fff;
    color: var(--bp-ink);
}

.bp-finder .bp-select-options button[aria-selected=true] {
    background: #eef3ff;
    color: var(--bp-blue);
}

.bp-finder .bp-select-empty {
    font-size: 12px;
    color: var(--bp-muted);
}

@media(max-width:700px) {
    .bp-finder .bp-select-search {
        font-size: 16px;
    }

}

/* 0.4.2: a desktop finder fills the theme main area; only its sidebar scrolls. */
@media(min-width:701px) {
    .bp-finder-frame {
        display: flex!important;
        flex-direction: column;
        box-sizing: border-box;
        height: var(--bp-frame-height,100dvh);
        min-height: 0!important;
        padding-top: var(--bp-frame-top-inset,0px);
        padding-bottom: var(--bp-frame-bottom-inset,0px);
    }

    .bp-finder-frame> :not(.bp-finder-main) {
        flex-shrink: 0;
    }

    main.site-content.bp-finder-main {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0!important;
        min-width: 0;
    }

    .bp-finder-main .bp-finder-slot {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0!important;
        min-width: 0;
    }

    .bp-finder.bp-finder-desktop {
        flex: 1 1 0;
        min-height: 0;
        margin-block: 0;
        margin-inline: 0!important;
        overflow: hidden;
        grid-template-rows: minmax(0,1fr);
    }

    .bp-finder-desktop .bp-finder-sidebar {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable;
        overscroll-behavior-y: contain;
    }

    .bp-finder-desktop .bp-finder-list {
        max-height: none;
        overflow: visible;
    }

    .bp-finder-desktop .bp-finder-map-panel {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .bp-finder-desktop .bp-finder-popup {
        max-height: calc(100% - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* Standalone shortcode outside the supported main still has a usable viewport-sized panel. */
    .bp-finder-desktop:not(.bp-finder-main .bp-finder) {
        height: 80dvh;
        flex: none;
    }

}

@media(max-width:700px) {
    .bp-finder {
        height: auto;
        overflow: visible;
    }

    .bp-finder-sidebar {
        height: auto;
        max-height: none;
        overflow: visible;
    }

}

/* 0.5.6: WP admin-bar desktop map height guard.
 * Keep the stable 0.5.1 finder JS untouched; CSS only prevents an undersized
 * first paint when the logged-in admin bar shifts the available viewport. */
@media (min-width: 783px) {
    .admin-bar .bp-finder-frame {
        min-height: calc(100vh - 97px) !important;
        min-height: calc(100dvh - 97px) !important;
    }
}

/* 0.5.16: consistent inline SVG controls instead of text/emoji-style glyphs. */
.bp-finder-card a svg,.bp-finder-popup>a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bp-finder-popup>button svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: auto;
}
