/* ============================================
   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 (.logo_2236) is a descendant of
   .preview-brown-795c (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.section-up-395b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".orange-a1f9" 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.photo_be3d so it can't cause
   horizontal overflow anyway. */
.preview_west_73fe,
.header_3d43,
.sort_pro_8229,
.advanced_1bc3,
.dark_c9c2,
.hard_2d68,
.down-769c,
.panel_3fcb,
.button_ef7c,
.preview-65d4,
.shadow-92a6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .full-ad9b {
    padding: 8px 0;
  }
  
  .mask-d980 img {
    height: 28px;
    width: auto;
  }
  
  .avatar-fast-d1c3 {
    display: none !important;
  }
  
  .banner_0e05 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .banner_0e05 svg {
    width: 14px;
    height: 14px;
  }
  
  .short-2c50 {
    padding: 6px;
  }
  
  .hero-ae79 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort_pro_8229,
  .header_3d43,
  .advanced_1bc3,
  .dark_c9c2,
  .wide-f14a,
  .detail-ea6d,
  .highlight-large-2f98,
  .background_3edb,
  .up-41a7,
  .full_4c16,
  .cold-b583,
  .first_402d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .badge-rough-3e07,
  .basic-182c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .full-05cc,
  .notice_8258,
  .tertiary_fast_952e,
  .prev-5b00,
  .photo_down_728e,
  .chip_6ffe,
  .pattern-mini-74a7 {
    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 */
  .gradient-slow-d213,
  .message_5185,
  .info_3837,
  .rough_cc0d,
  .wrapper_yellow_018a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover-3a2c,
  .media-white-daed,
  .outline-db05,
  .new_1317 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tabs_8a5f,
  .lite_d5e5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tabs-solid-2ac5,
  .header-cd0c,
  .image_bcb0,
  .dropdown_huge_5c0a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .banner-over-f342,
  .next_8a4e,
  .breadcrumb_tiny_4566,
  .backdrop-north-4280,
  .stale_5ee5,
  .highlight_0df4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gradient-slow-d213,
  .message_5185,
  .rough_cc0d {
    max-width: none !important;
  }
  
  .orange-a1f9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover-3a2c {
    font-size: 1.5rem !important;
  }
  
  .media-white-daed {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pressed-ddd2,
  .in-744b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .outline-db05 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero-basic-8f6e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .footer_f666 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gradient-slow-d213,
  .rough_cc0d {
    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: 3aaf */
.ghost-box-j6 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
