/* ============================================
   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 (.panel_prev_16ba) is a descendant of
   .element-69ec (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.
   Two site templates coexist: legacy obfuscated-class (header.fluid_8f2a)
   and the redesigned template (header.notice_top_53ff). Keep both selectors. */
header.fluid_8f2a,
header.notice_top_53ff {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".glass_072e" 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.message-49a8 so it can't cause
   horizontal overflow anyway. */
.action-cf05,
.backdrop_white_7abc,
.tertiary_complex_ae6c,
.filter-right-bef1,
.progress_down_8e78,
.badge_green_cde6,
.outline_246d,
.carousel_mini_8154,
.chip-59a9,
.disabled_47b9,
.lite_a837 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .row_9849 {
    padding: 8px 0;
  }
  
  .hovered-e1b9 img {
    height: 28px;
    width: auto;
  }
  
  .motion_8507 {
    display: none !important;
  }
  
  .glass_c579 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .glass_c579 svg {
    width: 14px;
    height: 14px;
  }
  
  .aside_gold_c78d {
    padding: 6px;
  }
  
  .iron_88fb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tertiary_complex_ae6c,
  .backdrop_white_7abc,
  .filter-right-bef1,
  .progress_down_8e78,
  .thumbnail_dirty_d673,
  .module-silver-6944,
  .full-493e,
  .overlay_up_cc56,
  .short-a31f,
  .short_4a22,
  .grid-1521,
  .message_left_6051 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .cool-481c,
  .medium-6eda {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shade_f46b,
  .white-1142,
  .accent_a852,
  .column_rough_39b5,
  .thick_51dc,
  .description-ca10,
  .popup-a87f {
    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 */
  .logo_motion_88dc,
  .texture_3fb2,
  .notice-4ece,
  .old-f5a1,
  .feature-in-92b9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tall-15c9,
  .panel_9367,
  .hidden-b7a8,
  .label-motion-3995 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .panel-warm-bd46,
  .list_first_982e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active-static-4b44,
  .bright_cae2,
  .sort_bbab,
  .lite-1ff5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .accordion-current-cb00,
  .soft-fd5f,
  .narrow-d561,
  .hero-5047,
  .iron-1442,
  .surface-medium-70e9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .logo_motion_88dc,
  .texture_3fb2,
  .old-f5a1 {
    max-width: none !important;
  }
  
  .glass_072e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tall-15c9 {
    font-size: 1.5rem !important;
  }
  
  .panel_9367 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .content-tall-049b,
  .glass_df5b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hidden-b7a8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .selected-c025 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .progress-dark-73cc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .logo_motion_88dc,
  .old-f5a1 {
    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: 94a5 */
.backdrop_5b09 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: bfdc */
.phantom-card-y7 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.0;
}
