/*
 * collect.css: the vault at /collect (reference/spec/social.md 3.10 to 3.16, 7.3, PRODUCT.md Decisions).
 * Signed out empty state, connected profile hero, unrevealed pulls, collection toolbar, card grid,
 * list view, card detail modal, sell back and price dialogs, sort sheet and filters drawer.
 */

/* ───────────── boot and signed out (3.10) ───────────── */
.vault-boot { display: flex; align-items: center; justify-content: center; min-height: calc(100dvh - var(--header-h)); }
.vault-spin { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--fg-20); border-top-color: var(--fg); animation: spin 1s linear infinite; }

.vault-out { display: flex; align-items: center; justify-content: center; min-height: calc(100dvh - var(--header-h)); padding: 64px 20px; }
.vault-out-inner { width: 100%; max-width: 448px; text-align: center; }
.vault-tile {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto;
  border: 1px solid var(--fg-10); border-radius: 16px; background: rgba(255, 255, 255, 0.035); color: var(--fg-80);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
}
.vault-tile > svg { width: 24px; height: 24px; }
.vault-out-title { margin-top: 20px; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.72px; color: var(--fg); }
.vault-out-text { max-width: 384px; margin: 8px auto 0; font-size: 14px; line-height: 24px; color: var(--muted); }
.vault-signin {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%;
  height: 44px; margin-top: 24px; padding: 0 20px; border-radius: 12px; background: #fff; color: #0a0a0a;
  font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.vault-signin:hover { opacity: 0.85; }
.vault-signin:active { transform: scale(0.97); }
.vault-signin > svg { width: 16px; height: 16px; flex-shrink: 0; }
.vault-signin > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) {
  .vault-out-title { font-size: 30px; line-height: 36px; letter-spacing: -0.9px; }
}

