/* ============================================
   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 (.outline_dynamic_58f6) is a descendant of
   .filter-7f7d (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.panel-1349 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".grid-e757" 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.hovered-a118 so it can't cause
   horizontal overflow anyway. */
.column-4a0d,
.chip_fast_0e5d,
.shadow_422d,
.popup-dirty-d784,
.hot-1719,
.item-black-d029,
.avatar_15c0,
.yellow-27a2,
.video-outer-2080,
.article_e0ff,
.accordion-hard-ee91 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .plasma-f553 {
    padding: 8px 0;
  }
  
  .accordion-orange-e5dd img {
    height: 28px;
    width: auto;
  }
  
  .hot-969d {
    display: none !important;
  }
  
  .icon_fluid_8017 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .icon_fluid_8017 svg {
    width: 14px;
    height: 14px;
  }
  
  .accordion-ec1b {
    padding: 6px;
  }
  
  .medium_2eb4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shadow_422d,
  .chip_fast_0e5d,
  .popup-dirty-d784,
  .hot-1719,
  .in_73d0,
  .list_prev_f1e8,
  .sidebar-5653,
  .up-2ef7,
  .detail_warm_b8e7,
  .active-prev-6cb3,
  .list-0334 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .search-in-7c1e,
  .cold-c1db {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .chip_motion_3af7,
  .primary_north_dc80,
  .advanced-0f8d,
  .detail-ff08,
  .component_29d2,
  .hidden_pressed_130f,
  .primary-c53a {
    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 */
  .wood_7869,
  .primary_slow_6a59,
  .badge-e7aa,
  .table-motion-0a98,
  .huge-2d73 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .summary-thick-f89f,
  .wood_2317,
  .link_1e00,
  .dirty-6c5b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .stale_b6a6,
  .nav-gas-8ef8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .action-74b7,
  .last-6201,
  .new_c8c0,
  .gradient_37e2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .description_outer_c15f,
  .video-iron-936c,
  .paragraph-08db,
  .liquid_16a3,
  .mask-f51b,
  .column-8088 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .wood_7869,
  .primary_slow_6a59,
  .table-motion-0a98 {
    max-width: none !important;
  }
  
  .grid-e757 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .summary-thick-f89f {
    font-size: 1.5rem !important;
  }
  
  .wood_2317 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .sort-c111,
  .sidebar-2926 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .link_1e00 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .lite_87ea {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .disabled-e078 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .wood_7869,
  .table-motion-0a98 {
    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: 4ad5 */
.shadow-element-p2 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
