/* COMPARE tool page — two documents side by side. Sibling of redact.css:
   soft white cards on the page's light ground, one accent per side (A teal,
   B violet), everything scoped under .compare-page so nothing leaks. */

.compare-page .tool-form { max-width: 860px; margin: 0 auto; }

/* ---------------------------------------------------- the two upload slots */
.cmp-slots {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 8px 0 6px;
}
.cmp-slot .dropzone-inner { padding: 26px 18px; }
.cmp-slot-tag {
  display: inline-block; margin-bottom: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: #e8f5f1; color: #1f7a6d;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.cmp-tag-b { background: #f1ebfd; color: #6d4bc0; }
.cmp-slot-name { margin-top: 10px; font-weight: 600; color: #3c4d61; }
.cmp-slot.has-file { border-color: #bfe3d9; background: #fbfefd; }
.cmp-slot.is-b.has-file { border-color: #d9ccf6; background: #fdfcff; }

.cmp-bar {
  display: flex; align-items: center; gap: 14px; justify-content: center;
  margin: 16px 0 6px;
}

/* ---------------------------------------------------------- the results -- */
#cmp-workspace { max-width: 1080px; margin: 0 auto; }

.cmp-working {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 12px 15px;
  background: #fff; border: 1px solid #e3eaf2; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(23, 43, 66, .06);
  font-size: 13.5px; color: #3c4d61;
}
.cmp-working[hidden] { display: none; }
.cmp-working.cw-ok { border-color: #c3e5cf; background: #f4fbf6; color: #1e6b3f; }
.cmp-working.cw-err { border-color: #f0c4c4; background: #fff7f7; color: #a94442; }
.cw-spin {
  flex: 0 0 auto; width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid #cfe0f0; border-top-color: #1f7a6d;
  animation: cwspin .8s linear infinite;
}
.cmp-working.cw-ok .cw-spin, .cmp-working.cw-err .cw-spin { display: none; }
@keyframes cwspin { to { transform: rotate(360deg); } }

.cmp-stats {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  align-items: stretch; margin: 0 0 12px;
}
.cmp-stat-card {
  background: #fff; border: 1px solid #e3eaf2; border-radius: 12px;
  padding: 12px 16px; box-shadow: 0 8px 20px rgba(23, 43, 66, .05);
  display: flex; flex-direction: column; gap: 6px;
}
.cmp-card-a { border-top: 3px solid #2ea58e; }
.cmp-card-b { border-top: 3px solid #8e5bf1; }
.csc-title {
  font-size: 12.5px; font-weight: 650; color: #2f3f52;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch;
}
.csc-rows { display: flex; gap: 14px; font-size: 12.5px; color: #5d6f83; }
.csc-rows b { color: #1d2b3a; }
.cmp-verdict {
  align-self: center; padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: #fdeaea; color: #b04141; border: 1px solid #f3cdcd;
}
.cmp-verdict.cv-same { background: #eaf7f0; color: #1e6b3f; border-color: #c3e5cf; }

/* AI card */
.cmp-ai-card, .cmp-diff-card {
  background: #fff; border: 1px solid #e3eaf2; border-radius: 14px;
  padding: 14px 18px; margin: 0 0 12px;
  box-shadow: 0 10px 26px rgba(23, 43, 66, .06);
}
.cmp-ai-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.cmp-ai-head h3 { margin: 0; font-size: 15px; color: #1d2b3a; }
.cmp-ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: #f1ebfd; color: #6d4bc0;
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
}
.cmp-ai-note { margin-left: auto; }
.cmp-ai-summary { margin: 0 0 8px; font-size: 14px; color: #2f3f52; }
.cmp-ai-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.cmp-ai-list li {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 13px; color: #3c4d61;
}
.cmp-ai-list li .cai-chip {
  flex: 0 0 auto; margin-top: 1px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: #eef3f8; color: #51637a;
}
.cai-added { background: #eaf7f0 !important; color: #1e6b3f !important; }
.cai-removed { background: #fdeaea !important; color: #b04141 !important; }
.cai-changed { background: #fff4e0 !important; color: #a06a12 !important; }
.cai-moved { background: #eef3f8 !important; color: #51637a !important; }
.cmp-ai-empty { font-size: 13px; color: #5d6f83; margin: 4px 0 0; }

/* deterministic diff blocks */
.cmp-diff { display: flex; flex-direction: column; gap: 8px; }
.cmp-block {
  border: 1px solid #e6edf6; border-radius: 10px; overflow: hidden;
  font-size: 12.5px; font-family: inherit;
}
.cmp-line { padding: 5px 12px 5px 26px; position: relative; white-space: pre-wrap; }
.cmp-line::before {
  position: absolute; left: 9px; top: 5px; font-weight: 800;
}
.cmp-del { background: #fdf1f1; color: #8f3b3b; }
.cmp-del::before { content: "−"; color: #b04141; }
.cmp-add { background: #f1fbf6; color: #215c3d; }
.cmp-add::before { content: "+"; color: #217a45; }
.cmp-pagetag {
  display: inline-block; margin-right: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: #8296a9; text-transform: uppercase;
}

/* the two panes */
.cmp-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 16px; }
.cmp-pane {
  background: #fff; border: 1px solid #e3eaf2; border-radius: 14px;
  overflow: hidden; box-shadow: 0 10px 26px rgba(23, 43, 66, .06);
  display: flex; flex-direction: column;
}
.cmp-pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid #edf2f8;
  background: #fafcfe;
}
.cmp-pane-name {
  font-size: 12.5px; font-weight: 650; color: #2f3f52;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch;
}
.cmp-pane-nav { display: inline-flex; align-items: center; gap: 6px; }
.cmp-nav {
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  border: 1px solid #dbe3ec; background: #fff; color: #45566b;
  font-size: 15px; line-height: 1;
}
.cmp-nav:hover { border-color: #8ccbbd; color: #1f7a6d; }
.cmp-nav:disabled { opacity: .4; cursor: not-allowed; }
.cmp-page { font-size: 11.5px; font-weight: 700; color: #5d6f83; min-width: 44px; text-align: center; }
.cmp-pane-body {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10px; background: #f4f7fb; min-height: 260px;
}
.cmp-pane-body img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 14px rgba(15, 35, 60, .14); }

@media (max-width: 720px) {
  .cmp-slots, .cmp-panes { grid-template-columns: 1fr; }
  .cmp-stats { grid-template-columns: 1fr; }
  .cmp-verdict { justify-self: start; }
}
