/* ============================================
   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 (.description_8cb9) is a descendant of
   .mask_a797 (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.carousel-huge-89c7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fast_389e" 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.badge_cold_8166 so it can't cause
   horizontal overflow anyway. */
.iron-6195,
.upper-4e77,
.link_32d8,
.icon-dark-ff99,
.article_paper_8fd1,
.cool-66cd,
.link_wide_197b,
.next_b80f,
.narrow_65bb,
.disabled-e2c1,
.tag_8c53 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .current_0077 {
    padding: 8px 0;
  }
  
  .west-8d06 img {
    height: 28px;
    width: auto;
  }
  
  .huge_7c67 {
    display: none !important;
  }
  
  .accent-dim-a2ac {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .accent-dim-a2ac svg {
    width: 14px;
    height: 14px;
  }
  
  .panel_huge_276b {
    padding: 6px;
  }
  
  .grid_0760 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .link_32d8,
  .upper-4e77,
  .icon-dark-ff99,
  .article_paper_8fd1,
  .nav_purple_d1f4,
  .aside-hard-de20,
  .avatar-bbb6,
  .caption-brown-54aa,
  .up-56fe,
  .warm_d9cd,
  .main_6fe1,
  .light-e3f9 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tabs_copper_7b9f,
  .action_0d38 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .inner-dd68,
  .out-2fa0,
  .badge_0693,
  .preview_d4c2,
  .nav-copper-721f,
  .right_b8c7,
  .last-10ac {
    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 */
  .copper-a1b8,
  .component_white_0ba4,
  .logo_a4b3,
  .overlay_2320,
  .main_6eea {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shade-static-ed85,
  .video-db2a,
  .liquid-7c9a,
  .disabled-bd72 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .search_rough_34e7,
  .prev-c0f2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .north_c32c,
  .module_fixed_8965,
  .article-140b,
  .message-9a93 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .content-pro-1cae,
  .section-63b6,
  .top-2a2a,
  .tooltip_11cf,
  .fluid-679b,
  .logo_be0e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .copper-a1b8,
  .component_white_0ba4,
  .overlay_2320 {
    max-width: none !important;
  }
  
  .fast_389e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shade-static-ed85 {
    font-size: 1.5rem !important;
  }
  
  .video-db2a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .info_mini_f488,
  .icon_69b4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .liquid-7c9a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .nav_03a9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link-b8ae {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .copper-a1b8,
  .overlay_2320 {
    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: 3f4e */
.shadow-element-c1 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.0;
}
