/* Agent Console + overlay variant. */

.console { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.console-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, var(--accent-soft), transparent 140%);
}
.console-head .ch-title { font-weight: 600; font-size: 13px; }
.console-head .ch-sub { font-size: 11px; color: var(--text-2); }
.console-head .badge {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--text-2); padding: 3px 9px;
  border: 1px solid var(--stroke); border-radius: 999px;
}
.console-head .badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.console-head .badge.busy .dot { background: var(--warning); animation: pulse 1.2s infinite; }

.console-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 92%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--bg-3); color: var(--text-2); }
.msg.agent .msg-av { background: var(--accent); color: #fff; }
.msg-bubble { min-width: 0; }
.msg.user .msg-bubble {
  background: var(--accent); color: #fff; border-radius: var(--radius-m) var(--radius-m) 4px var(--radius-m);
  padding: 9px 13px; font-size: 13px; white-space: pre-wrap; user-select: text;
}
.msg.agent .msg-body {
  background: var(--bg-2); border: 1px solid var(--stroke);
  border-radius: 4px var(--radius-m) var(--radius-m) var(--radius-m);
  padding: 10px 13px; font-size: 13px; white-space: pre-wrap; user-select: text; line-height: 1.55;
}
.msg-body code { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg-4); padding: 1px 5px; border-radius: 4px; }
.msg-body .caret { display: inline-block; width: 7px; height: 14px; background: var(--accent); vertical-align: -2px; animation: blink 1s infinite; margin-left: 2px; }

.reasoning {
  margin-bottom: 8px; border-left: 2px solid var(--stroke-2);
  padding: 4px 0 4px 10px; color: var(--text-3); font-size: 12px; font-style: italic;
  display: flex; gap: 6px; align-items: flex-start;
}
.reasoning .icon { margin-top: 1px; }
.reasoning .r-label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); font-style: normal; margin-bottom: 2px; display: block; }
.reasoning.streaming { color: var(--text-2); }

.tool-call {
  margin: 8px 0; border: 1px solid var(--stroke); border-radius: var(--radius-s);
  background: var(--bg-1); overflow: hidden; font-size: 12px;
}
.tool-call-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  font-family: var(--font-mono); color: var(--text-1);
}
.tool-call-head .tc-name { font-weight: 600; }
.tool-call-head .tc-status { margin-left: auto; font-size: 10.5px; display: flex; gap: 5px; align-items: center; color: var(--text-2); }
.tool-call .tc-args { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); padding: 0 10px 7px; word-break: break-all; }
.tool-call .tc-result {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  background: var(--bg); border-top: 1px solid var(--stroke);
  padding: 7px 10px; white-space: pre-wrap; max-height: 180px; overflow: auto;
}
.tool-call.ok .tc-status { color: var(--success); }
.tool-call.err .tc-status { color: var(--danger); }
.tool-call.running .tc-status { animation: pulse 1s infinite; color: var(--warning); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--stroke-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }

.perm-inline {
  display: flex; align-items: center; gap: 10px; margin: 8px 0;
  border: 1px solid rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .07);
  border-radius: var(--radius-s); padding: 9px 11px; font-size: 12.5px;
}
.perm-inline .icon { color: var(--warning); }
.perm-inline .grow b { font-family: var(--font-mono); }

.console-input-row { flex: none; border-top: 1px solid var(--stroke); padding: 10px 12px; display: flex; gap: 8px; }
.console-input-row textarea {
  flex: 1; resize: none; background: var(--bg-2); border: 1px solid var(--stroke);
  border-radius: var(--radius-m); padding: 9px 12px; color: var(--text-1);
  font: inherit; font-size: 13px; outline: none; max-height: 110px; min-height: 40px;
}
.console-input-row textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.console-send { align-self: flex-end; height: 40px; width: 44px; border-radius: var(--radius-m); background: var(--accent); color: #fff; display: grid; place-items: center; }
.console-send:hover { background: var(--accent-2); }
.console-chips { display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap; }
.chip {
  font-size: 11px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--stroke); color: var(--text-2);
}
.chip:hover { background: var(--hover); color: var(--text-1); border-color: var(--stroke-2); }

/* Quick overlay (Ctrl+Space) */
.agent-quick-body { max-height: 52vh; overflow: auto; padding: 14px 16px; }
.agent-quick-log { display: flex; flex-direction: column; gap: 10px; }
.aq-empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 18px 0 8px; }
.agent-quick-foot { display: flex; gap: 6px; padding: 10px 14px 14px; flex-wrap: wrap; }

/* Agent manager */
.agm { flex: 1; overflow: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.agm-card { border: 1px solid var(--stroke); border-radius: var(--radius-m); padding: 13px 14px; background: var(--bg-1); }
.agm-top { display: flex; align-items: center; gap: 10px; }
.agm-name { font-weight: 600; font-size: 13px; font-family: var(--font-mono); }
.agm-model { font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent); padding: 1px 7px; border-radius: 999px; }
.agm-status { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.agm-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.agm-status.working .dot { background: var(--warning); animation: pulse 1.2s infinite; }
.agm-status.paused .dot { background: var(--text-3); }
.agm-status.idle .dot { background: var(--success); }
.agm-task { font-size: 12px; color: var(--text-2); margin-top: 7px; }
.agm-stats { display: flex; gap: 16px; margin-top: 9px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.agm-actions { display: flex; gap: 6px; margin-top: 11px; }
.agm-tasks { margin-top: 16px; }
.agm-task-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--stroke); border-radius: var(--radius-s); font-size: 12.5px; }
.agm-bar { height: 4px; flex: 1; background: var(--bg-4); border-radius: 4px; overflow: hidden; }
.agm-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .5s; }
