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

/* Fix for any potential overflow elements */
/* NOTE: ".sort-steel-45a1" 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.background_pressed_255a so it can't cause
   horizontal overflow anyway. */
.picture_711b,
.south_1c32,
.block_thick_1812,
.shadow-04ce,
.hidden_0d47,
.focused_8ec1,
.feature-d108,
.container_in_5ccb,
.fixed-bb30,
.overlay_4404,
.light_3593 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview_4660 {
    padding: 8px 0;
  }
  
  .aside-34ee img {
    height: 28px;
    width: auto;
  }
  
  .wrapper-b86a {
    display: none !important;
  }
  
  .detail-easy-7830 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .detail-easy-7830 svg {
    width: 14px;
    height: 14px;
  }
  
  .module_c42b {
    padding: 6px;
  }
  
  .simple_4fa1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .block_thick_1812,
  .south_1c32,
  .shadow-04ce,
  .hidden_0d47,
  .shadow-silver-a812,
  .heading-d7d0,
  .label_ea45,
  .sort-f527,
  .motion-c579,
  .grid-smooth-0d03,
  .modal-994b,
  .popup-8e9c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .nav-df97,
  .wood_3ed3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-e084,
  .module_white_fc9c,
  .info-0a6e,
  .block-ce7d,
  .advanced_7bc1,
  .full-d563,
  .layout_0db3 {
    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 */
  .progress_thick_6d5b,
  .feature-north-d577,
  .modal_short_8639,
  .surface_narrow_2bc7,
  .content-b8e2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .black_266f,
  .message_6047,
  .overlay-9b3b,
  .gold-02f9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mask-warm-2aff,
  .element-6e0c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hard_64b7,
  .full-abd8,
  .picture-dynamic-baa3,
  .main-cool-6903 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .link_soft_0302,
  .shadow_cff6,
  .dynamic-b564,
  .heading-51fe,
  .tag_stone_0b88,
  .prev_0014 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .progress_thick_6d5b,
  .feature-north-d577,
  .surface_narrow_2bc7 {
    max-width: none !important;
  }
  
  .sort-steel-45a1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .black_266f {
    font-size: 1.5rem !important;
  }
  
  .message_6047 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .heading_598c,
  .preview-d707 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay-9b3b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bright_9fdf {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .row-top-a0bd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .progress_thick_6d5b,
  .surface_narrow_2bc7 {
    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: daa8 */
.ghost-box-f4 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
