/* ============================================
   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 (.tertiary_4a03) is a descendant of
   .backdrop_hard_bef0 (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.avatar_last_8bea {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".blue-cd69" 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.row-right-d12a so it can't cause
   horizontal overflow anyway. */
.summary-pro-89ee,
.tooltip-fluid-95e6,
.old_ad31,
.black_733e,
.progress-e0f5,
.chip_iron_afe0,
.highlight-2d7c,
.menu_dark_384e,
.current_cac6,
.sidebar-static-3b3b,
.sidebar-51e2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wide_a602 {
    padding: 8px 0;
  }
  
  .middle_23f3 img {
    height: 28px;
    width: auto;
  }
  
  .preview_last_4040 {
    display: none !important;
  }
  
  .light-da0f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .light-da0f svg {
    width: 14px;
    height: 14px;
  }
  
  .overlay_0b0e {
    padding: 6px;
  }
  
  .backdrop-dim-2606 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .old_ad31,
  .tooltip-fluid-95e6,
  .black_733e,
  .progress-e0f5,
  .content-copper-c79a,
  .motion-3bf8,
  .red_8ec1,
  .lower-0e4e,
  .full-36d1,
  .secondary-a16c,
  .thumbnail-1f46,
  .active-action-7314 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .caption-d049,
  .north-3ba1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .row_bf28,
  .grid_d19c,
  .picture-39bc,
  .glass_7686,
  .module_static_dcc6,
  .advanced-ba3a,
  .old_3070 {
    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 */
  .clean-1f62,
  .active-785c,
  .table_dim_a0d6,
  .column-huge-cc2a,
  .nav-wood-8fe5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .grid_slow_b220,
  .description_thick_de14,
  .dropdown-f7c8,
  .aside_simple_9ee9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .menu_5663,
  .photo_iron_164d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .photo-warm-5255,
  .filter-left-20cd,
  .status_white_8501,
  .image_73bf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .nav-48b6,
  .advanced-096c,
  .motion-d9a2,
  .sidebar_ffaf,
  .popup_1aea,
  .breadcrumb-next-7f1b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .clean-1f62,
  .active-785c,
  .column-huge-cc2a {
    max-width: none !important;
  }
  
  .blue-cd69 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .grid_slow_b220 {
    font-size: 1.5rem !important;
  }
  
  .description_thick_de14 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .detail_liquid_4220,
  .focus_6b85 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dropdown-f7c8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .mini-3084 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .filter-pressed-778d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .clean-1f62,
  .column-huge-cc2a {
    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: f851 */
.ghost-box-p0 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.0;
}
