.sales-filters{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:1rem;align-items:end;margin:1.5rem 0}
.sales-filters label{display:flex;flex-direction:column;gap:.4rem;font-size:.85rem;font-weight:650}
.sales-filters input,.sales-filters select{box-sizing:border-box;width:100%;min-height:42px;padding:.55rem .7rem;border:1px solid var(--line,#344052);border-radius:8px;background:var(--panel,#121a28);color:var(--text,#f5f6f8);font:inherit}
.sales-filter-actions{grid-column:1/-1;display:flex;gap:.75rem;flex-wrap:wrap}
.sales-table-wrap{width:100%;overflow-x:auto;border:1px solid var(--line,#344052);border-radius:12px}
.sales-table{border-collapse:collapse;width:100%;min-width:900px;font-size:.9rem;text-align:left}
.sales-table th{font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}
.sales-table th,.sales-table td{padding:1rem;border-bottom:1px solid var(--line,#344052);vertical-align:top}
.sales-table tbody tr:last-child td{border-bottom:0}
.sales-table small{display:block;margin-top:.35rem;color:var(--muted,#aab4c7);font-size:.78rem;line-height:1.4}
.sales-table details{max-width:310px}.sales-table details p{margin:.65rem 0;line-height:1.45;overflow-wrap:anywhere}
.sales-table summary{cursor:pointer}.sales-table a{overflow-wrap:anywhere}
.sales-table .sales-source-list{display:flex;flex-direction:column;gap:.4rem;margin-bottom:.5rem}
.sales-printing-link{font-weight:700}.sales-table .sales-price{white-space:nowrap;font-weight:650}
.sales-product{display:flex;gap:1rem;align-items:flex-start;min-width:290px}
.sales-product-description{min-width:0;max-width:300px;line-height:1.45}
.sales-product-image{flex:0 0 112px;width:112px;margin:0;text-align:center}
.sales-product-image a{display:block;border-radius:8px;outline-offset:4px}
.sales-product-image img{display:block;width:112px;height:156px;object-fit:contain;border-radius:8px;background:#080d12}
.sales-product-image figcaption{margin-top:.45rem;color:var(--muted,#aab4c7);font-size:.7rem;line-height:1.3}
.sales-image-unavailable{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:112px;height:156px;padding:.7rem;border:1px solid var(--line,#344052);border-radius:8px;color:var(--muted,#aab4c7);font-size:.75rem}
.sales-pagination{display:flex;gap:1rem;justify-content:center;align-items:center;padding:1.5rem 0}
#sales-identity{padding:.8rem 1rem;border:1px solid var(--line,#344052);border-radius:8px}
.card-documented-sales{grid-column:1/-1;min-width:0;margin:1rem 0;padding:1rem 0;border-top:1px solid var(--line,#344052)}
.card-documented-sales h3{margin-top:0}.sales-version-select{display:flex;flex-direction:column;gap:.5rem;max-width:340px;margin:1rem 0}.sales-version-select select{padding:.55rem .7rem;min-height:42px;border:1px solid var(--line,#344052);border-radius:8px;background:var(--panel,#121a28);color:var(--text,#f5f6f8);font:inherit}
@media(max-width:760px){.sales-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.sales-pagination{gap:.5rem;flex-wrap:wrap}}
@media(max-width:400px){.sales-filters{grid-template-columns:1fr}}

.sales-history-link{display:block;margin-top:8px;font-size:12px}.sales-table [data-sale-serial]{margin-top:9px}.sales-table [data-sale-condition]>small,.sales-table [data-sale-serial]>small{font-weight:600}

.sales-table-wrap { container: sale-history / inline-size; }
.sales-field-label { display: none; }

/* The archive and the card dialog can have different widths on the same screen. */
@container sale-history (max-width: 900px) {
  .sales-table, .sales-table tbody { display: block; }
  .sales-table { min-width: 0; }
  .sales-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sales-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "date price"
      "printing printing"
      "venue specimen"
      "evidence evidence";
    align-items: start;
    gap: .8rem 1rem;
    padding: 1rem;
  }
  .sales-table tbody tr + tr { border-top: 1px solid var(--line, #344052); }
  .sales-table td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .sales-date-cell { grid-area: date; }
  .sales-printing-cell { grid-area: printing; }
  .sales-venue-cell { grid-area: venue; }
  .sales-price-cell { grid-area: price; text-align: right; }
  .sales-specimen-cell { grid-area: specimen; }
  .sales-evidence-cell { grid-area: evidence; }

  .sales-field-label, .sales-table [data-sale-condition] > small {
    display: block;
    margin: 0 0 .2rem;
    color: var(--muted, #aab4c7);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.4;
  }
  .sales-table .sales-price {
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: normal;
  }
  .sales-product { min-width: 0; gap: .8rem; }
  .sales-product-description, .sales-table details { max-width: none; }
  .sales-product-image { flex: 0 0 4.5rem; width: 4.5rem; }
  .sales-product-image img, .sales-image-unavailable { width: 100%; height: auto; aspect-ratio: 112 / 156; }
}
