* { box-sizing: border-box; }
[hidden] { display: none !important; }
.hw-page { margin: 0; font-size: 16px; line-height: 1.5; }
.hw-page main { padding-top: 48px !important; }
.hw-header, .hw-dialog-header, .hw-results-head, .hw-actions, .hw-admin-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hw-header { padding-bottom: 32px; }
.hw-header h1 { font-size: clamp(40px, 6vw, 76px); margin: 0; }
.hw-header p { margin: 8px 0 0; }
.hw-kicker { font-size: 14px; font-weight: 700; }
.hw-page button { min-height: 42px; padding: 10px 16px; cursor: pointer; }
.hw-page button:disabled { cursor: default; }
.hw-page label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.hw-page input, .hw-page select, .hw-page textarea { font-size: 16px; padding: 10px; width: 100%; min-width: 0; }
.hw-page select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(135deg,var(--ink) 50%,transparent 50%); background-position: calc(100% - 17px) 50%,calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.hw-page textarea { resize: vertical; }
.hw-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; border-block: 1px solid var(--ink); padding: 24px 0; align-items: end; }
.hw-search { grid-column: span 2; }
.hw-admin-actions { justify-content: flex-start; flex-wrap: wrap; padding: 0 0 24px; }
.hw-import { width: 100%; max-width: 720px; }
.hw-import summary { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.hw-import button { margin-top: 12px; }
.hw-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.hw-card { position: relative; min-width: 0; max-width: 100%; flex: 0 0 auto; }
.hw-card button, .hw-card button:hover, .hw-card button:active { width: auto; max-width: 100%; display: block; border: none; border-radius: 0; padding: 0; background: transparent; color: inherit; box-shadow: none; }
.hw-card button:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.hw-card img { display: block; width: auto; max-width: 100%; height: 340px; object-fit: contain; background: transparent; transition: transform 160ms ease; }
.hw-card button:hover img { transform: translateY(-4px); }
.hw-cutout-pending { opacity: 0; }
.hw-card img.hw-cutout-pending { aspect-ratio: 2 / 3; }
@media (prefers-reduced-motion: reduce) { .hw-card img { transition: none; } .hw-card button:hover img { transform: none; } }
.hw-empty { text-align: center; padding: 64px 20px; }
.hw-empty h2 { font-size: 28px; }
.hw-collection-end { min-height: 1px; margin: 24px 0; text-align: center; }
.hw-collection-end p:empty { display: none; }
.hw-footnote, .hw-help { font-size: 14px; }
.hw-footnote { border-top: 1px solid var(--ink); padding-top: 20px; }
.hw-page dialog { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); width: min(960px,calc(100% - 32px)); max-height: 90dvh; padding: 28px; }
.hw-page dialog::backdrop { background: rgb(0 0 0 / 65%); }
.hw-dialog-header { align-items: flex-start; border-bottom: 1px solid var(--ink); padding-bottom: 16px; }
.hw-dialog-header h2, .hw-dialog-header p { margin: 0 0 6px; }
.hw-page fieldset { margin: 24px 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--ink); min-width: 0; }
.hw-page legend { font-weight: 800; font-size: 21px; padding-right: 14px; }
.hw-form-grid, .hw-photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hw-photo-slot { border: 1px solid var(--ink); padding: 16px; min-width: 0; }
.hw-photo-slot h3 { margin: 0 0 10px; }
.hw-photo-slot img { width: 100%; height: 230px; object-fit: contain; }
.hw-photo-slot label { margin-top: 16px; }
.hw-photo-slot input { font-size: 14px; }
.hw-inline { flex-direction: row !important; align-items: flex-start; margin-top: 12px; }
.hw-inline input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; accent-color: var(--ink); }
#camera { width: 100%; max-height: 50dvh; background: #000; margin: 12px 0; }
.hw-scan-feedback { border: 1px solid var(--ink); padding: 16px; margin-bottom: 16px; }
.hw-scan-feedback progress { width: 100%; height: 12px; accent-color: var(--ink); }
#scan-status { min-height: 3em; margin-bottom: 0; }
.hw-matches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.hw-match { border: 1px solid var(--ink); padding: 16px; }
.hw-match p { margin: 5px 0; font-size: 14px; }
.hw-match h3 { margin: 0 0 8px; font-size: 18px; }
.hw-match button { margin-top: 8px; }
.hw-reference-search { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 12px; }
.hw-reference-results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.hw-reference-card { border: 1px solid var(--ink); padding: 12px; min-width: 0; }
.hw-reference-card img { width: 100%; height: 200px; object-fit: contain; }
.hw-reference-card h3 { font-size: 17px; margin: 8px 0; }
.hw-reference-card p { font-size: 14px; }
.hw-reference-photos { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.hw-reference-photos button { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.hw-reference-photos button[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.hw-reference-photos img { width: 100%; height: 220px; object-fit: contain; }
.hw-reference-preview { display: block; width: 100%; max-height: 360px; object-fit: contain; }
#manual-capture summary { cursor: pointer; padding: 12px 0; text-decoration: underline; text-underline-offset: 4px; }
.hw-detail-photo { width: 100%; max-height: 50dvh; object-fit: contain; margin: 20px 0; }
.hw-detail-data { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.hw-detail-data div { border-top: 1px solid var(--ink); padding-top: 10px; overflow-wrap: anywhere; }
.hw-detail-data dt { font-size: 14px; }
.hw-detail-data dd { margin: 4px 0; font-weight: 700; }
.hw-actions { justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hw-reference-search { grid-template-columns: 1fr 1fr; }
  .hw-reference-search label:first-child { grid-column: span 2; }
  .hw-reference-results, .hw-reference-photos { grid-template-columns: 1fr 1fr; }
  .hw-filters { grid-template-columns: 1fr 1fr; }
  .hw-card img { height: 220px; }
  .hw-header { align-items: flex-start; flex-wrap: wrap; }
  .hw-page dialog { padding: 20px; }
}
@media (max-width: 480px) {
  .hw-reference-results { grid-template-columns: 1fr; }
  .hw-reference-photos img { height: 150px; }
  .hw-page main { width: calc(100% - 32px) !important; padding-top: 24px !important; }
  .hw-form-grid, .hw-photo-grid, .hw-matches { grid-template-columns: 1fr; }
  .hw-card img { height: 180px; }
  .hw-header h1 { font-size: 44px; }
}

/* Complete outlined labels: no downloadable or embedded font software. */
.hw-owned-count { position: absolute; top: 5px; left: -4px; z-index: 1; display: block; width: 76px; height: 48px; color: var(--ink); background: none; font-size: 36px; font-weight: 900; line-height: 48px; text-align: center; transform: rotate(-20deg); transform-origin: center; pointer-events: none; }
.hw-owned-count.hw-owned-art { background-color: var(--ink); mask: var(--counter-art) center / contain no-repeat; -webkit-mask: var(--counter-art) center / contain no-repeat; font-size: 0; }
@media (max-width:760px) { .hw-owned-count { width: 55px; height: 35px; font-size: 27px; line-height: 35px; top: 2px; } }
.hw-card-price { left: auto; right: -4px; transform: none; }
.hw-card-price::before { content: ''; position: absolute; z-index: -1; top: 50%; left: 50%; width: 120%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); transform: translate(-50%,-50%); }
.hw-price-label { display: block; width: 100%; height: 100%; }
.hw-card-price .hw-owned-art { background-color: var(--ink); font-size: 0; mask: var(--counter-art) center var(--price-position) / auto 10000% no-repeat; -webkit-mask: var(--counter-art) center var(--price-position) / auto 10000% no-repeat; }
.hw-hide-prices .hw-card-price, .hw-hide-prices #collection-valuation { display: none; }
.hw-valuation-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; padding-top: 24px; }
#collection-valuation { display: flex; flex-direction: column; }
#collection-value { font-size: 34px; line-height: 1.25; }
.hw-view-options { display: flex; flex-wrap: wrap; gap: 24px; }
.hw-view-options .hw-inline { margin: 0; align-items: center; min-height: 42px; }
#pricing-dialog { max-width: 640px; }
#price-progress { font-size: 14px; }
.hw-price-detail { border-block: 1px solid var(--ink); padding: 16px 0; margin: 20px 0; }
.hw-price-detail p { margin: 6px 0; }
.hw-price-candidates { display: grid; gap: 12px; margin-top: 12px; }
.hw-price-candidates button { text-align: left; }
