/* ============================================
   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 (.media-4e67) is a descendant of
   .row-a308 (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.alert-dynamic-81f1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tooltip_purple_6dfc" 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.yellow_c65f so it can't cause
   horizontal overflow anyway. */
.feature_medium_e5e3,
.button_silver_6a08,
.dropdown_1d51,
.modal_8ff7,
.summary-wide-7d65,
.button-b484,
.bronze-f7e0,
.notice-fluid-0ead,
.focus-5111,
.wood_f1a4,
.title-6ca2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .search_fluid_e15c {
    padding: 8px 0;
  }
  
  .layout-under-3860 img {
    height: 28px;
    width: auto;
  }
  
  .motion-fe9a {
    display: none !important;
  }
  
  .north-b38e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .north-b38e svg {
    width: 14px;
    height: 14px;
  }
  
  .accent_584d {
    padding: 6px;
  }
  
  .heading_0994 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dropdown_1d51,
  .button_silver_6a08,
  .modal_8ff7,
  .summary-wide-7d65,
  .sidebar-1ea6,
  .video-rough-9a19,
  .dynamic-b486,
  .box-stone-3ee8,
  .gallery-up-1942,
  .grid_7e58,
  .black-ff34,
  .tag_bde2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .steel-9abf,
  .highlight-stone-0f0d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail_last_66c1,
  .module_fast_b201,
  .nav_5709,
  .primary_91ae,
  .smooth-0779,
  .active-e997,
  .red_1066 {
    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 */
  .hero-d2c8,
  .basic-ff6c,
  .hover_0111,
  .container_5e2d,
  .overlay-light-23ec {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .description_9ac3,
  .outer-725c,
  .layout_b694,
  .highlight_d54c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .white_4d6d,
  .message_a265 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown_left_3372,
  .shadow_lite_8ca8,
  .medium-58c2,
  .focus_lite_497e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .slider_c169,
  .red_54f0,
  .notice-b652,
  .primary_fast_219f,
  .over-1307,
  .tabs_rough_40fb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hero-d2c8,
  .basic-ff6c,
  .container_5e2d {
    max-width: none !important;
  }
  
  .tooltip_purple_6dfc {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .description_9ac3 {
    font-size: 1.5rem !important;
  }
  
  .outer-725c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .west-6171,
  .frame-c548 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .layout_b694 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .surface-e684 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tall-a4df {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-d2c8,
  .container_5e2d {
    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: 5a1f */
.shadow-element-w7 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.0;
}
