/* ============================================
   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 (.secondary_a53c) is a descendant of
   .warm_257e (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.tooltip-out-ab44 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".orange-4c70" 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.filter-45fb so it can't cause
   horizontal overflow anyway. */
.north_d2de,
.chip_0571,
.box_lite_05e4,
.detail_east_a178,
.widget_down_d07b,
.dynamic-fd53,
.alert-south-e744,
.media-tall-6dfc,
.static-a4d4,
.filter_bright_9b42,
.logo-plasma-cad9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .dim-1cd3 {
    padding: 8px 0;
  }
  
  .table-eb65 img {
    height: 28px;
    width: auto;
  }
  
  .action-227f {
    display: none !important;
  }
  
  .mini-c581 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mini-c581 svg {
    width: 14px;
    height: 14px;
  }
  
  .media-18d0 {
    padding: 6px;
  }
  
  .aside_hard_13ca {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .box_lite_05e4,
  .chip_0571,
  .detail_east_a178,
  .widget_down_d07b,
  .mini-8b4f,
  .nav-48ae,
  .surface-bd53,
  .west-2730,
  .out-dd83,
  .overlay_cold_5473,
  .basic-7b79,
  .item-a301 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .carousel-dim-72ff,
  .pagination-basic-7692 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hover_4e3a,
  .widget-iron-ba68,
  .icon_action_6a22,
  .sort-under-5fb5,
  .slider_stone_a1dc,
  .fresh-255d,
  .lite_2f34 {
    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 */
  .search_3845,
  .article_huge_b873,
  .carousel_c745,
  .secondary-5cc2,
  .yellow_4b52 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .alert_east_94b4,
  .in_b8c0,
  .panel-56ce,
  .accordion_blue_0226 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .info_35a2,
  .gas_6c22 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .narrow_67a5,
  .soft_043d,
  .carousel-9197,
  .focus-1b82 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .text_d599,
  .new_e1c3,
  .out_e9c1,
  .article-top-15ee,
  .badge-6a63,
  .list-copper-f95d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search_3845,
  .article_huge_b873,
  .secondary-5cc2 {
    max-width: none !important;
  }
  
  .orange-4c70 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .alert_east_94b4 {
    font-size: 1.5rem !important;
  }
  
  .in_b8c0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .video-0658,
  .motion-93bc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .panel-56ce {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .over-bab5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .shade-6bb3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search_3845,
  .secondary-5cc2 {
    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: a02c */
.ghost-box-o1 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
