/* ============================================
   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 (.steel-e4ec) is a descendant of
   .highlight-af5f (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.grid-dirty-9864 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".item_b5c0" 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.new_3562 so it can't cause
   horizontal overflow anyway. */
.input-tall-8f53,
.module-medium-eae1,
.outer_dfd5,
.badge_3d4a,
.panel_lower_7ac5,
.icon_85f4,
.avatar_ab0f,
.avatar_90f9,
.footer_center_e8ff,
.menu-d21f,
.text-smooth-4a4f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .outer_9f19 {
    padding: 8px 0;
  }
  
  .modal-63be img {
    height: 28px;
    width: auto;
  }
  
  .background-active-5bde {
    display: none !important;
  }
  
  .badge-a9b7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .badge-a9b7 svg {
    width: 14px;
    height: 14px;
  }
  
  .search-bd0a {
    padding: 6px;
  }
  
  .clean-d7e8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .outer_dfd5,
  .module-medium-eae1,
  .badge_3d4a,
  .panel_lower_7ac5,
  .hidden-f36e,
  .info_e8cf,
  .content-0059,
  .block-south-0f5d,
  .stale_6af6,
  .image-8ea2,
  .tabs-blue-4174,
  .container-brown-615e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .under-cf77,
  .video_south_0861 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paragraph-purple-269f,
  .text_bf06,
  .title_west_a7f3,
  .warm-e56a,
  .cold-efc1,
  .breadcrumb_2799,
  .chip-232c {
    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 */
  .alert-brown-6c9f,
  .link_warm_ff29,
  .middle-1043,
  .center-e7f6,
  .texture-south-6764 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .popup-fresh-0757,
  .left_7aa7,
  .steel-7404,
  .blue_dba2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .feature-e35e,
  .east-9947 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .up_6b58,
  .box-3db1,
  .gold_8945,
  .old_8bdc {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hidden-red-08c7,
  .sort-ece9,
  .column-541d,
  .preview-purple-330d,
  .summary_1379,
  .hover_6420 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .alert-brown-6c9f,
  .link_warm_ff29,
  .center-e7f6 {
    max-width: none !important;
  }
  
  .item_b5c0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .popup-fresh-0757 {
    font-size: 1.5rem !important;
  }
  
  .left_7aa7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .mask-bd33,
  .tooltip_869f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .steel-7404 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .image_3356 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .nav_upper_8cc1 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .alert-brown-6c9f,
  .center-e7f6 {
    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: fcb4 */
.ghost-box-q6 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.2;
}
