.boe-search-by-word {
    margin: 0 0 14px 0;
    padding: 10px 12px;
    border: 1px solid #d6dbe5;
    border-radius: 8px;
    background: #f7f9fc;
}

.boe-search-by-word-title {
    display: inline-block;
    margin: 0 0 8px 0;
    color: #1c2b47;
    font-weight: 600;
}

.boe-search-by-word-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.boe-letter-btn {
    min-width: 24px;
    height: 24px;
    border: 1px solid #c2cbdd;
    border-radius: 4px;
    background: #ffffff;
    color: #1d2f52;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.boe-letter-btn:hover {
    border-color: #8fa4cf;
    background: #eef3ff;
}

.boe-letter-btn.active {
    border-color: #365ea8;
    background: #365ea8;
    color: #ffffff;
}

.boe-hero-stage {
    position: relative;
    min-height: calc(100vh - 180px);
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    padding: 4px 0 16px;
    border-radius: 0;
    background: #06142f;
    margin-bottom: 0;
    transition: background-color .25s ease, color .25s ease;
}

/* Light mode keeps the same hero background + carousel as dark mode;
   only typography colors switch via the per-element CSS variables. */



/* Avada/Fusion container overrides for BOE hero flush layout */
.fusion-fullwidth:has(.boe-hero-stage) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.fusion-fullwidth:has(.boe-hero-stage) .fusion-builder-row {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.fusion-fullwidth:has(.boe-hero-stage) .fusion-layout-column {
    margin-bottom: 0 !important;
    --awb-margin-bottom-large: 0px;
    --awb-spacing-right-large: 0px;
    --awb-spacing-left-large: 0px;
    --awb-spacing-right-medium: 0px;
    --awb-spacing-left-medium: 0px;
    --awb-spacing-right-small: 0px;
    --awb-spacing-left-small: 0px;
}

.fusion-fullwidth:has(.boe-hero-stage) .fusion-column-wrapper {
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.boe-hero-stage.tone-light {
    background: #e5ebf6;
}

.boe-hero-bg {
    position: fixed;
    inset: 0;
    border-radius: 0;
    overflow: hidden;
    z-index: 0;
    box-shadow: 0 20px 52px rgba(8, 18, 39, 0.32);
    background-attachment: fixed;
    clip-path: inset(var(--boe-bg-clip-top, 100vh) 0 var(--boe-bg-clip-bottom, 0px) 0);
    will-change: clip-path;
    pointer-events: none;
}

.boe-hero-bg .boe-hero-slide,
.boe-hero-bg > img,
.boe-hero-bg > picture > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.boe-hero-bg .boe-hero-slide.is-active,
.boe-hero-bg > img.is-active,
.boe-hero-bg > picture.is-active > img {
    opacity: 1;
}

.boe-hero-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    clip-path: inset(var(--boe-bg-clip-top, 100vh) 0 var(--boe-bg-clip-bottom, 0px) 0);
    will-change: clip-path;
    background: linear-gradient(
        145deg,
        rgba(4, 14, 32, calc(var(--boe-hero-overlay-opacity, 0.4) + 0.18)),
        rgba(3, 10, 24, calc(var(--boe-hero-overlay-opacity, 0.4) + 0.34))
    );
    border-radius: 0;
}

/* Zoom reveal mode — bg grows from bottom instead of being unmasked */
.boe-hero-stage.reveal-zoom .boe-hero-bg,
.boe-hero-stage.reveal-zoom .boe-hero-overlay {
    inset: unset;
    top: var(--boe-bg-top, 100vh);
    left: 0;
    right: 0;
    bottom: 0;
    clip-path: none;
    will-change: top;
}

/* Once a search has run, hide the carousel/overlay so the results sit on a clean canvas */
.boe-hero-stage.has-results .boe-hero-bg,
.boe-hero-stage.has-results .boe-hero-overlay {
    display: none;
}

/* Landing screen (no search yet): show the carousel cleanly with no overlay
   in either theme. */
.boe-hero-stage.no-results .boe-hero-overlay {
    display: none;
}

/* Light-mode results page: solid white canvas instead of the dark blue. Only
   when results are present, otherwise we'd hide the carousel on the landing. */
html[data-boe-theme="light"] .boe-hero-stage.has-results {
    background: #ffffff;
}

.boe-hero-stage {
    --boe-results-row-indicator-color: #9fc2ff;
    --boe-results-row-hover-color: #b7d1ff;
    --boe-results-row-active-color: #e1ecff;
}

html[data-boe-theme="light"] .boe-hero-stage {
    --boe-results-row-indicator-color: #1f4e9f;
    --boe-results-row-hover-color: #1d4ea8;
    --boe-results-row-active-color: #0f2f6f;
}

/* Hide Avada theme header while the page banner is visible (scroll top) */
html.boe-banner-visible #header,
html.boe-banner-visible .fusion-header-wrapper {
    opacity: 0 !important;
    pointer-events: none !important;
}

html:not(.boe-banner-visible) #header,
html:not(.boe-banner-visible) .fusion-header-wrapper {
    transition: opacity 0.4s ease;
}

.boe-hero-content {
    position: relative;
    z-index: 2;
}

.boe-hero-content {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 24px 24px 30px;
}

.boe-hero-layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.boe-hero-search,
.boe-hero-results,
.boe-hero-viewer {
    width: 100%;
    min-width: 0;
}

.boe-hero-results-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.boe-viewer-panel{
    height: 100%!important;
}

.boe-hero-search,
.boe-results-panel,
.boe-viewer-panel {
    padding: 16px;
}

.boe-hero-card {
    background: rgba(241, 247, 255, 0.24);
    border: 1px solid rgba(218, 232, 255, 0.46);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 18px 45px rgba(5, 16, 40, 0.33);
    -webkit-backdrop-filter: blur(13px) saturate(120%);
    backdrop-filter: blur(13px) saturate(120%);
    transition: background-color .25s ease;
}

html[data-boe-theme="light"] .boe-hero-card {
    background: transparent;
    border-color: transparent;
    box-shadow: 0 18px 45px rgba(15, 30, 60, 0.18);
}

/* The search panel is a flat form, not a card — no shadow in either theme. */
.boe-hero-search.boe-hero-card,
html[data-boe-theme="light"] .boe-hero-search.boe-hero-card {
    box-shadow: none;
}

/* ── Light-mode visibility tweaks ─────────────────────────────── */

/* Breadcrumb / nav-trace panels — pale tint instead of dark wash */
html[data-boe-theme="light"] .boe-category-trace {
    background: rgba(40, 60, 100, 0.06);
}
html[data-boe-theme="light"] .boe-nav-trace {
    background: rgba(40, 60, 100, 0.05);
    border-color: rgba(40, 60, 100, 0.15);
}
html[data-boe-theme="light"] .boe-category-trace-item:hover {
    color: var(--boe-breadcrumb-color, #1a2540) !important;
}

/* Entry meta panel — pale tint instead of dark wash */
html[data-boe-theme="light"] .boe-entry-meta {
    background: rgba(40, 60, 100, 0.05);
}

/* Pagination — bump opacity so buttons + dots are visible on white card */
html[data-boe-theme="light"] .boe-results-pager-btn {
    background: rgba(180, 205, 250, 0.45);
    border-top-color: rgba(60, 105, 195, 0.45);
    color: rgba(15, 45, 105, 0.95);
}
html[data-boe-theme="light"] .boe-results-pager-btn:first-child {
    border-right-color: rgba(60, 105, 195, 0.45);
}
html[data-boe-theme="light"] .boe-results-pager-btn:hover:not(:disabled) {
    background: rgba(150, 185, 240, 0.7);
    color: rgba(10, 30, 80, 1);
}
html[data-boe-theme="light"] .boe-results-pager-btn:active:not(:disabled) {
    background: rgba(125, 165, 230, 0.85);
}
html[data-boe-theme="light"] .boe-results-pager-dots {
    border-top-color: rgba(60, 105, 195, 0.30);
}
html[data-boe-theme="light"] .boe-results-pager-dot {
    background: rgba(60, 105, 195, 0.30);
    border-color: rgba(60, 105, 195, 0.65);
}
html[data-boe-theme="light"] .boe-results-pager-dot.is-active {
    background: rgba(60, 105, 195, 0.70);
    border-color: rgba(40, 80, 165, 0.95);
}

.boe-hero-search.boe-hero-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 0;
}

@media (max-width: 1200px) {
    .boe-hero-content {
        max-width: 1100px;
        padding: 18px 18px 24px;
    }

    .boe-hero-layout {
        grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
        gap: 14px;
    }

    .boe-hero-card {
        border-radius: 14px;
    }
}

@media (max-width: 980px) {
    .boe-hero-content {
        max-width: 100%;
        padding: 14px 12px 18px;
    }

    .boe-hero-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .boe-hero-search,
    .boe-hero-results,
    .boe-hero-viewer,
    .boe-results-panel,
    .boe-viewer-panel {
        width: 100%;
    }

    .boe-hero-card {
        border-radius: 12px;
    }

    .boe-hero-results-stack {
        gap: 12px;
    }
}

/* BOE hero/search layout overrides */
.boe-hero-stage.has-min-height-px {
    min-height: max(var(--boe-hero-min-height-vh, 90vh), var(--boe-hero-min-height-px, 0px));
}

.boe-hero-bg-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, #132647 0%, #2a4f89 42%, #3a6db0 100%);
    background-attachment: fixed;
}

