/* ============================================
   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 (.avatar_1c59) is a descendant of
   .yellow-6a94 (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.focus-4709 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".card_motion_1880" 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.middle-2c77 so it can't cause
   horizontal overflow anyway. */
.active_0a3d,
.title_698e,
.banner-gas-1295,
.motion_adac,
.highlight-3815,
.stale_5caa,
.in-fbbc,
.blue-5d07,
.message_clean_2fdd,
.thumbnail_bdc5,
.smooth_0288 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .box_dynamic_5315 {
    padding: 8px 0;
  }
  
  .active-2050 img {
    height: 28px;
    width: auto;
  }
  
  .cold-67fb {
    display: none !important;
  }
  
  .easy-e1e0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .easy-e1e0 svg {
    width: 14px;
    height: 14px;
  }
  
  .huge-3442 {
    padding: 6px;
  }
  
  .gradient-over-8d81 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner-gas-1295,
  .title_698e,
  .motion_adac,
  .highlight-3815,
  .modal_703e,
  .motion-9ea9,
  .active-c64c,
  .carousel-stale-993b,
  .clean-3627,
  .panel-534c,
  .overlay_gas_7abf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .grid_107d,
  .iron_6bfa {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .under-9885,
  .basic-e3af,
  .logo-first-93be,
  .bottom_2dfd,
  .header_narrow_873f,
  .dropdown_in_e447,
  .gas-6c8b {
    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 */
  .aside-last-32e2,
  .shade_9755,
  .search-6872,
  .breadcrumb-copper-68cf,
  .pattern_2865 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .basic_7f0e,
  .icon_df28,
  .text-c798,
  .dim_4639 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hover-hard-a3a2,
  .aside_bottom_7c70 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .silver-b6ca,
  .component_fd1e,
  .component-fluid-2f14,
  .description_e7cf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hover-37eb,
  .table-clean-c79a,
  .backdrop-8bbb,
  .avatar_f975,
  .container-glass-2938,
  .tiny-de12 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .aside-last-32e2,
  .shade_9755,
  .breadcrumb-copper-68cf {
    max-width: none !important;
  }
  
  .card_motion_1880 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .basic_7f0e {
    font-size: 1.5rem !important;
  }
  
  .icon_df28 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .purple-654f,
  .header-lower-dadc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .text-c798 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .layout-center-5939 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dynamic-8c15 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .aside-last-32e2,
  .breadcrumb-copper-68cf {
    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: eb39 */
.phantom-card-l9 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
