/* ============================================
   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 (.complex-59cf) is a descendant of
   .module-right-6919 (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.large_c3a0 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".paper_4215" 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.yellow_79b1 so it can't cause
   horizontal overflow anyway. */
.next_c26d,
.status_87ac,
.large-586e,
.progress_tall_4be1,
.fresh_31dd,
.secondary-02f9,
.primary_basic_05a6,
.highlight-8ae8,
.container_e323,
.accent-north-c635,
.advanced_fa31 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notification_1e78 {
    padding: 8px 0;
  }
  
  .item_58a5 img {
    height: 28px;
    width: auto;
  }
  
  .carousel-307c {
    display: none !important;
  }
  
  .heading-purple-c2b6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .heading-purple-c2b6 svg {
    width: 14px;
    height: 14px;
  }
  
  .border_4b0a {
    padding: 6px;
  }
  
  .secondary-94a7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .large-586e,
  .status_87ac,
  .progress_tall_4be1,
  .fresh_31dd,
  .carousel-upper-bda5,
  .center_7648,
  .main_dc50,
  .logo_full_4a37,
  .content_45b6,
  .pagination-c0f7,
  .card-a164,
  .grid_red_e4ff {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .caption_gold_4831,
  .text_bfac {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .gold-f8ce,
  .red-e2aa,
  .block-red-6743,
  .disabled_under_3068,
  .green_048a,
  .active_760e,
  .wood-1dcc {
    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 */
  .box-wood-5ce2,
  .south-f6bc,
  .basic_3c85,
  .yellow_5d27,
  .feature-2e17 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dim_d360,
  .steel-e15a,
  .accent-aeef,
  .tag-6f95 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .label_4679,
  .frame-96f0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .label-4f5a,
  .up-ad4d,
  .widget_f0d2,
  .gold-065a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dirty_dd47,
  .blue-b9c0,
  .disabled_ed71,
  .overlay_e599,
  .table-4c2a,
  .overlay_b341 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .box-wood-5ce2,
  .south-f6bc,
  .yellow_5d27 {
    max-width: none !important;
  }
  
  .paper_4215 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dim_d360 {
    font-size: 1.5rem !important;
  }
  
  .steel-e15a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .active_6cdb,
  .action-8dad {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .accent-aeef {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .liquid-8555 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .west-e5b9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .box-wood-5ce2,
  .yellow_5d27 {
    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: b976 */
.promo-block-w2 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
