/* ============================================
   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 (.tooltip_gold_b6f0) is a descendant of
   .outline_3a81 (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.nav_56ac {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gradient-pro-1cac" 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.preview-selected-2cb9 so it can't cause
   horizontal overflow anyway. */
.panel_b027,
.wide_daaa,
.sidebar-8db3,
.input_pro_4c69,
.gallery_b48c,
.container-advanced-53d7,
.banner_a172,
.picture-hovered-9028,
.search_d528,
.row-845e,
.avatar_d77f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .accordion_baf6 {
    padding: 8px 0;
  }
  
  .article_tiny_56d5 img {
    height: 28px;
    width: auto;
  }
  
  .yellow-4386 {
    display: none !important;
  }
  
  .frame-598c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .frame-598c svg {
    width: 14px;
    height: 14px;
  }
  
  .cold_9ce6 {
    padding: 6px;
  }
  
  .footer_small_f65c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sidebar-8db3,
  .wide_daaa,
  .input_pro_4c69,
  .gallery_b48c,
  .hidden_14ad,
  .active_eb33,
  .photo-1cf1,
  .primary-006f,
  .text_out_65ed,
  .icon_151e,
  .main_5de0,
  .module-0988 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shade-liquid-45b3,
  .middle-d246 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-80fe,
  .hidden-12b2,
  .border-34b8,
  .popup-small-9216,
  .focus-360c,
  .up-b28c,
  .thumbnail_6b29 {
    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_1955,
  .warm_db89,
  .status-old-41df,
  .mask_over_eb13,
  .photo-46d0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notification_current_f1c4,
  .focus-d420,
  .content_warm_164e,
  .media_7ace {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .sort_e3db,
  .full_54bf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active_3949,
  .avatar_tall_8dea,
  .texture-3b8e,
  .tertiary-e53e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .badge-bottom-3eb5,
  .soft_9f64,
  .shadow_hot_c5a5,
  .container-ced7,
  .image_basic_990c,
  .solid_b8df {
    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_1955,
  .warm_db89,
  .mask_over_eb13 {
    max-width: none !important;
  }
  
  .gradient-pro-1cac {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notification_current_f1c4 {
    font-size: 1.5rem !important;
  }
  
  .focus-d420 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .nav-185f,
  .carousel-43d3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .content_warm_164e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .icon_steel_9a06 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bronze_3e32 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dirty_1955,
  .mask_over_eb13 {
    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: 6c68 */
.shadow-element-y4 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
