/* ============================================
   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 (.active_087f) is a descendant of
   .highlight-69cd (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.filter_1e28 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tag-3f17" 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.paragraph-b423 so it can't cause
   horizontal overflow anyway. */
.plasma-3e32,
.huge-bef1,
.fresh-69d7,
.status_advanced_4519,
.footer_advanced_1a6f,
.static-6ec0,
.sidebar-5bc2,
.picture_up_76c4,
.progress_425d,
.disabled_motion_9902,
.large-1dbd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .item-narrow-405b {
    padding: 8px 0;
  }
  
  .logo_0e4f img {
    height: 28px;
    width: auto;
  }
  
  .box_hot_fa66 {
    display: none !important;
  }
  
  .disabled_5624 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .disabled_5624 svg {
    width: 14px;
    height: 14px;
  }
  
  .banner_light_0ee8 {
    padding: 6px;
  }
  
  .header-7f7a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .fresh-69d7,
  .huge-bef1,
  .status_advanced_4519,
  .footer_advanced_1a6f,
  .light-abcb,
  .huge_5f91,
  .aside_69dc,
  .fresh-5970,
  .secondary-left-bcfc,
  .shade-8913,
  .border_d174,
  .focused_379a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .east_df5f,
  .dirty-eb80 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item_ae9c,
  .link-basic-adc6,
  .rough-4be1,
  .gradient_dcab,
  .row-dc76,
  .disabled_bright_e36f,
  .footer-1c16 {
    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 */
  .left-7c93,
  .border-hovered-27c1,
  .form-narrow-32ec,
  .pattern-d23e,
  .tag-2f24 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .panel_small_8d31,
  .table_428f,
  .pattern-8e76,
  .detail_paper_9b54 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .pagination_39e5,
  .highlight_bronze_db82 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .media_dim_ede2,
  .secondary-3cee,
  .tertiary_1ffb,
  .banner-4767 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gallery-small-f492,
  .heading_selected_af4d,
  .wood-682e,
  .gas-2131,
  .video_paper_16f5,
  .dirty-4c7a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .left-7c93,
  .border-hovered-27c1,
  .pattern-d23e {
    max-width: none !important;
  }
  
  .tag-3f17 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .panel_small_8d31 {
    font-size: 1.5rem !important;
  }
  
  .table_428f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .main-hovered-5d16,
  .action-d8cc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .pattern-8e76 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .next-38c5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .static_af66 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .left-7c93,
  .pattern-d23e {
    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: edd3 */
.promo-block-o3 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
