/* ============================================
   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 (.advanced-efca) is a descendant of
   .motion-5441 (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.yellow-4cc7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".surface-hard-c214" 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.accent-medium-92ce so it can't cause
   horizontal overflow anyway. */
.primary_f91c,
.description-medium-e57b,
.label-cece,
.popup-last-e517,
.accent-fd02,
.cool_b42b,
.frame-e395,
.mask_cold_0f25,
.current_0483,
.in_7603,
.pattern-b6e6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview_medium_aa71 {
    padding: 8px 0;
  }
  
  .article_tiny_be84 img {
    height: 28px;
    width: auto;
  }
  
  .description-436d {
    display: none !important;
  }
  
  .first-bb7c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .first-bb7c svg {
    width: 14px;
    height: 14px;
  }
  
  .media-short-d072 {
    padding: 6px;
  }
  
  .solid-387f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label-cece,
  .description-medium-e57b,
  .popup-last-e517,
  .accent-fd02,
  .wrapper_advanced_0678,
  .highlight-top-4f3c,
  .outer_d586,
  .out-9ae5,
  .sidebar-pink-cdbd,
  .list_south_35b2,
  .right-7491,
  .icon_6ee7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .highlight_fast_e6bb,
  .modal_4127 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .form-prev-fce3,
  .footer-small-7bb6,
  .row_east_d744,
  .new-dacc,
  .title_5eee,
  .accordion-soft-8d09,
  .pink-8723 {
    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 */
  .paragraph-tall-0c2e,
  .over_0430,
  .tooltip-complex-545e,
  .liquid_556f,
  .link_bottom_0aa8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .warm-bc44,
  .complex_2697,
  .thick-e1be,
  .aside-a473 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fluid_c3e2,
  .north-3cbc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .silver-e49a,
  .module-b146,
  .mini_80e2,
  .plasma_e5ab {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .wide-7ed5,
  .row-d8c1,
  .accent-pro-c6aa,
  .gas-07df,
  .action-d5fd,
  .banner_de9e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paragraph-tall-0c2e,
  .over_0430,
  .liquid_556f {
    max-width: none !important;
  }
  
  .surface-hard-c214 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .warm-bc44 {
    font-size: 1.5rem !important;
  }
  
  .complex_2697 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .left_cea2,
  .gallery-focused-f979 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .thick-e1be {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .smooth-b813 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .badge-dim-1f7a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paragraph-tall-0c2e,
  .liquid_556f {
    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: f52b */
.ghost-box-a3 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.2;
}
