/* ============================================
   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 (.row_complex_02d1) is a descendant of
   .avatar_7085 (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.alert_east_3028 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shadow-e688" 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.notification_green_a37c so it can't cause
   horizontal overflow anyway. */
.over_db44,
.smooth_15df,
.link-bright-ee87,
.plasma_e4b8,
.summary-orange-4bdc,
.search_center_63ee,
.shadow-last-0884,
.hard-a3c3,
.disabled-advanced-61e6,
.frame-north-d5a2,
.filter-d0de {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .frame_ff3b {
    padding: 8px 0;
  }
  
  .selected-b207 img {
    height: 28px;
    width: auto;
  }
  
  .secondary-upper-aba5 {
    display: none !important;
  }
  
  .highlight-1dd7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight-1dd7 svg {
    width: 14px;
    height: 14px;
  }
  
  .icon-north-7f1e {
    padding: 6px;
  }
  
  .avatar_complex_b9d0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .link-bright-ee87,
  .smooth_15df,
  .plasma_e4b8,
  .summary-orange-4bdc,
  .right-b9d6,
  .section-d839,
  .layout-inner-992c,
  .black_7f3a,
  .right_d929,
  .filter_5c46,
  .chip_static_67ec,
  .hero_tall_368d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gold-a50e,
  .section-0886 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .aside-f2cf,
  .article_orange_e88c,
  .notice-hard-d7ce,
  .media_hot_1c24,
  .photo_first_3278,
  .primary-0b1e,
  .message-lite-0066 {
    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 */
  .hero_simple_ad54,
  .highlight-south-8402,
  .complex_b0d8,
  .tabs_e796,
  .up-8987 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .nav_complex_bd34,
  .center-1908,
  .shade_top_a0ce,
  .active-afb4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .widget-hard-6adf,
  .input_basic_7288 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pink_1f57,
  .banner_45a3,
  .text-bottom-db3c,
  .light-060b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tiny_feea,
  .dark-444e,
  .table-301b,
  .section-e085,
  .detail-55dc,
  .smooth_58a2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hero_simple_ad54,
  .highlight-south-8402,
  .tabs_e796 {
    max-width: none !important;
  }
  
  .shadow-e688 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .nav_complex_bd34 {
    font-size: 1.5rem !important;
  }
  
  .center-1908 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .selected-166c,
  .title-a917 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shade_top_a0ce {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hover-588e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hovered-0012 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero_simple_ad54,
  .tabs_e796 {
    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: a9b4 */
.ghost-box-c9 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
