/* MCE Workbench — custom overrides for Pico CSS */

/* ========== Toast notifications ========== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 400px;
}

.toast.error {
  background: var(--pico-del-color);
  color: #fff;
}

.toast.warning {
  background: #f59e0b;
  color: #fff;
}

/* ========== Vision text truncation ========== */
.vision-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
}

/* ========== Breadcrumb ========== */
nav[aria-label="breadcrumb"] ul {
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0.5rem;
}

nav[aria-label="breadcrumb"] li::before {
  content: "/ ";
  color: var(--pico-muted-color);
}

nav[aria-label="breadcrumb"] li:first-child::before {
  content: "";
}

/* ========== Code textarea ========== */
textarea[style*="monospace"] {
  tab-size: 4;
  white-space: pre;
  overflow-x: auto;
}

/* ========== Footer ========== */
footer small {
  color: var(--pico-muted-color);
}

/* ========== Handler spec tables ========== */
.spec-table {
  font-size: 0.85rem;
  margin-bottom: 0;
}
.spec-table th {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}
.spec-table td {
  padding: 0.35rem 0.6rem;
}

/* ========== Effect and tag badges ========== */
.effect-badge, .tag-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
}
.effect-badge {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}
.effect-config-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
}
.effect-adapter-label {
  font-size: 0.72rem;
  opacity: 0.65;
  font-style: italic;
}
.tag-badge {
  background: var(--pico-secondary-background);
  color: var(--pico-secondary-inverse);
}

/* ========== Runner card ========== */
.runner-card header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  background: var(--pico-secondary-background);
  color: var(--pico-secondary-inverse);
}
.tag-default {
  background: #059669;
  color: #fff;
}

/* ========== Handler human description ========== */
.handler-human-desc {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: #f0f9ff;
  border-left: 3px solid var(--pico-primary);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  color: #1e3a5f;
}

.handler-human-desc p {
  margin: 0 0 0.4rem;
}

/* ========== Handler spec section ========== */
.handler-spec {
  padding: 0.5rem 0;
}

/* ========== Status badges (handler states) ========== */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.status-spec_only {
  background: #e2e8f0;
  color: #475569;
}

.status-has_code {
  background: #fef3c7;
  color: #92400e;
}

.status-valid {
  background: #d1fae5;
  color: #065f46;
}

.status-invalid {
  background: #fee2e2;
  color: #991b1b;
}

.status-validating {
  background: #dbeafe;
  color: #1e40af;
  animation: pulse 1.5s infinite;
}

.status-unknown {
  background: #f1f5f9;
  color: #94a3b8;
}

/* ========== Readiness badges (saga states) ========== */
.readiness-ready {
  background: #d1fae5;
  color: #065f46;
}

.readiness-blocked {
  background: #fee2e2;
  color: #991b1b;
}

/* ========== Adapter status colors ========== */
.adapter-ready {
  color: #059669;
  font-weight: 600;
}

.adapter-no_secret {
  color: #d97706;
  font-weight: 600;
}

.adapter-no_dependency {
  color: #dc2626;
  font-weight: 600;
}

/* ========== Blocking issues list ========== */
.blocking-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.blocking-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  font-size: 0.85rem;
}

.blocking-list li::before {
  content: "\26A0  ";
  color: #dc2626;
  font-weight: bold;
}

