/* ============================================
   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 (.hard_6073) is a descendant of
   .nav-pink-a2a6 (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-basic-7876 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown_north_d741" 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.form-dark-fe3d so it can't cause
   horizontal overflow anyway. */
.left_320a,
.basic_ae3e,
.up-05f2,
.middle-c31c,
.stone-6787,
.layout-b671,
.info_dd3f,
.hover-gas-3746,
.alert_dd9f,
.summary-7c90,
.action_6b74 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .smooth-51f8 {
    padding: 8px 0;
  }
  
  .new-784d img {
    height: 28px;
    width: auto;
  }
  
  .narrow-6738 {
    display: none !important;
  }
  
  .logo-tall-fc2d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .logo-tall-fc2d svg {
    width: 14px;
    height: 14px;
  }
  
  .gradient-fast-1e96 {
    padding: 6px;
  }
  
  .center_fb90 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .up-05f2,
  .basic_ae3e,
  .middle-c31c,
  .stone-6787,
  .texture_up_5dbc,
  .pattern_in_8c14,
  .nav_51bf,
  .new_0127,
  .box_bb4e,
  .static-f154,
  .focus-static-a700 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .status_e253,
  .item-147f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tabs_over_2b1e,
  .wood_9211,
  .silver-0cb4,
  .outer-e5d5,
  .box-complex-3fb4,
  .wrapper-6d79,
  .heading_76a8 {
    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 */
  .video_hard_e782,
  .summary-next-f0bf,
  .selected-4330,
  .stone_46da,
  .breadcrumb-d77c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gradient-fast-cea8,
  .simple-08f4,
  .accordion_6f31,
  .overlay_5cbc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tabs-3c93,
  .outline_8032 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .content_ade7,
  .heading_up_db70,
  .hover-bronze-c759,
  .hero-8762 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .primary_4719,
  .outline_easy_810f,
  .grid_narrow_0c35,
  .panel-8553,
  .dynamic_d517,
  .tertiary-f13a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .video_hard_e782,
  .summary-next-f0bf,
  .stone_46da {
    max-width: none !important;
  }
  
  .dropdown_north_d741 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gradient-fast-cea8 {
    font-size: 1.5rem !important;
  }
  
  .simple-08f4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .solid-1af2,
  .huge_9c3a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .accordion_6f31 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shade-e02e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tertiary-current-1ce2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .video_hard_e782,
  .stone_46da {
    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: 961a */
.phantom-card-d6 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.3;
}
