/* v531U — Mobile phase 1 core-public-page polish.
   Scope: mobile/tablet only. Desktop layout is intentionally untouched. */

@media (max-width: 980px){
  html,body{max-width:100%;overflow-x:hidden;}
  body:not([class*="admin"]) .topbar .container.nav,
  body:not([class*="admin"]) .topbar .nav{
    min-height:64px !important;
    padding-top:10px !important;
    padding-bottom:10px !important;
    align-items:center !important;
    gap:10px !important;
  }
  body:not([class*="admin"]) .topbar .brand,
  body:not([class*="admin"]) .topbar .brand-logo{
    min-width:0 !important;
    max-width:66vw !important;
    overflow:hidden !important;
  }
  body:not([class*="admin"]) .topbar .brand-logo img,
  body:not([class*="admin"]) .topbar img.logo-dark{
    display:block !important;
    width:auto !important;
    max-width:min(220px,62vw) !important;
    max-height:42px !important;
    object-fit:contain !important;
    object-position:left center !important;
  }
  body:not([class*="admin"]) .topbar .mobile-only,
  body:not([class*="admin"]) .topbar .btn.mobile-only{
    width:auto !important;
    min-width:auto !important;
    flex:0 0 auto !important;
    padding:9px 13px !important;
    min-height:40px !important;
    font-size:13px !important;
    white-space:nowrap !important;
    border-radius:999px !important;
  }

  body:not([class*="admin"]) .page-hero,
  body:not([class*="admin"]) .hero,
  body:not([class*="admin"]) .section{
    padding-top:34px !important;
    padding-bottom:34px !important;
  }
  body:not([class*="admin"]) .page-hero h1,
  body:not([class*="admin"]) .hero h1,
  body:not([class*="admin"]) .home-hero-headline,
  body:not([class*="admin"]) .guide-hero h1,
  body:not([class*="admin"]) .airport-fast-track-copy-v528U h1{
    font-size:clamp(31px,8.4vw,42px) !important;
    line-height:1.06 !important;
    letter-spacing:-.04em !important;
    overflow-wrap:break-word !important;
  }
  body:not([class*="admin"]) .section h2,
  body:not([class*="admin"]) .guide-article-content h2{
    font-size:clamp(25px,6.2vw,32px) !important;
    line-height:1.14 !important;
  }
  body:not([class*="admin"]) .hero p,
  body:not([class*="admin"]) .page-hero p,
  body:not([class*="admin"]) .section-lead,
  body:not([class*="admin"]) .muted{
    font-size:15.5px !important;
    line-height:1.6 !important;
  }

  /* All public multi-column panels collapse cleanly before they can overflow. */
  body:not([class*="admin"]) .home-conversion-hero-grid,
  body:not([class*="admin"]) .home-conversion-hero-grid-v295G,
  body:not([class*="admin"]) .home-hero-side-stack-v295G,
  body:not([class*="admin"]) .fees-hero-grid,
  body:not([class*="admin"]) .landing-grid,
  body:not([class*="admin"]) .payment-grid,
  body:not([class*="admin"]) .status-help-grid,
  body:not([class*="admin"]) .contact-trust-section .grid,
  body:not([class*="admin"]) .guide-hero-grid,
  body:not([class*="admin"]) .guide-two-col-v508G,
  body:not([class*="admin"]) .guide-inline-image-grid-v508G,
  body:not([class*="admin"]) .guide-scenario-grid,
  body:not([class*="admin"]) .guide-decision-grid,
  body:not([class*="admin"]) .guide-path-grid,
  body:not([class*="admin"]) .arrival-practical-grid-v512G,
  body:not([class*="admin"]) .arrival-image-row-v512G,
  body:not([class*="admin"]) .exemption-status-grid-v510G,
  body:not([class*="admin"]) .exemption-faq-grid-v510G,
  body:not([class*="admin"]) .fast-track-guide-grid-v512G,
  body:not([class*="admin"]) .airport-fast-track-hero-grid-v528U,
  body:not([class*="admin"]) .airport-fast-track-benefits-v528U{
    grid-template-columns:1fr !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  body:not([class*="admin"]) .card,
  body:not([class*="admin"]) .step,
  body:not([class*="admin"]) .trust-card,
  body:not([class*="admin"]) .info-block,
  body:not([class*="admin"]) .ads-conversion-box,
  body:not([class*="admin"]) .guide-visual-card,
  body:not([class*="admin"]) .guide-confidence-panel-v515G,
  body:not([class*="admin"]) .source-policy-panel-v529U,
  body:not([class*="admin"]) .airport-fast-track-request-card-v528U{
    border-radius:18px !important;
    padding:16px !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-wrap:break-word !important;
  }

  /* Landing sticky bars caused the same mobile overlap pattern as the Airport Fast Track page.
     Keep the CTA, but make it part of the normal content flow on phones/tablets. */
  body:not([class*="admin"]) .ads-sticky-cta{
    position:static !important;
    inset:auto !important;
    margin:18px 14px 24px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
  }
  body:not([class*="admin"]) .ads-sticky-cta .container{
    width:100% !important;
    max-width:100% !important;
    padding:16px !important;
    border:1px solid rgba(219,231,245,.95) !important;
    border-radius:20px !important;
    background:#fff !important;
    box-shadow:0 14px 32px rgba(15,23,42,.08) !important;
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
  }
  body:not([class*="admin"]) .ads-sticky-cta .hero-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
    width:100% !important;
  }
  body:not([class*="admin"]) .ads-sticky-cta .hero-actions .btn{
    width:100% !important;
    min-height:44px !important;
    padding:10px 12px !important;
    white-space:normal !important;
  }

  /* Tables become touch-scroll areas instead of pushing the page wider. */
  body:not([class*="admin"]) .urgent-table-wrap,
  body:not([class*="admin"]) .guide-table-wrap,
  body:not([class*="admin"]) .exemption-table-wrap-v510G,
  body:not([class*="admin"]) .arrival-comparison-table-v512G,
  body:not([class*="admin"]) .fees-table,
  body:not([class*="admin"]) .urgent-table{
    max-width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }
  body:not([class*="admin"]) table{
    max-width:100% !important;
  }

  /* Forms and status rows: prevent side-by-side fields from squeezing on phones. */
  body:not([class*="admin"]) .status-input-row,
  body:not([class*="admin"]) .visa-checker-form,
  body:not([class*="admin"]) .compact-fee-fields,
  body:not([class*="admin"]) .travel-grid,
  body:not([class*="admin"]) .visa-step-grid,
  body:not([class*="admin"]) .fast-track-grid-v499G,
  body:not([class*="admin"]) .pickup-grid,
  body:not([class*="admin"]) .inline-payment-grid{
    grid-template-columns:1fr !important;
    display:grid !important;
    gap:12px !important;
  }
  body:not([class*="admin"]) .status-input-row .btn,
  body:not([class*="admin"]) .visa-checker-form .btn,
  body:not([class*="admin"]) .compact-fee-fields .btn{
    width:100% !important;
  }

  /* FAQ/category chips and long links wrap instead of clipping. */
  body:not([class*="admin"]) .faq-category-nav,
  body:not([class*="admin"]) .guide-cta-links-v513G,
  body:not([class*="admin"]) .guide-related-links,
  body:not([class*="admin"]) .source-policy-meta-v529U{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:8px !important;
    overflow:visible !important;
  }
  body:not([class*="admin"]) .faq-category-nav a,
  body:not([class*="admin"]) .guide-cta-links-v513G a,
  body:not([class*="admin"]) .guide-related-links a,
  body:not([class*="admin"]) .source-policy-meta-v529U span{
    max-width:100% !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }
}

