/* ============================================
   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 (.lower-4168) is a descendant of
   .article-8c81 (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.sidebar_040d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notification_paper_68e1" 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.notice-brown-5de9 so it can't cause
   horizontal overflow anyway. */
.column_red_9e7f,
.dropdown_df48,
.next-9338,
.cool_32b8,
.steel_8b26,
.large-3f9b,
.main_fresh_2fa2,
.stone_b4ac,
.last_186c,
.article_next_0260,
.west-5e3e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .banner-13a1 {
    padding: 8px 0;
  }
  
  .gallery_e57c img {
    height: 28px;
    width: auto;
  }
  
  .icon_orange_c335 {
    display: none !important;
  }
  
  .complex-95ba {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .complex-95ba svg {
    width: 14px;
    height: 14px;
  }
  
  .feature-d0e4 {
    padding: 6px;
  }
  
  .disabled_bcb9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .next-9338,
  .dropdown_df48,
  .cool_32b8,
  .steel_8b26,
  .new-22a2,
  .up-a569,
  .progress_2085,
  .in-be66,
  .filter_0236,
  .pattern_active_001b,
  .video-hovered-ded8,
  .detail_ccf6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pink_c581,
  .inner_c99a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .first-7ebf,
  .element-smooth-d4ed,
  .next-0d1b,
  .complex-a14c,
  .title-d878,
  .texture_paper_e2eb,
  .static_e28a {
    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 */
  .hot-4c4a,
  .slow-a277,
  .box_e0b3,
  .yellow-10b2,
  .gas-deb8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pagination_prev_3b57,
  .surface-soft-af8e,
  .focused_fa3f,
  .component-00ba {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .selected-33f1,
  .surface_wide_ff6d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .iron-f763,
  .highlight_orange_9747,
  .preview_32f8,
  .right_41c1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .menu-hard-7c07,
  .block-d0e5,
  .heading_ee33,
  .footer-green-450d,
  .hero-south-45c5,
  .out-71d2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hot-4c4a,
  .slow-a277,
  .yellow-10b2 {
    max-width: none !important;
  }
  
  .notification_paper_68e1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pagination_prev_3b57 {
    font-size: 1.5rem !important;
  }
  
  .surface-soft-af8e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .stale-b032,
  .pattern_f696 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .focused_fa3f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .cold-1812 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .video_silver_965e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hot-4c4a,
  .yellow-10b2 {
    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: 4e70 */
.ghost-box-p0 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
