/* ============================================
   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 (.button_4f97) is a descendant of
   .up-2340 (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.wood-da57 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".new_06be" 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.avatar_first_8d4b so it can't cause
   horizontal overflow anyway. */
.section_smooth_e218,
.item_26f4,
.badge-old-40e6,
.form-black-fe3a,
.popup_up_873d,
.center-c337,
.focused_1286,
.hero-2102,
.status-d662,
.video_wide_b5ad,
.sidebar-brown-9669 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gold_8454 {
    padding: 8px 0;
  }
  
  .thumbnail_edd8 img {
    height: 28px;
    width: auto;
  }
  
  .border_small_5664 {
    display: none !important;
  }
  
  .badge-8c4a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .badge-8c4a svg {
    width: 14px;
    height: 14px;
  }
  
  .detail_west_fcdc {
    padding: 6px;
  }
  
  .west-ed3a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .badge-old-40e6,
  .item_26f4,
  .form-black-fe3a,
  .popup_up_873d,
  .fast_400a,
  .next-a2b2,
  .block_huge_63fb,
  .article-black-4bc6,
  .status-526d,
  .focus_light_0a52,
  .blue-8d76,
  .simple-0050 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .main-1d3a,
  .pro_d80f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .light-129f,
  .info-cold-5a89,
  .purple-0e30,
  .message-dark-ca39,
  .section-complex-48e8,
  .wide_9248,
  .button_0ae8 {
    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 */
  .badge-bottom-9408,
  .fluid_c102,
  .avatar_ccd2,
  .panel-9e85,
  .media-81f4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .banner-stone-53ed,
  .list_warm_dd82,
  .highlight-in-005c,
  .modal_pink_56a2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .simple_63c6,
  .top-0029 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hot_ccf7,
  .tabs-c312,
  .article_hot_4c6a,
  .pro_5bb6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .narrow-2590,
  .accordion_wide_b7b9,
  .footer-hard-dc3e,
  .message-copper-fdab,
  .south-aa2a,
  .layout-black-7cc9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .badge-bottom-9408,
  .fluid_c102,
  .panel-9e85 {
    max-width: none !important;
  }
  
  .new_06be {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .banner-stone-53ed {
    font-size: 1.5rem !important;
  }
  
  .list_warm_dd82 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wrapper-f507,
  .badge-inner-cfb5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .highlight-in-005c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .advanced-9631 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gas_bcbe {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .badge-bottom-9408,
  .panel-9e85 {
    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: 7166 */
.promo-block-b6 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.0;
}
