/* ============================================
   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 (.gallery_aab7) is a descendant of
   .module_dark_7192 (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.caption_hovered_e11a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".badge_static_ddac" 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.description_b51b so it can't cause
   horizontal overflow anyway. */
.easy-a3a6,
.mask-upper-01b2,
.row_4e71,
.clean_3209,
.menu-2238,
.input-pro-23b1,
.border_full_1596,
.menu_cool_e81c,
.action-e8cd,
.widget_33c4,
.item-stale-5d31 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .primary-narrow-be45 {
    padding: 8px 0;
  }
  
  .notification_037c img {
    height: 28px;
    width: auto;
  }
  
  .thick_534c {
    display: none !important;
  }
  
  .slow_73a5 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .slow_73a5 svg {
    width: 14px;
    height: 14px;
  }
  
  .dark_33eb {
    padding: 6px;
  }
  
  .overlay-5134 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .row_4e71,
  .mask-upper-01b2,
  .clean_3209,
  .menu-2238,
  .summary_5160,
  .white_e17c,
  .banner-light-86e0,
  .modal_wood_9be8,
  .dropdown-5af5,
  .shadow_huge_7b61,
  .logo-591c,
  .section_first_9c66 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .chip-ea89,
  .in-d138 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .surface_cf37,
  .feature-warm-45f4,
  .lite-c0a7,
  .notification-8e77,
  .static_56a1,
  .filter_stone_a9d3,
  .label_lower_2824 {
    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 */
  .slider_c5b2,
  .warm-cf8b,
  .primary-870b,
  .alert_tall_ea2a,
  .up_8c07 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .card_middle_938a,
  .slider_809b,
  .avatar_center_f1ce,
  .list-5d21 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wide-c147,
  .dropdown-5717 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .blue-1baf,
  .bright-f529,
  .wide-ae1c,
  .banner_5e78 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cool_ff70,
  .form_0ee4,
  .form-up-500a,
  .shade-medium-e9c6,
  .outline_hard_bc98,
  .avatar-basic-b7a6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .slider_c5b2,
  .warm-cf8b,
  .alert_tall_ea2a {
    max-width: none !important;
  }
  
  .badge_static_ddac {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .card_middle_938a {
    font-size: 1.5rem !important;
  }
  
  .slider_809b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .action-ff4e,
  .purple-5c00 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .avatar_center_f1ce {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .table_3fe3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .left_0b2d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .slider_c5b2,
  .alert_tall_ea2a {
    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: 0403 */
.ghost-box-h0 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
