/* ===========================================================================
   /remove-duplicates
   ---------------------------------------------------------------------------
   Every rule is scoped under .rdx-page and every class is rdx- prefixed, so
   nothing here can reach the shared layout, the header/footer, or any other
   tool page. Colours come from the site's own theme tokens (--surface, --text,
   --line, --primary…) rather than a private palette, so this page follows the
   light/dark toggle automatically instead of needing its own dark block.
   =========================================================================== */

.rdx-page {
  --rdx-radius: 14px;
  --rdx-mono: "JetBrains Mono", ui-monospace, monospace;
  --rdx-display: "Archivo", system-ui, sans-serif;
  --rdx-ok: #0E9F6E;
  --rdx-warn: #D9820A;
  --rdx-bad: #E4152B;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

.rdx-wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding: 34px 22px 70px; }
@media (max-width: 640px) { .rdx-wrap { padding-inline: 15px; } }

.rdx-page .rdx-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── hero ──────────────────────────────────────────────────────── */

.rdx-hero { margin-bottom: 26px; }
.rdx-eyebrow {
  font-family: var(--rdx-mono); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--primary); margin: 0 0 12px;
}
.rdx-hero h1 {
  font-family: var(--rdx-display); font-weight: 800; letter-spacing: -1.1px;
  font-size: clamp(30px, 4vw, 44px); line-height: 1.08; margin: 0;
}
.rdx-hero h1 span { display: block; }
.rdx-hero h1 .rdx-b { color: var(--text); }
.rdx-hero h1 .rdx-g { color: var(--primary); }

