/* ============================================
   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 (.pagination-a6d5) is a descendant of
   .avatar_d305 (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.status-advanced-9e6c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".clean_dcff" 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.frame_8a9c so it can't cause
   horizontal overflow anyway. */
.active_copper_7a3a,
.dynamic_6dae,
.image-lower-b9e8,
.easy_82c1,
.sort-lower-b8bb,
.tabs-2970,
.logo-basic-6863,
.heading_0a25,
.tertiary-soft-e263,
.white_923a,
.gallery_hovered_1de0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .video_0935 {
    padding: 8px 0;
  }
  
  .icon_6f35 img {
    height: 28px;
    width: auto;
  }
  
  .popup-lite-d66f {
    display: none !important;
  }
  
  .easy-ca2b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .easy-ca2b svg {
    width: 14px;
    height: 14px;
  }
  
  .box_d112 {
    padding: 6px;
  }
  
  .carousel-a207 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .image-lower-b9e8,
  .dynamic_6dae,
  .easy_82c1,
  .sort-lower-b8bb,
  .header-motion-988c,
  .element_up_e06e,
  .last-f7fd,
  .stone_b2ad,
  .accent-plasma-f91a,
  .fast-ed26,
  .icon-medium-c20a,
  .video-51e6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .iron-0291,
  .sidebar-huge-77da {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hover_gas_0edc,
  .media_slow_6aba,
  .breadcrumb_5355,
  .primary-dim-8d54,
  .slider-6ad3,
  .notification-3f74,
  .short-fd4c {
    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 */
  .layout_lower_2939,
  .photo_c03f,
  .footer-north-e01b,
  .small-fc7a,
  .heading_d3a9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .simple_45f1,
  .blue-07dd,
  .panel-7756,
  .block-fixed-3b0e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fresh-140f,
  .top_8c09 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .plasma-0ca5,
  .message_first_a10d,
  .liquid-98c7,
  .summary_hard_f098 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thumbnail-fresh-f37f,
  .chip_in_3ff6,
  .disabled_middle_1a84,
  .texture-9e7c,
  .row-4917,
  .outline_left_1220 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .layout_lower_2939,
  .photo_c03f,
  .small-fc7a {
    max-width: none !important;
  }
  
  .clean_dcff {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .simple_45f1 {
    font-size: 1.5rem !important;
  }
  
  .blue-07dd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .outline-under-b5a6,
  .background_large_7a01 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .panel-7756 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tertiary_bottom_0294 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .backdrop-plasma-29fc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .layout_lower_2939,
  .small-fc7a {
    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: 02d9 */
.widget-item-j2 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
