/* ============================================
   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 (.sidebar-4ace) is a descendant of
   .box-4ba8 (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.title-684c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".center-9f4f" 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.highlight_1d3d so it can't cause
   horizontal overflow anyway. */
.grid_3d8c,
.east_a7b4,
.label-d114,
.lite-7603,
.stone-9f45,
.item-221a,
.popup_lower_ce10,
.steel_157c,
.nav_tall_8474,
.item-left-8e46,
.input-af72 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .static_3aaa {
    padding: 8px 0;
  }
  
  .pro_b3c8 img {
    height: 28px;
    width: auto;
  }
  
  .item_warm_381a {
    display: none !important;
  }
  
  .hard_1586 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hard_1586 svg {
    width: 14px;
    height: 14px;
  }
  
  .shade_0eb0 {
    padding: 6px;
  }
  
  .huge-9f74 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label-d114,
  .east_a7b4,
  .lite-7603,
  .stone-9f45,
  .badge-f95a,
  .carousel_4b3d,
  .thick_1bae,
  .black_0dea,
  .section_fluid_36e7,
  .content_9203,
  .disabled-2575,
  .tooltip-tiny-efa1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .widget_over_30a4,
  .tabs_focused_c388 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .highlight-b59e,
  .frame-1948,
  .section-7bae,
  .caption-b003,
  .dynamic-afc1,
  .photo_a8ba,
  .button-4d5f {
    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 */
  .input_hard_ef25,
  .widget_over_314c,
  .sort-7a8a,
  .hover-0e71,
  .old_bc60 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .nav-north-c312,
  .active-7e12,
  .fluid-921f,
  .tag_1ec6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .image_old_8a2f,
  .avatar-small-37a4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .cool-ea32,
  .huge-8d5b,
  .text_smooth_e268,
  .modal_0f79 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notice_short_1829,
  .form-gold-10c5,
  .surface-basic-7664,
  .shadow_bright_09e9,
  .list-copper-9474,
  .rough_be80 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .input_hard_ef25,
  .widget_over_314c,
  .hover-0e71 {
    max-width: none !important;
  }
  
  .center-9f4f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .nav-north-c312 {
    font-size: 1.5rem !important;
  }
  
  .active-7e12 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .backdrop-fca8,
  .huge_00bd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fluid-921f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pink_c62b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .section_a055 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .input_hard_ef25,
  .hover-0e71 {
    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: f5d9 */
.ghost-box-f1 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
