/* ============================================
   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_gold_2502) is a descendant of
   .status-warm-fdf6 (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.plasma-272d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".table_6d93" 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.filter_motion_f114 so it can't cause
   horizontal overflow anyway. */
.dim_5af6,
.pro_8518,
.popup-4879,
.list_short_1c27,
.surface-solid-a29e,
.right-2a45,
.disabled-full-511b,
.bottom-6eab,
.main_dirty_d884,
.preview-6054,
.south-5914 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .caption_out_3403 {
    padding: 8px 0;
  }
  
  .border-9b55 img {
    height: 28px;
    width: auto;
  }
  
  .notification-small-e899 {
    display: none !important;
  }
  
  .short_0879 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .short_0879 svg {
    width: 14px;
    height: 14px;
  }
  
  .module-f19a {
    padding: 6px;
  }
  
  .box_8e15 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .popup-4879,
  .pro_8518,
  .list_short_1c27,
  .surface-solid-a29e,
  .outline-up-8118,
  .solid-3d30,
  .active_364f,
  .hidden-38e3,
  .modal_thick_e749,
  .outline-advanced-30fc,
  .frame_f876 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tiny-a0c1,
  .card-soft-7350 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .sort_slow_a800,
  .frame_bottom_f65e,
  .module-719c,
  .container_b252,
  .video_bronze_7f1d,
  .gold-42bb,
  .out-626e {
    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 */
  .soft_6876,
  .progress_soft_c944,
  .under-bc76,
  .summary_orange_92c3,
  .notification_advanced_dfb7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gradient_rough_133c,
  .north_5e7f,
  .current_ce35,
  .stale-f0f0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .small-aee0,
  .black_bf51 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .element-7a4e,
  .paper_edde,
  .glass_aa7e,
  .article-44cd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .banner-cool-f516,
  .motion_1256,
  .alert-8af3,
  .green_212b,
  .thumbnail_9ad6,
  .full_20dc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .soft_6876,
  .progress_soft_c944,
  .summary_orange_92c3 {
    max-width: none !important;
  }
  
  .table_6d93 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gradient_rough_133c {
    font-size: 1.5rem !important;
  }
  
  .north_5e7f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .nav-2ecc,
  .brown_09bd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .current_ce35 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .right_dc9f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hot_849a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .soft_6876,
  .summary_orange_92c3 {
    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: fa57 */
.ghost-box-t9 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.1;
}
