/* Baseball Card Vault — warm cream + deep navy + gold accent */
:root {
  --background: #FAF7F0;
  --foreground: #16202E;
  --card: #FFFFFF;
  --primary: #1E3A5F;
  --primary-fg: #FAF7F0;
  --secondary: #F0EBDF;
  --muted: #EFEAE0;
  --muted-fg: #5F6B7A;
  --accent: #C9A227;
  --accent-soft: #F4E8C4;
  --destructive: #C0392B;
  --border: #E2DCCD;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(22, 32, 46, .08), 0 4px 14px rgba(22, 32, 46, .06);
  --shadow-lg: 0 8px 30px rgba(22, 32, 46, .16);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ─── Top nav ─────────────────────────────────────────────────── */
.topnav {
  background: var(--primary);
  color: var(--primary-fg);
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 40;
}
.topnav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--primary-fg); }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 22px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.nav-links { display: flex; gap: 4px; margin-right: auto; }
.nav-links a {
  color: rgba(250, 247, 240, .75);
  padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: 14.5px;
}
.nav-links a:hover { color: var(--primary-fg); text-decoration: none; background: rgba(255,255,255,.08); }
.nav-links a.active { color: var(--accent); }
.nav-actions { display: flex; gap: 10px; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: filter .15s, background .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #2B2410; }
.btn-outline { background: transparent; color: inherit; border-color: currentColor; opacity: .9; }
main .btn-outline { color: var(--primary); border-color: var(--border); background: var(--card); }
.btn-accent { background: var(--primary); color: var(--primary-fg); }
.btn-danger { background: var(--destructive); color: #fff; }

/* ─── Page head / gallery ─────────────────────────────────────── */
main { min-height: 70vh; padding: 32px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 700; margin: 0; }
.page-sub { color: var(--muted-fg); margin: 4px 0 0; font-size: 14.5px; }

.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); }
.view-toggle button { border: 0; background: transparent; padding: 8px 13px; font-size: 16px; cursor: pointer; color: var(--muted-fg); }
.view-toggle button.active { background: var(--primary); color: var(--primary-fg); }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 28px; box-shadow: var(--shadow);
}
.filter-bar select, .filter-bar input, .form-grid input, .form-grid select, .form-grid textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--background); color: var(--foreground); font-size: 14px; font-family: inherit;
}
.search-input { flex: 1 1 220px; min-width: 180px; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.card-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
  color: inherit; display: flex; flex-direction: column;
}
.card-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.card-image { position: relative; aspect-ratio: 3 / 4.2; background: var(--secondary); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 44px; opacity: .35;
}
.card-placeholder.large { min-height: 320px; font-size: 64px; }
.qty-badge {
  position: absolute; top: 8px; right: 8px; background: var(--primary); color: var(--primary-fg);
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
}
.card-meta { padding: 12px 14px 14px; }
.card-name { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.card-sub { color: var(--muted-fg); font-size: 13px; margin-top: 2px; }
.card-tags, .profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: var(--muted); color: var(--muted-fg);
}
.tag-condition { background: var(--accent-soft); color: #6B5410; }
.tag-value { background: var(--primary); color: var(--primary-fg); }

/* List view */
.card-grid.list-view { grid-template-columns: 1fr; gap: 12px; }
.card-grid.list-view .card-item { flex-direction: row; align-items: center; }
.card-grid.list-view .card-image { width: 84px; min-width: 84px; aspect-ratio: 3/4.2; }
.card-grid.list-view .card-meta { display: flex; align-items: center; gap: 18px; flex: 1; padding: 10px 16px; }
.card-grid.list-view .card-name { min-width: 180px; }
.card-grid.list-view .card-tags { margin-top: 0; margin-left: auto; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 12px; opacity: .5; }
.empty-state h2 { font-family: var(--font-display); margin: 0 0 8px; }
.empty-state p { color: var(--muted-fg); margin: 0 0 20px; }

/* ─── Card profile page ───────────────────────────────────────── */
.breadcrumb { margin-bottom: 20px; font-size: 14px; }
.profile { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 40px; align-items: start; }
.profile-images { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-image { margin: 0; }
.profile-image img, .profile-image .card-placeholder {
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
  background: var(--card); width: 100%;
}
.profile-image figcaption { text-align: center; font-size: 12.5px; color: var(--muted-fg); margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }
.profile-name { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); margin: 0; line-height: 1.15; }
.profile-sub { color: var(--muted-fg); font-size: 16px; margin: 6px 0 0; }
.detail-list { margin: 26px 0; border-top: 1px solid var(--border); }
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.detail-row dt { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-fg); }
.detail-row dd { margin: 0; font-size: 15px; }
.profile-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ─── Stats page ──────────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); border-top: 3px solid var(--accent);
}
.stat-label { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-fg); }
.stat-value { font-family: var(--font-display); font-size: 34px; font-weight: 700; margin-top: 4px; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.chart-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.chart-panel h2 { font-family: var(--font-display); font-size: 19px; margin: 0 0 14px; }
.muted { color: var(--muted-fg); }
.rank-list { margin: 0; padding: 0 0 0 22px; }
.rank-list li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list a { font-weight: 600; }
.rank-value { margin-left: auto; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* ─── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22, 32, 46, .55); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; padding: 22px 24px 24px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h2 { font-family: var(--font-display); margin: 0; font-size: 24px; }
.modal-close { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted-fg); padding: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.image-drop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.image-drop {
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--background);
  min-height: 150px; display: flex; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s;
}
.image-drop:hover, .image-drop.dragover { border-color: var(--accent); }
.image-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-drop-wide { min-height: 120px; margin-bottom: 14px; }
.drop-hint { font-size: 13.5px; color: var(--muted-fg); padding: 12px; position: relative; z-index: 1; }
.image-drop img:not([hidden]) + .drop-hint { background: rgba(255,255,255,.85); border-radius: 8px; }

