/* ============================================
   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 (.fixed_6384) is a descendant of
   .sort_95a6 (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.in-79ae {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notice_inner_1e5b" 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.progress_0200 so it can't cause
   horizontal overflow anyway. */
.white-e311,
.heading-2896,
.light-f103,
.hover-purple-c551,
.frame_12aa,
.sidebar-rough-2375,
.cool-7633,
.accordion-small-a066,
.smooth-3452,
.widget_warm_0591,
.link_41ab {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .mask_3c66 {
    padding: 8px 0;
  }
  
  .card-lite-0075 img {
    height: 28px;
    width: auto;
  }
  
  .aside-fresh-0199 {
    display: none !important;
  }
  
  .pattern-a327 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pattern-a327 svg {
    width: 14px;
    height: 14px;
  }
  
  .easy_4851 {
    padding: 6px;
  }
  
  .video-7a85 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .light-f103,
  .heading-2896,
  .hover-purple-c551,
  .frame_12aa,
  .tall_e118,
  .widget-4f44,
  .preview_e81c,
  .description_left_b304,
  .steel_4e3b,
  .focus_0577,
  .tall-9095,
  .bright_6665 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .thumbnail-stale-7064,
  .north_d4f2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .primary_orange_94f8,
  .copper_482f,
  .label_0fcb,
  .preview-brown-a9bf,
  .caption-west-d0a6,
  .frame_bright_a35b,
  .progress_a8f1 {
    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 */
  .avatar_dark_0387,
  .notice-yellow-e299,
  .row_c2a4,
  .label_fluid_a4ca,
  .media_under_2218 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .full-ef19,
  .nav-dark-8a9c,
  .filter_45e4,
  .header-gold-34e2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dark_8b6c,
  .info_372c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text_6a8c,
  .pro_8f85,
  .popup-stale-66b8,
  .banner-bc0a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .badge_52be,
  .steel_bebb,
  .south_935f,
  .banner-daca,
  .breadcrumb-2f24,
  .black_b558 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .avatar_dark_0387,
  .notice-yellow-e299,
  .label_fluid_a4ca {
    max-width: none !important;
  }
  
  .notice_inner_1e5b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .full-ef19 {
    font-size: 1.5rem !important;
  }
  
  .nav-dark-8a9c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .badge-lower-d948,
  .photo_selected_741a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .filter_45e4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .solid_6b77 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .plasma_2e0f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .avatar_dark_0387,
  .label_fluid_a4ca {
    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: b420 */
.shadow-element-w4 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.2;
}
