/* ============================================
   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 (.glass_be3a) is a descendant of
   .tall-a58f (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.module_last_083c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".panel_0e5a" 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.video_action_c7c3 so it can't cause
   horizontal overflow anyway. */
.red-5e2c,
.panel-2ecd,
.progress-a9fb,
.panel_bright_c54e,
.dropdown-solid-5758,
.feature_61de,
.over_79dc,
.tabs-e127,
.tag-f1e9,
.static-bf43,
.paragraph_eb66 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .box_copper_a435 {
    padding: 8px 0;
  }
  
  .highlight-10b6 img {
    height: 28px;
    width: auto;
  }
  
  .surface-0ddf {
    display: none !important;
  }
  
  .wrapper-1b87 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wrapper-1b87 svg {
    width: 14px;
    height: 14px;
  }
  
  .video-6d2a {
    padding: 6px;
  }
  
  .blue-3444 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .progress-a9fb,
  .panel-2ecd,
  .panel_bright_c54e,
  .dropdown-solid-5758,
  .shadow_910d,
  .tag-tiny-cb30,
  .north_de00,
  .nav-e5f2,
  .gas_e55f,
  .footer-white-5b92,
  .picture_blue_430f,
  .notice_bfad {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .popup-b995,
  .popup_e208 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shadow-e396,
  .old_3b26,
  .dropdown-96de,
  .module-b10c,
  .orange_9876,
  .cool-2d3f,
  .breadcrumb-focused-901c {
    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 */
  .card_soft_e604,
  .article_rough_167c,
  .south_7819,
  .wrapper-large-6dc0,
  .avatar-simple-1b87 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form-78f4,
  .nav_under_e8f7,
  .basic_7bb4,
  .red-1fc9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .short-5012,
  .aside-bc0e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .border_narrow_3829,
  .blue-2be6,
  .card-2904,
  .menu-outer-9c9e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .accent-cf73,
  .picture_5069,
  .tooltip_48dd,
  .item-fd82,
  .fast-8989,
  .main_hot_f8ca {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .card_soft_e604,
  .article_rough_167c,
  .wrapper-large-6dc0 {
    max-width: none !important;
  }
  
  .panel_0e5a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form-78f4 {
    font-size: 1.5rem !important;
  }
  
  .nav_under_e8f7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .texture_purple_9e95,
  .caption-f91b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .basic_7bb4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .surface_silver_e946 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .iron_f568 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .card_soft_e604,
  .wrapper-large-6dc0 {
    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: 74f7 */
.widget-item-q5 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.1;
}
