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

/* Fix for any potential overflow elements */
/* NOTE: ".shade-east-3be1" 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.primary-advanced-0d14 so it can't cause
   horizontal overflow anyway. */
.frame-82a7,
.panel_wide_69d8,
.copper_2b76,
.popup-soft-5726,
.medium-92e4,
.slow_ca65,
.east-35a6,
.paragraph-pink-a64e,
.link-gas-1e2c,
.paragraph_1e12,
.outline-ab3b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .action-c0be {
    padding: 8px 0;
  }
  
  .dynamic_713c img {
    height: 28px;
    width: auto;
  }
  
  .header_5874 {
    display: none !important;
  }
  
  .highlight_current_e49d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight_current_e49d svg {
    width: 14px;
    height: 14px;
  }
  
  .photo_72d8 {
    padding: 6px;
  }
  
  .simple_0e6f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .copper_2b76,
  .panel_wide_69d8,
  .popup-soft-5726,
  .medium-92e4,
  .pressed_0459,
  .info_pro_a096,
  .form_13fe,
  .heading_lite_c1b6,
  .hard_7641,
  .grid-static-c4e7,
  .accordion_stone_2877,
  .heading_green_9acc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .thumbnail-motion-f5a6,
  .description_fc59 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .modal-bb40,
  .gallery-b629,
  .first_2fa9,
  .element-5c92,
  .wrapper_7184,
  .title_3ed1,
  .next_408b {
    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 */
  .chip-45c0,
  .tertiary_e618,
  .photo_selected_429e,
  .hidden_c9ef,
  .nav_f4d6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notice_7b36,
  .tooltip-focused-3ecd,
  .frame-pink-527f,
  .highlight-basic-4a8e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .right_0046,
  .grid_9b9b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hard-db13,
  .gas-1d71,
  .purple-2702,
  .tall-99dd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .disabled_narrow_632c,
  .summary-current-d458,
  .medium_551f,
  .alert_short_f348,
  .content-90ee,
  .blue_89ab {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .chip-45c0,
  .tertiary_e618,
  .hidden_c9ef {
    max-width: none !important;
  }
  
  .shade-east-3be1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notice_7b36 {
    font-size: 1.5rem !important;
  }
  
  .tooltip-focused-3ecd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tertiary-white-b5a4,
  .north_92d6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .frame-pink-527f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .smooth_f9bd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .border-pressed-9755 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chip-45c0,
  .hidden_c9ef {
    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: 5700 */
.ghost-box-a5 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.1;
}
