/* ============================================
   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 (.pressed_cb5f) is a descendant of
   .logo_hot_2f79 (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.title-plasma-ed29 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".accent_833c" 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-inner-2678 so it can't cause
   horizontal overflow anyway. */
.header-bottom-dd06,
.overlay-4e93,
.detail_fluid_23e8,
.article_7714,
.pagination_64dd,
.overlay-over-c8eb,
.green_4ce6,
.out_060c,
.surface-597b,
.item-5aaf,
.accent-lite-ab6c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .prev_e950 {
    padding: 8px 0;
  }
  
  .avatar_bottom_50f3 img {
    height: 28px;
    width: auto;
  }
  
  .plasma_95da {
    display: none !important;
  }
  
  .fresh_0522 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fresh_0522 svg {
    width: 14px;
    height: 14px;
  }
  
  .nav-fcc5 {
    padding: 6px;
  }
  
  .search_02ff {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .detail_fluid_23e8,
  .overlay-4e93,
  .article_7714,
  .pagination_64dd,
  .inner_a66d,
  .north-6de8,
  .list-hard-9195,
  .column-3a49,
  .photo-e234,
  .footer_57b3,
  .clean-a4f0,
  .highlight-copper-a175 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .fixed_f620,
  .rough_12b6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-a61f,
  .dropdown_wood_c6da,
  .fluid_c483,
  .glass-8244,
  .accordion_2f41,
  .down-8823,
  .frame_simple_25f9 {
    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 */
  .in_cf78,
  .first-5a50,
  .section-dark-76b4,
  .pagination_b6a1,
  .preview-pro-4f07 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover_eb55,
  .module-action-a105,
  .gas-7a76,
  .sort_dbb1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fresh_020e,
  .hidden-pink-33af {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown_64ca,
  .list-cba1,
  .block-east-c580,
  .dirty_a280 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .content_33a1,
  .dirty_15d8,
  .gradient_0065,
  .menu_out_66a7,
  .notice-upper-2e71,
  .old_e84c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .in_cf78,
  .first-5a50,
  .pagination_b6a1 {
    max-width: none !important;
  }
  
  .accent_833c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover_eb55 {
    font-size: 1.5rem !important;
  }
  
  .module-action-a105 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .accent_4930,
  .nav-d18c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gas-7a76 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .info_focused_8056 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .overlay-7fdc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .in_cf78,
  .pagination_b6a1 {
    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: 4309 */
.promo-block-n8 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.2;
}
