/* ============================================
   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 (.status_dynamic_cf99) is a descendant of
   .section-copper-40be (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.media_wide_fbe2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".thick-334d" 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.silver-dd18 so it can't cause
   horizontal overflow anyway. */
.photo_thick_c0b4,
.breadcrumb-9337,
.media_simple_1d60,
.wide_e480,
.lite-4d66,
.layout_2ba0,
.text_red_ddcb,
.tag_yellow_50a2,
.picture_new_40da,
.over-6ee2,
.carousel_a2a4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .input-d8f8 {
    padding: 8px 0;
  }
  
  .left_b298 img {
    height: 28px;
    width: auto;
  }
  
  .advanced_5604 {
    display: none !important;
  }
  
  .item-b758 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .item-b758 svg {
    width: 14px;
    height: 14px;
  }
  
  .full_f1be {
    padding: 6px;
  }
  
  .popup-hovered-ce66 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .media_simple_1d60,
  .breadcrumb-9337,
  .wide_e480,
  .lite-4d66,
  .element-stone-7d54,
  .message-cold-2c5e,
  .button-dynamic-8b0e,
  .focus_2d46,
  .paragraph-b71b,
  .hard-3eb5,
  .pro_5d04,
  .hidden-stone-9522 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary-be27,
  .slow-c275 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .panel_silver_8fec,
  .pagination-9812,
  .text_wood_36d0,
  .pattern-6d88,
  .banner-0166,
  .filter_7bf0,
  .filter-over-0aaa {
    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 */
  .white_9fb9,
  .pattern_8ef0,
  .outer_85ad,
  .paragraph_stale_c7ca,
  .narrow_7e50 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .item-00fd,
  .top-0302,
  .breadcrumb-f0ce,
  .section-tall-c209 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .down-ef0d,
  .green_64d6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .purple-d295,
  .prev-7a0e,
  .slow-4979,
  .hidden_bb5b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thumbnail_motion_cb3e,
  .filter-pro-5e79,
  .shadow-right-d78f,
  .center_e7c3,
  .row-hot-10d1,
  .tabs-e9d0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .white_9fb9,
  .pattern_8ef0,
  .paragraph_stale_c7ca {
    max-width: none !important;
  }
  
  .thick-334d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .item-00fd {
    font-size: 1.5rem !important;
  }
  
  .top-0302 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tooltip-plasma-53ff,
  .preview_stale_0269 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .breadcrumb-f0ce {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notification_gold_f8ab {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .message-2e71 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .white_9fb9,
  .paragraph_stale_c7ca {
    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: ff91 */
.ghost-box-b8 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.3;
}
