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

/* Fix for any potential overflow elements */
/* NOTE: ".middle-98f4" 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.tertiary_1730 so it can't cause
   horizontal overflow anyway. */
.accent_a63e,
.gold-e298,
.message-f0cd,
.sort_active_5615,
.solid_3dde,
.card-c8b6,
.tooltip_49c3,
.container-easy-3b20,
.accordion_eb27,
.section-purple-2e6e,
.message-57f5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .button_80f9 {
    padding: 8px 0;
  }
  
  .outline-8c7f img {
    height: 28px;
    width: auto;
  }
  
  .component_f776 {
    display: none !important;
  }
  
  .avatar_3c8c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .avatar_3c8c svg {
    width: 14px;
    height: 14px;
  }
  
  .table_c5fa {
    padding: 6px;
  }
  
  .tabs-79f0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .message-f0cd,
  .gold-e298,
  .sort_active_5615,
  .solid_3dde,
  .status-first-48d5,
  .hidden_smooth_8525,
  .purple_e15d,
  .background-02b7,
  .right-4aab,
  .highlight_pro_6b35,
  .yellow_45b6,
  .thick_79e6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .preview_343f,
  .tabs-6aff {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .stale-99ed,
  .warm-34b1,
  .item_outer_ecf5,
  .gradient_bottom_9d70,
  .menu-e8fc,
  .silver-9e77,
  .modal-2c2f {
    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 */
  .tooltip-east-07fb,
  .wide_5b35,
  .description-e0ca,
  .rough_3035,
  .east_e963 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .header-76ef,
  .last_8a39,
  .tabs_bronze_166f,
  .chip-bb65 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .list-west-741f,
  .dirty_d722 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pressed-2634,
  .shade-hard-687a,
  .copper_fd6e,
  .overlay_9067 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .content-ddf6,
  .section_8c77,
  .primary-0159,
  .warm-e2f9,
  .carousel_glass_0409,
  .black-070e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tooltip-east-07fb,
  .wide_5b35,
  .rough_3035 {
    max-width: none !important;
  }
  
  .middle-98f4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .header-76ef {
    font-size: 1.5rem !important;
  }
  
  .last_8a39 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hero-82a7,
  .pattern_40f9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tabs_bronze_166f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .wide-8b67 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .rough-899d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tooltip-east-07fb,
  .rough_3035 {
    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: 5553 */
.ghost-box-y5 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.1;
}
