/* ============================================
   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 (.wrapper-fb61) is a descendant of
   .search_e982 (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.alert-b412 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".progress_88b1" 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.item_1fe3 so it can't cause
   horizontal overflow anyway. */
.preview-b889,
.gallery-94e0,
.gas_330b,
.hero_07bd,
.shadow_8822,
.tag_d036,
.smooth-5ea4,
.preview-dirty-d07b,
.element-7cf6,
.action-99ab,
.hover_1bbb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .box_small_183f {
    padding: 8px 0;
  }
  
  .current_bc78 img {
    height: 28px;
    width: auto;
  }
  
  .green-a5c9 {
    display: none !important;
  }
  
  .progress-4a36 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .progress-4a36 svg {
    width: 14px;
    height: 14px;
  }
  
  .footer_selected_7151 {
    padding: 6px;
  }
  
  .caption_db1d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gas_330b,
  .gallery-94e0,
  .hero_07bd,
  .shadow_8822,
  .accent_gold_bc58,
  .slider-steel-a592,
  .header_left_c9f0,
  .huge_95d8,
  .overlay_right_4d4f,
  .disabled_d171,
  .smooth_38a0,
  .focus-fresh-962f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .next-fcbe,
  .hero-5fa4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .bronze_364e,
  .green_1761,
  .backdrop-7bcc,
  .hard_6f30,
  .frame_8396,
  .gallery_443d,
  .shade-pink-8842 {
    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 */
  .disabled_narrow_4ef0,
  .alert-3b3f,
  .title_orange_5149,
  .title-dim-9fa6,
  .orange-f240 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .article_eb6c,
  .orange_a5e8,
  .hero_c9f1,
  .mask-orange-71d9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element_small_7d18,
  .surface-iron-ca86 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .input_ddfc,
  .panel-fresh-2389,
  .banner-bf4f,
  .list-orange-842c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dim_0c52,
  .gradient_0137,
  .stone_5626,
  .next_6a77,
  .primary-silver-366c,
  .frame-68d8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .disabled_narrow_4ef0,
  .alert-3b3f,
  .title-dim-9fa6 {
    max-width: none !important;
  }
  
  .progress_88b1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .article_eb6c {
    font-size: 1.5rem !important;
  }
  
  .orange_a5e8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tabs_middle_13f6,
  .north_1982 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hero_c9f1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sort-9fb1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .header-032e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .disabled_narrow_4ef0,
  .title-dim-9fa6 {
    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: 9599 */
.widget-item-j7 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.2;
}
