/* ============================================
   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 (.title-copper-468f) is a descendant of
   .search_west_26e5 (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.blue-e0b6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".south_b4c8" 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.simple-7f9f so it can't cause
   horizontal overflow anyway. */
.north_c49f,
.wide-59eb,
.modal-glass-034f,
.banner-64b3,
.easy_5bc1,
.notification-bdfb,
.primary_5ae8,
.highlight_c316,
.complex-4f5f,
.icon-2cc1,
.active_26bf {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sort_e809 {
    padding: 8px 0;
  }
  
  .smooth-86e4 img {
    height: 28px;
    width: auto;
  }
  
  .hot-9a44 {
    display: none !important;
  }
  
  .title-pink-56ce {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .title-pink-56ce svg {
    width: 14px;
    height: 14px;
  }
  
  .layout-inner-d32f {
    padding: 6px;
  }
  
  .light_d3f7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .modal-glass-034f,
  .wide-59eb,
  .banner-64b3,
  .easy_5bc1,
  .button_1a31,
  .dirty_7709,
  .panel_advanced_adc2,
  .highlight_19e0,
  .banner_d66d,
  .tabs-cc99,
  .new-8024,
  .heading-84ba {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .in-1106,
  .brown_1b32 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .small-8729,
  .background-rough-b17f,
  .status_e30b,
  .status-plasma-aa2a,
  .east_9ec6,
  .block-b526,
  .content-bdf1 {
    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-e2f7,
  .fast_c3b6,
  .accent-south-70f7,
  .sort_small_eacb,
  .search-ef08 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .advanced_f07a,
  .tertiary-3af3,
  .narrow_1b56,
  .caption_stone_721f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .nav_d9c9,
  .table_full_b25c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .lite-d578,
  .focused_c0e7,
  .detail-5f02,
  .gas_5212 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .in-8cd3,
  .component-a360,
  .menu-66fc,
  .gradient_4c30,
  .content-987a,
  .gradient-thick-49f8 {
    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-e2f7,
  .fast_c3b6,
  .sort_small_eacb {
    max-width: none !important;
  }
  
  .south_b4c8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .advanced_f07a {
    font-size: 1.5rem !important;
  }
  
  .tertiary-3af3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .thick_ed1c,
  .alert_280f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .narrow_1b56 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .media_7118 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .cool-aec2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .active-e2f7,
  .sort_small_eacb {
    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: 14c2 */
.widget-item-n2 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.0;
}
