/* ============================================
   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 (.badge_center_93e1) is a descendant of
   .layout-complex-568d (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-bca2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".motion_8b78" 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-fast-1039 so it can't cause
   horizontal overflow anyway. */
.status_inner_21b6,
.caption_blue_54cb,
.tooltip-cool-9311,
.right-433d,
.backdrop_7699,
.focused-5266,
.easy-8877,
.purple-f8d6,
.form_4d2d,
.texture_1c1b,
.dropdown-copper-183f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .west-5ca6 {
    padding: 8px 0;
  }
  
  .carousel_1dd5 img {
    height: 28px;
    width: auto;
  }
  
  .active-wide-3b0c {
    display: none !important;
  }
  
  .selected_4d19 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .selected_4d19 svg {
    width: 14px;
    height: 14px;
  }
  
  .last_58f9 {
    padding: 6px;
  }
  
  .secondary-5538 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tooltip-cool-9311,
  .caption_blue_54cb,
  .right-433d,
  .backdrop_7699,
  .border_stale_a287,
  .alert_white_5084,
  .thumbnail-fb34,
  .message-hard-ef7e,
  .selected_9a46,
  .breadcrumb-paper-1a92,
  .dark_0b62,
  .black_79d6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .panel_fb4b,
  .box_c183 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fluid_454a,
  .yellow_ced7,
  .thumbnail_e5b5,
  .solid_af6d,
  .in-fcfd,
  .footer_cold_ccca,
  .box-fluid-ff1f {
    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 */
  .active-2baf,
  .tabs_west_7fe2,
  .pagination_top_8af4,
  .logo-b2b6,
  .slider-f49d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .overlay-pressed-f661,
  .overlay_hard_37c6,
  .next-2074,
  .dropdown_e948 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shade_fixed_8e7e,
  .border-south-7b45 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .huge-1f3a,
  .feature_0f12,
  .shadow_dark_d15f,
  .notification_668d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .paper_6383,
  .column_19f4,
  .pagination_lower_8b12,
  .stale_eff0,
  .inner_8a69,
  .pagination_warm_ba93 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .active-2baf,
  .tabs_west_7fe2,
  .logo-b2b6 {
    max-width: none !important;
  }
  
  .motion_8b78 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .overlay-pressed-f661 {
    font-size: 1.5rem !important;
  }
  
  .overlay_hard_37c6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .feature-0161,
  .slider-9a76 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .next-2074 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .wide_fede {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .border-b80c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .active-2baf,
  .logo-b2b6 {
    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: 9e6c */
.ghost-box-p0 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
