
/* ── the agent trace ──────────────────────────────────────────────────────
   Drawn as a run log, not as a chat bubble: one row per call, the narration
   above the call it explains, the outcome under it, and the arguments folded
   away. Muted by design - it sits above the answer and must not compete with
   it, so the only colour is the accent on the tool name and red on a call
   that failed. */
.ag{margin:2px 0 14px;border:1px solid var(--ag-b,#262b26);border-radius:8px;
  background:var(--ag-bg,#0a0c0a);overflow:hidden}
.ag[open]{box-shadow:inset 2px 0 0 var(--acc)}
.ag-sum{list-style:none;cursor:pointer;display:flex;align-items:center;gap:9px;
  flex-wrap:wrap;padding:7px 11px;font-family:var(--fm);font-size:10.5px;
  color:#8b9a8d;user-select:none}
.ag-sum::-webkit-details-marker{display:none}
.ag-sum::marker{content:""}
.ag-sum::before{content:"\25B8";color:var(--acc);flex:none;font-size:9px;
  transition:transform .15s;display:inline-block}
.ag[open] .ag-sum::before{transform:rotate(90deg)}
.ag-sum:hover{background:rgba(255,212,0,.05)}
.ag-sum-t{font-weight:700;letter-spacing:.11em;text-transform:uppercase;
  color:var(--acc-text,#ffd400)}
.ag-sum-n{color:#c3d0c4}
.ag-sum-ms{margin-left:auto;color:#6d7b6f;font-variant-numeric:tabular-nums}
.ag-chip{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;
  border:1px solid #2a2f2a;border-radius:20px;color:#8b9a8d;white-space:nowrap}
.ag-chip i{font-style:normal;color:var(--acc);font-size:10px}
.ag-chip.bad{border-color:#5c2b2b;color:#ff9b9b}
.ag-chip.bad i{color:#ff9b9b}
/* The rail: every step hangs off one vertical line, which is what makes a
   list of calls read as a single run rather than as six unrelated boxes. It
   is drawn once on the body rather than per step, because the narration sits
   between steps and a per-step rail leaves a gap wherever it does. */
.ag-body{padding:6px 11px 11px;border-top:1px solid #1d221d;
  display:grid;gap:2px;position:relative}
.ag-body::before{content:"";position:absolute;left:21px;top:18px;bottom:18px;
  width:1px;background:#20251f}
.ag-step{display:grid;grid-template-columns:18px 1fr;gap:9px;
  padding:6px 0 6px 2px;position:relative}
.ag-ic{position:relative;z-index:1;width:18px;height:18px;margin-top:1px;
  border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:9.5px;background:#11150f;border:1px solid #2c332c;color:#9fb0a1}
.ag-step.k-run .ag-ic,.ag-step.k-scan .ag-ic{color:var(--acc);border-color:#4a4420}
.ag-step.k-done .ag-ic{color:#6ee7a0;border-color:#2c4a35}
.ag-step.bad .ag-ic{color:#ff9b9b;border-color:#5c2b2b}
/* Not run. Set back rather than marked wrong: nothing here went wrong. */
.ag-step.skipped{opacity:.6}
.ag-step.skipped .ag-ic{color:#7d8a7f;border-color:#2c332c;background:transparent}
.ag-step.skipped .ag-verb{font-weight:400}
.ag-step.skipped .ag-target{text-decoration:line-through;opacity:.75}
.ag-res.ag-skip{font-style:italic}
.ag-chip.skip{border-style:dashed}
.ag-main{min-width:0}
.ag-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;
  font-family:var(--fm);font-size:11.5px}
.ag-verb{color:#dfe9e0;font-weight:700}
.ag-target{font-family:var(--fm);font-size:11px;color:var(--acc-text,#ffd400);
  background:rgba(255,212,0,.07);border:1px solid #2f3323;border-radius:4px;
  padding:0 5px;overflow-wrap:anywhere;min-width:0}
.ag-kind{font-size:9px;letter-spacing:.13em;text-transform:uppercase;
  color:#66755f;border:1px solid #242a23;border-radius:3px;padding:0 4px}
.ag-ms{margin-left:auto;font-family:var(--fm);font-size:10px;color:#5f6d61;
  font-variant-numeric:tabular-nums;flex:none}
.ag-res{font-family:var(--fm);font-size:11px;color:#8b9a8d;margin-top:2px;
  overflow-wrap:anywhere}
.ag-res.bad{color:#ff9b9b}
.ag-step.note .ag-ic{color:#f5b84a;border-color:#5c4a22}
.ag-res.note{color:#f5b84a}
/* The narration. This is the model's own sentence about what it is about to
   do, so it is set apart from the mechanical rows around it. */
.ag-say{font-family:var(--fm);font-size:11.5px;line-height:1.7;color:#b9c9bb;
  margin:8px 0 2px;padding:0 0 0 40px;position:relative}
/* A smaller node on the same rail: the reviewer said something, then it did
   something. */
.ag-say::before{content:"";position:absolute;left:18px;top:7px;width:7px;
  height:7px;border-radius:50%;background:#3a4a3c;
  box-shadow:0 0 0 3px var(--ag-bg,#0a0c0a)}
/* The sandbox console, under the step that ran it. Drawn as a terminal
   rather than as more trace rows: it is somebody else's output, and the
   monospace block is what makes a traceback readable as one. */
.ag-con{margin-top:5px}
.ag-con summary{list-style:none;cursor:pointer;font-family:var(--fm);
  font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);padding:2px 0}
.ag-con summary::-webkit-details-marker{display:none}
.ag-con summary::before{content:"\25b8 ";display:inline-block;
  transition:transform .15s}
.ag-con[open] summary::before{transform:rotate(90deg)}
.ag-con summary:hover{color:var(--acc-text)}
.ag-con.bad summary{color:var(--red)}
.ag-con-cmd{font-family:var(--fm);font-size:11.5px;color:var(--acc-text);
  padding:6px 10px 4px;overflow-wrap:anywhere}
.ag-con-out{font-family:var(--fm);font-size:11.5px;line-height:1.55;
  color:var(--text);background:var(--bg);border:1px solid var(--border);
  border-radius:7px;padding:9px 11px;margin:4px 0 0;
  max-height:340px;overflow:auto;white-space:pre-wrap;word-break:break-word}
.ag-con.bad .ag-con-out{border-color:color-mix(in srgb,var(--red) 45%,var(--border))}
.ag-args{margin-top:4px}
.ag-args summary{list-style:none;cursor:pointer;font-family:var(--fm);
  font-size:10px;color:#5f6d61;padding:1px 0}
.ag-args summary::-webkit-details-marker{display:none}
.ag-args summary:hover{color:var(--acc-text,#ffd400)}
/* A step that can be opened. The summary is the same row a plain step draws;
   the body is what it executed. Closed, the outcome stays on one line so a
   long run reads as a list; open, it wraps in full. */
details.ag-step{display:block;padding:0}
.ag-x-s{list-style:none;cursor:pointer;display:grid;grid-template-columns:18px 1fr;
  gap:9px;padding:6px 4px 6px 2px;border-radius:5px}
.ag-x-s::-webkit-details-marker{display:none}
.ag-x-s::marker{content:""}
.ag-x-s:hover{background:rgba(255,212,0,.05)}
.ag-x-s:focus-visible{outline:1px solid var(--acc);outline-offset:1px}
.ag-x-s .ag-head::after{content:"\25B8";color:#5f6d61;font-size:9px;
  transition:transform .15s;display:inline-block}
.ag-x[open]>.ag-x-s .ag-head::after{transform:rotate(90deg);color:var(--acc)}
.ag-x:not([open])>.ag-x-s .ag-res{white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.ag-x-b{padding:0 4px 8px 29px}
.ag-x-b .ag-args{margin-top:0}
.ag-arg{font-family:var(--fm);font-size:10.5px;color:#9fb0a1;line-height:1.6;
  padding:2px 0 2px 10px;border-left:1px solid #242a23;overflow-wrap:anywhere}
.ag-arg span{color:#66755f;display:inline-block;min-width:74px}
.ag.none{display:flex;align-items:center;gap:8px;padding:7px 11px;
  font-family:var(--fm);font-size:10.5px;color:#7d8a7f}
.ag.none .ag-ic{border:0;background:none;width:auto}
/* Working. The one honest thing to show while a tool loop runs is the clock
   and the list of what it is allowed to do. */
.ag.working{padding:9px 11px}
.ag-work-h{display:flex;align-items:center;gap:9px;font-family:var(--fm);
  font-size:11px;color:#dfe9e0}
.ag-work-h b{font-weight:700;letter-spacing:.04em}
.ag-work-b{font-family:var(--fm);font-size:10.5px;line-height:1.7;
  color:#6d7b6f;margin-top:5px;max-width:74ch}
.ag-spin{width:11px;height:11px;flex:none;border-radius:50%;
  border:1.5px solid #2c332c;border-top-color:var(--acc);
  animation:agspin .7s linear infinite}
@keyframes agspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.ag-spin{animation:none}}
:root[data-theme="light"] .ag{--ag-b:#ddddd2;--ag-bg:#fbfbf6}
:root[data-theme="light"] .ag-verb{color:#141410}
:root[data-theme="light"] .ag-say{color:#3b3d35}
:root[data-theme="light"] .ag-res,:root[data-theme="light"] .ag-sum{color:#5a5c50}

/* ── the live run ─────────────────────────────────────────────────────────
   Motion earns its place here in one way: it says the connection is open.
   Every animation below stops when the stream closes, so a still panel means
   the run is over and a moving one means something is still coming. */
.tm.live{border-color:#3a4230}
.tm-live{display:inline-flex;align-items:center;gap:5px;font-family:var(--fm);
  font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:#6ee7a0;
  margin-left:auto;flex:none}
.tm-live i{width:6px;height:6px;border-radius:50%;background:#6ee7a0;
  animation:tmpulse 1.3s ease-in-out infinite}
.tm.live .tm-copy{margin-left:8px}
@keyframes tmpulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(110,231,160,.5)}
  50%{opacity:.45;box-shadow:0 0 0 5px rgba(110,231,160,0)}}
/* The scan line: a single sweep tied to the open connection. */
.tm-scan{height:2px;background:#171b18;overflow:hidden;position:relative}
.tm.live .tm-scan::after{content:"";position:absolute;inset:0;width:38%;
  background:linear-gradient(90deg,transparent,var(--acc),transparent);
  animation:tmsweep 1.5s linear infinite}
@keyframes tmsweep{from{transform:translateX(-100%)}to{transform:translateX(365%)}}

.ag-status{display:flex;align-items:center;gap:9px;margin:2px 0 10px;
  padding:7px 10px;border:1px solid #262b26;border-radius:7px;
  background:#0a0c0a;font-family:var(--fm);font-size:11.5px;color:#dfe9e0}
.ag-status b{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap}
.ag-status .ag-ms{margin-left:auto}
.ag.live{border:0;background:none;box-shadow:none;padding:0;display:grid;gap:2px;
  position:relative;padding-left:0}
.ag.live::before{content:"";position:absolute;left:10px;top:12px;bottom:12px;
  width:1px;background:#20251f}
.ag.live .ag-step{padding-left:0}
.ag.live .ag-say{padding-left:29px}
.ag.live .ag-say::before{left:7px}
/* Each row arrives rather than appearing: the eye follows the newest line
   instead of re-reading the list to find what changed. */
.ag-in{animation:agin .28s cubic-bezier(.2,.8,.2,1) both}
@keyframes agin{from{opacity:0;transform:translateY(-5px)}
  to{opacity:1;transform:none}}
/* A call that has gone out and not come back. */
.ag-pending .ag-ic{border-color:var(--acc);background:#11150f}
.ag-pending .ag-verb{color:var(--acc-text,#ffd400)}
.ag-pending .ag-kind{border-color:#4a4420;color:var(--acc-text,#ffd400);
  animation:agblink 1.1s ease-in-out infinite}
.ag-wait{color:#6d7b6f;font-style:italic}
@keyframes agblink{0%,100%{opacity:1}50%{opacity:.35}}
.ag-spin.sm{width:8px;height:8px;border-width:1.2px}
/* The answer as it is written. Deliberately plain and deliberately capped:
   it is a progress indicator that happens to be readable, and the report
   proper replaces it the moment the run ends. */
.ag-out{margin:10px 0 2px;border:1px solid #262b26;border-radius:7px;
  background:#070907;overflow:hidden}
.ag-out-h{padding:5px 10px;background:#0f130f;border-bottom:1px solid #1d221d;
  font-family:var(--fm);font-size:9.5px;letter-spacing:.13em;
  text-transform:uppercase;color:#6d7b6f}
.ag-out-b{margin:0;padding:9px 11px;max-height:190px;overflow:auto;
  font-family:var(--fm);font-size:11px;line-height:1.65;color:#9fb0a1;
  white-space:pre-wrap;overflow-wrap:anywhere}
.ag-out-b::after{content:"";display:inline-block;width:7px;height:12px;
  background:#6ee7a0;vertical-align:-2px;margin-left:2px;
  animation:tmb 1.05s steps(2,start) infinite}
@media (prefers-reduced-motion:reduce){
  .tm.live .tm-scan::after,.tm-live i,.ag-pending .ag-kind,.ag-in,
  .ag-out-b::after{animation:none}
  .ag-in{opacity:1;transform:none}
}
:root[data-theme="light"] .ag-status{background:#fbfbf6;border-color:#ddddd2;
  color:#141410}
:root[data-theme="light"] .ag-out{background:#fbfbf6;border-color:#ddddd2}
:root[data-theme="light"] .ag-out-b{color:#3b3d35}

