/* ============================================
   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 (.wood_5ef4) is a descendant of
   .block_static_70c2 (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.focused-a15a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".motion-76d1" 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_8f99 so it can't cause
   horizontal overflow anyway. */
.out-0020,
.right_cdc2,
.yellow_32c3,
.steel-6953,
.sidebar-light-f437,
.pattern-north-51f4,
.chip_ef80,
.caption-first-0d4f,
.mask-f75f,
.active_last_938b,
.column-last-88a9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .primary_slow_24a7 {
    padding: 8px 0;
  }
  
  .complex_db40 img {
    height: 28px;
    width: auto;
  }
  
  .disabled-solid-3021 {
    display: none !important;
  }
  
  .tooltip-basic-b579 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tooltip-basic-b579 svg {
    width: 14px;
    height: 14px;
  }
  
  .column_dynamic_acfd {
    padding: 6px;
  }
  
  .background_4f73 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .yellow_32c3,
  .right_cdc2,
  .steel-6953,
  .sidebar-light-f437,
  .preview-72c4,
  .easy-e32a,
  .medium-a66a,
  .red-7f4d,
  .pagination_ceee,
  .down-12c3,
  .sidebar-narrow-3c2b,
  .section-narrow-1337 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .feature_8601,
  .new_10a4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paragraph_yellow_cc51,
  .breadcrumb_basic_cbfa,
  .motion_1c96,
  .shade_da3e,
  .surface-hovered-5f4b,
  .north-be90,
  .header-dfc1 {
    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 */
  .bright_d9f2,
  .backdrop-solid-4f05,
  .text-top-c835,
  .info_a0e5,
  .photo-purple-66b2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .column-outer-d7fe,
  .header_134a,
  .info-new-00d9,
  .under-0cf3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .pro_c1bc,
  .card_e7da {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .action-fb48,
  .footer-27f3,
  .north-2916,
  .primary_brown_a63b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cold-1a27,
  .wide_d155,
  .right_4bce,
  .link_next_41c5,
  .mini-fbdf,
  .frame_large_b0fa {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bright_d9f2,
  .backdrop-solid-4f05,
  .info_a0e5 {
    max-width: none !important;
  }
  
  .motion-76d1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .column-outer-d7fe {
    font-size: 1.5rem !important;
  }
  
  .header_134a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gas-e687,
  .description-504c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .info-new-00d9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .menu-bf59 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .full_2f3d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bright_d9f2,
  .info_a0e5 {
    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: fea6 */
.promo-block-i0 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
