/* ============================================
   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 (.background-huge-f6de) is a descendant of
   .component_dark_c148 (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.hero-b506 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".media-9e0b" 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.search-eaf4 so it can't cause
   horizontal overflow anyway. */
.pagination_b52c,
.disabled_6242,
.complex-e7eb,
.text-a242,
.nav_outer_f595,
.wide_767d,
.sort_active_c067,
.bronze_15b2,
.outline-3332,
.alert_18b6,
.tertiary_clean_b3df {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .medium_b789 {
    padding: 8px 0;
  }
  
  .left-c281 img {
    height: 28px;
    width: auto;
  }
  
  .notification_dynamic_d99e {
    display: none !important;
  }
  
  .gradient-4f93 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gradient-4f93 svg {
    width: 14px;
    height: 14px;
  }
  
  .banner-advanced-2006 {
    padding: 6px;
  }
  
  .orange-85be {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .complex-e7eb,
  .disabled_6242,
  .text-a242,
  .nav_outer_f595,
  .old-2ea6,
  .box-complex-7dbc,
  .media-705d,
  .motion-e7e7,
  .text-250b,
  .article-f6f4,
  .tall_fc2f,
  .thick-5c83 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .progress_hard_70db,
  .modal_0b68 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .silver-e21c,
  .gradient_801d,
  .wide-7d4f,
  .black_02d7,
  .header-527f,
  .breadcrumb_hovered_9c7d,
  .thick_78ee {
    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 */
  .focused-5e24,
  .bottom_f1f6,
  .west_c4e2,
  .tertiary-hovered-e8fb,
  .border-pressed-fabf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .media-3902,
  .disabled_west_c97c,
  .huge_ac62,
  .paper_db1a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .caption_14b6,
  .thumbnail-703f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gradient_current_70ad,
  .list-wide-fc89,
  .heading_black_9f4b,
  .silver-3f6e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .badge_narrow_f210,
  .form_4de3,
  .menu-clean-463f,
  .aside_8395,
  .new-9018,
  .gold-cc18 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focused-5e24,
  .bottom_f1f6,
  .tertiary-hovered-e8fb {
    max-width: none !important;
  }
  
  .media-9e0b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .media-3902 {
    font-size: 1.5rem !important;
  }
  
  .disabled_west_c97c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .breadcrumb-bba7,
  .yellow-f496 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .huge_ac62 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notice-fast-349a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notification_aaf7 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focused-5e24,
  .tertiary-hovered-e8fb {
    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: 5ba5 */
.widget-item-g2 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
