/* Mobile app experience layer — desktop remains unchanged. */
.mobile-app-nav {
    display: none;
}

@media (max-width: 1023px) {
    :root {
        --web7-mobile-nav-height: 74px;
        --web7-mobile-nav-gap: 10px;
    }

    html {
        scroll-padding-top: calc(72px + env(safe-area-inset-top));
        scroll-padding-bottom: calc(98px + env(safe-area-inset-bottom));
        -webkit-text-size-adjust: 100%;
        overscroll-behavior-x: none;
    }

    body.web7-mobile-shell {
        min-height: 100svh;
        overflow-x: hidden;
        background:
            radial-gradient(circle at 50% -10%, rgba(109, 54, 242, .08), transparent 28%),
            var(--web7-bg);
        -webkit-tap-highlight-color: transparent;
    }

    .dark body.web7-mobile-shell {
        background:
            radial-gradient(circle at 50% -10%, rgba(116, 64, 245, .13), transparent 32%),
            var(--web7-bg);
    }

    body.web7-mobile-shell > header {
        top: 0;
        border-bottom-color: transparent !important;
        padding-top: env(safe-area-inset-top);
        background: rgba(247, 245, 255, .82) !important;
        box-shadow: 0 1px 0 rgba(80, 56, 130, .06);
        backdrop-filter: blur(24px) saturate(1.25);
        -webkit-backdrop-filter: blur(24px) saturate(1.25);
        transition: box-shadow .25s ease, background .25s ease;
    }

    .dark body.web7-mobile-shell > header {
        background: rgba(11, 0, 21, .8) !important;
        box-shadow: 0 1px 0 rgba(187, 156, 255, .06);
    }

    body.web7-mobile-shell > header.mobile-header-scrolled {
        box-shadow: 0 12px 36px rgba(57, 33, 100, .09), 0 1px 0 rgba(80, 56, 130, .08);
    }

    .dark body.web7-mobile-shell > header.mobile-header-scrolled {
        box-shadow: 0 14px 38px rgba(0, 0, 0, .2), 0 1px 0 rgba(187, 156, 255, .08);
    }

    body.web7-mobile-shell > header > div:first-child {
        height: 64px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.web7-mobile-shell > header > div:first-child > a img {
        height: 39px !important;
        width: auto !important;
    }

    body.web7-mobile-shell [data-mobile-menu-button],
    body.web7-mobile-shell [data-mobile-menu] {
        display: none !important;
    }

    body.web7-mobile-shell > header > div:first-child > div:last-child > a {
        display: none !important;
    }

    body.web7-mobile-shell .theme-switch-track {
        width: 58px !important;
        height: 34px !important;
        min-width: 58px !important;
        padding: 2px !important;
    }

    body.web7-mobile-shell .theme-switch-track::before {
        inset: 2px !important;
    }

    body.web7-mobile-shell .theme-switch-thumb {
        width: 28px !important;
        height: 28px !important;
        left: 2px !important;
        top: 2px !important;
    }

    .dark body.web7-mobile-shell .theme-switch-thumb {
        transform: translateX(26px) !important;
    }

    body.web7-mobile-shell .theme-switch-track > span:first-child {
        left: 7px !important;
        font-size: 10px !important;
    }

    body.web7-mobile-shell .theme-switch-track > span:nth-child(2) {
        right: 7px !important;
        font-size: 10px !important;
    }

    body.web7-mobile-shell > main {
        min-height: calc(100svh - 64px - env(safe-area-inset-top));
        isolation: isolate;
    }

    body.web7-mobile-shell > footer {
        margin-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    }

    body.web7-mobile-shell input,
    body.web7-mobile-shell textarea,
    body.web7-mobile-shell select {
        font-size: 16px !important;
    }

    body.web7-mobile-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body.web7-mobile-shell select {
        min-height: 48px;
    }

    body.web7-mobile-shell textarea {
        min-height: 132px;
    }

    body.web7-mobile-shell a,
    body.web7-mobile-shell button,
    body.web7-mobile-shell input,
    body.web7-mobile-shell select,
    body.web7-mobile-shell textarea {
        touch-action: manipulation;
    }

    .mobile-app-nav {
        position: fixed;
        z-index: 100;
        left: var(--web7-mobile-nav-gap);
        right: var(--web7-mobile-nav-gap);
        bottom: max(var(--web7-mobile-nav-gap), env(safe-area-inset-bottom));
        display: block;
        opacity: 1;
        transform: translate3d(0, 0, 0);
        transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1);
        will-change: transform;
    }

    .mobile-app-nav::before {
        content: "";
        position: absolute;
        inset: -18px -10px -14px;
        z-index: -1;
        pointer-events: none;
        background: radial-gradient(ellipse at center, rgba(94, 52, 190, .13), transparent 66%);
        filter: blur(12px);
    }

    .mobile-app-nav-surface {
        position: relative;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        align-items: center;
        min-height: var(--web7-mobile-nav-height);
        overflow: hidden;
        border: 1px solid rgba(91, 65, 138, .13);
        border-radius: 25px;
        padding: 5px;
        background: rgba(255, 255, 255, .9);
        box-shadow:
            0 18px 45px rgba(52, 30, 94, .16),
            inset 0 1px 0 rgba(255, 255, 255, .88);
        backdrop-filter: blur(26px) saturate(1.3);
        -webkit-backdrop-filter: blur(26px) saturate(1.3);
    }

    .mobile-app-nav-surface::after {
        content: "";
        position: absolute;
        top: 0;
        left: 14%;
        right: 14%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(126, 72, 244, .28), transparent);
        pointer-events: none;
    }

    .dark .mobile-app-nav-surface {
        border-color: rgba(188, 157, 255, .13);
        background: rgba(18, 5, 31, .9);
        box-shadow:
            0 20px 50px rgba(0, 0, 0, .38),
            inset 0 1px 0 rgba(255, 255, 255, .045);
    }

    .mobile-app-tab {
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 60px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        border-radius: 17px;
        color: #756b84;
        text-decoration: none !important;
        user-select: none;
        -webkit-user-select: none;
        transition: color .2s ease, background .2s ease, transform .15s ease;
    }

    .dark .mobile-app-tab {
        color: #9f91ae;
    }

    .mobile-app-tab::before {
        content: "";
        position: absolute;
        inset: 4px 3px;
        z-index: -1;
        border-radius: 14px;
        background: linear-gradient(145deg, rgba(49, 104, 255, .09), rgba(126, 58, 242, .1));
        opacity: 0;
        transform: scale(.88);
        transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
    }

    .dark .mobile-app-tab::before {
        background: linear-gradient(145deg, rgba(49, 104, 255, .12), rgba(126, 58, 242, .16));
    }

    .mobile-app-tab.is-active {
        color: #6b38ed;
    }

    .dark .mobile-app-tab.is-active {
        color: #cbb3ff;
    }

    .mobile-app-tab.is-active::before {
        opacity: 1;
        transform: scale(1);
    }

    .mobile-app-tab-icon {
        position: relative;
        display: grid;
        width: 25px;
        height: 25px;
        place-items: center;
        border-radius: 9px;
        transition: transform .25s cubic-bezier(.2, .8, .2, 1), color .2s ease;
    }

    .mobile-app-tab-icon svg {
        width: 20px;
        height: 20px;
    }

    .mobile-app-tab.is-active .mobile-app-tab-icon {
        color: white;
        background: linear-gradient(145deg, #3168ff, #7b3ef2 56%, #a84dff);
        box-shadow: 0 7px 16px rgba(109, 54, 242, .25);
        transform: translateY(-1px);
    }

    .mobile-app-tab-label {
        max-width: 100%;
        overflow: hidden;
        font-size: 8.8px;
        font-weight: 800;
        letter-spacing: -.02em;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-app-tab.is-active .mobile-app-tab-label {
        font-weight: 800;
    }

    .mobile-app-tab.is-pressed {
        transform: scale(.94);
    }

    body.mobile-keyboard-open .mobile-app-nav {
        pointer-events: none;
        opacity: 0;
        transform: translate3d(0, 120%, 0);
    }

    body.mobile-page-leaving > main {
        opacity: .94;
        transform: translateY(2px);
        transition: opacity .12s ease, transform .12s ease;
    }

    body.web7-mobile-shell [data-portfolio-filter] {
        min-height: 42px;
        white-space: nowrap;
    }

    body.web7-mobile-shell main section {
        scroll-margin-top: calc(76px + env(safe-area-inset-top));
    }
}

@media (max-width: 420px) {
    :root {
        --web7-mobile-nav-gap: 7px;
    }

    .mobile-app-nav-surface {
        border-radius: 22px;
        padding-left: 3px;
        padding-right: 3px;
    }

    .mobile-app-tab {
        border-radius: 14px;
        gap: 2px;
    }

    .mobile-app-tab-icon {
        width: 24px;
        height: 24px;
    }

    .mobile-app-tab-icon svg {
        width: 19px;
        height: 19px;
    }

    .mobile-app-tab-label {
        font-size: 8.1px;
    }
}

@media (min-width: 1024px) {
    .mobile-app-nav {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-app-nav,
    .mobile-app-tab,
    .mobile-app-tab::before,
    .mobile-app-tab-icon,
    body.mobile-page-leaving > main {
        transition: none !important;
    }
}