.bd {
    --bd-text: #f0f7f2;
    --bd-muted: #a9bbb0;
    --bd-border: rgba(154, 186, 167, .21);
    --bd-green: #89f7a9;
    --bd-cyan: #79d9ff;
    --bd-amber: #f2cc5d;
    min-width: 0;
    max-width: 1600px;
    padding: 24px clamp(14px, 2.6vw, 36px) 44px;
    margin-inline: auto;
    color: var(--bd-text);
    scroll-margin-top: 136px;
}

.bd, .bd * { box-sizing: border-box; }
.bd a { color: inherit; text-decoration: none; }
.bd :is(a, input, button, select):focus-visible { outline: 2px solid var(--bd-green); outline-offset: 2px; }

.bd-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    align-items: center;
    gap: 16px 24px;
    padding: clamp(16px, 2.4vw, 28px);
    border: 1px solid var(--bd-border);
    border-radius: 14px;
    background: radial-gradient(ellipse at 82% 0%, #163a27 0%, transparent 68%), #0a1611;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
}

.bd-eyebrow {
    margin: 0 0 7px;
    color: var(--bd-green);
    font: 700 .71rem "JetBrains Mono", monospace;
    letter-spacing: .11em;
    text-transform: uppercase;
}

html body.lab-shell-page .lab-canvas .bd h1 {
    margin: 0 !important;
    color: var(--bd-text) !important;
    font-size: clamp(1.85rem, 3.2vw, 2.7rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.038em !important;
}

.bd-intro { margin: 8px 0 0; color: var(--bd-muted); font-size: .94rem; line-height: 1.5; }
.bd-quick-links, .bd-stats { display: flex; flex-wrap: wrap; gap: 7px; }
.bd-quick-links { justify-content: flex-end; max-width: 334px; }
.bd-quick-links a, .bd-apply {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid var(--bd-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: var(--bd-text);
    font-size: .77rem;
    font-weight: 700;
}
.bd-quick-links a:hover, .bd-apply:hover { border-color: var(--bd-green); }
.bd-stats { grid-column: 1 / -1; margin: 0; padding: 0; list-style: none; }
.bd-stats li {
    padding: 6px 9px;
    border: 1px solid var(--bd-border);
    border-radius: 8px;
    background: rgba(3, 10, 7, .6);
    color: var(--bd-muted);
    font-size: .75rem;
}
.bd-stats strong { color: var(--bd-green); font: 700 .8rem "JetBrains Mono", monospace; }

.bd-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 18px 0 23px; min-width: 0; }
.bd-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.bd-search { position: relative; min-width: 0; }
.bd-search-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid #38704c;
    border-radius: 12px;
    background: #08130d;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .21);
}
.bd-search-field:focus-within { border-color: #64d889; }
.bd-search-icon {
    width: 20px;
    height: 20px;
    margin-left: 7px;
    fill: none;
    stroke: var(--bd-green);
    stroke-linecap: round;
    stroke-width: 1.8;
}
.bd-search input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--bd-text);
    font: inherit;
    color-scheme: dark;
}
.bd-search input::placeholder { color: var(--bd-muted); opacity: 1; }
.bd-search-button {
    min-height: 42px;
    padding: 0 17px;
    border: 0;
    border-radius: 8px;
    background: #31e274;
    color: #062013;
    font: 800 .87rem Inter, system-ui, sans-serif;
    cursor: pointer;
}
.bd-search-button:hover { background: var(--bd-green); }

