/* ============================================
   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 (.article-pink-5d4d) is a descendant of
   .focused_9722 (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.box_light_8100 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tag-warm-006d" 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.last_638e so it can't cause
   horizontal overflow anyway. */
.shade-left-b97f,
.hover-glass-5af5,
.filter_in_daf1,
.heading_rough_756c,
.widget-1956,
.hero-thick-638f,
.message-brown-b883,
.text-easy-f18a,
.center-ddf0,
.background-right-2fa6,
.north-ae6c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .next-4e5d {
    padding: 8px 0;
  }
  
  .heading-ed77 img {
    height: 28px;
    width: auto;
  }
  
  .secondary_b2ed {
    display: none !important;
  }
  
  .menu_hard_4357 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .menu_hard_4357 svg {
    width: 14px;
    height: 14px;
  }
  
  .element-adaa {
    padding: 6px;
  }
  
  .sidebar_tiny_112c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .filter_in_daf1,
  .hover-glass-5af5,
  .heading_rough_756c,
  .widget-1956,
  .fluid-1602,
  .info-f070,
  .modal_294a,
  .main_fba2,
  .hovered_f4dc,
  .selected_815a,
  .tall_82db,
  .tabs-7017 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .photo_6c3f,
  .box_accf {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over-a93f,
  .logo_c614,
  .module-6978,
  .badge-6c54,
  .pattern-082d,
  .sort_8424,
  .card-07ab {
    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 */
  .search-motion-d425,
  .border-stale-d178,
  .easy_1ab9,
  .list-dark-eeea,
  .notification_68af {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .layout-eea4,
  .advanced-24d9,
  .widget_iron_b902,
  .soft_e004 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tall-9268,
  .tabs-231d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .popup-4899,
  .chip-simple-5407,
  .shadow_e57b,
  .tabs_70cf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .footer_pink_fa36,
  .light-2bb9,
  .blue_88b3,
  .list_6c25,
  .slow_d5a5,
  .up-7086 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search-motion-d425,
  .border-stale-d178,
  .list-dark-eeea {
    max-width: none !important;
  }
  
  .tag-warm-006d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .layout-eea4 {
    font-size: 1.5rem !important;
  }
  
  .advanced-24d9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .rough-3889,
  .bright-d875 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget_iron_b902 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active_7ddb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .filter_outer_bf4d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search-motion-d425,
  .list-dark-eeea {
    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: 17a0 */
.promo-block-q5 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.1;
}
