/* ============================================
   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 (.tertiary_d6d2) is a descendant of
   .alert_88af (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.hero_96e7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fluid_b99c" 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.silver_0585 so it can't cause
   horizontal overflow anyway. */
.center-f6c9,
.heading-action-3646,
.gallery_a654,
.button_mini_3b58,
.gold_c95f,
.red_490e,
.shadow_gas_e92e,
.panel_focused_b186,
.border_top_4f24,
.bronze_7277,
.feature_advanced_7756 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .surface_bright_c3df {
    padding: 8px 0;
  }
  
  .huge-e4bc img {
    height: 28px;
    width: auto;
  }
  
  .up_e046 {
    display: none !important;
  }
  
  .row_d38a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .row_d38a svg {
    width: 14px;
    height: 14px;
  }
  
  .tabs-east-e7f5 {
    padding: 6px;
  }
  
  .prev-fa0d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gallery_a654,
  .heading-action-3646,
  .button_mini_3b58,
  .gold_c95f,
  .header_1067,
  .fast-3de7,
  .pattern-dark-2941,
  .glass-cbdb,
  .box-solid-d48e,
  .top_7cd9,
  .logo-light-1276,
  .component_db33 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focus-a05b,
  .soft_294d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .in-7bbe,
  .over-2270,
  .hover-new-5232,
  .frame-purple-cddc,
  .search-aadd,
  .last_c954,
  .popup-solid-51a7 {
    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 */
  .static-249b,
  .element-south-d0b8,
  .media_02a0,
  .hard-0fa7,
  .border_ef74 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .cold_4862,
  .pattern_bdb0,
  .aside_liquid_977b,
  .banner_clean_5008 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .smooth-9213,
  .white_77aa {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .aside_hard_c742,
  .accordion-0ca4,
  .backdrop_66aa,
  .active_fresh_9f52 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pressed-5a1c,
  .old_5e94,
  .stale-2c37,
  .clean-1b8a,
  .sidebar_79eb,
  .paper-8cbb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .static-249b,
  .element-south-d0b8,
  .hard-0fa7 {
    max-width: none !important;
  }
  
  .fluid_b99c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .cold_4862 {
    font-size: 1.5rem !important;
  }
  
  .pattern_bdb0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tag_e4c3,
  .steel-3d71 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside_liquid_977b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notice_7c9e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dark-a83a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .static-249b,
  .hard-0fa7 {
    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: d438 */
.shadow-element-c8 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.2;
}
