/* ============================================
   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 (.pagination_liquid_1e5d) is a descendant of
   .backdrop-yellow-49bc (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.glass-4d67 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".primary-cf5c" 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.soft_e394 so it can't cause
   horizontal overflow anyway. */
.pagination-a8a3,
.notification-da71,
.pagination-over-2935,
.title-78b5,
.primary_9582,
.row-ba34,
.main-58d3,
.west_6bac,
.tabs-yellow-3e09,
.title-2d72,
.last_6cd8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hover_e87b {
    padding: 8px 0;
  }
  
  .bottom-4f6d img {
    height: 28px;
    width: auto;
  }
  
  .hot_b230 {
    display: none !important;
  }
  
  .pressed_68fd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pressed_68fd svg {
    width: 14px;
    height: 14px;
  }
  
  .texture-pro-1242 {
    padding: 6px;
  }
  
  .notice_medium_e12d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pagination-over-2935,
  .notification-da71,
  .title-78b5,
  .primary_9582,
  .filter_30b1,
  .cold_b310,
  .active-first-5b86,
  .section-center-3608,
  .summary-4b8e,
  .lower-9923,
  .carousel-short-f0f9,
  .last_9f5a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .card-4da1,
  .tag_3de1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .info_motion_b217,
  .menu-a2a2,
  .gradient_9470,
  .up-fdb2,
  .icon_basic_eb6c,
  .element_tall_3601,
  .progress-liquid-087f {
    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 */
  .table-49a2,
  .heading_6665,
  .dynamic-8a1e,
  .border-153c,
  .element_hot_4fc8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .left_5e42,
  .aside_8408,
  .outer_ceb1,
  .avatar_c0e4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element-mini-b87e,
  .link-7a81 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh_055a,
  .background_dirty_3786,
  .tertiary_4d29,
  .outline_east_543a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .banner_c0d4,
  .tiny_2c35,
  .over-872e,
  .paragraph-be59,
  .label-e015,
  .article_fast_819d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .table-49a2,
  .heading_6665,
  .border-153c {
    max-width: none !important;
  }
  
  .primary-cf5c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .left_5e42 {
    font-size: 1.5rem !important;
  }
  
  .aside_8408 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tooltip_fcc6,
  .tertiary_down_260f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .outer_ceb1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sidebar-645a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .container_dc2d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .table-49a2,
  .border-153c {
    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: 3f06 */
.phantom-card-t2 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
