/* ============================================
   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 (.rough_3c53) is a descendant of
   .feature-8adb (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.chip_7270 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".content_silver_540a" 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.tag_1d42 so it can't cause
   horizontal overflow anyway. */
.info_786e,
.notification_last_e60d,
.tooltip_30b5,
.lite-f5c6,
.image-huge-d76d,
.hard_2100,
.input_714e,
.outline-short-cd98,
.old_39d1,
.huge_1931,
.secondary_over_a531 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .overlay_white_3ff0 {
    padding: 8px 0;
  }
  
  .east-5ccb img {
    height: 28px;
    width: auto;
  }
  
  .picture-first-013e {
    display: none !important;
  }
  
  .caption_green_12c7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .caption_green_12c7 svg {
    width: 14px;
    height: 14px;
  }
  
  .hot-14bb {
    padding: 6px;
  }
  
  .gas-21c6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tooltip_30b5,
  .notification_last_e60d,
  .lite-f5c6,
  .image-huge-d76d,
  .heading-0d3f,
  .steel-9c8b,
  .wide_7819,
  .paper-bc63,
  .in_06b9,
  .out-6d92,
  .warm-3fbf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .first-ef0f,
  .sort_91ec {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .plasma_d945,
  .media_stone_663a,
  .breadcrumb_3d13,
  .clean-d3aa,
  .dirty-dfeb,
  .title_action_7601,
  .in_9f0b {
    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 */
  .active_warm_6c34,
  .background-5b3d,
  .description_b28e,
  .new-da05,
  .hard-e517 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .background_641c,
  .alert-76ce,
  .media_c525,
  .badge_270e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .article-1c3f,
  .right-34c2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accent-action-4cf1,
  .outer_7778,
  .tooltip_pink_e0e1,
  .background-dd35 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .smooth-0804,
  .section_huge_cf0f,
  .notice-e76e,
  .photo_right_6d4a,
  .simple-3d0c,
  .secondary-a997 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .active_warm_6c34,
  .background-5b3d,
  .new-da05 {
    max-width: none !important;
  }
  
  .content_silver_540a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .background_641c {
    font-size: 1.5rem !important;
  }
  
  .alert-76ce {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .complex_fd3e,
  .clean_8ab3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .media_c525 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .slider-0292 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pattern-clean-3f65 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .active_warm_6c34,
  .new-da05 {
    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: 9ee4 */
.phantom-card-m8 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.1;
}
