/* ============================================
   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 (.sidebar_eec5) is a descendant of
   .cold-a57d (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.video_4b23 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".under-7a3c" 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.box-a3a8 so it can't cause
   horizontal overflow anyway. */
.highlight_facf,
.pink-7857,
.hero-b46d,
.hover-632c,
.title_right_a30d,
.notice-inner-ff41,
.active_af82,
.active-complex-f595,
.media-0310,
.small_5f0b,
.wide-22bf {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gradient-d8bb {
    padding: 8px 0;
  }
  
  .media-12a1 img {
    height: 28px;
    width: auto;
  }
  
  .summary-current-d212 {
    display: none !important;
  }
  
  .old-c435 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .old-c435 svg {
    width: 14px;
    height: 14px;
  }
  
  .backdrop_clean_4957 {
    padding: 6px;
  }
  
  .notice_34f2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hero-b46d,
  .pink-7857,
  .hover-632c,
  .title_right_a30d,
  .bottom-7460,
  .widget-stale-3474,
  .badge_next_f03c,
  .hover_60b3,
  .media-huge-a4c7,
  .avatar_pressed_a2be,
  .clean-fe38,
  .preview-purple-2107 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .video-up-a3cc,
  .nav_pressed_8adc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .border-blue-2ac5,
  .chip_5be6,
  .thick_dfe0,
  .inner-b686,
  .footer-6d9b,
  .alert_7718,
  .stale-bfaa {
    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 */
  .paragraph-pink-6242,
  .progress-4afa,
  .hard-dba0,
  .grid_d86b,
  .hidden-right-0f6d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .avatar-2935,
  .gallery-d74d,
  .frame-0fe0,
  .picture_slow_d50a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .text-dim-a888,
  .card-5e9a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .static_fc94,
  .thick_1355,
  .texture_warm_e9e4,
  .tabs-4316 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notification_c3af,
  .element_old_954c,
  .overlay_small_f568,
  .west-bb28,
  .modal_9650,
  .breadcrumb-first-e0e9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paragraph-pink-6242,
  .progress-4afa,
  .grid_d86b {
    max-width: none !important;
  }
  
  .under-7a3c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .avatar-2935 {
    font-size: 1.5rem !important;
  }
  
  .gallery-d74d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .caption_steel_f706,
  .outline-iron-9df7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .frame-0fe0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hidden_8824 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .north_a312 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paragraph-pink-6242,
  .grid_d86b {
    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: 1996 */
.widget-item-w9 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
