/* Public work stays compact beside the conversation. Details never move chat. */
#live-activity { max-height: min(34vh, 300px); border-top: 1px solid var(--border); background: var(--bg); scrollbar-width: none; }
#live-activity .pipeline-activity { padding: 0 16px; border-bottom: 1px solid var(--border); }
#live-activity .pipeline-activity:last-child { border-bottom: 0; }
#live-activity .pipeline-activity > summary { display: flex; align-items: center; gap: 9px; min-height: 56px; padding: 9px 0; list-style: none; }
#live-activity .pipeline-activity > summary::before { display: none; }
#live-activity summary::-webkit-details-marker { display: none; }
.activity-run-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: 0 0 7px; }
[data-running="true"] .activity-run-dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent); }
[data-recoverable="true"] .activity-run-dot { background: var(--red); }
.activity-summary-text { min-width: 0; flex: 1; display: grid; gap: 2px; }
.activity-heading { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 9px; }
.activity-kind { font-size: 11px; color: var(--dim); }
.activity-stage { font-size: 12px; font-weight: 600; }
[data-running="true"] .activity-stage { color: var(--green); }
[data-recoverable="true"] .activity-stage { color: var(--red); }
#live-activity .current-action { display: block; font-size: 11px; line-height: 1.4; color: var(--dim); }
.activity-elapsed { flex: 0 0 auto; font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }
.activity-expand { color: var(--dim); font-size: 14px; transition: transform .15s; }
.pipeline-activity[open] > summary .activity-expand { transform: rotate(180deg); }
.activity-body { padding: 0 0 8px 16px; min-width: 0; }
.activity-task { margin: 0 0 7px; font-size: 11px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.activity-task > span { color: var(--dim); margin-right: 5px; }
.activity-milestones { display: flex; align-items: center; gap: 16px; margin: 0 0 7px; padding: 0; list-style: none; font-size: 10px; color: var(--dim); }
.activity-milestones li { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.activity-milestones li > span:first-child { font-size: 9px; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border: 1px solid var(--border); border-radius: 50%; }
.activity-milestones .saved { color: var(--green); }
.activity-milestones .current { color: var(--text); font-weight: 600; }
.activity-milestones .current > span:first-child { border-color: var(--green); color: var(--green); }
#live-activity .run-events { max-height: 120px; padding: 0; scrollbar-width: none; overscroll-behavior: contain; }
#live-activity .run-events > .activity-event { padding: 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
#live-activity .run-events > .activity-event:last-child { border-bottom: 0; }
.activity-event-line, .activity-event-toggle { display: flex; gap: 7px; align-items: center; width: 100%; min-height: 30px; padding: 5px 0; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit; line-height: 1.4; }
.activity-event-toggle { cursor: pointer; }
.activity-event-toggle:hover { background: color-mix(in srgb, var(--dim) 6%, transparent); }
.activity-event-mark { flex: 0 0 10px; color: var(--dim); text-align: center; }
.activity-event-mark.running, .tool .activity-event-mark.completed { color: var(--green); }
.activity-event-mark.failed { color: var(--red); }
.activity-event-heading { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 7px; }
.activity-event-label { color: var(--text); font-size: 11px; flex-shrink: 0; }
.activity-event-preview { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.activity-event:not(.tool) .activity-event-heading { display: block; }
.activity-event:not(.tool) .activity-event-label { color: var(--dim); font-size: 10px; margin-right: 6px; }
.activity-event:not(.tool) .activity-event-preview { color: var(--text); white-space: normal; overflow-wrap: anywhere; }
.activity-event-meta { color: var(--dim); font-size: 10px; flex-shrink: 0; }
.activity-event-chevron { color: var(--dim); width: 12px; text-align: center; }
.activity-event-detail { padding: 4px 0 8px 17px; color: var(--dim); }
.activity-event-detail[hidden] { display: none; }
.activity-event-detail time, .activity-output-label { font-size: 10px; }
.activity-event-detail pre { margin: 4px 0; padding: 7px 9px; border-radius: 5px; background: var(--card); color: var(--text); font-size: 10px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.activity-event-detail p { margin: 4px 0; font-size: 11px; }
.activity-recovery, .activity-checkpoint, .activity-empty { margin: 3px 0 6px; color: var(--dim); font-size: 10px; line-height: 1.5; }
.activity-recovery { color: var(--text); }
.activity-checkpoint { margin: 5px 0 0; }
.activity-body .run-error { font-size: 11px; margin: 4px 0; overflow-wrap: anywhere; color: var(--red); }
#live-activity button:focus-visible, #live-activity summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media (max-width: 600px) {
  #live-activity { max-height: 31vh; }
  #live-activity .pipeline-activity { padding: 0 12px; }
  #live-activity .pipeline-activity > summary { min-height: 54px; }
  .activity-body { padding-left: 0; }
  .activity-event-line, .activity-event-toggle { min-height: 40px; }
  .activity-event-heading { display: block; }
  .activity-event-preview { display: block; }
  .activity-event:not(.tool) .activity-event-preview { display: inline; }
  .activity-milestones { gap: 13px; }
  #live-activity .run-events { max-height: 112px; }
}
@media (prefers-reduced-motion: reduce) { .activity-expand { transition: none; } }
