/* WorkflowsPage — page-specific styles (prefix: wf-) */

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Page header ───────────────────────────────────────── */
.wf-h1 {
  font-size: var(--kr-fs-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--kr-text-primary);
  margin: 0;
}

.wf-meta {
  font-size: var(--kr-fs-base);
  color: var(--kr-text-faint);
  margin: var(--kr-sp-2) 0 0;
}

/* ── Empty state ───────────────────────────────────────── */
.wf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--kr-text-faint);
  font-size: var(--kr-fs-md);
}

/* ── Create button ─────────────────────────────────────── */
.wf-create-btn {
  padding: var(--kr-sp-4) var(--kr-sp-8);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-accent-border);
  background: var(--kr-accent-bg-hover);
  color: var(--kr-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-base);
  font-family: inherit;
  font-weight: 600;
}

.wf-create-ai-btn {
  padding: var(--kr-sp-4) var(--kr-sp-8);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-accent-border);
  background: var(--kr-accent);
  color: var(--kr-text-on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-base);
  font-family: inherit;
  font-weight: 700;
  transition: opacity 0.15s;
}
.wf-create-ai-btn:hover { opacity: 0.85; }

/* ── Cards ─────────────────────────────────────────────── */
.wf-card {
  padding: 14px var(--kr-sp-8);
  border-radius: var(--kr-r-xl);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
  cursor: pointer;
  margin-bottom: var(--kr-sp-4);
  margin-top: var(--kr-sp-3);
  margin-left: var(--kr-sp-4);
}

.wf-card[data-active="true"] {
  background: var(--kr-accent-bg);
  border-color: rgba(var(--kr-accent-rgb), 0.15);
}

/* In-flight workflows: subtle cyan glow on the left edge so the user
   can spot active runs at a glance in long workflow lists. The
   spinner next to the name is the primary signal; this border is the
   secondary, peripherally-visible one. Stays subtle to avoid stealing
   attention from data-active="true" (current selection). */
.wf-card[data-running="true"] {
  border-left: 2px solid var(--kr-cyan);
}

/* ── Small button ──────────────────────────────────────── */
.wf-small-btn {
  padding: var(--kr-sp-2) var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-hover);
  color: var(--kr-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  font-size: var(--kr-fs-xs);
  font-family: inherit;
}

.wf-small-btn-accent {
  background: var(--kr-accent-bg-hover);
}

.wf-small-btn-danger {
  color: var(--kr-error);
  border-color: rgba(var(--kr-error-rgb), 0.2);
}

.wf-small-btn-delete-all {
  color: var(--kr-error);
  background: rgba(var(--kr-error-rgb), 0.06);
  border: 1px solid rgba(var(--kr-error-rgb), 0.15);
}

/* ── Icon button ───────────────────────────────────────── */
.wf-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--kr-sp-2);
  color: var(--kr-text-dim);
  display: flex;
  align-items: center;
}

/* ── Trigger badge ─────────────────────────────────────── */
.wf-trigger-badge {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: 2px var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  font-size: var(--kr-fs-xs);
  font-weight: 600;
}

.wf-trigger-badge[data-type="cron"] {
  background: rgba(var(--kr-cyan-rgb), 0.08);
  color: var(--kr-cyan);
  border: 1px solid rgba(var(--kr-cyan-rgb), 0.15);
}

.wf-trigger-badge[data-type="tracker"] {
  background: rgba(var(--kr-purple-rgb), 0.08);
  color: var(--kr-purple);
  border: 1px solid rgba(var(--kr-purple-rgb), 0.15);
}

.wf-trigger-badge[data-type="manual"] {
  background: var(--kr-accent-bg-hover);
  color: var(--kr-accent);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.15);
}

/* ── Detail panel ──────────────────────────────────────── */
.wf-detail-panel {
  padding: var(--kr-sp-8) var(--kr-sp-9);
  border-radius: var(--kr-r-xl);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
}

.wf-info-row {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-4);
  font-size: var(--kr-fs-base);
  margin-bottom: var(--kr-sp-3);
  color: var(--kr-text-tertiary);
}

.wf-info-label {
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  color: var(--kr-text-muted);
  width: 100px;
}

.wf-section-title {
  font-size: var(--kr-fs-base);
  font-weight: 700;
  color: var(--kr-text-tertiary);
  margin-top: var(--kr-sp-8);
  margin-bottom: var(--kr-sp-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Step card (detail view) ───────────────────────────── */
.wf-step-card {
  padding: var(--kr-sp-5) 14px;
  border-radius: var(--kr-r-lg);
  margin-bottom: var(--kr-sp-3);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
}

.wf-step-number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--kr-fs-xs);
  font-weight: 700;
  background: rgba(var(--kr-accent-rgb), 0.1);
  color: var(--kr-accent);
}

/* Inline variant rendered next to "→ Goto" in the on_result recap.
   Same shape as the row badge so the user reads "Goto (3)" as
   "jump to step 3", but slightly smaller because it sits inside
   prose at text-xs size. */
.wf-step-number-chip {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.wf-step-prompt-preview {
  margin-top: var(--kr-sp-3);
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-muted);
  font-family: var(--kr-font-mono);
  white-space: pre-wrap;
  max-height: 60px;
  overflow: hidden;
}

/* ── Run card ──────────────────────────────────────────── */
.wf-run-card {
  padding: var(--kr-sp-5) 14px;
  border-radius: var(--kr-r-lg);
  margin-top: var(--kr-sp-4);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
}

.wf-run-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--kr-text-ghost);
  display: flex;
  align-items: center;
}

.wf-run-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(var(--kr-error-rgb), 0.08);
  border: 1px solid rgba(var(--kr-error-rgb), 0.3);
  border-radius: 10px;
  color: var(--kr-error);
  font-size: var(--kr-fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.wf-run-cancel-btn:hover {
  background: rgba(var(--kr-error-rgb), 0.18);
  border-color: rgba(var(--kr-error-rgb), 0.55);
}

/* ── Inline stop button on workflow cards (list) ─────── */
.wf-card-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: auto;
  background: rgba(var(--kr-error-rgb), 0.08);
  border: 1px solid rgba(var(--kr-error-rgb), 0.3);
  border-radius: 10px;
  color: var(--kr-error);
  font-size: var(--kr-fs-2xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.wf-card-stop-btn:hover:not(:disabled) {
  background: rgba(var(--kr-error-rgb), 0.18);
  border-color: rgba(var(--kr-error-rgb), 0.55);
}

.wf-card-stop-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Run step progress dots ────────────────────────────── */
.wf-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wf-step-dot-pending {
  background: var(--kr-bg-active);
}

.wf-step-dot-next {
  background: var(--kr-warning);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── Step type badge (API/AGENT) ───────────────────────── */
.wf-step-type-badge {
  font-size: 8px;
  padding: 0 var(--kr-sp-2);
  border-radius: var(--kr-r-xs);
}

.wf-step-type-badge[data-type="api"] {
  background: rgba(var(--kr-cyan-rgb), 0.08);
  color: rgba(var(--kr-cyan-rgb), 0.5);
}

.wf-step-type-badge[data-type="agent"] {
  background: rgba(var(--kr-accent-rgb), 0.06);
  color: rgba(var(--kr-accent-rgb), 0.4);
}

/* ── Step result button (expandable) ───────────────────── */
.wf-step-result {
  margin-top: var(--kr-sp-2);
  border-radius: var(--kr-r-md);
}

.wf-step-result[data-expanded="true"] {
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-subtle);
}

.wf-step-result[data-expanded="false"] {
  border: 1px solid transparent;
  background: transparent;
}

.wf-step-result-btn {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-sm);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.wf-step-result-btn[data-expanded="true"] {
  padding: var(--kr-sp-3) var(--kr-sp-4);
}

.wf-step-result-btn[data-expanded="false"] {
  padding: 2px 0;
}

.wf-step-result-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wf-condition-badge {
  font-size: var(--kr-fs-2xs);
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  font-weight: 600;
}

.wf-condition-badge[data-action="stop"] {
  background: rgba(var(--kr-warning-rgb), 0.1);
  color: var(--kr-warning);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.2);
}

.wf-condition-badge[data-action="other"] {
  background: rgba(var(--kr-cyan-rgb), 0.1);
  color: var(--kr-cyan);
  border: 1px solid rgba(var(--kr-cyan-rgb), 0.2);
}

.wf-step-output-preview {
  color: var(--kr-text-ghost);
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-xs);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-step-output-full {
  padding: var(--kr-sp-4) var(--kr-sp-5);
  border-top: 1px solid var(--kr-border-light);
}

.wf-step-output-code {
  padding: var(--kr-sp-5) var(--kr-sp-6);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-code);
  border: 1px solid var(--kr-border-light);
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-sm);
  line-height: 1.6;
  /* `bg-code` stays dark in BOTH themes by design (IDE convention).
     `text-secondary` is dark-on-light in light theme → noir-sur-noir
     bug in light mode. Pin to `text-on-dark` so the contrast is
     correct regardless of theme. */
  color: var(--kr-text-on-dark);
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  word-break: break-word;
}

/* ── Live run progress ─────────────────────────────────── */
.wf-live-run {
  margin-top: var(--kr-sp-8);
  padding: var(--kr-sp-6) 14px;
  border-radius: var(--kr-r-lg);
  background: linear-gradient(135deg, rgba(var(--kr-cyan-rgb), 0.04), rgba(var(--kr-accent-rgb), 0.04));
  border: 1px solid rgba(var(--kr-cyan-rgb), 0.15);
}

.wf-progress-bar-track {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--kr-bg-hover-strong);
  margin-bottom: var(--kr-sp-5);
  overflow: hidden;
}

.wf-progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--kr-cyan), var(--kr-accent));
  transition: width 0.5s ease;
}

/* ── Live step indicators ──────────────────────────────── */
.wf-live-step {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-4);
  padding: 5px var(--kr-sp-4);
  margin-top: 2px;
  border-radius: var(--kr-r-md);
  transition: background 0.3s;
}

.wf-live-step[data-state="current"] {
  background: rgba(var(--kr-cyan-rgb), 0.06);
}

.wf-live-step-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wf-live-step-icon[data-state="success"] {
  background: rgba(var(--kr-success-rgb), 0.15);
}

.wf-live-step-icon[data-state="failed"] {
  background: rgba(var(--kr-error-rgb), 0.15);
}

.wf-live-step-icon[data-state="current"] {
  background: rgba(var(--kr-cyan-rgb), 0.15);
}

.wf-live-step-icon[data-state="pending"] {
  background: var(--kr-bg-hover);
}

.wf-live-step-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kr-cyan);
  animation: pulse 1.5s ease-in-out infinite;
}

.wf-live-step-dot-pending {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--kr-bg-selected);
}

.wf-live-step-name {
  font-size: var(--kr-fs-sm);
  flex: 1;
}

.wf-live-step-name[data-state="completed"] {
  font-weight: 500;
  color: var(--kr-text-tertiary);
}

.wf-live-step-name[data-state="current"] {
  font-weight: 600;
  color: var(--kr-text-on-dark);
}

.wf-live-step-name[data-state="pending"] {
  font-weight: 500;
  color: var(--kr-text-ghost);
}

.wf-live-step-in-progress {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-cyan);
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── Live run finished banner ──────────────────────────── */
.wf-live-finished {
  margin-top: var(--kr-sp-8);
  padding: var(--kr-sp-5) 14px;
  border-radius: var(--kr-r-lg);
  display: flex;
  align-items: center;
  gap: var(--kr-sp-4);
}

.wf-live-finished[data-status="success"] {
  background: rgba(var(--kr-success-rgb), 0.06);
  border: 1px solid rgba(var(--kr-success-rgb), 0.2);
}

.wf-live-finished[data-status="failed"] {
  background: rgba(var(--kr-error-rgb), 0.06);
  border: 1px solid rgba(var(--kr-error-rgb), 0.2);
}

