/* Card artwork treatment ----------------------------------------------------
   Remote card artwork can be stored in rectangular files whose white square
   corners remain visible inside object-fit: contain. Keep the source URL and
   bitmap unchanged; mask the artwork itself to the physical-card silhouette.

   Collection cards and shopping product cards use large staging boxes, so the
   bitmap must keep its natural aspect ratio before clipping. Fixed-ratio small
   thumbnails can use their existing dimensions and the same rounded inset.

   PSA certificate scans and the dedicated market-lookup detail image are
   intentionally excluded because those surfaces can show slab scans, raw lookup
   imagery, or special zoomed/padded assets rather than collection card artwork. */
.collection-card .img-wrap {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.collection-card .img-wrap img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 320px;
}

.shop-product-card:not(.shop-lottery-product) .shop-product-image > img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.collection-card .img-wrap img,
.holding-card img,
.shop-hero-card img,
.shop-product-card:not(.shop-lottery-product) .shop-product-image > img,
.cart-item img,
.bid-product-summary img,
.collection-editor-dialog .collection-catalog-result img,
.collection-editor-dialog .collection-selected-card img,
.contribution-card-image {
  border-radius: 5.25%;
  clip-path: inset(0.35% round 5.25%);
}

/* High-value holdings link to the card's canonical SNKRDUNK page. */
.holding-card-link {
  margin: -4px;
  padding: 4px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.holding-card-link:hover,
.holding-card-link:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.holding-card-link:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

/* Daily portfolio contribution controls/table. */
.contribution-header,
.card-history-header {
  align-items: center;
  gap: 16px;
}

.contribution-select-shell,
.card-history-select-shell {
  width: min(100%, 380px);
  flex: 0 1 380px;
}

.contribution-select-shell select,
.card-history-select-shell select {
  width: 100%;
  max-width: 340px;
}

.contribution-table th:first-child,
.contribution-table td:first-child {
  min-width: 240px;
}

.contribution-card {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.contribution-card-link:hover strong,
.contribution-card-link:focus-visible strong {
  color: var(--accent-strong);
}

.contribution-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.contribution-card-image {
  width: 40px;
  height: 56px;
  flex: 0 0 auto;
  background: var(--bg-deep);
  object-fit: contain;
}

.contribution-card strong,
.contribution-card small,
.contribution-card em {
  display: block;
}

.contribution-card strong {
  color: var(--text);
}

.contribution-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.contribution-card em {
  width: max-content;
  margin-top: 4px;
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.card-history-contribution {
  color: var(--muted-strong);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .contribution-header,
  .card-history-header {
    align-items: stretch;
    flex-direction: column;
  }

  .contribution-select-shell,
  .card-history-select-shell {
    width: 100%;
    flex-basis: auto;
  }

  .contribution-select-shell select,
  .card-history-select-shell select {
    max-width: none;
  }
}
