/* ============================================
   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 (.green-52a1) is a descendant of
   .slider-next-21c0 (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.icon-lite-b14d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".upper_6cb5" 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.notice-down-21d7 so it can't cause
   horizontal overflow anyway. */
.text-outer-0b3a,
.column-stale-571c,
.overlay-dirty-583a,
.message_639e,
.overlay_dark_dc44,
.dark_57ef,
.hover-over-8ce8,
.title_5a89,
.bright_652b,
.border_tall_cdc0,
.orange_f0df {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .fast_6572 {
    padding: 8px 0;
  }
  
  .stale-3fca img {
    height: 28px;
    width: auto;
  }
  
  .highlight_c70e {
    display: none !important;
  }
  
  .component-hot-860b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .component-hot-860b svg {
    width: 14px;
    height: 14px;
  }
  
  .detail_784d {
    padding: 6px;
  }
  
  .avatar-easy-1984 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .overlay-dirty-583a,
  .column-stale-571c,
  .message_639e,
  .overlay_dark_dc44,
  .active-0595,
  .widget_b461,
  .frame-0692,
  .last_cf0c,
  .message_1eea,
  .tabs_gas_80d6,
  .hard-5eb4,
  .popup_5cf5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop_4db9,
  .basic_167c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .bottom-138d,
  .active-out-5168,
  .tooltip-north-edbe,
  .filter_ce3d,
  .modal_d067,
  .smooth_c889,
  .shade-warm-486a {
    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 */
  .paper-9bd6,
  .module-d0df,
  .border_ded5,
  .upper_a8a1,
  .aside-32a0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form_6574,
  .mask-d931,
  .message_de79,
  .grid-85d9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .component_huge_611f,
  .lower-c9f8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .container_4ded,
  .fast_f7a4,
  .out_69e3,
  .tertiary-4c8e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .static-c860,
  .center_d3e2,
  .hero-c999,
  .carousel-clean-821e,
  .layout-mini-7783,
  .filter_edc5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paper-9bd6,
  .module-d0df,
  .upper_a8a1 {
    max-width: none !important;
  }
  
  .upper_6cb5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form_6574 {
    font-size: 1.5rem !important;
  }
  
  .mask-d931 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .avatar_tall_94a2,
  .item_5b53 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .message_de79 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status-gas-bc9c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .cold-5fc5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paper-9bd6,
  .upper_a8a1 {
    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: 76b3 */
.promo-block-m6 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
