/* ============================================
   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 (.primary_e8c5) is a descendant of
   .media-8680 (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.breadcrumb-142c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".upper-3bd1" 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.selected-ab7b so it can't cause
   horizontal overflow anyway. */
.header_top_5f2d,
.middle-0d7d,
.tag-8d29,
.nav-black-c617,
.paragraph-fe5d,
.nav_outer_b34e,
.hero-copper-28c4,
.gradient_de0a,
.up-0281,
.hidden_e814,
.smooth_1cb0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .alert-active-d412 {
    padding: 8px 0;
  }
  
  .west_7a17 img {
    height: 28px;
    width: auto;
  }
  
  .description-plasma-9cba {
    display: none !important;
  }
  
  .small-f67c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .small-f67c svg {
    width: 14px;
    height: 14px;
  }
  
  .medium-7810 {
    padding: 6px;
  }
  
  .search_soft_6eff {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tag-8d29,
  .middle-0d7d,
  .nav-black-c617,
  .paragraph-fe5d,
  .caption-837b,
  .popup-a96f,
  .widget-simple-61a5,
  .tertiary_rough_76a5,
  .fluid-03fe,
  .mask-ece0,
  .prev_fa07,
  .menu_dark_fba2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .menu_5f8a,
  .tag_891c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .button_053f,
  .dropdown_2489,
  .status_tiny_b971,
  .background-9d8c,
  .component-purple-0042,
  .module-static-e2de,
  .hard_5bcc {
    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 */
  .silver-e663,
  .in-7e74,
  .outline-a422,
  .notice_79eb,
  .preview-stone-e769 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .small-7c28,
  .container-thick-2ee8,
  .gradient_fcd2,
  .liquid_d3a4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .panel_yellow_bd64,
  .surface_8f0e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .solid-fac0,
  .section_d961,
  .warm-e64c,
  .surface_7001 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .main-e04d,
  .paragraph_273e,
  .filter-208f,
  .rough-40f0,
  .shade-114d,
  .image-over-4820 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .silver-e663,
  .in-7e74,
  .notice_79eb {
    max-width: none !important;
  }
  
  .upper-3bd1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .small-7c28 {
    font-size: 1.5rem !important;
  }
  
  .container-thick-2ee8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .black-4ec9,
  .card-copper-e063 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gradient_fcd2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .in-dc4a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .frame_bbf5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .silver-e663,
  .notice_79eb {
    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: 57cd */
.phantom-card-c9 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.2;
}
