#mobile-nav, #mobile-more:not([open]) {
    display: none;
}

@media (max-width: 700px) {
    :root {
        --mobile-bar-height: calc(66px + env(safe-area-inset-bottom, 0px));
    }
    #nav { display: none; }
    body > aside {
        height: var(--mobile-bar-height);
        padding: 3px env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
        background: #0b2536;
        box-shadow: 0 -8px 28px #061620aa;
    }
    .shell { padding-bottom: var(--mobile-bar-height); }
    .shell > header {
        height: auto;
        min-height: calc(52px + env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px);
    }
    #mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 3px;
        padding: 3px 6px 4px;
    }
    #mobile-nav button {
        min-width: 0;
        min-height: 48px;
        border: 0;
        border-radius: 10px;
        gap: 4px;
        color: #b9cbd7;
        font-size: clamp(10px, 3vw, 12px);
        font-weight: 650;
        line-height: 1.15;
        white-space: nowrap;
    }
    #mobile-nav svg { width: 22px; height: 22px; }
    #mobile-nav button.active { background: #153a39; color: #60f1a0; }
    #mobile-nav button:focus-visible, #mobile-more button:focus-visible {
        outline: 2px solid #60f1a0;
        outline-offset: -2px;
    }
    #mobile-more {
        position: fixed;
        inset: auto 0 0;
        margin: 0;
        width: 100%;
        max-width: none;
        max-height: min(80dvh, 520px);
        padding: 0;
        overflow: auto;
        overscroll-behavior: contain;
        border: 1px solid #2a485b;
        border-radius: 20px 20px 0 0;
        background: #102c3e;
    }
    #mobile-more::backdrop { background: #030d16aa; }
    .mobile-more-content {
        padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    }
    .mobile-more-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
    }
    .mobile-more-heading h2 { margin: 0; }
    .mobile-more-heading button { min-width: 44px; min-height: 44px; border-radius: 8px; background: #1a3a4d; }
    #mobile-more-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        height: auto;
    }
    #mobile-more-links button {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        min-height: 52px;
        gap: 9px;
        padding: 10px;
        border-radius: 10px;
        background: #16364a;
        color: #e5eff5;
        font-size: 13px;
        overflow: visible;
        line-height: 1.2;
    }
    #mobile-more-links button.active { background: #194840; color: #70f5aa; }
    #mobile-more-links svg { flex: 0 0 20px; width: 20px; height: 20px; }
}
