/* ============================================
   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 (.table_227d) is a descendant of
   .accordion_purple_643a (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.iron_fc39 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dirty-d0bb" 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.primary-east-0874 so it can't cause
   horizontal overflow anyway. */
.pink-edf1,
.pattern-hard-fb01,
.picture_solid_a262,
.south_4abd,
.hover_hot_e507,
.video_fresh_31f5,
.text-brown-3344,
.detail_722d,
.chip-pressed-3d8c,
.tiny-210a,
.heading_wide_3906 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .fresh-e5d0 {
    padding: 8px 0;
  }
  
  .hidden_hovered_2eb7 img {
    height: 28px;
    width: auto;
  }
  
  .basic-d16f {
    display: none !important;
  }
  
  .item_aaf6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .item_aaf6 svg {
    width: 14px;
    height: 14px;
  }
  
  .pattern-over-f73f {
    padding: 6px;
  }
  
  .huge_4005 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .picture_solid_a262,
  .pattern-hard-fb01,
  .south_4abd,
  .hover_hot_e507,
  .sidebar_e059,
  .info-494a,
  .south-fccd,
  .main-dim-abbc,
  .avatar_3790,
  .focus_static_59b7,
  .inner_56d6,
  .primary_narrow_0ccf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .up-f37f,
  .tabs-1964 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tooltip_f24a,
  .surface_d889,
  .new_eddf,
  .south_77f8,
  .north_914a,
  .summary_7d76,
  .tag_gold_34b8 {
    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 */
  .prev-e2de,
  .avatar-gold-50dc,
  .message_cool_e3b2,
  .accordion_static_5226,
  .cold_abc2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .status-d1d3,
  .info_589c,
  .thumbnail-4330,
  .modal_active_b50d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .iron-9cf7,
  .tag-a29e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accordion_e42c,
  .chip-mini-bba3,
  .icon_8edd,
  .heading_0c8b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .accent_pro_86fe,
  .table-basic-19a7,
  .active-84eb,
  .white-2783,
  .dark_72fb,
  .breadcrumb-west-0894 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .prev-e2de,
  .avatar-gold-50dc,
  .accordion_static_5226 {
    max-width: none !important;
  }
  
  .dirty-d0bb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .status-d1d3 {
    font-size: 1.5rem !important;
  }
  
  .info_589c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tiny-142b,
  .avatar_afc3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .thumbnail-4330 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .secondary-hovered-5196 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hidden_122b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .prev-e2de,
  .accordion_static_5226 {
    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: 4eaf */
.widget-item-r4 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.0;
}
