.thinking-steps-live {
  min-width: min(420px, 100%);
}

.thinking-steps-list {
  display: grid;
  gap: 7px;
}

.thinking-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.thinking-step-marker {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--success, #22c55e);
  font-size: 12px;
  font-weight: 800;
}

.thinking-step.is-active {
  color: var(--text-primary);
  font-weight: 600;
}

.thinking-step.is-active .thinking-step-marker {
  color: var(--brand);
  animation: thinkingStepSpin 1.1s linear infinite;
}

.thinking-step-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.thinking-steps-more {
  padding-left: 25px;
  color: var(--text-tertiary, var(--text-secondary));
  font-size: 11px;
}

.thinking-steps-details {
  width: 100%;
  min-width: 0;
  margin: 2px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.thinking-steps-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 2px;
  box-sizing: border-box;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.thinking-steps-details > summary::-webkit-details-marker {
  display: none;
}

.thinking-steps-details > summary::after {
  content: '';
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  margin: 0 4px 3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.thinking-steps-details[open] > summary::after {
  transform: rotate(225deg);
  margin-bottom: -3px;
}

.thinking-steps-details > summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: -2px;
}

.thinking-steps-details[open] > summary {
  color: var(--text-secondary);
}

.thinking-steps-details > .thinking-steps-list {
  margin: 0 0 12px 3px;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--panel-border);
  gap: 12px;
}

.thinking-steps-details .thinking-step-marker {
  color: var(--text-secondary);
  font-weight: 400;
}

.thinking-stopped {
  opacity: 0.86;
}

@keyframes thinkingStepSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-step.is-active .thinking-step-marker { animation: none; }
}

@media (max-width: 420px) {
  .thinking-steps-live,
  .thinking-steps-details {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .thinking-steps-details > summary {
    min-height: 44px;
    padding: 8px 2px;
  }
}

/* Tool ownership is only unambiguous in an explicit single-expert plan. */
.thinking-step--tool { margin-inline-start: 18px; }

.thinking-expert-owner { color: var(--text-secondary); font-size: 12px; font-weight: 600; margin: 4px 0; }