/* Paused on a Gate — distinct from success/failed. Amber/warn tone signals
   "your turn", not "broken". */
.wf-live-finished[data-status="waiting"] {
  background: rgba(var(--kr-warning-rgb), 0.07);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.25);
}

/* ── Group header ──────────────────────────────────────── */
.wf-group-header {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  cursor: pointer;
  border-radius: var(--kr-r-md);
  font-size: var(--kr-fs-base);
  font-weight: 600;
  color: var(--kr-text-secondary);
  background: var(--kr-bg-hover);
  user-select: none;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

/* ── Back button (mobile) ──────────────────────────────── */
.wf-back-btn {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: var(--kr-sp-3) var(--kr-sp-5);
  background: var(--kr-bg-hover-strong);
  border: 1px solid var(--kr-border-light);
  border-radius: var(--kr-r-md);
  color: var(--kr-text-secondary);
  font-size: var(--kr-fs-base);
  cursor: pointer;
  margin-bottom: var(--kr-sp-4);
  font-family: inherit;
}

/* ── Wizard card ───────────────────────────────────────── */
.wf-wizard-card {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--kr-sp-10);
  border-radius: var(--kr-r-2xl);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
}

/* ── Wizard progress bar ───────────────────────────────── */
.wf-wizard-progress-segment {
  height: 3px;
  border-radius: 2px;
  margin-bottom: var(--kr-sp-2);
}

.wf-wizard-progress-segment[data-active="true"] {
  background: var(--kr-accent);
}

.wf-wizard-progress-segment[data-active="false"] {
  background: var(--kr-border-light);
}

/* ── Form elements ─────────────────────────────────────── */
.wf-label {
  display: block;
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  color: var(--kr-text-tertiary);
  margin-bottom: var(--kr-sp-2);
}

.wf-input {
  width: 100%;
  padding: 9px var(--kr-sp-6);
  background: var(--kr-bg-input);
  border: 1px solid var(--kr-border-strong);
  border-radius: var(--kr-r-lg);
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-md);
  font-family: inherit;
  box-sizing: border-box;
}

/* Required-but-empty input — discreet amber border so the user
   notices the field needs filling, without screaming red on a
   neutral first-render state. */
.wf-input-required-empty {
  border-color: rgba(var(--kr-warning-rgb), 0.5);
}

.wf-input-required-empty:focus {
  outline: 1px solid rgba(var(--kr-warning-rgb), 0.7);
  outline-offset: -1px;
}

.wf-required-marker {
  color: rgba(var(--kr-warning-rgb), 0.95);
  margin-left: 2px;
}

.wf-field-hint {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-ghost);
  margin-top: 4px;
}

.wf-field-hint-required {
  color: rgba(var(--kr-warning-rgb), 0.95);
}

.wf-select {
  padding: 9px var(--kr-sp-6);
  background: var(--kr-bg-input);
  border: 1px solid var(--kr-border-strong);
  border-radius: var(--kr-r-lg);
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-md);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.wf-starters {
  margin-bottom: var(--kr-sp-4);
}
.wf-starters-label {
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-muted);
  margin-bottom: var(--kr-sp-3);
  display: block;
}
.wf-starters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--kr-sp-3);
}
@media (max-width: 600px) {
  .wf-starters-grid { grid-template-columns: repeat(2, 1fr); }
}
.wf-starter-card {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-4) var(--kr-sp-5);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-border);
  background: var(--kr-bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}
.wf-starter-card:hover {
  border-color: var(--kr-accent);
  background: rgba(var(--kr-accent-rgb, 99, 102, 241), 0.06);
}
.wf-starter-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.wf-starter-title {
  font-size: var(--kr-fs-sm);
  font-weight: 500;
  color: var(--kr-text-primary);
}

/* ── Step test panel ─────────────────────────────── */
.wf-test-btn {
  margin-left: auto;
  font-size: var(--kr-fs-xs);
  font-weight: 500;
  padding: 2px var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-border);
  background: transparent;
  color: var(--kr-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s;
}
.wf-test-btn:hover { border-color: var(--kr-accent); color: var(--kr-accent); }

.wf-test-panel {
  margin-top: var(--kr-sp-4);
  padding: var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-input);
  border: 1px solid var(--kr-border);
}
.wf-test-textarea {
  width: 100%;
  padding: var(--kr-sp-4);
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-sm);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border);
  border-radius: var(--kr-r-sm);
  color: var(--kr-text-primary);
  resize: vertical;
}
.wf-test-info {
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-muted);
  line-height: 1.5;
  margin-bottom: var(--kr-sp-4);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  background: rgba(var(--kr-info-rgb), 0.06);
  border-radius: var(--kr-r-sm);
  border-left: 3px solid var(--kr-accent);
}
.wf-test-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--kr-sp-4);
  gap: var(--kr-sp-4);
}
.wf-test-actions-right {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
}
.wf-test-dryrun-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-secondary);
}
.wf-test-run-btn {
  font-size: var(--kr-fs-sm);
  font-weight: 700;
  padding: var(--kr-sp-3) var(--kr-sp-6);
  border-radius: var(--kr-r-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--kr-accent);
  color: var(--kr-text-on-accent);
  transition: opacity 0.15s;
}
.wf-test-run-btn:hover { opacity: 0.85; }
.wf-test-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wf-test-cancel-btn {
  font-size: var(--kr-fs-sm);
  font-weight: 500;
  padding: var(--kr-sp-3) var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  border: 1px solid rgba(var(--kr-error-rgb), 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(var(--kr-error-rgb), 0.1);
  color: rgba(var(--kr-error-rgb), 0.9);
}
.wf-test-btn[data-active="true"] {
  border-color: var(--kr-accent);
  color: var(--kr-accent);
}
.wf-test-live {
  border-radius: var(--kr-r-sm);
  overflow: hidden;
}
.wf-test-live-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  color: var(--kr-accent);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border);
  border-bottom: none;
  border-radius: var(--kr-r-sm) var(--kr-r-sm) 0 0;
}
.wf-test-elapsed {
  margin-left: auto;
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
}
.wf-test-live-output {
  margin: 0;
  padding: var(--kr-sp-4);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border);
  border-radius: 0 0 var(--kr-r-sm) var(--kr-r-sm);
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-sm);
  white-space: pre-wrap;
  max-height: 350px;
  overflow-y: auto;
  color: var(--kr-text-primary);
  line-height: 1.6;
}
.wf-test-error {
  font-size: var(--kr-fs-sm);
  color: var(--kr-error);
  padding: var(--kr-sp-3);
  background: rgba(var(--kr-error-rgb), 0.08);
  border-radius: var(--kr-r-sm);
}
/* Non-blocking warning — preview ran but config has a smell. Orange so it
   doesn't get confused with the red error block. */
.wf-test-warning {
  font-size: var(--kr-fs-sm);
  color: var(--kr-warning-amber);
  padding: var(--kr-sp-3);
  background: rgba(var(--kr-warning-amber-rgb), 0.08);
  border-left: 3px solid var(--kr-warning-amber);
  border-radius: var(--kr-r-sm);
}
.wf-test-warning ul {
  color: var(--kr-text-muted);
  font-size: var(--kr-fs-xs);
}
.wf-test-result { border-top: 1px solid var(--kr-border); padding-top: var(--kr-sp-4); }
.wf-test-status {
  font-size: var(--kr-fs-xs);
  font-weight: 700;
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
}
.wf-test-status-success { background: rgba(var(--kr-success-rgb), 0.15); color: rgba(var(--kr-success-rgb), 0.9); }
.wf-test-status-failed { background: rgba(var(--kr-error-rgb), 0.15); color: rgba(var(--kr-error-rgb), 0.9); }
.wf-test-output {
  margin-top: var(--kr-sp-3);
  padding: var(--kr-sp-4);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border);
  border-radius: var(--kr-r-sm);
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-sm);
  white-space: pre-wrap;
  max-height: 400px;
  overflow: auto;
  color: var(--kr-text-primary);
}

.wf-textarea {
  width: 100%;
  padding: 9px var(--kr-sp-6);
  background: var(--kr-bg-input);
  border: 1px solid var(--kr-border-strong);
  border-radius: var(--kr-r-lg);
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-md);
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.5;
}

/* ── Trigger type buttons ──────────────────────────────── */
.wf-trigger-btn {
  flex: 1;
  padding: var(--kr-sp-5) var(--kr-sp-6);
  border-radius: var(--kr-r-lg);
  border: 1px solid;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-base);
  font-family: inherit;
  font-weight: 600;
}

.wf-trigger-btn[data-selected="true"] {
  background: rgba(var(--kr-accent-rgb), 0.1);
  border-color: rgba(var(--kr-accent-rgb), 0.3);
  color: var(--kr-accent);
}

.wf-trigger-btn[data-selected="false"] {
  background: var(--kr-bg-hover);
  border-color: var(--kr-border-light);
  color: var(--kr-text-muted);
}

/* ── Step edit card ────────────────────────────────────── */
.wf-step-edit-card {
  padding: var(--kr-sp-6) 14px;
  border-radius: var(--kr-r-lg);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
}

/* ── Step type toggle buttons ──────────────────────────── */
/* 0.6.0 UX pass — step type selector. Equal-width buttons with icon
   + short label, gap-aligned. Avoids the "Notify=6char vs Récupérer
   des données=21char" width-jump that Marie flaggait. The data-type
   colour overrides are applied per-type when selected. */
.wf-step-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wf-step-type-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 92px;
  padding: 5px 10px;
  font-size: var(--kr-fs-xs);
  font-weight: 500;
  border-radius: var(--kr-r-sm);
  cursor: pointer;
  border: 1px solid var(--kr-border-medium);
  background: transparent;
  color: var(--kr-text-muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wf-step-type-btn:hover:not([data-selected="true"]) {
  background: var(--kr-bg-elevated);
  color: var(--kr-text-secondary);
}

/* Caption below the type row — surfaces the selected type's role
   without requiring a hover. Italic to read as "secondary info". */
.wf-step-type-caption {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-faint);
  font-style: italic;
  padding-left: 2px;
}

/* 0.6.0 UX pass — Insert-here divider between steps. Discrete by
   default (a thin line + small + button), expands on hover with a
   label. Pattern from Notion / Linear "add row" affordance. Lets
   the user insert a step before the first one OR between any two
   existing ones, without having to drag-drop. */
.wf-step-insert-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 14px;
  margin: -4px 0;        /* reduce visual gap when no hover */
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.wf-step-insert-divider:hover {
  opacity: 1;
}

.wf-step-insert-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--kr-border-faint);
  z-index: 0;
}

.wf-step-insert-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--kr-fs-2xs, 10px);
  font-weight: 600;
  color: var(--kr-text-muted);
  background: var(--kr-bg-base);
  border: 1px solid var(--kr-border-faint);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
}

.wf-step-insert-btn:hover {
  color: var(--kr-accent);
  border-color: rgba(var(--kr-accent-rgb), 0.4);
  background: rgba(var(--kr-accent-rgb), 0.06);
}

.wf-step-insert-btn span {
  /* Hide the label by default, show on hover for discoverable
     compactness (Marie said the buttons feel cluttered). */
  display: none;
}

.wf-step-insert-divider:hover .wf-step-insert-btn span {
  display: inline;
}

/* 0.6.0 UX pass — Conditions on_result, layout 2 lignes.
   La rangée précédente (1 ligne) débordait dès qu'on choisissait Goto :
   action select 220px + step select 140px + max input 56px + 2 labels
   = ~500px de fixe, ne laissant plus de place pour `contains`.
   Ici on stack : ligne 1 = label + input plein large + remove,
                  ligne 2 = → + action + (si Goto) target + max + N + label.
   Wrap-friendly sur les écrans étroits (line2 reste dense mais flex-wrap). */
.wf-condition-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--kr-border-faint);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-elevated);
}

.wf-condition-row-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wf-condition-row-line2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: var(--kr-sp-3);
}

