/* ============================================
   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 (.tag-bottom-eadd) is a descendant of
   .tabs-4769 (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.old-ffb4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".label_9a97" 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.gas_1635 so it can't cause
   horizontal overflow anyway. */
.purple_97c6,
.outer-b323,
.notification_rough_a590,
.panel_c739,
.icon-1b7b,
.module_south_837e,
.title-8835,
.nav_upper_f2a0,
.dropdown_4407,
.dropdown-75fa,
.form-6a64 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside-rough-415e {
    padding: 8px 0;
  }
  
  .heading_white_195c img {
    height: 28px;
    width: auto;
  }
  
  .tabs-92db {
    display: none !important;
  }
  
  .north-5c8d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .north-5c8d svg {
    width: 14px;
    height: 14px;
  }
  
  .heading_04e9 {
    padding: 6px;
  }
  
  .status_red_f07a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notification_rough_a590,
  .outer-b323,
  .panel_c739,
  .icon-1b7b,
  .breadcrumb_wide_eff4,
  .outline_liquid_85ec,
  .hero-a499,
  .alert_c625,
  .sort_923f,
  .list-e453,
  .avatar-plasma-b0e7,
  .table_rough_8a43 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .section-5f70,
  .thumbnail-5083 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .menu_19db,
  .grid_0847,
  .input-4157,
  .element_d99c,
  .header-dirty-a658,
  .alert_6c31,
  .chip-0302 {
    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 */
  .photo_829a,
  .selected_8956,
  .article_79af,
  .block-4fa0,
  .footer_outer_7639 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sort-up-51f6,
  .tiny_ed90,
  .wood-2bdf,
  .button_stale_6541 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .accent-4e69,
  .layout_8f18 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .column-0fd5,
  .row-1b2c,
  .notification_pro_77b7,
  .west_243e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .full-c9a0,
  .list-1526,
  .grid-gold-5b34,
  .panel_67ff,
  .short_a259,
  .text-east-4675 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .photo_829a,
  .selected_8956,
  .block-4fa0 {
    max-width: none !important;
  }
  
  .label_9a97 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sort-up-51f6 {
    font-size: 1.5rem !important;
  }
  
  .tiny_ed90 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .paragraph-bfa8,
  .module-mini-54e0 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .wood-2bdf {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .wood-e861 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module_5787 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .photo_829a,
  .block-4fa0 {
    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: 5963 */
.promo-block-t0 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.0;
}
