/* ============================================
   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-silver-2518) is a descendant of
   .progress-bda4 (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.thumbnail_cool_6e75 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".iron-1a98" 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.action-b54d so it can't cause
   horizontal overflow anyway. */
.header_fast_3d3a,
.tall-80ec,
.header_top_f66d,
.wood-d083,
.form-e2cf,
.input_up_afba,
.mask-bbd0,
.dark_98d0,
.south-613d,
.advanced-6c1c,
.disabled_thick_14cf {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .focused-35f3 {
    padding: 8px 0;
  }
  
  .pro_2a54 img {
    height: 28px;
    width: auto;
  }
  
  .stale_1e72 {
    display: none !important;
  }
  
  .aside-f056 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .aside-f056 svg {
    width: 14px;
    height: 14px;
  }
  
  .dark-9ad8 {
    padding: 6px;
  }
  
  .soft_fb59 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header_top_f66d,
  .tall-80ec,
  .wood-d083,
  .form-e2cf,
  .wrapper_light_cf59,
  .shade-99bb,
  .chip-tall-cd06,
  .hot-8cad,
  .advanced_397a,
  .white_3963,
  .pagination_warm_b1f4,
  .sidebar_dynamic_fa3f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .first_d0f0,
  .backdrop_a7fb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .blue-9907,
  .item_2019,
  .advanced_f2e6,
  .overlay_fixed_0f30,
  .caption-clean-0a92,
  .dropdown_ab97,
  .menu_fast_c04b {
    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 */
  .background_0190,
  .avatar-first-297e,
  .summary-2b43,
  .box-c2a1,
  .icon-cec1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hidden_b395,
  .gradient-clean-c152,
  .basic-3ba0,
  .hard_69aa {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .table_current_86bd,
  .chip_097e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paper-4276,
  .slow-4ff2,
  .link-first-0826,
  .yellow-87cf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .item-a3be,
  .stale-3046,
  .huge-8e3a,
  .pagination_40c3,
  .hover-84af,
  .slow-c8fa {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .background_0190,
  .avatar-first-297e,
  .box-c2a1 {
    max-width: none !important;
  }
  
  .iron-1a98 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hidden_b395 {
    font-size: 1.5rem !important;
  }
  
  .gradient-clean-c152 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .notice_ab8b,
  .lite-d3b9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .basic-3ba0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .layout_b143 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .accordion-in-fa27 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .background_0190,
  .box-c2a1 {
    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: 1a34 */
.shadow-element-b7 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.1;
}
