.hub-mobile-drawer,
.hub-mobile-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    :root {
        --hub-header-height: 68px;
    }

    body.wh-v4 .topbar {
        height: var(--hub-header-height) !important;
        min-height: var(--hub-header-height) !important;
        padding: 0 16px !important;
        gap: 10px;
    }

    body.wh-v4 .topbar .brand {
        font-size: 18px;
        min-width: 0;
    }

    body.wh-v4 .topbar .brand img {
        width: 48px;
        height: 39px;
        object-fit: contain;
    }

    body.wh-v4.js-mobile-nav .hub-mobile-nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-height: 44px;
        padding: 8px 12px;
        gap: 8px;
        font-size: 13px;
    }

    body.wh-v4.js-mobile-nav .topbar #hub-primary-nav,
    body.wh-v4.js-mobile-nav .app-shell.has-sidebar > .admin-sidebar {
        display: none !important;
    }

    body.wh-v4 .app-shell.has-sidebar.hub-workspace-shell {
        display: block !important;
        min-width: 0;
    }

    body.wh-v4 .app-shell.hub-workspace-shell > main,
    body.wh-v4 .app-shell.has-sidebar > main {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    body.wh-v4 .app-shell.hub-workspace-shell > main > .section {
        padding: 20px 16px 34px;
    }

    body.wh-v4.js-mobile-nav .hub-mobile-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1090;
        width: 100%;
        height: 100%;
        background: rgba(13, 35, 49, .44);
        border: 0;
        cursor: pointer;
    }

    body.wh-v4.js-mobile-nav .hub-mobile-drawer:not([hidden]) {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1091;
        gap: 14px;
        width: min(360px, 100vw);
        height: 100vh;
        height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 16px 14px 28px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(28px, env(safe-area-inset-bottom));
        background: var(--hub-nav-background);
        border-left: 1px solid var(--hub-nav-border);
        box-shadow: -8px 0 24px rgba(11, 43, 58, .15);
        color: #17384d;
    }

    body.wh-v4.js-mobile-nav.hub-nav-open {
        overflow: hidden;
    }

    .hub-mobile-drawer-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 42px;
        padding: 0 8px 10px;
        border-bottom: 1px solid var(--hub-nav-border);
    }

    .hub-mobile-drawer-title {
        font-size: 17px;
        font-weight: 750;
    }

    .hub-mobile-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: #fff;
        border: 1px solid var(--hub-nav-border);
        border-radius: 9px;
        color: #17384d;
        font-size: 23px;
        cursor: pointer;
    }

    .hub-mobile-drawer-section {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }

    .hub-mobile-drawer-section + .hub-mobile-drawer-section {
        padding-top: 12px;
        border-top: 1px solid var(--hub-nav-border);
    }

    .hub-mobile-drawer-label {
        margin: 4px 8px 6px;
        color: #708893;
        font-size: 10px;
        font-weight: 750;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    .hub-mobile-drawer-section a,
    .hub-mobile-drawer-section button.navbtn {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        padding: 10px 12px;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 9px;
        box-shadow: none;
        color: var(--hub-nav-text);
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
        text-align: left;
        text-decoration: none;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .hub-mobile-drawer-section a.active,
    .hub-mobile-drawer-section a[aria-current="page"] {
        background: var(--hub-nav-selected);
        border-color: #c2e4e6;
        box-shadow: inset 3px 0 0 var(--hub-nav-accent);
        color: #006f7a;
    }

    .hub-mobile-drawer-section a:hover,
    .hub-mobile-drawer-section button.navbtn:hover {
        background: #e7f4f5;
        color: #006f7a;
    }

    .hub-mobile-drawer-section a:focus-visible,
    .hub-mobile-drawer-section button:focus-visible,
    .hub-mobile-drawer-close:focus-visible {
        outline: 3px solid var(--hub-nav-accent);
        outline-offset: 2px;
    }

    .hub-mobile-drawer-section form {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 360px) {
    body.wh-v4 .topbar .brand {
        font-size: 16px;
    }

    body.wh-v4 .app-shell.hub-workspace-shell > main > .section {
        padding: 16px 12px 30px;
    }
}

@media print {
    .hub-mobile-drawer,
    .hub-mobile-backdrop,
    .hub-mobile-nav-toggle {
        display: none !important;
    }
}

@media (max-width: 650px) {
    body.wh-v4 .app-shell.has-sidebar > main .section-head {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
    }

    body.wh-v4 .app-shell.has-sidebar > main .section-head > div:first-child {
        flex: none;
        width: 100%;
        height: auto;
    }

    body.wh-v4 .app-shell.has-sidebar > main .section-head .actions {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .hub-mobile-drawer-section .hub-mobile-drawer-label:not(:first-child) {
        margin-top: 11px;
        padding-top: 14px;
        border-top: 1px solid var(--hub-nav-border);
    }
}
