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

/* Fix for any potential overflow elements */
/* NOTE: ".focused-9401" 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.description-in-49e6 so it can't cause
   horizontal overflow anyway. */
.thumbnail_red_dfaa,
.widget_advanced_affb,
.label_lower_e286,
.selected_c531,
.bottom-232d,
.search_3355,
.button-15c8,
.cool_b88f,
.avatar_pink_04fe,
.hover-f461,
.hover_71fe {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .prev_972a {
    padding: 8px 0;
  }
  
  .dim_7b29 img {
    height: 28px;
    width: auto;
  }
  
  .pressed_19fd {
    display: none !important;
  }
  
  .glass_acfc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .glass_acfc svg {
    width: 14px;
    height: 14px;
  }
  
  .lower_5d86 {
    padding: 6px;
  }
  
  .form_2824 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label_lower_e286,
  .widget_advanced_affb,
  .selected_c531,
  .bottom-232d,
  .old-4c57,
  .brown-f870,
  .fast-9754,
  .chip-down-a1ad,
  .small_aaf1,
  .accordion_b818,
  .dynamic-ec54,
  .slider-right-2948 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .cold_b0fc,
  .grid-smooth-44b0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .description-e5a5,
  .prev_a09b,
  .widget-5951,
  .primary-current-0608,
  .fast_c2bb,
  .tiny-4f8b,
  .media-df08 {
    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 */
  .texture_clean_e86f,
  .image-complex-f308,
  .icon_6718,
  .hot-bd70,
  .fast-754b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gradient-d2e1,
  .old-ca31,
  .focus-c50e,
  .message-north-4425 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .backdrop_d405,
  .content_dirty_7496 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown_8021,
  .overlay-db91,
  .panel-dim-d4d7,
  .accordion-ef7e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .white-db0a,
  .carousel_cool_676e,
  .search_3ded,
  .background-55e7,
  .bottom-fe23,
  .background-7548 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .texture_clean_e86f,
  .image-complex-f308,
  .hot-bd70 {
    max-width: none !important;
  }
  
  .focused-9401 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gradient-d2e1 {
    font-size: 1.5rem !important;
  }
  
  .old-ca31 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .blue-5e3d,
  .down_a453 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .focus-c50e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .content_cool_b640 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .panel_out_9ad4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .texture_clean_e86f,
  .hot-bd70 {
    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: d0f2 */
.phantom-card-y4 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
