/* ── Quote chip drag-to-reorder (Phase D) ────────────────────────────────── */

.quote-chip-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  cursor: grab;
  color: oklch(var(--bc) / 30%);
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.1s;
  touch-action: none; /* required for pointer capture to work on touch */
}

.quote-chip-grip:hover {
  color: oklch(var(--bc) / 60%);
}

.quote-chip-grip:active {
  cursor: grabbing;
}

.quote-chip-grip svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.quote-chip.dragging {
  opacity: 0.35;
}

/* Placeholder div that holds space while a chip is being touch-dragged */
.quote-chip-placeholder {
  flex-shrink: 0;
  background: oklch(var(--bc) / 4%);
  border-radius: var(--radius);
  border: 1px dashed oklch(var(--bc) / 15%);
}

/* Drop-indicator line shown between chips during drag */
.quote-drop-indicator {
  height: 2px;
  margin: 0 0.5rem;
  background: oklch(var(--p));
  border-radius: 1px;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── Document card in user bubble (binary docs — PDF, DOCX, etc.) ─────────── */

.msg-doc-pill {
  display: block;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid oklch(var(--b3));
  background: oklch(var(--b1));
  max-width: 320px;
  overflow: hidden;
}

.msg-doc-pill-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: oklch(var(--b2));
  border-bottom: 1px solid oklch(var(--b3));
}

.msg-doc-pill-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: oklch(var(--p));
  flex-shrink: 0;
}

.msg-doc-pill-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(var(--bc));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.msg-doc-pill-footer {
  padding: 4px 10px;
  font-size: 0.7rem;
  color: oklch(var(--bc) / 60%);
}

/* ── Document card in user bubble ────────────────────────────────────────── */

.msg-doc-card {
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid oklch(var(--b3));
  background: oklch(var(--b1));
  overflow: hidden;
  cursor: pointer;
  max-width: 320px;
  transition: border-color 0.15s, max-width 0.2s ease;
  user-select: none;
}

.msg-doc-card.expanded {
  max-width: 100%;
}

.msg-doc-card:hover { border-color: oklch(var(--p) / 50%); }

.msg-doc-header {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: oklch(var(--b2));
  color: oklch(var(--bc));
  border-bottom: 1px solid oklch(var(--b3));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-doc-preview {
  padding: 6px 10px;
  font-size: 0.7rem;
  font-family: monospace;
  color: oklch(var(--bc) / 70%);
  white-space: pre;
  overflow: hidden;
  max-height: 6.5em;
  transition: max-height 0.25s ease;
  margin: 0;
}

.msg-doc-card.expanded .msg-doc-preview {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: auto;
  user-select: text;
}

/* ── Image lightbox overlay ──────────────────────────────────────────────── */

#img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#img-lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* ── Expandable image thumbnails ─────────────────────────────────────────── */

.msg-attachment-img {
  cursor: zoom-in;
}

.attach-thumb img {
  cursor: zoom-in;
}
