/* ============================================
   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 (.lite_4991) is a descendant of
   .item-72ab (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.message-4fb9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".form_5c95" 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.badge_tiny_0066 so it can't cause
   horizontal overflow anyway. */
.title_hot_9fa1,
.fresh_65af,
.large_ca12,
.alert-top-915d,
.disabled_ccd4,
.tertiary-smooth-acbf,
.input_fixed_2854,
.shade_south_b5a0,
.top_5e93,
.hidden-large-bcb9,
.tiny-0ff8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .button-71c4 {
    padding: 8px 0;
  }
  
  .detail-39a1 img {
    height: 28px;
    width: auto;
  }
  
  .button-6359 {
    display: none !important;
  }
  
  .south_90e5 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .south_90e5 svg {
    width: 14px;
    height: 14px;
  }
  
  .inner_2092 {
    padding: 6px;
  }
  
  .rough-99d2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .large_ca12,
  .fresh_65af,
  .alert-top-915d,
  .disabled_ccd4,
  .large_ba89,
  .gallery_b415,
  .iron-0900,
  .hero-67cb,
  .hero-fb40,
  .message_89dc,
  .hidden-4738,
  .tag_82ee {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail-3da8,
  .inner_c400 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .warm_3e3b,
  .selected_de14,
  .nav_solid_d1f1,
  .overlay-160b,
  .logo-glass-0975,
  .sidebar_faba,
  .grid_smooth_cd0e {
    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 */
  .element-93c9,
  .picture-medium-c594,
  .focus-1822,
  .avatar-674a,
  .nav_small_4ddf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .picture_fb78,
  .status-action-df57,
  .description-complex-0046,
  .small-d71c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .static_d3bf,
  .disabled_a952 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .motion_373f,
  .pattern-black-b6f0,
  .lower-ad33,
  .east-268c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .brown_a7b3,
  .article_9c92,
  .avatar_a74a,
  .block_green_3886,
  .lower-78fb,
  .pressed_5394 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element-93c9,
  .picture-medium-c594,
  .avatar-674a {
    max-width: none !important;
  }
  
  .form_5c95 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .picture_fb78 {
    font-size: 1.5rem !important;
  }
  
  .status-action-df57 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .stale-9605,
  .small_482b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .description-complex-0046 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .modal_old_4f98 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .element_dark_d3a0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element-93c9,
  .avatar-674a {
    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: 5773 */
.promo-block-z4 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
