/* ============================================
   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 (.element_hot_9d02) is a descendant of
   .column_motion_bc0c (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.next-f545 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focus_4a53" 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.link_e9a8 so it can't cause
   horizontal overflow anyway. */
.pattern-b77c,
.pro_8299,
.pattern_huge_1810,
.form-out-15dc,
.link_1149,
.dark-a277,
.wide-ac8e,
.accordion-red-9429,
.accordion_fa16,
.preview-cb26,
.surface-full-c07e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .header-full-80a1 {
    padding: 8px 0;
  }
  
  .surface-f813 img {
    height: 28px;
    width: auto;
  }
  
  .element-short-2215 {
    display: none !important;
  }
  
  .preview_down_f3dd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .preview_down_f3dd svg {
    width: 14px;
    height: 14px;
  }
  
  .preview_black_059d {
    padding: 6px;
  }
  
  .slow_b94c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pattern_huge_1810,
  .pro_8299,
  .form-out-15dc,
  .link_1149,
  .container-de9a,
  .hard_2665,
  .description_fast_514c,
  .brown-5b40,
  .breadcrumb-f201,
  .fixed-2e35,
  .popup-copper-e916,
  .active_glass_6c5c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label_a10f,
  .caption_e9ac {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .description_soft_a5d0,
  .carousel-fb7c,
  .header-7ee2,
  .pattern_6c7b,
  .row_4ebf,
  .nav_bf8f,
  .text-828e {
    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 */
  .blue_131c,
  .banner-0b28,
  .red-9c1e,
  .module-rough-f70c,
  .accent_8da3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag_2802,
  .dynamic_6f61,
  .liquid-f6ad,
  .active_9d72 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hidden-4051,
  .alert_e748 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .aside-short-0184,
  .modal_warm_5226,
  .menu-049d,
  .article-1bed {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .slider_a40d,
  .chip-2b48,
  .input-7fd3,
  .black_2536,
  .footer-ae59,
  .background_warm_16cd {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .blue_131c,
  .banner-0b28,
  .module-rough-f70c {
    max-width: none !important;
  }
  
  .focus_4a53 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag_2802 {
    font-size: 1.5rem !important;
  }
  
  .dynamic_6f61 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .layout-d7ab,
  .outline-d7cb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .liquid-f6ad {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .steel_b948 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .panel-a422 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .blue_131c,
  .module-rough-f70c {
    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: b99e */
.shadow-element-f5 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.2;
}
