/* ============================================
   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 (.first-36a3) is a descendant of
   .item_9a2b (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.focus_abb5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".list_over_5547" 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.secondary-selected-e76a so it can't cause
   horizontal overflow anyway. */
.layout-stale-afa4,
.lower-0063,
.tooltip-out-435e,
.center-44fa,
.mask-902a,
.brown-65dd,
.content_5ff6,
.avatar_828e,
.status-hot-168c,
.modal-17ef,
.next-dfdd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .grid_fe47 {
    padding: 8px 0;
  }
  
  .silver-61cf img {
    height: 28px;
    width: auto;
  }
  
  .background-motion-4e44 {
    display: none !important;
  }
  
  .right_4f38 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .right_4f38 svg {
    width: 14px;
    height: 14px;
  }
  
  .logo-6fa8 {
    padding: 6px;
  }
  
  .texture_clean_810a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tooltip-out-435e,
  .lower-0063,
  .center-44fa,
  .mask-902a,
  .info-5609,
  .alert-3dad,
  .block_smooth_406e,
  .label_e327,
  .item_silver_0298,
  .new_a90e,
  .tertiary_531d,
  .carousel_mini_928f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .thumbnail_cc2e,
  .under-74d1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .lower-4177,
  .icon_40ad,
  .paper-438a,
  .texture-glass-40ca,
  .chip-left-8080,
  .info-3280,
  .link_5fcc {
    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 */
  .badge-brown-8214,
  .title-eea8,
  .complex-14f8,
  .pro-5c15,
  .picture_db34 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .photo-inner-6211,
  .hidden_dim_76e7,
  .frame-east-ffb4,
  .breadcrumb-200c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tall_8dcf,
  .narrow-3d1d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .static-6d1e,
  .footer-b8eb,
  .soft_02db,
  .medium_00e2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .chip_2ec6,
  .tag-ffe4,
  .texture_next_46b6,
  .panel_9634,
  .breadcrumb-626b,
  .short-0e0e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .badge-brown-8214,
  .title-eea8,
  .pro-5c15 {
    max-width: none !important;
  }
  
  .list_over_5547 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .photo-inner-6211 {
    font-size: 1.5rem !important;
  }
  
  .hidden_dim_76e7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .popup_hot_f5a2,
  .badge-left-7eb6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .frame-east-ffb4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .module_86fe {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pagination-4988 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .badge-brown-8214,
  .pro-5c15 {
    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: d4cb */
.widget-item-o8 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.2;
}
