/* ============================================
   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 (.dynamic-02ba) is a descendant of
   .accent_856d (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.feature_pink_1637 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notice-4383" 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.action-ede5 so it can't cause
   horizontal overflow anyway. */
.shade_upper_5092,
.smooth-fc60,
.form-large-edc4,
.accent_out_8469,
.wrapper-d197,
.badge-black-f519,
.message_iron_26f8,
.message_paper_115e,
.highlight-26b9,
.grid_a132,
.border_ba84 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .mask-9adf {
    padding: 8px 0;
  }
  
  .hover_c418 img {
    height: 28px;
    width: auto;
  }
  
  .article_huge_a4ee {
    display: none !important;
  }
  
  .grid-plasma-22c7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .grid-plasma-22c7 svg {
    width: 14px;
    height: 14px;
  }
  
  .sort_wood_2bbe {
    padding: 6px;
  }
  
  .under-fa3a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .form-large-edc4,
  .smooth-fc60,
  .accent_out_8469,
  .wrapper-d197,
  .card-narrow-25cb,
  .tooltip-focused-c65a,
  .filter_fixed_d480,
  .column_smooth_bca2,
  .label-glass-f502,
  .wide_ab06,
  .component_center_6af4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .summary_in_d090,
  .paragraph_liquid_0f69 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .image_d233,
  .orange-6854,
  .stale-cbfc,
  .center_a068,
  .card-ff15,
  .hero_iron_c124,
  .blue-c34d {
    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 */
  .orange-8549,
  .notice-c32c,
  .caption-0116,
  .motion_28db,
  .pattern-224e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dim_2daf,
  .next_c81b,
  .nav_stale_e3f8,
  .header_out_9b7d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element_ad35,
  .popup_steel_b789 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .east-d47e,
  .layout-dirty-e896,
  .title_new_faf5,
  .narrow-73ad {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .advanced_1e19,
  .tall-c748,
  .label-smooth-0dcd,
  .tag_cfbd,
  .bronze-243a,
  .picture_9106 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .orange-8549,
  .notice-c32c,
  .motion_28db {
    max-width: none !important;
  }
  
  .notice-4383 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dim_2daf {
    font-size: 1.5rem !important;
  }
  
  .next_c81b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .paragraph-32b8,
  .texture-purple-9d43 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .nav_stale_e3f8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .input_37da {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .steel_fce9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .orange-8549,
  .motion_28db {
    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: e9a4 */
.phantom-card-a0 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
