/* ============================================
   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 (.image_liquid_e12e) is a descendant of
   .notification-stale-af21 (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.element_clean_8011 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".status-motion-345a" 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.feature-e749 so it can't cause
   horizontal overflow anyway. */
.simple_dc66,
.large_9363,
.box_bronze_a82c,
.article_07b4,
.focus-pro-327f,
.red-bb20,
.tiny-d333,
.hard-c11b,
.iron_2751,
.pagination_f7b2,
.secondary-paper-e52d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .filter_tiny_ab93 {
    padding: 8px 0;
  }
  
  .over_3e44 img {
    height: 28px;
    width: auto;
  }
  
  .section-up-63f1 {
    display: none !important;
  }
  
  .mini_0ad2 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mini_0ad2 svg {
    width: 14px;
    height: 14px;
  }
  
  .module-a1a3 {
    padding: 6px;
  }
  
  .wide-b539 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .box_bronze_a82c,
  .large_9363,
  .article_07b4,
  .focus-pro-327f,
  .input_soft_becd,
  .tooltip-white-379f,
  .warm-b337,
  .block-short-b04d,
  .action_bf5f,
  .preview-complex-9bfd,
  .north_3376 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .border_35db,
  .gradient-b43a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cool_e018,
  .summary_bronze_cee4,
  .carousel_tiny_0055,
  .smooth_c225,
  .pink-23b0,
  .modal-dark-065d,
  .slow-ff34 {
    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 */
  .bottom_6965,
  .texture-slow-f43b,
  .cold_aaa9,
  .dirty-e6ab,
  .hot-95d2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dim-e529,
  .upper-cb47,
  .shade_2731,
  .feature-yellow-5075 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .yellow_c899,
  .hidden_dc53 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .full_a8ac,
  .tooltip_b708,
  .preview_e536,
  .hovered-1958 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .outer_c239,
  .badge-fluid-5b3a,
  .progress_hot_11fa,
  .widget-83bd,
  .text_5794,
  .center_b18c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bottom_6965,
  .texture-slow-f43b,
  .dirty-e6ab {
    max-width: none !important;
  }
  
  .status-motion-345a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dim-e529 {
    font-size: 1.5rem !important;
  }
  
  .upper-cb47 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .video_12c5,
  .caption_under_dfe4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shade_2731 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .frame-ed01 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .border-69fd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bottom_6965,
  .dirty-e6ab {
    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: e726 */
.promo-block-k3 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.0;
}
