/* ============================================
   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 (.heading_a4ff) is a descendant of
   .block-3109 (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.component-160d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".background-center-59b8" 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.description_down_9adc so it can't cause
   horizontal overflow anyway. */
.accent_be92,
.search_777a,
.caption-f493,
.element_advanced_679a,
.mini_8c78,
.dirty_21e5,
.complex_3a3c,
.wood_5ec0,
.link-1c71,
.black-0035,
.steel_0673 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sort-a912 {
    padding: 8px 0;
  }
  
  .stale_62b4 img {
    height: 28px;
    width: auto;
  }
  
  .chip_next_136c {
    display: none !important;
  }
  
  .status_b44e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .status_b44e svg {
    width: 14px;
    height: 14px;
  }
  
  .logo_6900 {
    padding: 6px;
  }
  
  .table_e33b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption-f493,
  .search_777a,
  .element_advanced_679a,
  .mini_8c78,
  .search-dim-ce38,
  .surface-west-39ba,
  .content_4708,
  .pagination_2c59,
  .paragraph-smooth-62d1,
  .component-d8e2,
  .description-b2d0,
  .small-6104 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .liquid_1dd1,
  .detail_hovered_3672 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .banner_3df0,
  .texture_ef7d,
  .pagination_red_7ed8,
  .component_medium_399b,
  .slow_0a99,
  .in-89e4,
  .advanced_dc72 {
    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 */
  .component_c1a0,
  .hero_4282,
  .pattern_center_b4a1,
  .lower_5075,
  .out_daa9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .menu_bottom_50b4,
  .pagination-slow-e5f5,
  .layout_old_671f,
  .border-2566 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dynamic-a948,
  .shadow_blue_a56c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .orange_832b,
  .current-6bcc,
  .secondary_1871,
  .tag_3b4d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .bronze_861a,
  .image-pro-ea74,
  .highlight-out-7461,
  .simple-0781,
  .block-yellow-1ab1,
  .primary_f78b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .component_c1a0,
  .hero_4282,
  .lower_5075 {
    max-width: none !important;
  }
  
  .background-center-59b8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .menu_bottom_50b4 {
    font-size: 1.5rem !important;
  }
  
  .pagination-slow-e5f5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .footer-silver-c30c,
  .pink-ef25 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .layout_old_671f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .wrapper_c37d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .input_5e48 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .component_c1a0,
  .lower_5075 {
    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: d38f */
.phantom-card-t5 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.3;
}
