.reference-editor {
  width: 100%; min-height: 150px; padding: 0; border: 0; outline: none;
  color: var(--text, #e7eeeb); background: transparent; font: inherit;
  line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere;
  cursor: text; caret-color: var(--mint, #b4f2dd);
}
.reference-editor.is-empty::before {
  content: attr(data-placeholder); color: var(--muted, #82988e);
  pointer-events: none; white-space: pre-wrap;
}
.reference-editor:focus-visible { outline: none; }
.reference-chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 180px; padding: 3px 7px 3px 3px; margin: 0 3px;
  border: 1px solid var(--border); border-radius: 8px;
  background:var(--raised); color:var(--text); vertical-align: middle;
  font-size: .88em; font-weight: 600; line-height: 1.5;
  white-space: nowrap; user-select: all; cursor: default;
  box-shadow: 0 1px 2px #0002;
}
.reference-chip img {
  width: 25px; height: 25px; object-fit: cover; flex: 0 0 25px;
  border-radius: 4px; pointer-events: none;
}
.reference-chip > span { overflow: hidden; text-overflow: ellipsis; }
.image-field > .reference-editor {
  min-height: 180px; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: 12px; background:var(--input);
}
.image-field > .reference-editor:focus-visible { border-color: var(--accent); }
textarea[hidden] { display: none !important; }
@media (max-width: 640px) {
  .reference-editor { min-height: 145px; }
  .reference-chip { max-width: 130px; }
}

.reference-chip{position:relative;padding-right:20px;margin-right:5px;}.reference-chip-remove{position:absolute;right:-5px;top:-7px;display:grid;place-items:center;width:19px;height:19px;padding:0;border-radius:50%;background:var(--raised);color:var(--text);border:1px solid var(--border);font-size:15px;line-height:1;cursor:pointer;user-select:none;}.reference-chip-remove:hover{background:var(--danger);}.reference-chip-remove:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.reference-chip-remove:hover{color:var(--danger-ink,var(--accent-ink))}
