button,
a,
summary,
.market-tile {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.market-tile img { -webkit-touch-callout: none; -webkit-user-drag: none; }

.app-tabs,
.profile-scrim,
.profile-legal { display: none; }

@media (max-width: 767px) {
  :root { --tabs-h: calc(3.5rem + env(safe-area-inset-bottom)); }

  button,
  .market-tile,
  .rail-head,
  .cat-row { -webkit-user-select: none; user-select: none; }

  .app-tabs {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--tabs-h);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 10, 11, 0.92);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
    box-shadow: inset 0 1px 0 rgba(246, 241, 234, 0.08);
  }
  .app-tabs button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 0;
    background: transparent;
    color: rgba(246, 241, 234, 0.5);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 120ms ease, transform 120ms ease;
  }
  .app-tabs button i {
    display: grid;
    place-items: center;
    height: 1.6rem;
    font-size: 1.15rem;
    line-height: 1;
  }
  .app-tabs button[aria-current="page"] { color: #f6f1ea; }
  .app-tabs button[aria-current="page"] i.fa-regular { font-weight: 900; }
  .app-tabs button:active { transform: scale(0.92); }
  .app-tabs .app-tab-sell i {
    width: 2.25rem;
    border-radius: 999px;
    background: #e4c98f;
    color: #141210;
    font-size: 0.85rem;
  }
  body.has-trade-bar .app-tabs { display: none; }

  body:not(.has-trade-bar) #spaViewOutlet { padding-bottom: calc(var(--tabs-h) + 1.5rem); }
  body:not(.has-trade-bar) #toastContainer { bottom: calc(var(--tabs-h) + 0.75rem); }
  .market-foot { display: none; }

  .head-sell,
  .profile-trigger { display: none; }
  .head-live { margin-left: auto; }
  #spaViewOutlet { padding-top: 1.25rem; }

  .trust-strip,
  .floor-head.is-rails .floor-tools { display: none; }

  .profile-menu.is-open { filter: none; }
  .profile-menu.is-open .profile-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
  }
  .profile-panel {
    position: fixed;
    inset: auto 0 var(--tabs-h) 0;
    width: auto;
    max-height: calc(100dvh - var(--tabs-h) - 4rem);
    border: 0;
    border-radius: 1.1rem 1.1rem 0 0;
    padding-top: 0.5rem;
    animation: sheet-up 200ms ease-out;
  }
  .profile-panel::before {
    content: "";
    display: block;
    width: 2.25rem;
    height: 0.3rem;
    margin: 0 auto 0.35rem;
    border-radius: 999px;
    background: rgba(246, 241, 234, 0.2);
  }
  .profile-panel .menu-row { min-height: 3rem; }
  .profile-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(246, 241, 234, 0.1);
  }
  .profile-legal button {
    border: 0;
    background: transparent;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    color: rgba(246, 241, 234, 0.5);
  }
}

@media (hover: none) {
  .market-tile { transition: transform 120ms ease; }
  .market-tile:active { transform: scale(0.97); }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-panel { animation: none; }
}
