/* ============================================
   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 (.dropdown-dynamic-cbb9) is a descendant of
   .popup_85da (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.prev_20d4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".middle-4f32" 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.hover_up_6076 so it can't cause
   horizontal overflow anyway. */
.panel-f75a,
.frame_f7d5,
.wrapper-730e,
.last-0813,
.image-ab73,
.mask_b4e5,
.purple-483f,
.input-new-7a43,
.slow-3aa1,
.accordion_9285,
.top-90b9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .smooth-5d16 {
    padding: 8px 0;
  }
  
  .container_large_9c1d img {
    height: 28px;
    width: auto;
  }
  
  .table_e68a {
    display: none !important;
  }
  
  .nav_0a41 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .nav_0a41 svg {
    width: 14px;
    height: 14px;
  }
  
  .hovered_744e {
    padding: 6px;
  }
  
  .current_1025 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wrapper-730e,
  .frame_f7d5,
  .last-0813,
  .image-ab73,
  .container-5107,
  .slider_hard_6160,
  .outline_tall_95fa,
  .tiny-ca05,
  .panel-copper-fb26,
  .text_glass_67fc,
  .video-afa3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tag_d8a5,
  .west_4dd1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .steel-662b,
  .image-left-33cf,
  .focus_warm_9f0a,
  .sidebar-e145,
  .fresh-6c45,
  .cold-4379,
  .row-new-71bd {
    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 */
  .message-out-bb20,
  .caption_up_22a0,
  .white_dcaf,
  .video_a2f1,
  .wrapper_b853 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .motion-a8bc,
  .down_f5b3,
  .sort-inner-c8d8,
  .video_cold_5fad {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gallery_stone_940e,
  .section_3435 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text-4ffe,
  .menu-cold-4016,
  .light_24a8,
  .filter_b5e0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .menu_first_a0ae,
  .box-pro-7ae9,
  .texture_paper_9ae7,
  .hard-e6ec,
  .white_3557,
  .lite-9270 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .message-out-bb20,
  .caption_up_22a0,
  .video_a2f1 {
    max-width: none !important;
  }
  
  .middle-4f32 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .motion-a8bc {
    font-size: 1.5rem !important;
  }
  
  .down_f5b3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .link_left_054e,
  .label_44d8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sort-inner-c8d8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .upper-0332 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link_cool_d921 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .message-out-bb20,
  .video_a2f1 {
    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: 03d0 */
.phantom-card-s5 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.2;
}
