/* ============================================
   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 (.article-cold-5bda) is a descendant of
   .stone-f910 (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.box-d4cc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shade_1bb1" 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.hover-pro-b615 so it can't cause
   horizontal overflow anyway. */
.clean-3079,
.footer_f9f3,
.narrow_f33c,
.dark-febe,
.status_dirty_fb1f,
.block_complex_3c99,
.filter-dim-e5d4,
.footer_4c2b,
.next_cbb0,
.modal-soft-5db3,
.easy_af83 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .photo_solid_7498 {
    padding: 8px 0;
  }
  
  .chip_large_2726 img {
    height: 28px;
    width: auto;
  }
  
  .pattern_ba94 {
    display: none !important;
  }
  
  .content_mini_f5ad {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .content_mini_f5ad svg {
    width: 14px;
    height: 14px;
  }
  
  .solid-69d4 {
    padding: 6px;
  }
  
  .hover-gas-9ced {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .narrow_f33c,
  .footer_f9f3,
  .dark-febe,
  .status_dirty_fb1f,
  .plasma_a6f6,
  .iron-ff3c,
  .short_61ee,
  .component-566d,
  .main-4a2b,
  .active-fb5e,
  .out_48bb,
  .fluid-c3c2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .next-ccda,
  .focused-9713 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .first-c448,
  .silver-86e8,
  .gold_2a4f,
  .bottom_1783,
  .module_fa12,
  .hero-white-3514,
  .large-d166 {
    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 */
  .element_ecb6,
  .gradient_dim_0a21,
  .tertiary-2f07,
  .tiny-aaad,
  .chip_3f00 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .light-5b4d,
  .dirty_8981,
  .article-old-aeb3,
  .box_up_0d7e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .row-bcb2,
  .tall-cc46 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .slider_6ef3,
  .selected-477a,
  .cold_2059,
  .disabled_b45f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .progress-605b,
  .layout-upper-147c,
  .mini_2b83,
  .middle-9056,
  .alert_6252,
  .outline_26a1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element_ecb6,
  .gradient_dim_0a21,
  .tiny-aaad {
    max-width: none !important;
  }
  
  .shade_1bb1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .light-5b4d {
    font-size: 1.5rem !important;
  }
  
  .dirty_8981 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .progress-4c6d,
  .fast-d78a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .article-old-aeb3 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .south-0efc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .iron-ae59 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element_ecb6,
  .tiny-aaad {
    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: 01b8 */
.shadow-element-f2 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
