/* redaction.css - redaction v2 panel and preview (audit A6).
 * Variables first, one dark override block (A12): every color pair below
 * keeps at least WCAG AA contrast against its background in both themes. */

:root {
  --redact-bg: #f6f3ec;
  --redact-border: #d8d2c4;
  --redact-text: #2b2a26;
  --redact-muted: #6b675c;
  --redact-accent: #8a6d3b;
  --redact-mask-bg: #efe8d8;
  --redact-mask-text: #6b5721;
  --redact-danger: #a33c2e;
  --redact-btn-bg: #efe9dc;
  --redact-btn-border: #c9c2b1;
}

body.dark {
  --redact-bg: #23211c;
  --redact-border: #3c382f;
  --redact-text: #e8e6df;
  --redact-muted: #a8a294;
  --redact-accent: #d9b46c;
  --redact-mask-bg: #35301f;
  --redact-mask-text: #e3c987;
  --redact-danger: #ef9a8d;
  --redact-btn-bg: #2e2b24;
  --redact-btn-border: #4a4536;
}

#redact-panel {
  border: 1px solid var(--redact-border);
  background: var(--redact-bg);
  color: var(--redact-text);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 13px;
}
#redact-panel[hidden] { display: none !important; }

.redact-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.redact-panel-title { font-weight: 600; }
.redact-beta-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--redact-accent);
  color: var(--redact-accent);
  border-radius: 3px;
  padding: 1px 5px;
}
.redact-panel-note { color: var(--redact-muted); margin-bottom: 8px; line-height: 1.4; }

/* ---- p11-4: modes, query, per-match keeps, pre-flight ---- */
.redact-mode { margin-bottom: 10px; }
.redact-mode-title, .redact-query-title { font-weight: 600; margin-bottom: 4px; }
.redact-mode-row { display: flex; align-items: baseline; gap: 8px; padding: 1px 0; cursor: pointer; }
.redact-mode-label { font-weight: 600; }
.redact-mode-hint { color: var(--redact-muted); font-size: 11.5px; }
.redact-none-warn {
  border-left: 3px solid var(--redact-danger);
  color: var(--redact-danger);
  padding: 4px 8px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.redact-query { margin: 10px 0; }
.redact-query-note { color: var(--redact-muted); margin-bottom: 4px; line-height: 1.4; }
.redact-query-input { width: 100%; box-sizing: border-box; }
.redact-preview-keep { display: flex; align-items: center; gap: 4px; margin-left: auto; cursor: pointer; }
.redact-preview-keep-label { color: var(--redact-muted); font-size: 11.5px; }

.redact-preflight { margin-top: 10px; }
.redact-preflight-toggle { font-size: 11.5px; }
.redact-preflight-head { margin: 8px 0 4px; color: var(--redact-muted); }
.redact-preflight-title { font-weight: 600; }
.redact-preflight-body {
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--redact-border);
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11.5px;
  line-height: 1.45;
}
/* the mask reads as a diff deletion: same colour language as the diff view,
 * without borrowing its alignment logic (see roadmap-notes/p11-4.md) */
.redact-preflight-mask {
  background: var(--diff-del-bg);
  color: var(--diff-del-text);
  border-radius: 2px;
  padding: 0 2px;
}

.redact-cat-list { display: grid; grid-template-columns: 1fr; gap: 2px; }
.redact-cat-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; cursor: pointer; }
.redact-cat-label { flex: 1 1 auto; }
.redact-cat-mask {
  background: var(--redact-mask-bg);
  color: var(--redact-mask-text);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 12px;
}

.redact-custom { margin-top: 10px; border-top: 1px dashed var(--redact-border); padding-top: 8px; }
.redact-custom-title { font-weight: 600; margin-bottom: 4px; }
.redact-custom-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.redact-custom-src { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.redact-custom-remove,
.redact-custom-add,
.redact-preview-export,
.redact-preview-cancel {
  background: var(--redact-btn-bg);
  border: 1px solid var(--redact-btn-border);
  color: var(--redact-text);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}
.redact-custom-form { display: flex; gap: 6px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.redact-custom-input, .redact-custom-label-input {
  background: var(--redact-bg);
  border: 1px solid var(--redact-btn-border);
  color: var(--redact-text);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}
.redact-custom-input { flex: 2 1 160px; }
.redact-custom-label-input { flex: 1 1 80px; }
.redact-custom-err { color: var(--redact-danger); font-size: 12px; }

#redact-preview {
  border: 1px solid var(--redact-border);
  background: var(--redact-bg);
  color: var(--redact-text);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 13px;
}
#redact-preview[hidden] { display: none !important; }
.redact-preview-list { max-height: 220px; overflow: auto; margin: 6px 0; }
.redact-preview-row { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.redact-preview-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.redact-preview-arrow { color: var(--redact-muted); }
.redact-preview-more { color: var(--redact-muted); padding-top: 4px; }
.redact-preview-actions { display: flex; gap: 8px; margin-top: 8px; }
.redact-preview-export { border-color: var(--redact-accent); color: var(--redact-accent); font-weight: 600; }
