/* ============================================
   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 (.red-18f9) is a descendant of
   .modal_f15a (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.texture-26dc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".center_d13c" 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.hidden_south_cd67 so it can't cause
   horizontal overflow anyway. */
.wrapper-dark-12b8,
.nav_2a18,
.grid_22d0,
.tag-cf35,
.alert-0405,
.cool-bb83,
.banner_2581,
.aside_5413,
.narrow_5ab8,
.table_aaaf,
.highlight-light-0d2a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .warm_4fa8 {
    padding: 8px 0;
  }
  
  .item-hard-a13b img {
    height: 28px;
    width: auto;
  }
  
  .bronze-a066 {
    display: none !important;
  }
  
  .focus_cold_e1bc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .focus_cold_e1bc svg {
    width: 14px;
    height: 14px;
  }
  
  .large_4669 {
    padding: 6px;
  }
  
  .hero_8304 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .grid_22d0,
  .nav_2a18,
  .tag-cf35,
  .alert-0405,
  .purple-3461,
  .panel-hard-ee98,
  .notification_upper_3621,
  .outline_tall_7b81,
  .hot_2c16,
  .warm_64f4,
  .slow_6059,
  .input-in-a4ef {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .liquid-df8b,
  .input_fresh_82ec {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .full-5d8a,
  .form_b1eb,
  .selected-abf4,
  .lite_8f91,
  .element-81ec,
  .hovered_9cf5,
  .outline_3d5e {
    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 */
  .liquid-aa28,
  .video_stone_d560,
  .aside_fast_68af,
  .liquid_39e7,
  .description_fluid_92a9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern_new_9efe,
  .wrapper-da39,
  .picture_left_228c,
  .fast_1ce5 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .icon_5ee0,
  .left_ac2f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .container_large_8870,
  .nav-action-ccce,
  .link-b69e,
  .static-32e6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pro_80c1,
  .wood-96bf,
  .tag_out_2bba,
  .secondary-static-4dcb,
  .tabs_c595,
  .shade-pink-be7f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .liquid-aa28,
  .video_stone_d560,
  .liquid_39e7 {
    max-width: none !important;
  }
  
  .center_d13c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern_new_9efe {
    font-size: 1.5rem !important;
  }
  
  .wrapper-da39 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .top_428d,
  .detail-action-1a1d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture_left_228c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .green-55be {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .texture_blue_f573 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .liquid-aa28,
  .liquid_39e7 {
    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: fad0 */
.widget-item-y3 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.0;
}