.wf-condition-action-select {
  flex: 0 0 auto;
  width: 220px;
  max-width: 100%;
}

.wf-condition-goto-select {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
}

.wf-step-type-btn[data-type="agent"][data-selected="true"] {
  background: rgba(var(--kr-accent-rgb), 0.12);
  color: var(--kr-accent);
  border-color: rgba(var(--kr-accent-rgb), 0.3);
}

.wf-step-type-btn[data-type="api"][data-selected="true"] {
  background: rgba(var(--kr-cyan-rgb), 0.12);
  color: var(--kr-cyan);
  border-color: rgba(var(--kr-cyan-rgb), 0.3);
}

.wf-step-type-btn[data-type="gate"][data-selected="true"] {
  background: rgba(var(--kr-warning-rgb), 0.12);
  color: var(--kr-warning);
  border-color: rgba(var(--kr-warning-rgb), 0.3);
}

.wf-step-type-btn[data-type="exec"][data-selected="true"] {
  background: rgba(var(--kr-error-rgb), 0.12);
  color: var(--kr-error);
  border-color: rgba(var(--kr-error-rgb), 0.3);
}

/* 0.7+ — homogénéiser les autres step types qui n'avaient pas de variant
   sélectionné, pour que l'utilisateur voit clairement quel type est actif
   sur chaque step (pas juste sur Agent/API/Gate/Exec). */
.wf-step-type-btn[data-type="batch-qp"][data-selected="true"] {
  background: rgba(var(--kr-purple-rgb), 0.12);
  color: var(--kr-purple, rgb(var(--kr-purple-rgb)));
  border-color: rgba(var(--kr-purple-rgb), 0.3);
}

.wf-step-type-btn[data-type="batch-api"][data-selected="true"] {
  background: rgba(var(--kr-info-rgb), 0.12);
  color: var(--kr-info, rgb(var(--kr-info-rgb)));
  border-color: rgba(var(--kr-info-rgb), 0.3);
}

.wf-step-type-btn[data-type="notify"][data-selected="true"] {
  background: rgba(var(--kr-success-rgb), 0.12);
  color: var(--kr-success);
  border-color: rgba(var(--kr-success-rgb), 0.3);
}

.wf-step-type-btn[data-type="json-data"][data-selected="true"] {
  background: rgba(var(--kr-cyan-rgb), 0.12);
  color: var(--kr-cyan, rgb(var(--kr-cyan-rgb)));
  border-color: rgba(var(--kr-cyan-rgb), 0.3);
}

.wf-exec-form {
  display: flex;
  flex-direction: column;
  padding: var(--kr-sp-4);
  border: 1px solid rgba(var(--kr-error-rgb), 0.25);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-error-rgb), 0.04);
}

/* 0.7.0 Phase 5b — actionable CTA inside the "Exec disabled" warning.
   Inverts the surrounding warning's tint so the button stands out as
   the primary action, not part of the message. */
.wf-allowlist-cta {
  padding: 4px 10px;
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-bg-base);
  background: var(--kr-warning);
  border: 1px solid var(--kr-warning);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease;
}

.wf-allowlist-cta:hover {
  filter: brightness(1.1);
}

.wf-gate-form {
  display: flex;
  flex-direction: column;
  padding: var(--kr-sp-4);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.25);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-warning-rgb), 0.05);
}

/* 0.7.0 Phase 7 — workflow-level rollback section in wizard.
   Visually offset from the main steps with an amber tint to read
   as a "fail-only / safety net" rather than a regular step. */
.wf-rollback-section {
  padding: var(--kr-sp-5);
  border: 1px dashed rgba(var(--kr-warning-rgb), 0.35);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-warning-rgb), 0.04);
}

.wf-rollback-step {
  padding: var(--kr-sp-4);
  border: 1px solid var(--kr-border-faint);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-elevated);
}

/* 0.7.0 UX pass — Per-item export / import (workflow + QP).
   Modal-style overlay with a drag-and-drop dropzone fallback to file
   picker. Preview block + project dropdown before confirm. */
.wf-create-btn-secondary {
  background: transparent;
  color: var(--kr-text-secondary);
  border: 1px solid var(--kr-border-medium);
}

.wf-create-btn-secondary:hover {
  background: var(--kr-bg-hover);
}

.wf-import-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--kr-sp-5);
}

.wf-import-modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--kr-sp-6);
  background: var(--kr-bg-base);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-border-medium);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.wf-import-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--kr-sp-7) var(--kr-sp-5);
  border: 2px dashed var(--kr-border-medium);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-elevated);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wf-import-dropzone[data-drag-over="true"] {
  border-color: var(--kr-accent);
  background: rgba(var(--kr-accent-rgb), 0.06);
}

.wf-import-dropzone-icon {
  color: var(--kr-text-muted);
  margin-bottom: var(--kr-sp-4);
}

.wf-import-dropzone-title {
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  color: var(--kr-text-primary);
  margin-bottom: var(--kr-sp-2);
}

.wf-import-dropzone-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
  margin-bottom: var(--kr-sp-4);
}

.wf-import-dropzone-pick-btn {
  padding: 5px 14px;
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-accent);
  background: rgba(var(--kr-accent-rgb), 0.1);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.3);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
}

.wf-import-dropzone-pick-btn:hover {
  background: rgba(var(--kr-accent-rgb), 0.18);
}

.wf-import-dropzone-error {
  margin-top: var(--kr-sp-3);
  font-size: var(--kr-fs-xs);
  color: var(--kr-error);
}

.wf-import-dropzone-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--kr-text-faint);
  border: none;
  cursor: pointer;
}

.wf-import-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border-faint);
}

/* B4 (0.7.0 UX pass) — Bandeau "Démarrer depuis un pattern" en haut
   du wizard Steps. 3 cartes de présets non-triviaux. Auto-disparaît
   dès que l'user customise. */
.wf-presets-bandeau {
  padding: var(--kr-sp-5);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.3);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-accent-rgb), 0.04);
}

.wf-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--kr-sp-4);
}

.wf-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: var(--kr-sp-4) var(--kr-sp-5);
  border: 1px solid var(--kr-border-medium);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}

.wf-preset-card:hover {
  border-color: var(--kr-accent);
  transform: translateY(-2px);
}

.wf-preset-icon {
  font-size: 24px;
  line-height: 1;
  margin-bottom: var(--kr-sp-3);
}

.wf-preset-title {
  font-size: var(--kr-fs-sm);
  font-weight: 700;
  color: var(--kr-text-primary);
  margin-bottom: var(--kr-sp-2);
}

.wf-preset-desc {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
  line-height: 1.4;
  margin-bottom: var(--kr-sp-3);
}

.wf-preset-primitives {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.wf-preset-chip {
  padding: 1px 6px;
  font-size: var(--kr-fs-2xs, 10px);
  font-weight: 600;
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-accent-rgb), 0.1);
  color: var(--kr-accent);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.25);
}

/* B3 (0.7.0 UX pass) — STATE pedagogy chips. Show up only when the
   step is part of a Goto loop (source or target). Color: accent-ink
   (cyan/blue) to read as "informational shortcut", distinct from the
   warning ambres around Gate/Rollback and the error red of Exec. */
.wf-state-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-cyan-rgb), 0.06);
  border: 1px dashed rgba(var(--kr-cyan-rgb), 0.3);
}

.wf-state-chip {
  padding: 3px 8px;
  font-size: var(--kr-fs-xs);
  font-weight: 500;
  color: var(--kr-cyan);
  background: rgba(var(--kr-cyan-rgb), 0.12);
  border: 1px solid rgba(var(--kr-cyan-rgb), 0.3);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
  font-family: var(--kr-font-mono, monospace);
  white-space: nowrap;
}

.wf-state-chip:hover {
  background: rgba(var(--kr-cyan-rgb), 0.2);
}

/* P2 (0.6.0 UX pass) — Undeclared variable warning under prompts.
   Same visual language as the rollback matrix (warning ambré sur fond
   subtil), avec une chip par var non-déclarée + bouton actionnable
   pour la déclarer en 1 clic. */
.wf-undeclared-warning {
  padding: 8px 10px;
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-warning-rgb), 0.06);
  border: 1px dashed rgba(var(--kr-warning-rgb), 0.4);
}

.wf-undeclared-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: var(--kr-fs-xs);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-elevated);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.3);
}

.wf-undeclared-chip code {
  font-family: var(--kr-font-mono, monospace);
  color: var(--kr-warning);
}

.wf-undeclared-add-btn {
  padding: 1px 6px;
  font-size: var(--kr-fs-2xs, 10px);
  font-weight: 600;
  color: var(--kr-bg-base);
  background: var(--kr-warning);
  border: 1px solid var(--kr-warning);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
  white-space: nowrap;
}

.wf-undeclared-add-btn:hover {
  filter: brightness(1.1);
}

/* B6 (0.7.0 UX pass) — matrice "rollback fire conditions" inline.
   Petite typographie, espacée, le ✓/✗ en colonne fixe pour scan rapide. */
.wf-rollback-matrix {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 10px;
  padding: var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border-faint);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
}

.wf-rollback-matrix-row {
  display: contents;
}

.wf-rollback-matrix-row[data-fires="true"] > span:first-child {
  color: var(--kr-success);
  font-weight: 600;
}

.wf-rollback-matrix-row > span:first-child {
  color: var(--kr-text-faint);
  text-align: center;
  width: 16px;
}

.wf-rollback-matrix-row[data-fires="true"] > span:last-child {
  color: var(--kr-text-secondary);
}

.wf-step-type-btn[data-selected="false"] {
  background: transparent;
  color: var(--kr-text-muted);
  border-color: var(--kr-border-medium);
}

/* ── Add step button ───────────────────────────────────── */
.wf-add-step-btn {
  width: 100%;
  padding: var(--kr-sp-4) var(--kr-sp-6);
  border-radius: var(--kr-r-lg);
  border: 1px dashed var(--kr-border-strong);
  background: transparent;
  color: var(--kr-text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-sm);
  font-family: inherit;
}

.wf-add-step-btn-inline {
  padding: var(--kr-sp-2) var(--kr-sp-4);
  font-size: var(--kr-fs-xs);
  width: auto;
}

.wf-add-step-btn-preset {
  padding: 3px var(--kr-sp-4);
  font-size: var(--kr-fs-2xs);
  width: auto;
  border-style: solid;
}

/* ── Chip / pill buttons (skills, profiles, directives) ── */
.wf-chip {
  padding: 3px var(--kr-sp-4);
  border-radius: 10px;
  font-size: var(--kr-fs-xs);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}

.wf-chip-skill[data-selected="true"] {
  font-weight: 600;
  border: 1px solid rgba(var(--kr-accent-rgb), 0.4);
  background: rgba(var(--kr-accent-rgb), 0.1);
  color: var(--kr-accent);
}

.wf-chip-skill[data-selected="false"] {
  font-weight: 400;
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-hover);
  color: var(--kr-text-muted);
}

.wf-chip-profile-none[data-selected="true"] {
  font-weight: 600;
  border: 1px solid rgba(var(--kr-purple-rgb), 0.4);
  background: rgba(var(--kr-purple-rgb), 0.1);
  color: var(--kr-purple-soft);
}

.wf-chip-profile-none[data-selected="false"] {
  font-weight: 400;
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-hover);
  color: var(--kr-text-muted);
}

/* Profile chips with dynamic color need inline style for color */
.wf-chip-profile[data-selected="false"] {
  font-weight: 400;
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-hover);
  color: var(--kr-text-muted);
}

.wf-chip-directive[data-selected="true"] {
  font-weight: 600;
  border: 1px solid rgba(var(--kr-warning-amber-rgb), 0.4);
  background: rgba(var(--kr-warning-amber-rgb), 0.1);
  color: var(--kr-warning-soft);
}

.wf-chip-directive[data-selected="false"] {
  font-weight: 400;
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-hover);
  color: var(--kr-text-muted);
}

/* ── Selector label ────────────────────────────────────── */
.wf-selector-label {
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-text-muted);
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
}

