/* ============================================
   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 (.wood_cfb5) is a descendant of
   .frame_iron_d2d3 (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.upper_c462 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".video-f8aa" 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.hover_584c so it can't cause
   horizontal overflow anyway. */
.header_west_827d,
.status_north_3097,
.upper-06b8,
.secondary-mini-9a93,
.hero-hard-f697,
.active_brown_149a,
.carousel-9edd,
.icon-8116,
.fresh_2721,
.link-wood-b6a1,
.frame-e67c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .menu_full_5078 {
    padding: 8px 0;
  }
  
  .frame_0d08 img {
    height: 28px;
    width: auto;
  }
  
  .orange_debb {
    display: none !important;
  }
  
  .texture-de9e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .texture-de9e svg {
    width: 14px;
    height: 14px;
  }
  
  .hero-fast-7fa7 {
    padding: 6px;
  }
  
  .element_9158 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .upper-06b8,
  .status_north_3097,
  .secondary-mini-9a93,
  .hero-hard-f697,
  .texture_cold_4981,
  .dark-36e8,
  .wrapper_red_db79,
  .icon-6118,
  .huge_d885,
  .clean-e633,
  .link_copper_1b48,
  .status_bc71 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .row_medium_25d3,
  .detail-gas-8f7e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .form_action_5e12,
  .last_47de,
  .tertiary_93c9,
  .main-0f41,
  .dim-f1e2,
  .nav_hovered_48ae,
  .brown_f12d {
    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 */
  .avatar-c00d,
  .white_94ef,
  .mask-0ad4,
  .tag-purple-efce,
  .heading_4169 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .surface-next-bc6c,
  .hover-e835,
  .old-4a05,
  .pro-3755 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .white_4417,
  .box-prev-e4ed {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tag_6d24,
  .sidebar_9392,
  .footer_rough_d068,
  .black-1f51 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .header-e537,
  .nav-bright-a228,
  .mini-1b4a,
  .active_over_4dde,
  .cool-3310,
  .active_narrow_d139 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .avatar-c00d,
  .white_94ef,
  .tag-purple-efce {
    max-width: none !important;
  }
  
  .video-f8aa {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .surface-next-bc6c {
    font-size: 1.5rem !important;
  }
  
  .hover-e835 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .outline_mini_8add,
  .column_inner_bb28 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .old-4a05 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .module-cc1b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .picture-focused-e9c7 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .avatar-c00d,
  .tag-purple-efce {
    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: acd5 */
.phantom-card-h8 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
