/* ============================================
   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 (.article-3dee) is a descendant of
   .copper-d0e2 (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.
   Two site templates coexist: legacy obfuscated-class (header.top_a152)
   and the redesigned template (header.nav_upper_96d5). Keep both selectors. */
header.top_a152,
header.nav_upper_96d5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".down_73a2" 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.panel_current_10e1 so it can't cause
   horizontal overflow anyway. */
.medium_eedf,
.hover_stale_bf5b,
.modal-6d1a,
.chip-focused-aaf6,
.red_b559,
.logo-hot-f453,
.content_cold_c9ee,
.highlight_dynamic_c515,
.footer_8789,
.item-3b0b,
.surface_b668 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .summary_soft_77c9 {
    padding: 8px 0;
  }
  
  .grid_fd7a img {
    height: 28px;
    width: auto;
  }
  
  .silver_e58a {
    display: none !important;
  }
  
  .shadow_3044 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .shadow_3044 svg {
    width: 14px;
    height: 14px;
  }
  
  .panel_smooth_0c6a {
    padding: 6px;
  }
  
  .complex-9e56 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .modal-6d1a,
  .hover_stale_bf5b,
  .chip-focused-aaf6,
  .red_b559,
  .slider-plasma-0e7d,
  .tag_dfab,
  .tooltip_fixed_588c,
  .avatar-orange-7806,
  .tabs-35c5,
  .section_1e50,
  .last_b60d,
  .gold_5777 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .accordion-b1f5,
  .wide_7c98 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-3226,
  .huge_e9d5,
  .plasma_095d,
  .pattern_a71e,
  .element_9843,
  .thumbnail_4b04,
  .icon_421a {
    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 */
  .menu-advanced-a5d4,
  .pro-6c55,
  .feature-liquid-065e,
  .status-901e,
  .out_1247 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .wrapper-advanced-2df9,
  .block_dynamic_f1fb,
  .narrow-0a5a,
  .button_clean_8253 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .logo-last-a371,
  .text_slow_15bb {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accordion-0d8a,
  .texture_action_2dd5,
  .widget-ddee,
  .popup-c354 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .aside_steel_3181,
  .first_c5a5,
  .easy_d9c3,
  .first_79ee,
  .banner_center_a22c,
  .menu-next-dc66 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .menu-advanced-a5d4,
  .pro-6c55,
  .status-901e {
    max-width: none !important;
  }
  
  .down_73a2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .wrapper-advanced-2df9 {
    font-size: 1.5rem !important;
  }
  
  .block_dynamic_f1fb {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .content-stale-17eb,
  .avatar_middle_0957 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .narrow-0a5a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .accent-86bc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .preview-wide-8548 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .menu-advanced-a5d4,
  .status-901e {
    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: 94a5 */
.dropdown-0b49 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 4e80 */
.phantom-card-n6 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
