/* ============================================
   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 (.large_6537) is a descendant of
   .footer-8e5a (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.old-e861 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".primary_9f55" 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.info_right_8993 so it can't cause
   horizontal overflow anyway. */
.under-fa91,
.iron_0eb6,
.rough_f18d,
.title_e5bc,
.hover_3758,
.element-prev-5f6f,
.fluid_4a82,
.secondary_short_11a3,
.hover_in_e6e6,
.primary-5876,
.caption-clean-65c7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .lower_f247 {
    padding: 8px 0;
  }
  
  .search_dynamic_7ebc img {
    height: 28px;
    width: auto;
  }
  
  .text_dim_ab55 {
    display: none !important;
  }
  
  .pro-dac5 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pro-dac5 svg {
    width: 14px;
    height: 14px;
  }
  
  .out_6ffe {
    padding: 6px;
  }
  
  .active_80b5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .rough_f18d,
  .iron_0eb6,
  .title_e5bc,
  .hover_3758,
  .footer-5765,
  .under-d1f9,
  .easy-72bb,
  .popup_hard_9998,
  .progress_47d0,
  .gas-c5d1,
  .main-stale-aa35,
  .dim-fb01 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .breadcrumb-30eb,
  .motion-fc2c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tall_459c,
  .copper_6540,
  .medium_5bd1,
  .short-6d6a,
  .link_8961,
  .clean-d13d,
  .thick_ec5b {
    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 */
  .dropdown-b296,
  .footer_a2cc,
  .backdrop_bb5d,
  .fresh_6435,
  .dark_e90d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .up-cc53,
  .iron-e9a9,
  .progress_6088,
  .sidebar-mini-686f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .layout-474f,
  .up-ba0c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .narrow_a9dc,
  .thick_ccdb,
  .list-north-341c,
  .iron_0184 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .right-d6db,
  .item-25c8,
  .fresh-0e14,
  .dark_cd10,
  .texture_fe3e,
  .element_fixed_ca8e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dropdown-b296,
  .footer_a2cc,
  .fresh_6435 {
    max-width: none !important;
  }
  
  .primary_9f55 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .up-cc53 {
    font-size: 1.5rem !important;
  }
  
  .iron-e9a9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .filter-soft-016c,
  .column-50bb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .progress_6088 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .orange_c335 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .panel-1871 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dropdown-b296,
  .fresh_6435 {
    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: 69c6 */
.widget-item-q6 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.1;
}
