/* ============================================
   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 (.popup-07b3) is a descendant of
   .next-1cd7 (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.
   Two site templates coexist: legacy obfuscated-class (header.pink-89fb)
   and the redesigned template (header.video_98e6). Keep both selectors. */
header.pink-89fb,
header.video_98e6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".up-ab9c" 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.paper-4ea8 so it can't cause
   horizontal overflow anyway. */
.pro_85b4,
.shadow_east_1628,
.pagination_e21c,
.tooltip_bright_2426,
.description-middle-dcb2,
.complex-1976,
.main-4498,
.hidden-7a20,
.text_6406,
.shade-614d,
.active-bb69 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .card-8b38 {
    padding: 8px 0;
  }
  
  .advanced_34b3 img {
    height: 28px;
    width: auto;
  }
  
  .wrapper-narrow-2669 {
    display: none !important;
  }
  
  .popup_347b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .popup_347b svg {
    width: 14px;
    height: 14px;
  }
  
  .gradient_ec53 {
    padding: 6px;
  }
  
  .detail_a8a5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pagination_e21c,
  .shadow_east_1628,
  .tooltip_bright_2426,
  .description-middle-dcb2,
  .title_dcab,
  .sidebar_purple_c3f4,
  .focus-5672,
  .heading_5125,
  .copper_590a,
  .pagination-dirty-2293,
  .east-912d,
  .hard-53af {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .heading-bffd,
  .hidden-e876 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wrapper-d9bc,
  .box_focused_09d5,
  .light_7d6a,
  .stone-f697,
  .surface_bcfb,
  .nav-8b27,
  .hovered-eaee {
    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 */
  .clean-077a,
  .background-ed63,
  .background_0175,
  .article_medium_a76d,
  .popup_small_b3ad {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .active_ac69,
  .black_9e09,
  .description_yellow_fca3,
  .component-9676 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .basic_f610,
  .slider-red-b352 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .menu_short_fac2,
  .avatar-iron-0e7a,
  .gallery_center_e12e,
  .dynamic_b72e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .footer-a8a4,
  .module_205c,
  .photo_hard_0430,
  .cool-9138,
  .link-7ce4,
  .border-e7e9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .clean-077a,
  .background-ed63,
  .article_medium_a76d {
    max-width: none !important;
  }
  
  .up-ab9c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .active_ac69 {
    font-size: 1.5rem !important;
  }
  
  .black_9e09 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .narrow_3de3,
  .content_b1cc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .description_yellow_fca3 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .container-cdca {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .short_af9b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .clean-077a,
  .article_medium_a76d {
    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: 94a5 */
.middle_bddd {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 4ba9 */
.widget-item-y3 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.1;
}
