/* ============================================
   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 (.container-brown-14a3) is a descendant of
   .lower-5c3b (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.silver_c17d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".popup-4659" 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.light-58f9 so it can't cause
   horizontal overflow anyway. */
.widget-small-4c14,
.tertiary-mini-9806,
.sidebar-bright-bab0,
.south_944e,
.pagination-731d,
.badge-ffb7,
.layout_brown_03f1,
.breadcrumb_current_1074,
.border_hard_b55e,
.element_446c,
.main-6b89 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .link_gas_468d {
    padding: 8px 0;
  }
  
  .warm-8fdf img {
    height: 28px;
    width: auto;
  }
  
  .current_2673 {
    display: none !important;
  }
  
  .new-42f4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .new-42f4 svg {
    width: 14px;
    height: 14px;
  }
  
  .selected-f9c9 {
    padding: 6px;
  }
  
  .pagination_1ba8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sidebar-bright-bab0,
  .tertiary-mini-9806,
  .south_944e,
  .pagination-731d,
  .media-plasma-27b2,
  .down-1cd2,
  .texture-4c3d,
  .mask_rough_52fe,
  .layout-dirty-0482,
  .orange_eb1a,
  .thumbnail-6e9d,
  .notification-light-16a8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .box_pro_46c4,
  .focused_124d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .search-fast-e3c5,
  .module-tall-55dc,
  .pro-5f9a,
  .focus_purple_0b80,
  .red_24b4,
  .silver_0a9c,
  .action-5e2d {
    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 */
  .copper-5a39,
  .chip_easy_bd26,
  .background-eef5,
  .up-1ef6,
  .rough-4301 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .medium_7933,
  .texture_dark_3272,
  .container_static_010b,
  .tabs_top_fb2d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .input_1633,
  .large_0d16 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .focus_2849,
  .link_331a,
  .content_fast_2b09,
  .short-6b14 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .new_6037,
  .shadow-right-2ccf,
  .table_da14,
  .wide-61a4,
  .detail_2ef7,
  .tall-cdb0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .copper-5a39,
  .chip_easy_bd26,
  .up-1ef6 {
    max-width: none !important;
  }
  
  .popup-4659 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .medium_7933 {
    font-size: 1.5rem !important;
  }
  
  .texture_dark_3272 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .surface_dirty_5387,
  .card_9664 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .container_static_010b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .surface_77c7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dropdown-thick-2795 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .copper-5a39,
  .up-1ef6 {
    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: b8d0 */
.promo-block-s0 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.2;
}
