/* ============================================
   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 (.card-up-3cd9) is a descendant of
   .grid_last_b482 (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.picture-pro-ded6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".mask-hot-39b2" 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.stone-28e9 so it can't cause
   horizontal overflow anyway. */
.fluid_ff09,
.input-next-afd8,
.shadow-e26e,
.notice_stale_e6bd,
.search_stale_3d6a,
.shade-8883,
.alert-8aaa,
.bottom_f9e3,
.gradient_4f08,
.outline_over_fd5f,
.primary-5675 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tabs-warm-860d {
    padding: 8px 0;
  }
  
  .plasma_62d3 img {
    height: 28px;
    width: auto;
  }
  
  .popup-b598 {
    display: none !important;
  }
  
  .info-5818 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .info-5818 svg {
    width: 14px;
    height: 14px;
  }
  
  .primary_1c0f {
    padding: 6px;
  }
  
  .dim_fb5e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shadow-e26e,
  .input-next-afd8,
  .notice_stale_e6bd,
  .search_stale_3d6a,
  .notice-middle-3cd9,
  .frame_motion_f587,
  .center_b3d4,
  .image-top-8b68,
  .overlay_huge_169d,
  .light_90f7,
  .cold-5255,
  .pattern-d35b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .popup-01a5,
  .status_2cb5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .gas-47c4,
  .last-8a5f,
  .logo-2a01,
  .middle-b789,
  .pagination_cold_0144,
  .video-steel-8c59,
  .form_stale_2132 {
    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 */
  .medium-806b,
  .tag_wide_c610,
  .texture_93fd,
  .photo-focused-9ebe,
  .hero_5ba0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .footer-7403,
  .rough_9a8d,
  .video_lite_df70,
  .center_0c3f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .feature_8b80,
  .photo-e035 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .status-smooth-ee7d,
  .action_d081,
  .disabled_old_f9f7,
  .card-f6b4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .logo-smooth-827a,
  .static_3f08,
  .dark-97c6,
  .card-static-f40c,
  .photo_dirty_e35f,
  .inner-c162 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .medium-806b,
  .tag_wide_c610,
  .photo-focused-9ebe {
    max-width: none !important;
  }
  
  .mask-hot-39b2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .footer-7403 {
    font-size: 1.5rem !important;
  }
  
  .rough_9a8d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .header-f181,
  .logo_a053 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .video_lite_df70 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .primary_3fb5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .content_d0cc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .medium-806b,
  .photo-focused-9ebe {
    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: 4bf4 */
.shadow-element-z5 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
