/* ============================================
   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 (.shadow-3f40) is a descendant of
   .button_56bf (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.carousel_8e5f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".north-bd71" 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.dropdown_current_b0e6 so it can't cause
   horizontal overflow anyway. */
.image-black-0605,
.heading_under_7ee9,
.column-78c2,
.primary-dynamic-c302,
.link_f8d0,
.form_901a,
.preview_620e,
.old-a826,
.background-aa55,
.logo_huge_b16e,
.secondary_ac20 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gas_a0fd {
    padding: 8px 0;
  }
  
  .easy_164d img {
    height: 28px;
    width: auto;
  }
  
  .pattern_1459 {
    display: none !important;
  }
  
  .background_prev_26f7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .background_prev_26f7 svg {
    width: 14px;
    height: 14px;
  }
  
  .input-255e {
    padding: 6px;
  }
  
  .chip-red-01b0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .column-78c2,
  .heading_under_7ee9,
  .primary-dynamic-c302,
  .link_f8d0,
  .pattern_wide_1970,
  .picture-focused-329b,
  .sort_419f,
  .plasma-3c82,
  .accent_black_23c7,
  .notice-action-4a0a,
  .old-edbc,
  .content-thick-2646 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop-clean-86f8,
  .icon_dark_09e9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .form_large_22fe,
  .surface_liquid_ee2c,
  .pro_f447,
  .notification-glass-6374,
  .highlight_743c,
  .brown-76e9,
  .glass-5cc3 {
    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 */
  .hard_7628,
  .message_0ccd,
  .section-red-1695,
  .surface_7bd3,
  .dropdown_ff69 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .element-center-d56a,
  .sort_ea63,
  .tabs_a206,
  .sidebar-action-7432 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .module-839b,
  .row_630a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .backdrop-9875,
  .video-c43b,
  .last-1116,
  .thumbnail-0ed1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .box-warm-fbcd,
  .backdrop-009e,
  .progress-7065,
  .detail-4000,
  .form_e2e7,
  .stale_971d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hard_7628,
  .message_0ccd,
  .surface_7bd3 {
    max-width: none !important;
  }
  
  .north-bd71 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .element-center-d56a {
    font-size: 1.5rem !important;
  }
  
  .sort_ea63 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .lite-67dc,
  .action_57c5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tabs_a206 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .silver_309b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .white_12f0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hard_7628,
  .surface_7bd3 {
    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: a510 */
.widget-item-c0 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
