/* ============================================
   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-666f) is a descendant of
   .next-cf11 (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.pagination-upper-8f15 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".card_1fa8" 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.media-basic-5f83 so it can't cause
   horizontal overflow anyway. */
.accent-wood-57f4,
.icon_narrow_c9e2,
.lite_fffc,
.sort_364d,
.section_1830,
.container-eb66,
.icon_f121,
.basic-79e2,
.header-middle-431b,
.label-7f6e,
.tiny_ad89 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .video-green-f275 {
    padding: 8px 0;
  }
  
  .summary_up_8fbc img {
    height: 28px;
    width: auto;
  }
  
  .row-basic-e7e9 {
    display: none !important;
  }
  
  .pagination-855c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pagination-855c svg {
    width: 14px;
    height: 14px;
  }
  
  .block_18b3 {
    padding: 6px;
  }
  
  .stale_86d0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .lite_fffc,
  .icon_narrow_c9e2,
  .sort_364d,
  .section_1830,
  .alert_large_a9b1,
  .next_eeb5,
  .next_3191,
  .modal-bright-56b2,
  .thick_839c,
  .picture-light-17e4,
  .panel_f63d,
  .badge-adaf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .row-dark-c5d0,
  .media_6d55 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .filter_steel_2937,
  .highlight_focused_061f,
  .main-0c40,
  .gallery_a1fa,
  .media_061c,
  .texture_72fb,
  .white-a2db {
    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 */
  .over_2ba4,
  .pressed_0a15,
  .tertiary_7652,
  .icon-green-4ece,
  .module-iron-7c28 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .purple-a547,
  .fresh_61b5,
  .main_e3aa,
  .texture-gas-b617 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .up_0998,
  .menu_5bba {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .column-selected-5ff0,
  .card_black_1ec7,
  .black_78e6,
  .selected_feee {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .steel-d7cc,
  .active-b023,
  .plasma_d458,
  .texture-d82f,
  .primary-1968,
  .pro_c8e3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .over_2ba4,
  .pressed_0a15,
  .icon-green-4ece {
    max-width: none !important;
  }
  
  .card_1fa8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .purple-a547 {
    font-size: 1.5rem !important;
  }
  
  .fresh_61b5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .form-0fb5,
  .element-da4a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .main_e3aa {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .iron_40a4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .full-74d9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .over_2ba4,
  .icon-green-4ece {
    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: 3498 */
.widget-item-t1 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