/* ───────────── connected hero (3.11, 7.3) ───────────── */
.vh { margin-bottom: 24px; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--card); }
.vh-banner { position: relative; height: 160px; }
.vh-fill { position: absolute; inset: 0; overflow: hidden; background: #101112; }
.vh-midline { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(255, 255, 255, 0.035); }
.vh-mark { position: absolute; right: 7%; top: 50%; width: auto; height: 96px; transform: translateY(-50%); opacity: 0.035; }

.vh-stats {
  position: absolute; right: 12px; bottom: 12px; z-index: 1; display: flex; max-width: calc(100% - 24px); margin: 0;
  overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; background: rgba(0, 0, 0, 0.68);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.vh-stats.is-top { top: 12px; bottom: auto; }
.vh-stat { flex: 0 1 auto; min-width: 76px; padding: 8px 10px; }
.vh-stat + .vh-stat { border-left: 1px solid rgba(255, 255, 255, 0.1); }
.vh-stat-label {
  display: flex; align-items: center; gap: 4px; min-width: 0;
  font-size: 8px; line-height: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.55);
}
.vh-stat-label > svg { width: 12px; height: 12px; flex-shrink: 0; color: rgba(255, 255, 255, 0.65); }
.vh-stat-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-stat-value {
  margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #fff;
}
.vh-stat-value.is-muted { color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.vh-sk { display: inline-block; width: 52px; height: 12px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); vertical-align: middle; animation: pulse 2s var(--ease-pulse) infinite; }

.vh-id { position: relative; padding: 0 16px; }
.vh-avatar {
  position: absolute; left: 16px; top: -48px; display: block; width: 96px; height: 96px; overflow: hidden;
  border: 4px solid var(--card); border-radius: 50%; background: #101211; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}
.vh-avatar > svg { display: block; width: 100%; height: 100%; }
.vh-row { display: flex; flex-direction: column; gap: 12px; padding: 56px 0 16px; min-width: 0; }
.vh-name-block { min-width: 0; }
.vh-name { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--fg); overflow-wrap: anywhere; }
.vh-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 4px; margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--muted); }
.vh-meta-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.vh-meta-item > svg { width: 14px; height: 14px; flex-shrink: 0; }
.vh-meta-item > span { min-width: 0; overflow-wrap: anywhere; }
.vh-meta .btn-link { font-size: 14px; line-height: 20px; }
.vh-meta a.vh-meta-item { min-height: 24px; color: var(--muted); transition: color var(--dur-fast) var(--ease); }
.vh-meta a.vh-meta-item:hover { color: var(--fg); }
.vh-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.vh-tabs { border-top: 1px solid var(--border); padding: 0 16px; }
.vh-tab { position: relative; display: inline-flex; padding: 12px 16px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--fg); }
.vh-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: var(--radius-pill); background: linear-gradient(90deg, #157848, #2fbf73, #157848); }

@media (min-width: 640px) {
  .vh-banner { height: 192px; }
  .vh-mark { height: 128px; }
  .vh-stats { right: 24px; bottom: 16px; max-width: calc(100% - 48px); }
  .vh-stats.is-top { top: 16px; }
  .vh-stat { min-width: 96px; padding: 10px 12px; }
  .vh-stat-label { font-size: 9px; line-height: 13.5px; }
  .vh-stat-value { font-size: 16px; line-height: 24px; }
  .vh-id, .vh-tabs { padding: 0 24px; }
  .vh-avatar { left: 24px; top: -64px; width: 128px; height: 128px; }
  .vh-row { flex-direction: row; align-items: flex-end; justify-content: space-between; padding: 16px 0 16px 144px; }
  .vh-name { font-size: 24px; line-height: 32px; }
}
@media (min-width: 768px) {
  .vh-banner { height: 224px; }
  .vh-mark { height: 144px; }
  .vh-row { padding-left: 160px; }
}
@media (min-width: 1024px) {
  .vh-id, .vh-tabs { padding: 0 32px; }
  .vh-avatar { left: 32px; }
}

/* ───────────── body ───────────── */
.vault-body { padding: 0 16px 32px; min-width: 0; }
@media (min-width: 640px) { .vault-body { padding: 0 24px 32px; } }
@media (min-width: 1024px) { .vault-body { padding: 0 32px 32px; } }

.vault-alert {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 8px; margin-bottom: 16px; min-width: 0;
  border: 1px solid rgba(255, 101, 104, 0.2); border-radius: 12px; background: rgba(255, 101, 104, 0.07); padding: 10px 12px;
  font-size: 13px; line-height: 20px; color: #ffcaca;
}
.vault-alert > svg { width: 16px; height: 16px; flex-shrink: 0; }
.vault-alert-text { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }

/* ───────────── unrevealed pulls ───────────── */
.vp { margin-bottom: 24px; }
.vp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 16px; row-gap: 4px; margin-bottom: 12px; }
.vp-title { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--fg); }
.vp-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-bright);
  font-size: 11px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.vp-sub { min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.vp-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1024px) { .vp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vp-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 12px; min-width: 0;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 12px;
}
.vp-row.is-ready { border-color: rgba(47, 191, 115, 0.35); }
.vp-media { position: relative; width: 48px; height: 84px; overflow: hidden; border-radius: 6px; background: var(--secondary); }
.vp-media > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vp-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vp-pack { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.vp-pack > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-pack > .vp-rarity { flex-shrink: 0; }
.vp-card { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--fg); }
.vp-card.is-muted { font-weight: 500; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.vp-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px; min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.vp-line > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-variant-numeric: tabular-nums; }
.vp-line svg { width: 12px; height: 12px; flex-shrink: 0; }
.vp-deadline.is-soon { color: #ffd236; }
.vp-deadline.is-late { color: #ff6568; }
.vp-sk { display: block; width: 60%; height: 12px; margin: 4px 0; border-radius: 4px; background: var(--secondary); animation: pulse 2s var(--ease-pulse) infinite; }
.vp-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.vp-actions .btn { flex: 1 1 150px; }
.vp-actions .btn > [data-spin] { display: inline-flex; flex-shrink: 0; overflow: visible; }
.vp-status { grid-column: 1 / -1; margin-top: -4px; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.vp-status.is-error { color: #ffa3a3; }
@media (min-width: 640px) { .vp-actions .btn { flex: 0 1 auto; } }

.rar-common { color: #94a3b8; }
.rar-uncommon { color: #22d3ee; }
.rar-rare { color: #7dd3fc; }
.rar-epic { color: #ffd36b; }
.vp-rarity { font-size: 10px; line-height: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

/* ───────────── toolbar (3.12) ───────────── */
.vt { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; min-width: 0; }
.vt .search { height: 36px; border-color: var(--border); background: var(--card); }
.vt-search-m { display: flex; }
.vt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.vt-seg { display: inline-flex; align-items: center; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--secondary); }
.vt-seg-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 100%; padding: 0 12px; border-radius: 6px;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.vt-seg-btn:hover { color: var(--fg); }
.vt-seg-btn[aria-selected="true"] { background: var(--accent-strong); color: #fff; }
.vt-views [data-vt-view="compact"] { display: none; }
.vt-right { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.vt-search-d { display: none; flex: 1 1 auto; }
.vt-btn { gap: 6px; }
.vt-btn .vt-btn-label { display: none; }
.vt-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--accent-strong); color: #fff; font-size: 10px; line-height: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
@media (max-width: 639.98px) { .vt-btn { min-width: 36px; padding: 0 10px; } }
@media (min-width: 640px) {
  .vt-search-m { display: none; }
  .vt-search-d { display: flex; }
  .vt-right { flex: 1 1 360px; }
  .vt-btn .vt-btn-label { display: inline; }
}
@media (min-width: 768px) { .vt-views [data-vt-view="compact"] { display: inline-flex; } }

.vt-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.vt-meta-left { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 6px; min-width: 0; }
.vt-count { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vt-from { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.vt-from-label { font-size: 10px; line-height: 15px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-80); }
.vt-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; max-width: 100%; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--card);
  font-size: 10px; line-height: 15px; font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.vt-chip:hover { border-color: var(--fg-30); color: var(--fg); }
.vt-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-strong); color: #fff; }
.vt-chip > svg { width: 10px; height: 10px; flex-shrink: 0; }
.vt-chip-n { font-variant-numeric: tabular-nums; }
.vt-clear { font-size: 12px; line-height: 16px; }

/* ───────────── card grid (3.13) ───────────── */
.vg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 640px) { .vg { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .vg { grid-template-columns: repeat(4, minmax(0, 1fr)); } .vg.is-compact { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .vg { grid-template-columns: repeat(5, minmax(0, 1fr)); } .vg.is-compact { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .vg { grid-template-columns: repeat(6, minmax(0, 1fr)); } .vg.is-compact { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

.vc {
  position: relative; min-width: 0; overflow: hidden; container-type: inline-size;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
  animation: vc-in 0.4s ease-out both; animation-delay: calc(var(--i, 0) * 50ms);
}
@keyframes vc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.vc-hit { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; border-radius: inherit; }
.vc-hit:focus-visible { outline-offset: -2px; }
.vc-media { position: relative; z-index: 1; aspect-ratio: 3 / 4; overflow: hidden; background: var(--secondary); }
.vc-img { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 300ms var(--ease); }
.vc-img.fit-contain { object-fit: contain; padding: 12px; }
.vc-img.fit-cover { object-fit: cover; }
.vc-fail { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted-50); }
.vc-fail > svg { width: 32px; height: 32px; }
.vc-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px; min-width: 0; }
.vc-title {
  display: -webkit-box; min-height: 35px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 14px; line-height: 17.5px; font-weight: 500; color: var(--fg); overflow-wrap: anywhere;
}
.vc-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; min-height: 22px; }
.vc-origin { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vc-rdot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--muted-50); }
.vc-rdot.is-common { background: #64748b; }
.vc-rdot.is-uncommon { background: #22d3ee; }
.vc-rdot.is-rare { background: #7dd3fc; }
.vc-rdot.is-epic { background: #ffd36b; }
.vc-origin-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 15px; color: var(--muted); }
.vc .grade { flex-shrink: 1; min-width: 0; }
.vc-raw { flex-shrink: 0; font-size: 10px; line-height: 15px; color: var(--muted); }
@media (hover: hover) {
  .vc:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(20, 20, 20, 0.8); }
  .vc:hover .vc-img { transform: scale(1.05); }
}

.vc-listed {
  position: absolute; left: 8px; top: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 16px);
  padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.75);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.15); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.vc-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 6px rgba(47, 191, 115, 0.6); }
.vc-listed-price { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.vc-sell {
  position: absolute; right: 8px; top: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 16px); min-height: 26px;
  padding: 4px 10px; border: 1px solid rgba(47, 191, 115, 0.35); border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 11px; line-height: 16px; font-weight: 600; color: #8bc4a5; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.vc-sell:hover { background: rgba(6, 34, 20, 0.92); }
.vc-sell:active { transform: scale(0.97); }
.vc-sell > svg { width: 12px; height: 12px; flex-shrink: 0; }
.vc-sell-ico { display: none; }
.vc-sell-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
@container (max-width: 189.98px) {
  .vc-sell-word { display: none; }
  .vc-sell-ico { display: block; }
}
@container (max-width: 119.98px) {
  .vc-sell { width: 28px; height: 28px; min-height: 28px; padding: 0; justify-content: center; }
  .vc-sell-val { display: none; }
  .vc-listed { padding: 5px; }
  .vc-listed-price { display: none; }
  .vc-body { padding: 8px; }
  .vc-title { font-size: 12px; line-height: 15px; min-height: 30px; }
  .vc-origin-label { display: none; }
}

.vc-sk { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.vc-sk-media { aspect-ratio: 3 / 4; background: var(--secondary); animation: pulse 2s var(--ease-pulse) infinite; }
.vc-sk-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.vc-sk-line { height: 12px; border-radius: 4px; background: var(--secondary); animation: pulse 2s var(--ease-pulse) infinite; }
.vc-sk-line.is-short { width: 55%; }

/* ───────────── list view ───────────── */
.vl-wrap { --table-min-w: 780px; }
.vl td, .vl th { white-space: nowrap; }
.vl td { font-size: 12px; line-height: 16px; }
.vl-open { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 340px; min-height: 44px; text-align: left; color: var(--fg); border-radius: 6px; }
.vl-open:hover .vl-name { text-decoration: underline; text-underline-offset: 3px; }
.vl-thumb { width: 32px; height: 44px; flex-shrink: 0; border-radius: 4px; background: var(--secondary); object-fit: contain; }
.vl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; font-weight: 500; }
.vl-status { display: inline-flex; align-items: center; gap: 6px; }
.vl-status .vc-dot { box-shadow: none; }

/* ───────────── empty states (3.14) ───────────── */
.vault-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 16px; text-align: center; min-width: 0; }
.vault-empty-ico { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--secondary); color: var(--muted); }
.vault-empty-ico > svg { width: 32px; height: 32px; }
.vault-empty-title { margin-top: 16px; font-size: 18px; line-height: 28px; font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }
.vault-empty-text { max-width: 384px; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.vault-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }

/* ───────────── card detail modal (3.15, 7.3) ───────────── */
.vd-root .modal-overlay { background: rgba(0, 0, 0, 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vd-root .modal-panel.vd-panel {
  display: flex; flex-direction: column; width: 1024px; max-width: 100%; max-height: calc(100dvh - 32px); overflow: hidden;
  border-radius: 16px; padding: 0;
}
.vm-root .modal-panel:focus, .vd-root .modal-panel:focus { outline: none; }
.vd-head { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.vd-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vd-count { font-size: 14px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vd-step, .vd-close {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 6px; color: var(--fg); transition: background-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.vd-step:hover, .vd-close:hover { background: var(--secondary); }
.vd-step:disabled { opacity: 0.35; pointer-events: none; }
.vd-step > svg { width: 18px; height: 18px; }
.vd-close > svg { width: 20px; height: 20px; }
.vd-side {
  position: absolute; top: 50%; z-index: 1; display: none; align-items: center; justify-content: center; width: 48px; height: 48px; margin-top: -24px;
  border-radius: 50%; background: rgba(20, 20, 20, 0.8); color: #fff; transition: background-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.vd-side:hover { background: var(--secondary); }
.vd-side:disabled { opacity: 0.35; pointer-events: none; }
.vd-side > svg { width: 24px; height: 24px; }
.vd-side.is-prev { left: 16px; }
.vd-side.is-next { right: 16px; }
@media (min-width: 1200px) {
  .vd-side { display: inline-flex; }
  .vd-step { display: none; }
}
.vd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); }
.vd-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 16px; background: rgba(31, 31, 31, 0.5); }
.vd-frame { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1; }
.vd-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.vd-note { display: flex; align-items: flex-start; justify-content: center; gap: 6px; max-width: 420px; margin-top: 12px; font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }
.vd-note > svg { width: 12px; height: 12px; margin-top: 2px; flex-shrink: 0; }
.vd-content { min-width: 0; padding: 20px 16px 28px; }
.vd-origin {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: rgba(31, 31, 31, 0.5); font-size: 14px; line-height: 20px; font-weight: 500;
}
.vd-origin > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-bright); }
.vd-origin > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-title { margin-top: 12px; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--fg); overflow-wrap: anywhere; }
.vd-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.vd-tile { min-width: 0; max-width: 100%; padding: 12px; border-radius: 8px; background: rgba(31, 31, 31, 0.5); }
.vd-tile-label { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.vd-tile-value { margin-top: 4px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.vd-owner { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; background: rgba(31, 31, 31, 0.3); padding: 12px; }
.vd-owner-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 8px; row-gap: 6px; }
.vd-owner-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 10px; line-height: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.vd-owner-label > svg { width: 14px; height: 14px; flex-shrink: 0; }
.vd-listed-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
  font-size: 10px; line-height: 15px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.vd-listed-pill .vc-dot { box-shadow: none; }
.btn-sellback { width: 100%; margin-top: 10px; background: #2fbf73; color: #01331d; }
.btn-sellback:hover { background: #8bc4a5; }
.btn-sellback[aria-disabled="true"]:hover { background: #2fbf73; }
.btn > [data-spin], .btn > [data-ico] { display: inline-flex; flex-shrink: 0; overflow: visible; }
.vd-reason { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.vd-reason > svg { width: 12px; height: 12px; margin-top: 2px; flex-shrink: 0; }
.vd-owner-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vd-owner-row .btn { flex: 1 1 140px; }
.vd-float { margin-top: 10px; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.vd-sec { margin-top: 20px; min-width: 0; }
.vd-sec-title { margin-bottom: 4px; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.vd-rows { margin: 0; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; }
.vd-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; min-height: 36px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.vd-row:last-child { border-bottom: 0; }
.vd-row > dt { flex-shrink: 0; color: var(--muted); }
.vd-row > dd { min-width: 0; margin: 0; text-align: right; color: var(--fg); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.vd-link { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; max-width: 100%; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.vd-link:hover { color: var(--accent-bright); }
.vd-link > svg { width: 12px; height: 12px; flex-shrink: 0; }

@media (min-width: 640px) {
  .vd-head { padding: 16px 24px; }
  .vd-content { padding: 24px 24px 32px; }
  .vd-frame { max-width: 360px; }
}
@media (min-width: 768px) {
  .vd-body { grid-template-columns: minmax(0, 531fr) minmax(0, 491fr); min-height: 500px; }
  .vd-stage { align-self: stretch; }
  .vd-frame { max-width: 500px; }
}
@media (max-width: 639.98px) {
  .vd-root.is-sheet .modal-panel.vd-panel { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
}

/* ───────────── sell back and price dialogs (3.16) ───────────── */
.vm-root .modal-panel.vm-panel { width: 100%; padding: 24px; }
@media (min-width: 640px) { .vm-root .modal-panel.vm-panel { width: 448px; } }
.vm-top { display: flex; align-items: flex-start; gap: 16px; min-width: 0; padding-right: 32px; }
.vm-thumb { width: 64px; height: 96px; flex-shrink: 0; border-radius: 6px; background: var(--secondary); object-fit: contain; padding: 4px; }
.vm-head { min-width: 0; }
.vm-title { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.vm-desc { display: -webkit-box; margin-top: 4px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.vm-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--accent-highlight); overflow-wrap: anywhere; }
.vm-note > svg { width: 14px; height: 14px; margin-top: 1px; flex-shrink: 0; }
.vm-box { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; background: rgba(31, 31, 31, 0.25); padding: 16px; }
.vm-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; row-gap: 2px; min-width: 0; font-size: 14px; line-height: 20px; }
.vm-line + .vm-line { margin-top: 8px; }
.vm-line > dt, .vm-line > .vm-label { color: var(--muted); }
.vm-line > dd, .vm-line > .vm-value { margin: 0; min-width: 0; color: var(--fg); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.vm-total { margin-top: 12px !important; padding-top: 12px; border-top: 1px solid var(--border); }
.vm-total > dt { color: var(--fg); font-weight: 500; }
.vm-big { font-size: 20px; line-height: 28px; font-weight: 600; color: var(--accent-bright) !important; }
.vm-sub { margin-top: 4px; text-align: right; font-size: 11px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vm-warn { margin-top: 12px; border: 1px solid rgba(255, 210, 54, 0.25); border-radius: 8px; background: rgba(255, 210, 54, 0.06); padding: 8px 12px; font-size: 12px; line-height: 16px; color: #fee685; overflow-wrap: anywhere; }
.vm-error { margin-top: 12px; text-align: center; font-size: 12px; line-height: 16px; color: #ffa3a3; overflow-wrap: anywhere; }
.vm-status { margin-top: 8px; min-height: 16px; text-align: center; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.vm-cta { width: 100%; height: 44px; margin-top: 20px; }
.vm-keep { width: 100%; height: 36px; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.vm-keep:hover { color: var(--fg); }
.vm-field { margin-top: 20px; }
.vm-input-wrap {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; min-width: 0;
  border: 1px solid var(--input); border-radius: 6px; background: var(--secondary);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.vm-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(42, 158, 101, 0.35); }
.vm-input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; line-height: 24px; color: var(--fg); font-variant-numeric: tabular-nums; }
.vm-input:focus, .vm-input:focus-visible { outline: none; }
.vm-input:disabled { opacity: 0.5; }
.vm-unit { flex-shrink: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); }
.vm-hint { min-height: 16px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.vm-hint.is-error { color: #ffa3a3; }
.vm-fine { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.vm-fine > svg { width: 12px; height: 12px; margin-top: 2px; flex-shrink: 0; }
.vm-sep { margin-top: 20px; border-top: 1px solid var(--border); }
.vm-danger { color: #ffa3a3; }
.vm-danger:hover { color: #ffcaca; }
@media (max-width: 639.98px) {
  .vm-root.is-sheet .modal-panel.vm-panel { padding: 20px 16px 24px; }
}

/* ───────────── sort sheet ───────────── */
.vs-root .modal-panel.vs-panel { width: 100%; padding: 16px; }
@media (min-width: 640px) { .vs-root .modal-panel.vs-panel { width: 360px; } }
.vs-title { padding: 4px 36px 8px 4px; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--fg); }
.vs-list { display: flex; flex-direction: column; gap: 2px; }
.vs-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; padding: 0 12px;
  border-radius: 8px; text-align: left; font-size: 14px; line-height: 20px; color: var(--fg-80);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.vs-opt:hover { background: var(--secondary); color: var(--fg); }
.vs-opt > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-opt > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-bright); visibility: hidden; }
.vs-opt[aria-checked="true"] { background: var(--accent-soft); color: var(--fg); font-weight: 500; }
.vs-opt[aria-checked="true"] > svg { visibility: visible; }

/* ───────────── filters drawer ───────────── */
.vf-sec { padding: 16px 0; border-bottom: 1px solid var(--border); }
.vf-sec:first-child { padding-top: 0; }
.vf-sec:last-child { border-bottom: 0; }
.vf-sec .field-label { margin-bottom: 10px; }
.vf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vf-chips .vt-chip { font-size: 12px; line-height: 16px; min-height: 30px; padding: 0 12px; }
.vf-checks { display: flex; flex-direction: column; gap: 2px; }
.vf-checks .check-row { min-height: 32px; }
.vf-empty { font-size: 12px; line-height: 16px; color: var(--muted); }
.vf-foot { display: flex; align-items: center; gap: 8px; }
.vf-foot .btn-fill { flex: 1 1 auto; }
