/* ============================================
   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 (.header-506c) is a descendant of
   .soft-177e (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.up_f1eb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".chip_active_5340" 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.top-b5cc so it can't cause
   horizontal overflow anyway. */
.active_8e87,
.feature_green_5c83,
.tag-static-45f6,
.search_f10a,
.action-1063,
.item-pro-5c94,
.hidden-light-025c,
.paragraph_1a3b,
.banner-outer-ad92,
.upper-1e35,
.shade-out-7165 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .over-cf7e {
    padding: 8px 0;
  }
  
  .avatar_e5d1 img {
    height: 28px;
    width: auto;
  }
  
  .element_56a6 {
    display: none !important;
  }
  
  .dim-9785 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dim-9785 svg {
    width: 14px;
    height: 14px;
  }
  
  .photo-cb0d {
    padding: 6px;
  }
  
  .liquid_6fb5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tag-static-45f6,
  .feature_green_5c83,
  .search_f10a,
  .action-1063,
  .active-aff0,
  .detail-fbde,
  .item-tall-b708,
  .current_5591,
  .filter-red-10aa,
  .tall-3754,
  .tertiary_east_e900,
  .next_ec70 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .table-hovered-296a,
  .content-6495 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .glass_a151,
  .frame-f061,
  .large-d350,
  .video-7685,
  .table_a03e,
  .block_fluid_6e03,
  .layout-pro-e374 {
    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 */
  .black_a173,
  .element-south-ca98,
  .message-82fd,
  .alert-stale-b0cc,
  .action-f827 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sort-focused-4370,
  .menu-easy-9648,
  .picture-left-f1f1,
  .basic-d95f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hover-9ab5,
  .dim-37be {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .card-west-6d2e,
  .surface-up-8839,
  .under-c03e,
  .backdrop-hovered-b50c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .surface_yellow_afe8,
  .slider_082c,
  .summary_advanced_b8a7,
  .panel_hovered_1fe8,
  .media-86ea,
  .yellow_44c1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .black_a173,
  .element-south-ca98,
  .alert-stale-b0cc {
    max-width: none !important;
  }
  
  .chip_active_5340 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sort-focused-4370 {
    font-size: 1.5rem !important;
  }
  
  .menu-easy-9648 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .aside-dirty-dabd,
  .box-c5c6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture-left-f1f1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .focused_52e0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .image-8ece {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .black_a173,
  .alert-stale-b0cc {
    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: f0c6 */
.promo-block-l4 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
