/* ============================================
   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 (.feature_9628) is a descendant of
   .badge_copper_729c (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_8250 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tertiary-dark-ad7b" 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.texture-8482 so it can't cause
   horizontal overflow anyway. */
.clean_3f38,
.hard-9c34,
.chip_orange_f805,
.south_8f8a,
.bronze_5bbc,
.warm_e3dd,
.main_active_8318,
.widget-6496,
.carousel-ab5e,
.dirty-4af9,
.sidebar_complex_0ad0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .logo-8dbb {
    padding: 8px 0;
  }
  
  .tabs_narrow_ea1d img {
    height: 28px;
    width: auto;
  }
  
  .icon-7d31 {
    display: none !important;
  }
  
  .item-up-5de7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .item-up-5de7 svg {
    width: 14px;
    height: 14px;
  }
  
  .overlay_4592 {
    padding: 6px;
  }
  
  .breadcrumb-red-34c5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .chip_orange_f805,
  .hard-9c34,
  .south_8f8a,
  .bronze_5bbc,
  .search-tiny-3bd2,
  .accent_8c80,
  .text_9991,
  .hover-blue-7e0a,
  .silver-5afe,
  .red_344d,
  .frame_light_bec2,
  .east-1f75 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .over_3dbe,
  .container_medium_de75 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .short-9e89,
  .outline_eec1,
  .smooth_f2d3,
  .container_down_bd15,
  .bronze_1c11,
  .main_64f9,
  .tertiary-9e11 {
    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 */
  .frame-down-6543,
  .menu_8d09,
  .mask-d107,
  .avatar-120c,
  .gradient-cc89 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .complex_bcfc,
  .motion-29b5,
  .slider-915d,
  .item-23a0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .card-hard-5897,
  .solid_b8ac {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active_0298,
  .button_22ae,
  .huge-e1e1,
  .static-d925 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .picture-faf8,
  .filter-glass-95e0,
  .prev-279f,
  .media-medium-1fd4,
  .summary-pressed-cad1,
  .status_bbe5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .frame-down-6543,
  .menu_8d09,
  .avatar-120c {
    max-width: none !important;
  }
  
  .tertiary-dark-ad7b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .complex_bcfc {
    font-size: 1.5rem !important;
  }
  
  .motion-29b5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .heading-hard-316a,
  .short-a84b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .slider-915d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .action-36fb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dynamic-8eee {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .frame-down-6543,
  .avatar-120c {
    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: e764 */
.ghost-box-y8 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.0;
}
