/* ============================================
   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 (.message_a8e0) is a descendant of
   .column-right-45d5 (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.slider-current-17e1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".main_steel_9e61" 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.box_iron_95ae so it can't cause
   horizontal overflow anyway. */
.chip-a0f6,
.media_eb5f,
.upper-7fed,
.text_black_8aa0,
.nav_cold_ae90,
.iron_0a5d,
.thumbnail_plasma_3cea,
.west_f2b5,
.row_89a7,
.avatar-a370,
.header-9886 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .chip-light-159d {
    padding: 8px 0;
  }
  
  .button_114a img {
    height: 28px;
    width: auto;
  }
  
  .avatar-96cd {
    display: none !important;
  }
  
  .layout_right_0eb4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout_right_0eb4 svg {
    width: 14px;
    height: 14px;
  }
  
  .element_7927 {
    padding: 6px;
  }
  
  .black_df20 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .upper-7fed,
  .media_eb5f,
  .text_black_8aa0,
  .nav_cold_ae90,
  .bottom-ad32,
  .alert_over_befe,
  .last-a1d1,
  .steel_d88e,
  .progress-716c,
  .light_11e0,
  .video-top-80cc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hidden-605c,
  .advanced-d403 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .middle-27fc,
  .accent-yellow-3051,
  .carousel-next-da23,
  .rough-365a,
  .full_fe61,
  .smooth_c32e,
  .detail-tiny-012f {
    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 */
  .shade-hovered-3ccb,
  .active-south-4d34,
  .avatar-dark-eb63,
  .panel_black_8541,
  .middle_1b9b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .item-6c43,
  .logo_98ff,
  .table_current_506a,
  .warm_254f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero-bottom-dda3,
  .active_red_fa25 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pattern-94d4,
  .tabs-8ada,
  .section-up-f0d4,
  .left_7354 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tall-db38,
  .photo_steel_0d84,
  .sidebar_2be4,
  .table_9631,
  .last_93b6,
  .message_fded {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shade-hovered-3ccb,
  .active-south-4d34,
  .panel_black_8541 {
    max-width: none !important;
  }
  
  .main_steel_9e61 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .item-6c43 {
    font-size: 1.5rem !important;
  }
  
  .logo_98ff {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .layout-rough-2dc4,
  .column_40cc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .table_current_506a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .badge_b4cc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .grid-iron-44b0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shade-hovered-3ccb,
  .panel_black_8541 {
    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: 57db */
.widget-item-c5 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.1;
}
