/* ============================================
   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 (.paper-9bd5) is a descendant of
   .bright_d292 (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.hover-dd2d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".progress_dynamic_d510" 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_8d48 so it can't cause
   horizontal overflow anyway. */
.description-narrow-8164,
.orange-a5a7,
.narrow-d509,
.south_af9a,
.heading-d65b,
.dropdown-inner-f244,
.short_4ae5,
.stale_c8a4,
.gallery-dynamic-dc2b,
.media_5b9a,
.backdrop-white-626c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .text_ff8e {
    padding: 8px 0;
  }
  
  .input_a660 img {
    height: 28px;
    width: auto;
  }
  
  .video_pink_2d3f {
    display: none !important;
  }
  
  .outer_5f1e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .outer_5f1e svg {
    width: 14px;
    height: 14px;
  }
  
  .tooltip-c1d2 {
    padding: 6px;
  }
  
  .stale_bb3b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .narrow-d509,
  .orange-a5a7,
  .south_af9a,
  .heading-d65b,
  .slider_b083,
  .outline_clean_44c7,
  .badge-027a,
  .layout-7f63,
  .menu-5962,
  .modal_copper_61aa,
  .bright_93aa {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .black_9eed,
  .gradient_short_8a5a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .popup-pro-15bf,
  .pattern-basic-2f2e,
  .sort_5397,
  .icon-035b,
  .detail-3b01,
  .list_white_ec37,
  .logo_gas_d496 {
    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 */
  .overlay-in-00a6,
  .info_outer_b9d5,
  .feature-9229,
  .layout-18b3,
  .tooltip-94ac {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .last_650a,
  .pagination-3ece,
  .tag_hard_e1ba,
  .list-a616 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero_f5e6,
  .overlay-8279 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .copper-caf2,
  .fixed-cea1,
  .stale_f2b6,
  .sidebar_a93e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notice-c0fe,
  .item_d53e,
  .table-left-b1e5,
  .paragraph-north-325d,
  .accent-035f,
  .complex-9225 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .overlay-in-00a6,
  .info_outer_b9d5,
  .layout-18b3 {
    max-width: none !important;
  }
  
  .progress_dynamic_d510 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .last_650a {
    font-size: 1.5rem !important;
  }
  
  .pagination-3ece {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .component-4fce,
  .banner_54ad {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tag_hard_e1ba {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .paper-96b6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .column_wide_81c3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .overlay-in-00a6,
  .layout-18b3 {
    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: a088 */
.ghost-box-c7 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
