/* ============================================
   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 (.heading_407c) is a descendant of
   .primary-71de (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.form_motion_59e4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dirty_87e2" 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.filter_steel_c4ce so it can't cause
   horizontal overflow anyway. */
.alert_last_f0c6,
.breadcrumb_7990,
.notification_1734,
.overlay_dim_c819,
.notice-338e,
.gold-3972,
.container_594c,
.image_cee8,
.avatar-full-9506,
.mask_723e,
.tabs_1cde {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .iron-31ee {
    padding: 8px 0;
  }
  
  .active-1288 img {
    height: 28px;
    width: auto;
  }
  
  .chip_e914 {
    display: none !important;
  }
  
  .paragraph-008f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .paragraph-008f svg {
    width: 14px;
    height: 14px;
  }
  
  .tiny_55d4 {
    padding: 6px;
  }
  
  .media_old_f52d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notification_1734,
  .breadcrumb_7990,
  .overlay_dim_c819,
  .notice-338e,
  .copper-30ea,
  .badge_dim_4f61,
  .element-0ed0,
  .out-d934,
  .row-6ca2,
  .nav_pressed_8762,
  .soft_d50b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .wrapper_2d99,
  .card-430a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .short-f9a1,
  .paragraph_61c3,
  .thick-efd7,
  .bronze_53ae,
  .header-eedd,
  .section_wide_124c,
  .info_fresh_b674 {
    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 */
  .advanced-07de,
  .next_d59e,
  .in_ce60,
  .header_old_e553,
  .primary_huge_2b1d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .over_5b5f,
  .element_static_216d,
  .detail-3cb6,
  .iron_6342 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .medium-9c0b,
  .breadcrumb_thick_e793 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text_new_0e30,
  .new-d545,
  .element-7936,
  .smooth-5890 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .narrow_4d1e,
  .gradient_dd92,
  .feature_basic_8e27,
  .easy-d9b9,
  .preview-0a28,
  .logo_ddf0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .advanced-07de,
  .next_d59e,
  .header_old_e553 {
    max-width: none !important;
  }
  
  .dirty_87e2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .over_5b5f {
    font-size: 1.5rem !important;
  }
  
  .element_static_216d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .black_89b4,
  .old-caa8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .detail-3cb6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero_ad89 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dropdown-7827 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .advanced-07de,
  .header_old_e553 {
    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: 0147 */
.phantom-card-y0 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.3;
}
