/* ============================================
   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 (.button_south_b07b) is a descendant of
   .hard-75bc (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.block-prev-6342 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dim_80c8" 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.huge-8706 so it can't cause
   horizontal overflow anyway. */
.box_f117,
.dynamic_274d,
.disabled_4e2f,
.main-990f,
.grid_abf5,
.message-black-7d12,
.breadcrumb_39c2,
.element-north-b420,
.down-b0ef,
.button-28d9,
.yellow-245c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wrapper-next-76e5 {
    padding: 8px 0;
  }
  
  .caption-smooth-64a4 img {
    height: 28px;
    width: auto;
  }
  
  .photo-bright-53f1 {
    display: none !important;
  }
  
  .fresh_89be {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fresh_89be svg {
    width: 14px;
    height: 14px;
  }
  
  .component-9a22 {
    padding: 6px;
  }
  
  .avatar-1aaa {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .disabled_4e2f,
  .dynamic_274d,
  .main-990f,
  .grid_abf5,
  .thick-5a2a,
  .pattern_pressed_3d83,
  .text-top-d091,
  .heading_4a2c,
  .link_purple_8502,
  .input_d053,
  .shadow_24df,
  .next_073f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .badge_eef1,
  .mask_mini_ccf5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .backdrop-1f05,
  .carousel-4914,
  .soft-3a7c,
  .outline_e6f8,
  .item-41fc,
  .surface-4b22,
  .block_e9bc {
    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 */
  .dirty_e9e7,
  .main-new-0ac8,
  .table-dynamic-566c,
  .pink-58d4,
  .disabled_9515 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tiny_9447,
  .message-focused-e80a,
  .image-ca6d,
  .complex-272f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .focus_72cf,
  .main-0e16 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .stone-8fbb,
  .grid-89ca,
  .east-759e,
  .hovered_6e93 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notification_25fc,
  .header_upper_bdb6,
  .label-fd9a,
  .element_out_57cf,
  .header-cb8a,
  .panel-c59f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dirty_e9e7,
  .main-new-0ac8,
  .pink-58d4 {
    max-width: none !important;
  }
  
  .dim_80c8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tiny_9447 {
    font-size: 1.5rem !important;
  }
  
  .message-focused-e80a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .lower-2105,
  .texture-93f1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .image-ca6d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .list_huge_3b75 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tag-c4f7 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dirty_e9e7,
  .pink-58d4 {
    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: 497d */
.phantom-card-u2 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.3;
}
