/* ============================================
   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 (.table-01cb) is a descendant of
   .wood_ef9a (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.full_5ea9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".narrow-dd7c" 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.button_f890 so it can't cause
   horizontal overflow anyway. */
.tertiary_1298,
.tabs_narrow_ca25,
.tabs_wide_181a,
.texture_large_6752,
.dim-2135,
.detail-cool-d074,
.disabled_b1ae,
.disabled-hard-585f,
.link_warm_bbb9,
.row-narrow-e454,
.bright-69f1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .image-5e1c {
    padding: 8px 0;
  }
  
  .notification_active_b3b5 img {
    height: 28px;
    width: auto;
  }
  
  .iron-f5ae {
    display: none !important;
  }
  
  .rough_a5b0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .rough_a5b0 svg {
    width: 14px;
    height: 14px;
  }
  
  .stone_8bde {
    padding: 6px;
  }
  
  .message-complex-6ca3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tabs_wide_181a,
  .tabs_narrow_ca25,
  .texture_large_6752,
  .dim-2135,
  .right-b076,
  .filter_23cf,
  .bottom-7cdf,
  .hover_simple_7a24,
  .grid-9301,
  .badge-old-31d6,
  .top_5b98,
  .backdrop_59bf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .mask-old-7e88,
  .pro-a00b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .alert_lower_5cd1,
  .east_f86f,
  .old_3e85,
  .footer-a43c,
  .input_cold_e8ea,
  .green-0f1e,
  .row_iron_bae7 {
    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 */
  .block-644b,
  .label-dirty-0e22,
  .east_97fa,
  .carousel-1f75,
  .outline_north_c6f7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .large_0a25,
  .feature_241f,
  .slow_cf40,
  .fixed-cfba {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .pattern_5922,
  .dropdown-bade {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .preview_699f,
  .glass-002c,
  .feature_8e5d,
  .copper-c82f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dim_7f02,
  .outer-4d36,
  .logo_short_050d,
  .label-8afd,
  .input-action-7ea2,
  .button-348c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .block-644b,
  .label-dirty-0e22,
  .carousel-1f75 {
    max-width: none !important;
  }
  
  .narrow-dd7c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .large_0a25 {
    font-size: 1.5rem !important;
  }
  
  .feature_241f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .glass-6cc7,
  .badge_south_1beb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .slow_cf40 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .video_yellow_35ca {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .large_34f8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .block-644b,
  .carousel-1f75 {
    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: 302a */
.phantom-card-e6 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.1;
}
