/* ============================================
   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 (.article-north-90e2) is a descendant of
   .focus-9bc7 (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.breadcrumb-rough-4d60 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".silver-6843" 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.chip_static_f97a so it can't cause
   horizontal overflow anyway. */
.hovered_89de,
.hero_694d,
.pressed_08e1,
.overlay_inner_f8b7,
.narrow_8731,
.pagination-left-70a7,
.widget-green-7171,
.status-white-8cc7,
.smooth-bd65,
.full_c12d,
.logo-south-d85b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hard-4517 {
    padding: 8px 0;
  }
  
  .disabled_plasma_59b8 img {
    height: 28px;
    width: auto;
  }
  
  .old-e2f0 {
    display: none !important;
  }
  
  .upper-925f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .upper-925f svg {
    width: 14px;
    height: 14px;
  }
  
  .media-4207 {
    padding: 6px;
  }
  
  .banner_brown_efc0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pressed_08e1,
  .hero_694d,
  .overlay_inner_f8b7,
  .narrow_8731,
  .modal-tiny-bdce,
  .dynamic_b1e0,
  .border-d739,
  .tag-top-44df,
  .feature_8e2e,
  .mini_7293,
  .focus_bee8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .caption_5c3e,
  .preview_east_47ee {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .preview_3217,
  .menu-paper-c363,
  .pagination-a934,
  .breadcrumb-large-117b,
  .background_right_1f0e,
  .left-65ed,
  .aside_iron_9a2b {
    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 */
  .smooth-00d4,
  .layout-d19b,
  .paper-7aaf,
  .input_949a,
  .soft-9c19 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-26af,
  .alert_plasma_4b30,
  .modal_over_92ef,
  .avatar-ad95 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .narrow-70a9,
  .tertiary-868d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .label-cd69,
  .row_advanced_b7ab,
  .media-743b,
  .rough_25a1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .row_00bc,
  .summary-1b75,
  .south_d811,
  .advanced-dc32,
  .gold_dde8,
  .full-70dc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .smooth-00d4,
  .layout-d19b,
  .input_949a {
    max-width: none !important;
  }
  
  .silver-6843 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-26af {
    font-size: 1.5rem !important;
  }
  
  .alert_plasma_4b30 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .banner_west_23cb,
  .message-yellow-8295 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .modal_over_92ef {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active-complex-9ceb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .list-3492 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .smooth-00d4,
  .input_949a {
    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: abf5 */
.ghost-box-t7 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.3;
}
