/* ============================================
   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 (.smooth_ed64) is a descendant of
   .breadcrumb_north_01d5 (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.container-medium-5bcf {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".list_west_b75b" 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.header-purple-1c4e so it can't cause
   horizontal overflow anyway. */
.plasma_3249,
.soft_90a8,
.widget-stale-941e,
.inner-0779,
.background-light-71e7,
.media_f091,
.article_ed68,
.inner-aca3,
.article-cb7a,
.progress-59ec,
.shade-brown-859c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wide_13bb {
    padding: 8px 0;
  }
  
  .title_2a32 img {
    height: 28px;
    width: auto;
  }
  
  .bronze-ee1d {
    display: none !important;
  }
  
  .summary-53b7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .summary-53b7 svg {
    width: 14px;
    height: 14px;
  }
  
  .outline_copper_8e4f {
    padding: 6px;
  }
  
  .pattern-outer-28c6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .widget-stale-941e,
  .soft_90a8,
  .inner-0779,
  .background-light-71e7,
  .dropdown-e52c,
  .list_013e,
  .slow_4a17,
  .black_62cd,
  .backdrop_brown_ff0e,
  .item_c243,
  .steel-a987,
  .layout-current-79bc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .layout-white-9779,
  .gallery-wood-d2d6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .pressed_687a,
  .soft_8fe6,
  .layout-silver-e312,
  .slow-cee8,
  .avatar_6b0f,
  .caption_short_f9b3,
  .list-0bba {
    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 */
  .widget-89a9,
  .tertiary-8a2e,
  .mask_17b2,
  .message-42e4,
  .container_blue_2a7a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pressed-aa45,
  .container-9a59,
  .bottom-6bef,
  .component_3f6e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .backdrop_upper_a923,
  .shade_1447 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notification_9583,
  .shadow-6bb7,
  .wood_32af,
  .badge_pressed_2f67 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .header-left-e5b5,
  .caption-0aa5,
  .module-ebe9,
  .chip-0438,
  .hover-last-8091,
  .surface_center_151d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .widget-89a9,
  .tertiary-8a2e,
  .message-42e4 {
    max-width: none !important;
  }
  
  .list_west_b75b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pressed-aa45 {
    font-size: 1.5rem !important;
  }
  
  .container-9a59 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .thumbnail-e42d,
  .white_5bf6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .bottom-6bef {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .feature-424d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .item-9d9d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .widget-89a9,
  .message-42e4 {
    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: b31e */
.ghost-box-i9 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.2;
}
