/* ============================================
   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 (.footer-pink-413f) is a descendant of
   .column-copper-de3e (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.accent_light_3ccf {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fixed_be56" 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.icon-999e so it can't cause
   horizontal overflow anyway. */
.surface_7538,
.focus-gas-dea7,
.action-a978,
.down_bbac,
.dynamic_1e49,
.filter_rough_e849,
.alert-paper-9a53,
.light-3902,
.bright_e8d2,
.container_dce8,
.aside-1ec7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gallery-0241 {
    padding: 8px 0;
  }
  
  .alert-copper-c62d img {
    height: 28px;
    width: auto;
  }
  
  .info-gold-eec8 {
    display: none !important;
  }
  
  .wrapper_dark_b2a7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wrapper_dark_b2a7 svg {
    width: 14px;
    height: 14px;
  }
  
  .breadcrumb-east-587c {
    padding: 6px;
  }
  
  .surface-iron-7e26 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .action-a978,
  .focus-gas-dea7,
  .down_bbac,
  .dynamic_1e49,
  .button_d636,
  .lower-fd3f,
  .right_4beb,
  .prev-06e9,
  .right_ae41,
  .north_82a3,
  .backdrop_fluid_9c8d,
  .pagination-orange-3849 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hover-out-8187,
  .large-2208 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wood-2301,
  .banner-dynamic-4b43,
  .fresh-6c62,
  .card_dark_3b98,
  .paper_07cf,
  .upper_3745,
  .shadow_f61a {
    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 */
  .silver-a51d,
  .block-f6b8,
  .feature_gas_e3ad,
  .breadcrumb-cd00,
  .blue_028f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sort-3b25,
  .mini_b520,
  .header-c8c4,
  .fresh_2d61 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gradient_d9b6,
  .shadow_last_3b26 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .full_aaf8,
  .badge_f5ce,
  .gradient_pressed_b36b,
  .gold-7200 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pagination_light_b360,
  .border-pink-5711,
  .white_21b8,
  .wrapper-green-62cf,
  .main-focused-7a95,
  .gradient-over-8d61 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .silver-a51d,
  .block-f6b8,
  .breadcrumb-cd00 {
    max-width: none !important;
  }
  
  .fixed_be56 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sort-3b25 {
    font-size: 1.5rem !important;
  }
  
  .mini_b520 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .block_wide_b367,
  .heading_593f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .header-c8c4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .feature-up-1873 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .progress_7c8a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .silver-a51d,
  .breadcrumb-cd00 {
    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: 3597 */
.phantom-card-u4 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
