/**
 * Site-wide mobile optimizations (load after other stylesheets)
 */

html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
}

/* ── Tablet and below ── */
@media (max-width: 991.98px) {
    nav .navbar-brand img {
        width: auto !important;
        max-width: 11.5rem;
        height: auto;
    }

    nav {
        padding: 1rem 0 !important;
    }

    .navbar-collapse {
        max-height: min(72vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-nav {
        align-items: stretch !important;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
    }

    .navbar-nav .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.6rem 0.35rem;
    }

    .navbar-nav .nav-item .solid-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        box-sizing: border-box;
    }

    .navbar-nav .nav-item.dropdown {
        width: 100%;
    }

    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin-top: 0.25rem;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0.5rem 0.75rem;
    }

    .navbar-nav .dropdown-menu .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        white-space: normal;
    }

    .navbar-nav .dropdown-menu .dropdown-item > span {
        white-space: normal;
    }

    section.featured,
    section.featured-home {
        height: auto !important;
        min-height: 0 !important;
    }

    body.home-page .home-site-header .featured-home {
        min-height: auto !important;
        padding: 1.75rem 0 2.75rem !important;
    }

    .company-hero {
        margin-left: clamp(0.5rem, 2vw, 1rem);
        margin-right: clamp(0.5rem, 2vw, 1rem);
    }

    .industry-challenge-title {
        font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    }

    .industry-challenge-band {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .home-industries-grid,
    .home-services-grid {
        max-width: 100%;
    }

    .site-footer-brand {
        max-width: 100%;
    }

    .site-footer-brand p {
        max-width: none;
    }

    .trial-form-container {
        padding: 1.5rem 1.15rem;
    }

    .faq-layout {
        grid-template-columns: 1fr;
    }

    .process-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Phone ── */
@media (max-width: 575.98px) {
    .container-lg {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .pad-tb {
        padding-top: 2.75rem;
        padding-bottom: 2.75rem;
    }

    .pad-t {
        padding-top: 2.75rem;
    }

    .pad-b {
        padding-bottom: 2.75rem;
    }

    .section-heading {
        font-size: clamp(1.45rem, 5.2vw, 1.85rem);
        line-height: 1.2;
    }

    .solid-btn,
    .outline-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    section.featured,
    section.featured-home {
        padding: 2rem 0 !important;
        border-radius: 1.25rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    section.featured-home h1,
    section.featured h1 {
        font-size: clamp(1.75rem, 7vw, 2.15rem) !important;
        line-height: 1.15 !important;
    }

    body.home-page .featured-home .hero-title,
    body.home-page .featured-home .hero-lead {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    section.featured-home p,
    section.featured p {
        font-size: 1rem !important;
        line-height: 1.55 !important;
    }

    .company-hero {
        padding: 2rem 1rem !important;
        border-radius: 1.25rem;
    }

    .company-hero h1 {
        font-size: clamp(1.55rem, 6vw, 2rem);
    }

    .company-hero p {
        font-size: 1rem;
    }

    section.industry-hero h1 {
        font-size: clamp(1.6rem, 6.5vw, 2rem);
    }

    .industry-hero-tagline {
        font-size: 0.95rem;
    }

    .hero-cta-row,
    .industry-hero-actions,
    .process-cta-actions,
    .home-cta-section .hero-cta-row {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    body.home-page .featured-home .hero-cta-row {
        align-items: center !important;
        justify-content: center !important;
    }

    body.home-page .featured-home .hero-cta-demo {
        width: auto !important;
        max-width: 280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero-cta-row .solid-btn,
    .hero-cta-row .outline-btn,
    .industry-hero-actions .solid-btn,
    .industry-hero-actions .outline-btn,
    .process-cta-actions .solid-btn,
    .process-cta-actions .outline-btn {
        width: 100%;
        max-width: none;
    }

    .home-why-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }

    .home-why-tab {
        font-size: 0.65rem;
        padding: 0.65rem 0.35rem;
        min-height: 44px;
    }

    .home-why-stage {
        min-height: 0;
        padding: 1.25rem 1rem 1.5rem;
    }

    .home-why-stat-value {
        font-size: clamp(2.25rem, 11vw, 3rem);
    }

    .home-why-compare-before,
    .home-why-compare-after {
        font-size: 0.68rem;
        padding: 0 0.45rem;
        height: 1.85rem;
        min-width: 0;
    }

    .home-why-compare-legend {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    body.home-page .pricing .price-card {
        padding: 1.5rem 1.2rem 1.4rem;
    }

    body.home-page .pricing .price-card:hover {
        transform: none;
    }

    .pricing-billing-toggle {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .pricing-cards-row > [class*="col-"] {
        margin-bottom: 0.75rem;
    }

    .industry-challenge-stat-value {
        font-size: clamp(2rem, 11vw, 3.25rem);
    }

    .industry-challenge-line {
        font-size: 0.95rem;
    }

    .industry-challenge-band {
        padding: 1.35rem 0.85rem 1.15rem;
    }

    .industry-challenge-tab {
        min-height: 44px;
    }

    .industry-team-card {
        padding: 1.25rem 1.1rem;
    }

    .home-docintel-panel,
    .example-questions-panel {
        border-radius: 1rem;
    }

    .home-docintel .example-questions-picker,
    .home-docintel .example-questions-demo {
        padding: 1rem 0.85rem;
    }

    .example-questions-demo .chat-body {
        min-height: 220px;
        max-height: 280px;
    }

    body.home-page .logo-marquee-logo {
        height: 52px;
        max-width: 180px;
    }

    body.home-page .logo-marquee-set {
        gap: 1.5rem;
        padding-right: 1.5rem;
    }

    .trial-form-container {
        padding: 1.15rem 0.85rem;
        border-radius: 8px;
    }

    .trial-form h2 {
        font-size: 1.15rem;
    }

    .company-form {
        padding: 1.35rem 1rem;
        border-radius: 1rem;
    }

    .legal-prose h2 {
        font-size: 1.1rem;
    }

    .legal-prose p,
    .legal-prose li {
        font-size: 0.95rem;
    }

    .process-tabs {
        grid-template-columns: 1fr 1fr;
    }

    .process-tab-label {
        font-size: 0.6rem;
    }

    .video-modal-content {
        width: calc(100% - 1.5rem);
        max-width: 100%;
    }

    .video-modal-close {
        position: fixed !important;
        top: 12px !important;
        right: 12px !important;
        left: auto !important;
        float: none !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
        line-height: 40px !important;
        text-align: center;
        background: rgba(0, 0, 0, 0.75) !important;
        border-radius: 50%;
    }

    .site-footer {
        padding: 2.25rem 0 1.5rem;
    }

    .site-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .site-footer-member img {
        max-width: 11rem;
    }

    .form-check-label {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Coarse pointer: reduce hover motion */
@media (hover: none) and (pointer: coarse) {
    .price-card:hover,
    .home-docintel .example-q-chip:hover {
        transform: none;
    }
}
