/* ============================================
   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 (.preview_8a1c) is a descendant of
   .active-under-a463 (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.module_mini_a22e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".section-cool-860c" 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-0e2a so it can't cause
   horizontal overflow anyway. */
.first-191d,
.outline_c4d6,
.accordion_new_60f2,
.white_43a4,
.picture-8abc,
.east-43ee,
.image-3ec8,
.tooltip_clean_ac0e,
.hard_81a0,
.dirty-9bef,
.description_059f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .chip-b23e {
    padding: 8px 0;
  }
  
  .search-c7fc img {
    height: 28px;
    width: auto;
  }
  
  .surface_inner_6142 {
    display: none !important;
  }
  
  .hot-2d89 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hot-2d89 svg {
    width: 14px;
    height: 14px;
  }
  
  .next_ad09 {
    padding: 6px;
  }
  
  .block_e4f8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .accordion_new_60f2,
  .outline_c4d6,
  .white_43a4,
  .picture-8abc,
  .dark-889d,
  .south-6e84,
  .focus_slow_6b52,
  .down-e6f5,
  .outer-6d4b,
  .pattern-9e43,
  .shadow_inner_3249 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .carousel_smooth_e8a0,
  .filter_purple_1653 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .red-f340,
  .aside-silver-3a24,
  .notification_over_5559,
  .secondary_slow_a997,
  .feature_black_a589,
  .sidebar-tall-c24b,
  .article-in-0c6b {
    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 */
  .highlight_50ea,
  .carousel_light_5bd1,
  .active_0a5c,
  .north_18c0,
  .nav-5b87 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .element-d99d,
  .active_4adc,
  .static_5653,
  .hero-bb7b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shade-outer-7cbe,
  .pattern_fast_2686 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .nav-37e2,
  .dirty-b8eb,
  .input_huge_dab4,
  .highlight_5eaf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .next_8862,
  .detail-fixed-287a,
  .tabs-slow-1a7e,
  .surface-middle-702e,
  .slider_0f06,
  .stale-13de {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .highlight_50ea,
  .carousel_light_5bd1,
  .north_18c0 {
    max-width: none !important;
  }
  
  .section-cool-860c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .element-d99d {
    font-size: 1.5rem !important;
  }
  
  .active_4adc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .last_dd98,
  .image-black-b1c0 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .static_5653 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .item_1705 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .slow_e724 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .highlight_50ea,
  .north_18c0 {
    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: 5a5f */
.promo-block-j0 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.2;
}
