/* ============================================
   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 (.yellow-cea0) is a descendant of
   .tertiary-plasma-c28a (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.article-cool-d6ea {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".column-mini-f9af" 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.row-purple-d5bb so it can't cause
   horizontal overflow anyway. */
.gradient-west-1684,
.middle-3dfd,
.status-11e4,
.cool_a76f,
.highlight-3f93,
.notification_pressed_996d,
.item-ae84,
.alert-4fea,
.picture-steel-8503,
.banner_clean_a105,
.tag-1b56 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wide-7d96 {
    padding: 8px 0;
  }
  
  .stale_880f img {
    height: 28px;
    width: auto;
  }
  
  .icon_blue_3d93 {
    display: none !important;
  }
  
  .inner_fb1f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .inner_fb1f svg {
    width: 14px;
    height: 14px;
  }
  
  .solid-59cd {
    padding: 6px;
  }
  
  .bottom_8b70 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .status-11e4,
  .middle-3dfd,
  .cool_a76f,
  .highlight-3f93,
  .logo-out-8283,
  .search-6236,
  .hidden-1e45,
  .media-mini-c4d6,
  .status_glass_6e72,
  .element-79f6,
  .search-gas-59c0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .chip-5d0d,
  .sort-858e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hover-complex-4179,
  .gold-e727,
  .detail_basic_97bc,
  .article-hot-db6f,
  .description_gas_91dd,
  .preview-glass-a4ff,
  .focus-in-7088 {
    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 */
  .breadcrumb-hard-5ee5,
  .card_bottom_818a,
  .banner_2844,
  .card-ad81,
  .notice-a348 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag_warm_0013,
  .summary_rough_e5db,
  .menu_slow_8f4e,
  .cold_d209 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .article-last-5605,
  .red_83e9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .module_777e,
  .frame_tall_6202,
  .top_f80d,
  .backdrop_plasma_ae0a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gradient_34b6,
  .shadow-4f59,
  .item-north-d8c2,
  .block-east-7ef5,
  .image_inner_f758,
  .input-fluid-8667 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .breadcrumb-hard-5ee5,
  .card_bottom_818a,
  .card-ad81 {
    max-width: none !important;
  }
  
  .column-mini-f9af {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag_warm_0013 {
    font-size: 1.5rem !important;
  }
  
  .summary_rough_e5db {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .purple_6f17,
  .focused-b027 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .menu_slow_8f4e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .north-a4d3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .surface_4e9c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .breadcrumb-hard-5ee5,
  .card-ad81 {
    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: 575a */
.shadow-element-r2 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
