/* Desktop: hide hamburger, let Foundation handle layout normally */
@media only screen and (min-width: 941px) {
    .top-bar .title-area li.toggle-topbar.menu-icon {
        display: none !important;
    }
}

/* Mobile: flexbox on title-area to push hamburger right */
@media only screen and (max-width: 940px) {
    .top-bar .title-area {
        display: flex !important;
        align-items: center;
        width: 100%;
    }
    .top-bar .title-area li.name { flex: 1; }
    .top-bar .title-area li.toggle-topbar.menu-icon {
        margin-left: auto;
        float: none !important;
    }
}

/* Mobile expanded: stack all sections vertically, no overlap */
@media only screen and (max-width: 940px) {
    .top-bar.expanded {
        height: auto !important;
        overflow: visible !important;
    }
    .top-bar.expanded .top-bar-section {
        position: static !important;
        float: none !important;
        width: 100% !important;
        display: block !important;
        left: auto !important;
    }
    .top-bar.expanded .top-bar-section ul {
        float: none !important;
        width: 100% !important;
        display: block !important;
    }
    .top-bar.expanded .top-bar-section ul li {
        width: 100% !important;
        display: block !important;
    }
    .top-bar.expanded .top-bar-section ul li > a {
        padding: 5px 15px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    /* Show dropdown contents inline — always visible in expanded mobile menu */
    .top-bar.expanded .top-bar-section ul li.has-dropdown > ul.dropdown,
    .top-bar.expanded .top-bar-section ul li.has-dropdown > ul.dropdown li {
        position: static !important;
        float: none !important;
        width: 100% !important;
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(0,0,0,0.12) !important;
        padding-left: 15px !important;
    }
    /* Hide the «Back» generated items on mobile */
    .top-bar.expanded .top-bar-section ul li.title.back {
        display: none !important;
    }
    /* Library table columns stack vertically */
    .top-bar.expanded .library-table,
    .top-bar.expanded .library-table > div {
        float: none !important;
        width: 100% !important;
        display: block !important;
    }
    /* school-level-links div */
    .top-bar.expanded #school-level-links {
        display: block !important;
    }
}

/* Compact nav items on tablet */
@media only screen and (min-width: 941px) and (max-width: 1279px) {
    .top-bar-section ul.right.accountlinks > li > a {
        padding: 0 6px !important;
        font-size: 11px !important;
    }
}
