/* ============================================
   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 (.bright_8940) is a descendant of
   .yellow-0117 (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.left_1d0e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".layout_e7ad" 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.narrow_f6f9 so it can't cause
   horizontal overflow anyway. */
.alert_complex_4095,
.gradient-2b3b,
.wrapper_old_442a,
.detail_18d7,
.feature_ee82,
.shadow-03db,
.plasma_42a5,
.hidden_fast_1d21,
.overlay_steel_d404,
.hidden_37e7,
.east_85b1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .photo-b47a {
    padding: 8px 0;
  }
  
  .feature-a766 img {
    height: 28px;
    width: auto;
  }
  
  .modal_wide_aad2 {
    display: none !important;
  }
  
  .fast-cd8f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fast-cd8f svg {
    width: 14px;
    height: 14px;
  }
  
  .wrapper-paper-09b9 {
    padding: 6px;
  }
  
  .nav-north-ba2d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wrapper_old_442a,
  .gradient-2b3b,
  .detail_18d7,
  .feature_ee82,
  .active_copper_9979,
  .header_4f2e,
  .current-483d,
  .badge-d66f,
  .paragraph_a749,
  .gold-37b9,
  .plasma_0038,
  .pagination-left-ba0b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .background-f628,
  .banner-e658 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wrapper-ce16,
  .logo-f29b,
  .badge-077f,
  .short_2186,
  .label_f010,
  .soft-14ef,
  .shadow_4bfc {
    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 */
  .rough_02eb,
  .bronze-d289,
  .block-15e5,
  .action_874b,
  .plasma_e439 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .up-e07e,
  .outline-hard-192c,
  .layout-center-aa0c,
  .silver-2d43 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dim_d944,
  .static-829e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .photo-db63,
  .sort_ceaf,
  .notice_dcaf,
  .gradient_628a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .item_glass_6773,
  .secondary_1bd2,
  .fresh-b972,
  .paragraph_stale_270f,
  .form_8cc0,
  .box-98c5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .rough_02eb,
  .bronze-d289,
  .action_874b {
    max-width: none !important;
  }
  
  .layout_e7ad {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .up-e07e {
    font-size: 1.5rem !important;
  }
  
  .outline-hard-192c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .carousel_2a19,
  .pressed_3f60 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .layout-center-aa0c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .table-0c5d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .clean-adfd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .rough_02eb,
  .action_874b {
    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: 2cd3 */
.shadow-element-t2 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.0;
}
