/* ============================================
   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 (.silver-5796) is a descendant of
   .shade-6cb4 (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.layout_hard_7d98 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".out_6ff5" 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.down_d2af so it can't cause
   horizontal overflow anyway. */
.chip-da37,
.active-cold-5811,
.notice_78e2,
.caption-c752,
.column_out_62ed,
.texture-0ea0,
.tertiary_1158,
.message-rough-ffaf,
.article-b5a2,
.outline_2791,
.highlight-118c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background-b744 {
    padding: 8px 0;
  }
  
  .label_5b8f img {
    height: 28px;
    width: auto;
  }
  
  .dim-f1cb {
    display: none !important;
  }
  
  .wrapper_inner_5c20 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wrapper_inner_5c20 svg {
    width: 14px;
    height: 14px;
  }
  
  .tooltip-selected-2585 {
    padding: 6px;
  }
  
  .main_efcb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notice_78e2,
  .active-cold-5811,
  .caption-c752,
  .column_out_62ed,
  .wrapper_2d3a,
  .yellow-78bc,
  .info-cef1,
  .info-top-bb59,
  .table_clean_3dc4,
  .info-f412,
  .article_current_2b3e,
  .element-dark-9de3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .video_6b86,
  .tertiary-brown-9c4a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .picture_a9f5,
  .dropdown_c215,
  .east-0f37,
  .header_bottom_d557,
  .light_b822,
  .banner_east_21ed,
  .light_4df2 {
    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-iron-7672,
  .box-79e1,
  .focused_3073,
  .modal-lite-8e92,
  .tabs-bright-4314 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .first_3134,
  .mask_liquid_c8dc,
  .link_middle_e878,
  .disabled-2ae7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tertiary_91c4,
  .title_bottom_cf43 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .disabled_hard_a67c,
  .border-paper-3380,
  .title_dark_2b73,
  .hover_9b9f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .feature-378f,
  .list-gas-c75c,
  .label-7f64,
  .feature-fixed-b182,
  .footer_7560,
  .row-west-1c00 {
    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-iron-7672,
  .box-79e1,
  .modal-lite-8e92 {
    max-width: none !important;
  }
  
  .out_6ff5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .first_3134 {
    font-size: 1.5rem !important;
  }
  
  .mask_liquid_c8dc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .texture_stone_6f3f,
  .left-02bc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .link_middle_e878 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .filter-selected-a727 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .content_0a8a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .info-iron-7672,
  .modal-lite-8e92 {
    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: 0323 */
.widget-item-z4 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.3;
}