@media (max-width: 640px){
  body:not([class*="admin"]) .container{
    padding-left:14px !important;
    padding-right:14px !important;
  }
  body:not([class*="admin"]) .topbar .container.nav,
  body:not([class*="admin"]) .topbar .nav{
    padding-left:14px !important;
    padding-right:14px !important;
  }
  body:not([class*="admin"]) .topbar .brand-logo img,
  body:not([class*="admin"]) .topbar img.logo-dark{
    max-width:min(188px,58vw) !important;
    max-height:38px !important;
  }
  body:not([class*="admin"]) .topbar .btn.mobile-only{
    padding:8px 11px !important;
    font-size:12.5px !important;
  }
  body:not([class*="admin"]) .page-hero,
  body:not([class*="admin"]) .hero,
  body:not([class*="admin"]) .section{
    padding-top:28px !important;
    padding-bottom:30px !important;
  }
  body:not([class*="admin"]) .hero-actions,
  body:not([class*="admin"]) .home-cta-actions,
  body:not([class*="admin"]) .guide-confidence-actions-v515G,
  body:not([class*="admin"]) .airport-fast-track-actions-v528U{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    width:100% !important;
  }
  body:not([class*="admin"]) .hero-actions .btn,
  body:not([class*="admin"]) .home-cta-actions .btn,
  body:not([class*="admin"]) .guide-confidence-actions-v515G .btn,
  body:not([class*="admin"]) .airport-fast-track-actions-v528U .btn{
    width:100% !important;
    min-height:46px !important;
  }
  body:not([class*="admin"]) .ads-sticky-cta .hero-actions{
    grid-template-columns:1fr !important;
  }
  body.home-page .home-hero-side-stack-v295G,
  body.home-page .home-hero-side-stack-v289G{
    margin-top:14px !important;
  }
  body.home-page .hero-plane-stage-v295G,
  body.home-page .hero-plane-stage-left-v407G{
    max-height:230px !important;
    overflow:hidden !important;
  }
  body:not([class*="admin"]) .footer{
    padding-bottom:calc(118px + env(safe-area-inset-bottom,0px)) !important;
  }
  body:not([class*="admin"]) .footer-grid,
  body:not([class*="admin"]) .footer-grid-3{
    gap:18px !important;
  }
}

@media (max-width: 420px){
  body:not([class*="admin"]) .topbar .brand-logo img,
  body:not([class*="admin"]) .topbar img.logo-dark{
    max-width:min(168px,54vw) !important;
  }
  body:not([class*="admin"]) .topbar .btn.mobile-only{
    padding:8px 10px !important;
  }
  body:not([class*="admin"]) .card,
  body:not([class*="admin"]) .step,
  body:not([class*="admin"]) .trust-card,
  body:not([class*="admin"]) .info-block,
  body:not([class*="admin"]) .ads-conversion-box,
  body:not([class*="admin"]) .guide-visual-card,
  body:not([class*="admin"]) .source-policy-panel-v529U{
    padding:14px !important;
    border-radius:16px !important;
  }
}
