/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.disabled-south-0ffa) is a descendant of
   .pink-b35c (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.main_f743 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tabs_wide_b048" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.tag_pro_34da so it can't cause
   horizontal overflow anyway. */
.sidebar-c00c,
.overlay-white-1149,
.focus_9c12,
.nav-1079,
.secondary_easy_7c86,
.content-gas-09c8,
.description-050d,
.feature-045a,
.tiny_2e9a,
.south_fb66,
.pattern_3155 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .progress-3ba1 {
    padding: 8px 0;
  }
  
  .warm-68fe img {
    height: 28px;
    width: auto;
  }
  
  .preview-8bc6 {
    display: none !important;
  }
  
  .mask-91f7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mask-91f7 svg {
    width: 14px;
    height: 14px;
  }
  
  .middle_6ace {
    padding: 6px;
  }
  
  .texture_fd1e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .focus_9c12,
  .overlay-white-1149,
  .nav-1079,
  .secondary_easy_7c86,
  .hero_4958,
  .sort_6f92,
  .label_rough_3143,
  .footer-pink-1d7c,
  .slider_left_d6a7,
  .stale_11fc,
  .progress-upper-4e44,
  .component-tiny-8eb8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .upper_bc98,
  .dark_dec1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .motion-79e2,
  .current-8994,
  .rough-a0eb,
  .pro-c3a3,
  .next_f824,
  .shadow_plasma_b020,
  .pink-4719 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .mask-huge-a3a8,
  .feature-04a6,
  .rough-6b37,
  .highlight_1363,
  .sidebar_e936 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .video_south_ba0c,
  .sidebar_pro_3951,
  .static_3ba6,
  .down_a481 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element_d203,
  .wrapper_short_b975 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .mask_lite_c10e,
  .active-752d,
  .element-3858,
  .accordion-7443 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .message_6df1,
  .preview-d24f,
  .hovered-c1e0,
  .alert-slow-0cd2,
  .full-db38,
  .alert-motion-349d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .mask-huge-a3a8,
  .feature-04a6,
  .highlight_1363 {
    max-width: none !important;
  }
  
  .tabs_wide_b048 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .video_south_ba0c {
    font-size: 1.5rem !important;
  }
  
  .sidebar_pro_3951 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .warm_a3a9,
  .info_69ac {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .static_3ba6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .advanced-f50d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .box_north_bf6b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .mask-huge-a3a8,
  .highlight_1363 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: 4816 */
.phantom-card-p3 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.1;
}
