/* ============================================
   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 (.card_9a9f) is a descendant of
   .label-upper-b5bb (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.prev_53ce {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".static-4aad" 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.logo-wide-c1ac so it can't cause
   horizontal overflow anyway. */
.detail_79a9,
.active-07dc,
.banner_mini_ae72,
.icon-5956,
.hard_1699,
.focus_e0a1,
.text_upper_8bb3,
.slider-c325,
.container-c1dc,
.dirty-3a63,
.image_7a8d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .card_pro_cca0 {
    padding: 8px 0;
  }
  
  .plasma_064e img {
    height: 28px;
    width: auto;
  }
  
  .article_top_1324 {
    display: none !important;
  }
  
  .mask_short_8586 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mask_short_8586 svg {
    width: 14px;
    height: 14px;
  }
  
  .highlight_west_e9b1 {
    padding: 6px;
  }
  
  .gallery-first-3584 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner_mini_ae72,
  .active-07dc,
  .icon-5956,
  .hard_1699,
  .medium-377b,
  .item_dd27,
  .box-b169,
  .hard_0e77,
  .blue_5832,
  .sort-b346,
  .container-5ab0,
  .bronze-3649 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .outline_focused_e1ff,
  .module-gold-9738 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over-7715,
  .advanced-5f09,
  .primary_next_0dee,
  .frame_tall_1614,
  .chip-ee85,
  .summary_2cb4,
  .focus-warm-dc40 {
    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 */
  .sort-hard-91f8,
  .nav-30fc,
  .sort-a9e0,
  .large_a0f1,
  .caption_west_ca13 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dropdown_inner_3cf9,
  .notice-ef53,
  .grid_next_0cf7,
  .hero-8a4a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .static-d775,
  .cold_17d8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .photo-stone-f3da,
  .orange-c3ca,
  .paragraph-87f4,
  .sidebar_04ff {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .black_d880,
  .sort_5ad4,
  .breadcrumb-dark-0192,
  .caption-basic-f824,
  .panel-outer-da32,
  .gradient_9579 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .sort-hard-91f8,
  .nav-30fc,
  .large_a0f1 {
    max-width: none !important;
  }
  
  .static-4aad {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dropdown_inner_3cf9 {
    font-size: 1.5rem !important;
  }
  
  .notice-ef53 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gradient-18f7,
  .small-9f5a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .grid_next_0cf7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status-clean-0074 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .rough_a11b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sort-hard-91f8,
  .large_a0f1 {
    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: 9a8d */
.widget-item-m6 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
