/* ============================================
   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 (.backdrop_huge_b7a3) is a descendant of
   .column-82c6 (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.grid-205d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".message-soft-1a7e" 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.button_dark_4b42 so it can't cause
   horizontal overflow anyway. */
.active-middle-c347,
.element-08e1,
.info-7454,
.list-85f3,
.column_5029,
.message-c7c5,
.tertiary-781e,
.background_action_0de3,
.hidden_in_6409,
.left-0d95,
.gas_bfbd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .text_hovered_d1b4 {
    padding: 8px 0;
  }
  
  .south_ff61 img {
    height: 28px;
    width: auto;
  }
  
  .down_b76b {
    display: none !important;
  }
  
  .panel-a02b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .panel-a02b svg {
    width: 14px;
    height: 14px;
  }
  
  .grid_4b11 {
    padding: 6px;
  }
  
  .section_4c21 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .info-7454,
  .element-08e1,
  .list-85f3,
  .column_5029,
  .video-advanced-1891,
  .shade-bright-0870,
  .detail-hard-81f1,
  .link-prev-818b,
  .mask_yellow_4d1b,
  .wood-0a9e,
  .pattern_stone_8076,
  .table_f717 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .column_outer_09c3,
  .short_3e94 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fresh_90d4,
  .content_stone_e85c,
  .badge-df8d,
  .hero_focused_7fa4,
  .module-b83e,
  .description_7fe5,
  .background_selected_89b7 {
    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 */
  .info_slow_acea,
  .tabs_dc9a,
  .form-082c,
  .box-2e62,
  .progress_rough_7e33 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .wood_8db0,
  .blue-1ecd,
  .list-95d2,
  .main_f489 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .container_4420,
  .shade-84a5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .link-ad97,
  .fixed-9ac8,
  .tertiary_82e3,
  .pressed-fb43 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notice-2def,
  .green-b403,
  .sidebar_1322,
  .over_caab,
  .caption-under-30ab,
  .heading-7c92 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .info_slow_acea,
  .tabs_dc9a,
  .box-2e62 {
    max-width: none !important;
  }
  
  .message-soft-1a7e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .wood_8db0 {
    font-size: 1.5rem !important;
  }
  
  .blue-1ecd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .stone-682c,
  .nav-69af {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .list-95d2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .preview_huge_a06c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .motion-e949 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .info_slow_acea,
  .box-2e62 {
    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: 35bb */
.phantom-card-r6 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.2;
}
