/* ============================================
   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 (.aside-eea7) is a descendant of
   .large-e40a (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.text_out_7622 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".banner-ffb2" 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.small_443a so it can't cause
   horizontal overflow anyway. */
.thumbnail_center_6d79,
.row_fluid_ff9b,
.grid-paper-82cd,
.over_fc99,
.north-49d3,
.form-c804,
.status_inner_0d3d,
.main-05a3,
.text-dim-8f71,
.secondary-mini-d8cd,
.outline-0eb0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .accordion-wide-ad45 {
    padding: 8px 0;
  }
  
  .border-red-714e img {
    height: 28px;
    width: auto;
  }
  
  .info-c5fc {
    display: none !important;
  }
  
  .background-5c13 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .background-5c13 svg {
    width: 14px;
    height: 14px;
  }
  
  .active-8ddc {
    padding: 6px;
  }
  
  .title-035f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .grid-paper-82cd,
  .row_fluid_ff9b,
  .over_fc99,
  .north-49d3,
  .menu-first-4a14,
  .modal_smooth_52e2,
  .primary_c42c,
  .image-c492,
  .tall_bef7,
  .paragraph_7d9b,
  .easy_1f9d,
  .dynamic_7875 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .steel_28e1,
  .tertiary_old_0c91 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .disabled_slow_00d2,
  .nav-fb5f,
  .hard-2d37,
  .picture_light_5672,
  .first_1986,
  .alert-4b16,
  .breadcrumb_b13a {
    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 */
  .accordion-ada2,
  .light-d4e0,
  .stale_e89b,
  .gas-b552,
  .container-hot-8822 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .message-723c,
  .widget-green-c222,
  .menu-a0fb,
  .detail-top-8a72 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .soft-8e02,
  .row_action_4789 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .top_0342,
  .disabled_ac0b,
  .backdrop_0b3c,
  .dark-af51 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .menu-9701,
  .texture_3f14,
  .section_4e5a,
  .header-0b33,
  .bronze_5c39,
  .modal_under_1a36 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accordion-ada2,
  .light-d4e0,
  .gas-b552 {
    max-width: none !important;
  }
  
  .banner-ffb2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .message-723c {
    font-size: 1.5rem !important;
  }
  
  .widget-green-c222 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tag-fast-5ed1,
  .badge_copper_132f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .menu-a0fb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .paragraph-5896 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .feature_ab05 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accordion-ada2,
  .gas-b552 {
    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: 5150 */
.phantom-card-v3 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.1;
}
