/* Answer formatting shared by the Investigator and the Executive Advisor:
   the markdown tables the model emits, and the caret that marks a streaming
   answer as still arriving. */
.answer-table-wrap {
  max-width: 100%;
  margin: 18px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.answer-table-wrap:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
.answer-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.answer-table th,
.answer-table td {
  min-width: 10ch;
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--edge);
}
.answer-table th:first-child,
.answer-table td:first-child {
  min-width: 0;
  padding-left: 0;
}
.answer-table th:last-child,
.answer-table td:last-child {
  padding-right: 0;
}
.answer-table th {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.answer-table td {
  color: var(--muted);
}
.answer-table td:first-child {
  color: var(--text);
}
:is(.reply, .agent-answer-body) code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: var(--r-xs);
  padding: 2px 4px;
  overflow-wrap: anywhere;
  hyphens: none;
  text-align: left;
}
/* Identifiers share the available column width instead of setting its minimum. */
.answer-table :is(th, td) code {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* Shown only while tokens are still arriving: a finished answer and an answer
   paused mid-sentence look identical without it. */
.stream-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--ember, #ff7900);
  animation: stream-caret-blink 1s steps(2, start) infinite;
}

@keyframes stream-caret-blink {
  to {
    opacity: 0;
  }
}

/* With motion off the caret still marks the live end of the text; it simply
   holds steady instead of blinking. */
@media (prefers-reduced-motion: reduce) {
  .stream-caret {
    animation: none;
  }
}

/* Shown only when the backend answered without a model - a deterministic
   readout of the evidence rather than an analysis of it. Styled as a warning
   rather than prose so it is not mistaken for part of the answer. */
.answer-no-model {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 2px solid #ffa505;
  background: rgba(255, 165, 5, 0.08);
  color: #ffd9b0;
  font-size: 12px;
  line-height: 1.45;
}

/* A markdown rule (---) between sections of an answer. */
.answer-rule {
  border: 0;
  border-top: 1px solid var(--edge);
  margin: 14px 0;
}

/* A fenced code block (answer-format.js). The prompt uses one for a query, script or
   command the analyst will paste. It scrolls inside itself rather than widening the
   answer column. */
.answer-code-wrap {
  margin: 8px 0;
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  background: var(--surface-deep);
  overflow: hidden;
}
.answer-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 2px 12px;
  border-bottom: 1px solid var(--edge);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.answer-code-copy {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out);
}
.answer-code-copy:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
pre.answer-code {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  text-align: left;
  white-space: pre;
  -webkit-hyphens: manual;
  hyphens: manual;
}
/* The wrapper clips overflow, so the focus ring is drawn inside the block, not around it. */
pre.answer-code:focus-visible {
  outline-offset: -2px;
}
pre.answer-code code,
:is(.reply, .agent-answer-body) pre.answer-code code {
  padding: 0;
  border-radius: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: normal;
}
