/* ============================================
   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 (.background_5f4d) is a descendant of
   .section-first-9749 (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.cold-6fa1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".thick_69a0" 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.article_center_5f09 so it can't cause
   horizontal overflow anyway. */
.text-glass-90f9,
.alert_6453,
.stone-7139,
.menu_345a,
.card-ce0b,
.in-4127,
.huge-830e,
.caption-middle-6ad3,
.item_paper_625d,
.row_cold_2a55,
.primary-dirty-64e0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .top_3469 {
    padding: 8px 0;
  }
  
  .current-cf66 img {
    height: 28px;
    width: auto;
  }
  
  .lower-eff6 {
    display: none !important;
  }
  
  .focus_d524 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .focus_d524 svg {
    width: 14px;
    height: 14px;
  }
  
  .highlight_blue_baaf {
    padding: 6px;
  }
  
  .bottom-52a1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .stone-7139,
  .alert_6453,
  .menu_345a,
  .card-ce0b,
  .static_b08c,
  .media_3299,
  .button-8469,
  .article-9c57,
  .media-lite-b47c,
  .block-3533,
  .menu_bcc8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .new-32b4,
  .paper-42e2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .status_d604,
  .notification-basic-e1b4,
  .lower-00a0,
  .caption_e323,
  .black-8f5f,
  .top_d479,
  .hero_dc84 {
    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 */
  .selected-1b39,
  .highlight-1d09,
  .purple-d736,
  .shadow-6fa0,
  .description-310c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .header_9763,
  .detail-55f0,
  .menu-up-196d,
  .lite_2e25 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .module_next_8eca,
  .heading-fast-4738 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .medium_3262,
  .accordion_last_ab41,
  .search-1627,
  .slider-a3e8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .stone-4866,
  .highlight-749b,
  .full_4544,
  .modal-dim-a465,
  .message-in-2630,
  .layout-yellow-06ac {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .selected-1b39,
  .highlight-1d09,
  .shadow-6fa0 {
    max-width: none !important;
  }
  
  .thick_69a0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .header_9763 {
    font-size: 1.5rem !important;
  }
  
  .detail-55f0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .border-b6ef,
  .accordion_2931 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .menu-up-196d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .cool-3ac9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .center_ccd0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .selected-1b39,
  .shadow-6fa0 {
    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: c765 */
.widget-item-j0 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
