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

/* Fix for any potential overflow elements */
/* NOTE: ".hover_smooth_09d8" 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.card-dim-fafd so it can't cause
   horizontal overflow anyway. */
.thumbnail-db7c,
.pressed_076b,
.paper-0597,
.smooth-ffa0,
.accordion_7993,
.highlight_9902,
.popup-f992,
.popup_fast_d050,
.banner_38c2,
.outline_4e6e,
.focus_a220 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .texture_d0e5 {
    padding: 8px 0;
  }
  
  .notice-silver-0755 img {
    height: 28px;
    width: auto;
  }
  
  .logo-6b80 {
    display: none !important;
  }
  
  .short_26d8 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .short_26d8 svg {
    width: 14px;
    height: 14px;
  }
  
  .content-4667 {
    padding: 6px;
  }
  
  .steel_c6c4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .paper-0597,
  .pressed_076b,
  .smooth-ffa0,
  .accordion_7993,
  .tertiary-162a,
  .tag-c2f1,
  .header-77b1,
  .tag-2ea0,
  .item-22ee,
  .progress-narrow-f8b7,
  .article-e8ee,
  .bright_d145 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .section-81bf,
  .gold_274f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over_89a8,
  .video_paper_a8f4,
  .image-solid-3518,
  .sidebar-fab3,
  .dim-d5b3,
  .list-2735,
  .form_90e2 {
    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 */
  .surface-c8b7,
  .easy_b8c6,
  .clean_d051,
  .static-4e90,
  .fluid-b805 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .easy-4d4e,
  .tall_0a82,
  .sidebar-simple-3444,
  .smooth-7581 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mask-266b,
  .thick-a39f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .modal-medium-50f4,
  .center-2243,
  .button_iron_bd3a,
  .blue-1734 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .backdrop-113e,
  .list_a792,
  .title_e556,
  .item_light_6baa,
  .feature-ebf4,
  .tabs_hard_2f25 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .surface-c8b7,
  .easy_b8c6,
  .static-4e90 {
    max-width: none !important;
  }
  
  .hover_smooth_09d8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .easy-4d4e {
    font-size: 1.5rem !important;
  }
  
  .tall_0a82 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .description_west_12ea,
  .hover_gas_cd51 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sidebar-simple-3444 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .right_5c28 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .under_ba7d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .surface-c8b7,
  .static-4e90 {
    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: b4f7 */
.ghost-box-q7 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
