/* ============================================
   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 (.breadcrumb-soft-ae77) is a descendant of
   .wrapper-668d (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.hidden_96e9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".soft_d24b" 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.container_pressed_642d so it can't cause
   horizontal overflow anyway. */
.link_087a,
.pattern-full-b7ab,
.caption-action-bc88,
.component-e469,
.footer_complex_1f2d,
.slow_57ec,
.fluid_9276,
.image_soft_5246,
.list-4a11,
.shadow_clean_e63d,
.wood_9c57 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .huge_2446 {
    padding: 8px 0;
  }
  
  .logo_a091 img {
    height: 28px;
    width: auto;
  }
  
  .grid_warm_210c {
    display: none !important;
  }
  
  .tag-3f73 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tag-3f73 svg {
    width: 14px;
    height: 14px;
  }
  
  .background_bff6 {
    padding: 6px;
  }
  
  .primary_da6d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption-action-bc88,
  .pattern-full-b7ab,
  .component-e469,
  .footer_complex_1f2d,
  .info-last-4094,
  .focus_a58a,
  .widget-basic-8f83,
  .notification_lower_4ecd,
  .mask_east_65aa,
  .notice_selected_b283,
  .tag_156a,
  .north-831c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hard_c061,
  .button-dd39 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .huge-3fff,
  .carousel_bbe4,
  .pink-6137,
  .stale-ac6a,
  .surface_tall_9553,
  .static_4ee2,
  .complex_e16d {
    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 */
  .motion-3a93,
  .table-cool-dc45,
  .gas-0303,
  .status-20fc,
  .slider_prev_2c40 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge-b716,
  .plasma-b08c,
  .brown_0d72,
  .tertiary_gas_af63 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .detail_e0d2,
  .hard_958d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .block-344c,
  .red_2e13,
  .tooltip_13ed,
  .section_pink_1bdb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hero-warm-f81e,
  .layout-ec34,
  .tabs_5114,
  .text-light-f68d,
  .caption-white-79f4,
  .shadow-wood-ffb9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .motion-3a93,
  .table-cool-dc45,
  .status-20fc {
    max-width: none !important;
  }
  
  .soft_d24b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge-b716 {
    font-size: 1.5rem !important;
  }
  
  .plasma-b08c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dim-7525,
  .module_6a4a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .brown_0d72 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .paragraph_729a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .frame_912e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .motion-3a93,
  .status-20fc {
    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: ad96 */
.ghost-box-p4 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
