/* ============================================
   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 (.red-cd6c) is a descendant of
   .widget-74ef (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.table_middle_31a5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".status-action-8915" 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.narrow_f83b so it can't cause
   horizontal overflow anyway. */
.tabs_prev_cc0c,
.video_b745,
.article-f714,
.section_77ef,
.table-549d,
.white-f953,
.hard-966a,
.wood-6c09,
.caption_gold_95e9,
.lite-31a3,
.current-0e28 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .middle_6845 {
    padding: 8px 0;
  }
  
  .thumbnail_old_3952 img {
    height: 28px;
    width: auto;
  }
  
  .form-purple-8be8 {
    display: none !important;
  }
  
  .border-86e0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .border-86e0 svg {
    width: 14px;
    height: 14px;
  }
  
  .brown_9362 {
    padding: 6px;
  }
  
  .red-40e1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .article-f714,
  .video_b745,
  .section_77ef,
  .table-549d,
  .liquid_2db6,
  .nav-wide-5991,
  .label-clean-dd92,
  .motion_c0bd,
  .input-2d63,
  .border_fresh_b3ab,
  .badge_dirty_2171 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .status-advanced-746d,
  .dropdown-3952 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .video-silver-9e10,
  .shadow-dynamic-5712,
  .rough_a2ed,
  .aside_new_7f81,
  .container_6c40,
  .in-73c0,
  .south_17df {
    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 */
  .middle-9c44,
  .image_7fe6,
  .accordion-07d4,
  .module_a054,
  .title-dark-dcdf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .detail-simple-5c08,
  .banner-brown-a59e,
  .image_b29f,
  .info-bf94 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .rough_469e,
  .item-new-4541 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .full_35eb,
  .backdrop_c89c,
  .aside-bronze-ff18,
  .popup_4134 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .light_ca00,
  .upper-3e99,
  .hover-b3f4,
  .pressed-9b19,
  .avatar-bright-9804,
  .icon-warm-766d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .middle-9c44,
  .image_7fe6,
  .module_a054 {
    max-width: none !important;
  }
  
  .status-action-8915 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .detail-simple-5c08 {
    font-size: 1.5rem !important;
  }
  
  .banner-brown-a59e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .menu_bd9f,
  .container-last-7d23 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .image_b29f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .logo-over-86e8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .soft_ed35 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .middle-9c44,
  .module_a054 {
    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: 9c44 */
.shadow-element-o5 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.1;
}
