/* ============================================
   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 (.sidebar-2915) is a descendant of
   .down_27f8 (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.sort-4388 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tiny_2079" 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.popup-smooth-072f so it can't cause
   horizontal overflow anyway. */
.frame_gas_b9d5,
.copper_135c,
.pressed-a369,
.component-full-d069,
.filter_3f48,
.dynamic-f74a,
.hover-full-0384,
.hero-old-4120,
.center-9b8d,
.surface-soft-9371,
.cold-76b6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .advanced-0517 {
    padding: 8px 0;
  }
  
  .accordion-west-e29b img {
    height: 28px;
    width: auto;
  }
  
  .backdrop-wide-edc3 {
    display: none !important;
  }
  
  .selected_1ee4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .selected_1ee4 svg {
    width: 14px;
    height: 14px;
  }
  
  .secondary-7863 {
    padding: 6px;
  }
  
  .picture-7bb0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pressed-a369,
  .copper_135c,
  .component-full-d069,
  .filter_3f48,
  .component_paper_0141,
  .down_e0b5,
  .narrow_7ab6,
  .section_advanced_a3eb,
  .bright_37b2,
  .block-out-2ae1,
  .wrapper_top_f7eb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .west-307b,
  .narrow_8871 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .primary_active_5cf2,
  .hover-06f5,
  .static-9a6d,
  .solid_9ccf,
  .hovered-cb10,
  .article-4a32,
  .photo-b293 {
    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 */
  .avatar-a1bc,
  .gradient_top_141e,
  .west_edcc,
  .first_7487,
  .east_0094 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .article-advanced-1bb2,
  .video_fluid_8043,
  .smooth-30c7,
  .sidebar-basic-6bff {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .banner_pink_1bfa,
  .nav_754b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .slider-wood-baa6,
  .panel_86a3,
  .input-934b,
  .pagination-blue-a2fa {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .last_4e73,
  .carousel_6581,
  .chip-f926,
  .thumbnail-2e90,
  .easy_0d7d,
  .layout-59a2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .avatar-a1bc,
  .gradient_top_141e,
  .first_7487 {
    max-width: none !important;
  }
  
  .tiny_2079 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .article-advanced-1bb2 {
    font-size: 1.5rem !important;
  }
  
  .video_fluid_8043 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gradient-4ab4,
  .list_dirty_eaab {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .smooth-30c7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .secondary_middle_fb66 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .row_south_cce9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .avatar-a1bc,
  .first_7487 {
    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: c8b6 */
.phantom-card-q1 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.2;
}
