.fh-ingestion { width: min(100% - 2rem, 52rem); margin: .75rem auto; padding: .85rem 1rem; border: 1px solid #b8ada1; border-radius: 12px; background: var(--surface-primary, #fffdf9); color: var(--text-primary, #252321); max-height: 38vh; overflow: auto; font-size: 13px; }
.fh-ingestion-heading, .fh-ingestion-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.fh-ingestion-heading strong { font-size: 16px; }
.fh-ingestion button { border: 1px solid #9c8a79; border-radius: 6px; padding: .25rem .6rem; cursor: pointer; background: transparent; color: inherit; }
.fh-ingestion button:hover { background: #8b6e5120; }
.fh-ingestion button:disabled { opacity: .5; cursor: wait; }
.fh-ingestion-help { margin: .5rem 0; color: var(--text-secondary, #625c55); }
.fh-ingestion-notice { padding: .45rem; background: #c38d3220; border-radius: 4px; }
.fh-ingestion-batch, .fh-ingestion-question { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid #b8ada170; }
.fh-ingestion-file { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; padding: .45rem 0; }
.fh-ingestion-file strong { overflow-wrap: anywhere; }
.fh-ingestion-file span { color: var(--text-secondary, #625c55); }
.fh-ingestion-question p { margin: .4rem 0; white-space: pre-wrap; }
.fh-ingestion-question button { margin-left: .5rem; }

.fh-ingestion-viewer { width: min(90vw, 64rem); max-height: 85vh; overflow: auto; border: 1px solid #9c8a79; border-radius: 12px; padding: 1.2rem; background: var(--surface-primary, #fffdf9); color: var(--text-primary, #252321); }
.fh-ingestion-viewer::backdrop { background: #0007; }
.fh-ingestion-viewer button { padding: .4rem .7rem; margin: .3rem; border: 1px solid #9c8a79; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.fh-ingestion-unit-list { display: flex; flex-wrap: wrap; max-height: 22vh; overflow: auto; }
/* An author `display` beats the UA's `[hidden] { display: none }`, so the rule
   above kept the unit list on screen after the citation view set hidden on it
   (observed on 3097, 2026-09-14). Anything this file gives a display to has to
   say what hidden means for it. */
.fh-ingestion-viewer [hidden] { display: none; }
.fh-ingestion-viewer pre { white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid #b8ada170; padding-top: 1rem; tab-size: 4; }

/* In a chat the materials ride in the conversation, not above the composer.
   With a file attached the send is ours: LibreChat writes no user message
   until the answer is delivered, so a box by the input was the only thing on
   screen for the whole wait, in the one place the reader was not looking.

   Right-aligned, because this is the reader's own side of the conversation -
   it stands where their message will stand, and answer-delivery derives that
   message's id from the question so the block can pin itself above the real
   row once it arrives. */
.fh-ingestion-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  width: 100%;
  max-width: 47rem;
  margin: 0.5rem auto;
  padding: 0;
  border: 0;
  background: none;
}

.fh-ingestion-inline .fh-ingestion-batch,
.fh-ingestion-inline .fh-ingestion-file,
.fh-ingestion-inline .fh-ingestion-question {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: right;
}

/* The chip is the whole attachment: an icon and a name, the way one reads
   anywhere else. Everything the panel showed beside it - byte counts, the
   retained-original flag, the unit tally - answered a question nobody was
   asking while they waited. */
.fh-ingestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 22rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-medium, rgba(127, 127, 127, 0.3));
  border-radius: 0.75rem;
  background: var(--surface-secondary, rgba(127, 127, 127, 0.08));
  font-size: 0.8125rem;
}

.fh-ingestion-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  opacity: 0.75;
}

.fh-ingestion-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One line under the chip, and it is the line that changes: a 20,737-unit
   document took an hour on 2026-09-13, and without this a reader cannot tell
   a slow file from a stopped one. */
.fh-ingestion-inline .fh-ingestion-stage {
  padding-right: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b6b6b);
}

/* A citation opened from the answer shows one line: where, then the words.
   The unit list stays in the DOM because the citation handler clicks its
   button to make the selection - it is hidden, not removed. */
.fh-ingestion-viewer-single pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.fh-ingestion-cite-mark {
  margin-right: 0.1rem;
  font-weight: 600;
  color: var(--text-secondary, #6b6b6b);
}
