/* ============================================
   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 (.avatar-2b61) is a descendant of
   .current_dd3b (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.dropdown_338c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".wrapper_plasma_1658" 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.west-c53a so it can't cause
   horizontal overflow anyway. */
.frame-red-fc8f,
.hover_current_3ad6,
.text_4445,
.article_mini_1201,
.tabs_b4bb,
.pattern-static-281c,
.east_c596,
.old_2fe9,
.paragraph_0fe8,
.layout-da22,
.last-8bb8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .north-9f5d {
    padding: 8px 0;
  }
  
  .avatar_ca77 img {
    height: 28px;
    width: auto;
  }
  
  .hero-8d56 {
    display: none !important;
  }
  
  .search-cold-87e0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .search-cold-87e0 svg {
    width: 14px;
    height: 14px;
  }
  
  .input-8c5c {
    padding: 6px;
  }
  
  .item_blue_1f5a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .text_4445,
  .hover_current_3ad6,
  .article_mini_1201,
  .tabs_b4bb,
  .over-01e4,
  .secondary-0d0c,
  .notification_667a,
  .thumbnail-clean-deb4,
  .notification_1183,
  .silver-2fe9,
  .layout_027b,
  .new_461e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .clean_f90a,
  .warm_8726 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .icon_fixed_0684,
  .hot_e466,
  .tabs_aa78,
  .rough-4279,
  .fresh_f0f9,
  .notice_paper_000f,
  .breadcrumb-86ad {
    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 */
  .active_red_0625,
  .lower-0e63,
  .background_5f9e,
  .text_cd55,
  .gold-5241 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .slow_58ca,
  .caption_bf3e,
  .column-d105,
  .focus-fixed-f34c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .highlight_1e98,
  .under_9527 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .stale-ce0a,
  .mask_over_0819,
  .preview-purple-bc49,
  .soft_2f8b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .surface-iron-98d4,
  .down_5d55,
  .paper-fd55,
  .warm_de60,
  .chip_copper_079b,
  .box_outer_9028 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .active_red_0625,
  .lower-0e63,
  .text_cd55 {
    max-width: none !important;
  }
  
  .wrapper_plasma_1658 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .slow_58ca {
    font-size: 1.5rem !important;
  }
  
  .caption_bf3e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .summary-dark-8d32,
  .thumbnail_gold_75a1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .column-d105 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .aside-81e4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .heading_plasma_d841 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .active_red_0625,
  .text_cd55 {
    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: d47f */
.phantom-card-w2 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
