/* ============================================
   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 (.yellow-b3c3) is a descendant of
   .hard-9af4 (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.tertiary_258b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".last_4146" 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.summary-eae8 so it can't cause
   horizontal overflow anyway. */
.banner-0b8a,
.preview-dim-a35c,
.video_6cb8,
.text_outer_db5a,
.yellow_4144,
.gallery_pressed_cbc0,
.header-8728,
.picture-dbe2,
.thumbnail_glass_4c5f,
.module-06b8,
.large_4d4f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .video_stone_3e38 {
    padding: 8px 0;
  }
  
  .paper-1462 img {
    height: 28px;
    width: auto;
  }
  
  .focused_af94 {
    display: none !important;
  }
  
  .hovered-6186 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hovered-6186 svg {
    width: 14px;
    height: 14px;
  }
  
  .tooltip-up-a9fd {
    padding: 6px;
  }
  
  .mask_7687 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .video_6cb8,
  .preview-dim-a35c,
  .text_outer_db5a,
  .yellow_4144,
  .tertiary_0ef3,
  .cool-af04,
  .stale_9620,
  .plasma-6784,
  .detail_6242,
  .dim_c1c7,
  .list-action-fdf4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .fast_2b23,
  .container_87e3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .stone-3eb6,
  .backdrop_53e4,
  .gas-4605,
  .static-480e,
  .right_80a3,
  .modal-f6ce,
  .box-small-69a2 {
    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 */
  .message-cool-48bd,
  .red_335f,
  .hidden-under-59ac,
  .highlight-down-2f58,
  .modal_15f4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .description_action_de42,
  .section_rough_4acd,
  .table-540c,
  .hidden-bb46 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wrapper_caf2,
  .new_aa6f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .cool_dc37,
  .hard_1ddb,
  .container-7bb4,
  .advanced_6586 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .under-31de,
  .content-1518,
  .thumbnail_5c6a,
  .module-fixed-456c,
  .alert-right-2f18,
  .outline-west-9d16 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .message-cool-48bd,
  .red_335f,
  .highlight-down-2f58 {
    max-width: none !important;
  }
  
  .last_4146 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .description_action_de42 {
    font-size: 1.5rem !important;
  }
  
  .section_rough_4acd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .text_purple_5aec,
  .aside_2821 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .table-540c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .fast-91d6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .left-b1b9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .message-cool-48bd,
  .highlight-down-2f58 {
    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: 4034 */
.ghost-box-r7 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
