/* ============================================
   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 (.copper_e646) is a descendant of
   .tooltip_798c (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.accordion-dynamic-2db6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".action-05a6" 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.backdrop-north-da0c so it can't cause
   horizontal overflow anyway. */
.green-a8a7,
.title_dynamic_ada1,
.overlay_top_2670,
.accordion_wood_b27b,
.stale-51ae,
.dirty_c7f9,
.text-cb66,
.layout-9590,
.message_1999,
.element-3b89,
.focused_efd2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pagination_e080 {
    padding: 8px 0;
  }
  
  .avatar-0711 img {
    height: 28px;
    width: auto;
  }
  
  .accordion_simple_b2da {
    display: none !important;
  }
  
  .cold-1030 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .cold-1030 svg {
    width: 14px;
    height: 14px;
  }
  
  .green-505d {
    padding: 6px;
  }
  
  .icon_medium_ddc1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .overlay_top_2670,
  .title_dynamic_ada1,
  .accordion_wood_b27b,
  .stale-51ae,
  .badge-cold-2c8b,
  .picture-9d90,
  .pink-6fde,
  .border_4e9c,
  .paragraph-middle-e329,
  .sidebar_83ed,
  .detail-bottom-c3cf,
  .glass_a8c7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .outline_tiny_e708,
  .row-selected-2e65 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .smooth_8fe7,
  .purple_fdf4,
  .disabled_bright_1b66,
  .last-08b0,
  .outline-1fdb,
  .input_1e73,
  .title_8ff9 {
    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 */
  .south_d365,
  .link_7ae8,
  .header_e1b5,
  .focus-ce14,
  .middle_7caf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .north_8fc8,
  .paragraph-bronze-5f57,
  .article_dirty_cf71,
  .outer-49c1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .status_3086,
  .shade-0889 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .module-selected-5a7c,
  .frame_selected_57df,
  .easy-3f3e,
  .inner_30f5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gradient-over-bece,
  .warm_f2f3,
  .element-stone-a587,
  .video-3a31,
  .tabs_complex_8e6a,
  .list_motion_0a73 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .south_d365,
  .link_7ae8,
  .focus-ce14 {
    max-width: none !important;
  }
  
  .action-05a6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .north_8fc8 {
    font-size: 1.5rem !important;
  }
  
  .paragraph-bronze-5f57 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .old-0b97,
  .search_old_a271 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .article_dirty_cf71 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .modal-128d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .glass-97ea {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .south_d365,
  .focus-ce14 {
    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: 052d */
.shadow-element-z6 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.3;
}
