/* ============================================
   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 (.active-complex-6fe1) is a descendant of
   .module_751d (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_93e2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".image_5401" 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.widget-e274 so it can't cause
   horizontal overflow anyway. */
.item_538e,
.heading-tiny-b285,
.content-88be,
.banner-6e50,
.surface_advanced_8a4f,
.list-41b7,
.picture-wide-17f5,
.search_3703,
.highlight_1a9b,
.highlight-current-172d,
.widget-5653 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .progress_c0a1 {
    padding: 8px 0;
  }
  
  .button_wood_1420 img {
    height: 28px;
    width: auto;
  }
  
  .slow-900e {
    display: none !important;
  }
  
  .panel_b9fd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .panel_b9fd svg {
    width: 14px;
    height: 14px;
  }
  
  .logo-huge-acd9 {
    padding: 6px;
  }
  
  .module-9006 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .content-88be,
  .heading-tiny-b285,
  .banner-6e50,
  .surface_advanced_8a4f,
  .overlay_7e44,
  .form-5078,
  .background-over-ba40,
  .thick-d933,
  .light-23a3,
  .bronze_f63c,
  .form_dark_489d,
  .top_7969 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .short-6491,
  .menu_liquid_775a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fixed-70e1,
  .silver-79b7,
  .progress-0056,
  .component_over_2ab5,
  .brown_39e1,
  .detail_028c,
  .message-orange-082f {
    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 */
  .focused-9065,
  .dim-8ace,
  .tabs-57e3,
  .tiny-37ec,
  .progress-pro-77d4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .first_ba59,
  .element-advanced-203b,
  .picture-7a42,
  .background_static_8f8c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .popup_0e44,
  .background-d529 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fluid_a9d6,
  .red-b295,
  .dynamic-5753,
  .background_f4f1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .block_fast_e183,
  .pattern-smooth-96a7,
  .active_747c,
  .overlay-blue-98ff,
  .search_east_5934,
  .tertiary-purple-352e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focused-9065,
  .dim-8ace,
  .tiny-37ec {
    max-width: none !important;
  }
  
  .image_5401 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .first_ba59 {
    font-size: 1.5rem !important;
  }
  
  .element-advanced-203b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .active-0e13,
  .photo-large-c563 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture-7a42 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .list_d7a1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .mini-e8e5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focused-9065,
  .tiny-37ec {
    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: d8a2 */
.ghost-box-y0 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
