/* ============================================
   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 (.container-fresh-2b38) is a descendant of
   .short-3a6a (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.right_d200 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".photo_9012" 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.paper-92dc so it can't cause
   horizontal overflow anyway. */
.message_2d9a,
.steel-cbe7,
.status-9b66,
.main-solid-aa47,
.block-ff54,
.silver_56a5,
.texture-inner-9d5b,
.paragraph_bca6,
.media_clean_12db,
.green-7a05,
.solid_3533 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .advanced_1b80 {
    padding: 8px 0;
  }
  
  .preview_iron_b1b4 img {
    height: 28px;
    width: auto;
  }
  
  .layout_5de9 {
    display: none !important;
  }
  
  .liquid-f1ec {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .liquid-f1ec svg {
    width: 14px;
    height: 14px;
  }
  
  .item_dee0 {
    padding: 6px;
  }
  
  .summary_fc05 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .status-9b66,
  .steel-cbe7,
  .main-solid-aa47,
  .block-ff54,
  .warm_b4f7,
  .highlight_b1b5,
  .article_next_44e4,
  .article-3bd0,
  .feature_c3f3,
  .carousel_stone_c0a8,
  .tiny_a68e,
  .title-last-6842 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .prev-5f05,
  .backdrop-simple-2571 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header_f985,
  .first-1d65,
  .button-9d4a,
  .video-5a29,
  .container-prev-fd2c,
  .easy-338d,
  .stale-c418 {
    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 */
  .chip_255e,
  .chip_tall_102e,
  .pink_499c,
  .wrapper-66fc,
  .over_0a81 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .slider_b2f4,
  .shade-11e7,
  .status-stone-f7e6,
  .primary-53bb {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hovered_b89a,
  .stone-5310 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh-b142,
  .inner-a2b6,
  .old_4667,
  .border_8b8a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .filter_cold_c1dc,
  .banner-plasma-5c64,
  .texture-05fe,
  .heading_b3fa,
  .header_e978,
  .in-d245 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .chip_255e,
  .chip_tall_102e,
  .wrapper-66fc {
    max-width: none !important;
  }
  
  .photo_9012 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .slider_b2f4 {
    font-size: 1.5rem !important;
  }
  
  .shade-11e7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .icon-cbb4,
  .frame-medium-747e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .status-stone-f7e6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pressed-87fa {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module_eede {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chip_255e,
  .wrapper-66fc {
    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: 4737 */
.shadow-element-y7 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
