/* ============================================
   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 (.complex-ed9a) is a descendant of
   .hidden-73d8 (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.left-fb91 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".surface_461c" 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.table-silver-87e1 so it can't cause
   horizontal overflow anyway. */
.shade_88d1,
.modal_3320,
.huge_67ef,
.notification_21b9,
.video-f365,
.blue_2aed,
.card-north-fdd1,
.chip_974f,
.secondary_up_cf88,
.north_2608,
.alert-beaa {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .out_502c {
    padding: 8px 0;
  }
  
  .dropdown_slow_5de4 img {
    height: 28px;
    width: auto;
  }
  
  .alert_663e {
    display: none !important;
  }
  
  .hot-18a1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hot-18a1 svg {
    width: 14px;
    height: 14px;
  }
  
  .primary-pink-8e0c {
    padding: 6px;
  }
  
  .backdrop-clean-bef6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .huge_67ef,
  .modal_3320,
  .notification_21b9,
  .video-f365,
  .link_middle_f6f4,
  .texture-middle-0a9c,
  .down_2098,
  .secondary_middle_361a,
  .tertiary_61bd,
  .top_f565,
  .container_f4cd,
  .detail-white-c219 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .row_76bb,
  .feature_b997 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .sidebar_31e9,
  .photo_14fa,
  .upper_73b4,
  .current-2662,
  .upper-902f,
  .avatar-hot-b452,
  .solid_2d66 {
    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 */
  .accent_c77c,
  .texture-0db8,
  .hard-703f,
  .hero-advanced-1ad8,
  .avatar_e392 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .paragraph_588d,
  .chip-e57c,
  .component_5da2,
  .image-0771 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .white_c607,
  .grid_c33b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accent_d030,
  .pagination-d029,
  .hero_dim_eef7,
  .picture-2a2b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .focus-advanced-5a5b,
  .logo-8f98,
  .east_750a,
  .container-bronze-95ad,
  .up-0a16,
  .status-lower-71fc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accent_c77c,
  .texture-0db8,
  .hero-advanced-1ad8 {
    max-width: none !important;
  }
  
  .surface_461c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .paragraph_588d {
    font-size: 1.5rem !important;
  }
  
  .chip-e57c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .stale_015d,
  .hero-mini-f016 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .component_5da2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .surface_68f0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hidden-cool-05b8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accent_c77c,
  .hero-advanced-1ad8 {
    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: f724 */
.ghost-box-g2 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.3;
}