.extract-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.extract-status { font-size: 13.5px; color: var(--muted-fg); }
.extract-status.error { color: var(--destructive); }
.extract-status.ok { color: #2E7D32; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; }

.bulk-list { list-style: none; padding: 0; margin: 0; max-height: 280px; overflow-y: auto; }
.bulk-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.bulk-status { margin-left: auto; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--muted); color: var(--muted-fg); white-space: nowrap; }
.bulk-status.processing { background: var(--accent-soft); color: #6B5410; }
.bulk-status.done { background: #DFF0DF; color: #2E7D32; }
.bulk-status.failed { background: #FBE3E0; color: var(--destructive); }

/* ─── Footer ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted-fg);
  font-size: 13.5px; text-align: center;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 820px) {
  .topnav-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 8px; }
  .nav-actions { margin-left: auto; }
  .profile { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .card-grid.list-view .card-meta { flex-wrap: wrap; gap: 8px; }
  .brand-name { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ─── Tags ─────────────────────────────────────────────────────── */
.tag-label { background: #E7EDF5; color: #1E3A5F; }
.label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ─── Camera capture ──────────────────────────────────────────── */
.camera-btn {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  display: none;
}
@media (pointer: coarse) { .camera-btn { display: inline-flex; } }

/* ─── Image editor ────────────────────────────────────────────── */
.modal-editor { max-width: 760px; }
.editor-canvas-wrap { background: #101820; border-radius: 10px; overflow: hidden; }
#editorCanvas { display: block; touch-action: none; cursor: crosshair; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.editor-toolbar .btn { padding: 7px 12px; font-size: 14px; }
.editor-hint { font-size: 12.5px; color: var(--muted-fg); margin: 8px 0 0; }

/* ─── Rotate buttons on card page ─────────────────────────────── */
.icon-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  border-radius: 6px; padding: 2px 8px; font-size: 14px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:disabled { opacity: .5; cursor: wait; }
.rotate-btns { margin-left: 8px; display: inline-flex; gap: 4px; }
.profile-image img.zoomable { cursor: zoom-in; }

/* ─── Bulk list additions ─────────────────────────────────────── */
.bulk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.bulk-edit { font-size: 12px; }

/* ─── Value trend ─────────────────────────────────────────────── */
.value-trend {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin: 0 0 22px;
}
.value-trend h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 10px; }

/* ─── Lightbox ────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 15, 22, .92);
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; cursor: grab;
}
.lightbox-stage:active { cursor: grabbing; }
#lightboxImg {
  max-width: 90vw; max-height: 90vh; user-select: none; -webkit-user-drag: none;
  transition: transform .08s linear; will-change: transform;
}
.lightbox-close {
  position: absolute; top: 14px; right: 18px; z-index: 2;
  background: transparent; border: 0; color: #fff; font-size: 36px; cursor: pointer; line-height: 1;
}
.lightbox-controls {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; gap: 8px;
}
.lightbox-controls button {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px; padding: 8px 16px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.lightbox-controls button:hover { background: rgba(255,255,255,.25); }

/* ─── Inventory report ────────────────────────────────────────── */
.page-actions { display: flex; gap: 10px; }
.inv-set { margin-bottom: 30px; }
.inv-set-name {
  font-family: var(--font-display); font-size: 21px; margin: 0 0 10px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid var(--accent); padding-bottom: 6px;
}
.inv-set-meta { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.inv-table, .set-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  font-size: 14px; box-shadow: var(--shadow);
}
.inv-table th, .inv-table td, .set-table th, .set-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left;
}
.inv-table th, .set-table th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-fg); background: var(--secondary);
}
.inv-table .num, .set-table .num { text-align: right; white-space: nowrap; }
.inv-table tr:last-child td { border-bottom: 0; }
.inv-tags { color: var(--muted-fg); font-size: 13px; }
.inv-subtotal td { font-weight: 700; background: var(--accent-soft); color: #4C3D0E; }
.inv-grand {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
  background: var(--primary); color: var(--primary-fg); border-radius: var(--radius);
  padding: 18px 22px; margin-top: 8px;
}
.inv-grand-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.inv-grand-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.inv-printed-note { display: none; }
.chart-panel-wide { grid-column: 1 / -1; }
.panel-footnote { font-size: 13px; margin: 10px 0 0; }

/* Lightbox download link matches the control buttons */
.lightbox-controls a {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px; padding: 8px 16px; font-size: 15px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center;
}
.lightbox-controls a:hover { background: rgba(255,255,255,.25); text-decoration: none; }

/* ─── Print styles (inventory + general) ──────────────────────── */
@media print {
  .topnav, .site-footer, .no-print, .filter-bar, .view-toggle, .modal-overlay, .lightbox { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .inv-table, .set-table { box-shadow: none; }
  .inv-set { break-inside: avoid-page; }
  .inv-grand { background: #fff; color: #16202E; border: 2px solid #16202E; }
  .inv-printed-note { display: block; text-align: center; color: #5F6B7A; font-size: 12px; margin-top: 16px; }
  a { color: inherit; text-decoration: none; }
}

/* ─── Edit-stored-photo button in drop zones ──────────────────── */
.photo-edit-btn {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.photo-edit-btn:hover { border-color: var(--accent); }
.photo-edit-btn[hidden] { display: none; }

/* ─── Bulk pair mode + merge dialog ───────────────────────────── */
.pair-toggle {
  display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px;
  color: var(--muted-fg); margin: 0 0 14px; line-height: 1.45; cursor: pointer;
}
.pair-toggle input { margin-top: 2px; accent-color: var(--accent); }
.bulk-side { font-weight: 700; color: var(--primary); font-size: 11px; letter-spacing: .04em; }
.merge-explain { font-size: 14px; color: var(--muted-fg); margin: 0 0 12px; line-height: 1.5; }
.merge-search {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--background); font-size: 14px; font-family: inherit; margin-bottom: 8px;
}
.merge-select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  font-size: 14px; font-family: inherit; padding: 4px;
}
.merge-select option { padding: 7px 9px; border-radius: 5px; }
.merge-select option:checked { background: var(--primary); color: var(--primary-fg); }
.merge-select option:disabled { color: #B8B2A4; }

/* ─── Copies editor & display ─────────────────────────────────── */
.copies-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--background); }
.copies-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.copy-row:last-child { margin-bottom: 0; }
.copy-row-num { font-size: 12px; font-weight: 700; color: var(--muted-fg); width: 24px; }
.copy-cond { flex: 1; }
.copy-val { width: 110px; }
.copy-row select, .copy-row input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-size: 14px; font-family: inherit; }

.copies-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); margin: 18px 0 8px; }
.copies-panel h2 { font-family: var(--font-display); font-size: 17px; margin: 0 0 8px; }
.copies-list { list-style: none; margin: 0; padding: 0; }
.copies-list li { display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; align-items: baseline; }
.copies-list li:last-child { border-bottom: 0; }
.copy-num { font-weight: 700; color: var(--muted-fg); font-size: 12px; width: 26px; }
.copy-value { margin-left: auto; font-weight: 600; color: var(--primary); }
.copies-total { font-weight: 700; }
.copies-total .copy-value { color: var(--accent); }

