/* ============================================
   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 (.hard-7697) is a descendant of
   .breadcrumb-inner-375e (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.breadcrumb-paper-9ffc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".outline_simple_119e" 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.narrow-6b7d so it can't cause
   horizontal overflow anyway. */
.section_up_a34d,
.dark-cf0e,
.stone-940e,
.warm-5941,
.sidebar_rough_2ede,
.badge_2f62,
.complex-8ee0,
.dropdown-out-aef0,
.upper-2132,
.summary-c63a,
.media_3693 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .left-2de0 {
    padding: 8px 0;
  }
  
  .progress_0dc1 img {
    height: 28px;
    width: auto;
  }
  
  .modal_2ad2 {
    display: none !important;
  }
  
  .advanced-11ae {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .advanced-11ae svg {
    width: 14px;
    height: 14px;
  }
  
  .widget_over_4308 {
    padding: 6px;
  }
  
  .column-a963 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .stone-940e,
  .dark-cf0e,
  .warm-5941,
  .sidebar_rough_2ede,
  .label-1bbd,
  .sort_prev_445d,
  .short_a715,
  .motion_7bc9,
  .element_6f55,
  .middle_88ed,
  .shade-first-aee9,
  .carousel_up_2092 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .header_fcef,
  .gas-4317 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .photo_2a89,
  .label_8147,
  .small-f0ec,
  .focused-ad0b,
  .element-dim-b121,
  .footer-399c,
  .pagination-rough-0306 {
    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 */
  .heading_a991,
  .table_next_bd97,
  .focus_6d1a,
  .short_95a6,
  .message_active_75c7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gas-448b,
  .disabled_pink_4f05,
  .purple-ba88,
  .notification_liquid_827d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mask_light_bb0c,
  .clean-2222 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .image-inner-9378,
  .media_full_1d23,
  .highlight_smooth_ccc3,
  .chip_red_1b1c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .inner-e086,
  .selected_6cb8,
  .advanced_96e1,
  .grid_dd62,
  .iron_c5e0,
  .accent_79ca {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .heading_a991,
  .table_next_bd97,
  .short_95a6 {
    max-width: none !important;
  }
  
  .outline_simple_119e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gas-448b {
    font-size: 1.5rem !important;
  }
  
  .disabled_pink_4f05 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .modal-cd08,
  .logo-motion-00fd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .purple-ba88 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .up-a0eb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .wood_d190 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .heading_a991,
  .short_95a6 {
    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: b4d3 */
.phantom-card-a4 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.2;
}
