/* Marketplace — gear and merch between people (marketplace.js). No boxes: pictures on the field colour, hairlines, glowing fields. */
.mpl { max-width: var(--page-w, 1120px); margin: 0 auto; padding: 4px 16px 48px; }
.mpl--pane { padding: 12px 16px 32px; }
.mp-head { display: flex; align-items: flex-end; gap: 12px; padding: 8px 0 14px; }
.mp-head__t { flex: 1; min-width: 0; }
.mp-head h1 { display: none; margin: 0; font-size: 26px; line-height: 32px; font-weight: 900; letter-spacing: -0.01em; }
.mp-head h1.is-show { display: block; }
.mp-head p { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--color-ink-muted); }
.mp-head__acts { flex: none; display: flex; gap: 8px; }
.mp-sellbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 20px; }
.mp-sellbtn svg { width: 16px; height: 16px; }
.mp-q { margin: 0 0 10px; }
.mp-filters { margin: 0 -16px 12px; padding: 2px 16px 4px; }
.mp-clear svg { width: 12px; height: 12px; }

/* the grid: 2 on a phone, 3 on a tablet, 4 on a desktop */
.mp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 640px) { .mp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 16px; } }
@media (min-width: 1024px) { .mp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mp-card { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: inherit; text-decoration: none; }
.mp-card__img { position: relative; display: block; aspect-ratio: 1; margin-bottom: 8px; border-radius: 14px; overflow: hidden; background: var(--color-field); box-shadow: inset 0 0 0 var(--hairline) var(--color-line); }
.mp-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.mp-card__price { font-size: 16px; line-height: 21px; font-weight: 800; }
.mp-card__title { font-size: 14px; line-height: 19px; color: var(--color-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-card__meta { font-size: 12px; line-height: 17px; color: var(--color-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .mp-card:hover .mp-card__img img { transform: scale(1.03); } .mp-card:hover .mp-card__title { text-decoration: underline; } }
.mp-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-ink-muted); }
.mp-noimg svg { width: 26px; height: 26px; }
.mp-st { position: absolute; left: 8px; top: 8px; z-index: 1; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-style: normal; font-size: 12px; font-weight: 700;
  background: rgba(10, 10, 14, .55); color: #FFFFFF; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mp-st--sold { background: color-mix(in srgb, var(--color-positive, #1F9D55) 82%, black); }
.mp-st--off { background: rgba(10, 10, 14, .42); color: rgba(255, 255, 255, .85); }
.mp-more { display: flex; margin: 24px auto 0; min-width: 200px; justify-content: center; height: 44px; border-radius: 22px; }
.mp-empty { margin-top: 24px; }

/* rails (seller's other listings, feed unit) */
.mp-rail { display: flex; gap: 12px; overflow-x: auto; margin: 14px -16px 0; padding: 2px 16px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.mp-rail::-webkit-scrollbar { display: none; }
.mp-card--rail { flex: none; width: 148px; scroll-snap-align: start; }
.mp-fxrail .mp-card--rail { width: 150px; }

/* one listing */
.mpl--item { padding-top: 0; }
.mp-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 1024px) {
  .mpl--item { padding-top: 20px; }
  .mp-item { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .mp-gal { position: sticky; top: 20px; }
}
.mp-gal { position: relative; margin: 0 -16px; }
@media (min-width: 640px) { .mp-gal { margin: 0; } }
.mp-gal__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--color-field); }
@media (min-width: 640px) { .mp-gal__track { border-radius: 18px; box-shadow: inset 0 0 0 var(--hairline) var(--color-line); } }
.mp-gal__track::-webkit-scrollbar { display: none; }
.mp-gal__slide { flex: none; width: 100%; aspect-ratio: 1; padding: 0; scroll-snap-align: center; cursor: zoom-in; }
.mp-gal__slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mp-gal__n { position: absolute; right: 12px; top: 12px; height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 12px; font-size: 12px; font-weight: 700;
  background: rgba(10, 10, 14, .5); color: #FFFFFF; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mp-gal__dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.mp-gal__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .2s ease, background .2s ease; }
.mp-gal__dots i.is-on { background: #FFFFFF; transform: scale(1.25); }
.mp-gal .mp-st { left: 12px; top: 12px; }
.mp-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mp-item__price { margin: 0; font-size: 30px; line-height: 36px; font-weight: 900; letter-spacing: -0.01em; }
.mp-item__price small { font-size: 14px; font-weight: 600; color: var(--color-ink-muted); letter-spacing: 0; }
.mp-item__title { margin: 0; font-size: 20px; line-height: 27px; font-weight: 700; text-wrap: balance; overflow-wrap: anywhere; }
.mp-item__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.mp-item__tags span { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px; background: var(--color-field); font-size: 13px; font-weight: 600; color: var(--color-ink-2); }
.mp-item__line { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; line-height: 20px; color: var(--color-ink-2); }
.mp-item__line svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--color-ink-muted); }
.mp-item__line--muted { color: var(--color-ink-muted); font-size: 13px; }
.mp-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 4px; }
.mp-acts .dx-cta, .mp-acts .dx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 22px; }
.mp-acts .dx-cta svg, .mp-acts .dx-btn svg { width: 16px; height: 16px; }
.mp-ask { flex: 1 1 220px; }
.mp-item__desc { margin: 4px 0 0; padding-top: 14px; border-top: var(--hairline) solid var(--color-line); font-size: 15px; line-height: 23px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mp-item__serial { padding: 10px 12px; border-radius: 12px; background: var(--color-field); font-size: 13px; }
.mp-seller { padding-top: 14px; border-top: var(--hairline) solid var(--color-line); }
.mp-seller__row { display: flex; align-items: center; gap: 12px; padding: 6px 0; color: inherit; text-decoration: none; }
.mp-seller__av { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--color-field); font-weight: 700; color: var(--color-ink-2); }
.mp-seller__av img { width: 100%; height: 100%; object-fit: cover; }
.mp-seller__row > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-seller__row b { font-size: 16px; line-height: 21px; }
.mp-seller__row small { font-size: 13px; color: var(--color-ink-muted); }
.mp-seller__chev { width: 16px; height: 16px; color: var(--color-ink-muted); }
@media (hover: hover) { .mp-seller__row:hover b { text-decoration: underline; } }
.mp-safe { border-top: var(--hairline) solid var(--color-line); padding-top: 4px; }
.mp-safe summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 700; }
.mp-safe summary::-webkit-details-marker { display: none; }
.mp-safe summary > svg:first-child { width: 18px; height: 18px; color: var(--color-positive, #1F9D55); }
.mp-safe summary span { flex: 1; }
.mp-safe__chev { width: 14px; height: 14px; color: var(--color-ink-muted); transition: transform .2s ease; }
.mp-safe[open] .mp-safe__chev { transform: rotate(180deg); }
.mp-safe ul { margin: 0 0 8px; padding: 0 0 0 28px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 20px; color: var(--color-ink-2); }
.mp-foot { padding-top: 4px; }
.mp-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--color-ink-muted); }
.mp-link svg { width: 15px; height: 15px; }
.mp-link--danger { color: var(--color-danger); }
@media (hover: hover) { .mp-link:hover { color: var(--color-ink); } .mp-link--danger:hover { color: var(--color-danger); text-decoration: underline; } }

