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

/* Fix for any potential overflow elements */
/* NOTE: ".image-smooth-607b" 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.grid_pink_7b33 so it can't cause
   horizontal overflow anyway. */
.menu-north-4186,
.west-75d2,
.secondary-242a,
.basic-b2a0,
.complex_29bd,
.notice_f9b7,
.link_2b22,
.notification-plasma-1fd8,
.active-up-8385,
.menu-bright-b84c,
.stale-8e05 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notice-copper-e0b9 {
    padding: 8px 0;
  }
  
  .over_35f4 img {
    height: 28px;
    width: auto;
  }
  
  .alert-small-a4a9 {
    display: none !important;
  }
  
  .card-brown-1253 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .card-brown-1253 svg {
    width: 14px;
    height: 14px;
  }
  
  .alert-5833 {
    padding: 6px;
  }
  
  .card-af0b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .secondary-242a,
  .west-75d2,
  .basic-b2a0,
  .complex_29bd,
  .yellow_6a2d,
  .message-5e24,
  .detail_huge_56f8,
  .tabs-motion-b3b8,
  .active_a3be,
  .notice-9d91,
  .backdrop-dc39 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .medium-0865,
  .hidden-hovered-0173 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .border_6e69,
  .preview_3212,
  .title-a8c2,
  .lower_8dfb,
  .old-3840,
  .picture_e868,
  .slider_5e8e {
    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-2ad0,
  .alert-fcd2,
  .mini_ae0d,
  .component_next_c8ec,
  .module-0a1b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hovered-11df,
  .pink_6335,
  .prev-b8ad,
  .old_d342 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tag_current_ba0e,
  .hover-soft-bf76 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .label-f511,
  .hidden_1a0a,
  .upper_75e5,
  .orange-3cb6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .narrow_d40c,
  .center-8765,
  .card_mini_0933,
  .overlay_16e0,
  .row_cool_9bb2,
  .active-blue-e448 {
    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-2ad0,
  .alert-fcd2,
  .component_next_c8ec {
    max-width: none !important;
  }
  
  .image-smooth-607b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hovered-11df {
    font-size: 1.5rem !important;
  }
  
  .pink_6335 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .image-0813,
  .box_ba80 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .prev-b8ad {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .avatar-north-31b7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gallery-4afb {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .motion-2ad0,
  .component_next_c8ec {
    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: be13 */
.promo-block-w6 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.2;
}
