/* NAVO – Dubletten-Klärung: Hinweise, Gegenüberstellung, Sammel-Übersicht. Farben nur über die NAVO-Variablen (hell/dunkel). */
.dupx-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
}
.dupx-hint > .ic {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--warn);
  margin-top: 1px;
}
.dupx-hint > div:first-of-type {
  flex: 1;
  min-width: 0;
}
.dupx-hint.is-marked {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 22%, transparent);
}
.dupx-hint.is-marked > .ic {
  color: var(--info);
}
.dupx-hint-acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.dupx-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  font-size: 13px;
}
.dupx-banner > .ic {
  color: var(--warn);
  flex: none;
}
.dupx-banner > span {
  flex: 1;
}
.dupx-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 6px 0 0;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: var(--warn-soft);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.dupx-chip .ic {
  width: 14px;
  height: 14px;
  color: var(--warn);
}
.dupx-chip:hover {
  border-color: var(--warn);
}
.dupx-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 460px;
}
.dupx-toast button {
  background: none;
  border: 0;
  color: #93c5fd;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Ähnlichkeit in Worten + kleine Anzeige (nie nur Farbe: das Wort steht immer daneben) */
.dupx-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 12px;
}
.dupx-meter {
  display: inline-flex;
  gap: 2px;
}
.dupx-meter i {
  width: 6px;
  height: 10px;
  border-radius: 2px;
  background: var(--line-2);
}
.dupx-score.d2 .dupx-meter i:nth-child(-n + 1),
.dupx-score.d3 .dupx-meter i:nth-child(-n + 2),
.dupx-score.d4 .dupx-meter i:nth-child(-n + 3),
.dupx-score.d5 .dupx-meter i {
  background: var(--warn);
}
.dupx-score.d5 .dupx-meter i,
.dupx-score.d4 .dupx-meter i:nth-child(-n + 3) {
  background: var(--bad);
}
.dupx-score b {
  font-weight: 650;
}

