/* ============================================
   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-6702) is a descendant of
   .row-pink-4507 (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.advanced-7169 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".slider_a21b" 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.avatar_iron_a03f so it can't cause
   horizontal overflow anyway. */
.container-1eac,
.search_dim_8453,
.lower_a80c,
.tabs_gas_a655,
.paragraph-liquid-4cf9,
.pattern_white_e2e8,
.small_a199,
.image-9b44,
.tag_small_1805,
.preview_blue_cc94,
.outline_basic_b9b9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .green_093d {
    padding: 8px 0;
  }
  
  .widget_medium_6e7b img {
    height: 28px;
    width: auto;
  }
  
  .stone_d0eb {
    display: none !important;
  }
  
  .logo-a4e8 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .logo-a4e8 svg {
    width: 14px;
    height: 14px;
  }
  
  .paragraph_dd8f {
    padding: 6px;
  }
  
  .over-a141 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .lower_a80c,
  .search_dim_8453,
  .tabs_gas_a655,
  .paragraph-liquid-4cf9,
  .primary_a84f,
  .layout-black-075f,
  .table-active-7b70,
  .article_old_bc6d,
  .accordion-4d12,
  .caption_a7bc,
  .progress_1db3,
  .inner-f011 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .surface_fluid_7a54,
  .active-short-807f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .picture-8b2c,
  .pagination-ed5e,
  .hidden_pink_cbec,
  .tabs_99e7,
  .main_top_2758,
  .section_cbc3,
  .carousel-red-d308 {
    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 */
  .old_eb92,
  .bottom-e0f5,
  .surface-bronze-bc4c,
  .surface-fresh-4654,
  .lower-b027 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .breadcrumb_black_8332,
  .button-dim-4838,
  .status_fixed_e494,
  .warm-8f7a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gold-0a68,
  .hard_8175 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sort-cf04,
  .clean_0913,
  .copper-ed94,
  .motion_0552 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first-1514,
  .popup-0390,
  .main_a1d9,
  .orange_edcb,
  .highlight-middle-1696,
  .disabled_purple_23d3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .old_eb92,
  .bottom-e0f5,
  .surface-fresh-4654 {
    max-width: none !important;
  }
  
  .slider_a21b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .breadcrumb_black_8332 {
    font-size: 1.5rem !important;
  }
  
  .button-dim-4838 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .item-blue-4745,
  .component-7217 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .status_fixed_e494 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .mask-75a8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .row-outer-1e53 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .old_eb92,
  .surface-fresh-4654 {
    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: 0032 */
.phantom-card-w4 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.2;
}
