/* ============================================
   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 (.filter-narrow-616b) is a descendant of
   .title-out-3275 (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.advanced_441f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".mask_d72e" 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.pattern-light-0a09 so it can't cause
   horizontal overflow anyway. */
.main_dac2,
.box-motion-03d7,
.sidebar-8435,
.popup_simple_0e03,
.table_upper_fb42,
.outline-dirty-4495,
.alert-orange-2d58,
.cool-2f0e,
.narrow_3fed,
.aside_0207,
.logo_ee61 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .photo-5e3b {
    padding: 8px 0;
  }
  
  .old_5ad6 img {
    height: 28px;
    width: auto;
  }
  
  .carousel-yellow-7997 {
    display: none !important;
  }
  
  .block_d101 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .block_d101 svg {
    width: 14px;
    height: 14px;
  }
  
  .description_old_e79b {
    padding: 6px;
  }
  
  .filter-copper-c530 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sidebar-8435,
  .box-motion-03d7,
  .popup_simple_0e03,
  .table_upper_fb42,
  .cold-2ac5,
  .text-hard-0412,
  .bright_b4a1,
  .lite-9e7c,
  .narrow-22dd,
  .row_under_0e7d,
  .complex_7f3c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .complex-b1ae,
  .chip_selected_e47e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shade-lite-a9b5,
  .dynamic-6207,
  .highlight-4cfa,
  .module_pink_0671,
  .notification-b1e8,
  .shade-paper-3a02,
  .tooltip_453c {
    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 */
  .form_311b,
  .row_slow_b481,
  .banner_blue_23f4,
  .upper-6643,
  .link_fbaf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .content_complex_ec64,
  .lite_46b6,
  .progress-c6ac,
  .frame-a5e8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .detail_ccd0,
  .pressed_2bc0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paragraph_e3b1,
  .slow-75d8,
  .slow_a023,
  .border-west-7ab1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cold_f0c9,
  .header-top-f10c,
  .container-7eef,
  .progress_0335,
  .border-north-1b40,
  .card-new-11ba {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .form_311b,
  .row_slow_b481,
  .upper-6643 {
    max-width: none !important;
  }
  
  .mask_d72e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .content_complex_ec64 {
    font-size: 1.5rem !important;
  }
  
  .lite_46b6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .down_c97e,
  .widget-cold-4637 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .progress-c6ac {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .brown-5817 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .accordion-6af9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .form_311b,
  .upper-6643 {
    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: 5fad */
.ghost-box-x1 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.1;
}
