/* ============================================================
 * Responsive navigation (P6): desktop one-row nav with a "Help"
 * dropdown; mobile collapses to a hamburger + slide-in panel.
 * ============================================================ */

/* ---- Desktop "Help" dropdown ---- */
.wm-tabs__help {
    background: transparent; border: 0; cursor: pointer; font: inherit;
    display: inline-flex; align-items: center; gap: 5px;
}
.wm-tabs__help-chev { font-size: .66em; opacity: .8; transition: transform .15s ease; }
.wm-tabs__item-wrap--help:hover .wm-tabs__help-chev,
.wm-tabs__item-wrap--help:focus-within .wm-tabs__help-chev { transform: rotate(180deg); }
/* Right-align the Help submenu under the button so a straight-down mouse path
   stays over it. The shared rule applies translateX(-50%), which dragged this
   right-aligned menu ~100px to the left -- off to the side of the button -- so
   the cursor fell into empty space and the menu closed. Override it here. */
.wm-tabs__submenu--help {
    right: 0; left: auto; margin-top: 0;
    transform: translateX(0) translateY(6px);
}
.wm-tabs__item-wrap--help:hover .wm-tabs__submenu--help,
.wm-tabs__item-wrap--help:focus-within .wm-tabs__submenu--help {
    transform: translateX(0) translateY(2px);
}
/* Keep the menu open while the cursor travels from "Help" down into it.
   The invisible ::before must OVERLAP the button and fully span the gap --
   the old 10px bridge left a dead strip, so the menu closed mid-move.
   :hover tracks descendants, so a hoverable bridge touching both ends holds. */
.wm-tabs__submenu--help::before { top: -18px; height: 18px; left: 0; right: 0; }
/* A little breathing room between the bridge and the first item. */
.wm-tabs__submenu--help .wm-tabs__subitem:first-child { margin-top: 2px; }

/* ---- Hamburger button (hidden on desktop) ---- */
.wm-hamburger { display: none; }

/* ---- Mobile slide-in panel ---- */
.wm-navpanel[hidden] { display: none; }
.wm-navpanel { position: fixed; inset: 0; z-index: 10000; }
.wm-navpanel__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.wm-navpanel__sheet {
    position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 330px);
    background: var(--wm-panel, #0d1e2a); border-left: 1px solid var(--wm-line, #1d3b44);
    box-shadow: -14px 0 44px rgba(0, 0, 0, .5);
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto;
    display: flex; flex-direction: column; gap: 1px;
    animation: wm-navpanel-in .18s ease;
}
@keyframes wm-navpanel-in { from { transform: translateX(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.wm-navpanel__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.wm-navpanel__title { font-weight: 800; font-size: 1.05rem; color: var(--wm-text, #e6f2ee); }
.wm-navpanel__close { background: transparent; border: 0; color: var(--wm-text, #e6f2ee); font-size: 1.9rem; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.wm-navpanel__close:hover { background: var(--wm-panel-2, #122735); }
.wm-navpanel__group { margin: 14px 2px 3px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wm-text-dim, #9db1ae); }
.wm-navpanel__link { display: block; padding: 12px 10px; border-radius: 10px; color: var(--wm-text, #e6f2ee); text-decoration: none; font-weight: 600; }
.wm-navpanel__link:hover, .wm-navpanel__link:focus-visible { background: var(--wm-panel-2, #122735); }
.wm-navpanel__link.is-active { color: var(--wm-aqua, #7fffd4); background: rgba(127, 255, 212, .08); }

/* ============================================================
 * Breakpoint: hamburger below 900px, full nav at/above.
 * ============================================================ */
@media (max-width: 900px) {
    /* !important overrides style.css's two max-width:900 blocks that re-show
       the old nav as a wrapped grid. The hamburger replaces it here. */
    .wm-tabs { display: none !important; }
    .wm-install-pill { display: none !important; }
    .wm-topbar__inner {
        display: flex !important; gap: 10px !important; flex-wrap: nowrap !important;
        flex-direction: row !important; align-items: center !important;
        grid-template-columns: none !important;
        padding-top: 0 !important; padding-bottom: 0 !important;
    }
    .wm-topbar__inner > * { align-self: center !important; margin-top: 0 !important; }
    .wm-mode-toggle { padding: 3px !important; }
    .wm-topbar { padding-top: 6px !important; padding-bottom: 6px !important; }
    .wm-brand { margin-right: auto; margin-bottom: 0 !important; min-width: 0; }
    /* shrink brand + toggle so logo + toggle + hamburger fit one <64px row */
    .wm-brand__name { font-size: .92rem; }
    .wm-brand__mark { font-size: 1.1rem; }
    .wm-mode-toggle__btn { padding: 6px 12px !important; font-size: .78rem !important; }
    .wm-mode-toggle { order: 9; }
    .wm-hamburger {
        order: 10; display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; flex: 0 0 auto;
        background: transparent; border: 1px solid var(--wm-line, #1d3b44);
        border-radius: 10px; cursor: pointer; color: var(--wm-text, #e6f2ee);
    }
    .wm-hamburger__box { display: inline-flex; flex-direction: column; gap: 4px; width: 20px; }
    .wm-hamburger__bar { height: 2px; width: 100%; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .15s ease; }
    /* The hamburger replaces the bottom tab bar on mobile. */
    .wm-bottomnav { display: none !important; }
    /* Shrink on scroll: keep logo + hamburger, drop the toggle. */
    .wm-topbar.wm-topbar--shrunk .wm-mode-toggle { display: none; }
}
@media (max-width: 420px) {
    .wm-topbar__inner { gap: 8px !important; }
    .wm-brand__name { font-size: .86rem; }
    .wm-mode-toggle__btn { padding: 6px 10px !important; font-size: .74rem !important; }
}

/* hamburger -> X while the panel is open */
.wm-nav-open .wm-hamburger__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.wm-nav-open .wm-hamburger__bar:nth-child(2) { opacity: 0; }
.wm-nav-open .wm-hamburger__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
/* lock scroll behind the open panel */
body.wm-nav-open { overflow: hidden; }
