/* ============================================
   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 (.iron_4728) is a descendant of
   .dark-06b2 (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.card-e9e1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".selected-cfee" 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.media-steel-ff15 so it can't cause
   horizontal overflow anyway. */
.section_0e73,
.media-b565,
.menu_bronze_6994,
.mask_stone_6b90,
.medium-0ceb,
.container_silver_a379,
.panel-7ccb,
.element-4a3f,
.overlay_pink_052f,
.primary_f84d,
.video_black_a8b8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notice-b730 {
    padding: 8px 0;
  }
  
  .right_7f36 img {
    height: 28px;
    width: auto;
  }
  
  .paragraph-93da {
    display: none !important;
  }
  
  .hover-5978 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hover-5978 svg {
    width: 14px;
    height: 14px;
  }
  
  .hidden-action-4bc9 {
    padding: 6px;
  }
  
  .up-ce4c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .menu_bronze_6994,
  .media-b565,
  .mask_stone_6b90,
  .medium-0ceb,
  .wide-3e8f,
  .complex-44cd,
  .feature_in_1523,
  .caption_brown_cbc1,
  .overlay_hot_9978,
  .column_6e37,
  .highlight_stone_7f68,
  .module_9390 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pink_b14d,
  .last-e145 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .pro_e967,
  .carousel-4564,
  .banner_north_ef57,
  .component_inner_f993,
  .frame-8423,
  .west-488f,
  .header_f2c6 {
    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 */
  .accordion-c8e6,
  .dark_03d0,
  .container_fast_ea47,
  .block-south-115b,
  .component_79ad {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notice_huge_e49a,
  .tooltip-7694,
  .tall_982d,
  .narrow-5a45 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .silver-d8ad,
  .link_down_429d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .focus-cold-d9ce,
  .avatar-clean-cfd7,
  .pattern_dirty_d955,
  .bronze-1474 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dropdown-2be8,
  .tooltip_05bd,
  .table-copper-4191,
  .layout_motion_a645,
  .tooltip_82ef,
  .picture-6d6c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accordion-c8e6,
  .dark_03d0,
  .block-south-115b {
    max-width: none !important;
  }
  
  .selected-cfee {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notice_huge_e49a {
    font-size: 1.5rem !important;
  }
  
  .tooltip-7694 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tag_lite_6ea3,
  .accordion-646d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tall_982d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .list-2096 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .blue-c27f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accordion-c8e6,
  .block-south-115b {
    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: 9e32 */
.promo-block-p6 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
