/* ============================================
   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 (.input_short_06c1) is a descendant of
   .right_af31 (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.pattern-advanced-5aa8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".feature-fixed-5d21" 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.main-e33a so it can't cause
   horizontal overflow anyway. */
.thumbnail_white_337e,
.grid-1b6a,
.liquid_695f,
.notice_narrow_d427,
.row_6bef,
.old-b322,
.action_1b51,
.menu-ddeb,
.avatar_9d7d,
.frame-286d,
.carousel_c217 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .active-right-e82f {
    padding: 8px 0;
  }
  
  .detail_under_b798 img {
    height: 28px;
    width: auto;
  }
  
  .hover-cdbf {
    display: none !important;
  }
  
  .block-3c83 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .block-3c83 svg {
    width: 14px;
    height: 14px;
  }
  
  .carousel_dynamic_c0bd {
    padding: 6px;
  }
  
  .alert-e635 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .liquid_695f,
  .grid-1b6a,
  .notice_narrow_d427,
  .row_6bef,
  .summary_bf02,
  .accordion_pro_bdb1,
  .header_hard_a7dd,
  .pattern_32ee,
  .tabs_silver_f9df,
  .button-smooth-07d2,
  .slow-faae,
  .sidebar-b730 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .last_eb52,
  .gallery_f944 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .accent-2983,
  .highlight-82c0,
  .preview-b5bf,
  .blue-1b2f,
  .hidden_stale_6c6a,
  .aside_3198,
  .backdrop-6ec8 {
    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 */
  .stone_b7a6,
  .bronze_0ad5,
  .frame-next-4ee2,
  .accordion-a637,
  .preview_down_a1cd {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .over_24b6,
  .wide_03e3,
  .basic_2f6c,
  .box_e5ac {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .form_11c6,
  .tall_85c4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .outer_4cf4,
  .layout-2658,
  .dynamic_f8d5,
  .iron_0221 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gas-cb98,
  .clean_260c,
  .section-purple-4046,
  .large_6c5a,
  .card_prev_b955,
  .middle_f764 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .stone_b7a6,
  .bronze_0ad5,
  .accordion-a637 {
    max-width: none !important;
  }
  
  .feature-fixed-5d21 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .over_24b6 {
    font-size: 1.5rem !important;
  }
  
  .wide_03e3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .stone_e47f,
  .search-49f6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .basic_2f6c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay-9ec8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .table_west_f34e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .stone_b7a6,
  .accordion-a637 {
    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: d76e */
.phantom-card-u4 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.3;
}
