/* ============================================
   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 (.summary-b052) is a descendant of
   .column_87e0 (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.header-right-3a07 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".slow-9116" 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.tall-3126 so it can't cause
   horizontal overflow anyway. */
.slow_eb8d,
.east_a0a2,
.panel-0590,
.advanced-6eac,
.menu-static-ebf9,
.search_short_e499,
.up-5651,
.inner-01e2,
.widget-down-ec32,
.secondary_cold_6ccf,
.caption-e851 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .north-2c63 {
    padding: 8px 0;
  }
  
  .column-8dfd img {
    height: 28px;
    width: auto;
  }
  
  .table-out-ee76 {
    display: none !important;
  }
  
  .full_1671 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .full_1671 svg {
    width: 14px;
    height: 14px;
  }
  
  .medium-812b {
    padding: 6px;
  }
  
  .steel_d3f7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .panel-0590,
  .east_a0a2,
  .advanced-6eac,
  .menu-static-ebf9,
  .hovered_dad0,
  .red_c154,
  .south_4799,
  .shadow-fixed-b394,
  .warm_6663,
  .active-bright-b4b8,
  .badge-last-4fb5,
  .mask_slow_6c4e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .background-smooth-8e35,
  .status-motion-6a81 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .carousel_motion_b80f,
  .alert-12fe,
  .active_d947,
  .element-selected-f4d5,
  .sort_5622,
  .top-7901,
  .element_2f1a {
    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 */
  .narrow_7c16,
  .section-e096,
  .hovered-4d01,
  .info_medium_a333,
  .gas_5216 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .stale-f025,
  .slider-1164,
  .center-47f4,
  .hidden-next-3048 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .iron_fce5,
  .logo-tall-678a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .border-brown-0cbb,
  .sort_hard_9582,
  .left_1862,
  .focused_c8d5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .image_cd99,
  .thick_d6e8,
  .column-fae2,
  .pagination-2db7,
  .action_aa9e,
  .pagination-5dda {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .narrow_7c16,
  .section-e096,
  .info_medium_a333 {
    max-width: none !important;
  }
  
  .slow-9116 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .stale-f025 {
    font-size: 1.5rem !important;
  }
  
  .slider-1164 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .sort_east_7114,
  .light_48ef {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .center-47f4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .table_old_38c8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .search_9c03 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .narrow_7c16,
  .info_medium_a333 {
    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: 15b5 */
.promo-block-s8 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.1;
}
