/* ============================================
   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 (.container_next_6a5e) is a descendant of
   .glass_ec47 (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.block-a93e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".texture-3aa4" 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.active-4bb0 so it can't cause
   horizontal overflow anyway. */
.primary-dim-d64b,
.wide_3d56,
.highlight_b733,
.first-098d,
.article_406a,
.stone_9932,
.card-4a63,
.caption_soft_7812,
.surface-798a,
.header-complex-21e4,
.input-5b58 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .east_5fd3 {
    padding: 8px 0;
  }
  
  .stone-a390 img {
    height: 28px;
    width: auto;
  }
  
  .tabs_prev_fdc3 {
    display: none !important;
  }
  
  .chip-soft-4498 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .chip-soft-4498 svg {
    width: 14px;
    height: 14px;
  }
  
  .outline_c0ea {
    padding: 6px;
  }
  
  .overlay_08bc {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_b733,
  .wide_3d56,
  .first-098d,
  .article_406a,
  .texture-7093,
  .footer_1f8a,
  .status-d79c,
  .link_9fd5,
  .banner-out-a143,
  .gradient_47e8,
  .overlay_dim_a740,
  .disabled-full-5f72 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .primary-d4e9,
  .element_bf6b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .small_37a4,
  .column_stone_7d34,
  .element_0851,
  .under_4fe9,
  .plasma-1bfb,
  .chip-a097,
  .upper_b6d0 {
    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 */
  .hover-d933,
  .overlay-6516,
  .over_7c91,
  .tertiary-2207,
  .primary-1d9f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover-north-0043,
  .medium_5264,
  .block_2786,
  .in-fd0b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .main-d9a7,
  .shade-paper-0769 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .plasma-1411,
  .inner-3540,
  .row_medium_6505,
  .main_2a9a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .surface-5f66,
  .tertiary_47c3,
  .middle-3a47,
  .red_1396,
  .dropdown_1bce,
  .tabs_left_1669 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hover-d933,
  .overlay-6516,
  .tertiary-2207 {
    max-width: none !important;
  }
  
  .texture-3aa4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover-north-0043 {
    font-size: 1.5rem !important;
  }
  
  .medium_5264 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .left_1677,
  .progress-d261 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .block_2786 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .grid_upper_5205 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .section_470f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hover-d933,
  .tertiary-2207 {
    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: f468 */
.promo-block-j5 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