/* ─── Nav badge & review page ─────────────────────────────────── */
.nav-badge { background: var(--accent); color: #2B2410; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; margin-left: 2px; }
.review-section-title { font-family: var(--font-display); font-size: 21px; margin: 26px 0 6px; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.review-hint { font-size: 13.5px; color: var(--muted-fg); margin: 6px 0 14px; }
.review-pair, .review-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.review-pair { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.review-vs { font-size: 26px; color: var(--muted-fg); }
.review-card { display: flex; gap: 12px; align-items: center; min-width: 220px; flex: 1; }
.review-card img, .review-noimg { width: 62px; height: 86px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--secondary); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.review-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-fg); writing-mode: vertical-rl; transform: rotate(180deg); }
.review-info { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.review-group-cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.review-pickable { cursor: pointer; border: 2px solid transparent; border-radius: 10px; padding: 8px; }
.review-pickable:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.review-pickable input { accent-color: var(--accent); }
@media (max-width: 720px) { .review-pair { flex-direction: column; align-items: stretch; } .review-vs { display: none; } .review-actions { margin-left: 0; } }

/* ─── Selective group merge ───────────────────────────────────── */
.review-group-title { font-family: var(--font-display); font-size: 18px; margin: 0 0 10px; }
.grp-check { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted-fg); cursor: pointer; white-space: nowrap; }
.grp-check input, .grp-keep { accent-color: var(--accent); }
.grp-keep-label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; margin-top: 2px; }
.review-pickable:has(.grp-sel:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ─── Review zoom + back-photo pick mode ──────────────────────── */
.review-card img.zoomable { cursor: zoom-in; }
.review-group-cards .review-card img,
.review-group-cards .review-noimg { width: 88px; height: 122px; }
.review-pair .review-card img { width: 88px; height: 122px; }
.grp-back-btn {
  margin-top: 4px; border: 1px solid var(--border); background: var(--card); color: var(--muted-fg);
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 7px; cursor: pointer; align-self: flex-start;
}
.grp-back-btn:hover { border-color: var(--accent); color: var(--foreground); }
.grp-back-btn.picking { background: var(--accent-soft); border-color: var(--accent); color: #6B5410; }
.back-source { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 10px; }
.back-ineligible { opacity: .45; }
.back-target-btn { margin-top: 6px; }
