/* ============================================
   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 (.highlight-ce90) is a descendant of
   .fresh_9b8a (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.tabs-full-8dbb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".light-83ff" 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.badge-tiny-7aad so it can't cause
   horizontal overflow anyway. */
.chip-4760,
.layout_old_f64a,
.layout_bright_dbea,
.orange-5734,
.summary_b71b,
.pattern_brown_d78a,
.filter_iron_a94d,
.hover-b142,
.footer-outer-db49,
.medium_e749,
.box_red_4246 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .clean-07a0 {
    padding: 8px 0;
  }
  
  .gallery-4d53 img {
    height: 28px;
    width: auto;
  }
  
  .copper_c70a {
    display: none !important;
  }
  
  .full-1774 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .full-1774 svg {
    width: 14px;
    height: 14px;
  }
  
  .video_b337 {
    padding: 6px;
  }
  
  .message_bronze_d53f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .layout_bright_dbea,
  .layout_old_f64a,
  .orange-5734,
  .summary_b71b,
  .sidebar_wood_be5a,
  .accent-ab1c,
  .tag_759e,
  .row_761d,
  .filter_c1c2,
  .gradient_0538,
  .out-68cb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .heading_purple_a9a8,
  .tertiary-dfe3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .label-02b1,
  .article-737c,
  .huge_c1d9,
  .tooltip_1d28,
  .small-a301,
  .list-wood-c4f9,
  .frame-7682 {
    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 */
  .soft_e8e2,
  .media_2b79,
  .footer_a9d4,
  .selected-bd20,
  .focus-white-3d9d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .middle-5266,
  .tag-thick-e859,
  .label-steel-32a8,
  .form_f0ed {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .north_101a,
  .sidebar-north-dc9e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .primary_5066,
  .cold_a313,
  .element-bright-292e,
  .notice_white_7f48 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .silver-f34c,
  .narrow_477a,
  .last-e5bb,
  .yellow_d9e8,
  .texture-8e35,
  .media-6469 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .soft_e8e2,
  .media_2b79,
  .selected-bd20 {
    max-width: none !important;
  }
  
  .light-83ff {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .middle-5266 {
    font-size: 1.5rem !important;
  }
  
  .tag-thick-e859 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .slow-f9f8,
  .card-bff9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .label-steel-32a8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .surface-4c93 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .main_a10d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .soft_e8e2,
  .selected-bd20 {
    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: 7578 */
.ghost-box-w7 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
