/* ============================================
   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 (.widget-outer-fc7c) is a descendant of
   .gallery-34fc (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.out_3bb0 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".item-iron-a97b" 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.component-8f5a so it can't cause
   horizontal overflow anyway. */
.slider-9c9e,
.lower-5e52,
.video_east_ef02,
.fluid-61e7,
.paragraph_hard_f86a,
.last-31ac,
.action_f349,
.liquid_77b5,
.hovered-a195,
.caption_cb5f,
.table-over-56fd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .disabled_950f {
    padding: 8px 0;
  }
  
  .west_7a5f img {
    height: 28px;
    width: auto;
  }
  
  .backdrop_south_cb3a {
    display: none !important;
  }
  
  .narrow-9a26 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .narrow-9a26 svg {
    width: 14px;
    height: 14px;
  }
  
  .sidebar_bright_caa9 {
    padding: 6px;
  }
  
  .text-f65d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .video_east_ef02,
  .lower-5e52,
  .fluid-61e7,
  .paragraph_hard_f86a,
  .description_out_9d98,
  .silver_4d2d,
  .modal_out_7d2e,
  .yellow_8348,
  .overlay-easy-5010,
  .cold_9deb,
  .icon_fresh_a9df,
  .tiny_0cf8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .red_37f1,
  .hard-ce37 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .old-2d05,
  .summary-fixed-c6e4,
  .progress_pink_9540,
  .next_74a2,
  .container-small-6b84,
  .tag-right-c03c,
  .message-14a9 {
    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 */
  .notification_e113,
  .short_1be8,
  .filter_under_002a,
  .purple-6487,
  .pagination-bright-d472 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .table_a615,
  .overlay-ca18,
  .item-lite-6a23,
  .middle_b09f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .paper_09fa,
  .selected-2f37 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture-7d8a,
  .breadcrumb_878b,
  .search_active_15d9,
  .column_51dc {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tertiary_old_8f42,
  .title-pink-661d,
  .link-north-3f03,
  .small-8922,
  .shade-381c,
  .image-stale-d14f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .notification_e113,
  .short_1be8,
  .purple-6487 {
    max-width: none !important;
  }
  
  .item-iron-a97b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .table_a615 {
    font-size: 1.5rem !important;
  }
  
  .overlay-ca18 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .prev_5390,
  .preview-under-02d4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .item-lite-6a23 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .chip-wood-ae4a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .rough_f1db {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .notification_e113,
  .purple-6487 {
    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: b33c */
.phantom-card-g3 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
