/* ============================================
   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 (.preview-155e) is a descendant of
   .button-first-9160 (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.east-0162 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hovered-34c2" 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.pattern-up-a273 so it can't cause
   horizontal overflow anyway. */
.active_right_0346,
.fast_53e1,
.item_silver_8fb2,
.chip_67a2,
.first-6aa7,
.breadcrumb-east-ad35,
.outline-mini-e487,
.bottom-18e8,
.west_c132,
.card_pressed_5665,
.preview_ef49 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module_bottom_b7e5 {
    padding: 8px 0;
  }
  
  .in_62df img {
    height: 28px;
    width: auto;
  }
  
  .aside-bright-08cf {
    display: none !important;
  }
  
  .hover-9ede {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hover-9ede svg {
    width: 14px;
    height: 14px;
  }
  
  .carousel-3b9c {
    padding: 6px;
  }
  
  .grid-rough-f64d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .item_silver_8fb2,
  .fast_53e1,
  .chip_67a2,
  .first-6aa7,
  .progress-cb30,
  .tag_8f6d,
  .item_action_7305,
  .popup-east-4e7f,
  .plasma_262c,
  .status-smooth-b01c,
  .title_d49b,
  .input-glass-c88f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .picture-slow-78a1,
  .action-3a05 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .photo-8d9f,
  .tall_cb4b,
  .banner_silver_dfaf,
  .tabs-blue-0ac6,
  .preview_2120,
  .link_3b13,
  .video_e4cf {
    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 */
  .gas_cb02,
  .breadcrumb-839f,
  .selected-eaf8,
  .outline_6f78,
  .popup-under-407b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .block-brown-0c24,
  .feature_new_060d,
  .smooth-4fb9,
  .preview-short-ef3e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .light_01ef,
  .hover-rough-1243 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .easy-4b0f,
  .picture-afb9,
  .tabs-1995,
  .hidden_in_4476 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .black-c917,
  .caption_tiny_4dfd,
  .article_thick_434b,
  .preview_top_e80c,
  .container_4e49,
  .carousel-3a9b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gas_cb02,
  .breadcrumb-839f,
  .outline_6f78 {
    max-width: none !important;
  }
  
  .hovered-34c2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .block-brown-0c24 {
    font-size: 1.5rem !important;
  }
  
  .feature_new_060d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .simple_d8fb,
  .red_e937 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .smooth-4fb9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .border-0cda {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bottom_8be7 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gas_cb02,
  .outline_6f78 {
    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: 52d4 */
.ghost-box-x2 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
