/* ============================================
   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 (.box_huge_8939) is a descendant of
   .tabs_d3df (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.
   Two site templates coexist: legacy obfuscated-class (header.pink-7569)
   and the redesigned template (header.mini-d7ab). Keep both selectors. */
header.pink-7569,
header.mini-d7ab {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".large-3996" 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.avatar-fluid-aa3a so it can't cause
   horizontal overflow anyway. */
.fresh_ee4f,
.focused_b259,
.texture_488a,
.section_iron_442c,
.south-e2e0,
.dirty-ac07,
.popup-liquid-182d,
.solid_3dfa,
.focus_narrow_004e,
.sidebar_0270,
.progress-wood-6121 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .content-5a8f {
    padding: 8px 0;
  }
  
  .dynamic_f7ba img {
    height: 28px;
    width: auto;
  }
  
  .soft_d47d {
    display: none !important;
  }
  
  .border_lite_7979 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .border_lite_7979 svg {
    width: 14px;
    height: 14px;
  }
  
  .caption-tall-d729 {
    padding: 6px;
  }
  
  .down-13f4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .texture_488a,
  .focused_b259,
  .section_iron_442c,
  .south-e2e0,
  .highlight_bright_7959,
  .blue_4869,
  .alert-f0ed,
  .lite-a810,
  .sort_dark_5134,
  .element-5012,
  .layout-short-fc65,
  .plasma-73ad {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .warm_474b,
  .hovered-18ec {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .smooth_f889,
  .container_yellow_2991,
  .advanced-bba2,
  .tall-9d8e,
  .layout_4060,
  .white-b3c7,
  .white_2da5 {
    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 */
  .search_up_e5c8,
  .aside-7c4d,
  .old-e46d,
  .header-steel-f9f0,
  .paragraph_selected_77d1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notification_1d11,
  .photo-21d9,
  .label-9ef9,
  .heading-dim-10ac {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .carousel-91a8,
  .huge-155f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .photo_dynamic_e207,
  .caption_8ad7,
  .breadcrumb_955f,
  .warm_4965 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tag_south_23d6,
  .paragraph_old_faf9,
  .fast-5592,
  .tertiary_162b,
  .modal_fixed_2e7e,
  .active-8b33 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search_up_e5c8,
  .aside-7c4d,
  .header-steel-f9f0 {
    max-width: none !important;
  }
  
  .large-3996 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notification_1d11 {
    font-size: 1.5rem !important;
  }
  
  .photo-21d9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .narrow-b4b8,
  .mask_efc7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .label-9ef9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pink-034b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .section-795e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search_up_e5c8,
  .header-steel-f9f0 {
    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: 94a5 */
.hidden_full_a473 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 7dfa */
.shadow-element-o6 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.0;
}
