.piece { max-width: 1200px; margin: 0 auto; }
.piece-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.piece-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--sb-gold-deep);
    font-weight: 600; font-size: 14px; }
.piece-back:hover { color: var(--sb-gold); }

.piece-split { display: flex; gap: 24px; align-items: flex-start; }
.piece-source { flex: 0 0 34%; max-width: 360px; position: sticky; top: 16px; }
.piece-source-media { width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
    background: linear-gradient(135deg, #e9dcc3, #d8c7a2); border: 1px solid var(--sb-border); }
.piece-source-media img { width: 100%; height: 100%; object-fit: contain; }
.piece-source-title { font-family: var(--sb-font-serif); font-size: 22px; margin: 14px 0 8px; color: var(--sb-ink); }
.piece-source-specs { font-size: 13.5px; line-height: 2; }
.piece-source-specs > div span { color: var(--sb-taupe); display: inline-block; min-width: 74px; }

.piece-suggest { flex: 1; min-width: 0; }
.piece-toggle { display: inline-flex; border: 1px solid var(--sb-border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.piece-toggle-btn { height: 42px; padding: 0 18px; border: 0; background: var(--sb-surface-2); color: var(--sb-taupe);
    font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.piece-toggle-btn.is-active { background: linear-gradient(135deg, var(--sb-gold), var(--sb-gold-deep)); color: #2b1e15; }
.piece-suggest-body .collector-matches { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Loading overlay while coordinating / look-alikes fetch (htmx-indicator: opacity 0→1 during request) */
.piece-suggest-wrap { position: relative; min-height: 120px; }
.piece-loading { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center;
    padding-top: 44px; gap: 8px; background: rgba(255,253,249,.72); pointer-events: none; z-index: 2;
    font-size: 14px; font-weight: 600; color: var(--sb-gold-deep); }
.piece-spinner { width: 18px; height: 18px; border: 2px solid var(--sb-gold); border-top-color: transparent;
    border-radius: 50%; animation: piece-spin .7s linear infinite; }
@keyframes piece-spin { to { transform: rotate(360deg); } }
.piece-toggle-btn.htmx-request { opacity: .6; }
/* suggestion cards are now links (they navigate to that piece's own /Piece page) */
a.collector-match { text-decoration: none; color: inherit; display: block; transition: border-color .15s ease; }
a.collector-match:hover { border-color: var(--sb-gold); }

@media (max-width: 760px) {
    .piece-split { flex-direction: column; }
    .piece-source { position: static; flex-basis: auto; max-width: none; width: 100%; }
    .piece-source-media { max-width: 320px; }
}

/* Blurb under the Coordinating / Look-alikes toggle explaining what each mode matches on. */
.piece-suggest-blurb { margin: 0 0 14px; font-size: 13px; color: var(--sb-taupe); line-height: 1.4; }
.piece-suggest-blurb i { color: var(--sb-gold-deep); margin-right: 4px; }

/* Coordinating & look-alikes suggestion cards — base styles (moved from collectors.css
   during the collector-modal redesign; this Piece surface is the only remaining user). */
.collector-coord-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.collector-coord-chip { height: 30px; padding: 0 12px; border: 1px solid var(--sb-border); border-radius: 999px;
    background: var(--sb-surface-2); color: var(--sb-ink); font-size: 12px; font-weight: 500; cursor: pointer;
    transition: border-color .15s ease, background .15s ease; }
.collector-coord-chip:hover { border-color: var(--sb-gold); }
.collector-coord-chip.is-active { background: linear-gradient(135deg, var(--sb-gold), var(--sb-gold-deep));
    color: #2b1e15; border-color: transparent; }
.collector-matches-msg { font-size: 12.5px; color: var(--sb-taupe); margin: 4px 0; }
.collector-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 4px; }
.collector-match { background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: 10px; padding: 8px; }
.collector-match-img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #fff; }
.collector-match-tag { font-size: 11px; color: var(--sb-taupe); margin-top: 4px; }
.collector-match-desc { font-size: 11.5px; color: var(--sb-ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.collector-match-price { font-size: 12.5px; font-weight: 600; color: var(--sb-ink); margin-top: 2px; }

/* ---- Coordinating facet bar ---------------------------------------------------------
   Tap targets stay >= 44px for the in-store iPad. */
.coord-facets { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.coord-facet { position: relative; }
.coord-facet > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 1px solid var(--sb-border); border-radius: 9px; background: var(--sb-surface-2); font-size: 12.5px; color: var(--sb-cocoa); }
.coord-facet > summary::-webkit-details-marker { display: none; }
.coord-facet.is-active > summary { border-color: var(--sb-gold-deep); background: rgba(194,163,107,.14); color: var(--sb-ink); font-weight: 600; }
.coord-facet-sel { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coord-facet > summary > i { font-size: 9px; color: var(--sb-gold-deep); }
.coord-facet-menu { position: absolute; z-index: 20; left: 0; margin-top: 4px; min-width: 220px; max-height: 60vh; overflow-y: auto; padding: 6px; border: 1px solid var(--sb-border); border-radius: 12px; background: var(--sb-surface-2); box-shadow: 0 14px 34px rgba(52,37,27,.18); }
.coord-facet-opt { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-family: var(--sb-sans); font-size: 13px; color: var(--sb-cocoa); text-align: left; }
.coord-facet-opt:hover { background: rgba(194,163,107,.12); }
.coord-facet-box { flex: 0 0 auto; width: 15px; height: 15px; border: 1px solid var(--sb-border); border-radius: 4px; background: #fff; }
.coord-facet-opt.is-on .coord-facet-box { background: var(--sb-gold-deep); border-color: var(--sb-gold-deep); }
.coord-facet-lbl { flex: 1 1 auto; }
.coord-facet-n { flex: 0 0 auto; font-size: 11px; color: var(--sb-taupe); }
.coord-facet-clear, .coord-facet-clearall { border: 0; background: transparent; cursor: pointer; font-family: var(--sb-sans); font-size: 12px; color: var(--sb-gold-deep); text-decoration: underline; padding: 8px; min-height: 36px; }
.coord-facet-clear { display: block; width: 100%; text-align: left; border-top: 1px solid var(--sb-border); margin-top: 4px; }
.coord-facet-count { margin: 0 0 10px; font-size: 12.5px; color: var(--sb-taupe); display: flex; align-items: center; gap: 8px; }

/* A facet that can no longer narrow anything keeps its place, greyed out and inert — removing it
   would reflow the bar and move the remaining buttons under a finger mid-tap. Same element and
   rules as an enabled one, so the geometry is identical. */
.coord-facet.is-disabled > summary { pointer-events: none; opacity: .45; cursor: default; }
