/* ============================================
   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 (.dim_0582) is a descendant of
   .footer_7f8a (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.background-dim-67db {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".picture-dc09" 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.notification_new_d41e so it can't cause
   horizontal overflow anyway. */
.steel_6824,
.rough_f3af,
.carousel_de74,
.light-cc8c,
.fixed-f12b,
.picture-49ab,
.bright_cf21,
.white_4080,
.widget-mini-8a2b,
.dim_1c2f,
.title_advanced_f577 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .component-plasma-051b {
    padding: 8px 0;
  }
  
  .highlight-warm-c743 img {
    height: 28px;
    width: auto;
  }
  
  .under_529c {
    display: none !important;
  }
  
  .tabs-cce6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tabs-cce6 svg {
    width: 14px;
    height: 14px;
  }
  
  .gradient-dynamic-b074 {
    padding: 6px;
  }
  
  .paragraph-e2c9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .carousel_de74,
  .rough_f3af,
  .light-cc8c,
  .fixed-f12b,
  .wood_41c1,
  .alert_green_1d17,
  .shade-prev-e994,
  .sidebar_pink_f3d9,
  .liquid_bcdb,
  .gradient_fd08,
  .avatar-selected-dc8f,
  .mask_last_cc99 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .media-ab9f,
  .picture-motion-a72b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shadow-09dd,
  .secondary_east_bbaa,
  .shade-slow-2253,
  .modal_ff97,
  .static-584d,
  .plasma_47f1,
  .clean-1d74 {
    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 */
  .title_smooth_f625,
  .north-6a55,
  .avatar-thick-312d,
  .border_bottom_ba7d,
  .detail_small_3c48 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .video-cold-1fe4,
  .selected-8479,
  .preview_6d8f,
  .pattern_b54d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .table-692a,
  .hover-short-4d7f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture-ce07,
  .form-504d,
  .texture_d936,
  .dynamic_4794 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .menu-dim-d3a1,
  .list_dynamic_fddc,
  .soft-14cc,
  .highlight_middle_c0c2,
  .layout-f963,
  .cool_9a4a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .title_smooth_f625,
  .north-6a55,
  .border_bottom_ba7d {
    max-width: none !important;
  }
  
  .picture-dc09 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .video-cold-1fe4 {
    font-size: 1.5rem !important;
  }
  
  .selected-8479 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .grid-gas-6d42,
  .hero-0633 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .preview_6d8f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hover_plasma_14b2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .breadcrumb_5467 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .title_smooth_f625,
  .border_bottom_ba7d {
    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: e1d9 */
.shadow-element-j5 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.1;
}
