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

/* Fix for any potential overflow elements */
/* NOTE: ".gallery_bottom_5a04" 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.mask-dim-5843 so it can't cause
   horizontal overflow anyway. */
.feature_tall_64da,
.badge-4a89,
.active-2c59,
.hot-8e15,
.overlay_89ff,
.highlight_5dc5,
.texture-upper-b44b,
.box_bd85,
.media-orange-e4ae,
.input-yellow-3d19,
.badge_80b5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .frame-center-e680 {
    padding: 8px 0;
  }
  
  .advanced-fbeb img {
    height: 28px;
    width: auto;
  }
  
  .silver-0685 {
    display: none !important;
  }
  
  .table-b902 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .table-b902 svg {
    width: 14px;
    height: 14px;
  }
  
  .hard_cd14 {
    padding: 6px;
  }
  
  .small_987b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .active-2c59,
  .badge-4a89,
  .hot-8e15,
  .overlay_89ff,
  .liquid_cfeb,
  .small_b3df,
  .link-blue-6e68,
  .picture_dd70,
  .footer_south_cfa2,
  .disabled-in-01fe,
  .badge-ba5a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .button-thick-4572,
  .hover_in_1a21 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .module_smooth_751c,
  .hard_443b,
  .aside_cc51,
  .background_pressed_34b5,
  .white-55e3,
  .progress_bright_0216,
  .logo_d2f0 {
    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 */
  .tooltip_tall_f158,
  .dropdown_1f6c,
  .dropdown-0e2e,
  .media_smooth_4c79,
  .background_tiny_2470 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .warm-84cf,
  .surface-tall-8818,
  .backdrop-large-7e77,
  .grid-north-e364 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .over_35e1,
  .old-7f9b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .search_55b8,
  .section_c16b,
  .iron-f081,
  .component-dynamic-1d8f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .smooth_2285,
  .content-hot-4c69,
  .notice_hard_477d,
  .full_f682,
  .hard_173a,
  .plasma_c082 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tooltip_tall_f158,
  .dropdown_1f6c,
  .media_smooth_4c79 {
    max-width: none !important;
  }
  
  .gallery_bottom_5a04 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .warm-84cf {
    font-size: 1.5rem !important;
  }
  
  .surface-tall-8818 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .summary_7a58,
  .fresh_9358 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .backdrop-large-7e77 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .warm_1c26 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .menu_copper_7365 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tooltip_tall_f158,
  .media_smooth_4c79 {
    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: 0f46 */
.widget-item-z8 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.2;
}
