/* ============================================
   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 (.shadow_focused_0d6f) is a descendant of
   .light-d329 (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.full_57e7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".panel-fresh-9af8" 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.secondary-1726 so it can't cause
   horizontal overflow anyway. */
.main_east_57cd,
.heading_dim_fd57,
.surface_pro_b45e,
.gallery_918e,
.icon-complex-93d7,
.slider-080b,
.plasma_19b3,
.article_active_1a6a,
.table-04d9,
.badge_6801,
.nav_hot_5293 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .secondary_light_0e0c {
    padding: 8px 0;
  }
  
  .border-c4e4 img {
    height: 28px;
    width: auto;
  }
  
  .under_eef7 {
    display: none !important;
  }
  
  .primary-green-a1ef {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .primary-green-a1ef svg {
    width: 14px;
    height: 14px;
  }
  
  .nav_f3c5 {
    padding: 6px;
  }
  
  .solid-dcdd {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .surface_pro_b45e,
  .heading_dim_fd57,
  .gallery_918e,
  .icon-complex-93d7,
  .summary-2f5f,
  .header_5fee,
  .disabled_bd25,
  .basic_6329,
  .texture_5168,
  .article_b24a,
  .notice_west_d518 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .rough_aa50,
  .primary_41c5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .row-ce69,
  .grid-d8dc,
  .selected_578c,
  .detail-a036,
  .easy-256e,
  .description_dddf,
  .stale-38d1 {
    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 */
  .steel_da98,
  .active-lite-056e,
  .module_brown_84ba,
  .hover-static-3696,
  .dynamic-7803 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .title-copper-0d32,
  .backdrop_e48d,
  .notice_7417,
  .label_d851 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .section_black_6232,
  .paragraph-over-d44c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .menu-82eb,
  .row-lower-6fee,
  .main-selected-d89c,
  .card_0f0b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hard_10fc,
  .in-5420,
  .mini-76ba,
  .cool_a1eb,
  .highlight_30e7,
  .label-d19e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .steel_da98,
  .active-lite-056e,
  .hover-static-3696 {
    max-width: none !important;
  }
  
  .panel-fresh-9af8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .title-copper-0d32 {
    font-size: 1.5rem !important;
  }
  
  .backdrop_e48d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .prev-e9df,
  .badge-68bd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .notice_7417 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .over_8d3d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .button-advanced-b495 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .steel_da98,
  .hover-static-3696 {
    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: 4909 */
.shadow-element-x1 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.0;
}
