/* ============================================
   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 (.feature-ad2e) is a descendant of
   .background_advanced_d601 (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.copper-3123 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shade-17c4" 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.chip-wood-ff4f so it can't cause
   horizontal overflow anyway. */
.avatar_c7aa,
.text_cold_b5d8,
.primary_ec3c,
.carousel-208a,
.small-d629,
.orange-2cd2,
.middle_0f4f,
.container-b715,
.secondary-7f5f,
.logo_left_b528,
.block-active-20ef {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .solid_d318 {
    padding: 8px 0;
  }
  
  .card-bottom-e979 img {
    height: 28px;
    width: auto;
  }
  
  .footer_upper_6bc5 {
    display: none !important;
  }
  
  .hidden_soft_d7ac {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hidden_soft_d7ac svg {
    width: 14px;
    height: 14px;
  }
  
  .east_cb76 {
    padding: 6px;
  }
  
  .heading-east-2096 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .primary_ec3c,
  .text_cold_b5d8,
  .carousel-208a,
  .small-d629,
  .progress_55be,
  .badge_861f,
  .progress_motion_3765,
  .pagination-dbd4,
  .tooltip_wide_5808,
  .title-inner-5d44,
  .border_07b6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .first_ad02,
  .focus_dirty_65e8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shadow-8cb9,
  .old_6e41,
  .element-light-489e,
  .tiny-28ed,
  .mask_green_7570,
  .dynamic_7b12,
  .bronze_81f3 {
    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 */
  .footer_cool_ed28,
  .accordion-ec58,
  .main_bb52,
  .pattern-bc62,
  .hard_5fce {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge_advanced_7b9d,
  .copper_7944,
  .first_48ec,
  .cold-24c9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .aside_d413,
  .clean_921d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .search_4b58,
  .block-a923,
  .preview_action_c92f,
  .fixed_119b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .inner-d999,
  .media_huge_2446,
  .highlight_4025,
  .silver_9caf,
  .preview-left-7962,
  .pattern_rough_ae00 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .footer_cool_ed28,
  .accordion-ec58,
  .pattern-bc62 {
    max-width: none !important;
  }
  
  .shade-17c4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge_advanced_7b9d {
    font-size: 1.5rem !important;
  }
  
  .copper_7944 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .focus-adf0,
  .frame-da68 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .first_48ec {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .huge_92cc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sort-7629 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .footer_cool_ed28,
  .pattern-bc62 {
    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: 3f39 */
.ghost-box-i6 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.2;
}
