/* TrackBounty public website - marketplace family sheet (spec v4 section 4.7; map v4.3 amendment A3, WF increment 1).
   Loaded only by /marketplace, /marketplace/collections and /marketplace/collections/<slug>; the mktv4-* names stay so the admin
   sandbox preview (its own sheet) keeps rendering the shared card partials. Every colour is a --tb-* token or one of the
   semantic literals of components.css; no gradients, no glow, no box shadows: hairlines on paper. */

/* --- page ------------------------------------------------------------------ */
.mktv4-page { padding-top: 48px; padding-bottom: 96px; }
@media (max-width: 767px) { .mktv4-page { padding-top: 32px; padding-bottom: 72px; } }
.tbp .mktv4-page h1 { font-size: 46px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; max-width: 16ch; }
@media (max-width: 1023px) { .tbp .mktv4-page h1 { font-size: 38px; } }
@media (max-width: 767px) { .tbp .mktv4-page h1 { font-size: 32px; } }
.tbp .mktv4-page h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
@media (max-width: 767px) { .tbp .mktv4-page h2 { font-size: 22px; } }
.tbp .mktv4-page h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.tbp .mktv4-page a.mktv4-chip, .tbp .mktv4-page a.mktv4-mini-card, .tbp .mktv4-page a.mktv4-profile, .tbp .mktv4-page a.mktv4-mini-btn,
.tbp .mktv4-page a.mktv4-coll-card, .tbp .mktv4-page a.mktv4-coll-ed { color: inherit; text-decoration: none; }
.mktv4-section { margin-top: 56px; }
@media (max-width: 767px) { .mktv4-section { margin-top: 44px; } }
.mktv4-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 20px; }
.mktv4-section-head > div { display: grid; gap: 6px; }
.mktv4-section-head .tbp-meta { max-width: 60ch; }
.mktv4-page [hidden] { display: none !important; }

/* --- hero ------------------------------------------------------------------ */
.mktv4-hero { display: grid; gap: 36px; align-items: start; }
@media (min-width: 1024px) { .mktv4-hero { grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr); gap: 48px; } }
.mktv4-hero-copy { display: grid; gap: 18px; justify-items: start; }
.mktv4-hero-copy .tbp-lede { max-width: 48ch; }
.mktv4-hero-actions { margin-top: 6px; }
.mktv4-proof { margin-top: 4px; }
.mktv4-proof b { font-weight: 800; }

/* --- sound matching panel (a white hairline card; the script drives data-state) --- */
.mktv4-match-card { display: grid; gap: 18px; padding: 26px 24px; border: 1px solid var(--tb-line); border-radius: 16px; background: var(--tb-paper); }
@media (max-width: 767px) { .mktv4-match-card { padding: 20px 18px; } }
.mktv4-match-head { display: grid; gap: 6px; }
.mktv4-match-form { display: grid; gap: 14px; margin: 0; }
.mktv4-match-card .tbp-status:not([hidden]) { display: grid; }
.mktv4-match-card .tbp-status .tbp-what { margin: 0; }
.mktv4-match-loading { grid-template-columns: auto 1fr; align-items: center; }
.mktv4-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--tb-line-2); border-top-color: var(--tb-ink); border-radius: 50%; animation: mktv4-spin 800ms linear infinite; }
@keyframes mktv4-spin { to { transform: rotate(360deg); } }
.mktv4-match-turnstile { min-height: 65px; }
.mktv4-match-results-head { align-items: flex-start; }
.mktv4-match-results-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* --- tiles ----------------------------------------------------------------- */
.mktv4-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 420px; margin: 56px 0 0; }
.mktv4-stats-row dd { display: grid; gap: 4px; margin: 0; }
.tbp-tiles.mktv4-stats-row b { font-size: 34px; }
.tbp-tiles.mktv4-stats-row span { font-size: 13px; }
@media (max-width: 767px) { .mktv4-stats-row { margin-top: 44px; } .tbp-tiles.mktv4-stats-row b { font-size: 28px; } }

