/* ============================================
   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 (.layout-dirty-9a10) is a descendant of
   .sidebar_76c9 (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.icon-mini-8ebb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dark-9ef3" 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.modal-thick-1ef5 so it can't cause
   horizontal overflow anyway. */
.pattern-brown-beb5,
.white-e80d,
.clean_c638,
.sidebar-last-7fe5,
.icon-8590,
.component_hard_bfb5,
.mask_f72b,
.filter_5614,
.in_7fa4,
.feature_current_1398,
.search-f6d7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .south_f7ff {
    padding: 8px 0;
  }
  
  .dirty_5497 img {
    height: 28px;
    width: auto;
  }
  
  .border_aae6 {
    display: none !important;
  }
  
  .frame-3f2c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .frame-3f2c svg {
    width: 14px;
    height: 14px;
  }
  
  .tag_d166 {
    padding: 6px;
  }
  
  .wood-ca81 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .clean_c638,
  .white-e80d,
  .sidebar-last-7fe5,
  .icon-8590,
  .banner-6695,
  .container-active-e5aa,
  .chip_last_05d9,
  .yellow-a7e2,
  .thumbnail-7284,
  .lite_ba08,
  .feature_f3b2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bottom-dfc5,
  .container-dark-d972 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .highlight_044c,
  .glass-626b,
  .pattern_soft_3599,
  .grid_a963,
  .easy-e576,
  .box_b3a5,
  .right-9623 {
    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 */
  .paper-6b67,
  .notice_pro_184c,
  .left-d50e,
  .lower-f82f,
  .large-ef36 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .feature_de30,
  .cold_79db,
  .modal-white-44c8,
  .panel-069b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tiny_c0d3,
  .label_393c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .card_5555,
  .secondary_last_d258,
  .progress_last_63bd,
  .slider-bd43 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .prev-67ca,
  .gold_0e4b,
  .info-428d,
  .overlay_48d8,
  .green-0f90,
  .label-last-be0c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paper-6b67,
  .notice_pro_184c,
  .lower-f82f {
    max-width: none !important;
  }
  
  .dark-9ef3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .feature_de30 {
    font-size: 1.5rem !important;
  }
  
  .cold_79db {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shade_stone_bec0,
  .medium-a787 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .modal-white-44c8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .smooth-bf27 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link-wide-c2ad {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paper-6b67,
  .lower-f82f {
    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: 7e65 */
.shadow-element-m9 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.1;
}
