/* ============================================
   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 (.status_right_5487) is a descendant of
   .center_ea76 (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.search_lower_6517 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".primary-upper-b755" 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.purple_3ddf so it can't cause
   horizontal overflow anyway. */
.detail_paper_e607,
.paper_869b,
.pagination_last_a62b,
.solid_aec9,
.active-6b8b,
.item_tiny_bff5,
.bottom_2445,
.panel-9894,
.static-b0e4,
.brown-9c42,
.paragraph_upper_90f5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .container_5978 {
    padding: 8px 0;
  }
  
  .shadow-41e6 img {
    height: 28px;
    width: auto;
  }
  
  .last_5b5a {
    display: none !important;
  }
  
  .outline_b9b1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .outline_b9b1 svg {
    width: 14px;
    height: 14px;
  }
  
  .hidden-hard-4d8f {
    padding: 6px;
  }
  
  .full_d425 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pagination_last_a62b,
  .paper_869b,
  .solid_aec9,
  .active-6b8b,
  .info-medium-f5f6,
  .chip_easy_6885,
  .background-e95b,
  .yellow_1627,
  .form_ce71,
  .steel-2877,
  .hidden_dirty_858a,
  .bottom_3ed2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gallery_thick_f62b,
  .inner_1013 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .bright_a1c5,
  .photo_dirty_284c,
  .popup-1a27,
  .header_outer_479c,
  .thick_52e4,
  .active_73f0,
  .table_full_d7bb {
    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 */
  .hover-24c7,
  .main_inner_bf1a,
  .accordion-d418,
  .nav-over-944d,
  .module_2372 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hovered_a286,
  .search_brown_4209,
  .filter-1fa4,
  .highlight-large-3ad0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .solid-da57,
  .component_lower_b0d4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pagination-93c8,
  .center-d86a,
  .element-a673,
  .under-ff25 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sort-0d29,
  .badge-bright-7b83,
  .tag-iron-c114,
  .soft_6aad,
  .input-d367,
  .main_last_4f5f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hover-24c7,
  .main_inner_bf1a,
  .nav-over-944d {
    max-width: none !important;
  }
  
  .primary-upper-b755 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hovered_a286 {
    font-size: 1.5rem !important;
  }
  
  .search_brown_4209 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pattern_hard_fc12,
  .wrapper-3a45 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .filter-1fa4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .title-a0f7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .menu-slow-7520 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hover-24c7,
  .nav-over-944d {
    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: 7a9a */
.ghost-box-r2 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.3;
}
