.dev-top {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + var(--safe-t)) 14px 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.back-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text); }
.dev-top-title { flex: 1; font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-top .badge { flex: none; }

.dev-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 12px; }
.dev-feed { max-width: 680px; margin: 0 auto; }

.dev-elapsed { flex: none; font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.dev-elapsed b { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.msg-user {
  margin: 4px 0 18px auto;
  max-width: 84%; width: fit-content;
  background: var(--primary-soft);
  color: var(--text);
  border-radius: 16px 16px 5px 16px;
  padding: 11px 15px;
  font-size: 14.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}

.agent-intro { font-size: 14px; line-height: 1.75; color: var(--text-2); margin-bottom: 14px; padding: 0 2px; }

.thought-block {
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  overflow: hidden;
  animation: fadeUp .3s ease;
}
.thought-head {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 11px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.thought-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.thought-block.running .thought-dot { animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.75); } }
.thought-label { flex: none; }
.thought-block.done .thought-label { color: var(--muted); font-weight: 500; }
.thought-block.done .thought-dot { background: var(--ok); }
.thought-meta { flex: 1; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.thought-block .chev { flex: none; color: #b8bcd0; transition: transform .25s; display: flex; }
.thought-block.expanded .chev { transform: rotate(90deg); }

.thought-body { display: none; max-height: 250px; overflow-y: auto; padding: 2px 15px 13px 31px; }
.thought-block.expanded .thought-body { display: block; }
.thought-text {
  font-size: 12.6px; line-height: 1.75;
  color: #666b85;
  white-space: pre-wrap; word-break: break-word;
  border-left: 2px solid #dfe4f2;
  padding-left: 11px;
}

.steps { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);  overflow: hidden; margin-bottom: 14px; }
.step { position: relative; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.steps .step::before { content: ""; position: absolute; left: 29px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.steps .step:first-child::before { top: 50%; }
.steps .step:last-child::before { bottom: 50%; }

.step-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  position: relative; z-index: 1;
}
.step-ico {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #eef0f5; color: var(--muted);
}
.step-ico svg { width: 15px; height: 15px; }
.step.is-done .step-ico { background: var(--ok-soft); color: var(--ok); }
.step.is-running .step-ico { background: var(--primary-soft); color: var(--primary); }
.step.is-error .step-ico { background: var(--danger-soft); color: var(--danger); }
.step.is-running .step-ico svg { animation: none; }

.step-main { flex: 1; min-width: 0; }
.step-title { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.step.is-pending .step-title { color: var(--muted); font-weight: 500; }
.step-sub { display: block; font-size: 11.8px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .chev { flex: none; color: #c3c7d6; transition: transform .25s; display: flex; }
.step.expanded .chev { transform: rotate(90deg); }

.step-body {
  display: none;
  padding: 0 14px 13px 54px;
  font-size: 12.6px; line-height: 1.75; color: var(--text-2);
  position: relative; z-index: 1;
  white-space: pre-wrap; word-break: break-word;
}
.step.expanded .step-body { display: block; animation: fadeUp .22s ease; }

.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 17px;

  margin-bottom: 14px;
  animation: fadeUp .3s ease;
}
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.result-name { font-size: 15.5px; font-weight: 700; }
.result-url { display: block; font-size: 12.8px; word-break: break-all; margin-bottom: 13px; color: var(--primary); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.agent-err {
  background: var(--danger-soft);
  border: 1px solid #ffdbe1;
  border-radius: var(--r-lg);
  padding: 13px 16px;
  font-size: 13.5px; color: var(--danger);
  margin-bottom: 14px;
  animation: fadeUp .3s ease;
}
.agent-err b { font-weight: 700; }
.err-actions { margin-top: 10px; display: flex; gap: 8px; }
.err-actions .btn-ghost { background: #fff; border-color: #ffdbe1; color: var(--danger); }

.thought-block, .tool-call {
  background: #f5f6f9;
  border: none;
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  animation: fadeUp .25s ease;
}
.thought-block.running { background: #f2f3ff; }
.thought-head, .tool-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 11px 14px;
  font-size: 13.5px; font-weight: 600; color: #454a63;
}
.thought-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.thought-block.running .thought-dot { background: var(--primary); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.75); } }
.thought-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thought-meta { flex: none; font-size: 11.5px; color: var(--muted); }
.thought-block .chev, .tool-call .chev { flex: none; color: #b6b9c9; transition: transform .3s; display: flex; }
.thought-block.expanded .chev, .tool-call.expanded .chev { transform: rotate(90deg); }

.thought-body, .tool-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .32s ease;
}
.thought-block.expanded .thought-body, .tool-call.expanded .tool-body { grid-template-rows: 1fr; }
.thought-inner { overflow: hidden; min-height: 0; }
.thought-scroll { max-height: 260px; overflow-y: auto; padding: 2px 14px 12px 32px; }
.thought-text {
  font-size: 12.6px; line-height: 1.75;
  color: #666b85;
  white-space: pre-wrap; word-break: break-word;
  border-left: 2px solid #dfe4f2;
  padding-left: 11px;
}

.tool-ico {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--ok); display: flex; align-items: center; justify-content: center;
}
.tool-ico svg { display: none; }
.tool-call.is-running .tool-ico { background: var(--primary); }
.tool-call.is-running .tool-ico svg { display: block; width: 12px; height: 12px; }
.tool-call.is-error .tool-ico { background: var(--danger); }
.tool-label { flex: none; }
.tool-arg { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.tool-status { flex: none; display: flex; align-items: center; }
.tool-sk { display: inline-block; width: 52px; height: 11px; background: #e3e6ee; border-radius: 999px; }
.tool-mark { font-size: 12px; font-weight: 700; }
.tool-mark.ok { color: var(--ok); }
.tool-mark.err { color: var(--danger); }
.tool-call .chev { flex: none; color: #b6b9c9; display: flex; }
.tool-detail-wrap { overflow: hidden; min-height: 0; }
.tool-detail-pre {
  margin: 0 14px 11px 33px;
  padding: 9px 11px;
  background: #fff;
  border-radius: 9px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px; line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow-y: auto;
}

.agent-final {
  font-size: 14.5px; line-height: 1.75;
  color: var(--text);
  background: var(--primary-soft);
  border: none;
  border-radius: 4px 16px 16px 16px;
  padding: 14px 17px;
  margin-bottom: 14px;
  word-break: break-word;
  animation: fadeUp .3s ease;
}
.agent-final h1, .agent-final h2, .agent-final h3, .agent-final h4 { margin: 10px 0 6px; line-height: 1.4; }
.agent-final h1 { font-size: 18px; } .agent-final h2 { font-size: 16.5px; } .agent-final h3 { font-size: 15px; }
.agent-final p { margin: 4px 0; }
.agent-final p:empty { display: none; }
.agent-final > *:first-child { margin-top: 0; }
.agent-final > *:last-child { margin-bottom: 0; }
.agent-final ul, .agent-final ol { margin: 6px 0; padding-left: 22px; }
.agent-final li { margin: 3px 0; }
.agent-final code { background: #f1f2f7; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; }
.agent-final pre { background: #17192b; color: #e8eaf2; padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 8px 0; }
.agent-final pre code { background: none; color: inherit; padding: 0; }
.agent-final a { color: var(--primary); }
.agent-final strong { font-weight: 700; }

.agent-final {
  font-size: 14.5px; line-height: 1.75;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 13px 16px;
  margin-bottom: 14px;
  white-space: pre-wrap; word-break: break-word;
  animation: fadeUp .3s ease;
}

.dev-jump {
  position: absolute; right: 16px; bottom: calc(70px + var(--safe-b));
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); z-index: 20;
}

.dev-inputbar {
  flex: none;
  display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap;
  padding: 9px 14px calc(9px + var(--safe-b));
  background: #fff;
  border-top: 1px solid var(--line);
}
.dev-inputbar .att-bar { flex-basis: 100%; margin-bottom: 0; }
.dev-inputbar input {
  flex: 1; height: 42px; min-width: 0;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 0 17px;
  font-size: 14px;
}
.dev-inputbar input::placeholder { color: #b6b9c9; }
.dev-send {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
  display: flex; align-items: center; justify-content: center;

}
.agent-final br + br { display: none; }
.agent-final p:has(> br:only-child) { display: none; }

.dev-stop {
  flex: none; padding: 6px 14px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid #ffdbe1;
}