/* the form */
.mp-ph { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-ph__it, .mp-ph__add { position: relative; width: 84px; height: 84px; flex: none; border-radius: 14px; overflow: hidden; background: var(--color-field); }
.mp-ph__it img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.mp-ph__it:first-child { box-shadow: 0 0 0 2px var(--color-accent); }
.mp-ph__cover { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; text-align: center; font-size: 11px; font-weight: 700; color: #FFFFFF; background: linear-gradient(to top, rgba(10, 10, 14, .7), transparent); }
.mp-ph__x { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(10, 10, 14, .55); color: #FFFFFF; }
.mp-ph__x svg { width: 11px; height: 11px; }
.mp-ph__add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--color-ink-2); font: inherit; font-size: 12px; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--color-line-strong); }
.mp-ph__add svg { width: 20px; height: 20px; }
.mp-ph__add small { font-weight: 500; color: var(--color-ink-muted); }
.mp-ph__add:hover { background: var(--color-hover, var(--color-field)); }
.mp-ph__it.is-busy { display: grid; place-items: center; }
.mp-spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--color-line-strong); border-top-color: var(--color-accent); animation: mp-spin .8s linear infinite; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-seg4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mp-seg4 button { padding: 0 4px; font-size: 13px; }
@media (max-width: 420px) { .mp-seg4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mp-seg4 button[aria-checked="true"] { background: var(--color-surface); color: var(--color-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 var(--hairline) var(--color-line); }
.mp-pricerow { align-items: end; }
.mp-money { position: relative; display: flex; }
.mp-money input { padding-right: 58px !important; }
.mp-money b { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 700; color: var(--color-ink-muted); pointer-events: none; }
.mp-ways { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.mp-ways .mk-check { padding-bottom: 4px; }
.mp-lock { width: 12px; height: 12px; vertical-align: -1px; color: var(--color-ink-muted); }
.mp-hint { font-size: 12px; line-height: 17px; font-weight: 400; color: var(--color-ink-muted); }
.mp-rules { display: flex; gap: 8px; margin: 4px 0 0; font-size: 13px; line-height: 19px; color: var(--color-ink-muted); }
.mp-rules svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }

/* ask the seller */
.mp-ask__item { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; }
.mp-ask__item img, .mp-ask__item .mp-noimg { position: static; width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; background: var(--color-field); }
.mp-ask__item span { display: flex; flex-direction: column; min-width: 0; }
.mp-ask__item b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-ask__item small { font-size: 13px; color: var(--color-ink-muted); }

/* in Chat */
.mp-chat { display: flex; align-items: center; gap: 10px; margin: -2px 0 8px; padding: 6px 12px 6px 6px; border-radius: 14px; background: color-mix(in srgb, var(--color-surface) 60%, transparent); color: inherit; text-decoration: none; box-shadow: inset 0 0 0 var(--hairline) var(--color-line); min-width: 0; }
.mp-chat img, .mp-chat .mp-noimg { position: static; width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; background: var(--color-field); }
.mp-chat > span { display: flex; flex-direction: column; min-width: 0; }
.mp-chat b { font-size: 14px; line-height: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-chat small { font-size: 12px; line-height: 16px; color: var(--color-ink-muted); }
.mp-chat--gone { color: var(--color-ink-muted); font-size: 13px; }
.mp-chat--gone svg { width: 16px; height: 16px; }
.ob-bubble.is-mine .mp-chat { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.ob-bubble.is-mine .mp-chat small { color: inherit; opacity: .8; }
.ch-mp { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: var(--color-surface); border-bottom: var(--hairline) solid var(--color-line); }
.ch-mp .mp-chat { flex: 1 1 220px; margin: 0; background: transparent; box-shadow: none; padding-left: 0; }
.ch-mp__acts { display: flex; gap: 6px; }
.ch-mp__acts .dx-btn { height: 34px; padding: 0 12px; border-radius: 17px; font-size: 13px; }
.ch-warn { display: flex; gap: 8px; max-width: 520px; margin: 4px 0 10px 44px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 18px;
  background: color-mix(in srgb, var(--color-warn, #E8B54A) 16%, transparent); color: var(--color-ink); }
.ch-warn svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: color-mix(in srgb, var(--color-warn, #E8B54A) 70%, var(--color-ink)); }
.ch-tabs { margin: 0 0 6px; padding: 0 16px; position: static; }
.ch-tabs .chip { position: relative; }
.ch-tabs__dot { position: absolute; right: 4px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }

/* a listing as a post in the feed */
.mp-post { display: block; color: inherit; text-decoration: none; }
.mp-post__img { position: relative; display: block; max-height: 640px; overflow: hidden; background: var(--color-field); }
.mp-post__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-post__n { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; font-style: normal; font-size: 12px; font-weight: 700;
  background: rgba(10, 10, 14, .5); color: #FFFFFF; }
.mp-post__n svg { width: 12px; height: 12px; }
.mp-post__body { display: flex; align-items: center; gap: 12px; padding: 12px 16px 2px; }
.mp-post__body > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-post__price { font-size: 18px; line-height: 24px; font-weight: 800; }
.mp-post__title { font-size: 15px; line-height: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-post__body small { font-size: 13px; color: var(--color-ink-muted); }
.mp-post__go { flex: none; height: 36px; border-radius: 18px; }
@media (min-width: 640px) { .mp-post__img { margin: 0 16px; border-radius: 14px; } }

.mp-pane__acts { display: flex; gap: 8px; margin-bottom: 16px; }
.mp-pane__acts .dx-btn { height: 40px; border-radius: 20px; }
/* the screen's own bar carries the title (28/900 on desktop); only the fan's tab on a phone has no bar */
@media (min-width: 1024px) { .mp-head { padding-top: 4px; } .mp-head h1 { font-size: 28px; line-height: 34px; } }
@media (max-width: 380px) { .mp-head { flex-wrap: wrap; align-items: center; } }
/* the fan's Marketplace tab on a phone has no bar: the page carries its own title, like Chat */
@media (max-width: 1023px) { .screen.is-tabbed .mp-head h1 { display: block; } .screen.is-tabbed .mpl { padding-top: 8px; } }
/* the same frame as Opportunities: content starts where the page title does (owner, 23 Oct) */
@media (min-width: 1024px) {
  .screen--market .mpl { padding-left: 0; padding-right: 0; }
  .screen--market .mp-head { align-items: center; padding-top: 4px; }
}

/* 27 Oct (owner): Marketplace search looks and feels like Search — the big rounded field, glowing when you type */
.mp-q.search-field { height: 52px; margin: 4px 0 16px; padding: 0 10px 0 18px; gap: 12px; border-radius: 26px; background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-line-strong), 0 0 18px color-mix(in srgb, var(--color-accent) 14%, transparent); }
.mp-q.search-field:focus-within { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--color-accent) 80%, transparent), 0 0 22px color-mix(in srgb, var(--color-accent) 28%, transparent); }
.mp-q .search-field__icon { width: 20px; height: 20px; }
.mp-q input { font-size: 16px; }
@media (min-width: 1024px) { .mp-q.search-field { max-width: 640px; } }
