/* ============================================
   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 (.nav-last-32ee) is a descendant of
   .highlight-82e1 (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.nav_3866 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".item_23ce" 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.steel_3278 so it can't cause
   horizontal overflow anyway. */
.solid-bdf2,
.module-outer-6bd0,
.gallery_medium_5372,
.highlight_full_8706,
.aside-29d8,
.chip-middle-1947,
.tooltip_old_4f0b,
.container_brown_9e08,
.bottom_3c8a,
.media_upper_fde0,
.fluid-5331 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .status-f05a {
    padding: 8px 0;
  }
  
  .short_2778 img {
    height: 28px;
    width: auto;
  }
  
  .easy_275b {
    display: none !important;
  }
  
  .outer-5011 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .outer-5011 svg {
    width: 14px;
    height: 14px;
  }
  
  .sidebar-2cdc {
    padding: 6px;
  }
  
  .tag_59be {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gallery_medium_5372,
  .module-outer-6bd0,
  .highlight_full_8706,
  .aside-29d8,
  .tall-bf58,
  .title_a8ba,
  .notification_static_3495,
  .avatar-f2bc,
  .widget-last-2094,
  .item-4b16,
  .feature_d5ab,
  .north-e57e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .link-b16c,
  .steel_b158 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .texture-hovered-c428,
  .banner-cool-a945,
  .grid_east_00fa,
  .thick-d500,
  .tooltip-e3df,
  .overlay_2f92,
  .mask-7cc5 {
    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 */
  .motion-c1e4,
  .pagination-f368,
  .item_b2d4,
  .badge_orange_61e1,
  .dark_1df8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .layout-886e,
  .footer-dd8a,
  .tabs-10c6,
  .mask_down_9189 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .in-9a03,
  .heading-10f0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .light_4222,
  .secondary-fa86,
  .info_pro_f6e6,
  .active-0e93 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .shade_cad5,
  .new_c933,
  .container-advanced-5efd,
  .preview-advanced-cbf6,
  .shade_80ee,
  .chip_fb35 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .motion-c1e4,
  .pagination-f368,
  .badge_orange_61e1 {
    max-width: none !important;
  }
  
  .item_23ce {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .layout-886e {
    font-size: 1.5rem !important;
  }
  
  .footer-dd8a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .secondary-1e02,
  .logo_e15c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tabs-10c6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pattern_2116 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .preview-2087 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .motion-c1e4,
  .badge_orange_61e1 {
    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: f5d0 */
.widget-item-y8 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
