/* ============================================
   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 (.aside-pro-f7ba) is a descendant of
   .column_ae64 (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.thick_6d0a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".mini_fae3" 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.short-7051 so it can't cause
   horizontal overflow anyway. */
.avatar_fresh_fa17,
.pattern_14d2,
.disabled_239e,
.summary_d100,
.pink_3696,
.dynamic-2744,
.gold_b703,
.accent_slow_e43d,
.alert_2b69,
.pagination-inner-635d,
.old-6f6f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .cool-7cc1 {
    padding: 8px 0;
  }
  
  .hero_48b1 img {
    height: 28px;
    width: auto;
  }
  
  .sort-5032 {
    display: none !important;
  }
  
  .highlight-orange-cc24 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight-orange-cc24 svg {
    width: 14px;
    height: 14px;
  }
  
  .message_plasma_a476 {
    padding: 6px;
  }
  
  .notice_yellow_9373 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .disabled_239e,
  .pattern_14d2,
  .summary_d100,
  .pink_3696,
  .texture-72ab,
  .down_3f4c,
  .row_0198,
  .breadcrumb-iron-0cd0,
  .pro-1767,
  .outline_motion_3f39,
  .outer_11fd,
  .orange_74ed {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paper_d1eb,
  .fixed-ef64 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .description_d9ad,
  .carousel_046b,
  .smooth-d6c3,
  .detail-6001,
  .soft-fcb2,
  .thick_fe9c,
  .active_3f09 {
    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 */
  .article-simple-7d02,
  .sidebar_799c,
  .hidden_last_60f3,
  .heading_light_8adf,
  .light_6fb7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .icon_df7c,
  .cool-9e62,
  .block-smooth-fdb1,
  .gold_d161 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .alert_east_adf7,
  .content-copper-4141 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hover-upper-82d8,
  .sort_b86c,
  .alert_29ea,
  .chip-south-4a6d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .menu-5194,
  .module_ffcb,
  .surface_3a3b,
  .brown-da7f,
  .picture-050c,
  .element_2e40 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .article-simple-7d02,
  .sidebar_799c,
  .heading_light_8adf {
    max-width: none !important;
  }
  
  .mini_fae3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .icon_df7c {
    font-size: 1.5rem !important;
  }
  
  .cool-9e62 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .search-stale-3236,
  .notice-tall-18af {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .block-smooth-fdb1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .slow-6cf4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .popup-fe5a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .article-simple-7d02,
  .heading_light_8adf {
    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: 6b0a */
.phantom-card-p9 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.1;
}
