/* ============================================
   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 (.pagination-outer-f700) is a descendant of
   .item_96cf (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.notice_34a5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".backdrop_e4e7" 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.item_old_d8ae so it can't cause
   horizontal overflow anyway. */
.easy-6a56,
.hero-hot-25b4,
.clean_665f,
.prev_fc52,
.north_eddd,
.full-8221,
.shadow_bright_bde5,
.modal-7a87,
.message-1a62,
.light_7d81,
.medium-34ac {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .inner_eecb {
    padding: 8px 0;
  }
  
  .basic_f12e img {
    height: 28px;
    width: auto;
  }
  
  .dropdown_pink_e8b8 {
    display: none !important;
  }
  
  .out-2718 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .out-2718 svg {
    width: 14px;
    height: 14px;
  }
  
  .section_solid_bd3a {
    padding: 6px;
  }
  
  .hero_9c53 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .clean_665f,
  .hero-hot-25b4,
  .prev_fc52,
  .north_eddd,
  .fixed-fae6,
  .active-narrow-289e,
  .disabled_b377,
  .mask_b1cd,
  .content-action-b9b9,
  .sidebar_wide_997f,
  .static-73cc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .red_861e,
  .up_094c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notification-upper-c880,
  .sort_ee20,
  .first_be37,
  .input_7963,
  .preview-3203,
  .under-21ac,
  .green-e360 {
    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 */
  .in-4932,
  .plasma-587c,
  .detail-huge-881c,
  .module-b8a6,
  .grid_bright_5d7f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dark_e260,
  .up-1687,
  .frame_dirty_fc9b,
  .block-9b2b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .background_4fcf,
  .tiny_5094 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notice_middle_afa8,
  .first_26da,
  .menu_ecb4,
  .short_3638 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .footer-slow-c740,
  .tertiary-df9c,
  .banner_8a55,
  .photo_ce49,
  .iron-f44d,
  .list-thick-4a8c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .in-4932,
  .plasma-587c,
  .module-b8a6 {
    max-width: none !important;
  }
  
  .backdrop_e4e7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dark_e260 {
    font-size: 1.5rem !important;
  }
  
  .up-1687 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .breadcrumb-stone-07aa,
  .red-aff4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .frame_dirty_fc9b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .aside-out-338b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .cold_d1d2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .in-4932,
  .module-b8a6 {
    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: 6fbc */
.phantom-card-s2 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.0;
}