.bd-suggestions {
    position: absolute;
    z-index: 5;
    inset: calc(100% + 5px) 0 auto;
    max-height: min(400px, 55vh);
    overflow-y: auto;
    margin: 0;
    padding: 5px;
    border: 1px solid #38704c;
    border-radius: 12px;
    background: #0a1911;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    list-style: none;
}
.bd-suggestions a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
}
.bd-suggestions a:hover, .bd-suggestions [aria-selected="true"] a { background: #193425; }
.bd-suggestions .bd-logo { --bd-tile-size: 38px; border-radius: 8px; font-size: .75rem; }
.bd-suggestions .bd-logo img { padding: 4px; }
.bd-suggestion-text { min-width: 0; }
.bd-suggestion-text strong, .bd-suggestion-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-suggestion-text strong { font-size: .88rem; }
.bd-suggestion-text small { margin-top: 3px; color: var(--bd-muted); font-size: .75rem; }

.bd-segments, .bd-countries {
    display: flex;
    min-width: 0;
    max-width: 100%;
    gap: 5px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: #315740 transparent;
    scrollbar-width: thin;
    white-space: nowrap;
}
.bd-segments {
    justify-self: start;
    padding: 4px;
    border: 1px solid var(--bd-border);
    border-radius: 10px;
    background: #07110c;
}
.bd-segments a, .bd-countries a {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 0 12px;
    color: var(--bd-muted);
    font-size: .8rem;
    font-weight: 750;
}
.bd-segments a:focus-visible, .bd-countries a:focus-visible { outline-offset: -2px; }
.bd-segments a:hover, .bd-countries a:hover { color: var(--bd-text); border-color: #38704c; }
.bd-segments [aria-current], .bd-countries [aria-current] {
    border-color: #38704c;
    background: #163924;
    color: var(--bd-green);
}
.bd-countries { padding-bottom: 7px; }
.bd-countries a { min-height: 32px; padding-inline: 9px; border-color: var(--bd-border); border-radius: 8px; background: #0b1711; }
.bd-countries small { color: var(--bd-cyan); font: 600 .68rem "JetBrains Mono", monospace; }

.bd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.bd-filters label { display: flex; align-items: center; gap: 6px; color: var(--bd-muted); font-size: .79rem; font-weight: 650; }
.bd-filters select {
    max-width: 100%;
    min-height: 34px;
    padding: 3px 7px;
    border: 1px solid var(--bd-border);
    border-radius: 8px;
    background: #0b1711;
    color: var(--bd-text);
    color-scheme: dark;
    font: inherit;
}
.bd-filters .bd-logo-toggle { min-height: 34px; padding: 0 9px; border: 1px solid var(--bd-border); border-radius: 8px; cursor: pointer; }
.bd-logo-toggle input { margin: 0; accent-color: #31e274; cursor: pointer; }
.bd-filters .bd-sort { margin-left: auto; }
.bd-apply { cursor: pointer; }

.bd-popular {
    min-width: 0;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid var(--bd-border);
    border-radius: 14px;
    background: linear-gradient(170deg, #10251a, #09140e);
}
.bd h2 { margin: 0; }
.bd-wall {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.bd-popular-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 89px;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 10px;
}
.bd-popular-tile:hover { border-color: #38704c; background: rgba(49, 226, 116, .075); }
.bd-popular-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #e0ede4;
    font-size: .7rem;
    font-weight: 700;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bd-logo {
    --bd-tile-size: 52px;
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: var(--bd-tile-size);
    height: var(--bd-tile-size);
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--bd-from), var(--bd-to));
    color: #fff;
    font: 800 .94rem "JetBrains Mono", monospace;
}
.bd-logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 6px;
    object-fit: contain;
    background: #fff;
}
.bd-wall .bd-logo { width: min(100%, 84px); height: 52px; }
.bd-wall .bd-logo img { padding: 8px; }

.bd-results-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.bd-results-heading p { margin: 0; color: var(--bd-muted); font: 600 .76rem "JetBrains Mono", monospace; }
.bd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bd-card {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 101px;
    padding: 10px;
    border: 1px solid var(--bd-border);
    border-radius: 12px;
    background: linear-gradient(155deg, #10231a, #09150f);
    box-shadow: 0 5px 12px rgba(0, 0, 0, .14);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.bd-card:hover {
    transform: translateY(-2px);
    border-color: #56b375;
    box-shadow: 0 5px 20px rgba(49, 226, 116, .13);
}
.bd-card-body { flex: 1; min-width: 0; }
.bd-name, .bd-location { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-name { font-size: .88rem; line-height: 1.3; }
.bd-location { margin-top: 4px; color: var(--bd-muted); font-size: .75rem; }
.bd-reference { font: 600 .69rem "JetBrains Mono", monospace; }
.bd-us {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 4px;
    background: #19303a;
    color: var(--bd-cyan);
    font: 700 .62rem "JetBrains Mono", monospace;
}
.bd-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.bd-tags span { padding: 2px 5px; border-radius: 4px; background: #173424; color: var(--bd-green); font-size: .62rem; font-weight: 700; }
.bd-tags .bd-bic { background: #19303a; color: var(--bd-cyan); }
.bd-tags .bd-credit-union { background: #332b16; color: var(--bd-amber); }
.bd-arrow { align-self: flex-start; margin-left: -4px; color: #93ab9d; font-size: .83rem; }
.bd-card:hover .bd-arrow { color: var(--bd-green); }

.bd-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 16px; }
.bd-pagination > * {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    min-height: 34px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--bd-muted);
    font-size: .76rem;
    font-weight: 750;
}
.bd-pagination a { border-color: var(--bd-border); background: #0c1912; }
.bd-pagination a:hover { border-color: var(--bd-green); }
.bd-pagination [aria-current] { border-color: #56b375; background: #193c27; color: var(--bd-green); }
.bd-pagination .bd-disabled { color: #84988b; }

.bd-empty, .bd-method { padding: 17px; border: 1px solid var(--bd-border); border-radius: 12px; background: #0b1711; }
.bd-empty h3 { margin: 0; }
.bd-empty p, .bd-method p { margin: 7px 0 0; color: var(--bd-muted); font-size: .87rem; line-height: 1.55; }
.bd-empty a { display: inline-block; margin-top: 10px; color: var(--bd-green); text-decoration: underline; }
.bd-method { margin-top: 25px; }
.bd-method div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.bd-method strong { display: block; color: var(--bd-text); }

@media (min-width: 620px) { .bd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .bd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .bd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1040px) {
    .bd-wall {
        grid-template-columns: none;
        grid-template-rows: repeat(2, auto);
        grid-auto-flow: column;
        grid-auto-columns: minmax(90px, 1fr);
        overflow-x: auto;
        scrollbar-width: thin;
    }
}
@media (max-width: 700px) {
    .bd-header, .bd-method div { grid-template-columns: minmax(0, 1fr); }
    .bd-header { gap: 11px; }
    .bd-quick-links { justify-content: flex-start; }
    .bd-search-field { gap: 5px; }
    .bd-search-button { padding-inline: 10px; }
    .bd-filters .bd-sort { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .bd-card { transition: none; } }
