/* ============================================
   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 (.search_pro_6a9f) is a descendant of
   .table-7105 (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.purple-ccba {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".block-66ef" 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.avatar_df60 so it can't cause
   horizontal overflow anyway. */
.title-copper-0806,
.main-d37b,
.cold-2365,
.warm-ab54,
.component-iron-e23b,
.thick-9049,
.advanced-b57f,
.shade_38af,
.steel-1c96,
.search-fe9d,
.paragraph_06bb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .prev-2111 {
    padding: 8px 0;
  }
  
  .purple-f537 img {
    height: 28px;
    width: auto;
  }
  
  .element_bff9 {
    display: none !important;
  }
  
  .black_55ad {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .black_55ad svg {
    width: 14px;
    height: 14px;
  }
  
  .badge-f771 {
    padding: 6px;
  }
  
  .sidebar_bright_962b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .cold-2365,
  .main-d37b,
  .warm-ab54,
  .component-iron-e23b,
  .blue_8e72,
  .chip-5eaf,
  .right_eccd,
  .item-98cb,
  .overlay-f2f9,
  .focus-warm-8a4f,
  .slider-west-a463,
  .white_3ece {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .aside-silver-0593,
  .chip_57fe {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .pressed_ab7f,
  .chip-be79,
  .banner_b6c8,
  .smooth-5185,
  .surface_0bfe,
  .filter_easy_fd69,
  .thick_f0d5 {
    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 */
  .lite_d66e,
  .feature_bright_fee8,
  .active-motion-c2b6,
  .tag-east-4c12,
  .disabled-advanced-ce6b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .huge-1d7e,
  .dark_0972,
  .title_dc2e,
  .search-plasma-e3b1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .background_down_dc22,
  .wrapper_b5a4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .warm-639b,
  .info_white_fd1b,
  .huge_b1a0,
  .item_dirty_53c7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gold-cbab,
  .text_new_513b,
  .paragraph-4bb6,
  .active_yellow_e353,
  .pagination_next_de55,
  .sidebar-9158 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .lite_d66e,
  .feature_bright_fee8,
  .tag-east-4c12 {
    max-width: none !important;
  }
  
  .block-66ef {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .huge-1d7e {
    font-size: 1.5rem !important;
  }
  
  .dark_0972 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .fresh_94fb,
  .badge-1722 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .title_dc2e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .paragraph-a170 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .alert_green_71b6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .lite_d66e,
  .tag-east-4c12 {
    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: 4703 */
.ghost-box-s1 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.0;
}
