.mobile-appbar,
.mobile-bottom-nav,
.mobile-nav-backdrop,
.mobile-drawer-close {
    display: none;
}

@media (max-width: 760px) {
    :root {
        --mobile-appbar-height: 64px;
        --mobile-bottom-nav-height: 68px;
        --mobile-safe-top: env(safe-area-inset-top, 0px);
        --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    html,
    body.mobile-shell-ready {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    body.mobile-shell-ready {
        min-height: 100dvh;
        overscroll-behavior-x: none;
    }

    body.mobile-shell-ready.mobile-nav-open {
        overflow: hidden;
    }

    body.mobile-shell-ready .app-frame {
        display: block;
        width: 100%;
        min-width: 0;
        min-height: 100dvh;
    }

    body.mobile-shell-ready .workspace {
        width: 100%;
        min-width: 0;
        min-height: 100dvh;
        padding-top: calc(var(--mobile-appbar-height) + var(--mobile-safe-top));
    }

    .mobile-appbar {
        position: fixed;
        z-index: 800;
        inset: 0 0 auto;
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        gap: 4px;
        height: calc(var(--mobile-appbar-height) + var(--mobile-safe-top));
        padding: var(--mobile-safe-top) 10px 0;
        border-bottom: 1px solid rgba(8, 43, 102, .12);
        color: #171918;
        background: rgba(251, 250, 247, .96);
        box-shadow: 0 8px 28px rgba(8, 43, 102, .07);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
        backdrop-filter: blur(18px) saturate(150%);
    }

    .mobile-menu-toggle,
    .mobile-profile-link,
    .mobile-drawer-close {
        display: inline-grid;
        place-items: center;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
        border: 0;
        border-radius: 14px;
        color: #082b66;
        background: transparent;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-toggle:active,
    .mobile-profile-link:active,
    .mobile-drawer-close:active {
        background: #e8f3ff;
    }

    .mobile-menu-toggle svg,
    .mobile-profile-link > svg,
    .mobile-drawer-close svg {
        width: 25px;
        height: 25px;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        fill: none;
    }

    .mobile-app-brand {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-width: 0;
        width: fit-content;
        max-width: 100%;
        padding: 4px 6px;
        border-radius: 12px;
        color: inherit;
        text-decoration: none;
    }

    .mobile-app-brand .brand-mark {
        width: 31px;
        height: 31px;
        padding: 6px;
        border-radius: 9px;
    }

    .mobile-app-brand-copy {
        display: block;
        min-width: 0;
    }

    .mobile-app-brand-copy strong,
    .mobile-app-brand-copy span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-app-brand-copy strong {
        color: #082b66;
        font-size: 13px;
        font-weight: 800;
        letter-spacing: .08em;
        line-height: 1.1;
    }

    .mobile-app-brand-copy span {
        margin-top: 3px;
        color: #666963;
        font-size: 10px;
        font-weight: 650;
        line-height: 1.1;
    }

    .mobile-profile-link .user-avatar {
        width: 38px;
        height: 38px;
        border: 1px solid rgba(21, 93, 186, .18);
        color: #082b66;
        background: #e8f3ff;
        font-size: 11px;
    }

    .mobile-appbar-spacer {
        display: block;
        width: 48px;
        height: 48px;
    }

    body.mobile-shell-ready .sidebar {
        position: fixed;
        z-index: 920;
        inset: 0 auto 0 0;
        display: flex;
        flex-direction: column;
        width: min(88vw, 360px);
        max-width: 100%;
        height: 100dvh;
        padding: calc(22px + var(--mobile-safe-top)) 18px calc(18px + var(--mobile-safe-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
        color: #f7f8f5;
        background: #161817;
        box-shadow: 20px 0 60px rgba(5, 16, 36, .28);
        visibility: hidden;
        transform: translate3d(-104%, 0, 0);
        transition: transform 220ms cubic-bezier(.22, 1, .36, 1), visibility 0s linear 220ms;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-shell-ready.mobile-nav-open .sidebar {
        visibility: visible;
        transform: translate3d(0, 0, 0);
        transition-delay: 0s;
    }

    body.mobile-shell-ready .sidebar > .brand {
        flex: 0 0 auto;
        max-width: calc(100% - 58px);
        min-height: 48px;
        padding: 4px 2px;
    }

    body.mobile-shell-ready .sidebar .brand-copy small {
        display: block;
    }

    .mobile-drawer-close {
        position: absolute;
        top: calc(15px + var(--mobile-safe-top));
        right: 12px;
        color: #d4d8d3;
        background: rgba(255, 255, 255, .055);
    }

    .mobile-drawer-close:active {
        color: #fff;
        background: rgba(255, 255, 255, .12);
    }

    body.mobile-shell-ready .sidebar .primary-nav {
        display: grid;
        flex: 0 0 auto;
        gap: 3px;
        width: 100%;
        max-width: 100%;
        margin-top: 34px;
        padding: 0;
        overflow: visible;
    }

    body.mobile-shell-ready .sidebar .nav-label {
        display: block;
        margin: 18px 12px 8px;
        color: #a8ada8;
        font-size: 10px;
    }

    body.mobile-shell-ready .sidebar .nav-label:first-child {
        margin-top: 0;
    }

    body.mobile-shell-ready .sidebar .nav-label--second {
        margin-top: 22px;
    }

    body.mobile-shell-ready .sidebar .nav-link {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        align-items: center;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 0 13px;
        border-radius: 11px;
        font-size: 14px;
        line-height: 1.25;
        white-space: normal;
    }

    body.mobile-shell-ready .sidebar .nav-link > span:last-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body.mobile-shell-ready .sidebar .nav-index {
        display: inline;
        color: #aeb4ae;
        font-size: 10px;
    }

    body.mobile-shell-ready .sidebar .nav-link::before {
        left: -18px;
        display: block;
    }

    body.mobile-shell-ready .sidebar .sidebar-footer {
        display: grid;
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        margin-top: auto;
        padding-top: 18px;
    }

    body.mobile-shell-ready .sidebar .sidebar-profile-link {
        min-height: 48px;
        padding: 5px 3px;
    }

    body.mobile-shell-ready .sidebar .icon-button {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .mobile-nav-backdrop {
        position: fixed;
        z-index: 900;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(5, 16, 36, .52);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 180ms ease, visibility 0s linear 180ms;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    body.mobile-shell-ready.mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 800;
        inset: auto 0 0;
        display: block;
        min-height: calc(var(--mobile-bottom-nav-height) + var(--mobile-safe-bottom));
        padding: 5px 8px var(--mobile-safe-bottom);
        border-top: 1px solid rgba(8, 43, 102, .12);
        background: rgba(251, 250, 247, .97);
        box-shadow: 0 -10px 30px rgba(8, 43, 102, .08);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
        backdrop-filter: blur(18px) saturate(150%);
    }

    .mobile-bottom-nav__inner {
        display: grid;
        grid-template-columns: repeat(var(--mobile-nav-count, 4), minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        max-width: 560px;
        min-height: 58px;
        margin: 0 auto;
        overflow: hidden;
    }

    .mobile-bottom-link,
    .mobile-bottom-more {
        position: relative;
        display: grid;
        grid-template-rows: 26px auto;
        place-items: center;
        align-content: center;
        gap: 2px;
        min-width: 0;
        min-height: 54px;
        padding: 3px 4px;
        border: 0;
        border-radius: 13px;
        color: #666963;
        background: transparent;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.1;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-link > span:last-child,
    .mobile-bottom-more > span:last-child {
        display: block;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-bottom-link svg,
    .mobile-bottom-more svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
    }

    .mobile-bottom-link.is-active {
        color: #082b66;
        background: #e8f3ff;
    }

    .mobile-bottom-link.is-active::before {
        position: absolute;
        top: 0;
        left: 50%;
        width: 24px;
        height: 2px;
        border-radius: 0 0 4px 4px;
        background: linear-gradient(90deg, #155dba, #55b8ff);
        content: "";
        transform: translateX(-50%);
    }

    .mobile-bottom-link:active,
    .mobile-bottom-more:active {
        background: #e8f3ff;
    }

    body.mobile-shell-ready .topbar {
        width: 100%;
        min-width: 0;
        min-height: 70px;
        padding: 10px 16px;
        gap: 10px;
        background: rgba(244, 243, 239, .92);
    }

    body.mobile-shell-ready .topbar .club-indicator {
        min-width: 0;
        max-width: 44vw;
        min-height: 44px;
        padding-block: 7px;
    }

    body.mobile-shell-ready .topbar .club-indicator > span:last-child,
    body.mobile-shell-ready .topbar .club-indicator strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.mobile-shell-ready .topbar-actions {
        min-width: 0;
        margin-left: auto;
    }

    body.mobile-shell-ready .topbar-actions .primary-action,
    body.mobile-shell-ready .topbar-actions .quiet-action {
        min-height: 44px;
    }

    body.mobile-shell-ready .content-canvas {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding-right: 16px;
        padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-safe-bottom) + 34px);
        padding-left: 16px;
        overflow-x: clip;
    }

    body.mobile-shell-ready img,
    body.mobile-shell-ready video,
    body.mobile-shell-ready canvas,
    body.mobile-shell-ready svg {
        max-width: 100%;
    }

    .mobile-menu-toggle:focus-visible,
    .mobile-profile-link:focus-visible,
    .mobile-app-brand:focus-visible,
    .mobile-drawer-close:focus-visible,
    .mobile-bottom-link:focus-visible,
    .mobile-bottom-more:focus-visible {
        outline: 3px solid #55b8ff;
        outline-offset: 2px;
    }
}

@media (max-width: 430px) {
    body.mobile-shell-ready .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    body.mobile-shell-ready .topbar .club-indicator {
        max-width: 100%;
    }

    body.mobile-shell-ready .topbar-actions {
        width: 100%;
        margin-left: 0;
    }

    body.mobile-shell-ready .topbar-actions > * {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (max-width: 350px) {
    .mobile-appbar {
        padding-inline: 4px;
    }

    .mobile-bottom-nav {
        padding-inline: 3px;
    }

    .mobile-bottom-link,
    .mobile-bottom-more {
        font-size: 9px;
    }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    body.mobile-shell-ready .sidebar,
    .mobile-nav-backdrop {
        transition: none;
    }
}

@media (max-width: 760px) and (forced-colors: active) {
    .mobile-appbar,
    .mobile-bottom-nav,
    body.mobile-shell-ready .sidebar {
        border: 1px solid CanvasText;
        background: Canvas;
        color: CanvasText;
    }

    .mobile-bottom-link.is-active,
    .mobile-menu-toggle:active,
    .mobile-profile-link:active,
    .mobile-bottom-link:active,
    .mobile-bottom-more:active {
        color: HighlightText;
        background: Highlight;
    }

    .mobile-nav-backdrop {
        background: rgba(0, 0, 0, .72);
    }
}
