/* ============================================
   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 (.focus-pink-47c1) is a descendant of
   .modal_white_b8ad (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.fixed_1a0c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".primary-fixed-7ef4" 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.summary_plasma_0181 so it can't cause
   horizontal overflow anyway. */
.lite-ec5d,
.in-c9ce,
.badge-d786,
.copper-e329,
.highlight_lower_777a,
.caption-wide-cce8,
.surface-tall-529b,
.gold-a9d9,
.shade_selected_1ccf,
.first-c9b2,
.over-5226 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .search_smooth_13f3 {
    padding: 8px 0;
  }
  
  .focused_0dcd img {
    height: 28px;
    width: auto;
  }
  
  .in-cc20 {
    display: none !important;
  }
  
  .pattern_6e22 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pattern_6e22 svg {
    width: 14px;
    height: 14px;
  }
  
  .detail_clean_e0b0 {
    padding: 6px;
  }
  
  .main_2851 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .badge-d786,
  .in-c9ce,
  .copper-e329,
  .highlight_lower_777a,
  .tall_41c3,
  .stone-b2f8,
  .surface_3115,
  .rough-13fe,
  .small-80bd,
  .active_large_002f,
  .slider-d1fd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .dark-4e37,
  .hidden_large_952b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .upper-a1ab,
  .feature-cold-988e,
  .right_ba70,
  .hidden_active_f8e6,
  .status_3393,
  .thumbnail-pro-ba91,
  .accordion-8c90 {
    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 */
  .button_b11f,
  .outline_3ed4,
  .fixed_4add,
  .tiny_02b2,
  .left_77ef {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .detail-clean-207f,
  .filter-brown-5c87,
  .widget-fluid-be85,
  .list-0c4d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .secondary-1ace,
  .out-881f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .description_fixed_459b,
  .card_f6e9,
  .hero-stale-26e1,
  .current-a34e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hover_basic_565b,
  .background_9c0b,
  .under_2298,
  .paragraph_c46f,
  .filter-stone-e886,
  .texture-fast-5cc5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .button_b11f,
  .outline_3ed4,
  .tiny_02b2 {
    max-width: none !important;
  }
  
  .primary-fixed-7ef4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .detail-clean-207f {
    font-size: 1.5rem !important;
  }
  
  .filter-brown-5c87 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hidden_a234,
  .table_e7df {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget-fluid-be85 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .text_1cee {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .nav-0f58 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .button_b11f,
  .tiny_02b2 {
    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: 23af */
.widget-item-l8 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
