/* ============================================
   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 (.button-2bbb) is a descendant of
   .panel-65a2 (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.outer_79e0 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".overlay-61bf" 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.title_over_4320 so it can't cause
   horizontal overflow anyway. */
.advanced-be86,
.media_purple_adab,
.wrapper_26f6,
.bright-4e29,
.surface_68f6,
.layout_8fff,
.shade_1605,
.outline_c789,
.smooth-ce15,
.fluid-de66,
.upper-6fc3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background-top-4c3e {
    padding: 8px 0;
  }
  
  .disabled_81de img {
    height: 28px;
    width: auto;
  }
  
  .outer-1373 {
    display: none !important;
  }
  
  .full-226b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .full-226b svg {
    width: 14px;
    height: 14px;
  }
  
  .white_2841 {
    padding: 6px;
  }
  
  .tabs-9021 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wrapper_26f6,
  .media_purple_adab,
  .bright-4e29,
  .surface_68f6,
  .notification-bd2d,
  .silver_cb26,
  .pro_8d3c,
  .left_90c7,
  .media-pressed-d4c2,
  .new-51a0,
  .liquid_dad6,
  .panel_outer_ae97 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .header_bdfb,
  .popup-dim-544f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .complex_9927,
  .yellow_78cd,
  .outline_f46a,
  .footer-5936,
  .hero_8ec7,
  .logo_black_3fef,
  .accordion-a31d {
    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 */
  .plasma_f141,
  .avatar-c4ad,
  .copper_26de,
  .element_d8ed,
  .middle-7411 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hidden-action-ac58,
  .popup-ff83,
  .nav_762d,
  .lite-30fe {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .top_508d,
  .carousel-in-3c38 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .table-2f02,
  .module_33ca,
  .action_0e8f,
  .background-under-0dce {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pro_568f,
  .description_39ae,
  .dropdown-e298,
  .banner_copper_c203,
  .full_3c04,
  .sidebar_up_d210 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .plasma_f141,
  .avatar-c4ad,
  .element_d8ed {
    max-width: none !important;
  }
  
  .overlay-61bf {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hidden-action-ac58 {
    font-size: 1.5rem !important;
  }
  
  .popup-ff83 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .north_c11c,
  .secondary_old_fdf6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .nav_762d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .texture_right_bff1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sidebar_over_c472 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .plasma_f141,
  .element_d8ed {
    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: a025 */
.promo-block-g9 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
