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

/* Fix for any potential overflow elements */
/* NOTE: ".gradient_short_6c11" 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.inner-a070 so it can't cause
   horizontal overflow anyway. */
.highlight_5702,
.green-b74e,
.overlay_7b13,
.pro-37d4,
.wrapper_bottom_1cc7,
.center-5082,
.list-9cff,
.avatar_soft_8b12,
.complex-c95c,
.highlight-stone-006f,
.media_249d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .row-soft-6f05 {
    padding: 8px 0;
  }
  
  .next-ab05 img {
    height: 28px;
    width: auto;
  }
  
  .header_first_d9ed {
    display: none !important;
  }
  
  .pagination_middle_4ec0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pagination_middle_4ec0 svg {
    width: 14px;
    height: 14px;
  }
  
  .disabled-b95c {
    padding: 6px;
  }
  
  .sidebar-c89e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .overlay_7b13,
  .green-b74e,
  .pro-37d4,
  .wrapper_bottom_1cc7,
  .media_center_9792,
  .upper_2c48,
  .overlay_simple_b7ca,
  .background-huge-a396,
  .status-8fc9,
  .soft_43f7,
  .container-9dfa,
  .pattern_fast_7701 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .picture-48d1,
  .input-next-08bc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .heading_e7a1,
  .footer_b217,
  .dynamic-3efb,
  .top_450d,
  .wide-35f2,
  .block-5a80,
  .card-9e61 {
    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 */
  .black-be50,
  .primary_silver_81e5,
  .border_inner_2e6e,
  .alert-inner-363b,
  .detail_7225 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .modal-dim-9508,
  .steel_1489,
  .sort-first-79ba,
  .text_warm_5285 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .badge-0945,
  .highlight_2c5c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .section_ad1f,
  .content_00a8,
  .fast_147b,
  .modal-bronze-eac3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .list_small_8c23,
  .status_3b85,
  .box_6cc5,
  .lite-347a,
  .paragraph-86f6,
  .solid-9134 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .black-be50,
  .primary_silver_81e5,
  .alert-inner-363b {
    max-width: none !important;
  }
  
  .gradient_short_6c11 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .modal-dim-9508 {
    font-size: 1.5rem !important;
  }
  
  .steel_1489 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .container_easy_5e7f,
  .hidden-fixed-466b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sort-first-79ba {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .texture_99e8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .right_1b11 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .black-be50,
  .alert-inner-363b {
    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: 17f1 */
.widget-item-s7 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.2;
}