/* ── Advanced toggle ───────────────────────────────────── */
.wf-advanced-toggle {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  margin-top: var(--kr-sp-4);
  padding: var(--kr-sp-2) var(--kr-sp-4);
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--kr-fs-xs);
  font-family: inherit;
}

.wf-advanced-panel {
  margin-top: var(--kr-sp-4);
  padding: var(--kr-sp-5) var(--kr-sp-6);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-light);
}

/* ── Summary ───────────────────────────────────────────── */
.wf-summary-row {
  font-size: var(--kr-fs-base);
  padding: var(--kr-sp-2) 0;
  color: var(--kr-text-tertiary);
}

.wf-summary-label {
  font-weight: 600;
  color: var(--kr-text-muted);
  margin-right: var(--kr-sp-4);
  display: inline-block;
  width: 70px;
}

.wf-summary-step-type {
  padding: 1px 5px;
  border-radius: var(--kr-r-xs);
  font-size: var(--kr-fs-2xs);
  font-weight: 600;
  margin-right: var(--kr-sp-2);
}

.wf-summary-step-type[data-type="api"] {
  background: rgba(var(--kr-cyan-rgb), 0.1);
  color: var(--kr-cyan);
}

.wf-summary-step-type[data-type="agent"] {
  background: rgba(var(--kr-accent-rgb), 0.08);
  color: var(--kr-accent-text);
}

/* ── Help panel ────────────────────────────────────────── */
.wf-small-help-btn {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-3) var(--kr-sp-6);
  border-radius: var(--kr-r-md);
  border: 1px solid;
  font-size: var(--kr-fs-sm);
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
}

.wf-small-help-btn[data-open="true"] {
  background: rgba(var(--kr-accent-rgb), 0.06);
  border-color: rgba(var(--kr-accent-rgb), 0.2);
  color: var(--kr-accent);
}

.wf-small-help-btn[data-open="false"] {
  background: var(--kr-bg-hover);
  border-color: var(--kr-border-light);
  color: var(--kr-text-muted);
}

.wf-help-panel {
  padding: 14px var(--kr-sp-8);
  border-radius: var(--kr-r-lg);
  margin-bottom: 14px;
  background: rgba(var(--kr-accent-rgb), 0.02);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.08);
}

.wf-help-section {
  margin-bottom: var(--kr-sp-6);
}

.wf-help-title {
  font-size: var(--kr-fs-sm);
  font-weight: 700;
  color: var(--kr-text-muted);
  margin-bottom: var(--kr-sp-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wf-help-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wf-help-row {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-5);
  font-size: var(--kr-fs-sm);
}

.wf-help-code {
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-sm);
  color: var(--kr-accent);
  background: rgba(var(--kr-accent-rgb), 0.06);
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}

.wf-help-code:hover {
  background: rgba(var(--kr-accent-rgb), 0.12);
}

.wf-help-code-signal {
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-sm);
  color: rgba(var(--kr-warning-amber-rgb), 0.7);
  background: rgba(var(--kr-accent-rgb), 0.06);
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  white-space: nowrap;
}

.wf-help-desc {
  color: var(--kr-text-muted);
}

.wf-help-example {
  padding: var(--kr-sp-5) var(--kr-sp-6);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-code);
  border: 1px solid var(--kr-border-light);
  font-size: var(--kr-fs-sm);
  font-family: var(--kr-font-mono);
  line-height: 1.6;
  color: var(--kr-text-secondary);
}

/* ── Prompt variable hint (clickable codes) ────────────── */
.wf-var-hint-code {
  color: rgba(var(--kr-accent-rgb), 0.5);
  cursor: pointer;
  padding: 1px var(--kr-sp-2);
  border-radius: var(--kr-r-xs);
  background: rgba(var(--kr-accent-rgb), 0.04);
  transition: background 0.15s;
}

.wf-var-hint-code:hover {
  background: rgba(var(--kr-accent-rgb), 0.12);
}

/* ── Navigation buttons ────────────────────────────────── */
.wf-cancel-btn {
  padding: var(--kr-sp-4) var(--kr-sp-8);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-border-light);
  background: transparent;
  color: var(--kr-text-muted);
  cursor: pointer;
  font-size: var(--kr-fs-base);
  font-family: inherit;
}

.wf-next-btn {
  padding: var(--kr-sp-4) var(--kr-sp-8);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-accent-border);
  background: var(--kr-accent-bg-hover);
  color: var(--kr-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-base);
  font-family: inherit;
  font-weight: 600;
}

/* ── Checkbox label ────────────────────────────────────── */
.wf-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-tertiary);
  cursor: pointer;
}

/* ── Cron preview box ──────────────────────────────────── */
.wf-cron-preview {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-4);
  padding: var(--kr-sp-4) var(--kr-sp-6);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-accent-rgb), 0.04);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.1);
}

/* ── BatchQuickPrompt dry-run preview (test panel) ────── */
.wf-batch-preview {
  padding: var(--kr-sp-3) var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-ghost);
}

.wf-batch-preview-ok {
  color: var(--kr-success);
  font-size: var(--kr-fs-sm);
}

.wf-batch-preview-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-batch-preview-items {
  margin: 0;
  padding-left: 18px;
  list-style: '→ ';
  font-size: var(--kr-fs-xs);
}

.wf-batch-preview-items li {
  padding: 2px 0;
}

.wf-batch-preview-items code {
  font-family: var(--kr-font-mono);
  background: var(--kr-bg-scrim);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Per-item batch list with collapsible prompt + per-item dry-run button. */
.wf-batch-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-batch-item {
  border: 1px solid var(--kr-border-light);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-subtle);
  overflow: hidden;
}

.wf-batch-item-header {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: 6px 10px;
}

.wf-batch-item-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-xs);
}

.wf-batch-item-toggle code {
  font-family: var(--kr-font-mono);
  background: var(--kr-bg-scrim);
  padding: 1px 6px;
  border-radius: 3px;
}

.wf-batch-item-dryrun-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(var(--kr-accent-rgb), 0.08);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.25);
  border-radius: 10px;
  color: var(--kr-accent);
  font-size: var(--kr-fs-xs);
  cursor: pointer;
  transition: background 0.12s;
}

.wf-batch-item-dryrun-btn:hover:not(:disabled) {
  background: rgba(var(--kr-accent-rgb), 0.18);
}

.wf-batch-item-dryrun-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.wf-batch-item-body,
.wf-batch-item-result {
  padding: 6px 10px;
  border-top: 1px dashed var(--kr-border-ghost);
}

/* ── Run → Batch discussions chip ──────────────────────── */
/* Sits under each linear run in the WorkflowDetail runs list. Click jumps
   to the Discussions tab with the matching batch group expanded. */
.wf-run-batch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 4px 0 8px 24px;
  background: rgba(var(--kr-accent-rgb), 0.06);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.18);
  border-radius: 12px;
  font-size: var(--kr-fs-xs);
  font-weight: 500;
  color: var(--kr-accent);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.wf-run-batch-chip:hover {
  background: rgba(var(--kr-accent-rgb), 0.14);
  border-color: rgba(var(--kr-accent-rgb), 0.4);
}

.wf-run-batch-chip-status {
  font-size: 11px;
  margin-left: 2px;
}

/* ── BatchQuickPrompt step form ────────────────────────── */
.wf-batch-qp-form {
  padding: var(--kr-sp-4) var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-accent-rgb), 0.03);
  border: 1px dashed rgba(var(--kr-accent-rgb), 0.25);
}

.wf-batch-intro {
  display: flex;
  gap: var(--kr-sp-4);
  align-items: flex-start;
  padding-bottom: var(--kr-sp-3);
  border-bottom: 1px solid var(--kr-border-ghost);
  margin-bottom: var(--kr-sp-4);
  color: var(--kr-accent);
}

.wf-batch-intro strong {
  display: block;
  color: var(--kr-text-primary);
  margin-bottom: 2px;
}

.wf-batch-info {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  margin-bottom: var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-warning-rgb), 0.06);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.15);
  font-size: var(--kr-fs-xs);
  color: var(--kr-warning);
}

/* ── 0.7+ — QP/QA reference banner ──────────────────────────────────────
   Surface clairement ce qui vient d'un Quick Prompt / Quick API référencé
   versus ce que l'utilisateur peut overrider au niveau du step. Utilisé
   dans le wizard Agent step (picker QP) et dans ApiCallStepCard (picker QA).
   Le pattern : un bandeau "🔗 Hérité de X" qui montre les valeurs canoniques,
   puis les fields override sont enroulés dans un <details> "Personnaliser". */
.wf-qref-banner {
  margin-top: var(--kr-sp-2);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-accent-rgb, 100, 150, 255), 0.08);
  border: 1px solid rgba(var(--kr-accent-rgb, 100, 150, 255), 0.25);
  font-size: var(--kr-fs-xs);
  line-height: 1.45;
}
.wf-qref-banner-header {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  margin-bottom: var(--kr-sp-2);
}
.wf-qref-banner-header strong {
  flex: 1;
  color: var(--kr-text);
}
.wf-qref-override-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(var(--kr-warning-rgb), 0.15);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.4);
  color: var(--kr-warning);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.wf-qref-banner-body {
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-2);
  margin: var(--kr-sp-2) 0;
}
.wf-qref-field {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kr-sp-2);
  align-items: baseline;
}
.wf-qref-field-label {
  color: var(--kr-text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  min-width: 60px;
}
.wf-qref-field-value {
  flex: 1;
  font-family: var(--kr-font-mono);
  font-size: 10.5px;
  color: var(--kr-text-secondary);
  background: rgba(var(--kr-text-faint-rgb, 128, 128, 128), 0.06);
  padding: 2px 6px;
  border-radius: 3px;
  word-break: break-word;
  white-space: pre-wrap;
  display: inline-block;
}
.wf-qref-var-chip {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 4px 0 0;
  font-size: 10px;
  background: rgba(var(--kr-accent-rgb, 100, 150, 255), 0.12);
  border-radius: 3px;
  font-family: var(--kr-font-mono);
}
.wf-qref-hint {
  margin: var(--kr-sp-2) 0 0;
  font-size: 10.5px;
  color: var(--kr-text-muted);
  font-style: italic;
}
/* Le <details> override : visuellement séparé du bandeau, summary cliquable
   avec une teinte légère pour signaler qu'on entre en mode "perso". */
.wf-qref-override {
  margin-top: var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  border: 1px dashed rgba(var(--kr-text-faint-rgb, 128, 128, 128), 0.3);
  background: rgba(var(--kr-text-faint-rgb, 128, 128, 128), 0.03);
}
.wf-qref-override-summary {
  cursor: pointer;
  padding: var(--kr-sp-2) var(--kr-sp-3);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
  user-select: none;
  list-style: none;
}
.wf-qref-override-summary::-webkit-details-marker {
  display: none;
}
.wf-qref-override-summary:hover {
  color: var(--kr-text);
}
.wf-qref-override[open] > .wf-qref-override-summary {
  color: var(--kr-text);
  border-bottom: 1px dashed rgba(var(--kr-text-faint-rgb, 128, 128, 128), 0.3);
}
.wf-qref-override-body {
  padding: var(--kr-sp-3);
}

/* Required-field marker — kept bold + slightly larger to pop on dark bg */
.wf-required {
  color: var(--kr-error);
  font-weight: 700;
  font-size: 1.05em;
  margin-left: 3px;
}

/* ── Batch step summary in WorkflowDetail ─────────────── */
/* Visually distinct from agent steps: accent border + layered card look,
   so it's immediately obvious the step has a different shape (QP reference
   + items source + flags) rather than a prompt. */
.wf-step-card[data-step-type='batch-qp'] {
  border-left: 3px solid rgba(var(--kr-accent-rgb), 0.5);
  background: rgba(var(--kr-accent-rgb), 0.02);
}

.wf-step-card[data-step-type='api'] {
  border-left: 3px solid rgba(var(--kr-cyan-rgb), 0.6);
  background: rgba(var(--kr-cyan-rgb), 0.025);
}

.wf-step-card[data-step-type='notify'] {
  border-left: 3px solid rgba(var(--kr-purple-rgb, 168 85 247), 0.55);
  background: rgba(var(--kr-purple-rgb, 168 85 247), 0.025);
}

.wf-step-kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-accent);
  background: rgba(var(--kr-accent-rgb), 0.1);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.3);
  border-radius: 10px;
}

