/* ============================================
   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 (.notification_0cf6) is a descendant of
   .label-pressed-c4aa (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.hidden-brown-652c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tooltip-e9e7" 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.video_in_73fc so it can't cause
   horizontal overflow anyway. */
.over-ba14,
.mini-f953,
.dropdown-rough-0d2b,
.component_orange_da52,
.up_f077,
.accent-0848,
.background_pro_c432,
.sidebar_brown_a847,
.gas_b18f,
.element-866d,
.header-2d1f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module_down_8821 {
    padding: 8px 0;
  }
  
  .under-33a9 img {
    height: 28px;
    width: auto;
  }
  
  .photo_cool_8f33 {
    display: none !important;
  }
  
  .column-clean-dd63 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .column-clean-dd63 svg {
    width: 14px;
    height: 14px;
  }
  
  .layout_b99b {
    padding: 6px;
  }
  
  .surface_2ecb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dropdown-rough-0d2b,
  .mini-f953,
  .component_orange_da52,
  .up_f077,
  .footer-wide-cfd5,
  .cool-329a,
  .summary-f20d,
  .left-2970,
  .pattern_9ae0,
  .complex_f0aa,
  .panel-wide-204c,
  .module-green-37f8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .complex_198c,
  .highlight_wood_9fe7 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .list-dynamic-2b53,
  .lite-6c08,
  .light-b8be,
  .easy-cc2b,
  .pro_c581,
  .slider_tiny_270f,
  .accordion-south-08a5 {
    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 */
  .section-in-7944,
  .slow_1cf7,
  .prev-1f84,
  .new-594a,
  .picture_bdf4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hidden-97d8,
  .wide_5a52,
  .fresh_f924,
  .hot_4d17 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shadow_c90b,
  .frame_out_4c8f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .glass_d4c1,
  .nav-e6be,
  .prev_1801,
  .menu_fluid_0b44 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .popup_a609,
  .shadow-bfd8,
  .sidebar-west-65ba,
  .hover-rough-3d49,
  .item-huge-1ca1,
  .chip-over-8e51 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .section-in-7944,
  .slow_1cf7,
  .new-594a {
    max-width: none !important;
  }
  
  .tooltip-e9e7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hidden-97d8 {
    font-size: 1.5rem !important;
  }
  
  .wide_5a52 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .slow_2809,
  .stone-78a0 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fresh_f924 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .container-active-e342 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .caption-plasma-f51b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .section-in-7944,
  .new-594a {
    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: 800b */
.shadow-element-t5 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