.boe-hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 28px;
}

.boe-hero-carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity var(--boe-hero-transition-speed-ms, 700ms) ease,
                transform var(--boe-hero-transition-speed-ms, 700ms) ease;
}

.boe-hero-carousel.preserve-aspect-ratio {
    background: #03102a;
}

.boe-hero-stage.tone-light .boe-hero-carousel.preserve-aspect-ratio {
    background: #f2f6ff;
}

.boe-hero-carousel.preserve-aspect-ratio .boe-hero-carousel-slide {
    inset: 28px;
    border-radius: 18px;
    background-size: contain;
    background-color: #041331;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.boe-hero-stage.tone-light .boe-hero-carousel.preserve-aspect-ratio .boe-hero-carousel-slide {
    background-color: #ffffff;
    box-shadow: 0 12px 30px rgba(26, 48, 86, 0.22);
}

.boe-hero-carousel-slide.is-active {
    opacity: 1;
}

.boe-hero-carousel.effect-slide .boe-hero-carousel-slide {
    transform: translate3d(2.4%, 0, 0);
}

.boe-hero-carousel.effect-slide .boe-hero-carousel-slide.is-active {
    transform: translate3d(0, 0, 0);
}

.boe-hero-carousel.effect-zoom .boe-hero-carousel-slide {
    transform: scale(1.032);
}

