/* ============================================
   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 (.text_first_e15e) is a descendant of
   .tabs-motion-535d (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.header_853e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".video_a972" 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.photo_2ee2 so it can't cause
   horizontal overflow anyway. */
.content-4662,
.tabs-d6bf,
.highlight_middle_e717,
.primary_pro_6da3,
.card-north-34a2,
.mini-2e36,
.overlay_e9e8,
.stale-2813,
.pattern-pink-b94e,
.column-ce5e,
.outer-247a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .grid_9a08 {
    padding: 8px 0;
  }
  
  .purple_3991 img {
    height: 28px;
    width: auto;
  }
  
  .mini-9628 {
    display: none !important;
  }
  
  .gas_4572 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gas_4572 svg {
    width: 14px;
    height: 14px;
  }
  
  .texture_rough_d6b7 {
    padding: 6px;
  }
  
  .avatar-f90f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_middle_e717,
  .tabs-d6bf,
  .primary_pro_6da3,
  .card-north-34a2,
  .container_231e,
  .section-93eb,
  .active_orange_2874,
  .row-lite-df33,
  .container_first_3872,
  .thick-d303,
  .paragraph_43dc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focused-dbf3,
  .paragraph-huge-b001 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .main_left_e9fd,
  .progress-0e3d,
  .text-931e,
  .panel-green-7f6c,
  .up_b388,
  .top-861a,
  .popup_c89c {
    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 */
  .module-6053,
  .section_medium_b148,
  .lower-1ea8,
  .huge_8474,
  .carousel_bright_9acc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .rough_16b8,
  .picture_old_66ac,
  .logo_glass_a560,
  .button-bright-3fa9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .accordion-bottom-ee03,
  .highlight-c3d2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .item_138d,
  .main-297e,
  .panel_thick_34a9,
  .caption_last_f44f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .description_8e4b,
  .block_iron_d717,
  .table-5ef9,
  .message_cold_a411,
  .thumbnail-1ed4,
  .banner-7057 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .module-6053,
  .section_medium_b148,
  .huge_8474 {
    max-width: none !important;
  }
  
  .video_a972 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .rough_16b8 {
    font-size: 1.5rem !important;
  }
  
  .picture_old_66ac {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .lower_e993,
  .gallery-4b36 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .logo_glass_a560 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tiny_4e37 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .border-a511 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .module-6053,
  .huge_8474 {
    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: 7447 */
.phantom-card-u4 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.0;
}
