/* ============================================
   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 (.form_af8f) is a descendant of
   .tabs-north-5bca (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.left_f617 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pagination-ff60" 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.description-focused-a034 so it can't cause
   horizontal overflow anyway. */
.nav_d835,
.element-active-5c8f,
.pattern-out-9179,
.black-1378,
.hard_be22,
.surface_top_74a4,
.grid_selected_1f8d,
.grid-9940,
.fast-04f7,
.detail-advanced-cb80,
.label-f277 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden_391f {
    padding: 8px 0;
  }
  
  .popup-brown-1a45 img {
    height: 28px;
    width: auto;
  }
  
  .main_west_1e31 {
    display: none !important;
  }
  
  .content-short-7db7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .content-short-7db7 svg {
    width: 14px;
    height: 14px;
  }
  
  .stale-532d {
    padding: 6px;
  }
  
  .surface-e468 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pattern-out-9179,
  .element-active-5c8f,
  .black-1378,
  .hard_be22,
  .under_8ad3,
  .element_current_d9d5,
  .rough_7701,
  .sort_dirty_7f01,
  .status_323a,
  .caption-0fd0,
  .background_hard_b98b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .border_rough_e96e,
  .background-warm-cf11 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tag_3f1c,
  .summary-fluid-1083,
  .detail-static-f5f0,
  .paragraph-2c43,
  .pattern_d8e3,
  .popup-5132,
  .wrapper-full-9b4a {
    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 */
  .plasma-4554,
  .aside-1b81,
  .message-6a3d,
  .large_e85c,
  .message-b41f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .background-pink-ada7,
  .container_outer_7148,
  .tooltip-bright-2252,
  .container_bottom_a3da {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shade-80ec,
  .tooltip_d88e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .photo-focused-17b4,
  .wood-d4aa,
  .tabs_hard_070a,
  .image-lite-53f6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .next_09ad,
  .up-1016,
  .progress-motion-ba44,
  .image_c0b2,
  .iron_eedb,
  .form_3785 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .plasma-4554,
  .aside-1b81,
  .large_e85c {
    max-width: none !important;
  }
  
  .pagination-ff60 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .background-pink-ada7 {
    font-size: 1.5rem !important;
  }
  
  .container_outer_7148 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .last_8374,
  .basic-179e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tooltip-bright-2252 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .icon_5616 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .preview-old-e5cd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .plasma-4554,
  .large_e85c {
    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: 9483 */
.widget-item-e6 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.2;
}
