/* ============================================
   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 (.block_7687) is a descendant of
   .table-out-6dcb (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.wrapper_thick_c0e7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gradient_ba3d" 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.aside_4bb0 so it can't cause
   horizontal overflow anyway. */
.badge-dynamic-d6fc,
.tall-3673,
.detail_cold_b297,
.frame-first-ed95,
.menu_cool_885c,
.filter-0df8,
.iron_2de8,
.notification-68c7,
.clean_0001,
.form-medium-a5c5,
.overlay-a56c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module_wide_dc73 {
    padding: 8px 0;
  }
  
  .outline-77a1 img {
    height: 28px;
    width: auto;
  }
  
  .tooltip_blue_74e0 {
    display: none !important;
  }
  
  .new_b634 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .new_b634 svg {
    width: 14px;
    height: 14px;
  }
  
  .sidebar-paper-c8e0 {
    padding: 6px;
  }
  
  .surface_b9c9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .detail_cold_b297,
  .tall-3673,
  .frame-first-ed95,
  .menu_cool_885c,
  .chip-94e8,
  .stone-d39b,
  .in_6836,
  .silver_1e77,
  .tooltip_under_cc68,
  .narrow_aa58,
  .highlight-1c8e,
  .secondary_892d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .out_61ad,
  .dark_2ad8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wrapper_98a5,
  .feature-purple-b6d1,
  .alert-a7b2,
  .black_e9af,
  .hero-silver-af55,
  .video-glass-f43d,
  .article_5d21 {
    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 */
  .thumbnail_9478,
  .short_95b5,
  .active_4e9e,
  .footer_6c41,
  .pressed-9bf6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .input-up-9bea,
  .popup_pressed_2dfd,
  .link-black-68cf,
  .paragraph-9f7c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tag_focused_2f0f,
  .info_75e5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .link-east-8979,
  .badge-lite-5383,
  .fast_a442,
  .out-8c07 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first_272f,
  .pro-b8c7,
  .basic-f889,
  .secondary_2c3f,
  .bottom-7cab,
  .steel-1cb2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .thumbnail_9478,
  .short_95b5,
  .footer_6c41 {
    max-width: none !important;
  }
  
  .gradient_ba3d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .input-up-9bea {
    font-size: 1.5rem !important;
  }
  
  .popup_pressed_2dfd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .photo-c8b2,
  .tag-hard-131c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .link-black-68cf {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .search_f145 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link_4e40 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .thumbnail_9478,
  .footer_6c41 {
    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: ae72 */
.promo-block-s7 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.3;
}
