/* ============================================
   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 (.mask-first-0314) is a descendant of
   .chip_thick_c51d (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.tabs_out_4ea5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".info-0e0d" 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_aeb6 so it can't cause
   horizontal overflow anyway. */
.photo_fluid_32c0,
.module_962c,
.text-dark-2749,
.element-e581,
.search-8e76,
.card-last-e75e,
.rough-3e91,
.soft-ebe6,
.link-bc7c,
.nav_3c5a,
.banner-new-2bbf {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .container-945e {
    padding: 8px 0;
  }
  
  .out-3c22 img {
    height: 28px;
    width: auto;
  }
  
  .accordion_fe18 {
    display: none !important;
  }
  
  .video_a371 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .video_a371 svg {
    width: 14px;
    height: 14px;
  }
  
  .message-e271 {
    padding: 6px;
  }
  
  .banner-in-1d9c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .text-dark-2749,
  .module_962c,
  .element-e581,
  .search-8e76,
  .tiny-13ff,
  .wrapper_80dd,
  .north_f4e0,
  .liquid_8c08,
  .backdrop_24d9,
  .black_fedd,
  .wrapper-66ed {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gallery_07de,
  .lower_63e2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .texture_9595,
  .paper-be06,
  .hard-64a1,
  .description_current_139c,
  .dim_a274,
  .red_9c2c,
  .sort-5200 {
    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 */
  .status-iron-c34d,
  .highlight_gas_8ab8,
  .lower_096c,
  .header-82b3,
  .white_e535 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .container-e0db,
  .focused_5f1a,
  .message-ffe6,
  .title-e737 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero-out-3da7,
  .slider-27ad {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .thumbnail-bright-51ac,
  .detail_1563,
  .panel_soft_a09b,
  .dynamic-a270 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .layout-255d,
  .card_de01,
  .hot_5035,
  .gradient_0ca8,
  .input_b4ec,
  .hover_cc22 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .status-iron-c34d,
  .highlight_gas_8ab8,
  .header-82b3 {
    max-width: none !important;
  }
  
  .info-0e0d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .container-e0db {
    font-size: 1.5rem !important;
  }
  
  .focused_5f1a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .status-6282,
  .slow-2b93 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .message-ffe6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .heading_e8d9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notification_solid_6a1f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .status-iron-c34d,
  .header-82b3 {
    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: f59d */
.ghost-box-a9 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.0;
}
