/* ============================================
   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 (.main-5398) is a descendant of
   .hidden-fa28 (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.silver_9951 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".form-1c55" 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.summary_pink_52f3 so it can't cause
   horizontal overflow anyway. */
.selected-7749,
.sidebar_stale_f042,
.input-under-4bc3,
.clean_ce1b,
.copper-7355,
.border_c476,
.white_94f4,
.plasma_d240,
.mask_large_7bcc,
.sort-selected-02e7,
.mini-4488 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .main-cf89 {
    padding: 8px 0;
  }
  
  .detail_4bf2 img {
    height: 28px;
    width: auto;
  }
  
  .outline-2cde {
    display: none !important;
  }
  
  .brown_88da {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .brown_88da svg {
    width: 14px;
    height: 14px;
  }
  
  .hot_14e9 {
    padding: 6px;
  }
  
  .stale-3e0c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .input-under-4bc3,
  .sidebar_stale_f042,
  .clean_ce1b,
  .copper-7355,
  .advanced-ba2a,
  .prev-29f1,
  .fast_1aa4,
  .footer-c630,
  .description_dark_b544,
  .surface-stone-9689,
  .primary-ed26,
  .simple-fb3c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shade_blue_5186,
  .paragraph-warm-8e7d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .button_east_93b6,
  .photo-ed8a,
  .notification-hovered-5a6c,
  .link_liquid_99ce,
  .main_blue_a4a5,
  .text_action_48b4,
  .liquid_8c62 {
    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 */
  .popup_fluid_ebae,
  .over_f505,
  .alert-63c7,
  .image_orange_d3b4,
  .overlay-0abb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .right_c42a,
  .fresh_015b,
  .logo-9b26,
  .heading-prev-d64c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .avatar_f053,
  .container_warm_4f78 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .steel_7f89,
  .accordion_2cce,
  .shadow_orange_5630,
  .text-over-95c1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .texture_action_7633,
  .smooth-dce6,
  .tag_da04,
  .pattern_fluid_4b12,
  .column-outer-b0cb,
  .backdrop_cold_8d4c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .popup_fluid_ebae,
  .over_f505,
  .image_orange_d3b4 {
    max-width: none !important;
  }
  
  .form-1c55 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .right_c42a {
    font-size: 1.5rem !important;
  }
  
  .fresh_015b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .description_fluid_c72c,
  .last_5596 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .logo-9b26 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .nav-4204 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .container-20b3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .popup_fluid_ebae,
  .image_orange_d3b4 {
    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: 3975 */
.ghost-box-v4 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
