/* ============================================
   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 (.left-0e4b) is a descendant of
   .alert_8676 (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.focus_bottom_42f3 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".glass-e7b9" 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.shade-copper-8b57 so it can't cause
   horizontal overflow anyway. */
.notice_74a2,
.chip-orange-8cd0,
.element_basic_45b9,
.tertiary-pressed-c2d3,
.row-1c56,
.module_9f79,
.video-3f40,
.short_2f9d,
.focused-e342,
.dirty-7e88,
.status_4c91 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .chip_0afc {
    padding: 8px 0;
  }
  
  .video_easy_4e10 img {
    height: 28px;
    width: auto;
  }
  
  .element_fast_1641 {
    display: none !important;
  }
  
  .layout-purple-c275 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout-purple-c275 svg {
    width: 14px;
    height: 14px;
  }
  
  .light_10a1 {
    padding: 6px;
  }
  
  .article-5412 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .element_basic_45b9,
  .chip-orange-8cd0,
  .tertiary-pressed-c2d3,
  .row-1c56,
  .small_b1f4,
  .primary-b2c8,
  .accent-west-0034,
  .table-d0b5,
  .middle-60c6,
  .first_4b4f,
  .modal-c4e9,
  .frame-6935 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .header-62dd,
  .top_59b1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .inner-edbe,
  .media_05aa,
  .form_complex_bc78,
  .accordion_down_2a1f,
  .active-6a6a,
  .secondary_b35f,
  .footer_a379 {
    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 */
  .picture-middle-d20d,
  .avatar-fresh-6ae7,
  .detail_action_3de3,
  .stale-1a6a,
  .focus_89d9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .border_bb1c,
  .steel-7be0,
  .liquid-5b7f,
  .paper_e8ac {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .component_advanced_4583,
  .thumbnail-new-ebc6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .item-left-4d79,
  .carousel_e067,
  .light-2eba,
  .description-upper-396b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .info-a60b,
  .search-hot-0a06,
  .hot-2929,
  .first-b58f,
  .breadcrumb_hard_db17,
  .hard-89ee {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .picture-middle-d20d,
  .avatar-fresh-6ae7,
  .stale-1a6a {
    max-width: none !important;
  }
  
  .glass-e7b9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .border_bb1c {
    font-size: 1.5rem !important;
  }
  
  .steel-7be0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .current-ff5c,
  .banner_2ba6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .liquid-5b7f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .center-13ed {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module_wood_f9fa {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .picture-middle-d20d,
  .stale-1a6a {
    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: a856 */
.phantom-card-v8 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.1;
}
