/* Preview-only affordances for the contract iframe on /verify.
   Excluded from PDF export so nothing here reaches a real document. */

/* Marks text that came from a placeholder rather than the template's own wording,
   so a drafter can see at a glance which parts are data. */
.field-val {
  background-color: #fff9c4;
  border-radius: 2px;
  padding: 0 2px;
}

/* A known placeholder left empty. The exported .docx has nothing here, so neither
   does the preview — no token, no highlight. The Checks panel names the field.
   The span survives only so hovering its merge field still has a target. */
.field-val.is-blank {
  background-color: transparent;
  padding: 0;
}

/* A placeholder the builder does not know: shown as the {{token}} the exported
   .docx will actually contain, in red so it reads as unresolved, not as text. */
.field-val.is-unfilled {
  background-color: #fee2e2;
  color: #b91c1c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* Left in the document on purpose, to be completed by hand in Word. */
.field-val.is-manual {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px dashed #7dd3fc;
}

/* Applied by contract-preview.js when the drafter hovers the matching merge field. */
.preview-highlight {
  outline: 2px solid #0f5bcc;
  background-color: rgba(15, 91, 204, 0.07) !important;
  border-radius: 3px;
  transition: outline 0.15s, background-color 0.15s;
}

/* --------------------------------------------------------- hand editing -- */

/* Every addressed paragraph is editable. Kept visually quiet until pointed at:
   the preview must read as a document, not as a form. */
[data-edit][contenteditable] {
  cursor: text;
  border-radius: 2px;
}

[data-edit][contenteditable]:hover {
  outline: 1px dashed #c7cdd6;
  outline-offset: 2px;
}

[data-edit][contenteditable]:focus {
  outline: 2px solid #0f5bcc;
  outline-offset: 2px;
  background: rgba(15, 91, 204, 0.04);
}

/* Typed over: this paragraph no longer follows the template or the merge
   fields. Amber, matching how the builder marks departures elsewhere. */
[data-edit].is-edited {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #fcd34d;
}

/* An empty paragraph is a thin strip; give the caret somewhere to land. */
.doc-spacer[contenteditable] {
  min-height: 1em;
}

/* Floating per-paragraph revert, parked beside the hovered edited paragraph by
   contract-preview.js. A sibling of the text, never inside it. */
.edit-revert {
  position: absolute;
  z-index: 5;
  transform: translateY(-100%);
  padding: 0.15rem 0.5rem;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font: 600 0.7rem/1.4 system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.edit-revert:hover {
  background: #fef3c7;
}
