/* ============================================
   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 (.last-4bd9) is a descendant of
   .accent_smooth_6764 (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.article-west-a2e1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".alert_top_e051" 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.glass_2e35 so it can't cause
   horizontal overflow anyway. */
.fast-8576,
.backdrop_de3d,
.pressed-dadf,
.summary_bronze_bc31,
.upper_5494,
.icon-wood-e626,
.widget_gold_d8b9,
.disabled-3583,
.footer_bfc5,
.label-9481,
.under-2f42 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .white-1c33 {
    padding: 8px 0;
  }
  
  .red-f635 img {
    height: 28px;
    width: auto;
  }
  
  .card_plasma_0821 {
    display: none !important;
  }
  
  .notice_3a13 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notice_3a13 svg {
    width: 14px;
    height: 14px;
  }
  
  .iron_ae5f {
    padding: 6px;
  }
  
  .clean_c17e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pressed-dadf,
  .backdrop_de3d,
  .summary_bronze_bc31,
  .upper_5494,
  .shade-steel-1b35,
  .preview_static_183d,
  .tooltip-afc2,
  .border_e924,
  .advanced-616b,
  .paragraph_focused_6b2a,
  .panel_527c,
  .form_dim_73e3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hovered_cb22,
  .stone-fcc1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .description_b93d,
  .wrapper-short-8eea,
  .chip-advanced-5660,
  .avatar-green-4f7d,
  .shade_glass_0dd9,
  .banner-1ba7,
  .main-52b7 {
    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_50b4,
  .header-05d8,
  .text_75d4,
  .slider_b151,
  .item_5b4e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .preview_dark_3a4d,
  .highlight-cdc2,
  .steel_77dd,
  .breadcrumb_dirty_71ef {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .highlight_40ee,
  .small_1016 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paper_1712,
  .middle_6676,
  .pattern-e578,
  .tabs_west_37e5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dirty-8f79,
  .message_active_c8f6,
  .main-black-c576,
  .slider-outer-e6ea,
  .box-c4fa,
  .tertiary-lite-77af {
    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_50b4,
  .header-05d8,
  .slider_b151 {
    max-width: none !important;
  }
  
  .alert_top_e051 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .preview_dark_3a4d {
    font-size: 1.5rem !important;
  }
  
  .highlight-cdc2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .center_29a5,
  .dim-d2e2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .steel_77dd {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .article_ce4b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .title-611b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .summary_50b4,
  .slider_b151 {
    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: cc03 */
.ghost-box-j6 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.2;
}
