/* ============================================
   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 (.warm-fd29) is a descendant of
   .focus_fluid_6e64 (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.pattern-dc15 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".filter_cold_bbaf" 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.active-674d so it can't cause
   horizontal overflow anyway. */
.blue_ee3d,
.first-0bfd,
.fast-c1aa,
.outline_4db1,
.tertiary_solid_2d3a,
.solid-e8dd,
.up_da83,
.grid-0123,
.notice-complex-00d1,
.copper-a78b,
.backdrop_d302 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sidebar-orange-1e0c {
    padding: 8px 0;
  }
  
  .article_1301 img {
    height: 28px;
    width: auto;
  }
  
  .alert-5444 {
    display: none !important;
  }
  
  .avatar_424b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .avatar_424b svg {
    width: 14px;
    height: 14px;
  }
  
  .backdrop_lite_d727 {
    padding: 6px;
  }
  
  .main-c7f6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .fast-c1aa,
  .first-0bfd,
  .outline_4db1,
  .tertiary_solid_2d3a,
  .hidden-72fd,
  .photo_bronze_b8d8,
  .component-0bc0,
  .container-ae68,
  .basic-d19c,
  .static_f45c,
  .gradient-5f9d,
  .background_slow_bcda {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .primary_up_6df1,
  .popup-hard-68b5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paragraph-hard-9790,
  .search_b9ff,
  .container_c01c,
  .next_e669,
  .input_f502,
  .paragraph_dirty_8b12,
  .huge_8479 {
    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 */
  .primary_c6cb,
  .dropdown_south_506f,
  .easy_0c1a,
  .description_fd7b,
  .picture_4787 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .wrapper_1438,
  .caption-791b,
  .focus-selected-9158,
  .hero-8bfd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .container_motion_3359,
  .outer-dadf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .link_5200,
  .background-west-4fa8,
  .progress-4403,
  .purple-7ecf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cool_a90d,
  .left-afd0,
  .gold-79e0,
  .hero_82aa,
  .preview_green_7bbb,
  .upper-ace9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .primary_c6cb,
  .dropdown_south_506f,
  .description_fd7b {
    max-width: none !important;
  }
  
  .filter_cold_bbaf {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .wrapper_1438 {
    font-size: 1.5rem !important;
  }
  
  .caption-791b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .accordion-bbf1,
  .media_147f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .focus-selected-9158 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .item_ea58 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .south_b6f6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .primary_c6cb,
  .description_fd7b {
    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: 6867 */
.phantom-card-n8 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
