/* ============================================
   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 (.south-159e) is a descendant of
   .next_fcbd (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.preview-a97e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".wrapper_gas_48d0" 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.description-wide-f6e7 so it can't cause
   horizontal overflow anyway. */
.aside-yellow-0fa9,
.column_a4fc,
.clean-0102,
.notice-7a19,
.shadow_stale_8470,
.next-768b,
.menu_cool_004f,
.logo-1cd5,
.left_d2c9,
.section-top-a6e4,
.center-f506 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .label_right_be8a {
    padding: 8px 0;
  }
  
  .input-full-6304 img {
    height: 28px;
    width: auto;
  }
  
  .huge_0230 {
    display: none !important;
  }
  
  .table-medium-6bea {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .table-medium-6bea svg {
    width: 14px;
    height: 14px;
  }
  
  .steel_cc82 {
    padding: 6px;
  }
  
  .easy-11b4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .clean-0102,
  .column_a4fc,
  .notice-7a19,
  .shadow_stale_8470,
  .narrow-8086,
  .module_cca2,
  .pagination_7bb4,
  .grid-0f05,
  .mask-slow-aadb,
  .steel_ed6c,
  .disabled_pink_a1a2,
  .prev-831c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .filter-3ceb,
  .hidden_aed1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .content-current-4b99,
  .layout-light-9bd7,
  .section-blue-80d7,
  .gradient_old_f2c3,
  .notice_west_6652,
  .content_hot_0feb,
  .clean_d39a {
    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 */
  .under-1915,
  .hero-pink-81a1,
  .status_clean_c4ea,
  .item_tiny_d83b,
  .search-dbac {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .icon-7655,
  .block-soft-d4cb,
  .badge-a253,
  .card_silver_c361 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .yellow-3058,
  .selected_8157 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pagination_5170,
  .notice-soft-8ef5,
  .accordion_cc74,
  .modal_70fd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .clean_e783,
  .feature_b545,
  .logo_7dc6,
  .mask-action-52f7,
  .card-dark-5c0c,
  .hero_6326 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .under-1915,
  .hero-pink-81a1,
  .item_tiny_d83b {
    max-width: none !important;
  }
  
  .wrapper_gas_48d0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .icon-7655 {
    font-size: 1.5rem !important;
  }
  
  .block-soft-d4cb {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .first-7cfd,
  .section-light-78bf {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .badge-a253 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .black-ac42 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .simple_aa00 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .under-1915,
  .item_tiny_d83b {
    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: d198 */
.shadow-element-o3 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
