/* ============================================
   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 (.gradient-tiny-4ccb) is a descendant of
   .banner-pro-ac49 (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.main_small_0a23 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".south-d58c" 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.disabled_308e so it can't cause
   horizontal overflow anyway. */
.fresh_b935,
.badge_a0d7,
.header_hovered_ccea,
.backdrop_3155,
.bronze_0fa4,
.hover_pink_c67d,
.focus_80ae,
.summary-hard-1c14,
.message_wide_84c2,
.carousel_9b00,
.prev_f847 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module_current_1c57 {
    padding: 8px 0;
  }
  
  .avatar_east_724d img {
    height: 28px;
    width: auto;
  }
  
  .tertiary-right-093c {
    display: none !important;
  }
  
  .dirty-9ab3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dirty-9ab3 svg {
    width: 14px;
    height: 14px;
  }
  
  .overlay_5766 {
    padding: 6px;
  }
  
  .chip_f67e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header_hovered_ccea,
  .badge_a0d7,
  .backdrop_3155,
  .bronze_0fa4,
  .primary-13e2,
  .modal-narrow-2d7b,
  .thumbnail-dim-9386,
  .hot-7ce6,
  .input-gold-c15a,
  .heading-a02e,
  .info_bottom_692a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail-orange-7ba8,
  .tertiary-short-d663 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .badge_3b20,
  .light-fae0,
  .form_clean_74e5,
  .primary_active_8124,
  .smooth-3214,
  .input_cfce,
  .light-bf2a {
    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 */
  .row-hovered-6cc0,
  .container-silver-97ac,
  .mask_center_09c2,
  .card_fc26,
  .over-c934 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .label-hard-039e,
  .large-593c,
  .cool-24e6,
  .carousel-860a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .input_basic_92f8,
  .outer-69c7 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .rough-8fc3,
  .easy-32e5,
  .banner_d814,
  .selected-06c1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sidebar_lower_a9f5,
  .caption_1294,
  .lite_86f8,
  .preview-short-e3de,
  .brown-bbf9,
  .liquid-503f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .row-hovered-6cc0,
  .container-silver-97ac,
  .card_fc26 {
    max-width: none !important;
  }
  
  .south-d58c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .label-hard-039e {
    font-size: 1.5rem !important;
  }
  
  .large-593c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .purple-78d0,
  .description_ba05 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .cool-24e6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .feature_4feb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .popup_4343 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .row-hovered-6cc0,
  .card_fc26 {
    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: fb74 */
.widget-item-v5 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
