/* SubagentList — Nested agent tree under main session */

.subagent-list {
  padding: 0 12px;
  border-bottom: 1px solid var(--island-subtle);
}

.subagent-list__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 0;
  background: none;
  border: none;
  color: var(--island-text-muted);
  font-size: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color 0.15s ease-out;
}

.subagent-list__toggle:hover {
  color: var(--island-text-secondary);
}

.subagent-list__chevron {
  transition: transform 0.15s ease-out;
  flex-shrink: 0;
  opacity: 0.72;
}

.subagent-list__chevron--open {
  transform: rotate(90deg);
}

.subagent-list__label {
  font-weight: 500;
}

.subagent-list__hint {
  margin-left: auto;
  color: var(--island-text-muted);
  font-size: 9px;
  opacity: 0.72;
}

.subagent-list__toggle:hover .subagent-list__chevron,
.subagent-list__toggle:hover .subagent-list__hint {
  opacity: 1;
}

.subagent-list__items {
  padding: 2px 0 6px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subagent-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--island-text-secondary);
  padding: 2px 0;
  width: 100%;
  min-height: 20px;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
}

.subagent-row:disabled {
  cursor: default;
}

.subagent-row--button {
  cursor: pointer;
  border-radius: 5px;
  padding: 2px 4px 2px 0;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.subagent-row--button:hover {
  background: var(--island-card-hover);
  color: var(--island-text);
}

.subagent-row__main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.subagent-row__name,
.subagent-row__desc,
.subagent-row__result {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagent-row__name {
  flex-shrink: 0;
  color: var(--island-text-secondary);
}

.subagent-row__desc {
  min-width: 0;
  color: var(--island-text-muted);
}

.subagent-row__result {
  max-width: 120px;
  flex-shrink: 1;
  color: var(--island-text-muted);
  font-size: 10px;
}

.subagent-row__tool {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--island-text-muted);
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 10px;
  flex-shrink: 0;
}

.subagent-row__history {
  flex-shrink: 0;
  color: var(--island-text-muted);
  font-size: 9px;
}

.subagent-row__spinner {
  width: 6px;
  height: 6px;
  border: 1px solid var(--island-text-muted);
  border-top-color: var(--island-text);
  border-radius: 50%;
  animation: subagent-spin 0.8s linear infinite;
}

@keyframes subagent-spin {
  to { transform: rotate(360deg); }
}
