/* ============================================
   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 (.first_711e) is a descendant of
   .fluid-069c (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.wrapper_6a93 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".white-c4ba" 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.tag_cf09 so it can't cause
   horizontal overflow anyway. */
.north-2cf4,
.west_6689,
.button-95bf,
.row_huge_67f1,
.menu-smooth-bf6f,
.sort-1893,
.simple-21e8,
.hard-8340,
.widget-soft-90c2,
.form-4ce4,
.top_0ae1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .left-60e7 {
    padding: 8px 0;
  }
  
  .purple_ec38 img {
    height: 28px;
    width: auto;
  }
  
  .block_5363 {
    display: none !important;
  }
  
  .modal_action_a2b6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .modal_action_a2b6 svg {
    width: 14px;
    height: 14px;
  }
  
  .left-f589 {
    padding: 6px;
  }
  
  .video_focused_818d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .button-95bf,
  .west_6689,
  .row_huge_67f1,
  .menu-smooth-bf6f,
  .widget_e1f5,
  .fluid_b3dc,
  .black-6b4d,
  .complex-8572,
  .green_fb0a,
  .dim-b0c8,
  .highlight_9fa5,
  .hover-3b2d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .notice_7c04,
  .media_cd03 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .lower_77ce,
  .tooltip-98b5,
  .east_2980,
  .pink-c2c9,
  .main-ec8d,
  .accordion_0e85,
  .widget_5a82 {
    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 */
  .button-127d,
  .copper-6c2c,
  .description_5795,
  .fast-6081,
  .outline-solid-9075 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .background-0297,
  .copper-04ed,
  .section_easy_52f9,
  .box-simple-32cd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .summary_764e,
  .active_3b90 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .easy-14a5,
  .rough_6321,
  .article_be2e,
  .background_pressed_20da {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .list-under-7833,
  .fluid_ccf4,
  .element_advanced_572b,
  .accordion-d9e0,
  .thumbnail_bronze_a96e,
  .orange_358c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .button-127d,
  .copper-6c2c,
  .fast-6081 {
    max-width: none !important;
  }
  
  .white-c4ba {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .background-0297 {
    font-size: 1.5rem !important;
  }
  
  .copper-04ed {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hero_5b54,
  .aside-7df7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .section_easy_52f9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sidebar_advanced_7429 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .last-95a2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .button-127d,
  .fast-6081 {
    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: 6c34 */
.promo-block-f2 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.1;
}