/* --- verified strip -------------------------------------------------------- */
.mktv4-verified-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 164px; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.mktv4-mini-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 18px 12px 16px; border: 1px solid var(--tb-line); border-radius: 12px; text-align: center; scroll-snap-align: start; transition: border-color 150ms var(--tb-ease); }
.mktv4-mini-card:hover { border-color: var(--tb-ink); }
.mktv4-mini-card .mktv4-tier { position: absolute; top: 10px; right: 10px; }
.mktv4-mini-avatar-frame { width: 56px; height: 56px; margin-bottom: 6px; }
.mktv4-mini-name { max-width: 100%; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.mktv4-mini-niche { color: var(--tb-ink-3); font-size: 13px; }
.mktv4-mini-followers { color: var(--tb-ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mktv4-empty--strip { margin: 0; color: var(--tb-ink-2); font-size: 17px; }

/* --- avatars and tier pills (shared partials) ------------------------------ */
.mktv4-avatar-frame, .mktv4-mini-avatar-frame { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--tb-tint); color: var(--tb-ink-2); overflow: hidden; flex: none; }
.mktv4-avatar-initial { font-size: 20px; font-weight: 800; line-height: 1; }
.mktv4-avatar, .mktv4-mini-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mktv4-tier { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--tb-ink); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; line-height: 1; flex: none; }

/* --- filter dock ----------------------------------------------------------- */
.mktv4-filter-dock { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--tb-line); }
.mktv4-filters-head { margin-bottom: 20px; }
.mktv4-filters-head a { display: inline-block; margin: -5px 0; padding: 5px 0; }
.mktv4-filter-form { margin: 0; }
.mktv4-filter-top { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
@media (max-width: 1023px) { .mktv4-filter-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mktv4-filter-top .mktv4-filter-q { grid-column: 1 / -1; } }
@media (max-width: 559px) { .mktv4-filter-top { grid-template-columns: minmax(0, 1fr); } }
.mktv4-filter-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 1023px) { .mktv4-filter-actions { grid-column: 1 / -1; } }
.mktv4-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.mktv4-chip-lbl { margin-right: 4px; color: var(--tb-ink-3); font-size: 13px; }
.mktv4-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 1.5px solid var(--tb-line-2); border-radius: 999px; color: var(--tb-ink); font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: border-color 150ms var(--tb-ease), background 150ms var(--tb-ease); }
a.mktv4-chip:hover { border-color: var(--tb-ink); }
.mktv4-chip--active { background: var(--tb-bolt); border-color: var(--tb-bolt); }
.mktv4-chip-count { color: var(--tb-ink-3); font-size: 13px; font-weight: 500; }
.mktv4-chip--active .mktv4-chip-count { color: var(--tb-ink-2); }
@media (max-width: 767px) { .mktv4-niche-chips a:nth-child(n+10) { display: none; } }

