/**
 * Shared ASCII box-card renderer.
 *
 * Used by:
 *   - MCP adapter (hctx.box in handlers)
 *   - Install wizard (first-run banner)
 *   - MCP first-call banner (NEXUS_BANNER_PRINTED guard)
 */
/**
 * Render a bordered card to stderr.
 *
 * @example
 * drawCard({ title: 'NEXUS PRIME · READY', lines: ['Dashboard  http://localhost:3377'] });
 */
export function drawCard({ title, lines, color = '34', width = 68 }) {
    const topPad = Math.max(0, width - title.length - 4);
    process.stderr.write(`\n\x1b[${color}m┌─ ${title} ${'─'.repeat(topPad)}┐\x1b[0m\n`);
    for (const line of lines) {
        const trimmed = line.substring(0, width - 2).padEnd(width - 2, ' ');
        process.stderr.write(`\x1b[${color}m│\x1b[0m ${trimmed} \x1b[${color}m│\x1b[0m\n`);
    }
    process.stderr.write(`\x1b[${color}m└${'─'.repeat(width)}┘\x1b[0m\n\n`);
}
