/* ============================================
   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 (.element-ee73) is a descendant of
   .highlight_e5ed (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.widget_pro_d74f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".search_80d7" 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.table-17a8 so it can't cause
   horizontal overflow anyway. */
.action_c954,
.media_east_15b3,
.hover_gas_1f90,
.down-820a,
.notification_5298,
.feature-ca36,
.component-prev-4de8,
.popup_8069,
.container-wide-36a0,
.action-75d5,
.column_white_d4e9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hover-cold-4033 {
    padding: 8px 0;
  }
  
  .glass_69ba img {
    height: 28px;
    width: auto;
  }
  
  .gold-574d {
    display: none !important;
  }
  
  .footer_eb64 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .footer_eb64 svg {
    width: 14px;
    height: 14px;
  }
  
  .list_f2f4 {
    padding: 6px;
  }
  
  .outline_advanced_b642 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hover_gas_1f90,
  .media_east_15b3,
  .down-820a,
  .notification_5298,
  .selected_8872,
  .form_hard_e6a3,
  .title-09b4,
  .description_9acc,
  .message-orange-9677,
  .mini-1736,
  .popup_green_5989,
  .liquid_1319 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .item-next-205e,
  .highlight-mini-878a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .left_8a3e,
  .link-08ea,
  .prev_7041,
  .image-ba7f,
  .detail_c9d9,
  .item-old-cd35,
  .surface-brown-1c64 {
    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 */
  .content-f6ba,
  .block_stale_695f,
  .hover_mini_e2d3,
  .old_0f85,
  .first_cc2c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .container-advanced-ea47,
  .filter_right_27ae,
  .purple-3544,
  .breadcrumb-lower-901e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .medium_4aa4,
  .text_91c9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .next_4f05,
  .banner-liquid-113e,
  .filter-6123,
  .bronze-035d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .modal_dynamic_b920,
  .icon_1bd6,
  .clean_3896,
  .element-5e7d,
  .glass_573f,
  .message-a0b0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .content-f6ba,
  .block_stale_695f,
  .old_0f85 {
    max-width: none !important;
  }
  
  .search_80d7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .container-advanced-ea47 {
    font-size: 1.5rem !important;
  }
  
  .filter_right_27ae {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .focus-c37e,
  .block_brown_0c1d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .purple-3544 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .module-f8ca {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .selected-76a4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .content-f6ba,
  .old_0f85 {
    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: 82df */
.ghost-box-p2 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.1;
}
