/* ============================================
   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 (.banner_04e8) is a descendant of
   .article-dirty-20be (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.detail_e586 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focus_motion_b78f" 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.shade-cold-4722 so it can't cause
   horizontal overflow anyway. */
.footer-3cc9,
.feature-slow-0527,
.primary_c1c6,
.tooltip-effd,
.notification_out_6dfa,
.advanced-fc6f,
.first-c2f3,
.dynamic-52af,
.form_49b9,
.soft_6c7c,
.banner_fb66 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .lower-d3c7 {
    padding: 8px 0;
  }
  
  .tall-bac9 img {
    height: 28px;
    width: auto;
  }
  
  .slow-d47a {
    display: none !important;
  }
  
  .footer_soft_5595 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .footer_soft_5595 svg {
    width: 14px;
    height: 14px;
  }
  
  .wood_5750 {
    padding: 6px;
  }
  
  .paragraph-5044 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .primary_c1c6,
  .feature-slow-0527,
  .tooltip-effd,
  .notification_out_6dfa,
  .border_f209,
  .container_advanced_eb74,
  .module-520e,
  .highlight_c44a,
  .thumbnail-a059,
  .focused_e7fc,
  .soft-b3e5,
  .chip-aa49 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .box_45bd,
  .caption_b202 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cold-a951,
  .caption_a915,
  .gold-8469,
  .table-bronze-dd8d,
  .clean_e9e9,
  .caption-68f6,
  .background-steel-676a {
    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 */
  .focus_ffb6,
  .hot_4441,
  .old-d17c,
  .copper_1f27,
  .menu-ff37 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .right_a78a,
  .video-727c,
  .main-7cac,
  .element-4b51 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .outer-9513,
  .backdrop-1540 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .section_ae04,
  .plasma_7486,
  .block_paper_6d87,
  .fluid_e6c3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .feature_8099,
  .action_10a7,
  .center_1a4b,
  .modal-first-43d9,
  .text-b4f3,
  .dirty-918c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focus_ffb6,
  .hot_4441,
  .copper_1f27 {
    max-width: none !important;
  }
  
  .focus_motion_b78f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .right_a78a {
    font-size: 1.5rem !important;
  }
  
  .video-727c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .lite_bbf1,
  .video_bd53 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .main-7cac {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .upper-e7e6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .stone_6795 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focus_ffb6,
  .copper_1f27 {
    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: 8ee6 */
.phantom-card-l5 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
