/* ============================================
   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 (.feature_under_fb8c) is a descendant of
   .hard-c3ec (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.stone-ea87 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".left_7376" 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.solid_f225 so it can't cause
   horizontal overflow anyway. */
.outline-large-cea8,
.text-8d24,
.surface_5d9e,
.notice-west-bf7b,
.photo-first-e69f,
.button_next_8b3a,
.hidden-rough-c9f2,
.gallery-center-0c5b,
.logo_middle_5a49,
.white_214a,
.progress-0a33 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .progress_up_884e {
    padding: 8px 0;
  }
  
  .sort_d358 img {
    height: 28px;
    width: auto;
  }
  
  .picture-solid-2999 {
    display: none !important;
  }
  
  .texture_b47b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .texture_b47b svg {
    width: 14px;
    height: 14px;
  }
  
  .preview-east-b439 {
    padding: 6px;
  }
  
  .list_55ae {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .surface_5d9e,
  .text-8d24,
  .notice-west-bf7b,
  .photo-first-e69f,
  .shade_under_e6a8,
  .primary_8425,
  .thumbnail-4114,
  .title_9581,
  .widget-focused-3321,
  .gradient_9df7,
  .section-next-3bf4,
  .caption_4378 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .message_ce37,
  .main-a922 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .inner_d292,
  .article_blue_80f8,
  .outline_9556,
  .popup-dirty-493e,
  .video-easy-4fb4,
  .sort-2ad2,
  .accordion-black-edae {
    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 */
  .stale_eaff,
  .form_bottom_f197,
  .form_ea5c,
  .message_in_f2d6,
  .advanced_9028 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .silver-7e96,
  .thumbnail_old_4baf,
  .notice_704d,
  .container-lower-234d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .widget-a2ff,
  .focus-first-fcf9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .wide_57ec,
  .blue_7d8b,
  .element_east_96de,
  .first_11b0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .full-1dd4,
  .container-eedf,
  .accordion_pressed_62cb,
  .row-690d,
  .sidebar-blue-0c12,
  .feature_complex_8d50 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .stale_eaff,
  .form_bottom_f197,
  .message_in_f2d6 {
    max-width: none !important;
  }
  
  .left_7376 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .silver-7e96 {
    font-size: 1.5rem !important;
  }
  
  .thumbnail_old_4baf {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tooltip-7350,
  .footer_fixed_17b1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .notice_704d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .carousel-0b20 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .active-7bf3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .stale_eaff,
  .message_in_f2d6 {
    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: 5dc1 */
.widget-item-k6 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