/* ========== Trace viewer ========== */
.trace-entry {
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border-left: 3px solid var(--pico-primary);
  margin-bottom: 0.25rem;
  background: var(--pico-card-background-color);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trace-entry.trace-error {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.trace-event-type {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  background: var(--pico-muted-border-color);
  white-space: nowrap;
}
.trace-type-step-start { color: #2563eb; }
.trace-type-step-complete { color: #059669; }
.trace-type-step-error { color: #dc2626; background: #fee2e2; }
.trace-type-run-error { color: #dc2626; background: #fee2e2; }
.trace-type-handler-call { color: #7c3aed; }
.trace-type-handler-result { color: #059669; }
.trace-type-effect-call { color: #d97706; }
.trace-type-effect-result { color: #059669; }
.trace-type-run-start { color: #6b7280; }
.trace-type-run-complete { color: #059669; }

.trace-viewer pre {
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========== Validation report ========== */
.validation-pass {
  color: #059669;
  font-weight: 600;
}

.validation-fail {
  color: #dc2626;
  font-weight: 600;
}

.validation-detail {
  font-family: monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  padding: 0.5rem;
  background: var(--pico-card-background-color);
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

/* ========== Stats row (dashboard) ========== */
.stats-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  min-width: 100px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  margin-top: 0.15rem;
}

/* ========== Run status colors ========== */
.run-completed { color: #059669; }
.run-failed { color: #dc2626; }
.run-running { color: #2563eb; }
.run-cancelled { color: #6b7280; }
.run-pending { color: #94a3b8; }

/* ========== Error block ========== */
.error-block {
  border-left: 4px solid #dc2626;
  padding: 0.75rem;
  margin: 0.75rem 0;
  background: #fef2f2;
  border-radius: 0 0.25rem 0.25rem 0;
}

.error-block pre {
  white-space: pre-wrap;
  font-size: 0.85rem;
  margin: 0;
  color: #991b1b;
}

/* ========== Pulse animation ========== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========== Main content padding for progress panel ========== */
main.container {
  padding-bottom: 4rem;
}

/* ========== Misc helpers ========== */
.text-muted {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* ========== Chain Flow Visualization ========== */
.chain-flow {
  padding: 0.75rem 0;
}

.chain-flow summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.chain-steps {
  position: relative;
  padding-left: 1rem;
}

.chain-step {
  position: relative;
  background: var(--pico-card-background-color, #fff);
  border: 1px solid var(--pico-muted-border-color, #ddd);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.chain-step:not(:last-child)::after {
  content: '\2193';
  display: block;
  text-align: center;
  color: var(--pico-muted-color);
  font-size: 1rem;
  line-height: 1.2;
  margin: 0.1rem 0;
  position: relative;
  left: -0.5rem;
}

.chain-step .step-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chain-step .step-type {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.chain-step .step-type.type-call { background: #dbeafe; color: #1e40af; }
.chain-step .step-type.type-effect { background: #fef3c7; color: #92400e; }
.chain-step .step-type.type-saga { background: #ede9fe; color: #5b21b6; }
.chain-step .step-type.type-foreach { background: #d1fae5; color: #065f46; }
.chain-step .step-type.type-parallel { background: #fce7f3; color: #9d174d; }

.chain-step .step-target {
  font-weight: 600;
}

.chain-step .step-number {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pico-muted-color);
  min-width: 2.5rem;
}

.chain-step .step-handler-link {
  font-weight: 600;
  color: var(--pico-primary);
  text-decoration: none;
  cursor: pointer;
}

.chain-step .step-handler-link:hover {
  text-decoration: underline;
}

.chain-step .step-description {
  margin: 0.25rem 0 0;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  font-style: italic;
  line-height: 1.3;
}

.chain-step .step-spec-name {
  color: var(--pico-muted-color);
  font-style: italic;
  margin-left: 0.3rem;
}

.chain-step .step-io {
  color: var(--pico-muted-color);
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

/* ---- Data mapping rows ---- */
.step-mapping {
  margin-top: 0.3rem;
  padding: 0.25rem 0.4rem;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
}

.step-mapping-out {
  border-left: 2px solid #059669;
}

.step-mapping:not(.step-mapping-out) {
  border-left: 2px solid #2563eb;
}

.mapping-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0;
}

.mapping-port {
  font-weight: 600;
  min-width: 5rem;
}

.mapping-arrow {
  color: var(--pico-muted-color);
  font-size: 0.85em;
}

.mapping-expr {
  color: #6b21a8;
}

.step-effects {
  margin-top: 0.25rem;
}

/* ---- Parallel branch rendering ---- */
.parallel-branches {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
}

.parallel-branch {
  flex: 1;
  border: 1px solid var(--pico-muted-border-color, #e5e7eb);
  border-radius: 0.3rem;
  padding: 0.4rem;
  background: var(--pico-card-background-color, #fafafa);
}

.branch-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #9d174d;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.branch-step {
  margin-bottom: 0.3rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
}

.branch-step:not(:last-child)::after {
  font-size: 0.7rem;
}

.chain-validate-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  margin: 0;
}

.chain-validation-result {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}

.chain-validation-result.valid { background: #d1fae5; color: #065f46; }
.chain-validation-result.invalid { background: #fee2e2; color: #991b1b; }

/* ========== Pipeline Progress ========== */
.pipeline-progress {
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-radius: 0.5rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.pipeline-phase {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phase-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.phase-starting { background: #f1f5f9; color: #475569; }
.phase-generating { background: #dbeafe; color: #1e40af; }
.phase-validating { background: #fef3c7; color: #92400e; }
.phase-validation_result { background: #f1f5f9; color: #475569; }
.phase-improving { background: #ede9fe; color: #5b21b6; }
.phase-analyzing { background: #fee2e2; color: #991b1b; }
.phase-complete { background: #d1fae5; color: #065f46; }

.pipeline-attempts {
  margin-top: 0.5rem;
}

.pipeline-attempts progress {
  height: 0.5rem;
  margin-bottom: 0.25rem;
}

/* ========== Pipeline Result ========== */
.pipeline-result {
  border-left: 4px solid var(--pico-muted-border-color);
  margin-top: 1rem;
}

.result-valid { border-left-color: #059669; }
.result-invalid { border-left-color: #dc2626; }

.pipeline-result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.pipeline-result-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-valid { background: #d1fae5; color: #065f46; }
.badge-invalid { background: #fee2e2; color: #991b1b; }
.badge-skipped { background: #f1f5f9; color: #475569; }

.pipeline-result-summary { font-size: 0.9rem; }

/* ========== Pipeline Test Results ========== */
.pipeline-tests {
  padding: 0 1rem 0.5rem;
}

.pipeline-test-summary {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--pico-muted-color);
}

.pipeline-test-row {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  font-size: 0.85rem;
}

.pipeline-test-row:last-child { border-bottom: none; }

.test-status {
  display: inline-block;
  width: 3rem;
  font-weight: 600;
  font-size: 0.8rem;
}

.test-pass .test-status { color: #059669; }
.test-fail .test-status { color: #dc2626; }

.test-error {
  margin: 0.25rem 0 0.25rem 3rem;
  padding: 0.3rem 0.5rem;
  background: #fef2f2;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #991b1b;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========== Structured Errors ========== */
.structured-errors {
  padding: 0 1rem;
}

.structured-error {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 0.25rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  font-size: 0.85rem;
}

.error-category {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: #fee2e2;
  color: #991b1b;
  margin-right: 0.5rem;
}

.error-suggestion {
  margin-top: 0.25rem;
  padding: 0.3rem 0.5rem;
  background: #fefce8;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #713f12;
}

/* ========== Failure Analysis ========== */
.failure-analysis {
  white-space: pre-wrap;
  font-size: 0.85rem;
  padding: 0.5rem;
  background: var(--pico-card-background-color);
  border-radius: 0.25rem;
}

/* ========== Runner Status ========== */
.runner-status { margin-bottom: 0.75rem; }
.runner-ready { color: #059669; }
.runner-missing { color: #d97706; }

/* ========== Run Mode Badges ========== */
.mode-sim {
  background: #dbeafe;
  color: #1e40af;
}
.mode-real {
  background: #fef3c7;
  color: #92400e;
}

/* ========== Run Mode Toggle ========== */
.run-mode-toggle {
  margin-bottom: 0.75rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0.75rem;
}
.run-mode-toggle legend {
  font-weight: 600;
  font-size: 0.85rem;
}
.run-mode-toggle label {
  margin-bottom: 0.25rem;
}

/* ========== REAL Warning ========== */
.real-warning {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: var(--pico-border-radius);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  font-size: 0.85rem;
  color: #92400e;
}

/* ========== Run Guidance ========== */
.run-guidance {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--pico-border-radius);
}
.guidance-success {
  background: #d1fae5;
  color: #065f46;
  padding: 0.75rem;
  border-radius: var(--pico-border-radius);
}
.guidance-failed {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: var(--pico-border-radius);
}

/* ========== Generation Options (debug loop) ========== */
.generation-options {
  margin: 0.5rem 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0 0.75rem;
}
.generation-options summary {
  cursor: pointer;
  padding: 0.4rem 0;
}
.generation-options textarea {
  margin-bottom: 0.25rem;
}

/* ========== Project Summary Banner ========== */
.project-summary-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  flex-wrap: wrap;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.summary-label {
  font-size: 0.7rem;
  color: var(--pico-muted-color);
}

.summary-effects {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ========== Tab Context Hint ========== */
.tab-context-hint {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin-bottom: 1rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0,0,0,0.02);
  border-radius: 4px;
  border-left: 3px solid var(--pico-muted-border-color);
}

/* ========== Per-runner readiness ========== */
.runner-readiness-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.runner-readiness-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
}

.runner-readiness-item.adapter-ready {
  border-color: #059669;
  background: #d1fae5;
}

.runner-readiness-item.adapter-no_secret {
  border-color: #d97706;
  background: #fef3c7;
}

.runner-readiness-item.adapter-no_dependency {
  border-color: #dc2626;
  background: #fee2e2;
}

/* ========== Run History Summary ========== */
.run-history-summary {
  margin-top: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
}

/* ========== Type-Aware Input Forms ========== */
.saga-input-field {
  margin-bottom: 0.75rem;
}

.saga-input-field > label {
  margin-bottom: 0.25rem;
}

.bool-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.media-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.media-url-input {
  flex: 1;
  margin-bottom: 0;
}

.media-file-btn {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  background: var(--pico-background-color);
  color: var(--pico-color);
}

.media-file-btn:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

.media-file-input {
  display: none;
}

.input-media-preview {
  max-width: 200px;
  max-height: 150px;
  border-radius: 4px;
  border: 1px solid var(--pico-muted-border-color);
  margin-top: 0.25rem;
}

.input-audio-preview {
  width: 100%;
  max-width: 400px;
  margin-top: 0.25rem;
}

.input-video-preview {
  max-width: 300px;
  max-height: 200px;
  margin-top: 0.25rem;
  border-radius: 4px;
}

.list-input {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-input-row {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.list-input-row input {
  margin-bottom: 0;
}

.list-remove-btn {
  padding: 0.2rem 0.5rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.list-add-btn {
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  margin: 0;
  align-self: flex-start;
}

/* ========== Output Rendering ========== */
.output-container {
  padding: 0.5rem 0;
}

.output-entry {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.output-entry:last-child {
  border-bottom: none;
}

.output-key {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.25rem;
}

.output-value {
  font-size: 0.9rem;
}

.output-value a {
  word-break: break-all;
}

.output-media {
  margin: 0.25rem 0;
}

.output-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--pico-muted-border-color);
  transition: transform 0.2s;
}

.output-image:hover {
  transform: scale(1.02);
}

.output-video {
  max-width: 100%;
  max-height: 400px;
  border-radius: 6px;
}

.output-audio {
  width: 100%;
  max-width: 500px;
}

.output-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.output-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--pico-muted-border-color);
}

.output-text {
  white-space: pre-wrap;
  font-size: 0.85rem;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
}

.output-json {
  white-space: pre-wrap;
  font-size: 0.82rem;
  margin: 0;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid var(--pico-muted-border-color);
  max-height: 300px;
  overflow-y: auto;
}

/* ========== Live Progress Panel ========== */
.progress-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: #fff;
  border-top: 2px solid var(--pico-primary);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  max-height: 50vh;
  overflow: hidden;
}

.progress-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: #f8fafc;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.progress-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}

.icon-running {
  background: #dbeafe;
  color: #1e40af;
  animation: pulse 1.5s infinite;
}

.icon-success {
  background: #d1fae5;
  color: #065f46;
}

.icon-error {
  background: #fee2e2;
  color: #991b1b;
}

.progress-panel-elapsed,
.progress-panel-duration {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  font-weight: 400;
}

.progress-panel-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-panel-toggle {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

.progress-panel-close {
  all: unset;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--pico-muted-color);
  padding: 0 0.3rem;
  line-height: 1;
}

.progress-panel-close:hover {
  color: var(--pico-del-color);
}

.progress-panel-body {
  padding: 0.5rem 1rem;
  max-height: 35vh;
  overflow-y: auto;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.82rem;
  border-radius: 3px;
}

.progress-step-phase {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  min-width: 5rem;
  text-align: center;
}

.progress-step-message {
  flex: 1;
}

.progress-step-time {
  font-size: 0.72rem;
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.progress-step-active {
  background: #eff6ff;
  font-weight: 500;
}

.progress-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-result {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.progress-result.result-success {
  background: #d1fae5;
  color: #065f46;
}

.progress-result.result-failure {
  background: #fee2e2;
  color: #991b1b;
}

/* ========== Saga Detail Page ========== */
.saga-handler-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.saga-handler-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
}

.saga-handler-link {
  font-weight: 600;
  color: var(--pico-primary);
  text-decoration: none;
  cursor: pointer;
}

.saga-handler-link:hover {
  text-decoration: underline;
}
