/* ============================================
   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 (.media_smooth_ba9a) is a descendant of
   .fast_697f (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.wrapper-9cc0 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".input-45e8" 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.form-medium-90b9 so it can't cause
   horizontal overflow anyway. */
.top-3e4e,
.text_action_6626,
.heading_7e89,
.popup_green_a306,
.article_65da,
.panel_3745,
.over-ec8a,
.feature-steel-02b3,
.rough_0b7b,
.item_285f,
.hover_7a6a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .down_b8d1 {
    padding: 8px 0;
  }
  
  .prev-182c img {
    height: 28px;
    width: auto;
  }
  
  .wrapper_3df2 {
    display: none !important;
  }
  
  .full-3b09 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .full-3b09 svg {
    width: 14px;
    height: 14px;
  }
  
  .dynamic_7455 {
    padding: 6px;
  }
  
  .backdrop-tall-a509 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .heading_7e89,
  .text_action_6626,
  .popup_green_a306,
  .article_65da,
  .clean-cd49,
  .badge-green-85ab,
  .lower_b9e6,
  .gallery_over_ae16,
  .advanced-c72a,
  .thick-df9a,
  .status-19d1,
  .aside-green-a5fa {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .prev-a6cb,
  .avatar_3996 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header-3a89,
  .photo-5b64,
  .button-paper-bf1c,
  .popup_liquid_1750,
  .card-bc69,
  .progress_red_a4e3,
  .under_21a4 {
    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 */
  .red_606c,
  .component-3917,
  .heading_active_5fd6,
  .detail_pink_6a9b,
  .pattern_purple_2ca6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tall_ca27,
  .gallery_fresh_f35f,
  .orange_c154,
  .slow-019f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tag-center-72ce,
  .inner_1ae6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .action-b6a0,
  .block-down-a32d,
  .hot_201e,
  .slider_6ba7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notice-626f,
  .status_b00c,
  .tooltip_light_bbfd,
  .north_80d1,
  .notification-advanced-0e79,
  .status-2a2d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .red_606c,
  .component-3917,
  .detail_pink_6a9b {
    max-width: none !important;
  }
  
  .input-45e8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tall_ca27 {
    font-size: 1.5rem !important;
  }
  
  .gallery_fresh_f35f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .grid-274c,
  .medium_186e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .orange_c154 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .smooth_116b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .picture_small_370e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .red_606c,
  .detail_pink_6a9b {
    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: fce4 */
.ghost-box-d0 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.1;
}
