:root { --mnav-h: 4rem; --mnav-safe: env(safe-area-inset-bottom, 0px); }

.mnav, .mnav-sheet { display: none; }

@media (max-width: 639.98px) {
  #app { overflow-x: clip; }
  body.has-mnav { padding-bottom: calc(var(--mnav-h) + var(--mnav-safe)); }

  .main :where(p, h1, h2, h3, h4, li, dd, td, th, blockquote, label) { overflow-wrap: anywhere; }
  .main pre { max-width: 100%; overflow-x: auto; }
  .main iframe, .main video { max-width: 100%; }

  .mnav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: calc(var(--mnav-h) + var(--mnav-safe)); padding: 0 env(safe-area-inset-right, 0px) var(--mnav-safe) env(safe-area-inset-left, 0px);
    background: rgb(var(--color-voon-900) / 0.97); border-top: 1px solid rgb(255 255 255 / 0.08);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .mnav-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    min-width: 0; height: var(--mnav-h); padding: 0 0.15rem; border: 0; background: none; cursor: pointer;
    color: rgb(255 255 255 / 0.7); font: inherit; font-size: 0.68rem; font-weight: 600; text-decoration: none;
  }
  .mnav-item i { font-size: 1.15rem; }
  .mnav-item span.mnav-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mnav-item:hover, .mnav-item[aria-current="page"], .mnav-item[aria-expanded="true"] { color: #fff; }
  .mnav-item[aria-current="page"]::before {
    content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px;
    background: rgb(var(--color-indigo-400));
  }
  .mnav-item--play i { color: rgb(var(--color-indigo-300)); }
  .mnav-badge {
    position: absolute; top: 0.45rem; left: calc(50% + 0.35rem); min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem;
    border-radius: 999px; background: #581c87; color: #fff; font-size: 0.65rem; line-height: 1.1rem; text-align: center;
  }

  .mnav-sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 95; }
  .mnav-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.55); }
  .mnav-panel {
    position: absolute; left: 0; right: 0; bottom: calc(var(--mnav-h) + var(--mnav-safe));
    max-height: calc(100vh - var(--mnav-h) - var(--mnav-safe) - 3rem); overflow-y: auto; overscroll-behavior: contain;
    padding: 1rem 1rem 1.25rem; border-radius: 1.1rem 1.1rem 0 0;
    background: rgb(var(--color-voon-800)); border: 1px solid rgb(255 255 255 / 0.08); border-bottom: 0; color: #fff; outline: none;
  }
  .mnav-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
  .mnav-panel-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
  .mnav-close { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 0.75rem; background: rgb(255 255 255 / 0.06); color: #fff; cursor: pointer; }
  .mnav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
  .mnav-links a, .mnav-links button {
    display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 3rem; padding: 0.6rem 0.8rem; border-radius: 0.8rem;
    background: rgb(255 255 255 / 0.04); border: 1px solid rgb(255 255 255 / 0.06); color: rgb(255 255 255 / 0.9);
    font: inherit; font-size: 0.85rem; font-weight: 600; text-decoration: none; text-align: left; cursor: pointer;
  }
  .mnav-links a[aria-current="page"] { border-color: rgb(var(--color-indigo-400) / 0.6); color: #fff; }
  .mnav-links i { width: 1.1rem; text-align: center; color: rgb(var(--color-indigo-300)); }

  #scrollUp { bottom: calc(var(--mnav-h) + var(--mnav-safe) + 0.75rem) !important; }
  .sp-bulk { bottom: calc(var(--mnav-h) + var(--mnav-safe) + 0.5rem); }

  #mobile-menu > div:first-child { gap: 0.5rem; }
  #mobile-menu > div:first-child > a:first-child { flex: 0 1 auto; min-width: 0; }
  #mobile-menu > div:first-child > a:first-child img { max-width: 34vw; height: auto; max-height: 3rem; object-fit: contain; }
  .site-mobile-tools { gap: 0.35rem; flex-shrink: 0; }

  #__heroSection h1 { font-size: 2.1rem; line-height: 1.15; }
  #__heroSection p { font-size: 1.05rem; }
  #__heroSection .flex.items-center.gap-4 { flex-wrap: wrap; }

  .sp-tabs, .cm-pills, .sg-toolbar-row {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    padding-bottom: 0.35rem; margin-right: -0.25rem;
  }
  .sp-tabs > *, .cm-pills > *, .sg-toolbar-row > * { flex: 0 0 auto; white-space: nowrap; }

  .sp-filters > *, .sh-filters > *, .cm-filters > * { min-width: 0; max-width: 100%; }
  .sp-layout > *, .sg-layout > *, .cm-grid > *, .cm-profile > *, .ev-detail > *, .sh-grid > *, .sgi-grid > * { min-width: 0; }

  .sp-bulk { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.6rem 0.75rem; }
  .sp-bulk-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.2rem; }
  .sp-bulk-actions > *, .sp-bulk-priority > * { flex: 0 0 auto; }
  .sp-bulk-priority { flex-wrap: nowrap; }

  .sp-menu[open] .sp-menu-pop {
    position: fixed; top: auto; left: 0.75rem; right: 0.75rem; width: auto; z-index: 96;
    bottom: calc(var(--mnav-h) + var(--mnav-safe) + 0.75rem); max-height: 70vh; overflow-y: auto;
  }
  .sg-report[open] .sg-report-pop {
    position: fixed; top: auto; left: 0.75rem; right: 0.75rem; width: auto; z-index: 96;
    bottom: calc(var(--mnav-h) + var(--mnav-safe) + 0.75rem);
  }
  .nt-panel { max-height: calc(100vh - 4.25rem - var(--mnav-h) - var(--mnav-safe) - 1rem); overflow-y: auto; }

  .main table.cl-cards, .main table.cl-cards tbody, .main table.cl-cards tr, .main table.cl-cards td { display: block; width: 100%; }
  .main table.cl-cards { border: 0; background: transparent; }
  .main table.cl-cards thead { display: none; }
  .main table.cl-cards tr {
    margin-bottom: 0.75rem; padding: 0.75rem 1rem; border-radius: 1rem;
    background: rgb(var(--color-voon-card)); border: 1px solid rgb(255 255 255 / 0.08);
  }
  .main table.cl-cards td {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.35rem 0 !important; border: 0 !important; text-align: right !important; width: 100% !important;
  }
  .main table.cl-cards td[data-label]::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    color: rgb(255 255 255 / 0.65); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  }
  .main table.cl-cards td:empty { display: none; }

  .main .overflow-x-auto:has(> table.cl-cards) { overflow: visible; }
}

@media (min-width: 640px) {
  .mnav, .mnav-sheet { display: none !important; }
}

@media (max-width: 639.98px) {
  .lb-discord-row { flex-wrap: wrap; }
  .lb-discord-row > :nth-child(2) { width: 3.5rem; padding-left: 0.5rem; padding-right: 0.5rem; border-radius: 0.75rem 0 0 0; }
  .lb-discord-row > :nth-child(3) { flex: 1 1 calc(100% - 3.5rem); width: auto; min-width: 0; padding-left: 1rem; padding-right: 1rem; overflow-wrap: anywhere; }
  .lb-discord-row > :nth-child(n+4) { flex: 1 1 33.333%; min-width: 0; padding: 0.6rem 0.4rem; }
  .lb-discord-row > :nth-child(4) { border-left: 0; }
}
