/* ============================================
   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 (.background-b8b2) is a descendant of
   .highlight_ec8e (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.gallery_d611 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".bronze_5deb" 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.summary-9f82 so it can't cause
   horizontal overflow anyway. */
.bright-898c,
.heading-73ac,
.frame_db47,
.new_e071,
.card_7c04,
.fast-9e1d,
.breadcrumb_cold_0b7c,
.full_e280,
.shadow-wide-3e09,
.focused_66ae,
.avatar-silver-4f1d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .steel-08d9 {
    padding: 8px 0;
  }
  
  .status-fast-bbf9 img {
    height: 28px;
    width: auto;
  }
  
  .basic_4782 {
    display: none !important;
  }
  
  .south_61e0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .south_61e0 svg {
    width: 14px;
    height: 14px;
  }
  
  .badge-5c3c {
    padding: 6px;
  }
  
  .surface_out_692e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .frame_db47,
  .heading-73ac,
  .new_e071,
  .card_7c04,
  .thumbnail_46df,
  .button-fab0,
  .progress-new-c234,
  .breadcrumb-7665,
  .mask-0e09,
  .secondary-pink-d4c1,
  .stone-67bb,
  .list-8846 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .module_plasma_6dae,
  .avatar_north_90e8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .menu-f5fa,
  .copper_d111,
  .white-3e32,
  .top-a354,
  .banner-45e7,
  .description-7d79,
  .title_89c4 {
    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 */
  .secondary-fb90,
  .avatar_78f0,
  .table-inner-bb48,
  .feature_820e,
  .sidebar-tall-364c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dynamic_5044,
  .filter-first-93c7,
  .slider-6319,
  .banner-right-7db0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .simple-c1cb,
  .outer_1eb6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .disabled-7e93,
  .card_over_b065,
  .wrapper-up-7764,
  .sort_short_c3f1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .frame-current-ba11,
  .tag_slow_53fa,
  .modal-dirty-bd4b,
  .white_9dc4,
  .section-d12b,
  .pro_2264 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .secondary-fb90,
  .avatar_78f0,
  .feature_820e {
    max-width: none !important;
  }
  
  .bronze_5deb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dynamic_5044 {
    font-size: 1.5rem !important;
  }
  
  .filter-first-93c7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .paragraph-light-6983,
  .green_0e05 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .slider-6319 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hidden-c360 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .heading-f12e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .secondary-fb90,
  .feature_820e {
    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: 0641 */
.widget-item-x5 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.3;
}
