/* ============================================
   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 (.pro_5ddd) is a descendant of
   .video_active_e2c5 (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.
   Two site templates coexist: legacy obfuscated-class (header.first_3c24)
   and the redesigned template (header.north_01c2). Keep both selectors. */
header.first_3c24,
header.north_01c2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".popup-under-571f" 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.backdrop-cb3a so it can't cause
   horizontal overflow anyway. */
.outline_159f,
.menu-pressed-b456,
.soft-c1fd,
.south_a992,
.tooltip_green_7986,
.thumbnail-1562,
.container-4be8,
.wrapper-paper-e089,
.panel-fresh-6eba,
.mini_529c,
.banner_4c77 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pagination_da13 {
    padding: 8px 0;
  }
  
  .chip_right_9127 img {
    height: 28px;
    width: auto;
  }
  
  .sidebar-8157 {
    display: none !important;
  }
  
  .last-abf7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .last-abf7 svg {
    width: 14px;
    height: 14px;
  }
  
  .lite_6171 {
    padding: 6px;
  }
  
  .form_paper_05a6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .soft-c1fd,
  .menu-pressed-b456,
  .south_a992,
  .tooltip_green_7986,
  .cool-f067,
  .active-light-5911,
  .module-5d66,
  .backdrop_58fb,
  .first-381d,
  .purple-0ae4,
  .menu-f95a,
  .paper_ca0e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .feature-002d,
  .basic_db78 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hero-d613,
  .summary-9827,
  .easy_a4df,
  .image-11bc,
  .wrapper_a244,
  .content_pressed_3736,
  .table_8270 {
    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 */
  .dropdown_915e,
  .content-4b7d,
  .plasma_e1a7,
  .accordion_dirty_b93f,
  .copper-9fba {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .silver_65fa,
  .alert-173e,
  .short_eb7b,
  .middle_d0b2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .modal_b829,
  .header_green_caf9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .orange_fc45,
  .texture-0be6,
  .hidden_east_53a8,
  .hover-gold-4723 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .huge_2121,
  .solid-2cc4,
  .thumbnail-1500,
  .heading-637e,
  .paper_e3d7,
  .feature_1fb4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dropdown_915e,
  .content-4b7d,
  .accordion_dirty_b93f {
    max-width: none !important;
  }
  
  .popup-under-571f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .silver_65fa {
    font-size: 1.5rem !important;
  }
  
  .alert-173e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .south-330c,
  .input_left_afff {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .short_eb7b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .upper_9db4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .next_0cbc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dropdown_915e,
  .accordion_dirty_b93f {
    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: 94a5 */
.accordion-middle-f70e {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 9748 */
.widget-item-u9 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
