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

/* Fix for any potential overflow elements */
/* NOTE: ".soft_72c8" 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.top-1c60 so it can't cause
   horizontal overflow anyway. */
.nav_middle_9b21,
.carousel_a488,
.container-in-41b8,
.info_0681,
.border-8b4f,
.block-ee2e,
.accent_724d,
.narrow-164b,
.filter-solid-3c87,
.in-57f5,
.container_solid_696e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .logo_870e {
    padding: 8px 0;
  }
  
  .surface-dim-1932 img {
    height: 28px;
    width: auto;
  }
  
  .main-fresh-cbcd {
    display: none !important;
  }
  
  .active_paper_0e43 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .active_paper_0e43 svg {
    width: 14px;
    height: 14px;
  }
  
  .border-steel-8854 {
    padding: 6px;
  }
  
  .cool_c019 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .container-in-41b8,
  .carousel_a488,
  .info_0681,
  .border-8b4f,
  .iron_de60,
  .liquid_e814,
  .footer-narrow-3909,
  .row-6570,
  .card_small_502e,
  .orange_0ccc,
  .notification-94bb,
  .tabs-ef8a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .border_9c58,
  .large-f495 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .simple-963b,
  .main_5fed,
  .thumbnail-basic-fbcf,
  .stale_cba6,
  .nav-brown-cd56,
  .title_new_cfe7,
  .dim_dd70 {
    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 */
  .header_5d7c,
  .focus_6a16,
  .notification_clean_a4e4,
  .silver-76a6,
  .detail-copper-58ec {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .secondary-hovered-0fb0,
  .out-bdbe,
  .info-motion-7d68,
  .glass_8c2a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .sidebar-2e4d,
  .frame_e3c9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .summary_f36f,
  .aside_9bfd,
  .outer-d0b1,
  .box-hovered-061e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gold_f21f,
  .inner-b17b,
  .stone_f5bf,
  .shade_6f7f,
  .column-727d,
  .content-large-1a31 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .header_5d7c,
  .focus_6a16,
  .silver-76a6 {
    max-width: none !important;
  }
  
  .soft_72c8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .secondary-hovered-0fb0 {
    font-size: 1.5rem !important;
  }
  
  .out-bdbe {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .summary-focused-adb3,
  .fast-718e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .info-motion-7d68 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .simple-197b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .block-out-b27e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header_5d7c,
  .silver-76a6 {
    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: cf5e */
.promo-block-a4 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.0;
}
