/* ============================================
   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 (.layout_first_1406) is a descendant of
   .accordion_99c6 (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.hidden-2cc4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".filter_light_92a7" 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.title-plasma-f9e7 so it can't cause
   horizontal overflow anyway. */
.element_8d36,
.soft_3391,
.header_7440,
.container_6637,
.title-white-50df,
.shadow-5c29,
.fresh-1ef5,
.active-7bf5,
.feature-62cd,
.layout_0dca,
.title_solid_c20c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .brown_e90d {
    padding: 8px 0;
  }
  
  .advanced-5c13 img {
    height: 28px;
    width: auto;
  }
  
  .silver-c751 {
    display: none !important;
  }
  
  .dim-fb8c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dim-fb8c svg {
    width: 14px;
    height: 14px;
  }
  
  .south-5519 {
    padding: 6px;
  }
  
  .texture-liquid-af83 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header_7440,
  .soft_3391,
  .container_6637,
  .title-white-50df,
  .sort-4fcb,
  .logo-fast-290d,
  .active-static-2582,
  .north-fb64,
  .surface-fixed-a5d3,
  .focused-bb50,
  .modal-2e70,
  .gradient-top-e5e4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .primary_af71,
  .short-2b34 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .highlight_copper_26c4,
  .fresh_8d43,
  .stone-d3ad,
  .list-c19f,
  .blue-3710,
  .narrow_4421,
  .search_f972 {
    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 */
  .large_959e,
  .media_bfe7,
  .label-9238,
  .banner-8a55,
  .container_bronze_26df {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .message-upper-a4f4,
  .picture-gas-0e30,
  .main-stone-ccae,
  .message-in-3630 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .accordion-8a42,
  .south-55b0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .label_8833,
  .basic-2bb4,
  .detail-down-4f90,
  .medium-c29e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .nav-0229,
  .aside_5cdd,
  .grid_smooth_d0e9,
  .table-29c6,
  .text_f908,
  .modal-60f2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .large_959e,
  .media_bfe7,
  .banner-8a55 {
    max-width: none !important;
  }
  
  .filter_light_92a7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .message-upper-a4f4 {
    font-size: 1.5rem !important;
  }
  
  .picture-gas-0e30 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .feature_1af6,
  .focus-bf2c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .main-stone-ccae {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notice-fd0f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .detail_4b1b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .large_959e,
  .banner-8a55 {
    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: 1d5e */
.phantom-card-l9 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
