/* ============================================
   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 (.info-stone-5d9a) is a descendant of
   .popup-efdf (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.block_352d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".preview_plasma_ae1b" 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.stale-8a6f so it can't cause
   horizontal overflow anyway. */
.smooth-f2a9,
.focus-light-5ca6,
.banner-pro-72db,
.avatar_tall_a053,
.button-db04,
.badge_center_d507,
.image-3c0d,
.dim_479d,
.filter-c6ae,
.header-fe15,
.tall_a5cc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .selected_dbcd {
    padding: 8px 0;
  }
  
  .secondary-over-f7ef img {
    height: 28px;
    width: auto;
  }
  
  .gradient-0337 {
    display: none !important;
  }
  
  .notification-cf47 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notification-cf47 svg {
    width: 14px;
    height: 14px;
  }
  
  .border_e8fa {
    padding: 6px;
  }
  
  .element_786b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner-pro-72db,
  .focus-light-5ca6,
  .avatar_tall_a053,
  .button-db04,
  .shade_a55d,
  .smooth-6ec5,
  .brown_0552,
  .easy_7699,
  .overlay_up_5241,
  .heading-235e,
  .text-right-774d,
  .menu_0696 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pink_800c,
  .search_b600 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .input-clean-4497,
  .banner-hot-9fdc,
  .item_3ab2,
  .box-focused-75c9,
  .accordion-7c39,
  .outer_06d7,
  .new_52e8 {
    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 */
  .simple-0552,
  .image-85ca,
  .basic-1980,
  .pressed-80b2,
  .narrow-0753 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .info-fa80,
  .button-40f7,
  .hidden-602e,
  .hero-87e7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .up-8172,
  .shade-743f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .silver-651c,
  .icon-140f,
  .layout_liquid_0d52,
  .main-8985 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .active-8362,
  .sidebar_lower_1e9f,
  .main_9330,
  .hover-narrow-1082,
  .block-slow-22c3,
  .preview_ffc8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .simple-0552,
  .image-85ca,
  .pressed-80b2 {
    max-width: none !important;
  }
  
  .preview_plasma_ae1b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .info-fa80 {
    font-size: 1.5rem !important;
  }
  
  .button-40f7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .item_hard_8bc2,
  .section-fresh-cd26 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hidden-602e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .menu-copper-9cd6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .shade-active-61b0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .simple-0552,
  .pressed-80b2 {
    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: 315d */
.phantom-card-w8 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
