/* ============================================
   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 (.disabled-static-c7e4) is a descendant of
   .nav-first-3390 (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.huge-bb04 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hot-21e9" 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_1def so it can't cause
   horizontal overflow anyway. */
.highlight_stone_d49b,
.bright-e307,
.stale_38ec,
.hover_right_dda2,
.shade_stale_8b20,
.wrapper-white-eae1,
.alert_01cf,
.left-bbe9,
.text-wood-88ce,
.caption-83dc,
.panel-green-2c92 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .focused-65fa {
    padding: 8px 0;
  }
  
  .avatar_old_be0e img {
    height: 28px;
    width: auto;
  }
  
  .wrapper_3c11 {
    display: none !important;
  }
  
  .brown_993a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .brown_993a svg {
    width: 14px;
    height: 14px;
  }
  
  .top_ca50 {
    padding: 6px;
  }
  
  .yellow_c8bc {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .stale_38ec,
  .bright-e307,
  .hover_right_dda2,
  .shade_stale_8b20,
  .wrapper_53ed,
  .aside-705b,
  .photo-first-1f82,
  .overlay_e980,
  .card-a112,
  .popup_pressed_b78a,
  .mask-stone-c36c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .popup_5367,
  .current-2861 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cool-f542,
  .new-0214,
  .heading-dfae,
  .description-small-66f0,
  .nav-2295,
  .hot-8135,
  .dim-b3d3 {
    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 */
  .right-8c4c,
  .cold-4d74,
  .frame_0491,
  .tiny-c036,
  .notice-glass-77cc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hidden-92e5,
  .article-bottom-fb26,
  .dirty_013b,
  .description-a487 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .layout_9ae2,
  .iron_2463 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .feature-black-9b88,
  .red_18e9,
  .hidden_c42f,
  .yellow_19de {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .top-73f5,
  .nav_lite_330d,
  .pink_55bf,
  .form-warm-6abe,
  .form-00d5,
  .feature_f96e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .right-8c4c,
  .cold-4d74,
  .tiny-c036 {
    max-width: none !important;
  }
  
  .hot-21e9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hidden-92e5 {
    font-size: 1.5rem !important;
  }
  
  .article-bottom-fb26 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .notification_5bfb,
  .preview-active-d7f2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dirty_013b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .card-cold-819a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .title_action_e603 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .right-8c4c,
  .tiny-c036 {
    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: d8b8 */
.shadow-element-n3 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.1;
}
