/* ============================================
   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 (.surface-huge-62d5) is a descendant of
   .column-bronze-e3a1 (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.red-999c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".feature-ffda" 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.element_inner_8e1d so it can't cause
   horizontal overflow anyway. */
.bottom-223f,
.column_0cbd,
.list_9acf,
.avatar_huge_a5db,
.layout-c7b4,
.frame_358e,
.stone_bae4,
.clean_8b7c,
.highlight_middle_7dca,
.disabled-6e30,
.shadow_83f3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notification-3743 {
    padding: 8px 0;
  }
  
  .solid-11ea img {
    height: 28px;
    width: auto;
  }
  
  .surface_in_d070 {
    display: none !important;
  }
  
  .stone-161d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .stone-161d svg {
    width: 14px;
    height: 14px;
  }
  
  .panel_dirty_cc92 {
    padding: 6px;
  }
  
  .silver-bbf9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .list_9acf,
  .column_0cbd,
  .avatar_huge_a5db,
  .layout-c7b4,
  .content_9e17,
  .status-next-20ff,
  .button_80f3,
  .outline-next-c66a,
  .under-e026,
  .border_current_2661,
  .rough-ba3f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .chip-1d4b,
  .accordion-f7d8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .module_45c4,
  .under-50c8,
  .chip-lower-82da,
  .accent_1a95,
  .input-7292,
  .cold_4329,
  .panel_e389 {
    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 */
  .feature_53e1,
  .tabs-brown-70f9,
  .alert-gas-7a16,
  .detail_gold_d3c0,
  .motion_7598 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover-da89,
  .gas-827c,
  .module_fresh_6029,
  .gas_f69b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .item-simple-d449,
  .mini_d377 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .smooth_e508,
  .gallery_fast_3e61,
  .breadcrumb-wood-d372,
  .layout-f32a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gallery_0006,
  .feature-1a07,
  .tall-f772,
  .chip-dim-98e4,
  .panel_e8f3,
  .bronze-f7e4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .feature_53e1,
  .tabs-brown-70f9,
  .detail_gold_d3c0 {
    max-width: none !important;
  }
  
  .feature-ffda {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover-da89 {
    font-size: 1.5rem !important;
  }
  
  .gas-827c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .widget_bb10,
  .form-narrow-20b9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .module_fresh_6029 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .feature_ce32 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .fixed_6b28 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .feature_53e1,
  .detail_gold_d3c0 {
    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: 4388 */
.shadow-element-y2 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
