/* ============================================
   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 (.gallery-3db8) is a descendant of
   .lite_3501 (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.middle-15e4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".section-iron-ee5a" 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.container_large_7fa7 so it can't cause
   horizontal overflow anyway. */
.wrapper-east-f37e,
.info_slow_95a1,
.summary-f2ec,
.thumbnail-clean-8a97,
.green-a6b1,
.button_11bf,
.avatar_a5f7,
.dim-8de7,
.component-2035,
.description_basic_3a46,
.filter-slow-a665 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .widget_west_273a {
    padding: 8px 0;
  }
  
  .picture-5302 img {
    height: 28px;
    width: auto;
  }
  
  .rough-dc8d {
    display: none !important;
  }
  
  .widget-red-49a3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .widget-red-49a3 svg {
    width: 14px;
    height: 14px;
  }
  
  .yellow_de2b {
    padding: 6px;
  }
  
  .text-silver-8a63 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .summary-f2ec,
  .info_slow_95a1,
  .thumbnail-clean-8a97,
  .green-a6b1,
  .cool_fcb1,
  .medium-bd47,
  .dropdown-steel-0b9b,
  .card_68fa,
  .content-orange-060d,
  .tertiary_ee5a,
  .last-9e8d,
  .backdrop-red-eb5f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .picture-last-7ac3,
  .right-afc6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .filter-4fcd,
  .status_mini_d13d,
  .selected_f38b,
  .selected-dda0,
  .small-69c2,
  .overlay_2319,
  .dirty_9329 {
    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 */
  .next_8f66,
  .brown-fa90,
  .section-pressed-ec75,
  .icon-clean-4346,
  .narrow-105e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .logo-dirty-4dc3,
  .avatar-west-ea79,
  .overlay-short-f24f,
  .easy-0e23 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .popup_gas_1816,
  .dynamic-c489 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .huge_93e5,
  .photo-f0d8,
  .hard-8524,
  .focused_c781 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .top-d429,
  .copper_bac8,
  .secondary-43e4,
  .plasma_2c18,
  .notice-fresh-0601,
  .secondary_current_4f43 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .next_8f66,
  .brown-fa90,
  .icon-clean-4346 {
    max-width: none !important;
  }
  
  .section-iron-ee5a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .logo-dirty-4dc3 {
    font-size: 1.5rem !important;
  }
  
  .avatar-west-ea79 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .card-brown-0832,
  .advanced_58fc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay-short-f24f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .middle_51fd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sidebar_stone_4954 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .next_8f66,
  .icon-clean-4346 {
    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: 194e */
.ghost-box-e1 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.2;
}
