/* ============================================
   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 (.element_cool_210f) is a descendant of
   .upper_b53e (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.heading_basic_c48c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".slow_6c93" 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.filter_focused_0be0 so it can't cause
   horizontal overflow anyway. */
.notification-6727,
.container_bottom_cbdb,
.full-59db,
.notice-ba25,
.gradient-simple-42ff,
.detail_gas_ef6e,
.search-9289,
.aside-746e,
.chip_dynamic_69b5,
.light-d148,
.dim_950f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .inner_f655 {
    padding: 8px 0;
  }
  
  .hovered-5520 img {
    height: 28px;
    width: auto;
  }
  
  .list_inner_08ea {
    display: none !important;
  }
  
  .dirty_6e56 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dirty_6e56 svg {
    width: 14px;
    height: 14px;
  }
  
  .frame-bright-ad14 {
    padding: 6px;
  }
  
  .aside-stale-db3b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .full-59db,
  .container_bottom_cbdb,
  .notice-ba25,
  .gradient-simple-42ff,
  .current-2ca3,
  .preview_aadb,
  .section_wide_6f52,
  .orange-f7b1,
  .logo-57ee,
  .gallery-blue-72e2,
  .new_ff71,
  .light-30b4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .center_48a8,
  .header-fast-982a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .disabled_next_4eef,
  .hero-9269,
  .gallery-in-f6c0,
  .form-bcd6,
  .summary_red_0415,
  .old_b6d4,
  .small_4e43 {
    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 */
  .box-82cc,
  .advanced_40c0,
  .selected_59da,
  .rough_ef14,
  .row_upper_e1a3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .component-164d,
  .over_242a,
  .dirty_7e1f,
  .thumbnail_0e81 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .form-glass-5cbf,
  .notice_hard_e8a3 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tag_dynamic_4df2,
  .message_da66,
  .form-7c74,
  .simple-8e94 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .text_liquid_bab5,
  .mask_e8b4,
  .search-cold-fd8f,
  .banner-89cd,
  .focus_3935,
  .table_prev_dea1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .box-82cc,
  .advanced_40c0,
  .rough_ef14 {
    max-width: none !important;
  }
  
  .slow_6c93 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .component-164d {
    font-size: 1.5rem !important;
  }
  
  .over_242a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .thick_1297,
  .paragraph_selected_f7e9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dirty_7e1f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .list_yellow_e502 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .prev-e262 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .box-82cc,
  .rough_ef14 {
    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: 9737 */
.shadow-element-x2 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
