/* ============================================
   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 (.bottom-950b) is a descendant of
   .icon_81b3 (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.bottom-e10e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".green_7770" 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.layout_01de so it can't cause
   horizontal overflow anyway. */
.tabs_orange_2a64,
.description-gold-1030,
.pressed-6fba,
.article-next-3e87,
.dynamic_5363,
.accent-d39c,
.notice_hot_9596,
.prev_8300,
.active_ff91,
.gradient_purple_6a17,
.panel_rough_df4a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .huge-2c2a {
    padding: 8px 0;
  }
  
  .card_ec23 img {
    height: 28px;
    width: auto;
  }
  
  .background-061a {
    display: none !important;
  }
  
  .header-ce7f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .header-ce7f svg {
    width: 14px;
    height: 14px;
  }
  
  .copper-589b {
    padding: 6px;
  }
  
  .grid_dark_b71b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pressed-6fba,
  .description-gold-1030,
  .article-next-3e87,
  .dynamic_5363,
  .fluid_b4a0,
  .text_advanced_6fd9,
  .box_1912,
  .item-49da,
  .last_cf73,
  .first_489d,
  .footer-motion-f67a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shadow-203b,
  .upper-d491 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .action-46e3,
  .wrapper-huge-c161,
  .detail-top-e97a,
  .border-hard-88d7,
  .full-d1d5,
  .west_07c6,
  .description-stale-dff5 {
    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 */
  .shade_b050,
  .filter_1f15,
  .progress_3e8c,
  .overlay_slow_bbbe,
  .backdrop_action_2c15 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .nav_88c9,
  .dirty-38b0,
  .box_c7d4,
  .up_a639 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .row-a5f3,
  .fluid-abef {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .out-40a5,
  .fixed_87d8,
  .focus-yellow-1959,
  .inner_2c76 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thick-b80b,
  .gradient_stone_c13d,
  .dropdown_04d4,
  .banner_4513,
  .pattern_focused_7a9c,
  .message-north-5501 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shade_b050,
  .filter_1f15,
  .overlay_slow_bbbe {
    max-width: none !important;
  }
  
  .green_7770 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .nav_88c9 {
    font-size: 1.5rem !important;
  }
  
  .dirty-38b0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .icon_f70f,
  .box-outer-4643 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .box_c7d4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .badge-fluid-04fc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dark-de7c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shade_b050,
  .overlay_slow_bbbe {
    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: 9b2e */
.phantom-card-o3 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.0;
}