.rdx-privacy {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin: 20px 0 0; padding: 14px 17px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--rdx-ok); border-radius: 12px;
}
.rdx-lock { color: var(--rdx-ok); flex-shrink: 0; margin-top: 2px; }
.rdx-privacy p { margin: 0; flex: 1; min-width: 240px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.rdx-privacy p b { color: var(--text); }
.rdx-tick { font-family: var(--rdx-mono); font-size: 11px; color: var(--rdx-ok); white-space: nowrap; }
.rdx-lede { margin: 18px 0 0; font-size: 15.5px; line-height: 1.7; color: var(--muted); max-width: 72ch; }

/* ── shared shell ──────────────────────────────────────────────── */

.rdx-console, .rdx-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--rdx-radius); overflow: hidden; margin-bottom: 16px;
}
.rdx-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 15px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.rdx-lbl { font-family: var(--rdx-mono); font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.rdx-mini { font-family: var(--rdx-mono); font-size: 11.5px; color: var(--muted); }
.rdx-sp { flex: 1; }

.rdx-btn {
  cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 600; transition: .15s;
}
.rdx-btn:hover { border-color: var(--primary); color: var(--primary); }
.rdx-btn-sm { padding: 6px 12px; font-size: 12.5px; }
.rdx-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  padding: 13px 26px; font-size: 15px; border-radius: 10px;
}
.rdx-primary:hover { filter: brightness(1.07); color: #fff; }

.rdx-page textarea {
  width: 100%; display: block; border: 0; resize: vertical; padding: 16px;
  font-family: var(--rdx-mono); font-size: 13.5px; line-height: 1.65;
  background: transparent; color: var(--text); min-height: 190px;
}
.rdx-page textarea:focus { outline: 0; }
.rdx-page textarea.is-invalid { background: rgba(228, 21, 43, .06); }
#rdx-output { min-height: 210px; background: var(--bg); }

.rdx-source-note {
  margin: 0; padding: 0 16px 12px; font-family: var(--rdx-mono);
  font-size: 11.5px; color: var(--primary);
}

/* ── drag & drop ───────────────────────────────────────────────── */

.rdx-console.is-over { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.rdx-console.is-over::after {
  content: "Drop your file to load it"; position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  font-weight: 700; color: var(--primary); border-radius: var(--rdx-radius);
}
.rdx-console { position: relative; }

/* ── table mode ────────────────────────────────────────────────── */

.rdx-table-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.rdx-table-head > div:first-child { flex: 1; min-width: 200px; }
.rdx-table-head b { display: block; font-size: 14.5px; color: var(--text); }
.rdx-table-head span {
  display: block; margin-top: 2px; font-family: var(--rdx-mono);
  font-size: 11.5px; color: var(--muted);
}
.rdx-check-inline { align-items: center; }
.rdx-check-inline b { font-size: 13px; }

.rdx-columns {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.rdx-col {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px 6px 10px;
  background: var(--surface); font-size: 13px; transition: .15s;
}
.rdx-col:hover { border-color: var(--primary); }
.rdx-col input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.rdx-col:has(input:checked) { border-color: var(--primary); color: var(--primary); font-weight: 600; }

.rdx-table-scroll { overflow-x: auto; max-height: 340px; overflow-y: auto; }
.rdx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rdx-table th, .rdx-table td {
  text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--line);
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.rdx-table th {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  font-family: var(--rdx-mono); font-size: 11px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.rdx-table td { font-family: var(--rdx-mono); color: var(--text); }
/* The compared columns are tinted so the effect of the tick boxes is visible
   in the data itself, not just in the control above it. */
.rdx-table th.is-key, .rdx-table td.is-key {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}
.rdx-table th.is-key { color: var(--primary); }
.rdx-table-hint { margin: 0; padding: 11px 16px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ── options ───────────────────────────────────────────────────── */

.rdx-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px;
  padding: 16px; border-top: 1px solid var(--line); background: var(--bg);
}
.rdx-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.rdx-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.rdx-check span { display: block; min-width: 0; }
.rdx-check b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.rdx-check em {
  display: block; font-style: normal; font-size: 12px; color: var(--muted);
  line-height: 1.5; margin-top: 2px;
}
.rdx-check code, .rdx-page .tool-content-section code, .rdx-page .tool-faq code {
  font-family: var(--rdx-mono); font-size: 11.5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
.rdx-select { display: flex; flex-direction: column; gap: 5px; }
.rdx-select > span {
  font-family: var(--rdx-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.rdx-select select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  background: var(--surface); color: var(--text); font-size: 13.5px; cursor: pointer;
}
/* "Match by" carries an explanation that changes with the selection, so it gets
   the full row rather than sharing one with the checkboxes. */
.rdx-select-wide { grid-column: 1 / -1; }
.rdx-match-note {
  display: block; font-style: normal; font-size: 12px; color: var(--muted);
  line-height: 1.55; margin-top: 5px; max-width: 76ch;
}
.rdx-match-note code {
  font-family: var(--rdx-mono); font-size: 11.5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}

.rdx-run-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 0 16px 16px; background: var(--bg); }
.rdx-kbd-hint { font-size: 12.5px; color: var(--muted); }
.rdx-kbd-hint kbd {
  font-family: var(--rdx-mono); font-size: 11px; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface);
}

/* ── results ───────────────────────────────────────────────────── */

.rdx-verdict {
  display: flex; flex-direction: column; gap: 4px; padding: 15px 18px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--rdx-ok); border-radius: 12px;
}
.rdx-verdict b { font-size: 15.5px; font-weight: 600; color: var(--text); }
.rdx-verdict span { font-family: var(--rdx-mono); font-size: 11.5px; color: var(--muted); }

.rdx-statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .rdx-statgrid { grid-template-columns: repeat(2, 1fr); } }
.rdx-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 16px;
}
.rdx-stat b {
  display: block; font-family: var(--rdx-display); font-size: 28px;
  font-weight: 800; letter-spacing: -1px; color: var(--text); line-height: 1.1;
}
.rdx-stat span {
  display: block; margin-top: 4px; font-family: var(--rdx-mono); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.rdx-stat.is-good b { color: var(--rdx-ok); }
.rdx-stat.is-removed b { color: var(--rdx-bad); }

/* ── output format chips ───────────────────────────────────────── */

.rdx-formats {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 12px 15px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.rdx-formats-label {
  font-family: var(--rdx-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-right: 3px;
}
.rdx-chip {
  cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 99px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; transition: .15s;
}
.rdx-chip:hover { border-color: var(--primary); color: var(--primary); }
.rdx-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
/* The separator row sits under the textarea rather than in the format bar, so
   it reads as "how we split your input" rather than "how we format the output". */
.rdx-separators { border-bottom: 0; border-top: 1px solid var(--line); }
.rdx-chip-reset { border-style: dashed; }

.rdx-custom-wrap input {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; width: 130px;
  font-family: var(--rdx-mono); font-size: 12.5px; background: var(--surface); color: var(--text);
}

/* ── duplicate report ──────────────────────────────────────────── */

.rdx-dupes-list { list-style: none; margin: 0; padding: 6px 0; max-height: 460px; overflow-y: auto; }
.rdx-dupes-list li {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
}
.rdx-dupes-list li:last-child { border-bottom: 0; }
.rdx-dupe-value {
  font-family: var(--rdx-mono); font-size: 13px; color: var(--text);
  word-break: break-all; flex: 1; min-width: 150px;
}
.rdx-dupe-count {
  font-family: var(--rdx-mono); font-size: 11.5px; font-weight: 600;
  background: rgba(228, 21, 43, .1); color: var(--rdx-bad);
  border-radius: 99px; padding: 3px 10px; white-space: nowrap;
}
.rdx-dupe-removed { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rdx-variants { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.rdx-variants code {
  font-family: var(--rdx-mono); font-size: 11px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin-right: 4px;
}

/* ── toast ─────────────────────────────────────────────────────── */

.rdx-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--text); color: var(--bg); border-radius: 99px; padding: 10px 20px;
  font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60;
}
.rdx-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .rdx-page *, .rdx-toast { transition: none !important; }
}
