/* ============================================
   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 (.badge_north_3c71) is a descendant of
   .title_last_1274 (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.mask-ce75 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".menu-new-f69f" 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.blue_a14f so it can't cause
   horizontal overflow anyway. */
.hard-5085,
.fast_426c,
.fast_412f,
.accordion_west_f1e1,
.logo_9069,
.feature_last_ce95,
.breadcrumb_278e,
.layout_5157,
.fixed-fb4d,
.row-hot-7448,
.full_1939 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .panel_c20e {
    padding: 8px 0;
  }
  
  .shadow-2423 img {
    height: 28px;
    width: auto;
  }
  
  .column_76b8 {
    display: none !important;
  }
  
  .south-9192 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .south-9192 svg {
    width: 14px;
    height: 14px;
  }
  
  .notice_b1cf {
    padding: 6px;
  }
  
  .thick_639c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .fast_412f,
  .fast_426c,
  .accordion_west_f1e1,
  .logo_9069,
  .gallery-middle-b31a,
  .notice_active_4bf1,
  .avatar-e093,
  .stale-8f1f,
  .heading-new-3929,
  .modal_f624,
  .middle_bcd7,
  .text_right_d982 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paragraph_54a4,
  .pink-f6d5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .link_full_7e77,
  .description_tiny_e228,
  .component_bright_8d12,
  .notification-1065,
  .avatar_white_ddee,
  .layout-warm-97b7,
  .backdrop-5158 {
    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 */
  .search-1d9d,
  .middle_8985,
  .media_selected_3bcc,
  .nav_8de8,
  .column_c00d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .large_c592,
  .notice_lower_5628,
  .dynamic_f216,
  .accordion_0c7b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tabs_ad62,
  .notice-41ed {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .next_edad,
  .right-c4c6,
  .middle_d33a,
  .search-huge-141f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .focus_bottom_ac76,
  .primary_01c8,
  .fluid_2ab0,
  .pro_8b5c,
  .hero_pressed_0fba,
  .accordion-4140 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search-1d9d,
  .middle_8985,
  .nav_8de8 {
    max-width: none !important;
  }
  
  .menu-new-f69f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .large_c592 {
    font-size: 1.5rem !important;
  }
  
  .notice_lower_5628 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .nav_dark_28f5,
  .fixed_47fb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dynamic_f216 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tag-e75a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .image_49cd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search-1d9d,
  .nav_8de8 {
    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: 87f6 */
.ghost-box-z6 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.0;
}
