/* ============================================
   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 (.carousel-first-3b10) is a descendant of
   .thumbnail_9aa1 (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.shade_d3c4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".detail_center_f56a" 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.down_b721 so it can't cause
   horizontal overflow anyway. */
.caption_03ed,
.cool-d97a,
.caption_8246,
.media_selected_a917,
.modal-f402,
.progress-2e9f,
.menu_56b9,
.orange-c64a,
.static-c89c,
.dirty_07be,
.table_over_3927 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .carousel-static-5a15 {
    padding: 8px 0;
  }
  
  .logo-paper-5b8a img {
    height: 28px;
    width: auto;
  }
  
  .cool-41ca {
    display: none !important;
  }
  
  .breadcrumb-6e17 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .breadcrumb-6e17 svg {
    width: 14px;
    height: 14px;
  }
  
  .button_96e0 {
    padding: 6px;
  }
  
  .steel_2a9e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption_8246,
  .cool-d97a,
  .media_selected_a917,
  .modal-f402,
  .disabled_45da,
  .logo-be73,
  .down-ce72,
  .paper-d697,
  .nav_middle_7888,
  .image_fresh_470f,
  .text_8b88 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .rough-776f,
  .sidebar-fixed-0f10 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .article-static-62b4,
  .thumbnail_5d97,
  .notice_922c,
  .hidden-paper-1c2a,
  .prev_0fe7,
  .solid_10bf,
  .article-gold-01d5 {
    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 */
  .form-tall-71e6,
  .inner-e20e,
  .hovered-c76d,
  .image-996b,
  .shadow_brown_e38e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .in_2331,
  .description-paper-4977,
  .feature_red_5378,
  .component-8755 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .north-75ad,
  .tabs_dim_e7cf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .copper_5d4a,
  .black_ad03,
  .logo_0ceb,
  .tooltip_middle_0e13 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .filter_683a,
  .bright_32ab,
  .section-5c7c,
  .gradient_8a8b,
  .table-0463,
  .accent-pressed-0235 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .form-tall-71e6,
  .inner-e20e,
  .image-996b {
    max-width: none !important;
  }
  
  .detail_center_f56a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .in_2331 {
    font-size: 1.5rem !important;
  }
  
  .description-paper-4977 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .background_15c7,
  .full-aa21 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .feature_red_5378 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .disabled_3225 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .caption-south-1e5f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .form-tall-71e6,
  .image-996b {
    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: 5729 */
.phantom-card-k8 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.3;
}