.wf-step-kind-badge[data-kind='api'] {
  color: var(--kr-cyan);
  background: rgba(var(--kr-cyan-rgb), 0.1);
  border-color: rgba(var(--kr-cyan-rgb), 0.35);
}

.wf-step-kind-badge[data-kind='notify'] {
  color: var(--kr-purple-soft, var(--kr-accent));
  background: rgba(var(--kr-purple-rgb, 168 85 247), 0.1);
  border-color: rgba(var(--kr-purple-rgb, 168 85 247), 0.35);
}

.wf-step-kind-badge[data-kind='gate'] {
  color: var(--kr-warning);
  background: rgba(var(--kr-warning-rgb), 0.1);
  border-color: rgba(var(--kr-warning-rgb), 0.35);
}

.wf-step-kind-badge[data-kind='exec'] {
  color: var(--kr-error);
  background: rgba(var(--kr-error-rgb), 0.1);
  border-color: rgba(var(--kr-error-rgb), 0.35);
}

.wf-step-kind-badge[data-kind='batch-api'] {
  color: var(--kr-info, rgb(var(--kr-info-rgb)));
  background: rgba(var(--kr-info-rgb), 0.1);
  border-color: rgba(var(--kr-info-rgb), 0.35);
}

.wf-step-kind-badge[data-kind='json-data'] {
  color: var(--kr-cyan, rgb(var(--kr-cyan-rgb)));
  background: rgba(var(--kr-cyan-rgb), 0.08);
  border-color: rgba(var(--kr-cyan-rgb), 0.3);
}

/* B5 (0.7.0 UX pass) — distinct status badge + paused-since counter
   for runs in WaitingApproval. The badge uses warning tint (consistent
   with the GatePanel below), the counter is muted to keep the focus
   on the badge. */
.wf-run-status-badge {
  padding: 2px 8px;
  font-size: var(--kr-fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--kr-r-sm);
}

.wf-run-status-badge--gate {
  color: var(--kr-bg-base);
  background: var(--kr-warning);
  animation: wf-pulse 2.4s ease-in-out infinite;
}

@keyframes wf-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

.wf-paused-since {
  color: var(--kr-warning);
  font-weight: 600;
}

.wf-paused-zero-tokens {
  color: var(--kr-success);
  font-weight: 600;
}

/* 0.7.0 Phase 4 — Gate decision panel. Rendered on a paused run
   (status=WaitingApproval) above the step list. Three-button row,
   primary action is "Approuver" so that's the highlighted CTA;
   "Demander des changements" and "Rejeter" are secondary. The whole
   block is wrapped in a soft amber tint to read as "the run is
   waiting on you". */
.wf-gate-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--kr-warning-rgb), 0.35);
  border-radius: 8px;
  background: rgba(var(--kr-warning-rgb), 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-gate-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-primary);
}

.wf-gate-message {
  white-space: pre-wrap;
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-secondary);
  padding: 8px 10px;
  background: var(--kr-bg-elevated);
  border-radius: 4px;
  border: 1px solid var(--kr-border-faint);
  max-height: 240px;
  overflow-y: auto;
}

/* 0.8.3 — Feasibility-Gated triage manifest panel inside the Gate
   message slot. When the gate message wraps a triage manifest, the
   raw JSON dump is replaced with this structured view. */
.wf-triage-manifest {
  white-space: normal;          /* override .wf-gate-message pre-wrap */
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-triage-section {
  border: 1px solid var(--kr-border-faint);
  border-radius: 4px;
  background: var(--kr-bg-base);
}
.wf-triage-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  user-select: none;
  border-radius: 4px;
}
.wf-triage-section > summary::-webkit-details-marker { display: none; }
.wf-triage-section > summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--kr-text-faint);
  transition: transform 0.12s ease;
}
.wf-triage-section[open] > summary::before { transform: rotate(90deg); }

.wf-triage-section[data-cat="clear"]   > summary { color: var(--kr-text-secondary); }
.wf-triage-section[data-cat="decided"] > summary { color: var(--kr-accent-ink); }
.wf-triage-section[data-cat="mocked"]  > summary { color: var(--kr-warning); }
.wf-triage-section[data-cat="blocked"] > summary { color: var(--kr-error); }

.wf-triage-cat-label { flex: 0 0 auto; }
.wf-triage-cat-count {
  margin-left: auto;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--kr-bg-elevated);
  border-radius: 10px;
  color: var(--kr-text-secondary);
}

.wf-triage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 12px 12px;
}

.wf-triage-entry {
  padding: 8px 10px;
  background: var(--kr-bg-elevated);
  border-radius: 4px;
  border-left: 3px solid var(--kr-border-medium);
  font-size: var(--kr-fs-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wf-triage-entry[data-cat="clear"]   { border-left-color: var(--kr-text-faint); }
.wf-triage-entry[data-cat="decided"] { border-left-color: var(--kr-accent-ink); }
.wf-triage-entry[data-cat="mocked"]  { border-left-color: var(--kr-warning); }
.wf-triage-entry[data-cat="blocked"] { border-left-color: var(--kr-error); }

.wf-triage-entry-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--kr-text-faint);
}
.wf-triage-entry-what {
  font-weight: 600;
  color: var(--kr-text-primary);
}
.wf-triage-entry-where {
  font-size: 11px;
  color: var(--kr-text-secondary);
}
.wf-triage-entry-where code,
.wf-triage-files-list code {
  font-size: 11px;
  background: transparent;
  padding: 0;
  color: var(--kr-accent-ink);
}

.wf-triage-entry-label {
  display: inline-block;
  margin-right: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--kr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wf-triage-entry-considered {
  margin-top: 2px;
}
.wf-triage-entry-considered > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: var(--kr-text-faint);
  font-style: italic;
}
.wf-triage-entry-considered > summary::-webkit-details-marker { display: none; }
.wf-triage-entry-considered > summary::before {
  content: '▸ ';
  color: var(--kr-text-faint);
}
.wf-triage-entry-considered[open] > summary::before { content: '▾ '; }
.wf-triage-entry-considered ul {
  margin: 4px 0 0 16px;
  padding: 0;
  list-style: '— ';
  color: var(--kr-text-secondary);
  font-size: var(--kr-fs-sm);
}

.wf-triage-files {
  border: 1px dashed var(--kr-border-faint);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-secondary);
}
.wf-triage-files > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.wf-triage-files > summary::-webkit-details-marker { display: none; }
.wf-triage-files-list {
  margin: 6px 0 0 12px;
  padding: 0;
  list-style: '· ';
}

.wf-gate-comment {
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-primary);
  background: var(--kr-bg-elevated);
  border: 1px solid var(--kr-border-medium);
  border-radius: 4px;
  resize: vertical;
}

.wf-gate-comment:focus {
  outline: none;
  border-color: var(--kr-accent);
}

.wf-gate-error {
  font-size: var(--kr-fs-xs);
  color: var(--kr-error);
}

.wf-gate-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wf-gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  border: 1px solid var(--kr-border-medium);
  border-radius: 4px;
  background: var(--kr-bg-elevated);
  color: var(--kr-text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wf-gate-btn:hover:not(:disabled) {
  background: var(--kr-bg-hover);
}

.wf-gate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wf-gate-btn--approve {
  border-color: rgba(var(--kr-success-rgb), 0.5);
  color: var(--kr-success);
  background: rgba(var(--kr-success-rgb), 0.08);
}

.wf-gate-btn--approve:hover:not(:disabled) {
  background: rgba(var(--kr-success-rgb), 0.15);
}

.wf-gate-btn--changes {
  border-color: rgba(var(--kr-warning-rgb), 0.5);
  color: var(--kr-warning);
  background: rgba(var(--kr-warning-rgb), 0.08);
}

.wf-gate-btn--changes:hover:not(:disabled) {
  background: rgba(var(--kr-warning-rgb), 0.15);
}

.wf-gate-btn--reject {
  border-color: rgba(var(--kr-error-rgb), 0.5);
  color: var(--kr-error);
  background: rgba(var(--kr-error-rgb), 0.08);
}

.wf-gate-btn--reject:hover:not(:disabled) {
  background: rgba(var(--kr-error-rgb), 0.15);
}

/* Live status of the currently-running step in the run-detail
   progress list. The static "running..." placeholder told the user
   nothing — this row pairs a per-type activity hint ("Appel HTTP en
   cours", "L'agent réfléchit", …) with a ticking elapsed counter so
   "is it stuck?" is answered at a glance. */
.wf-live-step-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(var(--kr-warning-rgb), 0.1);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.3);
  font-size: var(--kr-fs-2xs);
}

.wf-live-step-activity {
  color: rgba(var(--kr-warning-rgb), 0.95);
  font-weight: 500;
}

.wf-live-step-elapsed {
  font-family: var(--kr-font-mono, monospace);
  color: var(--kr-text-ghost);
  font-variant-numeric: tabular-nums;
}

.wf-batch-step-summary {
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-4);
  padding: var(--kr-sp-4) var(--kr-sp-5);
  margin-top: var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-ghost);
}

.wf-batch-step-qp {
  display: flex;
  gap: var(--kr-sp-4);
  align-items: flex-start;
}

.wf-batch-step-qp-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.wf-batch-step-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wf-batch-step-items {
  display: block;
  padding: 6px 10px;
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-primary);
  background: var(--kr-bg-scrim);
  border: 1px solid var(--kr-border-light);
  border-radius: var(--kr-r-sm);
  word-break: break-all;
}

.wf-batch-step-flags {
  display: flex;
  gap: var(--kr-sp-3);
  flex-wrap: wrap;
}

.wf-batch-step-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
  background: var(--kr-bg-hover);
  border: 1px solid var(--kr-border-light);
  border-radius: 10px;
}

.wf-batch-step-flag-worktree {
  color: var(--kr-accent);
  background: rgba(var(--kr-accent-rgb), 0.08);
  border-color: rgba(var(--kr-accent-rgb), 0.2);
}

/* Day-of-week picker (cron weekday chips) */
.wf-cron-weekdays {
  margin-top: var(--kr-sp-3);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border-ghost);
}

.wf-weekday-chip {
  min-width: 44px;
  padding: 6px 10px;
  background: var(--kr-bg-hover);
  border: 1px solid var(--kr-border);
  border-radius: var(--kr-r-sm);
  color: var(--kr-text-muted);
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.wf-weekday-chip:hover {
  background: rgba(var(--kr-accent-rgb), 0.06);
  border-color: rgba(var(--kr-accent-rgb), 0.2);
  color: var(--kr-text-primary);
}

.wf-weekday-chip[data-selected='true'] {
  background: rgba(var(--kr-accent-rgb), 0.18);
  border-color: rgba(var(--kr-accent-rgb), 0.5);
  color: var(--kr-accent);
}

/* Inline help icon next to labels/buttons — hover shows native tooltip.
   Discreet on purpose: it only draws attention when the user actually looks. */
.wf-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: var(--kr-text-ghost);
  cursor: help;
  vertical-align: middle;
  transition: color 0.15s;
}

.wf-help-icon:hover {
  color: var(--kr-accent);
}

