/* ============================================
   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 (.old_2422) is a descendant of
   .active-bace (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.in-8435 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".cool-94fd" 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.action-847b so it can't cause
   horizontal overflow anyway. */
.fast_051f,
.text_fast_d92a,
.sidebar_black_fa33,
.stale-427f,
.input-smooth-7003,
.thumbnail_large_1340,
.brown-c34e,
.input-motion-2591,
.detail_tall_bf6a,
.list-54e3,
.nav-4f03 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .content_top_6415 {
    padding: 8px 0;
  }
  
  .hot_dbeb img {
    height: 28px;
    width: auto;
  }
  
  .fast-75da {
    display: none !important;
  }
  
  .menu-fefe {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .menu-fefe svg {
    width: 14px;
    height: 14px;
  }
  
  .info-red-0bc3 {
    padding: 6px;
  }
  
  .wide-ea57 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sidebar_black_fa33,
  .text_fast_d92a,
  .stale-427f,
  .input-smooth-7003,
  .fresh_0653,
  .panel_b1ba,
  .logo-hovered-7649,
  .up-5655,
  .clean_341e,
  .progress-middle-3191,
  .bright-c2b6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label_54d1,
  .primary-down-7eb9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .picture_active_f4fd,
  .content_simple_c5db,
  .menu-7873,
  .modal_bc46,
  .title_92f2,
  .tall-7c92,
  .liquid-821b {
    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 */
  .up_9804,
  .liquid-d55c,
  .under-d182,
  .module-brown-ec0e,
  .carousel-wood-b33e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .column-stone-5500,
  .highlight-simple-204c,
  .last-8a08,
  .status_3ae1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .slider_dark_3c09,
  .icon_d620 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .media_cf87,
  .description-0510,
  .media_f07f,
  .progress-3b31 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .top-313a,
  .paragraph-9a5b,
  .article_static_6767,
  .slow_556e,
  .orange-e0c5,
  .simple_3e28 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .up_9804,
  .liquid-d55c,
  .module-brown-ec0e {
    max-width: none !important;
  }
  
  .cool-94fd {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .column-stone-5500 {
    font-size: 1.5rem !important;
  }
  
  .highlight-simple-204c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .element-bright-cef5,
  .white_5507 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .last-8a08 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .purple_b4a3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .overlay_e860 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .up_9804,
  .module-brown-ec0e {
    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: a970 */
.phantom-card-x8 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.1;
}
