/* ============================================
   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 (.container_c659) is a descendant of
   .gradient-current-1e65 (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.caption-07a1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notice-a9be" 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.tertiary_2860 so it can't cause
   horizontal overflow anyway. */
.paragraph_fe10,
.focused-54c2,
.tooltip-wide-8cf6,
.hidden-37d1,
.notice_current_610b,
.column-2d2c,
.simple-cbc3,
.dynamic-a32a,
.tall-f875,
.liquid-06b3,
.heading_advanced_4200 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .mask_66cd {
    padding: 8px 0;
  }
  
  .fresh-f50d img {
    height: 28px;
    width: auto;
  }
  
  .link-stone-dbc6 {
    display: none !important;
  }
  
  .border-orange-7a95 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .border-orange-7a95 svg {
    width: 14px;
    height: 14px;
  }
  
  .main-under-6629 {
    padding: 6px;
  }
  
  .huge_adaf {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tooltip-wide-8cf6,
  .focused-54c2,
  .hidden-37d1,
  .notice_current_610b,
  .paragraph-bottom-78da,
  .pattern-1b46,
  .sort_df0d,
  .glass_6edd,
  .summary-medium-0a17,
  .plasma_8144,
  .smooth_4377,
  .mini_722b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .simple-1932,
  .header_525c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .search-brown-7f1d,
  .block_8d14,
  .detail-cold-153d,
  .preview-5589,
  .center_e6f7,
  .card_stale_e37c,
  .sort_d7ee {
    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 */
  .wood-cf68,
  .tertiary-new-35fa,
  .dim_d43a,
  .highlight_over_3327,
  .button-fca3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .left_ead1,
  .pattern-short-708f,
  .summary-5438,
  .container-f38c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .disabled_d617,
  .pagination-07b7 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .component_a748,
  .accordion_ef22,
  .bronze-2ce3,
  .message-lite-af5e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .middle_610c,
  .thick-202e,
  .action_98c4,
  .purple-ad47,
  .east_5ff5,
  .container-brown-649b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .wood-cf68,
  .tertiary-new-35fa,
  .highlight_over_3327 {
    max-width: none !important;
  }
  
  .notice-a9be {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .left_ead1 {
    font-size: 1.5rem !important;
  }
  
  .pattern-short-708f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .button-steel-df80,
  .frame-mini-3885 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .summary-5438 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notification-cool-f071 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .smooth-e5be {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .wood-cf68,
  .highlight_over_3327 {
    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: 91f6 */
.ghost-box-j0 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.0;
}
