/* ============================================
   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 (.in_0950) is a descendant of
   .tag_cold_cde3 (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.medium-d8f1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".accent_slow_f30b" 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.bottom-c03f so it can't cause
   horizontal overflow anyway. */
.nav_6645,
.article_action_b5fc,
.tertiary_d5b4,
.cool-a8dd,
.active-first-8df1,
.red_1088,
.box_fast_936f,
.shade-68ce,
.solid-25f6,
.clean_920d,
.motion_dcd0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .media-down-8906 {
    padding: 8px 0;
  }
  
  .lower-485f img {
    height: 28px;
    width: auto;
  }
  
  .clean_6fff {
    display: none !important;
  }
  
  .notice-1dfc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notice-1dfc svg {
    width: 14px;
    height: 14px;
  }
  
  .complex-b630 {
    padding: 6px;
  }
  
  .tertiary_dirty_b7cd {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tertiary_d5b4,
  .article_action_b5fc,
  .cool-a8dd,
  .active-first-8df1,
  .preview-a497,
  .mask_fluid_7b99,
  .red_6e39,
  .pattern_cf38,
  .silver_60ba,
  .tooltip-down-ea22,
  .search-bright-6416 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .table_easy_df16,
  .detail-short-5906 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .badge-ceb5,
  .next_706d,
  .advanced-e990,
  .hovered-560c,
  .focused-d373,
  .secondary_yellow_f3b0,
  .secondary_bronze_fce7 {
    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 */
  .left_b44b,
  .container_soft_f012,
  .thumbnail_f84c,
  .element_40e0,
  .item-fresh-afb4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge_9931,
  .easy_2d1d,
  .focused-10c3,
  .focused-1163 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .breadcrumb_advanced_e963,
  .filter_0cc8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .easy-0bf1,
  .inner_a1c8,
  .tertiary_out_06b6,
  .row-e480 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .large-92cb,
  .label_cold_80a5,
  .simple-bf0a,
  .popup-d620,
  .accordion_up_eeef,
  .yellow_ffbd {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .left_b44b,
  .container_soft_f012,
  .element_40e0 {
    max-width: none !important;
  }
  
  .accent_slow_f30b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge_9931 {
    font-size: 1.5rem !important;
  }
  
  .easy_2d1d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .menu_full_2e3f,
  .highlight-484d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .focused-10c3 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .last_11e7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .upper-3146 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .left_b44b,
  .element_40e0 {
    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: c134 */
.shadow-element-l5 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.2;
}