/* Inline field error (right under the offending field) */
.wf-field-error {
  font-size: var(--kr-fs-xs);
  color: var(--kr-error);
  margin: 4px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wf-field-error::before {
  content: '⚠';
  font-size: 11px;
}

/* Invalid input visual marker — combined with :not(:placeholder-shown)
   to avoid lighting up empty fields the user hasn't touched yet for
   optional cases, but for required fields we want it visible from the start. */
.wf-input[data-invalid='true'],
.wf-textarea[data-invalid='true'] {
  border-color: rgba(var(--kr-error-rgb), 0.5) !important;
  background: rgba(var(--kr-error-rgb), 0.04);
}

/* QP preview card shown once a QP is selected */
.wf-qp-preview {
  padding: var(--kr-sp-3) var(--kr-sp-4);
  margin-top: var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-accent-rgb), 0.05);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.15);
}

.wf-qp-preview-head {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
}

.wf-qp-preview-icon {
  font-size: 18px;
  line-height: 1;
}

/* "← Depuis step-X" chip */
.wf-batch-prev-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(var(--kr-accent-rgb), 0.08);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.2);
  border-radius: 12px;
  font-size: var(--kr-fs-xs);
  color: var(--kr-accent);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.wf-batch-prev-chip:hover {
  background: rgba(var(--kr-accent-rgb), 0.15);
  border-color: rgba(var(--kr-accent-rgb), 0.4);
}

/* ── Restricted agent warning ──────────────────────────── */
.wf-restricted-warning {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-3) var(--kr-sp-5);
  margin-bottom: var(--kr-sp-3);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-warning-rgb), 0.06);
  border: 1px solid rgba(var(--kr-warning-rgb), 0.15);
  font-size: var(--kr-fs-sm);
  color: var(--kr-warning);
}

/* Discrete informational chip — used to surface "this run is isolated in a
   git worktree" in the wizard and on the Exec step, where users worry
   whether successive Agent → Exec steps actually see the same files. Tone:
   informational (accent ink), not warning. */
.wf-worktree-hint {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: var(--kr-sp-2) var(--kr-sp-4);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-accent-rgb), 0.05);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.12);
  font-size: var(--kr-fs-xs);
  color: var(--kr-accent-ink);
  width: fit-content;
}

.wf-worktree-hint svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Worktree path row on the run detail card. Compact, monospace, with a
   copy-to-clipboard button. The path can be long (~80 chars on Linux), so
   it overflows-ellipsis and the full value is in the title attribute. */
.wf-run-worktree-row {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: var(--kr-sp-2) var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-text-faint-rgb, 128, 128, 128), 0.04);
  border: 1px solid var(--kr-border-faint);
  font-size: var(--kr-fs-xs);
}

.wf-run-worktree-path {
  flex: 1;
  min-width: 0;
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px var(--kr-sp-2);
  background: transparent;
}

.wf-run-worktree-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: var(--kr-r-sm);
  background: transparent;
  border: 1px solid var(--kr-border-faint);
  color: var(--kr-text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.wf-run-worktree-copy:hover {
  background: rgba(var(--kr-accent-rgb), 0.08);
  color: var(--kr-accent-ink);
}

/* ── Produced branches panel (0.7.0 — recover commits the agent left
   behind when push failed). Distinct visual tone from the worktree row
   so the operator notices these need attention vs. the always-on
   workspace_path display. ──────────────────────────────────── */
.wf-produced-branches {
  border: 1px solid rgba(var(--kr-warning-rgb), 0.25);
  background: rgba(var(--kr-warning-rgb), 0.05);
  border-radius: var(--kr-r-md);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-2);
}

.wf-produced-branches-title {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-warning);
}

.wf-produced-branch-row {
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-2);
  padding: var(--kr-sp-2);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-card);
  border: 1px solid var(--kr-border-faint);
}

.wf-produced-branch-head {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  flex-wrap: wrap;
  font-size: var(--kr-fs-xs);
}

.wf-produced-branch-head code {
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-secondary);
  background: transparent;
}

.wf-produced-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: var(--kr-fs-2xs);
  font-weight: 600;
}

.wf-produced-pill--pushed {
  background: rgba(var(--kr-success-rgb), 0.1);
  color: var(--kr-success);
}

.wf-produced-pill--local {
  background: rgba(var(--kr-warning-rgb), 0.15);
  color: var(--kr-warning);
}

.wf-produced-branch-actions {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  flex-wrap: wrap;
}

.wf-produced-test-btn {
  border-color: rgba(var(--kr-warning-rgb), 0.3);
  color: var(--kr-warning);
}

.wf-produced-test-path {
  font-family: var(--kr-font-mono);
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-secondary);
  background: var(--kr-bg-hover);
  padding: 2px var(--kr-sp-2);
  border-radius: var(--kr-r-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.wf-produced-error {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--kr-fs-2xs);
  color: var(--kr-error);
}

/* ── Validation errors ─────────────────────────────────── */
.wf-validation-errors {
  padding: var(--kr-sp-4) var(--kr-sp-6);
  margin-top: var(--kr-sp-4);
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-error-rgb), 0.06);
  border: 1px solid rgba(var(--kr-error-rgb), 0.15);
}

.wf-validation-error {
  font-size: var(--kr-fs-xs);
  color: rgba(var(--kr-error-rgb), 0.8);
  padding: 2px 0;
}

/* ── Chevron rotation ──────────────────────────────────── */
.wf-chevron-rotated {
  transform: rotate(90deg);
  transition: transform 0.15s;
}

.wf-chevron {
  transition: transform 0.15s;
}

/* ── Spinner for loading states ────────────────────────── */
@keyframes wf-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.wf-spin {
  animation: wf-spin 1s linear infinite;
}

/* keyframes pulse defined globally in reset.css */

/* ── Starter templates (désagentification aha moment) ────── */

.wf-starter-templates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kr-sp-3);
  margin-bottom: var(--kr-sp-5);
}

.wf-starter-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(var(--kr-success-rgb), 0.35);
  background: rgba(var(--kr-success-rgb), 0.08);
  color: var(--kr-success);
  font-size: var(--kr-fs-sm);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.wf-starter-template-btn:hover {
  background: rgba(var(--kr-success-rgb), 0.16);
  border-color: rgba(var(--kr-success-rgb), 0.55);
}

/* ── ApiCall step card (wizard) ──────────────────────────── */

.wf-apicall-card {
  padding: var(--kr-sp-5);
  border: 1px solid var(--kr-border-soft);
  border-radius: var(--kr-r-md);
  background: var(--kr-bg-raised);
  margin-top: var(--kr-sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-4);
}

.wf-apicall-card-empty {
  background: rgba(var(--kr-warning-rgb), 0.06);
  border-color: rgba(var(--kr-warning-rgb), 0.25);
}

.wf-apicall-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wf-apicall-subtitle {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-ghost);
  margin-left: auto;
}

.wf-apicall-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--kr-sp-4);
}

.wf-apicall-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-secondary);
}

.wf-apicall-field input,
.wf-apicall-field select {
  padding: 6px 10px;
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-border-soft);
  background: var(--kr-bg-base);
  color: var(--kr-text-primary);
  font-family: inherit;
  font-size: var(--kr-fs-sm);
}

.wf-apicall-params {
  border: 1px dashed var(--kr-border-soft);
  border-radius: var(--kr-r-sm);
  padding: var(--kr-sp-3) var(--kr-sp-4);
}

.wf-apicall-auth-managed {
  border-style: solid;
  border-color: rgba(var(--kr-success-rgb), 0.35);
  background: rgba(var(--kr-success-rgb), 0.04);
}

.wf-apicall-path-params {
  border-style: solid;
  border-color: rgba(var(--kr-accent-rgb), 0.35);
  background: rgba(var(--kr-accent-rgb), 0.04);
}

.wf-apicall-path-params legend {
  color: var(--kr-accent);
  font-weight: 600;
}

.wf-apicall-path-preview {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: var(--kr-r-sm);
  background: rgba(0, 0, 0, 0.2);
  font-size: var(--kr-fs-2xs);
  word-break: break-all;
}

.wf-apicall-path-preview code {
  font-family: var(--kr-font-mono, monospace);
  color: var(--kr-text-primary);
}

.wf-apicall-path-preview-incomplete {
  border-left: 2px solid rgba(var(--kr-warning-rgb), 0.7);
}

.wf-apicall-path-preview-incomplete code {
  color: rgba(var(--kr-warning-rgb), 0.95);
}

.wf-apicall-auth-managed legend {
  color: rgba(var(--kr-success-rgb), 0.95);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.wf-apicall-auth-hint {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-ghost);
  margin-bottom: 6px;
}

.wf-apicall-auth-row {
  grid-template-columns: 200px 1fr 30px;
}

.wf-apicall-auth-kind {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(var(--kr-text-rgb, 255 255 255), 0.06);
  color: var(--kr-text-ghost);
  font-size: var(--kr-fs-2xs);
  font-weight: 400;
  text-transform: uppercase;
}

.wf-apicall-auth-value {
  font-family: var(--kr-font-mono, monospace);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-ghost);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.wf-apicall-auth-reveal {
  background: transparent;
  border: 1px solid var(--kr-border-soft);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
  padding: 2px 6px;
  font-size: var(--kr-fs-xs);
}

.wf-apicall-params legend {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-ghost);
  padding: 0 6px;
}

.wf-apicall-param-row {
  display: grid;
  grid-template-columns: 160px 1fr 30px;
  gap: 6px;
  margin-bottom: 4px;
  align-items: center;
}

.wf-apicall-param-row input {
  padding: 4px 8px;
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-border-soft);
  background: var(--kr-bg-base);
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-xs);
}

.wf-apicall-param-row button {
  padding: 2px 6px;
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-border-soft);
  background: transparent;
  color: var(--kr-text-ghost);
  cursor: pointer;
}

.wf-apicall-param-key {
  font-family: var(--kr-font-mono, monospace);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-primary);
}

.wf-apicall-test-row {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
}

.wf-apicall-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-accent);
  background: var(--kr-accent);
  color: var(--kr-bg-base);
  font-size: var(--kr-fs-sm);
  font-weight: 500;
  cursor: pointer;
}

.wf-apicall-test-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wf-apicall-tokens-saved {
  font-size: var(--kr-fs-xs);
  color: var(--kr-success);
}

.wf-apicall-error {
  padding: 6px 10px;
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-error-rgb), 0.08);
  border: 1px solid rgba(var(--kr-error-rgb), 0.3);
  color: var(--kr-error);
  font-size: var(--kr-fs-xs);
  user-select: text;
}

.wf-apicall-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--kr-sp-4);
}

@media (max-width: 900px) {
  .wf-apicall-split { grid-template-columns: 1fr; }
  .wf-apicall-pickers { grid-template-columns: 1fr; }
}

.wf-apicall-section-title {
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.wf-apicall-response {
  background: var(--kr-bg-base);
  border: 1px solid var(--kr-border-soft);
  border-radius: var(--kr-r-sm);
  padding: var(--kr-sp-3);
  min-height: 120px;
}

.wf-apicall-response-empty {
  color: var(--kr-text-ghost);
  font-size: var(--kr-fs-xs);
  font-style: italic;
}

.wf-apicall-json-tree {
  font-family: var(--kr-font-mono, monospace);
  font-size: var(--kr-fs-xs);
  line-height: 1.55;
  max-height: 340px;
  overflow-y: auto;
  color: var(--kr-text-primary);
}

.wf-apicall-json-leaf {
  background: transparent;
  border: 1px dashed transparent;
  padding: 1px 4px;
  border-radius: 3px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.wf-apicall-json-leaf:hover {
  background: rgba(var(--kr-accent-rgb), 0.12);
  border-color: rgba(var(--kr-accent-rgb), 0.3);
}

.wf-apicall-json-key {
  color: var(--kr-cyan);
}

.wf-apicall-json-key-btn {
  background: transparent;
  border: 1px dashed transparent;
  padding: 0 4px;
  border-radius: 3px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.wf-apicall-json-key-btn:hover {
  background: rgba(var(--kr-accent-rgb), 0.12);
  border-color: rgba(var(--kr-accent-rgb), 0.4);
  color: var(--kr-accent);
}

.wf-apicall-json-array-marker {
  color: var(--kr-accent);
  font-weight: 600;
}

.wf-apicall-json-array-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.wf-apicall-json-index {
  background: transparent;
  border: 1px dashed transparent;
  padding: 0 4px;
  border-radius: 3px;
  color: var(--kr-text-ghost);
  font: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.wf-apicall-json-index:hover {
  background: rgba(var(--kr-accent-rgb), 0.12);
  border-color: rgba(var(--kr-accent-rgb), 0.4);
  color: var(--kr-accent);
}

/* ── Auto-derived path suggestions ────────────────────── */

.wf-apicall-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  margin-bottom: var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-accent-rgb), 0.05);
  border: 1px dashed rgba(var(--kr-accent-rgb), 0.3);
}

.wf-apicall-suggest-title {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-ghost);
  font-weight: 600;
  margin-right: 4px;
}

