/* ============================================
   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 (.highlight_0293) is a descendant of
   .small_7035 (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.stale-76e8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".avatar_basic_461b" 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.secondary_c021 so it can't cause
   horizontal overflow anyway. */
.purple_3342,
.wide-54c4,
.media_eb5f,
.panel-cf59,
.white_948f,
.complex-58a7,
.breadcrumb-5430,
.tag_green_ee5b,
.column-easy-9e18,
.gallery_lower_c29e,
.heading-current-80a7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sidebar-inner-8398 {
    padding: 8px 0;
  }
  
  .accent_c925 img {
    height: 28px;
    width: auto;
  }
  
  .pagination_blue_97a1 {
    display: none !important;
  }
  
  .hover-green-b847 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hover-green-b847 svg {
    width: 14px;
    height: 14px;
  }
  
  .medium_655d {
    padding: 6px;
  }
  
  .form-bdb1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .media_eb5f,
  .wide-54c4,
  .panel-cf59,
  .white_948f,
  .search_b5dd,
  .notice_upper_e3bc,
  .background_tall_b811,
  .message_f4eb,
  .tag_2864,
  .grid_up_842c,
  .block_6bb2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shade_advanced_0c6b,
  .hero-new-ed44 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .element_d640,
  .purple-b36e,
  .header_024d,
  .slow-a3d9,
  .active-8c1b,
  .full_2de1,
  .solid_49f3 {
    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_f1e0,
  .alert-0d66,
  .over-fcce,
  .media-524a,
  .dim_b3f3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .media-5358,
  .south_53b5,
  .full_594c,
  .soft_d6a1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .basic-cb54,
  .dark_8a89 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .backdrop_c6a7,
  .green_5beb,
  .button-77ec,
  .active_650b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .row-steel-737e,
  .input_small_36fe,
  .element-lower-4264,
  .tabs-over-2c89,
  .mask-7c54,
  .logo_40ec {
    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_f1e0,
  .alert-0d66,
  .media-524a {
    max-width: none !important;
  }
  
  .avatar_basic_461b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .media-5358 {
    font-size: 1.5rem !important;
  }
  
  .south_53b5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tooltip_dynamic_f417,
  .wood-bfb6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .full_594c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .frame_65ca {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .box_pressed_9c01 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chip_f1e0,
  .media-524a {
    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: 575b */
.phantom-card-t5 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.1;
}
