/* ============================================
   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 (.dim-ecc4) is a descendant of
   .top-3ebd (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.article_09fa {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shadow_dynamic_859b" 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.nav-1206 so it can't cause
   horizontal overflow anyway. */
.aside-static-a3ad,
.block_2c7c,
.light-b05f,
.thumbnail_6b50,
.warm_aca0,
.orange-12f1,
.wrapper-white-6019,
.nav-fast-a40e,
.sort-63f9,
.shadow_prev_4bde,
.section_5482 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .nav_solid_515b {
    padding: 8px 0;
  }
  
  .sort-smooth-cf94 img {
    height: 28px;
    width: auto;
  }
  
  .status-center-d008 {
    display: none !important;
  }
  
  .east-14a9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .east-14a9 svg {
    width: 14px;
    height: 14px;
  }
  
  .sort-1a67 {
    padding: 6px;
  }
  
  .accordion-green-c8c6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .light-b05f,
  .block_2c7c,
  .thumbnail_6b50,
  .warm_aca0,
  .panel_wide_f54a,
  .tabs_aad0,
  .chip-mini-a805,
  .tall-d795,
  .rough-0d7e,
  .light_650b,
  .red-b067,
  .wrapper_dd8e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sort_7ea8,
  .footer-pressed-b383 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .inner-a99b,
  .left-0068,
  .east-2ae2,
  .module_10fa,
  .small-9adc,
  .purple_059e,
  .new-d5cd {
    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 */
  .dark-41d5,
  .video-solid-9a89,
  .focused-d08d,
  .sort-basic-9a21,
  .thumbnail_77fa {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .section-last-1af1,
  .icon_b386,
  .overlay_5fe7,
  .chip-3737 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .rough_490f,
  .element_976f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .thumbnail-352c,
  .popup-da72,
  .link-gas-20f1,
  .highlight-8375 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .steel-7ce0,
  .text-85fd,
  .title-7539,
  .preview_3dfb,
  .rough-0642,
  .info_e1fb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dark-41d5,
  .video-solid-9a89,
  .sort-basic-9a21 {
    max-width: none !important;
  }
  
  .shadow_dynamic_859b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .section-last-1af1 {
    font-size: 1.5rem !important;
  }
  
  .icon_b386 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .input_3284,
  .green-bbb7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay_5fe7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bronze-9e8b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tiny_368f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dark-41d5,
  .sort-basic-9a21 {
    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: 4fc5 */
.widget-item-q1 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.0;
}
