.pipeline-container { max-width: 960px; margin: 0 auto; }

.step-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 0.5rem 0 0.25rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
}

.substep-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    transition: border-color 0.15s;
}
.substep-card:hover { border-color: #adb5bd; }

.substep-card.status-complete {
    border-left: 3px solid #198754;
}
.substep-card.status-not_started {
    border-left: 3px solid #dee2e6;
}
.substep-card.status-in_progress {
    border-left: 3px solid #0d6efd;
}
.substep-card.status-running {
    border-left: 3px solid #0d6efd;
    background: #f8f9ff;
}
.substep-card.status-error {
    border-left: 3px solid #dc3545;
}

.substep-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}
.substep-icon.icon-complete { background: #198754; color: #fff; }
.substep-icon.icon-not_started { background: #e9ecef; color: #6c757d; }
.substep-icon.icon-in_progress { background: #0d6efd; color: #fff; }
.substep-icon.icon-running { background: #0d6efd; color: #fff; }
.substep-icon.icon-error { background: #dc3545; color: #fff; }

.substep-info { flex: 1; min-width: 0; }
.substep-name { font-weight: 500; font-size: 0.9rem; }
.substep-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.artifact-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: #f0f0f0;
    color: #495057;
    white-space: nowrap;
}
.artifact-badge.has-data { background: #d1e7dd; color: #0f5132; }

/* Entity type badge colors (Nine-Component Framework) */
/* Step 1 - Context */
.artifact-badge[data-entity-type="roles"]       { background: #cfe2ff; color: #084298; }
.artifact-badge[data-entity-type="states"]      { background: #e2d9f3; color: #432874; }
.artifact-badge[data-entity-type="resources"]   { background: #d2f4ea; color: #0d6854; }
/* Step 2 - Normative */
.artifact-badge[data-entity-type="principles"]  { background: #ffe5d0; color: #984c0c; }
.artifact-badge[data-entity-type="obligations"] { background: #f8d7da; color: #842029; }
.artifact-badge[data-entity-type="constraints"] { background: #e2e3e5; color: #41464b; }
.artifact-badge[data-entity-type="capabilities"]{ background: #cff4fc; color: #087990; }
/* Step 3 - Temporal */
.artifact-badge[data-entity-type="actions"] { background: #d1e7dd; color: #0f5132; }
.artifact-badge[data-entity-type="events"]  { background: #fff3cd; color: #664d03; }
/* Step 4 - Synthesis */
.artifact-badge[data-entity-type="code_provision_reference"]   { background: #e2e3e5; color: #41464b; }
.artifact-badge[data-entity-type="precedent_case_reference"]   { background: #e2e3e5; color: #41464b; }
.artifact-badge[data-entity-type="ethical_question"]           { background: #cff4fc; color: #087990; }
.artifact-badge[data-entity-type="ethical_conclusion"]         { background: #d1e7dd; color: #0f5132; }
.artifact-badge[data-entity-type="causal_normative_link"]      { background: #e2e5e9; color: #3b4455; }
.artifact-badge[data-entity-type="question_emergence"]         { background: #e2e5e9; color: #3b4455; }
.artifact-badge[data-entity-type="resolution_pattern"]         { background: #e2e5e9; color: #3b4455; }
.artifact-badge[data-entity-type="canonical_decision_point"]   { background: #e2e5e9; color: #3b4455; }

.substep-actions { flex-shrink: 0; display: flex; gap: 0.35rem; align-items: center; }

.blocker-text {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

.group-section { margin-bottom: 1.5rem; }

/* Overview stats */
.pipeline-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.stat-item { text-align: center; }
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
}
.stat-value.text-success { color: #198754 !important; }
.stat-value.text-muted { color: #adb5bd !important; }

/* Running animation */
@keyframes pulse-border {
    0%, 100% { border-left-color: #0d6efd; }
    50% { border-left-color: #6ea8fe; }
}
.substep-card.status-running {
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Error state */
.error-message {
    font-size: 0.75rem;
    color: #dc3545;
    margin-top: 0.25rem;
}

/* Waiting review state (interactive mode) */
.substep-card.status-waiting_review {
    border-left: 3px solid #fd7e14;
    background: #fff8f0;
}
.substep-icon.icon-waiting_review { background: #fd7e14; color: #fff; }

/* Interactive review bar */
.review-bar {
    padding: 0.5rem 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Mode toggle */
.mode-toggle .btn { font-size: 0.8rem; padding: 0.2rem 0.6rem; }

/* Re-run button */
.btn-rerun { font-size: 0.7rem; padding: 0.15rem 0.35rem; }
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin { display: inline-block; animation: spin 1s linear infinite; }
