/* The agent's provenance line — what it looked at before it answered.

   A chat answer is prose, and prose reads as considered. "You took about $4,200
   at Bastille" has no seam where a truncated query was, no place where a failed
   read shows, nothing to distinguish a figure from a floor. This is that seam,
   made visible: one collapsed line under each answer that used the hub's data,
   listing every tool that ran and how much of the table it actually got.

   Collapsed by default, because the answer is the thing he wants and the working
   is the thing he wants when he does not believe the answer. <details> does the
   opening; there is no script behind any of this.

   Colour, per HANDOFF rule 6: flat accents need no light-theme counterpart as
   fills or borders, but do as TEXT — raw --amber is about 2:1 on white and
   #E05A4A about 3.2:1, both under AA. So every accent used as text below carries
   a body.light-theme override, reusing the pair already established across
   js/links.js and js/assets.js: #9C5C08 for amber, #B03A2E for red. */

.agt-tools {
  align-self: flex-start;
  max-width: 90%;
  margin: -2px 0 2px;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--muted);
  border-left: 2px solid var(--glass-border);
  padding-left: .7rem;
}

.agt-tools > summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  padding: .15rem 0;
  user-select: none;
}

/* The default disclosure triangle sits badly against a left rule and is
   inconsistent between WebKit and Blink, so it is replaced with one that
   rotates. */
.agt-tools > summary::-webkit-details-marker { display: none; }
.agt-tools > summary::before {
  content: '▸';
  display: inline-block;
  width: 1em;
  transition: transform .15s ease;
  opacity: .7;
}
.agt-tools[open] > summary::before { transform: rotate(90deg); }
.agt-tools > summary:hover { color: var(--sand); }

/* A partial read or a failed one is the whole reason this line exists, so it
   announces itself while still shut. */
.agt-tools-warn > summary { color: var(--amber); }
body.light-theme .agt-tools-warn > summary { color: #9C5C08; }
.agt-tools-bad > summary { color: #E05A4A; }
body.light-theme .agt-tools-bad > summary { color: #B03A2E; }

.agt-tool-list { padding: .35rem 0 .2rem; display: flex; flex-direction: column; gap: 3px; }

.agt-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .5rem;
  align-items: baseline;
}

.agt-tool-name { color: var(--sand); }

/* The three verdicts a single lookup can carry. Dim is "this was fine";
   the other two are not, and are not allowed to look like it. */
.agt-dim { color: var(--muted); }

.agt-warn { color: var(--amber); }
body.light-theme .agt-warn { color: #9C5C08; }

.agt-bad { color: #E05A4A; }
body.light-theme .agt-bad { color: #B03A2E; }

/* A sentence that needs its own line — the Momento date warning, or the note
   that the loop stopped before it finished. */
.agt-tool-note {
  flex-basis: 100%;
  font-size: .72rem;
  line-height: 1.45;
  padding: .2rem 0 .1rem;
}

/* The panel is 100% wide on a phone (css/shell.css), where an unbroken tool
   name and its verdict would otherwise push the chat sideways. */
@media (max-width: 720px) {
  .agt-tools { max-width: 100%; }
  .agt-tool-row { flex-direction: column; gap: 0; }
}
