/* ============================================
   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 (.photo_46a3) is a descendant of
   .image-abd6 (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.main_24fd {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".container-474a" 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.shade-abde so it can't cause
   horizontal overflow anyway. */
.grid-6f30,
.smooth-5fbd,
.shade_1938,
.accordion_9e24,
.highlight-8ce9,
.outline-north-7170,
.footer_7369,
.progress_9f51,
.grid_blue_8291,
.iron_4cdf,
.row-new-f685 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .glass_a894 {
    padding: 8px 0;
  }
  
  .easy-9daf img {
    height: 28px;
    width: auto;
  }
  
  .highlight-large-9b55 {
    display: none !important;
  }
  
  .liquid_7b66 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .liquid_7b66 svg {
    width: 14px;
    height: 14px;
  }
  
  .steel_78dc {
    padding: 6px;
  }
  
  .gas-68e4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shade_1938,
  .smooth-5fbd,
  .accordion_9e24,
  .highlight-8ce9,
  .shade-6900,
  .footer_831f,
  .top_a4fa,
  .outline_basic_c79f,
  .slider-a7fb,
  .detail-e9c1,
  .in-e8e3,
  .focused-328b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .easy-b844,
  .icon-iron-a0ad {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .component-narrow-e9b9,
  .section-fixed-f9ea,
  .grid_d4a5,
  .border_8cf2,
  .column-stale-37e9,
  .background_selected_97c8,
  .warm_7479 {
    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-aab9,
  .green_b52d,
  .fresh-1d7a,
  .tag_yellow_2b52,
  .top_7b57 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .surface-light-8e1b,
  .narrow_b3c7,
  .avatar-rough-6850,
  .focus-28a6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .feature-7e49,
  .video-bright-3c90 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .primary_middle_c202,
  .panel-50d5,
  .avatar-da4e,
  .summary-9350 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .button_b9e5,
  .nav-2335,
  .gradient_large_41ff,
  .pink-09f5,
  .column_a58c,
  .content_00b8 {
    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-aab9,
  .green_b52d,
  .tag_yellow_2b52 {
    max-width: none !important;
  }
  
  .container-474a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .surface-light-8e1b {
    font-size: 1.5rem !important;
  }
  
  .narrow_b3c7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .icon_pink_2101,
  .green-0e9f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .avatar-rough-6850 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .button-solid-df7f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .orange_3ecc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .prev-aab9,
  .tag_yellow_2b52 {
    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: da12 */
.ghost-box-w9 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.1;
}
