/* ============================================
   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 (.backdrop-7ed1) is a descendant of
   .form-up-bd2f (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.item_9dc8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".full_2fcc" 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.badge_medium_7f84 so it can't cause
   horizontal overflow anyway. */
.element_hard_3eaa,
.background-4bc5,
.caption-glass-4174,
.accent-cool-62bf,
.shade_849e,
.sidebar_short_d2dc,
.card_hard_2c70,
.hero-708d,
.lite-05aa,
.stale_8406,
.accent-8a07 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .full-8e6c {
    padding: 8px 0;
  }
  
  .border-narrow-7c0b img {
    height: 28px;
    width: auto;
  }
  
  .pattern_pro_8200 {
    display: none !important;
  }
  
  .gradient_medium_a2a1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gradient_medium_a2a1 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter-soft-99e9 {
    padding: 6px;
  }
  
  .warm_c7d0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption-glass-4174,
  .background-4bc5,
  .accent-cool-62bf,
  .shade_849e,
  .chip-8cea,
  .thumbnail-1172,
  .highlight-f4f4,
  .widget-263b,
  .detail_middle_8fea,
  .inner-492b,
  .inner-f8c6,
  .hidden_south_9f69 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop_right_b520,
  .tall_872b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .glass_87c8,
  .fixed_58df,
  .copper-0a1a,
  .focused-6870,
  .gradient_b2d8,
  .border-3e27,
  .chip-basic-1e4e {
    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 */
  .icon-9563,
  .shadow_inner_65bc,
  .link-warm-412f,
  .stale_a0bf,
  .tertiary_motion_f8bd {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .column-clean-e10e,
  .row-26c0,
  .mask_87df,
  .hard-66ff {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tag-a750,
  .smooth-1c46 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .alert_rough_8963,
  .table_clean_8c91,
  .highlight_full_49b9,
  .summary_large_5a22 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .panel-first-520c,
  .component_up_7e80,
  .wood-3777,
  .primary_steel_4801,
  .top_2c75,
  .heading_top_118a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .icon-9563,
  .shadow_inner_65bc,
  .stale_a0bf {
    max-width: none !important;
  }
  
  .full_2fcc {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .column-clean-e10e {
    font-size: 1.5rem !important;
  }
  
  .row-26c0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .steel_c513,
  .link-28d2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .mask_87df {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .new_36f9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .message-over-913a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .icon-9563,
  .stale_a0bf {
    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: 9786 */
.promo-block-p0 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.2;
}
