/* ============================================
   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 (.status_complex_52af) is a descendant of
   .link_narrow_8463 (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.menu_solid_5503 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".advanced_72d7" 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.gallery_advanced_1605 so it can't cause
   horizontal overflow anyway. */
.hover-6a8b,
.light_4cb2,
.smooth-e98f,
.pressed-0ed6,
.list_cc6c,
.bottom_1fad,
.focus_in_032e,
.copper_9e32,
.grid-a4a7,
.red-7b87,
.last_b5a6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .form_next_284b {
    padding: 8px 0;
  }
  
  .container_839d img {
    height: 28px;
    width: auto;
  }
  
  .message-3c3c {
    display: none !important;
  }
  
  .under_c4be {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .under_c4be svg {
    width: 14px;
    height: 14px;
  }
  
  .module_4a0e {
    padding: 6px;
  }
  
  .copper-2b8f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .smooth-e98f,
  .light_4cb2,
  .pressed-0ed6,
  .list_cc6c,
  .huge_adeb,
  .gradient-red-a1e0,
  .top-6492,
  .block-5ee9,
  .solid_181f,
  .link-hard-e129,
  .progress_fresh_5f4c,
  .next-9f21 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label-e7c8,
  .green-c2c4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .layout-fc81,
  .solid_d4f7,
  .block_5bbf,
  .status_focused_720f,
  .soft-fb59,
  .disabled_tiny_d44d,
  .border-a925 {
    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 */
  .caption-2708,
  .frame_62f9,
  .surface_small_5f94,
  .pressed_fd78,
  .overlay-c995 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shade_7967,
  .module-in-8ccc,
  .nav-purple-12d1,
  .description_28f5 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element-f557,
  .dim-0d14 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .form_last_50f2,
  .center-86d0,
  .photo-left-3121,
  .list-small-83d3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .message_cool_d709,
  .grid-rough-f93c,
  .outer-e9ba,
  .current_f839,
  .left-1034,
  .feature-6529 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .caption-2708,
  .frame_62f9,
  .pressed_fd78 {
    max-width: none !important;
  }
  
  .advanced_72d7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shade_7967 {
    font-size: 1.5rem !important;
  }
  
  .module-in-8ccc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .silver-924c,
  .narrow_8cef {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .nav-purple-12d1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .chip-b254 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .menu-tall-e08a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .caption-2708,
  .pressed_fd78 {
    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: 62af */
.promo-block-x6 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.2;
}
