/* ============================================
   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 (.accordion-80fd) is a descendant of
   .gallery_9ed8 (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.tertiary-liquid-9d32)
   and the redesigned template (header.solid_1074). Keep both selectors. */
header.tertiary-liquid-9d32,
header.solid_1074 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".summary_bottom_816f" 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.border_6f67 so it can't cause
   horizontal overflow anyway. */
.motion_4637,
.content-9a52,
.menu-655d,
.current-7927,
.rough-7540,
.left-119f,
.bottom_edc9,
.active_035a,
.modal_ee9e,
.avatar_small_1d1e,
.image_motion_0132 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .lite_d9b5 {
    padding: 8px 0;
  }
  
  .outline-copper-7ffa img {
    height: 28px;
    width: auto;
  }
  
  .red-d1bc {
    display: none !important;
  }
  
  .green-f269 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .green-f269 svg {
    width: 14px;
    height: 14px;
  }
  
  .popup-844c {
    padding: 6px;
  }
  
  .surface_75be {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .menu-655d,
  .content-9a52,
  .current-7927,
  .rough-7540,
  .frame-full-7024,
  .orange_a8b7,
  .selected-65f5,
  .element_pressed_618d,
  .bronze_1870,
  .paragraph-iron-5f80,
  .blue-e5ac,
  .green-9605 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar_5f45,
  .preview_8e07 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .box-hovered-e75c,
  .notification-outer-df20,
  .breadcrumb_narrow_b9b0,
  .accent-selected-a8fd,
  .shade-04a5,
  .notification_f99f,
  .element_75d8 {
    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 */
  .accordion-selected-91a8,
  .hover_a59e,
  .sidebar_2ac2,
  .texture-cf80,
  .message_narrow_8947 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge_34ba,
  .slider-bronze-e9c2,
  .mini-8864,
  .notification_over_12fa {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gold_c0cf,
  .card-selected-eaa0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .background-pro-4dce,
  .feature_fe9b,
  .block-a32d,
  .image_paper_7c13 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .static-b616,
  .gallery-a1ef,
  .caption_7b4f,
  .medium-4533,
  .paragraph-west-3603,
  .texture-0325 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accordion-selected-91a8,
  .hover_a59e,
  .texture-cf80 {
    max-width: none !important;
  }
  
  .summary_bottom_816f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge_34ba {
    font-size: 1.5rem !important;
  }
  
  .slider-bronze-e9c2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .secondary_fast_d59b,
  .item_22f3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .mini-8864 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tag-center-d49a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .paper-16db {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accordion-selected-91a8,
  .texture-cf80 {
    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 */
.breadcrumb-de2a {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 5a22 */
.widget-item-o5 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
