/* ============================================
   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 (.avatar_f8d1) is a descendant of
   .list-fluid-4cb5 (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.small-994b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".popup-next-373f" 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.nav_9ace so it can't cause
   horizontal overflow anyway. */
.up-f49e,
.info-cold-8911,
.message-9597,
.blue_d42c,
.border_rough_812f,
.outline-active-df02,
.button-iron-cf68,
.panel_5676,
.tertiary_basic_1b77,
.wood_ef48,
.item_cc4c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .shade-b75d {
    padding: 8px 0;
  }
  
  .accordion_gas_db0b img {
    height: 28px;
    width: auto;
  }
  
  .block_2c57 {
    display: none !important;
  }
  
  .tooltip-medium-553b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tooltip-medium-553b svg {
    width: 14px;
    height: 14px;
  }
  
  .action_9571 {
    padding: 6px;
  }
  
  .icon-hot-5a1e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .message-9597,
  .info-cold-8911,
  .blue_d42c,
  .border_rough_812f,
  .heading_311e,
  .label_24fd,
  .carousel-clean-394b,
  .outline-e692,
  .block-selected-bb30,
  .tertiary_steel_3c6e,
  .copper-79ee,
  .avatar-complex-57ed {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .light-07d8,
  .mini_51b3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .link_435c,
  .pattern-complex-4c86,
  .fast_79c0,
  .steel-2bd6,
  .blue_a330,
  .paper-3f41,
  .warm-2daa {
    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 */
  .dark-5474,
  .gallery_b155,
  .pattern_2e83,
  .photo-stone-9f53,
  .mask-small-95d5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .layout_static_1b1d,
  .stone-a4e0,
  .alert-96f5,
  .fixed_0144 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .secondary-paper-2f75,
  .dynamic_bc39 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sidebar-cold-533f,
  .badge-360f,
  .surface_c60a,
  .orange_9da6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gas-f367,
  .current_d6a4,
  .old_0edb,
  .stale-e83f,
  .disabled_1491,
  .shade_6461 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dark-5474,
  .gallery_b155,
  .photo-stone-9f53 {
    max-width: none !important;
  }
  
  .popup-next-373f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .layout_static_1b1d {
    font-size: 1.5rem !important;
  }
  
  .stone-a4e0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination-white-9343,
  .sidebar_d435 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .alert-96f5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .brown-00b2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .photo_south_ba89 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dark-5474,
  .photo-stone-9f53 {
    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: 6e9c */
.shadow-element-q5 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.2;
}
