/* ============================================
   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 (.modal-c6ca) is a descendant of
   .north-425a (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.fast-4cea {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".footer-44c6" 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.info_94de so it can't cause
   horizontal overflow anyway. */
.paper-9f5c,
.disabled_bright_af75,
.background-glass-dcbb,
.image-fluid-119c,
.dirty-60af,
.container_9bd3,
.avatar-hard-a714,
.badge-wood-bf6e,
.thick_5f41,
.breadcrumb_mini_5bd9,
.module-red-6223 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .column_basic_b368 {
    padding: 8px 0;
  }
  
  .secondary-fresh-ee5b img {
    height: 28px;
    width: auto;
  }
  
  .static-023f {
    display: none !important;
  }
  
  .badge-c8af {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .badge-c8af svg {
    width: 14px;
    height: 14px;
  }
  
  .light_4c02 {
    padding: 6px;
  }
  
  .title_e732 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .background-glass-dcbb,
  .disabled_bright_af75,
  .image-fluid-119c,
  .dirty-60af,
  .form-5b13,
  .slider_27db,
  .accent_cool_17ad,
  .wrapper-fresh-8ea8,
  .highlight-9e25,
  .avatar_f3df,
  .table-hovered-a310,
  .module_879c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tag-light-0e08,
  .surface_243d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .full_6f26,
  .hover-7517,
  .container-medium-a871,
  .hidden-white-bb6e,
  .highlight-tall-39b7,
  .avatar_wood_25cf,
  .texture-gold-f53d {
    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 */
  .wide_d899,
  .module-b478,
  .basic-9b49,
  .sort_plasma_e759,
  .layout-56b9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .header_64ef,
  .title-4d88,
  .slow-6431,
  .yellow-3f8c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gallery-d14b,
  .description-short-1278 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .detail_fd2a,
  .east_44d3,
  .glass_cf7a,
  .media-869b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pink-ca70,
  .message_smooth_546f,
  .dropdown_solid_f89d,
  .overlay_in_2031,
  .alert_f9a1,
  .slider_cool_cd0a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .wide_d899,
  .module-b478,
  .sort_plasma_e759 {
    max-width: none !important;
  }
  
  .footer-44c6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .header_64ef {
    font-size: 1.5rem !important;
  }
  
  .title-4d88 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .module-0186,
  .photo-a3e1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .slow-6431 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .badge_up_9795 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .form-2513 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .wide_d899,
  .sort_plasma_e759 {
    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: c473 */
.promo-block-c4 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
