/* child window: agents, background tasks, approvals */
.child-menu-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.subagent-capsules { display: flex; gap: 6px; margin-left: 8px; flex-wrap: wrap; }
.subagent-capsule {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.subagent-capsule.running { border-color: #bfdbfe; }
.subagent-capsule .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; margin-right: 4px; }
.child-window { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.child-window.open { pointer-events: auto; }
.child-window-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.28); opacity: 0; transition: opacity .18s; }
.child-window.open .child-window-overlay { opacity: 1; }
.child-window-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 92vw);
  background: #fff; box-shadow: -8px 0 30px rgba(15,23,42,.16);
  transform: translateX(102%); transition: transform .2s ease;
  display: flex; flex-direction: column;
}
.child-window.open .child-window-panel { transform: translateX(0); }
.child-window-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 16px 8px; }
.child-window-title { font-size: 17px; font-weight: 650; color: #0f172a; }
.child-window-sub { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.child-window-close { border: 0; background: none; font-size: 24px; line-height: 1; color: #64748b; cursor: pointer; padding: 2px 6px; }
.child-window-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid #eef2f7; }
.child-tab { border: 0; background: none; padding: 10px 8px; color: #64748b; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.child-tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.child-tab span { color: #94a3b8; margin-left: 2px; }
.child-window-body { flex: 1; overflow: auto; padding: 12px; background: #f8fafc; }
.child-empty { color: #94a3b8; font-size: 13px; text-align: center; padding: 36px 12px; line-height: 1.7; }
.child-agent-card { background: #fff; border: 1px solid #e8eef6; border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.child-agent-top { display: flex; justify-content: space-between; gap: 8px; }
.child-agent-name { font-size: 13px; font-weight: 600; color: #0f172a; word-break: break-all; }
.child-agent-status { font-size: 11px; color: #64748b; white-space: nowrap; }
.child-agent-status.active { color: #16a34a; }
.child-agent-goal { font-size: 12px; color: #64748b; margin-top: 5px; line-height: 1.5; word-break: break-word; }
.child-agent-meta { font-size: 10px; color: #94a3b8; margin-top: 6px; word-break: break-all; }
.child-agent-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.child-agent-actions button { border: 1px solid #dbeafe; background: #eff6ff; color: #1d4ed8; border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
.child-agent-actions button.danger { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
.child-message-list { max-height: 150px; overflow: auto; background: #f8fafc; border-radius: 8px; padding: 8px; margin-top: 8px; }
.child-message { font-size: 11px; color: #475569; padding: 3px 0; border-bottom: 1px dashed #eef2f7; }
.child-message:last-child { border-bottom: 0; }
.child-steer-row { display: flex; gap: 6px; margin-top: 8px; }
.child-steer-row input { flex: 1; border: 1px solid #e2e8f0; border-radius: 7px; padding: 6px 8px; font-size: 12px; }
.child-steer-row button { border: 0; background: #2563eb; color: #fff; border-radius: 7px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.child-approval-card { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 11px; margin-bottom: 8px; }
.child-approval-desc { font-size: 12px; color: #92400e; margin: 4px 0 8px; word-break: break-word; }
.child-approval-card button { border: 1px solid #fcd34d; background: #fff; border-radius: 6px; padding: 4px 9px; font-size: 11px; cursor: pointer; margin-right: 5px; }
.child-approval-card button.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
@media (max-width: 640px) {
  .child-window-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 72vh; border-radius: 14px 14px 0 0; transform: translateY(102%); }
  .child-window.open .child-window-panel { transform: translateY(0); }
  .subagent-capsules { display: none; }
}
