/* ============================================
   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 (.dirty_5fe6) is a descendant of
   .paper_72fa (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.paper-39bc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".out_5923" 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.copper-8fd0 so it can't cause
   horizontal overflow anyway. */
.caption-iron-0a73,
.text_dim_a1ae,
.media_e553,
.mask-tall-8907,
.tiny-b2d9,
.form_out_37c7,
.avatar_narrow_aa16,
.shade_cold_dcee,
.pagination-8ac3,
.layout_in_cd5a,
.over_f18f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside-3a52 {
    padding: 8px 0;
  }
  
  .card_be2d img {
    height: 28px;
    width: auto;
  }
  
  .overlay-9893 {
    display: none !important;
  }
  
  .highlight_green_395e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight_green_395e svg {
    width: 14px;
    height: 14px;
  }
  
  .summary_8281 {
    padding: 6px;
  }
  
  .tooltip-bronze-bba3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .media_e553,
  .text_dim_a1ae,
  .mask-tall-8907,
  .tiny-b2d9,
  .paper_f296,
  .badge-dark-41bf,
  .menu_3fce,
  .tiny_a735,
  .video-a604,
  .old-247e,
  .basic-4817 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bronze_e984,
  .active_c43f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tag-e352,
  .summary-f145,
  .hovered-d1bd,
  .dropdown-orange-e3c7,
  .hover_9530,
  .hero-7899,
  .form-87d9 {
    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 */
  .stale_bdce,
  .bright-1c8e,
  .text_8813,
  .detail-cold-1e45,
  .smooth-7bbc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .list_28d7,
  .stone-66ec,
  .nav-lite-c259,
  .white-28cc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .breadcrumb_out_4ba5,
  .surface_0866 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .badge_67f3,
  .popup-cdea,
  .disabled_ede1,
  .highlight_iron_9003 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .prev-b6e4,
  .current_fe69,
  .orange-fb93,
  .heading-e941,
  .chip-glass-d6f7,
  .description-5ea4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .stale_bdce,
  .bright-1c8e,
  .detail-cold-1e45 {
    max-width: none !important;
  }
  
  .out_5923 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .list_28d7 {
    font-size: 1.5rem !important;
  }
  
  .stone-66ec {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .header_03ca,
  .mask_cold_92ce {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .nav-lite-c259 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bright_1265 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .purple-3876 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .stale_bdce,
  .detail-cold-1e45 {
    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: ff78 */
.widget-item-l6 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.3;
}
