/* ============================================
   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 (.glass_3850) is a descendant of
   .module_805e (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.shade-2e5b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".panel_simple_187e" 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.info-cf56 so it can't cause
   horizontal overflow anyway. */
.sort_eb24,
.paragraph_plasma_6947,
.out-2b3f,
.label-selected-193a,
.banner-top-8b5c,
.button-tall-4e94,
.article_f1a1,
.smooth-0dd3,
.hot_431f,
.active-dcaa,
.card-fast-ba39 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .new_4e31 {
    padding: 8px 0;
  }
  
  .heading_a5dc img {
    height: 28px;
    width: auto;
  }
  
  .sidebar-hard-4880 {
    display: none !important;
  }
  
  .center_be7b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .center_be7b svg {
    width: 14px;
    height: 14px;
  }
  
  .hero-aa41 {
    padding: 6px;
  }
  
  .soft-5e9f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .out-2b3f,
  .paragraph_plasma_6947,
  .label-selected-193a,
  .banner-top-8b5c,
  .background_middle_c99d,
  .tertiary-fixed-0a3f,
  .main_prev_5962,
  .component_plasma_74c8,
  .thumbnail_prev_c3dd,
  .inner-81fd,
  .message_mini_6c69,
  .outline-upper-95b3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .banner_1729,
  .small-90cb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .dropdown_over_6fde,
  .hard_b519,
  .bronze-04d4,
  .accordion-4623,
  .active_06f4,
  .menu_simple_9285,
  .narrow-8aad {
    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 */
  .highlight-ec36,
  .tag-87e2,
  .tertiary_basic_b33d,
  .tooltip-659e,
  .picture-9af1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .feature-easy-b9b2,
  .tooltip_brown_5517,
  .table-selected-2506,
  .progress_af3c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .next_0b1e,
  .breadcrumb-lite-199c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .middle_e4f7,
  .link_cbd8,
  .image_dirty_72a6,
  .left-173c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .link-3fd7,
  .tertiary_5ede,
  .box_stale_3c10,
  .notification-c248,
  .highlight_3e27,
  .outer_31bf {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .highlight-ec36,
  .tag-87e2,
  .tooltip-659e {
    max-width: none !important;
  }
  
  .panel_simple_187e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .feature-easy-b9b2 {
    font-size: 1.5rem !important;
  }
  
  .tooltip_brown_5517 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .active_hard_9f1d,
  .primary_basic_0a2e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .table-selected-2506 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .right_abe5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .slow_e583 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .highlight-ec36,
  .tooltip-659e {
    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: af2d */
.ghost-box-f7 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.1;
}
