/* ============================================
   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 (.container-4c4c) is a descendant of
   .frame_lower_c7f1 (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.border-advanced-bec2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".active_130b" 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.background_smooth_5833 so it can't cause
   horizontal overflow anyway. */
.pattern_advanced_1a5c,
.detail_purple_61ae,
.component-65e8,
.bright_8585,
.dim-bf34,
.media_460a,
.logo-71bf,
.first_3094,
.nav_solid_a6ff,
.last_4abd,
.upper-52f9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .iron_73c4 {
    padding: 8px 0;
  }
  
  .hard_5855 img {
    height: 28px;
    width: auto;
  }
  
  .info-5abc {
    display: none !important;
  }
  
  .progress_8883 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .progress_8883 svg {
    width: 14px;
    height: 14px;
  }
  
  .dynamic_5ca8 {
    padding: 6px;
  }
  
  .overlay_b2f5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .component-65e8,
  .detail_purple_61ae,
  .bright_8585,
  .dim-bf34,
  .last-0ac6,
  .out-8592,
  .table-5560,
  .slow_34bf,
  .banner-dirty-4e59,
  .info_a10e,
  .filter_c503,
  .plasma-90b8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .popup-ae9a,
  .texture-old-e94c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .liquid_b4f6,
  .pagination-e5df,
  .hard_412e,
  .disabled_5747,
  .popup-afc0,
  .short-77e5,
  .description_paper_7b95 {
    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 */
  .info_iron_0b4f,
  .section-e459,
  .popup_f041,
  .article_fb74,
  .middle-7ec7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .column-32d4,
  .cold_320c,
  .surface-dd01,
  .primary-old-ee7d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .aside_42bb,
  .carousel-1e30 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .huge_b570,
  .yellow_bebf,
  .glass_3876,
  .column_under_0773 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .new-748e,
  .east_db1a,
  .media-static-bde5,
  .widget_old_3542,
  .glass-bdad,
  .short_0d96 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .info_iron_0b4f,
  .section-e459,
  .article_fb74 {
    max-width: none !important;
  }
  
  .active_130b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .column-32d4 {
    font-size: 1.5rem !important;
  }
  
  .cold_320c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .primary_fast_1782,
  .wrapper-7601 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .surface-dd01 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .preview-e90e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .form_next_47f6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .info_iron_0b4f,
  .article_fb74 {
    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: a87a */
.phantom-card-j9 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.2;
}