.wf-apicall-suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--kr-accent-rgb), 0.4);
  background: var(--kr-bg-raised);
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-2xs);
  cursor: pointer;
  text-align: left;
}

.wf-apicall-suggest-chip:hover {
  background: rgba(var(--kr-accent-rgb), 0.15);
  border-color: var(--kr-accent);
}

.wf-apicall-suggest-chip-label {
  font-weight: 600;
}

.wf-apicall-suggest-chip-sample {
  font-family: var(--kr-font-mono, monospace);
  color: var(--kr-text-ghost);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 5px;
  border-radius: 3px;
  font-size: var(--kr-fs-2xs);
}

@keyframes wf-apicall-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--kr-accent-rgb), 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(var(--kr-accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--kr-accent-rgb), 0); }
}

.wf-apicall-path-pulse {
  animation: wf-apicall-pulse 0.6s ease-out;
  border-color: var(--kr-accent) !important;
}

.wf-apicall-extract {
  background: var(--kr-bg-base);
  border: 1px solid var(--kr-border-soft);
  border-radius: var(--kr-r-sm);
  padding: var(--kr-sp-3) var(--kr-sp-4);
}

.wf-apicall-radios {
  display: flex;
  gap: var(--kr-sp-3);
  margin-bottom: var(--kr-sp-3);
}

.wf-apicall-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-secondary);
  cursor: pointer;
}

.wf-apicall-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: var(--kr-sp-2) 0;
}

.wf-apicall-examples button {
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--kr-border-soft);
  background: var(--kr-bg-raised);
  color: var(--kr-text-secondary);
  font-size: var(--kr-fs-2xs);
  cursor: pointer;
}

.wf-apicall-examples button:hover {
  background: rgba(var(--kr-accent-rgb), 0.1);
  color: var(--kr-accent);
}

.wf-apicall-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--kr-sp-2);
  font-size: var(--kr-fs-xs);
  flex-wrap: wrap;
}

.wf-apicall-preview-value {
  font-family: var(--kr-font-mono, monospace);
  color: var(--kr-text-primary);
  word-break: break-all;
}

.wf-apicall-preview-type {
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(var(--kr-accent-rgb), 0.1);
  color: var(--kr-accent);
  font-size: var(--kr-fs-2xs);
}

.wf-apicall-preview-error {
  color: var(--kr-error);
  font-size: var(--kr-fs-2xs);
}

.wf-apicall-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--kr-sp-3);
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-secondary);
}

.wf-apicall-banner {
  padding: 6px 10px;
  border-radius: var(--kr-r-sm);
  font-size: var(--kr-fs-xs);
  margin-top: var(--kr-sp-3);
  border: 1px solid;
}

.wf-apicall-banner-ok {
  background: rgba(var(--kr-success-rgb), 0.08);
  border-color: rgba(var(--kr-success-rgb), 0.25);
  color: var(--kr-success);
}

.wf-apicall-banner-warn {
  background: rgba(var(--kr-warning-rgb), 0.08);
  border-color: rgba(var(--kr-warning-rgb), 0.3);
  color: var(--kr-warning);
}

.wf-apicall-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--kr-r-sm);
  border: none;
  background: transparent;
  color: var(--kr-text-ghost);
  font-size: var(--kr-fs-xs);
  cursor: pointer;
  align-self: flex-start;
}

.wf-apicall-advanced-toggle:hover {
  color: var(--kr-text-primary);
  background: var(--kr-bg-hover);
}

.wf-apicall-advanced-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--kr-accent);
  margin-left: 4px;
  box-shadow: 0 0 0 2px rgba(var(--kr-accent-rgb), 0.2);
}

.wf-apicall-advanced {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-3);
  background: var(--kr-bg-base);
  border-radius: var(--kr-r-sm);
}

.wf-apicall-http-advanced {
  grid-template-columns: 1fr;
  margin-top: var(--kr-sp-2);
}

.wf-apicall-body-editor {
  margin-top: var(--kr-sp-3);
}

.wf-apicall-body-textarea {
  width: 100%;
  min-height: 120px;
  padding: 8px 10px;
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-border-soft);
  background: var(--kr-bg-base);
  color: var(--kr-text-primary);
  font-family: var(--kr-font-mono, monospace);
  font-size: var(--kr-fs-xs);
  resize: vertical;
}

.wf-apicall-body-textarea:focus {
  outline: 1px solid var(--kr-accent);
  outline-offset: -1px;
}

@media (max-width: 700px) {
  .wf-apicall-advanced { grid-template-columns: 1fr; }
}


/* ── Workflow suggestions ──────────────────────────────── */

.wf-suggestions-toggle {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  padding: 6px var(--kr-sp-6);
  border-radius: 20px;
  border: 1px solid rgba(var(--kr-accent-rgb), 0.3);
  background: rgba(var(--kr-accent-rgb), 0.08);
  color: var(--kr-accent);
  font-size: var(--kr-fs-sm);
  font-family: inherit;
  cursor: pointer;
  margin-bottom: var(--kr-sp-6);
  transition: all 0.15s;
}

.wf-suggestions-toggle:hover {
  background: rgba(var(--kr-accent-rgb), 0.15);
}

.wf-suggestions-panel {
  border: 1px solid rgba(var(--kr-accent-rgb), 0.2);
  border-radius: var(--kr-r-xl);
  background: var(--kr-bg-surface);
  padding: var(--kr-sp-7);
  margin-bottom: var(--kr-sp-8);
}

.wf-suggestions-header {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  margin-bottom: var(--kr-sp-6);
}

.wf-suggestions-title {
  font-weight: 600;
  font-size: var(--kr-fs-md);
}

.wf-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--kr-sp-4);
}

.wf-suggestion-card {
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-3);
  padding: var(--kr-sp-6);
  border-radius: var(--kr-r-lg);
  border: 1px solid var(--kr-border-light);
  background: var(--kr-bg-hover);
}

.wf-suggestion-top {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
  justify-content: space-between;
}

.wf-suggestion-name {
  font-weight: 600;
  font-size: var(--kr-fs-base);
}

.wf-suggestion-audience {
  font-size: var(--kr-fs-2xs);
  font-weight: 600;
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  text-transform: uppercase;
}

.wf-audience-dev {
  background: rgba(var(--kr-accent-rgb), 0.12);
  color: var(--kr-accent);
}

.wf-audience-pm {
  background: rgba(var(--kr-info-rgb), 0.12);
  color: var(--kr-info);
}

.wf-audience-ops {
  background: rgba(var(--kr-warning-amber-rgb), 0.12);
  color: var(--kr-warning-amber);
}

.wf-suggestion-desc {
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-muted);
  margin: 0;
  line-height: 1.4;
}

.wf-suggestion-reason {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-faint);
  margin: 0;
  font-style: italic;
}

.wf-suggestion-mcps {
  display: flex;
  gap: var(--kr-sp-2);
  flex-wrap: wrap;
}

.wf-suggestion-mcp-tag {
  font-size: var(--kr-fs-2xs);
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-hover-strong);
  color: var(--kr-text-faint);
  text-transform: capitalize;
}

.wf-suggestion-apply {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: 5px var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.3);
  background: rgba(var(--kr-accent-rgb), 0.08);
  color: var(--kr-accent);
  font-size: var(--kr-fs-sm);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  margin-top: auto;
  transition: all 0.15s;
}

.wf-suggestion-apply:hover {
  background: rgba(var(--kr-accent-rgb), 0.18);
}

.wf-suggestion-complexity {
  font-size: var(--kr-fs-2xs);
  font-weight: 600;
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: var(--kr-bg-hover-strong);
  color: var(--kr-text-faint);
}

.wf-suggestion-steps-count {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-faint);
  margin-left: auto;
}


/* ── Quick Prompts ────────────────────────────── */
.qp-form {
  padding: var(--kr-sp-8);
  border-radius: var(--kr-r-xl);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border);
  margin-bottom: var(--kr-sp-6);
}
.qp-vars {
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-2);
}
.qp-var-row {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
}
.qp-var-name {
  font-size: var(--kr-fs-xs);
  color: var(--kr-accent);
  min-width: 80px;
}
.qp-add-var-btn {
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  padding: 2px var(--kr-sp-4);
  border-radius: var(--kr-r-sm);
  border: 1px solid var(--kr-accent-border);
  background: transparent;
  color: var(--kr-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}
.qp-list {
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-4);
}
.qp-card {
  padding: var(--kr-sp-5) var(--kr-sp-6);
  border-radius: var(--kr-r-lg);
  background: var(--kr-bg-subtle);
  border: 1px solid var(--kr-border);
}
/* 0.8.5 — post-deploy QP focus flash. Briefly highlights the card the
   user just deployed an improved version of, via a fading accent
   border + glow. Animation is set inline via `.qp-card-flash`
   (added/removed by the WorkflowsPage post-deploy effect) and runs
   ~1.5s. Respects prefers-reduced-motion. */
/* 0.8.5 — compact "fitness" chip inside the QP card header. Renders
   the current version's avg tokens / avg duration / launch count
   so the user can read pertinence at a glance without opening the
   history drawer. */
.qp-card-metrics-chip {
  display: inline-flex;
  align-items: center;
  margin-left: var(--kr-sp-3, 6px);
  padding: 2px 6px;
  font-size: 11px;
  background: var(--kr-bg-raised);
  border: 1px solid var(--kr-border);
  border-radius: 4px;
  color: var(--kr-text-primary);
  white-space: nowrap;
}
.qp-card-metrics-sep {
  color: var(--kr-text-dim);
  margin: 0 4px;
}

@keyframes qp-card-flash-anim {
  0%   { box-shadow: 0 0 0 0 var(--kr-accent), 0 0 0 0 rgba(0, 0, 0, 0); border-color: var(--kr-accent); }
  20%  { box-shadow: 0 0 0 4px rgba(var(--kr-accent-rgb, 200, 255, 0), 0.35); border-color: var(--kr-accent); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); border-color: var(--kr-border); }
}
.qp-card.qp-card-flash {
  animation: qp-card-flash-anim 1.5s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .qp-card.qp-card-flash { animation: none; outline: 2px solid var(--kr-accent); outline-offset: 2px; }
}
.qp-card-header {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-4);
}
.qp-card-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.qp-card-name {
  font-weight: 600;
  font-size: var(--kr-fs-base);
  flex: 1;
}
.qp-card-vars {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-muted);
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: rgba(var(--kr-accent-rgb), 0.08);
}

/* Agent identity badge in the QP card header. Color comes from
 * `agentColor()` so a Codex QP is visually distinguishable from a
 * Claude Code QP at a glance. Discreet outline-style — doesn't
 * compete with the variable count or the launch CTA. */
