.preview-card { position: sticky; top: 20px; }
.preview-card .card-heading { margin-bottom: 12px; }
.reward-summary { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.reward-summary strong { font-size: 20px; line-height: 1.5; font-weight: 600; }
.reward-summary span { font-size: 12px; color: var(--muted); }
.preview-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(185px, .8fr); gap: 22px; align-items: start; }
.qr-view { min-width: 0; }
.preview-area { width: 100%; max-width: 340px; margin: 0 auto; aspect-ratio: 1; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); padding: 0; }
.preview-area img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; background: #fff; }
.empty-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; text-align: center; color: var(--muted); }
.empty-preview strong { font-size: 14px; font-weight: 400; }
.empty-preview span { font-size: 12px; line-height: 1.8; }
.preview-caption { min-height: 30px; display: flex; justify-content: center; align-items: center; font-size: 11px; color: var(--muted); }
.status-dot { display: none; }
.qr-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.qr-pager .button { padding: 8px 10px; min-width: 0; }
.qr-pager > span { font-size: 13px; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.usage-panel { border-left: 1px solid var(--line); padding-left: 22px; min-width: 0; }
.usage-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.usage-heading label { font-size: 13px; }
.usage-heading select { width: auto; min-height: 34px; padding: 6px 8px; font-size: 12px; }
.usage-status { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 20px 0 16px; }
.used-badge { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; background: #f5f4f1; color: #77716a; font-size: 12px; }
.used-badge.recorded { border-color: #bacbb9; color: #466342; background: #eff5ec; }
.usage-panel > .primary, #scan-mark-next { width: 100%; }
.skip-button { display: block; margin: 8px auto 0; }
.usage-panel > p { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.warnings { border-left: 2px solid #baa275; background: #faf7ef; padding: 10px 12px; margin-top: 18px; font-size: 12px; color: #7f6948; line-height: 1.8; overflow-wrap: anywhere; }
.warnings p { margin: 0; }
.warnings p + p { margin-top: 5px; }
.export-section { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-label { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.download-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.download-grid .button { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.loading .preview-area { opacity: .55; }
.history-card > p { font-size: 13px; line-height: 1.8; }
.history-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.history-list { list-style: none; padding: 0; margin: 18px 0 0; }
.history-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
.history-list strong { font-weight: 600; flex: 1; min-width: 150px; }
.history-list span, .history-list time { font-size: 12px; color: var(--muted); }
.scan-dialog { width: min(680px, calc(100vw - 24px)); max-width: 680px; max-height: calc(100dvh - 24px); }
.scan-dialog > img { display: block; width: min(100%, 490px); height: auto; margin: 18px auto; image-rendering: pixelated; background: #fff; }
.scan-dialog > p { text-align: center; font-size: 12px; color: var(--muted); }
.scan-usage-summary { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; margin-bottom: 16px; }
.scan-dialog .qr-pager { margin-bottom: 16px; }
@media (max-width: 1080px) {
  .preview-layout { grid-template-columns: 1fr; gap: 20px; }
  .qr-view { width: min(100%, 330px); margin: auto; }
  .usage-panel { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .usage-status { flex-direction: row; justify-content: space-between; align-items: center; margin: 14px 0; }
  .usage-panel > p { margin-top: 10px; }
  .usage-panel > p br { display: none; }
}
@media (max-width: 640px) {
  .preview-card { position: static; }
  .preview-layout { gap: 18px; }
  .qr-view { width: min(100%, 350px); }
  .export-section { align-items: flex-start; }
  .section-label { padding-top: 7px; }
  .scan-dialog { padding: 18px; }
}
