/* ============================================
   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 (.steel-de4d) is a descendant of
   .prev-3fe4 (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.slow_72e4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".info-09eb" 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.large-384f so it can't cause
   horizontal overflow anyway. */
.module-copper-4a5a,
.popup_3205,
.banner-outer-dc79,
.tabs-iron-5b13,
.basic_fec1,
.focus-693c,
.texture_5cc8,
.center-6556,
.menu-bottom-78bc,
.narrow-de30,
.top_23a2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .surface-rough-8f4b {
    padding: 8px 0;
  }
  
  .blue-7452 img {
    height: 28px;
    width: auto;
  }
  
  .tag-inner-5ae7 {
    display: none !important;
  }
  
  .header-0974 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .header-0974 svg {
    width: 14px;
    height: 14px;
  }
  
  .alert_087b {
    padding: 6px;
  }
  
  .paper_dc97 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner-outer-dc79,
  .popup_3205,
  .tabs-iron-5b13,
  .basic_fec1,
  .backdrop-9f18,
  .menu_advanced_3a7b,
  .image_176e,
  .cold-cdd4,
  .carousel-a64b,
  .rough_6cea,
  .element_selected_7d5e,
  .progress-d382 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail_3334,
  .next_5404 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .light-7cf6,
  .alert-large-8d75,
  .hard-e317,
  .video_hovered_6653,
  .container_436b,
  .outer_43a2,
  .element-over-8929 {
    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 */
  .prev-b7c1,
  .modal_ea00,
  .panel-3313,
  .status_hard_e7ee,
  .first_7d33 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .full-710f,
  .highlight_406f,
  .heading_259c,
  .stone_9b6e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .module-aa62,
  .plasma-72f0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .description_47e7,
  .east-ac90,
  .feature_aed4,
  .hovered-b006 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .preview_pro_7beb,
  .lite-38c5,
  .paragraph-c41d,
  .secondary_94f6,
  .modal_orange_2d9f,
  .gallery_7d56 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .prev-b7c1,
  .modal_ea00,
  .status_hard_e7ee {
    max-width: none !important;
  }
  
  .info-09eb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .full-710f {
    font-size: 1.5rem !important;
  }
  
  .highlight_406f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .message-green-bf1d,
  .west-b483 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .heading_259c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .search_169d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dropdown_5f04 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .prev-b7c1,
  .status_hard_e7ee {
    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: 6fb1 */
.ghost-box-s8 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.0;
}