.boe-hero-carousel.effect-zoom .boe-hero-carousel-slide.is-active {
    transform: scale(1);
}

.boe-hero-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.boe-hero-stage.no-results .boe-hero-layout {
    min-height: min(66vh, 720px);
    justify-content: flex-start;
    padding-top: 6vh;
}

.boe-hero-stage.no-results .boe-hero-search {
    width: min(980px, 92vw);
    margin: 0 auto;
}

.boe-main-search-group {
    margin: 0 !important;
}

.boe-main-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-radius: 999px;
    padding: 20px 24px;
    margin: 0 auto 16px;
    width: min(100%, 560px);
}

.boe-main-logo-image {
    width: min(100%, 460px);
    height: auto;
    display: block;
}

.boe-main-search-submit-wrap {
    margin: 12px 0 0;
    text-align: left;
}

.boe-main-categories-row {
    margin: 0 0 0.85rem;
    color: var(--boe-category-color, #fff);
    font-size: var(--boe-category-font-size, 15px);
    line-height: 1.45;
    text-align: center;
}

.boe-main-categories-title,
.boe-main-search-title {
    color: var(--boe-main-search-heading-color, #fff);
    font-size: var(--boe-main-search-heading-font-size, 18px);
    letter-spacing: .01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.boe-main-categories-title {
    /*display: block;*/
    margin-bottom: 0.3rem;
    display: none!important;
}

#boe-feedback-link {
    color: var(--boe-meta-color, #e8e9eb);
}

#boe-feedback-link:hover {
    color: var(--boe-meta-color, #e8e9eb);
    opacity: 0.85;
}

.boe-main-categories-links {
    /*display: inline-flex;*/
    display: none!important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
}

.boe-main-categories-divider {
    font-weight: 700;
    line-height: 1;
    margin: 0 0.15rem;
}

.boe-main-search-title {
    display: inline-block;
    margin-bottom: 6px;
}

.boe-root-category-link {
    color: var(--boe-category-color, #fff);
    font-weight: 700;
    font-size: var(--boe-category-font-size, 15px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.boe-root-category-link:hover {
    color: var(--boe-category-color, #fff);
    text-decoration: underline;
}

.boe-main-search-controls {
    display: flex;
    gap: 0;
    align-items: stretch;
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(20, 45, 84, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(8, 20, 47, 0.22);
    overflow: hidden;
}

.boe-main-search-controls:focus-within {
    border-color: rgba(58, 105, 190, 0.6);
    box-shadow: 0 0 0 3px rgba(58, 105, 190, 0.22),
                0 10px 28px rgba(8, 20, 47, 0.22);
}

.boe-main-search-shell {
    display: block;
    width: min(1100px, 100%);
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.boe-top-letter-filter {
    display: none!important;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 0.8rem;
    color: var(--boe-category-color, #fff);
}

.boe-live-filter-chips {
    margin: 10px 0 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border-top: 0;
    width: min(1100px, 100%);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.boe-main-search-input-wrap {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
}

.boe-main-search-input-wrap::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23254a87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") center/contain no-repeat;
    pointer-events: none;
    z-index: 1;
}

.boe-main-search-persistent-placeholder {
    position: absolute;
    top: 50%;
    left: 56px;
    transform: translateY(-50%);
    color: var(--boe-placeholder-font-color, #5d6f8f);
    font-size: var(--boe-input-font-size, 20px);
    line-height: 1.4;
    pointer-events: none;
}

.boe-main-search-input {
    flex: 1 1 auto;
    width: 100%;
    min-height: 60px;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 20px 0 56px !important;
    font-size: var(--boe-input-text-font-size, var(--boe-input-font-size, 20px));
    color: var(--boe-input-color, #132847);
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.boe-main-search-input:focus,
.boe-main-search-input:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
}


.boe-main-search-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 132px;
    min-height: 60px;
    padding: 0 18px;
    border: 0;
    border-left: 1px solid rgba(20, 45, 84, 0.10);
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--boe-cat-btn-font-size, 17px);
    white-space: nowrap;
    color: var(--boe-cat-btn-color, #132847);
}

.boe-main-search-filter-btn:hover {
    background: rgba(20, 45, 84, 0.04);
}

.boe-main-search-submit-btn {
    min-width: 164px;
    padding: 13px 24px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(14, 36, 72, 0.62) 0%, rgba(8, 22, 48, 0.78) 100%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--boe-search-btn-color, #ffffff);
    cursor: pointer;
    font-weight: 800;
    font-size: var(--boe-search-btn-font-size, 17px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 10px 24px rgba(8, 20, 47, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

.boe-main-search-submit-btn:hover {
    background: linear-gradient(180deg, rgba(20, 45, 84, 0.78) 0%, rgba(10, 26, 54, 0.88) 100%);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 12px 28px rgba(8, 20, 47, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.boe-main-search-submit-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.boe-main-search-submit-btn:active {
    transform: translateY(1px);
}

/* ── Compact search form on the results page (narrow sidebar column) ── */
.boe-hero-stage.has-results .boe-main-search-controls {
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(8, 20, 47, 0.16);
}

.boe-hero-stage.has-results .boe-main-search-input {
    min-height: 48px;
    padding: 0 14px 0 44px !important;
    font-size: 16px;
}

.boe-hero-stage.has-results .boe-main-search-input-wrap::before {
    left: 14px;
    width: 18px;
    height: 18px;
}

.boe-hero-stage.has-results .boe-main-search-persistent-placeholder {
    left: 44px;
    font-size: 16px;
}

.boe-hero-stage.has-results .boe-main-search-filter-btn {
    min-width: 0;
    min-height: 48px;
    padding: 0 12px;
    font-size: 14px;
    gap: 4px;
}

.boe-hero-stage.has-results .boe-main-search-filter-btn svg {
    width: 14px;
    height: 14px;
}

.boe-hero-stage.has-results .boe-main-search-submit-wrap {
    margin-top: 10px;
}

.boe-hero-stage.has-results .boe-main-search-submit-btn {
    min-width: 140px;
    padding: 10px 20px;
    font-size: 15px;
    box-shadow: 0 6px 16px rgba(14, 36, 72, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.boe-hero-stage.has-results .boe-main-search-submit-btn:hover {
    box-shadow: 0 8px 20px rgba(14, 36, 72, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.boe-results-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 2fr);
    gap: 18px;
    align-items: start;
}

.boe-results-column {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.boe-results-primary,
.boe-results-secondary {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 0 0 auto;
}

.boe-keyword-results-title {
    margin: 0 0 10px;
}

.boe-results-carousel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.boe-results-panel,
.boe-viewer-panel {
    border: 1px solid rgba(210, 225, 247, 0.55);
    border-radius: 16px;
    background: rgba(245, 250, 255, 0.43);
    box-shadow: 0 15px 38px rgba(7, 19, 45, 0.24);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.boe-viewer-panel {
    position: relative;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    align-self: start;
    overflow: hidden;
}

.boe-viewer-loader {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 24, 50, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.boe-viewer-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.boe-viewer-loader-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    animation: boe-spin 0.7s linear infinite;
    box-shadow: 0 4px 18px rgba(14, 36, 72, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.boe-hero-stage.boe-ui-booting .boe-hero-card {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(.988);
}

.boe-hero-stage.boe-ui-ready .boe-hero-card {
    opacity: 1;
    transform: translateY(0);
}

/* Card shadow stays constant — don't swap it on scroll, that creates a
   visible "jump" especially in light mode where the at-rest shadow is subtle. */
.boe-hero-stage.is-user-scrolling .boe-hero-search.boe-hero-card {
    box-shadow: none;
}


.boe-results-row.is-opening .boe-results-name {
    color: var(--boe-results-row-active-color, #18356c);
}

html {
    scroll-behavior: smooth;
}

#boe-category-modal {
    opacity: 0;
    visibility: hidden;
}

#boe-category-modal .boe-category-modal-dialog {
    opacity: .88;
    transform: translateY(20px) scale(.985);
}

#boe-category-modal.is-open {
    opacity: 1;
    visibility: visible;
}

#boe-category-modal.is-open .boe-category-modal-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 980px) {
    .boe-main-categories-row {
        font-size: var(--boe-category-font-size-mobile, 14px);
        line-height: 1.35;
        margin-bottom: 0.6rem;
    }

    .boe-main-categories-title {
        font-size: var(--boe-heading-font-size-mobile, 16px);
        margin-bottom: 0.2rem;
    }

    .boe-main-categories-links {
        row-gap: 0.25rem;
    }

    .boe-root-category-link {
        font-size: var(--boe-category-font-size-mobile, 14px);
    }

    .boe-main-search-controls {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
    }

    .boe-main-search-submit-btn {
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
    }

    .boe-main-search-filter-btn {
        min-height: 48px;
        min-width: 0;
        padding: 0 12px;
        border-left: 0;
        border-top: 1px solid rgba(20, 45, 84, 0.10);
        width: 100%;
        font-size: var(--boe-cat-btn-font-size-mobile, 15px);
        gap: 4px;
    }

    .boe-main-search-filter-btn svg {
        width: 14px;
        height: 14px;
    }

    .boe-main-search-shell {
        width: 100%;
    }

    .boe-main-search-persistent-placeholder {
        font-size: var(--boe-input-font-size-mobile, 18px);
    }

    .boe-main-search-input {
        font-size: var(--boe-input-text-font-size-mobile, var(--boe-input-font-size-mobile, 18px));
    }

    .boe-main-search-submit-btn {
        font-size: var(--boe-search-btn-font-size-mobile, 15px);
    }

    .boe-main-search-title {
        font-size: var(--boe-main-search-heading-font-size-mobile, 16px);
    }

    .boe-results-hint {
        font-size: var(--boe-heading-font-size-mobile, 16px);
    }
}

.boe-results-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 10px;
}

.boe-collapsible-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.boe-collapsible-toggle[aria-disabled="true"] {
    cursor: default;
}

.boe-collapsible-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 9999px;
    opacity: 1;
    overflow: hidden;
}

.boe-collapsible:not(.is-open) .boe-collapsible-content {
    opacity: 0;
    max-height: 0;
}

.boe-collapsible-toggle span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.boe-collapsible-toggle span:last-child::after {
    content: "▾";
    font-size: 14px;
    opacity: .8;
    transform: translateY(1px);
}

.boe-collapsible-toggle[aria-disabled="true"] span:last-child::after {
    content: "";
}

.boe-collapsible.is-open .boe-collapsible-toggle span:last-child::after {
    transform: rotate(180deg) translateY(-1px);
}

.boe-results-hint {
    margin: 0 0 10px;
    color: var(--boe-heading-color, #fff);
    opacity: .88;
    font-size: var(--boe-heading-font-size, 18px);
    display: none;
}

.boe-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
    table-layout: fixed;
}

.boe-results-row td {
    background: transparent;
    padding: 2px 0;
    border: 0;
    cursor: pointer;
    vertical-align: top;
}

.boe-results-row td:last-child {
    text-align: right;
    color: var(--boe-results-row-indicator-color, #345890);
    font-weight: 700;
    width: 24px;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    transition: opacity .15s ease;
}

.boe-results-row:hover td:last-child,
.boe-results-row-active td:last-child {
    opacity: 1;
}

.boe-results-row:hover .boe-results-name {
    color: var(--boe-results-row-hover-color, #1d4ea8);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.boe-results-row-active .boe-results-name {
    color: var(--boe-results-row-active-color, #18356c);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.boe-results-name {
    display: block;
    font-weight: 600;
    font-size: var(--boe-results-text-font-size, 14px);
    color: var(--boe-results-text-color, #e8eef9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.boe-results-pager-controls {
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

#boe-titles-section {
    scroll-margin-top: 100px;
    /*height: 996px;*/
}

.boe-results-pager-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 100%;
    padding: 10px 16px 8px;
    border-top: 1px solid rgba(147, 178, 228, 0.28);
    width: 100%;
    box-sizing: border-box;
}

.boe-results-pager-dot {
    border: 1px solid rgba(100, 145, 215, 0.50);
    border-radius: 999px;
    width: 7px;
    height: 7px;
    padding: 0;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 1px 3px rgba(14, 36, 72, 0.15);
    cursor: pointer;
}

.boe-results-pager-dot.is-active {
    width: 18px;
    background: rgba(255, 255, 255, 0.50);
    border-color: rgba(70, 120, 210, 0.70);
    box-shadow: 0 1px 6px rgba(50, 90, 180, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.boe-results-pager-btns {
    display: flex;
    width: 100%;
}

.boe-results-pager-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-top: 1px solid rgba(147, 178, 228, 0.35);
    background: rgba(220, 232, 255, 0.28);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgba(25, 55, 115, 0.80);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.boe-results-pager-btn:first-child {
    border-right: 1px solid rgba(147, 178, 228, 0.35);
    border-bottom-left-radius: 16px;
        border-top-left-radius: 16px;

}

.boe-results-pager-btn:last-child {
    border-bottom-right-radius: 16px;
        border-top-right-radius: 16px;

}

.boe-results-pager-btn:hover:not(:disabled) {
    background: rgba(200, 220, 255, 0.50);
    color: rgba(15, 45, 105, 1);
}

.boe-results-pager-btn:active:not(:disabled) {
    background: rgba(180, 205, 255, 0.65);
}

.boe-results-pager-btn:disabled {
    opacity: .28;
    cursor: default;
}

.boe-results-abstract {
    display: block;
    font-size: calc(var(--boe-results-text-font-size, 14px) - 2px);
    color: var(--boe-results-text-color, #e8eef9);
    opacity: 0.72;
    margin-top: 1px;
    padding-left: 10px;
    font-weight: 400;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.boe-viewer-traces {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: -8px;
}

.boe-trace-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.5;
    flex-shrink: 0;
    margin-right: 6px;
}

.boe-category-trace {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 5px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 13px;
    font-size: var(--boe-breadcrumb-font-size, 13px);
    color: var(--boe-breadcrumb-color, #fff);
    background: rgba(0, 0, 0, 0.12);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;

}

.boe-category-trace-sep {
    opacity: 0.55;
}

.boe-category-trace-item {
    opacity: 0.85;
    color: inherit;
    text-decoration: none;
}

.boe-category-trace-item:hover {
    opacity: 1;
    text-decoration: underline;
    color: #fff!important;
}

.boe-nav-trace {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px 10px;
    font-size: var(--boe-breadcrumb-font-size, 13px);
    color: var(--boe-breadcrumb-color, #fff);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.boe-nav-trace-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.boe-nav-trace-item {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: var(--boe-breadcrumb-font-size, 13px);
    color: inherit;
    opacity: 0.85;
    cursor: pointer;
    text-decoration: underline;
}

.boe-nav-trace-item:hover {
    opacity: 1;
}

.boe-nav-trace-item.is-current {
    opacity: 1;
    text-decoration: none;
    cursor: default;
    font-weight: 600;
}

.boe-nav-trace-sep {
    opacity: 0.5;
}

.boe-viewer-title {
    margin: 0 0 5px;
}

.boe-results-primary h3.boe-viewer-title {
    color: var(--boe-titles-heading-color, #fff) !important;
    font-size: var(--boe-titles-heading-font-size, 18px);
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.boe-results-secondary h3.boe-viewer-title {
    color: var(--boe-related-heading-color, #fff) !important;
    font-size: var(--boe-related-heading-font-size, 18px);
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.boe-viewer-frame {
    width: 100%;
    min-height: 0;
    height: clamp(300px, 46vh, 460px);
    flex: 0 0 auto;
    min-height: 0;
    border: 1px solid #c7d6f0;
    border-radius: 10px;
    background: #fff;

}

.boe-viewer-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(199, 214, 240, 0.75);
    margin: 8px 0 0;
}

.boe-viewer-empty-logo {
    display: block;
    width: min(100%, 420px);
    height: auto;
}

.boe-viewer-category-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 0 10px 0;
    border: 1px solid rgba(199, 214, 240, 0.55);
}

.boe-doc-footer {
    margin-top: 12px;
}

.boe-entry-homonyms {
    margin-top: 12px;
    padding: 10px 14px;
    background: #e3e9f4;
    color: var(--boe-homonyms-color, #132847);
    border: 1px solid #b5c5e2;
    border-radius: 10px;
    font-family: "Times New Roman", serif;
    font-size: var(--boe-homonyms-font-size, 18px);
    line-height: 1.15;
}

.boe-entry-homonyms-heading {
    margin: 0 0 6px;
    font-size: inherit;
    color: inherit;
    font-weight: 700;
}

.boe-entry-homonyms-list {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}   

.boe-entry-homonyms-item {
    word-break: break-word;
    font-style: italic;

}

.boe-entry-images {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.boe-entry-image-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 240px;
}

.boe-entry-image-link {
    display: block;
    line-height: 0;
    cursor: zoom-in;
}

.boe-entry-image-frame {
    max-width: 220px;
    max-height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #c7d6f0;
    border-radius: 6px;
}

.boe-entry-image {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.boe-entry-image-descr {
    font-size: var(--boe-image-descr-font-size, 13px);
    line-height: 1.2;
    color: var(--boe-image-descr-color, #fff);
    text-align: center;
    word-break: break-word;
    max-width: 220px;
    font-style: italic;
}

.boe-feedback-wrap {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.boe-feedback-link {
    display: inline-block;
    font-size: 18px;
    font-weight: bold;
    color: var(--boe-meta-color, #fff);
    text-decoration: underline;
    word-break: break-word;
}

.boe-entry-meta {
    margin-top: 12px;
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.14);
}

.boe-entry-meta-row {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr;
    gap: 10px;
    align-items: start;
    color: var(--boe-meta-color, #fff);
    font-size: var(--boe-meta-font-size, 13px);
}

.boe-entry-meta-label {
    font-weight: 700;
    opacity: 0.9;
}

.boe-entry-meta-value {
    opacity: 0.95;
    word-break: break-word;
}

.boe-load-more-btn {
    border: 1px solid #244e93;
    background: #2f63bc;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 980px) {
    .boe-results-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .boe-viewer-frame {
        height: clamp(260px, 44vh, 380px);
    }

    .boe-entry-meta-row {
        grid-template-columns: 1fr;
        gap: 2px;
        font-size: var(--boe-meta-font-size-mobile, 12px);
    }

    .boe-entry-homonyms {
        font-size: var(--boe-homonyms-font-size-mobile, 18px);
    }

    .boe-entry-image-descr {
        font-size: var(--boe-image-descr-font-size-mobile, 12px);
    }

    .boe-results-name {
        font-size: var(--boe-results-text-font-size-mobile, 13px);
    }

    .boe-results-abstract {
        font-size: calc(var(--boe-results-text-font-size-mobile, 13px) - 2px);
    }

    .boe-category-trace {
        font-size: var(--boe-breadcrumb-font-size-mobile, 12px);
    }

    .boe-nav-trace {
        font-size: var(--boe-breadcrumb-font-size-mobile, 12px);
    }

    .boe-nav-trace-item {
        font-size: var(--boe-breadcrumb-font-size-mobile, 12px);
    }

    .boe-results-primary .boe-viewer-title {
        font-size: var(--boe-titles-heading-font-size-mobile, 16px);
    }

    .boe-results-secondary .boe-viewer-title {
        font-size: var(--boe-related-heading-font-size-mobile, 16px);
    }

    .boe-modal-header h3 {
        font-size: var(--boe-modal-heading-font-size-mobile, 16px);
    }

    .boe-filter-chip {
        font-size: var(--boe-filter-font-size-mobile, 13px);
    }

    .boe-letter-filter-btn {
        font-size: var(--boe-filter-font-size-mobile, 13px);
    }

    .boe-modal-cat-btn {
        font-size: var(--boe-modal-filter-font-size-mobile, 13px);
    }

    .boe-modal-breadcrumb-btn {
        font-size: var(--boe-modal-breadcrumb-font-size-mobile, 12px);
    }

    .boe-collapsible-content[hidden] {
        display: none;
    }

    .boe-hero-carousel.preserve-aspect-ratio .boe-hero-carousel-slide {
        inset: 14px;
        background-attachment: scroll;
    }

    .boe-hero-bg,
    .boe-hero-bg-fallback {
        background-attachment: scroll;
    }
}


.boe-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Letter filter buttons (top of search form) ── */
.boe-letter-filter-btn {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid #c2cbdd;
    border-radius: 4px;
    background: #fff;
    color: var(--boe-filter-color, #1d2f52);
    font-size: var(--boe-filter-font-size, 15px);
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.boe-letter-filter-btn.is-active {
    border-color: #365ea8;
    background: #365ea8;
    color: #fff;
}

/* ── Root category link active state ── */
.boe-root-category-link.is-active {
    font-weight: 700;
    text-decoration: underline;
}

/* ── Category modal overlay & dialog ── */
#boe-category-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(9, 16, 32, .55);
    z-index: 9999;
    padding: 22px 12px;
    overflow: auto;
}

.boe-category-modal-dialog {
    background: #fff;
    width: min(760px, 96vw);
    max-height: 88vh;
    overflow: auto;
    margin: 30vh auto 0;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(15, 31, 70, .26);
}

.boe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e3e7f2;
    padding-bottom: 10px;
}

.boe-modal-header h3 {
    margin: 0;
    color: var(--boe-modal-heading-color, #fff) !important;
    font-size: var(--boe-modal-heading-font-size, 18px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.boe-modal-close-btn {
    border: 1px solid #c5cde1;
    background: #f8faff;
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
}

#boe-category-path {
    margin: 12px 0;
    color: #324665;
    font-size: 14px;
    min-height: 20px;
}

#boe-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    min-height: 120px;
    padding: 4px 0;
}

.boe-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #e3e7f2;
    margin-top: 14px;
    padding-top: 12px;
}

.boe-modal-clear-btn {
    border: 1px solid #d0d8ec;
    background: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.boe-modal-save-btn {
    border: 1px solid #244e93;
    background: #2f63bc;
    color: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}

/* ── JS-created modal elements ── */
.boe-modal-up-btn {
    padding: 5px 9px;
    border: 1px solid #c3cce2;
    background: #f8faff;
    border-radius: 8px;
    cursor: pointer;
}

.boe-modal-cat-btn {
    padding: 7px 10px;
    border: 1px solid #c6d2ea;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: var(--boe-modal-filter-font-size, 15px);
    color: var(--boe-modal-filter-color, #1a3461);
}

.boe-modal-cat-btn.is-selected {
    background: #2f63bc;
    color: #fff;
    border-color: #244e93;
}

.boe-modal-cat-btn.is-ancestor {
    background: #eaf1ff;
    border-color: #7e9fd8;
}

.boe-modal-breadcrumb-btn {
    border: none;
    background: none;
    padding: 0;
    color: var(--boe-modal-breadcrumb-color, #234b8f);
    cursor: pointer;
    text-decoration: underline;
    font-size: var(--boe-modal-breadcrumb-font-size, 13px);
}

.boe-modal-breadcrumb-sep {
    color: var(--boe-modal-breadcrumb-color, #234b8f);
    opacity: 0.75;
}

/* ── Live filter chips ── */
.boe-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(10, 22, 45, 0.45);
    color: var(--boe-filter-color, #ffffff);
    font-size: var(--boe-filter-font-size, 15px);
    font-weight: 600;
    white-space: normal;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    backdrop-filter: blur(8px) saturate(130%);
}

.boe-filter-chip > span {
    word-break: break-word;
}

.boe-filter-chip-remove {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.boe-filter-chip-remove:hover {
    background: #ffffff;
    color: #0a162d;
}

/* Page loader */
.boe-page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 24, 50, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
}

.boe-page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.boe-page-loader-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    animation: boe-spin 0.7s linear infinite;
    box-shadow: 0 4px 24px rgba(14, 36, 72, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

@keyframes boe-spin {
    to { transform: rotate(360deg); }
}
