/* AI task flow page ====================================================== */

.step-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-6);
}
.step-head h1 { font-size: var(--text-2xl); margin: 6px 0 4px; font-weight: 600; letter-spacing: -0.01em; }
.step-head p { color: var(--muted); margin: 0; font-size: var(--text-sm); }

.stepper {
  list-style: none; padding: 0; margin: 0 0 var(--space-6);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-3);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  align-items: center;
}
.step.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.step.is-done .step-num { background: var(--success); color: white; border-color: var(--success); }
.step strong { display: block; font-weight: 500; font-size: var(--text-sm); }
.step .muted-sm { margin: 2px 0 0; font-size: var(--text-xs); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-grid; place-items: center;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  font-family: var(--font-mono);
}

/* Two-col flow ========================================================== */
.ai-flow {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.prompt-card {
  border: 1px dashed var(--border);
  background: color-mix(in oklab, var(--accent), white 95%);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.prompt-card p { margin: 0 0 12px; font-size: var(--text-base); line-height: 1.6; }
.prompt-foot { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--text-xs); }

/* Plan list ============================================================= */
.plan { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 12px 0; }
.plan li .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  margin-top: 4px;
}
.plan li strong { display: block; font-weight: 600; margin-bottom: 2px; }
.plan li p { margin: 0; }
.plan li.done .dot { border-color: var(--success); background: var(--success); }
.plan li.active .dot { border-color: var(--accent); animation: pulse-dot 1s infinite; }
.plan li.active strong { color: var(--accent); }

.progress {
  height: 4px;
  background: color-mix(in oklab, var(--fg), transparent 90%);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar {
  width: 60%;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  animation: progress-grow 2s ease-in-out infinite;
}
@keyframes progress-grow {
  0% { width: 10%; }
  100% { width: 90%; }
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent), transparent 60%); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

/* Diff list ============================================================ */
.diff-list { display: grid; gap: 10px; margin: 16px 0; }
.diff-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.diff-row.add { border-left: 3px solid var(--success); }
.diff-row.remove { border-left: 3px solid var(--danger); }
.diff-row.modify { border-left: 3px solid var(--warn); }
.diff-row strong { display: block; font-weight: 600; margin-bottom: 4px; }
.diff-row p { margin: 0 0 8px; font-size: var(--text-sm); color: var(--muted); }
.diff-marker {
  width: 24px; height: 24px;
  border-radius: 4px;
  display: inline-grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
}
.diff-row.add .diff-marker { color: var(--success); }
.diff-row.remove .diff-marker { color: var(--danger); }
.diff-row.modify .diff-marker { color: var(--warn); }
.diff-code {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}
.diff-foot {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.diff-actions { display: flex; justify-content: space-between; gap: 8px; }

/* Timeline ============================================================== */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: flex-start;
}
.timeline li .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  margin-top: 6px;
}
.timeline li strong { display: block; font-weight: 500; margin-bottom: 2px; }
.timeline li p { margin: 0; }
.timeline li.tl-done .dot { background: var(--success); border-color: var(--success); }
.timeline li.tl-active .dot { background: var(--accent); border-color: var(--accent); }

@media (max-width: 920px) {
  .stepper { grid-template-columns: 1fr 1fr; }
  .ai-flow { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .stepper { grid-template-columns: 1fr; }
}