/* ============================================
   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 (.title-orange-8fe1) is a descendant of
   .article-motion-77d3 (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.summary-static-9bf1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".main_7f8b" 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.paragraph_complex_d916 so it can't cause
   horizontal overflow anyway. */
.plasma-cdc2,
.pagination-bright-3068,
.static_5d32,
.hidden_28ba,
.paper_1cd8,
.list_iron_11d5,
.secondary_cb41,
.gallery-north-6baf,
.inner-f61c,
.upper_e19f,
.main-80d1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .photo_2038 {
    padding: 8px 0;
  }
  
  .motion_bf55 img {
    height: 28px;
    width: auto;
  }
  
  .tertiary_1017 {
    display: none !important;
  }
  
  .highlight_blue_826b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight_blue_826b svg {
    width: 14px;
    height: 14px;
  }
  
  .simple-bebd {
    padding: 6px;
  }
  
  .purple_8107 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .static_5d32,
  .pagination-bright-3068,
  .hidden_28ba,
  .paper_1cd8,
  .lower_4517,
  .picture-6ff2,
  .black-dc6a,
  .aside_943c,
  .avatar_center_2551,
  .status-2669,
  .panel-purple-fdc3,
  .box-dca0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .panel-old-9de2,
  .menu-pink-25a5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hidden-narrow-8688,
  .table_aa79,
  .info_orange_4345,
  .gallery_3ec0,
  .pagination-blue-078c,
  .button-clean-acd1,
  .modal_dc09 {
    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 */
  .container_344f,
  .item_7770,
  .element_cde2,
  .slow_009c,
  .paragraph-6574 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .filter-red-dc08,
  .south-b5be,
  .hidden_782d,
  .simple_e71b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .widget-1a95,
  .accordion-complex-b155 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .widget_hot_26e0,
  .mask-5dce,
  .liquid-00b0,
  .alert_wood_c11f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .icon-over-cc33,
  .shadow_wood_1bd2,
  .pressed_38bc,
  .hover-smooth-4aa2,
  .feature_outer_d97d,
  .card_e548 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .container_344f,
  .item_7770,
  .slow_009c {
    max-width: none !important;
  }
  
  .main_7f8b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .filter-red-dc08 {
    font-size: 1.5rem !important;
  }
  
  .south-b5be {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .sort-stale-7559,
  .right-99c2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hidden_782d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .steel-25aa {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .block_bd61 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .container_344f,
  .slow_009c {
    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: 3e23 */
.phantom-card-y4 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.1;
}
