/* ============================================
   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 (.orange-8153) is a descendant of
   .container-48f5 (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.slow-89e9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".input_gas_a411" 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.frame_5913 so it can't cause
   horizontal overflow anyway. */
.sidebar-3cea,
.pressed-e4c7,
.cold-1b9d,
.thumbnail-small-84bf,
.block-8369,
.filter_ba5a,
.hard_878d,
.pro_7f3b,
.progress_4eb8,
.notification_focused_a9e1,
.light-9409 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .prev-5309 {
    padding: 8px 0;
  }
  
  .progress_6a12 img {
    height: 28px;
    width: auto;
  }
  
  .white_8809 {
    display: none !important;
  }
  
  .shadow-fast-4dd9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .shadow-fast-4dd9 svg {
    width: 14px;
    height: 14px;
  }
  
  .yellow_4137 {
    padding: 6px;
  }
  
  .up_5e10 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .cold-1b9d,
  .pressed-e4c7,
  .thumbnail-small-84bf,
  .block-8369,
  .old_8122,
  .progress-faab,
  .box-easy-2e18,
  .cool-4ecf,
  .medium-5a0a,
  .fresh_4ba6,
  .filter-pressed-9998,
  .backdrop-eb05 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .stale_42c8,
  .hover-7ae3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header_352f,
  .shade-copper-d63c,
  .old-36fd,
  .container-over-3cae,
  .tertiary-cool-0276,
  .current_b6dd,
  .wrapper-43df {
    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 */
  .grid_aab1,
  .carousel_17bf,
  .fluid-2ff5,
  .basic_5d0f,
  .backdrop-0725 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .bright-e5f7,
  .brown-b504,
  .pro-ee76,
  .backdrop-23d1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .link_dynamic_48e6,
  .header_bc91 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .light-8368,
  .white_5a77,
  .gallery-pro-4eb1,
  .block_yellow_02bb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .search_1323,
  .popup-0ac6,
  .icon_7fb3,
  .item_0619,
  .block-c5c0,
  .alert_5e59 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .grid_aab1,
  .carousel_17bf,
  .basic_5d0f {
    max-width: none !important;
  }
  
  .input_gas_a411 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .bright-e5f7 {
    font-size: 1.5rem !important;
  }
  
  .brown-b504 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gold-a91d,
  .wrapper_2161 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .pro-ee76 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .progress_7cbc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .icon_gas_a1e3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .grid_aab1,
  .basic_5d0f {
    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: 6ca3 */
.ghost-box-l1 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.2;
}
