/* SOG Agent turn trace: a quiet disclosure under an answer, in the agent
   panel's own type scale (source pills are 7.5px mono) with 1px hairlines,
   one status colour per dot and the amber/red already used for human-check. */
.agent-trace{margin-top:10px;max-width:100%;overflow:hidden;border:1px solid #333842;border-radius:6px;background:#191c21;font-family:var(--font-mono);font-size:7.5px;color:#7d8692}
.agent-trace>summary{display:flex;align-items:center;gap:6px;padding:5px 8px;cursor:pointer;list-style:none;user-select:none;outline:none}
.agent-trace>summary::-webkit-details-marker{display:none}
.agent-trace>summary:focus-visible{box-shadow:inset 0 0 0 1px var(--gold-ring,rgba(79,157,179,.55))}
.agent-trace-caret{flex:0 0 auto;width:0;height:0;border:3px solid transparent;border-left:4px solid #7d8692;transition:transform var(--motion-fast,120ms) var(--ease,ease)}
.agent-trace[open] .agent-trace-caret{transform:rotate(90deg)}
.agent-trace-title{flex:0 0 auto;color:#aab2c0;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.agent-trace-summary{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agent-trace-chip{flex:0 0 auto;margin-left:auto;border:1px solid currentColor;border-radius:999px;padding:1px 6px;font-weight:800;letter-spacing:.04em;white-space:nowrap}
.agent-trace-chip.warn{color:#f0bd67}
.agent-trace-chip.danger{color:var(--danger,#ef6b63)}
.agent-trace-steps{display:grid;gap:2px;margin:0;padding:3px 8px 6px;list-style:none;border-top:1px solid #2a2f38}
.agent-trace-steps li{display:grid;grid-template-columns:8px auto minmax(0,1fr) auto;align-items:center;gap:6px;padding:2px 0;line-height:1.5}
.agent-trace-dot{width:5px;height:5px;border-radius:50%;background:#5c6472}
.agent-trace-steps li.completed .agent-trace-dot{background:var(--ok,#52c981)}
.agent-trace-steps li.started .agent-trace-dot{background:#f0bd67}
.agent-trace-steps li.failed .agent-trace-dot{background:var(--danger,#ef6b63);box-shadow:0 0 0 2px rgba(239,107,99,.18)}
.agent-trace-steps li>b{color:#aab2c0;font-weight:800;white-space:nowrap}
.agent-trace-steps li>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agent-trace-steps li.failed>span{color:#ef9a94}
.agent-trace-steps li>em{font-style:normal;color:#5c6472;font-variant-numeric:tabular-nums;white-space:nowrap}
.agent-trace-why{margin:0;padding:5px 8px 6px;border-top:1px solid #2a2f38;color:#aab2c0;line-height:1.5;overflow-wrap:anywhere}
.agent-trace-why>b{margin-right:5px;color:#f0bd67;font-weight:800}
.agent-trace-why.danger>b{color:var(--danger,#ef6b63)}
html[data-theme="light"] .agent-trace{border-color:#d4dad7;background:#fff;color:#69736e}
html[data-theme="light"] .agent-trace-title,html[data-theme="light"] .agent-trace-steps li>b,html[data-theme="light"] .agent-trace-why{color:#3f4844}
html[data-theme="light"] .agent-trace-steps,html[data-theme="light"] .agent-trace-why{border-top-color:#e3e8e6}
html[data-theme="light"] .agent-trace-caret{border-left-color:#69736e}
html[data-theme="light"] .agent-trace-chip.warn,html[data-theme="light"] .agent-trace-why>b{color:#8a6d1f}
html[data-theme="light"] .agent-trace-steps li>em{color:#9aa19e}

/* Tool actions share one measured card grid in the Agent rail. */
.agent-actions{box-sizing:border-box;max-width:100%;min-width:0;margin-top:14px;overflow:hidden;border:1px solid #3c4849;border-radius:11px;background:#202728;color:#e9f0ee;font-family:inherit}
.agent-actions>summary{display:grid;grid-template-columns:13px auto minmax(0,1fr) auto;align-items:center;column-gap:8px;min-height:42px;padding:9px 11px;cursor:pointer;list-style:none}
.agent-actions>summary::-webkit-details-marker,.agent-action-card>summary::-webkit-details-marker{display:none}
.agent-actions>summary:focus-visible,.agent-action-card>summary:focus-visible{outline:2px solid var(--gold-ring,#78bdc1);outline-offset:-2px}
.agent-actions-caret,.agent-action-chevron{width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s ease}
.agent-actions:not([open]) .agent-actions-caret,.agent-action-card[open] .agent-action-chevron{transform:rotate(-135deg)}
.agent-actions>summary strong{font-size:13px;line-height:1.4}
.agent-actions-meta{min-width:0;overflow:hidden;color:#abbcb8;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.agent-actions-state{justify-self:end;border-radius:999px;background:#2c4343;color:#9bd1cf;padding:4px 8px;font-size:9px;font-weight:800;line-height:1.2;white-space:nowrap}
.agent-actions-state.failed{background:#593438;color:#f3b0aa}
.agent-actions-state.running{background:#554a32;color:#efd18e}
.agent-actions-list{display:grid;gap:1px;margin:0 11px 10px;border-top:1px solid #3b4949;padding-top:4px}
.agent-action-card{min-width:0;border-radius:6px}
.agent-action-card>summary{display:grid;grid-template-columns:18px minmax(0,1fr) auto 9px;align-items:center;gap:8px;min-height:39px;padding:7px 4px;cursor:pointer;list-style:none}
.agent-action-card:hover{background:rgba(255,255,255,.035)}
.agent-action-mark{display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:#41787a;color:#dff8f6;font-size:11px;font-weight:900;line-height:1}
.agent-action-card.running .agent-action-mark{border:1px solid #c6aa6b;background:transparent;color:#d7ba7b}
.agent-action-card.failed .agent-action-mark{background:#793b3d;color:#ffe0dc}
.agent-action-name{min-width:0;overflow:hidden;color:#b2dedb;font-size:12px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}
.agent-action-time{color:#aab9b5;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}
.agent-action-chevron{width:6px;height:6px;color:#aab9b5}
.agent-action-detail{display:grid;gap:4px;padding:0 6px 9px 26px}
.agent-action-detail p{display:grid;grid-template-columns:75px minmax(0,1fr);gap:6px;margin:0;color:#b9c8c4;font-size:11px;line-height:1.45}
.agent-action-detail b{color:#829591;font-weight:700}
.agent-action-detail span,.agent-action-detail code{min-width:0;max-height:100px;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap;font:inherit}
.agent-action-detail code{font-family:var(--font-mono,monospace)}
.agent-action-card.failed .agent-action-detail p:last-child span{color:#f0a6a1}
html[data-theme="light"] .agent-actions{border-color:#cbd8d4;background:#fff;color:#283e3d}
html[data-theme="light"] .agent-actions-list{border-top-color:#dbe4e0}
html[data-theme="light"] .agent-actions-meta,html[data-theme="light"] .agent-action-time{color:#657874}
html[data-theme="light"] .agent-actions-state{background:#e4f0ed;color:#20575a}
html[data-theme="light"] .agent-actions-state.failed{background:#f8e8e7;color:#9b353a}
html[data-theme="light"] .agent-actions-state.running{background:#f5eddc;color:#85641b}
html[data-theme="light"] .agent-action-name{color:#174d56}
html[data-theme="light"] .agent-action-card:hover{background:#f4f8f6}
html[data-theme="light"] .agent-action-detail p{color:#4a5d59}
html[data-theme="light"] .agent-action-detail b{color:#6a7d79}
html[data-theme="light"] .agent-action-card.failed .agent-action-detail p:last-child span{color:#9c3838}
@media(max-width:480px){.agent-actions>summary{grid-template-columns:13px auto minmax(0,1fr) auto}.agent-actions-meta{grid-column:2/4;grid-row:2}.agent-actions-state{grid-column:4;grid-row:1}.agent-action-detail p{grid-template-columns:65px minmax(0,1fr)}}
