/* ============================================
   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 (.bronze-cb00) is a descendant of
   .action_e63e (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.texture_348a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".thumbnail-0154" 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.outer_8835 so it can't cause
   horizontal overflow anyway. */
.highlight_0624,
.button_6fb4,
.dynamic-1e34,
.banner_ecfd,
.photo_lower_5b20,
.progress-3154,
.filter-light-f581,
.info-basic-6e18,
.grid_green_54a7,
.white_ee2e,
.tertiary_fresh_82ce {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .easy_d705 {
    padding: 8px 0;
  }
  
  .lower-f427 img {
    height: 28px;
    width: auto;
  }
  
  .logo-left-2aad {
    display: none !important;
  }
  
  .banner_in_38a4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .banner_in_38a4 svg {
    width: 14px;
    height: 14px;
  }
  
  .message-focused-80a7 {
    padding: 6px;
  }
  
  .shadow_5677 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dynamic-1e34,
  .button_6fb4,
  .banner_ecfd,
  .photo_lower_5b20,
  .stale_4856,
  .notification-simple-dc54,
  .carousel_d226,
  .complex_fd91,
  .title-39c7,
  .frame-087f,
  .white-7f2d,
  .primary-right-ed93 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop_8c72,
  .orange_755e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .picture-east-0549,
  .gallery-rough-72de,
  .content-steel-48e7,
  .rough-fbe5,
  .iron-a34d,
  .item-c06b,
  .bright_67fd {
    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 */
  .gradient-complex-a1ac,
  .list-center-e0bc,
  .bottom-7b49,
  .image_soft_e2d6,
  .message-4949 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-pro-27d5,
  .info-old-7da3,
  .gas-b88f,
  .steel_2865 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero_easy_2f18,
  .paper-1df4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .motion_a596,
  .accent-6bb6,
  .mask_5af1,
  .dirty_0638 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first-99d7,
  .text-b6f9,
  .notification-312e,
  .tooltip-pro-f265,
  .article_3731,
  .dim-245f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gradient-complex-a1ac,
  .list-center-e0bc,
  .image_soft_e2d6 {
    max-width: none !important;
  }
  
  .thumbnail-0154 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-pro-27d5 {
    font-size: 1.5rem !important;
  }
  
  .info-old-7da3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .rough-4515,
  .hover-red-6c85 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gas-b88f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .gradient_1d44 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .caption-silver-01a2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gradient-complex-a1ac,
  .image_soft_e2d6 {
    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: 555d */
.promo-block-c6 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
