/* ============================================
   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 (.bright-4f12) is a descendant of
   .tertiary-large-a455 (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.active_27ea {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".message_paper_7511" 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.tabs-d35a so it can't cause
   horizontal overflow anyway. */
.last_8dc0,
.menu_7b74,
.info_936d,
.avatar-3172,
.filter-57b4,
.bottom-93e4,
.upper_bd9f,
.tertiary_action_883f,
.sidebar_prev_b1db,
.silver_b7a5,
.primary-motion-3561 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .accordion_south_3cc8 {
    padding: 8px 0;
  }
  
  .blue-007e img {
    height: 28px;
    width: auto;
  }
  
  .center_27da {
    display: none !important;
  }
  
  .hovered-75f0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hovered-75f0 svg {
    width: 14px;
    height: 14px;
  }
  
  .disabled_stone_ea96 {
    padding: 6px;
  }
  
  .stale-8d5f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .info_936d,
  .menu_7b74,
  .avatar-3172,
  .filter-57b4,
  .dropdown-full-c743,
  .overlay-gold-5cc2,
  .focused_48bf,
  .article_d012,
  .container_4097,
  .gallery_wide_9009,
  .gallery-basic-6930,
  .current-9637 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .slow_2a6d,
  .outline_fast_e87f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .west-03fc,
  .info_323d,
  .column_257f,
  .panel_579e,
  .texture-b347,
  .fast_94b7,
  .photo_5fb7 {
    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 */
  .selected-61bf,
  .smooth_fc60,
  .plasma-0fa3,
  .element-a288,
  .section-0ee0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .accent_motion_ffe6,
  .column_inner_6372,
  .red_5e0b,
  .layout_focused_9c7b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .large-23df,
  .clean_3af0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .texture-8863,
  .under_8551,
  .pro_6986,
  .top_6cbb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .middle-ca58,
  .slow_0b25,
  .active_8036,
  .layout_3dd5,
  .paper-f685,
  .table_e90d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .selected-61bf,
  .smooth_fc60,
  .element-a288 {
    max-width: none !important;
  }
  
  .message_paper_7511 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .accent_motion_ffe6 {
    font-size: 1.5rem !important;
  }
  
  .column_inner_6372 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .card_warm_7509,
  .photo-under-d9c3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .red_5e0b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .short-eedd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .green_d173 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .selected-61bf,
  .element-a288 {
    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: 9741 */
.phantom-card-u3 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.2;
}
