/* ============================================
   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 (.wrapper_ad9b) is a descendant of
   .accordion-0f91 (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.layout_9a6c)
   and the redesigned template (header.element-rough-4b99). Keep both selectors. */
header.layout_9a6c,
header.element-rough-4b99 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".new_84ae" 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.texture_34b6 so it can't cause
   horizontal overflow anyway. */
.outline_8b4b,
.feature-right-0ad3,
.pressed_8986,
.feature-orange-13bd,
.link_brown_7b2b,
.panel-f45b,
.center_5fb1,
.narrow-bc57,
.mask-advanced-c089,
.full_ee74,
.tooltip-huge-dbef {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .progress_white_5149 {
    padding: 8px 0;
  }
  
  .heading_ee2f img {
    height: 28px;
    width: auto;
  }
  
  .bottom-3fd8 {
    display: none !important;
  }
  
  .tertiary_af9e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tertiary_af9e svg {
    width: 14px;
    height: 14px;
  }
  
  .solid-4173 {
    padding: 6px;
  }
  
  .element_eca0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pressed_8986,
  .feature-right-0ad3,
  .feature-orange-13bd,
  .link_brown_7b2b,
  .picture_a74f,
  .cool-c5b0,
  .action_3140,
  .orange-abae,
  .overlay_tiny_50c4,
  .media_105c,
  .frame-84ad,
  .shadow-c24b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail-8583,
  .shadow_outer_0657 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .accordion-c7cf,
  .light_a4d5,
  .component-080c,
  .outer-fc51,
  .input_f45c,
  .backdrop_gold_dc73,
  .solid-2184 {
    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 */
  .container-lite-be0d,
  .rough-7f1c,
  .modal_right_db48,
  .description-bc8e,
  .orange_e168 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .first_7e67,
  .overlay-d707,
  .chip-lower-9138,
  .wood_453c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .secondary_fluid_6a9a,
  .list_motion_e3bc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .middle_baa8,
  .button_cold_286a,
  .logo-8408,
  .dropdown-660e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .purple_8077,
  .layout_5acb,
  .panel-a56d,
  .medium_def0,
  .green_1fb9,
  .link-red-307d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .container-lite-be0d,
  .rough-7f1c,
  .description-bc8e {
    max-width: none !important;
  }
  
  .new_84ae {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .first_7e67 {
    font-size: 1.5rem !important;
  }
  
  .overlay-d707 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .main-9cd9,
  .element-3366 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .chip-lower-9138 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .card_slow_2691 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .border-slow-b9ca {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .container-lite-be0d,
  .description-bc8e {
    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 */
.title_simple_92a6 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 197b */
.phantom-card-v2 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
