/* ============================================
   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 (.lite-fc08) is a descendant of
   .notification_0432 (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.shadow_light_aeaa {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gas_dc8f" 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.sidebar_f93a so it can't cause
   horizontal overflow anyway. */
.hidden_inner_23b1,
.sort-copper-0acb,
.text_1bf8,
.media-fb44,
.surface_cold_0d5a,
.chip-ed81,
.primary-2fe9,
.feature_iron_8288,
.modal_58b2,
.outline-old-a08b,
.header-478a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .input_3b10 {
    padding: 8px 0;
  }
  
  .clean-54ad img {
    height: 28px;
    width: auto;
  }
  
  .copper_bf8b {
    display: none !important;
  }
  
  .title-glass-3ff6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .title-glass-3ff6 svg {
    width: 14px;
    height: 14px;
  }
  
  .aside-hovered-72a1 {
    padding: 6px;
  }
  
  .new_821f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .text_1bf8,
  .sort-copper-0acb,
  .media-fb44,
  .surface_cold_0d5a,
  .heading-selected-7d73,
  .smooth_8769,
  .advanced_300a,
  .east_1996,
  .layout-bright-027c,
  .input-55dc,
  .video-a288,
  .content-14f3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .nav-c060,
  .main_last_2113 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .section_0056,
  .link-dark-e9c4,
  .north-3a44,
  .left_c965,
  .highlight-3e17,
  .hidden-10d0,
  .section-plasma-2a03 {
    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 */
  .right-11fd,
  .icon_lite_1e0c,
  .pressed_04cc,
  .red-a269,
  .modal-purple-def8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .old_dc89,
  .accordion_cold_3e27,
  .fixed_d63b,
  .east_45a3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wood-07ee,
  .disabled_upper_a96c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .surface-dynamic-31c7,
  .heading_6767,
  .video-5c91,
  .notification_5bbf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .form_stale_f3ac,
  .notice_bf25,
  .media_4a7b,
  .plasma-289a,
  .container-59f7,
  .button-simple-9bd3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .right-11fd,
  .icon_lite_1e0c,
  .red-a269 {
    max-width: none !important;
  }
  
  .gas_dc8f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .old_dc89 {
    font-size: 1.5rem !important;
  }
  
  .accordion_cold_3e27 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wrapper-4b0a,
  .input-pro-c3ff {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fixed_d63b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .focus-simple-7d6f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .advanced-7ec6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .right-11fd,
  .red-a269 {
    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: a3bc */
.promo-block-h2 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