.qp-card-agent-badge {
  font-size: var(--kr-fs-2xs);
  font-weight: 600;
  font-family: var(--kr-font-mono);
  padding: 1px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  border: 1px solid currentColor;
  background: transparent;
  white-space: nowrap;
  /* `color` and `borderColor` are set inline via `agentColor()` so
   * each agent's brand colour reads through. */
}
.qp-card-actions {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
}
.qp-launch-btn {
  font-size: var(--kr-fs-sm);
  font-weight: 700;
  padding: var(--kr-sp-2) var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  border: none;
  background: var(--kr-accent);
  color: var(--kr-text-on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.qp-launch-btn:hover { opacity: 0.85; }
.qp-launch-form {
  margin-top: var(--kr-sp-4);
  padding-top: var(--kr-sp-4);
  border-top: 1px solid var(--kr-border);
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-3);
}
.qp-launch-field {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-3);
}
.qp-launch-label {
  font-size: var(--kr-fs-sm);
  font-weight: 500;
  min-width: 100px;
  color: var(--kr-text-secondary);
}
.qp-launch-go-btn {
  align-self: flex-end;
  font-size: var(--kr-fs-sm);
  font-weight: 700;
  padding: var(--kr-sp-3) var(--kr-sp-8);
  border-radius: var(--kr-r-md);
  border: none;
  background: var(--kr-accent);
  color: var(--kr-text-on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qp-launch-go-btn:disabled { opacity: 0.5; }

.qp-syntax-hint {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-faint);
  margin: -8px 0 var(--kr-sp-4);
  font-family: var(--kr-font-mono);
}

/* ── QP Chain pills (WorkflowWizard BatchQuickPrompt step) ───────────── */
.wf-chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 8px;
  border-radius: var(--kr-r-md);
  background: rgba(var(--kr-accent-rgb), 0.1);
  border: 1px solid rgba(var(--kr-accent-rgb), 0.3);
  color: var(--kr-accent);
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  /* Visual cue for the drag affordance — `grab` when idle, the browser
   * switches to `grabbing` while a drag is active. The native DnD
   * handler still allows clicking the children (arrows, X). */
  cursor: grab;
}
.wf-chain-pill:active { cursor: grabbing; }
.wf-chain-pos {
  color: var(--kr-text-faint);
  font-weight: 500;
  font-family: var(--kr-font-mono);
}
.wf-chain-pill-remove {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: transparent;
  border: none;
  border-radius: var(--kr-r-sm);
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.wf-chain-pill-remove:hover {
  opacity: 1;
  color: var(--kr-error-soft);
}

/* Up/down arrow buttons — keyboard-accessible fallback for the native
 * HTML5 drag-and-drop. Sit between the position number and the X. */
.wf-chain-pill-arrow {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: transparent;
  border: none;
  border-radius: var(--kr-r-sm);
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.wf-chain-pill-arrow:hover:not(:disabled),
.wf-chain-pill-arrow:focus-visible:not(:disabled) {
  opacity: 1;
  outline: none;
}
.wf-chain-pill-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Compare-agents CTA — sits next to the regular Launch button in the
 * QP launch form. Slightly different styling so the user reads it as
 * "alternate launch mode" rather than a destructive secondary action. */
.qp-launch-compare-btn {
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  padding: var(--kr-sp-2) var(--kr-sp-5);
  border-radius: var(--kr-r-md);
  border: 1px solid rgba(var(--kr-info-rgb), 0.3);
  background: rgba(var(--kr-info-rgb), 0.08);
  color: var(--kr-info);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.qp-launch-compare-btn:hover:not(:disabled) {
  background: rgba(var(--kr-info-rgb), 0.16);
  border-color: rgba(var(--kr-info-rgb), 0.5);
}

.qp-launch-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Compare-agents chip selector — picks the subset of installed agents
 * that 🤝 Compare will fan out across. Inactive chips are dimmed; active
 * chips wear the agent's brand colour via inline `color`/`borderColor`. */
.qp-compare-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: var(--kr-sp-2) 0;
}
.qp-compare-selector-label {
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  color: var(--kr-text-secondary);
  margin-right: var(--kr-sp-1);
}
.qp-compare-chip {
  font-size: var(--kr-fs-2xs);
  font-weight: 600;
  font-family: var(--kr-font-mono);
  padding: 2px var(--kr-sp-3);
  border-radius: var(--kr-r-sm);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
}
.qp-compare-chip--active {
  border: 1px solid currentColor;
  opacity: 1;
}
.qp-compare-chip--active:hover {
  background: rgba(var(--kr-accent-rgb), 0.06);
}
.qp-compare-chip--inactive {
  border: 1px dashed var(--kr-border, rgba(255, 255, 255, 0.18));
  color: var(--kr-text-tertiary);
  opacity: 0.55;
}
.qp-compare-chip--inactive:hover {
  opacity: 0.85;
}
.qp-compare-toggle-all {
  font-size: var(--kr-fs-2xs);
  background: transparent;
  border: none;
  color: var(--kr-info);
  cursor: pointer;
  padding: 2px var(--kr-sp-2);
  margin-left: auto;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.qp-compare-toggle-all:hover {
  color: var(--kr-text-primary);
}

/* ─── 0.8.5 — WorkflowQuickStartPicker ─────────────────────────────
   Unified entry point at top of wizard step 0. Collapsed = single
   chip; expanded = panel with search + filters + list of cards. */

.wf-quickstart-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--kr-sp-2);
  padding: var(--kr-sp-2) var(--kr-sp-3);
  background: var(--kr-accent-bg);
  border: 1px solid var(--kr-accent-border);
  border-radius: var(--kr-radius-md);
  color: var(--kr-text-primary);
  font-size: var(--kr-fs-sm);
  cursor: pointer;
  margin-bottom: var(--kr-sp-4);
  transition: background 120ms ease, border-color 120ms ease;
}
.wf-quickstart-toggle:hover:not(:disabled) {
  background: var(--kr-accent-bg-hover);
  border-color: var(--kr-accent);
}
.wf-quickstart-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--kr-bg-subtle);
  border-color: var(--kr-border-ghost);
  color: var(--kr-text-ghost);
}

.wf-quickstart-panel {
  background: var(--kr-bg-surface);
  border: 1px solid var(--kr-accent-border);
  border-radius: var(--kr-radius-md);
  padding: var(--kr-sp-3) var(--kr-sp-4);
  margin-bottom: var(--kr-sp-6);
}

.wf-quickstart-header {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-2);
  margin-bottom: var(--kr-sp-3);
}
.wf-quickstart-title {
  font-size: var(--kr-fs-sm);
  font-weight: 600;
  color: var(--kr-text-primary);
}
.wf-quickstart-hint {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-ghost);
}

.wf-quickstart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kr-sp-3);
  align-items: center;
  margin-bottom: var(--kr-sp-3);
  padding-bottom: var(--kr-sp-3);
  border-bottom: 1px solid var(--kr-border-ghost);
}
.wf-quickstart-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
}
.wf-quickstart-search-icon {
  position: absolute;
  left: var(--kr-sp-2);
  color: var(--kr-text-ghost);
  pointer-events: none;
}
.wf-quickstart-search-input {
  padding-left: 24px !important;
}

.wf-quickstart-filters {
  display: flex;
  align-items: center;
  gap: var(--kr-sp-1);
  flex-wrap: wrap;
}
.wf-quickstart-filter-chip {
  font-size: var(--kr-fs-2xs);
  padding: 2px var(--kr-sp-2);
  border-radius: var(--kr-radius-pill);
  border: 1px solid var(--kr-border);
  background: transparent;
  color: var(--kr-text-tertiary);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.wf-quickstart-filter-chip[data-active="true"] {
  background: var(--kr-accent-bg-strong);
  border-color: var(--kr-accent);
  color: var(--kr-text-primary);
}
.wf-quickstart-filter-chip:hover {
  border-color: var(--kr-accent);
  color: var(--kr-text-primary);
}

.wf-quickstart-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--kr-sp-2);
  max-height: 480px;
  overflow-y: auto;
}

.wf-quickstart-empty {
  padding: var(--kr-sp-4);
  text-align: center;
  color: var(--kr-text-ghost);
  font-size: var(--kr-fs-xs);
  font-style: italic;
}

.wf-quickstart-row {
  padding: var(--kr-sp-3);
  background: var(--kr-bg-raised);
  border: 1px solid var(--kr-border);
  border-radius: var(--kr-radius-sm);
  transition: border-color 120ms ease, background 120ms ease;
}
.wf-quickstart-row:hover {
  border-color: var(--kr-accent-border);
  background: var(--kr-bg-elevated);
}
.wf-quickstart-row[data-applicable="false"] {
  opacity: 0.55;
}
.wf-quickstart-row[data-applicable="false"]:hover {
  opacity: 0.85;
}

.wf-quickstart-row-top {
  display: flex;
  align-items: flex-start;
  gap: var(--kr-sp-2);
  margin-bottom: var(--kr-sp-1);
}
.wf-quickstart-row-title {
  flex: 1;
  font-weight: 600;
  font-size: var(--kr-fs-sm);
  color: var(--kr-text-primary);
}
.wf-quickstart-row-badges {
  display: flex;
  gap: var(--kr-sp-1);
  flex-wrap: wrap;
  align-items: center;
}

.wf-quickstart-complexity-badge,
.wf-quickstart-source-badge,
.wf-quickstart-audience-badge {
  font-size: 10px;
  padding: 1px var(--kr-sp-2);
  border-radius: var(--kr-radius-pill);
  border: 1px solid var(--kr-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kr-text-tertiary);
  white-space: nowrap;
}
.wf-quickstart-complexity-badge[data-complexity="simple"] {
  border-color: rgba(120, 200, 80, 0.4);
  color: rgba(150, 220, 110, 0.95);
}
.wf-quickstart-complexity-badge[data-complexity="intermediate"] {
  border-color: rgba(200, 160, 60, 0.4);
  color: rgba(230, 190, 90, 0.95);
}
.wf-quickstart-complexity-badge[data-complexity="advanced"] {
  border-color: rgba(220, 100, 100, 0.4);
  color: rgba(240, 130, 130, 0.95);
}
.wf-quickstart-source-badge[data-source="preset"] {
  border-color: var(--kr-accent-border);
  color: var(--kr-accent-text);
}
.wf-quickstart-source-badge[data-source="starter"] {
  border-color: rgba(100, 180, 220, 0.4);
  color: rgba(140, 200, 240, 0.95);
}
.wf-quickstart-source-badge[data-source="project-suggestion"] {
  border-color: rgba(200, 120, 220, 0.4);
  color: rgba(220, 150, 240, 0.95);
}

.wf-quickstart-row-desc {
  font-size: var(--kr-fs-xs);
  color: var(--kr-text-secondary);
  margin: 0 0 var(--kr-sp-2);
  line-height: 1.4;
}
.wf-quickstart-row-reason {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-ghost);
  margin: 0 0 var(--kr-sp-2);
  font-style: italic;
}

.wf-quickstart-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kr-sp-2);
  margin-bottom: var(--kr-sp-2);
}
.wf-quickstart-steps-count {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-tertiary);
  font-weight: 500;
}
.wf-quickstart-row-tag {
  font-size: 10px;
  padding: 1px var(--kr-sp-2);
  border-radius: var(--kr-radius-sm);
  background: var(--kr-bg-subtle);
  color: var(--kr-text-tertiary);
  border: 1px solid var(--kr-border-ghost);
}
.wf-quickstart-steps-preview {
  font-size: var(--kr-fs-2xs);
  color: var(--kr-text-ghost);
  font-family: var(--kr-font-mono, monospace);
  margin-left: auto;
}

.wf-quickstart-row-warning {
  font-size: var(--kr-fs-2xs);
  color: rgba(240, 130, 130, 0.95);
  margin: 0 0 var(--kr-sp-2);
}

.wf-quickstart-row-actions {
  display: flex;
  justify-content: flex-end;
}
.wf-quickstart-apply-btn {
  padding: var(--kr-sp-1) var(--kr-sp-3);
  background: var(--kr-accent);
  color: var(--kr-text-on-accent);
  border: none;
  border-radius: var(--kr-radius-sm);
  font-size: var(--kr-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 120ms ease, filter 120ms ease;
}
.wf-quickstart-apply-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}
.wf-quickstart-apply-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wf-quickstart-loading {
  padding: var(--kr-sp-2);
  text-align: center;
}
