/* Remove Duplicates from List (rd-): A-line orange for input/unique, petrol blue for duplicates found */
.rd-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rd-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

[data-rd-card="unique"] { --rd-tone: var(--line-a, var(--primary)); --rd-soft: var(--line-a-soft, var(--primary-soft)); }
[data-rd-card="dupes"] { --rd-tone: var(--line-b, var(--accent)); --rd-soft: var(--line-b-soft, var(--accent-soft)); }
[data-rd-card="once"] { --rd-tone: var(--text); --rd-soft: var(--soft); }

.rd-section-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--text); }
.rd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.rd-input-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.rd-input-card.card-body, .rd-card.card-body { padding: 16px; }
.rd-pane-head, .rd-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rd-count { padding: 0; background: none; color: var(--muted); font-family: "Overpass Mono", ui-monospace, monospace; font-size: 12px; flex: none; white-space: nowrap; }
.rd-file { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.rd-file .rd-ico { width: 12px; height: 12px; }
.rd-file-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn.rd-icon-btn { position: relative; flex: none; width: 40px; padding: 0; }
.rd-upload-btn { margin-left: auto; }
.btn.rd-upload-btn:hover:not(:disabled) { color: var(--line-a); }
.btn.rd-clear-btn:hover:not(:disabled) { color: var(--danger); }
.rd-input-card .textarea { min-height: 180px; }

.rd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.rd-split-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rd-toolbar .select { width: 160px; }
.rd-custom-sep { width: 140px; }

.rd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.rd-stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.rd-stat-val { margin: 0; font-family: "Overpass Mono", ui-monospace, monospace; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.rd-stat-label { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.rd-results-title { margin-bottom: 16px; }
.rd-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rd-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rd-card[data-rd-card="once"] { grid-column: 1 / -1; }
.rd-card-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; flex: none; white-space: nowrap; }
.rd-card-title::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--rd-tone); flex: none; }
.rd-card-count { min-width: 28px; justify-content: center; background: var(--soft); color: var(--text); font-family: "Overpass Mono", ui-monospace, monospace; font-size: 14px; flex: none; }
.rd-sort-btn { margin-left: auto; }
.btn.rd-sort-btn.is-active { background: var(--rd-soft); color: var(--rd-tone); }
.rd-copied-ico { color: var(--ok); }

.rd-list, .rd-empty { box-sizing: border-box; flex: 1; margin: 0; min-height: 120px; border-radius: var(--radius-sm); background: var(--bg); }
.rd-list {
  max-height: 300px; overflow-y: auto; padding: 12px 12px 12px 44px; list-style: none;
  font-family: "Overpass Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.rd-list li { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rd-list li + li { margin-top: 4px; }
.rd-list li::before { content: ""; position: absolute; top: 7px; left: -24px; z-index: 1; box-sizing: border-box; width: 10px; height: 10px; border: 3px solid var(--rd-tone); border-radius: 50%; background: var(--card); }
.rd-list li:not(:last-child)::after { content: ""; position: absolute; top: 12px; bottom: -14px; left: -20px; width: 3px; background: var(--rd-tone); }
.rd-dup-badge { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--rd-soft); color: var(--rd-tone); font-size: 12px; font-weight: 700; }
.rd-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }

@media (max-width: 640px) {
  .rd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-results { grid-template-columns: minmax(0, 1fr); }
  .rd-card[data-rd-card="once"] { grid-column: auto; }
  .btn.rd-icon-btn { width: 36px; }
  .rd-toolbar .select, .rd-custom-sep { width: 100%; }
}