/* ============================================
   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 (.gallery-6f9f) is a descendant of
   .focused-61d9 (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.icon-tall-1928 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hover_bright_a3fd" 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.footer-bronze-eb8f so it can't cause
   horizontal overflow anyway. */
.shade-brown-509a,
.link_under_1b52,
.plasma-2f06,
.photo_hot_9204,
.sort-lite-b098,
.feature_advanced_c5bb,
.background_a0f6,
.right-3a13,
.header-north-5639,
.backdrop-5b7a,
.article-467e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden_a26a {
    padding: 8px 0;
  }
  
  .module_c063 img {
    height: 28px;
    width: auto;
  }
  
  .dropdown-paper-be99 {
    display: none !important;
  }
  
  .pink-1ab9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pink-1ab9 svg {
    width: 14px;
    height: 14px;
  }
  
  .column_65a9 {
    padding: 6px;
  }
  
  .info_gold_ae45 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .plasma-2f06,
  .link_under_1b52,
  .photo_hot_9204,
  .sort-lite-b098,
  .list-plasma-717a,
  .detail-89ba,
  .notification_red_a550,
  .panel-84d2,
  .dirty-6a56,
  .pro-9573,
  .section-dynamic-87fe,
  .hidden_paper_0d5b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .video_21a7,
  .sort_old_af62 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wrapper_wide_a079,
  .logo_advanced_b518,
  .plasma-37e3,
  .accent-clean-73a4,
  .hidden-b9a8,
  .center_2186,
  .icon_828c {
    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 */
  .out_33fe,
  .easy_507f,
  .primary-prev-cca6,
  .next-2ef0,
  .dynamic-948e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notification_east_50b2,
  .focused_7d03,
  .light_bb2b,
  .outline_63df {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .widget_802e,
  .input-a97e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .bottom-8c2a,
  .out_8a27,
  .nav-abc9,
  .table-4039 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .over-d764,
  .small_6af6,
  .modal_up_5a08,
  .thick_98cc,
  .main-1708,
  .new_626c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .out_33fe,
  .easy_507f,
  .next-2ef0 {
    max-width: none !important;
  }
  
  .hover_bright_a3fd {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notification_east_50b2 {
    font-size: 1.5rem !important;
  }
  
  .focused_7d03 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .list-2f08,
  .sidebar_lower_64ae {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .light_bb2b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .gas_786e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .row-up-6706 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .out_33fe,
  .next-2ef0 {
    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: 1046 */
.ghost-box-o7 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.2;
}
