/* ============================================
   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 (.container-1325) is a descendant of
   .bright_2229 (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.info-d79c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shade_down_d99a" 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.cold-865e so it can't cause
   horizontal overflow anyway. */
.yellow-a39a,
.label_left_2d17,
.description_cd4e,
.gold_bc64,
.orange-337c,
.hard-5eb0,
.steel-ff5c,
.north-df52,
.huge-7ab3,
.disabled-glass-7c09,
.gallery-south-79a6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .slider-outer-b880 {
    padding: 8px 0;
  }
  
  .surface_8103 img {
    height: 28px;
    width: auto;
  }
  
  .avatar_7755 {
    display: none !important;
  }
  
  .module_4b98 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .module_4b98 svg {
    width: 14px;
    height: 14px;
  }
  
  .badge_upper_6568 {
    padding: 6px;
  }
  
  .item-b41f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .description_cd4e,
  .label_left_2d17,
  .gold_bc64,
  .orange-337c,
  .last-73ad,
  .summary-21e2,
  .module-fca5,
  .tertiary-stone-0e85,
  .primary_70db,
  .frame_c0eb,
  .main-d80e,
  .bottom_fe94 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .box-gas-acfb,
  .advanced_6adf {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .modal-4926,
  .secondary_west_b1bd,
  .shadow_f19f,
  .under_726a,
  .shadow_simple_3ddc,
  .hero-1fca,
  .container-d6ef {
    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 */
  .carousel-7a83,
  .gradient-c968,
  .smooth_2cd4,
  .shadow_fa5e,
  .logo_cb34 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .status-0646,
  .dropdown_next_d36f,
  .search_green_0615,
  .black-1396 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .grid_da7e,
  .table_focused_c324 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .left-9196,
  .short-fda4,
  .pagination_hovered_be16,
  .narrow-d52f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .summary_dark_d869,
  .main_e02c,
  .overlay-7a04,
  .down_ef25,
  .accent_fluid_cbed,
  .menu-757e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .carousel-7a83,
  .gradient-c968,
  .shadow_fa5e {
    max-width: none !important;
  }
  
  .shade_down_d99a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .status-0646 {
    font-size: 1.5rem !important;
  }
  
  .dropdown_next_d36f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dim_6a25,
  .component-e331 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .search_green_0615 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .blue_79ce {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .description-729c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .carousel-7a83,
  .shadow_fa5e {
    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: fedc */
.ghost-box-m4 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.1;
}