.dupx-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dupx-tag.new {
  background: var(--accent-soft);
  color: var(--accent);
}
.dupx-tag.old {
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
kbd {
  font: 11px var(--font);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  color: var(--muted);
  background: var(--panel);
}

/* ---------- Gegenüberstellung ---------- */
.dupx-bg {
  padding: 18px;
}
.dupx {
  background: var(--panel);
  color: var(--text);
  border-radius: 16px;
  width: min(1480px, 100%);
  height: min(940px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}
.dupx-loading,
.dupx-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
}
.dupx-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.dupx-ht {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dupx-ht h2 {
  margin: 0;
  font-size: 17px;
}
.dupx-kind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.dupx-kind .ic {
  width: 15px;
  height: 15px;
}
.dupx-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dupx-seg {
  display: none;
}
.dupx-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.dupx-center {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.dupx.is-rec .dupx-center {
  overflow: auto;
}
.dupx-side {
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--panel-2);
}
.dupx-side h3 {
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dupx-why ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.dupx-why li {
  display: flex;
  gap: 7px;
  font-size: 13px;
  line-height: 1.4;
}
.dupx-why li .ic {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--warn);
}
.dupx-why-score {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dupx-why-score .dupx-score {
  font-size: 15px;
}
.dupx-why-score .dupx-meter i {
  width: 9px;
  height: 14px;
}
.dupx-note {
  margin: 10px 0 0;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--info-soft);
}
.dupx-cand-list {
  display: grid;
  gap: 6px;
}
.dupx-cand {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.dupx-cand.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.dupx-cand-t {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dupx-cand-s {
  display: flex;
  gap: 6px;
  align-items: center;
}
.dupx-counts > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}
.dupx-cnt {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* Werkzeugleiste + zwei Vorschauen */
.dupx-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.dupx-tool .btn .ic {
  width: 16px;
  height: 16px;
}
.dupx-z {
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.dupx-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
}
.dupx-pg {
  min-width: 90px;
  text-align: center;
}
.dupx-sync {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}
.dupx-panes {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.dupx-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dupx-pane + .dupx-pane {
  border-left: 1px solid var(--line);
}
.dupx-pane > header,
.dupx-rechead > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.dupx-pane.new > header {
  box-shadow: inset 0 3px 0 var(--accent);
}
.dupx-ph-t {
  flex: 1;
  min-width: 0;
  display: grid;
}
.dupx-ph-t b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.dupx-ph-t .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dupx-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
  padding: 12px;
  outline: none;
}
.dupx-pages {
  display: grid;
  gap: 14px;
  justify-items: center;
}
.dupx-pw {
  position: relative;
}
.dupx-page,
.dupx-img {
  display: block;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  max-width: none;
}
.dupx-pl {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}
.dupx-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.dupx-nopv {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 50px 10px;
  color: var(--muted);
  text-align: center;
}
.dupx-fields {
  border-top: 1px solid var(--line);
  max-height: 34%;
  overflow: auto;
  flex: none;
}
.dupx-fields > summary {
  cursor: pointer;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

/* Feld-für-Feld-Tabelle */
.dupx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dupx-table th,
.dupx-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.dupx-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
  font-size: 12px;
  color: var(--muted);
}
.dupx-fields .dupx-table thead th {
  top: 34px;
}
.dupx-table tbody th {
  width: 22%;
  color: var(--muted);
  font-weight: 550;
}
.dupx-table td {
  width: 34%;
  word-break: break-word;
}
.dupx-table tr.st-anders td:not(.dupx-st) {
  background: color-mix(in srgb, var(--warn-soft) 80%, transparent);
}
.dupx-table tr.st-nur_neu td:nth-of-type(1),
.dupx-table tr.st-nur_alt td:nth-of-type(2) {
  background: color-mix(in srgb, var(--info-soft) 85%, transparent);
}
.dupx-st {
  width: 10% !important;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.dupx-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-weight: 700;
  margin-right: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.dupx-mark.st-gleich {
  color: var(--ok);
}
.dupx-mark.st-anders {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}
.dupx-mark.st-nur_neu,
.dupx-mark.st-nur_alt,
.dupx-mark.st-aehnlich {
  color: var(--info);
}
.dupx-mark.st-info {
  color: var(--faint);
}
.dupx-table tr.st-aehnlich td:not(.dupx-st) {
  background: color-mix(in srgb, var(--info-soft) 55%, transparent);
}
.dupx-tool.one-page [data-page],
.dupx-tool.one-page .dupx-pg,
.dupx-tool.one-page .dupx-sep {
  display: none;
}
.dupx-hint .dupx-score {
  margin-left: 6px;
}
.dupx-pick label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}
.dupx-pick input {
  margin-top: 2px;
  flex: none;
}
.dupx-pick.on {
  box-shadow: inset 3px 0 0 var(--accent);
}
.dupx-pick.on span {
  font-weight: 600;
}
.dupx-recs {
  padding: 0 0 12px;
}
.dupx-rechead {
  display: grid;
  grid-template-columns: 22% 1fr 1fr 10%;
}
.dupx-rechead > header:first-child {
  grid-column: 2;
}
.dupx-rechead > header {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
.dupx-pickhint {
  margin: 10px 12px 4px;
}
.dupx-cards {
  display: none;
}

.dupx-foot {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  background: var(--panel);
}
.dupx-acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dupx-acts .btn kbd,
.dupx-step .btn kbd {
  margin-left: 6px;
}
.dupx-acts .btn.primary kbd {
  color: inherit;
  background: transparent;
  border-color: currentColor;
  opacity: 0.7;
}
.dupx-acts .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.dupx-acts-info {
  flex: 1;
  text-align: right;
}
.dupx-step {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}
.dupx-step ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.dupx-step-acts {
  display: flex;
  gap: 8px;
  flex: none;
  align-self: center;
}

/* ---------- Sammel-Übersicht ---------- */
.dupx-ov {
  display: grid;
  gap: 12px;
}
.dupx-ov-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dupx-ov-head > div {
  flex: 1;
}
.dupx-ov-head h2 {
  margin: 0 0 4px;
}
.dupx-ov-head p {
  margin: 0;
  max-width: 760px;
}
.dupx-filters {
  display: flex;
  gap: 10px 18px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.dupx-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dupx-fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.dupx-fchip .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.dupx-fchip b {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}
.dupx-fchip.on {
  border-color: var(--ink, var(--accent));
  background: var(--ink, var(--accent));
  color: var(--on-ink, #fff);
}
.dupx-fchip.on b,
.dupx-fchip.on .ic {
  color: inherit;
}
.dupx-keys kbd {
  margin: 0 2px;
}
.dupx-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  outline: none;
}
.dupx-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 260px auto;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.dupx-row:last-child {
  border-bottom: 0;
}
.dupx-row:hover {
  background: var(--panel-2);
}
.dupx-row.sel {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.dupx-pair {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.dupx-pair > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.dupx-pair b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
}
.dupx-pair .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dupx-rw {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.dupx-rw > .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dupx-none {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 28px 20px;
}
.dupx-none > .ic {
  width: 28px;
  height: 28px;
  color: var(--ok);
}
.dupx-more {
  padding: 10px 14px;
}
.dupx-hist {
  display: grid;
}
.dupx-hrow {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.dupx-hrow.undone {
  opacity: 0.6;
}
.dupx-draft {
  display: grid;
  gap: 12px;
}

/* ---------- Handy / App-Ansicht ---------- */
@media (max-width: 720px) {
  .dupx-bg {
    padding: 0;
    align-items: stretch;
  }
  .dupx {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .dupx-head {
    padding: 10px 12px;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .dupx-ht {
    flex: 1 1 0;
    order: 1;
    min-width: 0;
  }
  .dupx-ht h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dupx-head [data-x] {
    order: 2;
  }
  .dupx-head::after {
    content: '';
    order: 3;
    flex: 0 0 100%;
    height: 0;
  }
  .dupx-nav {
    order: 4;
  }
  .dupx-swap {
    order: 5;
    margin-left: auto;
  }
  .dupx-ht h2 {
    font-size: 15px;
  }
  .dupx-swap span {
    display: none;
  }
  .dupx-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
  }
  .dupx-seg button {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .dupx-seg button.on {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }
  .dupx-main {
    display: block;
    overflow: auto;
  }
  .dupx-center {
    border-right: 0;
    overflow: visible;
  }
  .dupx.is-files .dupx-center {
    height: 68vh;
  }
  .dupx-panes {
    grid-template-columns: 1fr;
  }
  .dupx-pane + .dupx-pane {
    border-left: 0;
  }
  .dupx.side-new .dupx-pane.old,
  .dupx.side-old .dupx-pane.new {
    display: none;
  }
  .dupx-sync {
    display: none;
  }
  .dupx-tool {
    gap: 4px;
    padding: 6px 8px;
  }
  .dupx-sep {
    display: none;
  }
  .dupx-fields {
    max-height: none;
  }
  .dupx-side {
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  .dupx.is-rec .dupx-table,
  .dupx.is-rec .dupx-rechead {
    display: none;
  }
  .dupx.is-rec .dupx-seg {
    display: none;
  }
  .dupx-cards {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
  }
  .dupx-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    display: grid;
    gap: 6px;
  }
  .dupx-card.st-anders {
    border-color: color-mix(in srgb, var(--warn) 45%, transparent);
    background: color-mix(in srgb, var(--warn-soft) 60%, transparent);
  }
  .dupx-card-h {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
  }
  .dupx-card-h .dupx-st-l {
    font-size: 12px;
    color: var(--muted);
  }
  .dupx-card-v {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    word-break: break-word;
  }
  .dupx-card-v.on span:last-child {
    font-weight: 600;
  }
  .dupx-fields .dupx-table tbody th {
    width: 30%;
  }
  .dupx-fields .dupx-st-l {
    display: none;
  }
  .dupx-foot {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .dupx-acts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .dupx-acts .btn {
    justify-content: center;
    white-space: normal;
    height: auto;
    min-height: 38px;
    padding: 6px 8px;
    text-align: center;
  }
  .dupx-acts .btn kbd {
    display: none;
  }
  .dupx-step {
    flex-direction: column;
  }
  .dupx-step-acts {
    align-self: stretch;
  }
  .dupx-step-acts .btn {
    flex: 1;
    justify-content: center;
  }
  .dupx-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .dupx-row .dupx-kind {
    grid-column: 1 / -1;
  }
  .dupx-row .dupx-pair {
    grid-column: 1 / -1;
  }
  .dupx-pair > div {
    flex-wrap: wrap;
    row-gap: 0;
  }
  .dupx-pair > div .small {
    flex-basis: 100%;
  }
  .dupx-pair b {
    max-width: calc(100% - 100px);
  }
  .dupx-row .dupx-rw {
    grid-column: 1;
  }
  .dupx-keys {
    display: none;
  }
  .dupx-hint {
    flex-wrap: wrap;
  }
  .dupx-hint-acts {
    width: 100%;
    justify-content: flex-end;
  }
  .dupx-hrow {
    grid-template-columns: 1fr auto;
  }
  .dupx-hrow > .dupx-kind {
    grid-column: 1 / -1;
  }
}
