/* ============================================
   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 (.right_c061) is a descendant of
   .background_bb49 (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.background_outer_c28c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".grid_6d8e" 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.label_e448 so it can't cause
   horizontal overflow anyway. */
.notice-06d0,
.article_solid_dcf8,
.message-c467,
.shade_abf1,
.header_4af9,
.container_5627,
.hidden_eec9,
.outline_4284,
.description-brown-416f,
.outline-cold-4d8b,
.paragraph-under-3cd3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wrapper-out-0df1 {
    padding: 8px 0;
  }
  
  .out_847c img {
    height: 28px;
    width: auto;
  }
  
  .action-2209 {
    display: none !important;
  }
  
  .search-selected-991f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .search-selected-991f svg {
    width: 14px;
    height: 14px;
  }
  
  .tiny_128b {
    padding: 6px;
  }
  
  .content_white_1250 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .message-c467,
  .article_solid_dcf8,
  .shade_abf1,
  .header_4af9,
  .bronze_e4e2,
  .status-2898,
  .dark-08f0,
  .gold-1659,
  .filter_51e2,
  .disabled_058f,
  .box_bronze_5d49,
  .info-08ae {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .stale-39bc,
  .filter-2433 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .focus_focused_ebe2,
  .slider_bronze_4a55,
  .widget-bc61,
  .shadow_motion_a97e,
  .texture-selected-dc3c,
  .content-easy-d37e,
  .outer-3a99 {
    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 */
  .tooltip_pink_57be,
  .tag-basic-913d,
  .notice-5330,
  .up-8400,
  .photo_67d3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover_0a3c,
  .solid-0631,
  .photo-light-9875,
  .chip-stale-c785 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .menu_clean_4b6a,
  .hidden_b1c5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .up-7433,
  .active-b67f,
  .feature_cee1,
  .hover-wide-b7c1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .paper_fd33,
  .outer-5aef,
  .red_d509,
  .component-7dd8,
  .wide_8ef2,
  .carousel_small_f1d8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tooltip_pink_57be,
  .tag-basic-913d,
  .up-8400 {
    max-width: none !important;
  }
  
  .grid_6d8e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover_0a3c {
    font-size: 1.5rem !important;
  }
  
  .solid-0631 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .breadcrumb-bottom-2539,
  .widget_paper_f1ab {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .photo-light-9875 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status-778c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .disabled-7f91 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tooltip_pink_57be,
  .up-8400 {
    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: 131f */
.widget-item-k8 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.3;
}
