/* Match the ledger's compact rows and category badges. */
body.review-page-body .review-list:has(.duplicate-review-card) {
  display: flex;
  flex-direction: column;
}

.review-card.duplicate-review-card {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-width: 0;
  max-height: 100%;
  padding: 24px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--theme-shadow-ink,rgb(31 42 46)) 4%, transparent);
}

.duplicate-review-introduction { flex-shrink: 0; margin-bottom: 12px; }

.duplicate-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.duplicate-review-label {
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--theme-accent, #88621b);
  background: var(--theme-raised, var(--kkaebu-gold-soft));
  font-size: 12px;
  font-weight: 700;
}

.duplicate-review-group-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.duplicate-review-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -.03em;
}

.duplicate-review-summary {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.duplicate-review-entries {
  min-height: 0;
  border-top: 1px solid var(--surface-line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.duplicate-review-entry {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-line);
}

.duplicate-entry-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  line-height: 1.5;
}

.duplicate-entry-heading > strong:first-child {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.duplicate-entry-amount {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.duplicate-entry-classification {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.duplicate-entry-classification :is(.records-category, .records-detail-badge) {
  justify-content: flex-start;
  min-height: 25px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.duplicate-entry-classification .records-category {
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
}

.duplicate-entry-classification .records-detail-badge {
  color: var(--muted);
  background: var(--theme-raised, #f2f5f4);
}

.duplicate-entry-category-pending { color: var(--theme-accent, #88621b); font-size: 11px; }

.duplicate-entry-memo {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.duplicate-entry-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.duplicate-entry-remove {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--theme-danger, #9c4d54);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.duplicate-entry-remove svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.duplicate-entry-remove:hover:not(:disabled) { background: var(--danger-soft); }

.duplicate-review-actions {
  display: grid;
  flex-shrink: 0;
  gap: 6px;
  padding-top: 14px;
}

.duplicate-review-action-hint {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  word-break: keep-all;
}

.duplicate-review-actions .duplicate-confirm-distinct {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  background: var(--kkaebu-mint-action);
  box-shadow: none;
  white-space: normal;
}

.duplicate-review-actions .review-skip-button {
  justify-self: center;
  min-height: 36px;
  padding: 6px 16px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.duplicate-review-card button:focus-visible {
  outline: 3px solid var(--kkaebu-mint-action);
  outline-offset: 3px;
}

.duplicate-review-card[aria-busy="true"] { opacity: .7; }
.duplicate-entry-remove:disabled { cursor: wait; }

@container kkaebu (max-width: 599px){
  body.fixed-mobile-page .review-card.duplicate-review-card { padding: 18px 16px 12px; }
  .duplicate-review-card h2 { font-size: 20px; }
  .duplicate-entry-heading { gap: 12px; font-size: 14px; }
  .duplicate-entry-amount { font-size: 15px; }
  .duplicate-review-entry { padding: 12px 0; }
}
