/* ============================================
   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 (.disabled-silver-4b5f) is a descendant of
   .layout-d6ed (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.action_2c7b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".layout_81fa" 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.column_wide_5d6a so it can't cause
   horizontal overflow anyway. */
.main-4262,
.new-081c,
.glass_bdde,
.item_lite_92a9,
.block-7fb7,
.popup_926a,
.bronze_8ca8,
.form_hard_b980,
.south-ff9e,
.mask-gas-29a7,
.breadcrumb_2409 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .detail-basic-cec1 {
    padding: 8px 0;
  }
  
  .tooltip-2f07 img {
    height: 28px;
    width: auto;
  }
  
  .light_1f02 {
    display: none !important;
  }
  
  .highlight_iron_1e19 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight_iron_1e19 svg {
    width: 14px;
    height: 14px;
  }
  
  .sidebar_next_0d22 {
    padding: 6px;
  }
  
  .section-8e04 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .glass_bdde,
  .new-081c,
  .item_lite_92a9,
  .block-7fb7,
  .media_70c9,
  .notice-5b8f,
  .cold-9944,
  .label-orange-f776,
  .block-18ea,
  .south_9071,
  .grid-a25d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bottom_1008,
  .upper_7e88 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .sidebar_b2da,
  .soft-d632,
  .notice-037a,
  .iron_4fc7,
  .section_short_e10b,
  .tooltip-slow-f492,
  .paragraph_inner_4a6f {
    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 */
  .easy-3b96,
  .brown-2e87,
  .filter-4ac9,
  .article-9bf9,
  .bright_783d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .cool_9fa9,
  .static-391a,
  .backdrop_dark_ec68,
  .container_center_1ad5 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .paragraph-full-0bf5,
  .backdrop-4e71 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tooltip_white_9ac9,
  .button-in-6038,
  .gradient_ac85,
  .avatar_d5e6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .breadcrumb-dea5,
  .icon-iron-2e90,
  .tooltip_8182,
  .main_eba3,
  .icon_outer_d3ea,
  .status_d4a4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .easy-3b96,
  .brown-2e87,
  .article-9bf9 {
    max-width: none !important;
  }
  
  .layout_81fa {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .cool_9fa9 {
    font-size: 1.5rem !important;
  }
  
  .static-391a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gallery_dfe1,
  .hover_3e4f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .backdrop_dark_ec68 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link-dirty-c2ab {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .slow_a714 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .easy-3b96,
  .article-9bf9 {
    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: e5f8 */
.widget-item-h1 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.1;
}
