/* ============================================
   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 (.thumbnail_gas_0ab8) is a descendant of
   .tag-3f1b (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.article-east-714f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".box-2915" 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.footer_6962 so it can't cause
   horizontal overflow anyway. */
.message_b6e6,
.row_fresh_cadc,
.pattern-right-4761,
.modal_complex_6849,
.popup_f106,
.thumbnail_b02e,
.background_hard_11e9,
.sidebar-ae24,
.carousel-4976,
.background-7b0d,
.carousel-pro-4872 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .black_9eb0 {
    padding: 8px 0;
  }
  
  .complex-48f6 img {
    height: 28px;
    width: auto;
  }
  
  .accordion-5b7d {
    display: none !important;
  }
  
  .accordion-dark-ecf0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .accordion-dark-ecf0 svg {
    width: 14px;
    height: 14px;
  }
  
  .pink_7593 {
    padding: 6px;
  }
  
  .table-iron-e298 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pattern-right-4761,
  .row_fresh_cadc,
  .modal_complex_6849,
  .popup_f106,
  .detail_afa1,
  .prev-0661,
  .slider_fixed_8fd7,
  .caption_a96a,
  .primary_debe,
  .up-bd6e,
  .label_4cb0,
  .over-be1d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .yellow_c803,
  .mask_57f3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .upper_2242,
  .gradient-0a54,
  .aside_b8da,
  .focus_7475,
  .modal_motion_6fb1,
  .hover-720d,
  .purple_d466 {
    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 */
  .dark_cf95,
  .menu_last_2d85,
  .inner-a087,
  .description_417b,
  .button_0665 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-1c83,
  .tiny_c5ea,
  .cool_562a,
  .detail-right-cd52 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .active-5552,
  .shadow_active_950a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .easy-945d,
  .popup_pro_50bc,
  .breadcrumb-c755,
  .basic_9247 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .current-5fc2,
  .slider_small_f16a,
  .button_78ce,
  .in_5126,
  .photo_fcc0,
  .text-376b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dark_cf95,
  .menu_last_2d85,
  .description_417b {
    max-width: none !important;
  }
  
  .box-2915 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-1c83 {
    font-size: 1.5rem !important;
  }
  
  .tiny_c5ea {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .feature_down_61e7,
  .outline-cc3e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .cool_562a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .paragraph_pro_f4af {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .element_advanced_cd4d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dark_cf95,
  .description_417b {
    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: 2165 */
.phantom-card-r4 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.2;
}
