/* ============================================
   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 (.widget-613a) is a descendant of
   .chip_24eb (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.avatar_0667 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hero_0a84" 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.module_a25b so it can't cause
   horizontal overflow anyway. */
.button-red-25f7,
.sidebar-8a91,
.table_narrow_89e1,
.plasma_8e39,
.east-a40a,
.layout-next-4f27,
.sort_c4c2,
.alert-over-ce22,
.picture-lower-8ac1,
.shadow-9ccf,
.grid_f177 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .avatar-center-60b1 {
    padding: 8px 0;
  }
  
  .dropdown-3b5e img {
    height: 28px;
    width: auto;
  }
  
  .bright-6f36 {
    display: none !important;
  }
  
  .preview_122f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .preview_122f svg {
    width: 14px;
    height: 14px;
  }
  
  .carousel_warm_278a {
    padding: 6px;
  }
  
  .accent-12af {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .table_narrow_89e1,
  .sidebar-8a91,
  .plasma_8e39,
  .east-a40a,
  .south-8964,
  .sidebar_yellow_091a,
  .photo-e757,
  .tabs-mini-c431,
  .lite-4b04,
  .inner-4bd5,
  .new-1ed3,
  .avatar_short_de2b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .link-steel-626e,
  .component-tall-b1bf {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fresh_eaba,
  .paragraph-47e6,
  .sort_pink_81e9,
  .tall-374d,
  .narrow_a2c3,
  .middle-9c42,
  .primary-hot-adf9 {
    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 */
  .chip_fluid_02c8,
  .filter_up_3f8b,
  .table_c221,
  .article-green-28ec,
  .surface-active-8ed3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .top_78d4,
  .prev_906e,
  .glass_720d,
  .image-purple-87f0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .image-prev-2674,
  .steel_d683 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .logo_57d9,
  .focused_25ac,
  .pagination_light_b1b2,
  .status_small_3f06 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first-7bd6,
  .thumbnail-f67c,
  .silver_22e3,
  .silver_e167,
  .rough_7e36,
  .tooltip_focused_2c57 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .chip_fluid_02c8,
  .filter_up_3f8b,
  .article-green-28ec {
    max-width: none !important;
  }
  
  .hero_0a84 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .top_78d4 {
    font-size: 1.5rem !important;
  }
  
  .prev_906e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .medium_43ac,
  .right_5710 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .glass_720d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .nav_north_70c4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .plasma_0eaf {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chip_fluid_02c8,
  .article-green-28ec {
    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: d0af */
.phantom-card-d4 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.2;
}
