/* ============================================
   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 (.main-medium-719b) is a descendant of
   .section-15e2 (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.message_ecab {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".container-8a95" 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.layout_center_0a4a so it can't cause
   horizontal overflow anyway. */
.short_7534,
.table-lower-eb50,
.dropdown-first-3fd9,
.dark_ed4d,
.easy_2d22,
.mask_51fc,
.under-06b8,
.image-smooth-ea62,
.content-25b9,
.under_3c70,
.message_d8ed {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .black_89fd {
    padding: 8px 0;
  }
  
  .table_1374 img {
    height: 28px;
    width: auto;
  }
  
  .carousel_bf30 {
    display: none !important;
  }
  
  .outline_60e2 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .outline_60e2 svg {
    width: 14px;
    height: 14px;
  }
  
  .shadow_right_83f2 {
    padding: 6px;
  }
  
  .container-right-a808 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dropdown-first-3fd9,
  .table-lower-eb50,
  .dark_ed4d,
  .easy_2d22,
  .photo-liquid-3a6e,
  .badge-cool-1b2a,
  .stale_e9ec,
  .module_956d,
  .logo-down-990d,
  .hero_steel_b233,
  .over-21b1,
  .tertiary-short-388d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .chip_bdef,
  .texture-0e56 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .button-glass-cadf,
  .box_25ab,
  .filter-steel-d915,
  .message-motion-4243,
  .avatar_gold_be0b,
  .slow_2668,
  .grid_selected_6e58 {
    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 */
  .icon_dbf8,
  .fast_5239,
  .summary-south-53bb,
  .pink_ab24,
  .table-7019 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .accent-5a08,
  .media_wide_3940,
  .clean_1750,
  .menu-4f0f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .complex-a603,
  .notice-88fe {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hover_lite_ba93,
  .pattern_left_8b12,
  .border-f8cf,
  .first_49c4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .action-f6aa,
  .box-f599,
  .tooltip_dark_552a,
  .active-5f4e,
  .purple-33d4,
  .description_f4a0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .icon_dbf8,
  .fast_5239,
  .pink_ab24 {
    max-width: none !important;
  }
  
  .container-8a95 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .accent-5a08 {
    font-size: 1.5rem !important;
  }
  
  .media_wide_3940 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .blue_5633,
  .hero-right-9c70 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .clean_1750 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .filter_0029 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .wrapper_hard_527f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .icon_dbf8,
  .pink_ab24 {
    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: ec6c */
.ghost-box-h2 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
