/* ============================================
   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 (.over-0101) is a descendant of
   .container_orange_2563 (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.easy_c8e0)
   and the redesigned template (header.primary-e3c1). Keep both selectors. */
header.easy_c8e0,
header.primary-e3c1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".brown-2777" 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.old-6bdf so it can't cause
   horizontal overflow anyway. */
.fluid-e4ef,
.notification-orange-cea4,
.smooth-59c7,
.icon-f69e,
.tag-d0d9,
.hero-12c5,
.dim-71d6,
.primary-gold-baf9,
.cool_ef54,
.plasma-e783,
.huge-3e6f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .dynamic_a77b {
    padding: 8px 0;
  }
  
  .grid_top_2ae5 img {
    height: 28px;
    width: auto;
  }
  
  .panel-a2b3 {
    display: none !important;
  }
  
  .dark_14f6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dark_14f6 svg {
    width: 14px;
    height: 14px;
  }
  
  .picture-4529 {
    padding: 6px;
  }
  
  .container_3b46 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .smooth-59c7,
  .notification-orange-cea4,
  .icon-f69e,
  .tag-d0d9,
  .aside_small_dab5,
  .soft-1a6b,
  .cool_4fb7,
  .media-white-34d3,
  .dynamic_50b8,
  .alert_white_a35d,
  .white_5fbe,
  .center_97d6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tabs_light_c317,
  .black-a4c0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fixed_a7b9,
  .selected_49bb,
  .iron-9604,
  .primary_5926,
  .simple-3392,
  .lower-8ab8,
  .surface_bronze_8e13 {
    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 */
  .gas_c340,
  .easy_fa80,
  .motion_53fe,
  .highlight-new-07ef,
  .box-b0bf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .popup-0b85,
  .out_9433,
  .pattern_north_e7fa,
  .overlay_d88c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .surface-plasma-e35f,
  .motion_8148 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sort_old_cd0c,
  .grid_wide_a65d,
  .logo-current-f462,
  .hover-6f72 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .progress-5aa3,
  .title-4f21,
  .brown-c33e,
  .fluid_df22,
  .popup-d1c7,
  .button_d0ac {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gas_c340,
  .easy_fa80,
  .highlight-new-07ef {
    max-width: none !important;
  }
  
  .brown-2777 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .popup-0b85 {
    font-size: 1.5rem !important;
  }
  
  .out_9433 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .full-5a9e,
  .notification_top_4553 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .pattern_north_e7fa {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .lower-1306 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .warm_bdb9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gas_c340,
  .highlight-new-07ef {
    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 */
.prev_7d78 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: a9a8 */
.shadow-element-v3 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.3;
}
