.tool-call-task-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0;
}

.tool-call-task-section {
  border: 1px solid var(--tool-call-border-color, var(--border-base));
  overflow: hidden;
  background-color: transparent;
  border-radius: 0;
}

.tool-call-task-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem;
  background-color: var(--surface-secondary);
  border-bottom: 1px solid var(--tool-call-border-color, var(--border-base));
  font-family: var(--font-family-mono);
  font-size: 13px;
  color: inherit;
}

.tool-call-task-section-title {
  font-weight: var(--font-weight-semibold);
}

.tool-call-task-section-meta {
  font-family: var(--font-family-mono);
  color: var(--text-muted);
}

.tool-call-task-section-body {
  background-color: var(--surface-code);
}

.tool-call-task-section-body .tool-call-markdown {
  padding: 12px;
}

.tool-call-task-container {
  padding: 0;
}

/* Steps list should be flush (no inset padding). */
.tool-call-task-section-body .tool-call-task-container.tool-call-markdown {
  padding: 0;
}

/* Keep task lists compact vs prompt/output panes. */
.tool-call-task-container.tool-call-markdown {
  max-height: calc(var(--tool-call-max-height-compact, calc(25 * 1.4em)) / 2);
}

/* Prompt + output panes: slightly taller than tasks. */
.tool-call-task-section-body > .tool-call-markdown:not(.tool-call-task-container) {
  max-height: calc(var(--tool-call-max-height-compact, calc(25 * 1.4em)) * 2 / 3);
}

.tool-call-task-empty {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  color: var(--text-muted);
  padding: 0.5rem;
}

.tool-call-task-summary {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
}

/* Nested tool calls (child session tool timeline) */
.tool-call-task-summary .tool-call {
  /* Tool calls inside the main message stream are borderless.
     Use an overlay stripe so hover backgrounds don't hide it. */
  position: relative;
}

.tool-call-task-summary .tool-call::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--task-tool-call-stripe, transparent);
  pointer-events: none;
  z-index: 2;
}

.tool-call-task-summary .tool-call.tool-call-status-completed,
.tool-call-task-summary .tool-call.tool-call-status-success {
  --task-tool-call-stripe: var(--status-success);
}

.tool-call-task-summary .tool-call.tool-call-status-running {
  --task-tool-call-stripe: var(--status-warning);
}

.tool-call-task-summary .tool-call.tool-call-status-pending {
  --task-tool-call-stripe: var(--accent-primary);
}

.tool-call-task-summary .tool-call.tool-call-status-error {
  --task-tool-call-stripe: var(--status-error);
}

.tool-call-task-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  border-left: 2px solid var(--tool-call-border-color, var(--border-base));
  font-size: var(--font-size-sm);
  font-family: var(--font-family-mono);
  line-height: 1.35;
  background-color: var(--surface-secondary);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tool-call-task-item + .tool-call-task-item {
  margin-top: 0.1rem;
}

.tool-call-task-item:hover {
  background-color: var(--surface-hover);
}

.tool-call-task-item[data-task-status="completed"] {
  border-left-color: var(--status-success);
}

.tool-call-task-item[data-task-status="running"] {
  border-left-color: var(--status-warning);
}

.tool-call-task-item[data-task-status="pending"] {
  border-left-color: var(--accent-primary);
}

.tool-call-task-item[data-task-status="error"] {
  border-left-color: var(--status-error);
}

.tool-call-task-icon {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text-muted);
}

.tool-call-task-label {
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  font-size: inherit;
}

.tool-call-task-separator {
  color: var(--text-muted);
  font-size: inherit;
}

.tool-call-task-text {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-call-task-status {
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  font-size: 0.9rem;
}
