/* ============================================
   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 (.hovered_9ead) is a descendant of
   .border-d81f (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.basic_78f5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hero-fixed-2a7f" 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.fluid-5e00 so it can't cause
   horizontal overflow anyway. */
.section-2c14,
.tabs_small_0527,
.background-86c1,
.accent_cb83,
.progress-rough-4054,
.button_wide_0d24,
.grid-hard-0a84,
.notification_d10b,
.card-solid-e68a,
.basic-6906,
.solid_629b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .alert-solid-f69d {
    padding: 8px 0;
  }
  
  .texture_left_cc15 img {
    height: 28px;
    width: auto;
  }
  
  .fresh-28f5 {
    display: none !important;
  }
  
  .sort_b76a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .sort_b76a svg {
    width: 14px;
    height: 14px;
  }
  
  .full-d31c {
    padding: 6px;
  }
  
  .cool_afde {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .background-86c1,
  .tabs_small_0527,
  .accent_cb83,
  .progress-rough-4054,
  .frame_paper_191c,
  .old_bfc2,
  .menu-hovered-1081,
  .copper-de2c,
  .clean-ef1c,
  .avatar-red-4d74,
  .tiny_1c91,
  .disabled-f518 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tooltip-brown-f199,
  .item_bottom_58d8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .large_7fac,
  .mask-0623,
  .item-a0c2,
  .disabled-ccd7,
  .info_4870,
  .column-center-9460,
  .preview-3a77 {
    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 */
  .secondary_last_521e,
  .element_3b78,
  .title-26fb,
  .photo_e880,
  .dynamic-ce91 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .light-27ef,
  .plasma-e6a3,
  .notification-mini-f559,
  .search_33ff {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .button_advanced_cab5,
  .pressed-4968 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .steel-906e,
  .shadow_0cdd,
  .outer-7e05,
  .steel-ad5e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .shadow_small_36d3,
  .carousel_45d2,
  .frame_south_4f0c,
  .tag_hovered_b2e8,
  .white_d58c,
  .active_orange_7799 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .secondary_last_521e,
  .element_3b78,
  .photo_e880 {
    max-width: none !important;
  }
  
  .hero-fixed-2a7f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .light-27ef {
    font-size: 1.5rem !important;
  }
  
  .plasma-e6a3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .left-d4f4,
  .up_4173 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .notification-mini-f559 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .summary-103a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .label-plasma-4fba {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .secondary_last_521e,
  .photo_e880 {
    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: 5cb5 */
.shadow-element-m6 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.0;
}
