/* Mobile hardening for SwrlSite account entry and client portal.
   Keep these rules scoped so the public marketing site is unaffected. */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
}
.auth-page .site-header {
    position: static;
    padding-inline: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}
.auth-page #main {
    min-width: 0;
}
.auth-page #main input[type="email"],
.auth-page #main input[type="text"],
.auth-page #main input[type="password"] {
    min-height: 50px;
    font-size: 16px;
}
.auth-page #main input[name="code"] {
    letter-spacing: .055em;
    font-family: Inter, Arial, sans-serif;
    font-weight: 700;
}
.auth-page #main button[type="submit"],
.auth-page #main a[href*="google"],
.auth-page #main a[href*="/code/"] {
    min-height: 50px;
    touch-action: manipulation;
}
.auth-page .auth-assent {
    padding-inline: 12px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.dash-app {
    min-width: 0;
    overflow-x: clip;
}
.dash-app .dash-shell,
.dash-app .dash-main,
.dash-app .dash-section,
.dash-app .dash-item-main,
.dash-app .dash-project,
.dash-app .studio-page {
    min-width: 0;
}
.dash-app .dash-item-main,
.dash-app .dash-project,
.dash-app .dash-section {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .dash-app .dash-shell {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }
    .dash-app .dash-sidebar:not(.dash-sidebar--founder) {
        height: auto;
        min-height: 72px;
    }
    .dash-app .dash-sidebar:not(.dash-sidebar--founder) .dash-side-nav {
        align-items: stretch;
    }
    .dash-app .dash-sidebar:not(.dash-sidebar--founder) .dash-side-link {
        min-height: 58px;
        touch-action: manipulation;
    }
    .dash-app .dash-main {
        padding-bottom: 32px;
    }
    .dash-app .portal-subnav {
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 720px) {
    .dash-app .dash-topbar {
        min-height: 60px;
        padding-block: 8px;
    }
    .dash-app .dash-nav {
        top: 100%;
        z-index: 80;
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
        padding: 16px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
        border-top: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
        overscroll-behavior: contain;
    }
    .dash-app .dash-nav-user {
        width: 100%;
    }
    .dash-app .dash-nav-user > a:not(.dash-bell) {
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 9px 11px;
        border-radius: 8px;
        touch-action: manipulation;
    }
    .dash-app .dash-nav-user > a:not(.dash-bell):focus-visible,
    .dash-app .dash-nav-user > a:not(.dash-bell):hover {
        background: rgba(255, 255, 255, .1);
    }
    .dash-app .dash-nav-user .dash-logout {
        justify-content: center;
    }
}

@media (max-width: 620px) {
    .auth-page .site-header {
        padding-block: 10px;
    }
    .auth-page .brand-logo {
        width: 36px;
        height: 36px;
    }
    .auth-page #main {
        width: min(100% - 20px, 444px);
        margin: 16px auto 18px;
        padding: 24px 18px;
        border-radius: 18px;
    }
    .auth-page #main h1 {
        font-size: clamp(1.7rem, 8vw, 2rem);
        line-height: 1.05;
    }
    .auth-page #main > p {
        line-height: 1.45;
    }

    .dash-app .dash-topbar {
        gap: 10px;
        padding-inline: 12px;
    }
    .dash-app .dash-topbar .brand-logo {
        width: 30px;
        height: 30px;
    }
    .dash-app .dash-brand {
        min-width: 0;
        gap: 7px;
        font-size: .96rem;
    }
    .dash-app .dash-portal-tag {
        display: none;
    }
    .dash-app .dash-nav-toggle-label {
        flex: none;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        padding: 9px;
        touch-action: manipulation;
    }
    .dash-app .dash-main {
        padding: 20px 12px 28px;
    }
    .dash-app .dash-head {
        margin-bottom: 18px;
    }
    .dash-app .dash-head h1 {
        font-size: clamp(1.7rem, 9vw, 2.15rem);
    }
    .dash-app .dash-section {
        padding: 18px 16px;
    }
    .dash-app .dash-item {
        align-items: flex-start;
    }
    .dash-app .dash-item-actions {
        width: 100%;
        align-items: stretch;
    }
    .dash-app .dash-item-actions > .button,
    .dash-app .dash-item-actions > .pricing-card-link,
    .dash-app .dash-item-actions > a {
        flex: 1 1 140px;
        min-height: 44px;
        justify-content: center;
        display: inline-flex;
        align-items: center;
        text-align: center;
        touch-action: manipulation;
    }
    .dash-app .dash-project-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .dash-app .dash-project-head .button {
        width: 100%;
        justify-content: center;
    }
    .dash-app .dash-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .dash-app .dash-actions > .button,
    .dash-app .dash-actions > .pricing-card-link {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        text-align: center;
    }
    .dash-app .portal-subnav a {
        min-height: 44px;
    }
}

@media (max-width: 370px) {
    .dash-app .dash-sidebar:not(.dash-sidebar--founder) .dash-side-link {
        font-size: .59rem;
    }
    .dash-app .dash-sidebar:not(.dash-sidebar--founder) .dash-side-ico {
        width: 19px;
        height: 19px;
    }
}
