/**
 * MyLibrary desktop navigation v3.10.214
 * One viewport-safe, three-column menu panel. No sideways hover flyouts.
 * The original WordPress menu remains intact, including its mobile version.
 */
@media (min-width: 1201px) {
    /* After JS confirms it has built the new panel, suppress every Veen / legacy
       hover submenu (including nested :hover and :focus-within variants). */
    html.mlb-mega-enabled #header nav.main-nav ul.menu ul.sub-menu,
    html.mlb-mega-enabled #header nav.main-nav ul.menu li:hover > ul.sub-menu,
    html.mlb-mega-enabled #header nav.main-nav ul.menu li:focus-within > ul.sub-menu,
    html.mlb-mega-enabled #header nav.main-nav ul.menu li.mlb-menu-open > ul.sub-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    html.mlb-mega-enabled #header nav.main-nav ul.menu > li.mlb-mega-trigger > a {
        position: relative;
    }
    html.mlb-mega-enabled #header nav.main-nav ul.menu > li.mlb-mega-trigger.mlb-mega-active > a::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 18px;
        right: 18px;
        height: 3px;
        border-radius: 4px 4px 0 0;
        background: currentColor;
    }
    .mlb-mega-panel {
        position: fixed;
        z-index: 2147480000;
        box-sizing: border-box;
        width: min(1060px, calc(100vw - 32px));
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        color: #25354c;
        background: #fff;
        border: 1px solid #dfe7f1;
        border-radius: 15px;
        box-shadow: 0 17px 50px rgba(29, 43, 63, .19);
        font: 14px/1.4 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }
    .mlb-mega-panel[hidden] { display: none !important; }
    .mlb-mega-panel *, .mlb-mega-panel *::before, .mlb-mega-panel *::after { box-sizing: border-box; }
    .mlb-mega-panel a { color: inherit; text-decoration: none; }
    .mlb-mega-panel button, .mlb-mega-panel input { font: inherit; }
    .mlb-mega-panel :is(a, button, input):focus-visible { outline: 2px solid #1769ce; outline-offset: -2px; }
    .mlb-mega-toolbar {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-bottom: 1px solid #e8eef5;
        background: #fbfcff;
    }
    .mlb-mega-title {
        display: inline-block;
        flex: 0 1 28%;
        max-width: 235px;
        min-width: 120px;
        font-size: 16px;
        font-weight: 750;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mlb-mega-search {
        min-width: 0;
        flex: 1;
        display: block;
        border: 1px solid #d9e3ee;
        border-radius: 10px;
        height: 38px;
        padding: 8px 12px;
        background: #fff;
        color: #263648;
    }
    .mlb-mega-search::placeholder { color: #77869a; }
    .mlb-mega-close {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border: 0;
        background: transparent;
        border-radius: 9px;
        color: #55657a;
        cursor: pointer;
        font-size: 22px !important;
    }
    .mlb-mega-close:hover { background: #edf2f9; }
    .mlb-mega-columns {
        display: grid;
        flex: 1 1 auto;
        min-height: 0;
        grid-template-columns: 23% 34% minmax(0, 43%);
        overflow: hidden;
    }
    .mlb-mega-columns[hidden] { display: none !important; }
    .mlb-mega-column {
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border-right: 1px solid #e8eef5;
    }
    .mlb-mega-column:last-child { border-right: 0; }
    .mlb-mega-column__heading {
        flex: 0 0 auto;
        padding: 12px 13px 8px;
        color: #6b7a90;
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .07em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mlb-mega-column__list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding: 0 9px 12px;
    }
    .mlb-mega-column__list.mlb-mega-grid {
        display: grid;
        align-content: start;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px;
    }
    .mlb-mega-entry { display: flex; align-items: stretch; min-width: 0; border-radius: 9px; }
    .mlb-mega-entry:hover, .mlb-mega-entry.mlb-mega-selected, .mlb-mega-entry:focus-within { background: #edf4fd; }
    .mlb-mega-entry.mlb-mega-selected > a { font-weight: 700; }
    .mlb-mega-entry > a {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        min-height: 37px;
        padding: 8px 8px 8px 10px;
        overflow-wrap: anywhere;
        line-height: 1.3;
        font-size: 13px;
    }
    .mlb-mega-entry > button {
        flex: 0 0 26px;
        width: 26px;
        color: #56769f;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        background: none;
        border: 0;
        border-radius: 7px;
    }
    .mlb-mega-entry > button:hover { background: #d7e7fa; }
    .mlb-mega-empty {
        padding: 12px;
        color: #75859a;
        font-size: 13px;
    }
    .mlb-mega-results {
        overflow-y: auto;
        min-height: 0;
        flex: 1 1 auto;
        padding: 14px;
    }
    .mlb-mega-results[hidden] { display: none !important; }
    .mlb-mega-results__items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .mlb-mega-result { display: block; min-width: 0; border-radius: 8px; padding: 10px 12px; }
    .mlb-mega-result:hover { background: #edf4fd; }
    .mlb-mega-result strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
    .mlb-mega-result small { display: block; color: #718095; font-size: 11px; margin-top: 3px; }
    .mlb-mega-foot {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex: 0 0 auto;
        border-top: 1px solid #e8eef5;
        background: #fafcff;
        padding: 8px 15px;
        gap: 16px;
        font-size: 12px;
        color: #738196;
    }
}
@media (prefers-reduced-motion: reduce) {
    .mlb-mega-panel { scroll-behavior: auto; }
}
