/* ============================================
   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 (.column-b711) is a descendant of
   .short-1e9b (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.label_under_7204 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".avatar-4811" 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.menu_c502 so it can't cause
   horizontal overflow anyway. */
.dark_0e70,
.nav-1301,
.tabs_9e8e,
.fast_73ec,
.section_342a,
.top-195a,
.black-3835,
.section-up-7ce3,
.active_fast_1452,
.gallery-out-9b0f,
.avatar-large-24c6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module-bb38 {
    padding: 8px 0;
  }
  
  .gradient_a557 img {
    height: 28px;
    width: auto;
  }
  
  .link-tiny-daac {
    display: none !important;
  }
  
  .smooth_5ef3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .smooth_5ef3 svg {
    width: 14px;
    height: 14px;
  }
  
  .secondary-fad9 {
    padding: 6px;
  }
  
  .surface-small-c38f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tabs_9e8e,
  .nav-1301,
  .fast_73ec,
  .section_342a,
  .chip-under-006a,
  .header_a2e8,
  .south_3559,
  .secondary_active_7572,
  .focused_7b6c,
  .light-f5ee,
  .dirty_7cc0,
  .simple-590f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .filter-white-b78e,
  .card-cd98 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .new_352f,
  .logo_active_a35f,
  .black-6ef1,
  .detail-1172,
  .white_b846,
  .up_0d32,
  .element-small-b05c {
    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 */
  .overlay-a644,
  .outline-3049,
  .column_easy_c5c2,
  .widget-huge-750f,
  .dirty-9655 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge_inner_cfa7,
  .caption_paper_f523,
  .frame_huge_4993,
  .pagination_6b0d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .selected-5915,
  .progress_blue_6aed {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .secondary-lower-2738,
  .border_bfa0,
  .iron_1a9e,
  .prev-d4f5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .border-8f72,
  .north-1930,
  .hard_ee9d,
  .outline-ec70,
  .logo_c31e,
  .out_cbc9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .overlay-a644,
  .outline-3049,
  .widget-huge-750f {
    max-width: none !important;
  }
  
  .avatar-4811 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge_inner_cfa7 {
    font-size: 1.5rem !important;
  }
  
  .caption_paper_f523 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dirty_f7fb,
  .aside-cb42 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .frame_huge_4993 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .modal-dc65 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .white_a520 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .overlay-a644,
  .widget-huge-750f {
    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: 015a */
.phantom-card-t0 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.2;
}