/* --- results and cards ----------------------------------------------------- */
.mktv4-cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1023px) { .mktv4-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .mktv4-cards-grid { grid-template-columns: minmax(0, 1fr); } }
.mktv4-editor-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--tb-line); border-radius: 12px; transition: border-color 150ms var(--tb-ease); }
.mktv4-editor-card:hover { border-color: var(--tb-ink); }
.mktv4-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mktv4-profile { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.mktv4-name-wrap { min-width: 0; }
.mktv4-name-wrap strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mktv4-name-wrap span { display: block; margin-top: 2px; color: var(--tb-ink-2); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mktv4-name-wrap--verified strong::after { content: ""; display: inline-block; width: 6px; height: 11px; margin-left: 8px; border-right: 2px solid #1B7F3B; border-bottom: 2px solid #1B7F3B; transform: translateY(-2px) rotate(45deg); vertical-align: middle; }
.mktv4-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mktv4-tag-stack { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 36px; margin-top: 14px; }
.mktv4-editor-card .mktv4-chip, .mktv4-coll-ed .mktv4-chip { min-height: 0; padding: 4px 9px; border-width: 1px; border-color: var(--tb-line-2); font-size: 12px; font-weight: 600; }
.mktv4-chip--green { border-color: #EEF8F0; background: #EEF8F0; color: #1B7F3B; }
.mktv4-chip--purple { border-color: var(--tb-tint); background: var(--tb-tint); color: var(--tb-ink-2); }
.mktv4-chip--soft { color: var(--tb-ink-3); }
.mktv4-chip--match { border-color: var(--tb-bolt); background: var(--tb-bolt); color: var(--tb-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.mktv4-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--tb-line); }
.mktv4-metric strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.mktv4-metric span { display: block; margin-top: 4px; color: var(--tb-ink-3); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.mktv4-metric--na span { font-style: italic; }
.mktv4-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.mktv4-price { min-width: 0; color: var(--tb-ink-3); font-size: 13px; line-height: 1.3; }
.mktv4-price strong { display: block; color: var(--tb-ink); font-size: 15px; font-weight: 700; }
.mktv4-mini-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--tb-ink); border-radius: 10px; font-size: 15px; font-weight: 700; white-space: nowrap; flex: none; transition: background 150ms var(--tb-ease); }
.mktv4-mini-btn:hover { background: var(--tb-tint); }

/* --- empty states ---------------------------------------------------------- */
.mktv4-empty { display: grid; gap: 8px; justify-items: start; color: var(--tb-ink-2); font-size: 17px; }
.mktv4-empty--results { grid-column: 1 / -1; padding: 28px 0 8px; border-top: 1px solid var(--tb-line); }
.mktv4-empty p { max-width: 56ch; }
.mktv4-empty .tb-btn { margin-top: 6px; }

/* --- pagination ------------------------------------------------------------ */
.mktv4-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--tb-line); }
.mktv4-page-marker { text-align: center; }

/* --- collections (/marketplace/collections, /marketplace/collections/<slug>) --- */
.mktv4-coll-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; }
.mktv4-coll-crumb a { display: inline-block; margin: -5px 0; padding: 5px 0; }   /* 24 px targets (spec v4 §5.3 item 5) */
.mktv4-coll-head { display: grid; justify-items: start; gap: 14px; max-width: 72ch; }
.mktv4-coll-head .tbp-lede { max-width: 60ch; }
.mktv4-coll-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 36px; }
@media (max-width: 1023px) { .mktv4-coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .mktv4-coll-grid { grid-template-columns: minmax(0, 1fr); margin-top: 28px; } }
.mktv4-coll-card { display: grid; align-content: start; gap: 8px; padding: 20px; border: 1px solid var(--tb-line); border-radius: 12px; transition: border-color 150ms var(--tb-ease); }
.mktv4-coll-card:hover { border-color: var(--tb-ink); }
.mktv4-coll-card .tbp-pill { justify-self: start; margin-bottom: 4px; }
.mktv4-coll-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.mktv4-coll-desc { color: var(--tb-ink-2); font-size: 15px; line-height: 1.45; }
.mktv4-coll-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.mktv4-coll-go { font-size: 15px; font-weight: 700; }
.mktv4-coll-ed { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--tb-line); border-radius: 12px; transition: border-color 150ms var(--tb-ease); }
.mktv4-coll-ed:hover { border-color: var(--tb-ink); }
.mktv4-coll-ed-frame { width: 48px; height: 48px; }
.mktv4-coll-ed-frame .mktv4-avatar-initial { font-size: 18px; }
.mktv4-coll-ed-name { font-size: 16px; font-weight: 700; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mktv4-coll-ed-meta { color: var(--tb-ink-2); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mktv4-coll-ed-price { color: var(--tb-ink); font-size: 14px; font-weight: 600; }
.mktv4-coll-loader { grid-column: 1 / -1; padding: 24px 0; }
.mktv4-coll-cta { display: grid; justify-items: start; gap: 10px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--tb-line); }
.mktv4-coll-cta p { max-width: 60ch; color: var(--tb-ink-2); font-size: 17px; }
.mktv4-coll-cta .tbp-ctas { margin-top: 8px; }

/* --- motion ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mktv4-editor-card, .mktv4-mini-card, .mktv4-mini-btn, .mktv4-chip, .mktv4-coll-card, .mktv4-coll-ed { transition: none; }
  .mktv4-spinner { animation: none; border-style: dotted; }
}
