/* Multiprompt: stage prompt list and stage progress (shared by textai.html and rules_registry.html) */
.textai-prompt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.textai-prompt-item {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fafbfc;
  font-size: 13px;
}

.textai-prompt-index {
  font-weight: 700;
  color: var(--mp-accent, #8e44ad);
  text-align: center;
}

.textai-prompt-name {
  overflow-wrap: anywhere;
  color: var(--mp-ink, #0d1f38);
  font-weight: 600;
}

.textai-prompt-source {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.textai-prompt-source input {
  width: auto;
}

.textai-prompt-controls {
  display: flex;
  gap: 4px;
}

.textai-prompt-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--mp-muted, #4a5a70);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.textai-prompt-controls button:hover:not(:disabled) {
  border-color: var(--mp-accent, #8e44ad);
  color: var(--mp-accent, #8e44ad);
}

.textai-prompt-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.textai-stage-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  font-size: 13px;
}

.textai-stage-row.is-running {
  border-color: var(--mp-accent, #8e44ad);
  background: var(--mp-accent-light, rgba(142, 68, 173, 0.08));
}

.textai-stage-row.is-error {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.textai-stage-meta {
  color: var(--mp-muted, #4a5a70);
  font-size: 12px;
  margin-top: 2px;
}

.textai-stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 640px) {
  .textai-prompt-item {
    grid-template-columns: 24px 1fr auto;
  }

  .textai-prompt-source {
    grid-column: 2 / -1;
    grid-row: 2;
  }
}


.textai-stage-warning {
  color: #b45309;
  font-size: 12px;
  margin-top: 2px;
}

.textai-stage-row .textai-stage-download {
  white-space: nowrap;
}

.textai-stage-body {
  min-width: 0;
}

.textai-stage-details {
  margin-top: 6px;
}

.textai-stage-details summary {
  cursor: pointer;
  color: var(--mp-accent, #8e44ad);
  font-size: 12px;
  font-weight: 600;
}

.textai-stage-ops {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.textai-stage-op {
  display: grid;
  grid-template-columns: 1fr 90px 36px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mp-muted, #4a5a70);
}

.textai-stage-op-bar {
  height: 5px;
  background: rgba(128, 128, 128, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.textai-stage-op-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #38b000;
  transition: width 0.3s ease;
}

.textai-stage-op-percent {
  text-align: right;
  font-weight: 600;
}

.textai-stage-thinking-title {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mp-ink, #0d1f38);
}

.textai-stage-thinking {
  margin: 4px 0 0;
  max-height: 260px;
  overflow: auto;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334155;
}

.textai-stage-row.is-skipped {
  opacity: 0.55;
  border-style: dashed;
}
