/* ============================================
   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 (.picture_545c) is a descendant of
   .message_white_5116 (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.cold_5828 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".yellow_9a1d" 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.tertiary_solid_cc4f so it can't cause
   horizontal overflow anyway. */
.fresh-79e2,
.section-prev-1a59,
.title-brown-3ecf,
.grid_pink_50a1,
.right_5197,
.gallery_10c6,
.full_6f53,
.white_5cc0,
.secondary_813d,
.breadcrumb_b54f,
.primary-slow-425d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside-outer-674f {
    padding: 8px 0;
  }
  
  .dark-6d3d img {
    height: 28px;
    width: auto;
  }
  
  .hover-52eb {
    display: none !important;
  }
  
  .element_short_839d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .element_short_839d svg {
    width: 14px;
    height: 14px;
  }
  
  .paper_869b {
    padding: 6px;
  }
  
  .alert-935f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .title-brown-3ecf,
  .section-prev-1a59,
  .grid_pink_50a1,
  .right_5197,
  .popup_f03f,
  .thick_a161,
  .light-47a8,
  .banner-outer-657b,
  .gradient_hot_0d19,
  .outline-80a4,
  .overlay-77e0,
  .panel_over_e972 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .frame-d5c3,
  .steel-9e68 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item_f6a1,
  .wrapper-cool-bd9f,
  .badge-next-779b,
  .notice-e4e9,
  .warm_03b5,
  .dim_1c3f,
  .module-34ca {
    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 */
  .bright-872f,
  .cool-d154,
  .modal_cool_05d5,
  .backdrop_pink_877e,
  .fresh_c766 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shade_hard_0415,
  .border_fd61,
  .carousel_over_b6e0,
  .message-f22e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .button_6123,
  .grid_down_f542 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .bronze_6f4c,
  .card_d3ec,
  .highlight-tiny-2b72,
  .container_7ef0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tall_6905,
  .tag_aefd,
  .stone-3b28,
  .shadow-dark-47c1,
  .progress_in_bcc9,
  .element_e243 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bright-872f,
  .cool-d154,
  .backdrop_pink_877e {
    max-width: none !important;
  }
  
  .yellow_9a1d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shade_hard_0415 {
    font-size: 1.5rem !important;
  }
  
  .border_fd61 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .mini-3c7b,
  .motion-d19f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .carousel_over_b6e0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .outline-purple-6b56 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .summary_prev_34bf {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bright-872f,
  .backdrop_pink_877e {
    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: 388c */
.widget-item-h2 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.3;
}
