/* ============================================
   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 (.tertiary-93f2) is a descendant of
   .tabs-warm-e2fc (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.sort_outer_9fba {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".overlay-593d" 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.text_brown_2fa5 so it can't cause
   horizontal overflow anyway. */
.liquid_1cb4,
.thick_112c,
.medium-1b91,
.label-green-ce22,
.white-7081,
.shadow-rough-4918,
.summary_inner_5e94,
.summary-0559,
.layout_gold_4ae0,
.blue-3bf1,
.info_aa19 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .avatar-1180 {
    padding: 8px 0;
  }
  
  .media_7665 img {
    height: 28px;
    width: auto;
  }
  
  .text-8210 {
    display: none !important;
  }
  
  .dropdown_small_66d6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dropdown_small_66d6 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter_thick_cb6b {
    padding: 6px;
  }
  
  .simple-4334 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .medium-1b91,
  .thick_112c,
  .label-green-ce22,
  .white-7081,
  .modal-3042,
  .modal-hot-dfbb,
  .message-f458,
  .filter-old-eaf2,
  .top_6b55,
  .black-6f1e,
  .progress-f5d8,
  .narrow-6476 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .element-bbf2,
  .hidden-e15e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fresh_159d,
  .complex_5d6b,
  .article-full-8ec5,
  .logo-cd28,
  .dark-17a1,
  .feature_inner_323f,
  .chip-red-f437 {
    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 */
  .prev_6dc3,
  .border_static_aa5d,
  .icon-3776,
  .sidebar_5e12,
  .section_39b4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sort_c8cb,
  .lite_0916,
  .active_0b05,
  .basic-61d5 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .clean_f0ee,
  .label-tall-60cf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .caption-de83,
  .shadow_038f,
  .text-8770,
  .video-silver-aa35 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .breadcrumb-b651,
  .carousel_facf,
  .box_0c7c,
  .layout-e241,
  .rough-0245,
  .prev_8e26 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .prev_6dc3,
  .border_static_aa5d,
  .sidebar_5e12 {
    max-width: none !important;
  }
  
  .overlay-593d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sort_c8cb {
    font-size: 1.5rem !important;
  }
  
  .lite_0916 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .section_blue_63c2,
  .content-ae1e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active_0b05 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .module-0286 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .text-af5b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .prev_6dc3,
  .sidebar_5e12 {
    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: a3eb */
.promo-block-d3 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.0;
}
