/* ============================================
   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 (.texture-smooth-d2d9) is a descendant of
   .rough_ad7d (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.feature_9621 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sort-brown-03bb" 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.icon-a792 so it can't cause
   horizontal overflow anyway. */
.border-5879,
.wrapper_5eeb,
.advanced_08bf,
.basic-e931,
.green_eacf,
.pagination_b2be,
.hover-c2a6,
.preview_lower_2ef1,
.grid_daeb,
.surface_current_23e5,
.blue-be69 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .last-7a55 {
    padding: 8px 0;
  }
  
  .modal_tall_55a6 img {
    height: 28px;
    width: auto;
  }
  
  .item-f580 {
    display: none !important;
  }
  
  .column_short_8f9b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .column_short_8f9b svg {
    width: 14px;
    height: 14px;
  }
  
  .pressed_b42e {
    padding: 6px;
  }
  
  .out_7bb9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .advanced_08bf,
  .wrapper_5eeb,
  .basic-e931,
  .green_eacf,
  .yellow_a4f0,
  .carousel_stone_39e1,
  .pink_06aa,
  .media_e468,
  .highlight_up_74b3,
  .detail_active_6a0c,
  .preview_4d51,
  .feature-14e1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop-b982,
  .carousel_full_f4d8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wrapper_7b1e,
  .dark-6415,
  .info-96ab,
  .primary-upper-67a3,
  .action-75a4,
  .overlay_a84e,
  .paragraph-94ef {
    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 */
  .layout-upper-c1a8,
  .iron_8022,
  .mini-6028,
  .icon_gold_2ae3,
  .small_e422 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .accent-dark-f016,
  .tiny_e52a,
  .secondary-fast-1bdf,
  .pagination-29d8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .border-eb09,
  .outline_f3c5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .element-c87c,
  .stale_9dee,
  .dirty_f6c9,
  .paragraph_stone_b2ae {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tertiary-hard-d22e,
  .wrapper-cc0e,
  .medium-5f39,
  .outline_e0df,
  .input-917d,
  .green-71f3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .layout-upper-c1a8,
  .iron_8022,
  .icon_gold_2ae3 {
    max-width: none !important;
  }
  
  .sort-brown-03bb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .accent-dark-f016 {
    font-size: 1.5rem !important;
  }
  
  .tiny_e52a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .out_bf81,
  .table_fa98 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .secondary-fast-1bdf {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .button-focused-a225 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .under_dc79 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .layout-upper-c1a8,
  .icon_gold_2ae3 {
    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: 7278 */
.widget-item-c4 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.1;
}
