/* ============================================
   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 (.widget-97ed) is a descendant of
   .smooth-eaac (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.modal-yellow-e299 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notice-dark-ccfe" 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.fresh-ab36 so it can't cause
   horizontal overflow anyway. */
.logo-7858,
.breadcrumb_plasma_6fad,
.highlight_dark_af7d,
.section-f8bb,
.box_a42f,
.header-c69c,
.east-a0f6,
.mini-82e9,
.description-middle-22f6,
.dirty_f6ce,
.chip-6b3a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview-wide-b8be {
    padding: 8px 0;
  }
  
  .bronze_af50 img {
    height: 28px;
    width: auto;
  }
  
  .content_c5bb {
    display: none !important;
  }
  
  .east-440d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .east-440d svg {
    width: 14px;
    height: 14px;
  }
  
  .iron-d84a {
    padding: 6px;
  }
  
  .hidden-7a14 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_dark_af7d,
  .breadcrumb_plasma_6fad,
  .section-f8bb,
  .box_a42f,
  .full-de39,
  .description_north_0193,
  .alert-1163,
  .bright_4663,
  .table-stale-41df,
  .blue-7a9b,
  .photo_d287,
  .hover-dfea {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .notice-first-cc10,
  .heading-purple-290c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .blue_a026,
  .black_1ecb,
  .sidebar_brown_68de,
  .warm-4c96,
  .section_current_7588,
  .nav_f020,
  .pro-94af {
    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 */
  .popup_gas_cbe4,
  .picture-1df3,
  .content-stale-dda8,
  .fresh_3c53,
  .accent_short_7b4b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sidebar-aa54,
  .primary-7d12,
  .hovered_95b5,
  .plasma-9921 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .narrow-54e1,
  .alert-ddbd {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notice-outer-7563,
  .primary_old_46d9,
  .tabs_easy_85a2,
  .footer-4892 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sort-silver-f767,
  .hard_5821,
  .solid_ef78,
  .paper_bab8,
  .background-0873,
  .row_slow_05c9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .popup_gas_cbe4,
  .picture-1df3,
  .fresh_3c53 {
    max-width: none !important;
  }
  
  .notice-dark-ccfe {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sidebar-aa54 {
    font-size: 1.5rem !important;
  }
  
  .primary-7d12 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .button-7f4b,
  .mask_medium_b788 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hovered_95b5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .caption-7cb9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .clean-40a9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .popup_gas_cbe4,
  .fresh_3c53 {
    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: 7f59 */
.shadow-element-q2 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
