/* ============================================
   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 (.pink_a7f4) is a descendant of
   .caption-tiny-5463 (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.out-90c8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".content-stone-e104" 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.soft-945d so it can't cause
   horizontal overflow anyway. */
.menu-next-8cb2,
.stale_fa46,
.disabled-24bb,
.primary-28d0,
.button-bright-e083,
.iron-d97d,
.breadcrumb-over-de07,
.aside-last-d966,
.feature-6e75,
.label-be44,
.wrapper_bb2d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .white_7a28 {
    padding: 8px 0;
  }
  
  .lower_a075 img {
    height: 28px;
    width: auto;
  }
  
  .iron-0428 {
    display: none !important;
  }
  
  .fixed_0679 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fixed_0679 svg {
    width: 14px;
    height: 14px;
  }
  
  .purple_e68f {
    padding: 6px;
  }
  
  .input-lower-4832 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .disabled-24bb,
  .stale_fa46,
  .primary-28d0,
  .button-bright-e083,
  .pattern_f88d,
  .image_8512,
  .shade_red_3663,
  .blue_3b82,
  .table-69a5,
  .border-south-a785,
  .middle-5f64,
  .current-12fd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .summary_635f,
  .link_bottom_29b0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .blue_edba,
  .wide_c6f3,
  .search-c544,
  .summary_4ba7,
  .large_8c3e,
  .card-top-9d27,
  .disabled_8716 {
    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 */
  .tooltip_pink_7cc6,
  .hover-c7f7,
  .slider-left-06aa,
  .popup-d891,
  .block-c1a6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .prev_0aeb,
  .outline-9355,
  .glass_371b,
  .new-6c33 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .focus-wood-ac89,
  .sort_fluid_d050 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .layout-gas-bae4,
  .liquid_cdb5,
  .purple_7009,
  .section-dc9b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .frame-blue-ba18,
  .slider-c2f4,
  .button-9e7c,
  .preview-8bc4,
  .sidebar_4296,
  .icon-eacd {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tooltip_pink_7cc6,
  .hover-c7f7,
  .popup-d891 {
    max-width: none !important;
  }
  
  .content-stone-e104 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .prev_0aeb {
    font-size: 1.5rem !important;
  }
  
  .outline-9355 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gradient_stone_0e3a,
  .complex_6b51 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .glass_371b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .border-7bb0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .banner_dark_02a9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tooltip_pink_7cc6,
  .popup-d891 {
    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: d119 */
.widget-item-k4 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.1;
}
