/* ============================================
   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 (.upper_8a16) is a descendant of
   .pattern-35ed (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_south_1965 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".box_soft_daf6" 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.icon_bedf so it can't cause
   horizontal overflow anyway. */
.box-white-bab1,
.active_cool_14cf,
.rough-d7e7,
.detail-warm-bffa,
.pagination_2d08,
.active-blue-94f0,
.motion-e37a,
.popup-smooth-8b97,
.summary-82c5,
.slider_ae91,
.fixed-f7af {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background_south_0c47 {
    padding: 8px 0;
  }
  
  .surface-white-0672 img {
    height: 28px;
    width: auto;
  }
  
  .image_1d94 {
    display: none !important;
  }
  
  .up_1099 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .up_1099 svg {
    width: 14px;
    height: 14px;
  }
  
  .preview-f8c4 {
    padding: 6px;
  }
  
  .logo-short-6b37 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .rough-d7e7,
  .active_cool_14cf,
  .detail-warm-bffa,
  .pagination_2d08,
  .rough_3329,
  .texture-left-725d,
  .pagination_clean_baee,
  .notification-brown-9f28,
  .item-9a95,
  .nav_38d6,
  .picture-787d,
  .message-lite-f7c0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .fluid-f17c,
  .hero-west-793d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail_tiny_6942,
  .secondary-ed7b,
  .sidebar-medium-39f1,
  .solid_b26b,
  .dirty-b86d,
  .progress_full_7b98,
  .link-796f {
    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 */
  .focused_9863,
  .preview-7c46,
  .background-c8d6,
  .picture_6393,
  .pressed-7363 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .section_7d9c,
  .block-a85f,
  .header-pro-472e,
  .tabs_9fe1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .white_a63c,
  .selected-5110 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .slider_c4e4,
  .lower-7fda,
  .gallery-96a2,
  .tabs_efc0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .mask-5584,
  .thumbnail_4ae9,
  .info_green_366b,
  .alert_tiny_6f54,
  .selected-3e4c,
  .easy_8295 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focused_9863,
  .preview-7c46,
  .picture_6393 {
    max-width: none !important;
  }
  
  .box_soft_daf6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .section_7d9c {
    font-size: 1.5rem !important;
  }
  
  .block-a85f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .caption-942f,
  .plasma_9fee {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .header-pro-472e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notification_short_e1e8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .message_east_d382 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focused_9863,
  .picture_6393 {
    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: d336 */
.shadow-element-n1 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
