/* ============================================
   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 (.background_bronze_2be6) is a descendant of
   .rough-5870 (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.dim_4c4e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".west_c9c5" 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.bright_1741 so it can't cause
   horizontal overflow anyway. */
.pattern-17fb,
.alert_medium_10cb,
.notification_5db4,
.block-60aa,
.mask-steel-3113,
.left-8b0f,
.feature-9ba0,
.backdrop-3ca8,
.overlay-066a,
.icon_120d,
.under-6ada {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .article-159e {
    padding: 8px 0;
  }
  
  .motion-a07a img {
    height: 28px;
    width: auto;
  }
  
  .middle_f9e5 {
    display: none !important;
  }
  
  .fast-c325 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fast-c325 svg {
    width: 14px;
    height: 14px;
  }
  
  .notice-7fad {
    padding: 6px;
  }
  
  .accent_acda {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notification_5db4,
  .alert_medium_10cb,
  .block-60aa,
  .mask-steel-3113,
  .silver-ddb0,
  .tag_1898,
  .layout-pink-9071,
  .filter_motion_1434,
  .focus_09e6,
  .out-4048,
  .card_silver_4c8e,
  .list-fast-4177 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .chip_dark_9b14,
  .pink-1b09 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item-cc80,
  .preview-8807,
  .article-simple-0199,
  .pattern-9381,
  .first_6889,
  .status-9649,
  .detail_6624 {
    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 */
  .summary_static_bd49,
  .dirty-5ef2,
  .yellow_27c1,
  .backdrop-b7b4,
  .table_steel_7213 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tiny_6f12,
  .picture-motion-962b,
  .north_4d04,
  .layout_7ba8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .item-easy-4f6f,
  .focus-6c57 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .banner-7b11,
  .breadcrumb_86ae,
  .layout-tiny-e7ca,
  .module-lite-69d7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .header-e03c,
  .accent_46df,
  .feature-wide-6c54,
  .outer_05fd,
  .backdrop-inner-067c,
  .modal_gas_bf02 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .summary_static_bd49,
  .dirty-5ef2,
  .backdrop-b7b4 {
    max-width: none !important;
  }
  
  .west_c9c5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tiny_6f12 {
    font-size: 1.5rem !important;
  }
  
  .picture-motion-962b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .section_68ec,
  .out_3610 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .north_4d04 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dim_7f6e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .prev_4cac {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .summary_static_bd49,
  .backdrop-b7b4 {
    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: ea67 */
.shadow-element-e1 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
