/* ============================================
   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 (.frame-f4c4) is a descendant of
   .wrapper-a25e (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.card_south_245a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".slider-e228" 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_left_7aa4 so it can't cause
   horizontal overflow anyway. */
.hero-pressed-320c,
.article_narrow_4669,
.wrapper_beb3,
.first-74d5,
.active_a75c,
.section-d85f,
.short-9389,
.popup_2689,
.module-dim-e5df,
.primary_3189,
.paper_9fa2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .header_3454 {
    padding: 8px 0;
  }
  
  .pattern-lite-1bda img {
    height: 28px;
    width: auto;
  }
  
  .backdrop-north-5271 {
    display: none !important;
  }
  
  .narrow-c1a5 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .narrow-c1a5 svg {
    width: 14px;
    height: 14px;
  }
  
  .prev-b142 {
    padding: 6px;
  }
  
  .primary_fluid_8dbd {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wrapper_beb3,
  .article_narrow_4669,
  .first-74d5,
  .active_a75c,
  .modal-7190,
  .outline-b2b3,
  .dynamic_68dc,
  .heading_over_df89,
  .stale-1194,
  .heading_1acc,
  .small_07c6,
  .action_4cd6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .row-rough-0966,
  .large_bb39 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .advanced_5291,
  .layout-b553,
  .tiny-2bd3,
  .filter_liquid_3336,
  .background_35d8,
  .solid_0258,
  .left_a4db {
    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 */
  .row_orange_7635,
  .gradient-73c6,
  .form_cool_bc1e,
  .aside-hovered-8c4f,
  .rough-4ee2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tall-421b,
  .badge-b8a3,
  .huge-169e,
  .wrapper_9158 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mask-ed9b,
  .header-in-b024 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .logo_current_7ba6,
  .notice-cold-66d0,
  .block-02e8,
  .modal_9c87 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .medium_72fe,
  .container-thick-0952,
  .footer_easy_6bdb,
  .surface_solid_eee5,
  .brown_08ab,
  .carousel_pro_0809 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .row_orange_7635,
  .gradient-73c6,
  .aside-hovered-8c4f {
    max-width: none !important;
  }
  
  .slider-e228 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tall-421b {
    font-size: 1.5rem !important;
  }
  
  .badge-b8a3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .notification-1f35,
  .medium_cce2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .huge-169e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .row_over_f86c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .backdrop-easy-5d3b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .row_orange_7635,
  .aside-hovered-8c4f {
    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: f82f */
.ghost-box-i5 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
