/* ============================================
   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 (.table-3b12) is a descendant of
   .pagination_easy_493b (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.table-next-6661 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".image-dbda" 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.advanced_8ba6 so it can't cause
   horizontal overflow anyway. */
.table-990c,
.alert_basic_dc9e,
.hidden-large-3398,
.hard_758c,
.gradient_1048,
.panel-159d,
.description_6c78,
.prev-9326,
.component-fluid-c338,
.orange_37f1,
.accent-51b5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .backdrop_2cdf {
    padding: 8px 0;
  }
  
  .detail-pro-f479 img {
    height: 28px;
    width: auto;
  }
  
  .grid-black-432b {
    display: none !important;
  }
  
  .sidebar_1a41 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .sidebar_1a41 svg {
    width: 14px;
    height: 14px;
  }
  
  .component_6fc6 {
    padding: 6px;
  }
  
  .stone_1d70 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hidden-large-3398,
  .alert_basic_dc9e,
  .hard_758c,
  .gradient_1048,
  .next-b99a,
  .carousel_static_e0aa,
  .frame_440d,
  .full_4ffe,
  .simple-5e67,
  .box_2de4,
  .texture_665c,
  .logo_center_bee9 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .action-3647,
  .tabs_in_2eb0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .container_small_8998,
  .huge_047c,
  .preview_a845,
  .rough-837f,
  .tag_small_2a51,
  .detail_top_4530,
  .wood_d77a {
    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 */
  .focus_simple_f3a9,
  .focus_75c5,
  .list_f7f4,
  .silver-b054,
  .overlay-soft-7f8e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .old_9fd3,
  .chip_f424,
  .rough_d194,
  .picture-light-88fd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wrapper-new-9f4f,
  .panel-60e2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown_active_ec7a,
  .next_face,
  .caption-left-a36d,
  .preview_easy_a2c4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .backdrop-tall-836e,
  .secondary_middle_ab60,
  .backdrop-6985,
  .aside_full_7ec5,
  .module-1696,
  .aside_dirty_8d0a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focus_simple_f3a9,
  .focus_75c5,
  .silver-b054 {
    max-width: none !important;
  }
  
  .image-dbda {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .old_9fd3 {
    font-size: 1.5rem !important;
  }
  
  .chip_f424 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .content-hard-ec7b,
  .pink_db9a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .rough_d194 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .liquid_cc14 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tag_fbc6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focus_simple_f3a9,
  .silver-b054 {
    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: c1ce */
.phantom-card-p4 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
