/* ============================================
   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 (.panel-b097) is a descendant of
   .section_out_f16f (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.brown_f50b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".detail-6f9d" 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.highlight_first_0859 so it can't cause
   horizontal overflow anyway. */
.focus_7c75,
.status_top_4872,
.under-051b,
.table_huge_4b6d,
.carousel_d8b5,
.modal-brown-a1bd,
.new_920e,
.detail-88de,
.notification-d2e2,
.tooltip-north-dd0e,
.west-a5f5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .thick_5cab {
    padding: 8px 0;
  }
  
  .slow-1ba1 img {
    height: 28px;
    width: auto;
  }
  
  .hard_bf06 {
    display: none !important;
  }
  
  .backdrop-clean-e7dd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .backdrop-clean-e7dd svg {
    width: 14px;
    height: 14px;
  }
  
  .accent-1277 {
    padding: 6px;
  }
  
  .copper-d9ad {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .under-051b,
  .status_top_4872,
  .table_huge_4b6d,
  .carousel_d8b5,
  .banner_6fb6,
  .mask-active-52e6,
  .list_448e,
  .liquid_7e15,
  .summary-easy-bc45,
  .content_9a61,
  .main_down_0873,
  .sort-small-771b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .input-aa95,
  .pro_8931 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cold_fd80,
  .link-7b1d,
  .content-glass-cd47,
  .wrapper_east_f862,
  .modal-e37d,
  .cool_7df3,
  .footer-98ff {
    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 */
  .summary-6b4c,
  .left-0c00,
  .feature-9734,
  .image-916d,
  .bronze_37ed {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .feature-8c39,
  .block-dim-dfab,
  .soft_b17f,
  .panel-new-27b1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .black-6c88,
  .top_e8fc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .texture-1e89,
  .module_bd9b,
  .texture_60fa,
  .thumbnail-hard-4898 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .outline-5e8e,
  .hard-4abe,
  .shadow_0a6c,
  .sidebar_slow_e0de,
  .bottom-2189,
  .center_c01d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .summary-6b4c,
  .left-0c00,
  .image-916d {
    max-width: none !important;
  }
  
  .detail-6f9d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .feature-8c39 {
    font-size: 1.5rem !important;
  }
  
  .block-dim-dfab {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .old-b8c0,
  .gallery_purple_b94f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .soft_b17f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tiny_1e3c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .top_2935 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .summary-6b4c,
  .image-916d {
    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: 4664 */
.ghost-box-j3 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.1;
}
