/* ============================================
   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 (.upper-9ba7) is a descendant of
   .shadow-smooth-dfc5 (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.container-27d5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".texture_north_fedd" 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.steel-4c9b so it can't cause
   horizontal overflow anyway. */
.modal-0b42,
.banner-glass-b99d,
.backdrop_722e,
.hero_3cb8,
.upper_6119,
.component-4051,
.lower_c6d3,
.caption-f59f,
.highlight-purple-0bbb,
.accent_7995,
.slider-d441 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .surface-pink-4974 {
    padding: 8px 0;
  }
  
  .caption-selected-2965 img {
    height: 28px;
    width: auto;
  }
  
  .status-1be8 {
    display: none !important;
  }
  
  .layout-3f22 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout-3f22 svg {
    width: 14px;
    height: 14px;
  }
  
  .mini-c0c8 {
    padding: 6px;
  }
  
  .dirty_b581 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .backdrop_722e,
  .banner-glass-b99d,
  .hero_3cb8,
  .upper_6119,
  .simple_4b93,
  .over_7e65,
  .paragraph-bright-2a88,
  .pattern-eaed,
  .rough_1d2a,
  .glass_59d0,
  .popup_lower_a3e1,
  .mask-77fe {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .image_outer_1fd4,
  .form-0a2f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .breadcrumb-fixed-5fc7,
  .avatar_f994,
  .shadow_4ca4,
  .item_top_9443,
  .thick-44b8,
  .middle_d0f1,
  .cold-920c {
    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 */
  .surface_2746,
  .preview_db38,
  .footer-6fc0,
  .thumbnail-gold-ce7c,
  .outer-683a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .focus-stone-5717,
  .pink-a1d8,
  .caption-current-7a05,
  .pattern-16ac {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .active_bright_158a,
  .popup-active-5cad {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .center-481c,
  .detail_3ec0,
  .hidden-hot-5adf,
  .outline-solid-8b61 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .table-1b24,
  .frame_0504,
  .footer-advanced-0319,
  .heading_af69,
  .table-4f8f,
  .alert_a8f8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .surface_2746,
  .preview_db38,
  .thumbnail-gold-ce7c {
    max-width: none !important;
  }
  
  .texture_north_fedd {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .focus-stone-5717 {
    font-size: 1.5rem !important;
  }
  
  .pink-a1d8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .link_a6e2,
  .grid-soft-20a9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .caption-current-7a05 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero_9fe3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gradient-current-64e5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .surface_2746,
  .thumbnail-gold-ce7c {
    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: 2096 */
.phantom-card-m7 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.0;
}
