/* ============================================
   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 (.picture_middle_bb6a) is a descendant of
   .hot_adec (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.row-down-9009 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".item_fdf7" 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.message-7d43 so it can't cause
   horizontal overflow anyway. */
.active_gold_ffde,
.menu_complex_2e46,
.hard_87d3,
.tertiary_bottom_5cf5,
.dark-cc32,
.feature_last_b4a8,
.shadow-70f6,
.search_lower_5c25,
.progress_5180,
.mask_small_15da,
.summary-58b4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .menu_4e7a {
    padding: 8px 0;
  }
  
  .hovered_7fe5 img {
    height: 28px;
    width: auto;
  }
  
  .hidden_smooth_b21a {
    display: none !important;
  }
  
  .icon_caf6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .icon_caf6 svg {
    width: 14px;
    height: 14px;
  }
  
  .hidden-light-b84a {
    padding: 6px;
  }
  
  .header_wide_813e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hard_87d3,
  .menu_complex_2e46,
  .tertiary_bottom_5cf5,
  .dark-cc32,
  .tertiary_241a,
  .hard_9b35,
  .full_1227,
  .south-bae6,
  .picture-focused-c4ab,
  .fluid-810b,
  .static-3919,
  .border_action_9634 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .accordion-b93a,
  .bottom_cb71 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over_b0c8,
  .carousel-d556,
  .bright_fae0,
  .section-dirty-c140,
  .plasma_28f4,
  .element-hot-6f7e,
  .preview_out_6bb0 {
    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 */
  .middle_df04,
  .secondary-911c,
  .under-e79a,
  .pagination-small-28ca,
  .stone-baee {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-2926,
  .wood_1e95,
  .message-f6b7,
  .tertiary-mini-568f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .orange-820c,
  .hot_267d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .carousel-dd59,
  .active-6008,
  .icon_hovered_1b6c,
  .texture_soft_da68 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .huge-7521,
  .frame-11e4,
  .slow-ee12,
  .middle_afe9,
  .cold_0086,
  .modal_cool_863f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .middle_df04,
  .secondary-911c,
  .pagination-small-28ca {
    max-width: none !important;
  }
  
  .item_fdf7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-2926 {
    font-size: 1.5rem !important;
  }
  
  .wood_1e95 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination-990d,
  .purple_5776 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .message-f6b7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .summary-fe5d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .backdrop-east-48e4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .middle_df04,
  .pagination-small-28ca {
    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: 77cd */
.shadow-element-e2 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.0;
}
