/* ============================================
   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 (.block_complex_fe4b) is a descendant of
   .secondary-dbbd (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.thumbnail-next-0a78 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shade_west_498d" 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.chip-dark-1cc1 so it can't cause
   horizontal overflow anyway. */
.focus-540f,
.icon-d718,
.widget_bc37,
.modal-dark-5cd1,
.section_c401,
.search-ca54,
.fixed-d2e1,
.dim-388c,
.component-brown-340a,
.article-1737,
.yellow_0f24 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pattern_b9ea {
    padding: 8px 0;
  }
  
  .link_9e02 img {
    height: 28px;
    width: auto;
  }
  
  .solid-9f14 {
    display: none !important;
  }
  
  .south-1d90 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .south-1d90 svg {
    width: 14px;
    height: 14px;
  }
  
  .green-a2a1 {
    padding: 6px;
  }
  
  .header-227a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .widget_bc37,
  .icon-d718,
  .modal-dark-5cd1,
  .section_c401,
  .tag-5590,
  .progress_bottom_2137,
  .shadow-6098,
  .banner_small_0699,
  .tertiary-hot-3138,
  .background-fluid-f145,
  .hidden_92c5,
  .center_b624 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .right-2a82,
  .panel_3f56 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .link_pink_17db,
  .disabled-910c,
  .solid-8ab4,
  .aside-medium-f50b,
  .background-gas-09b8,
  .out_ff8b,
  .sidebar-1b32 {
    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 */
  .button_hot_2fb9,
  .pattern-7f09,
  .module_e98c,
  .pattern_motion_e695,
  .element-80c5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .down-ef78,
  .panel_fixed_6410,
  .background_0939,
  .box-gas-5d13 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .info-aa99,
  .active-lite-515f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paper-c12a,
  .tabs-016d,
  .sidebar_copper_6bf7,
  .gold_38c6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .logo-out-d3b1,
  .article_stone_55c9,
  .tiny_5884,
  .hovered_229e,
  .focus-b21c,
  .input-6ea7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .button_hot_2fb9,
  .pattern-7f09,
  .pattern_motion_e695 {
    max-width: none !important;
  }
  
  .shade_west_498d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .down-ef78 {
    font-size: 1.5rem !important;
  }
  
  .panel_fixed_6410 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tabs_advanced_3def,
  .button_clean_8551 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .background_0939 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .under_1e44 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .search-motion-d187 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .button_hot_2fb9,
  .pattern_motion_e695 {
    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: 7174 */
.shadow-element-b5 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.2;
}
