/* ============================================
   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 (.soft_6782) is a descendant of
   .shade_47dd (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.avatar-left-5b87 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".next-d943" 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.label_081d so it can't cause
   horizontal overflow anyway. */
.photo_d577,
.video-cc37,
.plasma_7b01,
.border_e61e,
.tiny-b711,
.motion-dfa6,
.card-selected-5971,
.wood-ecc9,
.message_6fa6,
.thumbnail-8a6e,
.popup-smooth-4f16 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .over-66a0 {
    padding: 8px 0;
  }
  
  .notification_advanced_d7c9 img {
    height: 28px;
    width: auto;
  }
  
  .dirty-94bf {
    display: none !important;
  }
  
  .form-fast-46d4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .form-fast-46d4 svg {
    width: 14px;
    height: 14px;
  }
  
  .preview_tiny_63e9 {
    padding: 6px;
  }
  
  .right_f144 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .plasma_7b01,
  .video-cc37,
  .border_e61e,
  .tiny-b711,
  .tabs_thick_4194,
  .element-a61b,
  .card-liquid-9fb6,
  .feature_advanced_8332,
  .down-3ab6,
  .tabs-easy-78ee,
  .brown-ed6b,
  .secondary_next_ac31 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .lite-a32c,
  .easy-7b25 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .texture_short_bd97,
  .cool_a916,
  .up_0ade,
  .tall-f225,
  .pattern-rough-a885,
  .short-a596,
  .light-40b8 {
    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 */
  .container-40b6,
  .accordion-gas-ca65,
  .fresh-773b,
  .gradient-44f7,
  .hidden_silver_6481 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .slider_9d36,
  .nav-mini-0030,
  .highlight_5629,
  .component_456d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .column-2c1f,
  .heading-purple-e174 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .link_488c,
  .pro_e54e,
  .surface-active-21f2,
  .focused_ecad {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .progress-bronze-c1c5,
  .hot_1776,
  .hover_outer_c12d,
  .notification_soft_b6a0,
  .heading-b688,
  .hero_pressed_7fd1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .container-40b6,
  .accordion-gas-ca65,
  .gradient-44f7 {
    max-width: none !important;
  }
  
  .next-d943 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .slider_9d36 {
    font-size: 1.5rem !important;
  }
  
  .nav-mini-0030 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination-silver-46d8,
  .media-02b3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .highlight_5629 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sort-e373 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sidebar-24c8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .container-40b6,
  .gradient-44f7 {
    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: 842f */
.widget-item-u5 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.2;
}
