/* web/css/mcp.css
 *
 * The MCP page (web/mcp/page.js), the Subagents page (web/subagents/page.js),
 * and the elicitation card in the ask dock (web/transcript/elicitation.js).
 * Both pages are the Skills page's shape — `.skp` and its `skp-` rail, bar and
 * detail come from web/css/skills.css — so this is only what they add: the
 * server form's rows, status dots, the tools picker, and the card's fields.
 */

.skp .btn.tiny {
    height: calc(var(--ctl-sm) - 6px);
    padding: 0 var(--sp-4);
    font-size: var(--fs-sm);
}

/* ── status ────────────────────────────────────────────────────────────── */

.mcp-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-4);
}
.mcp-dot.connected { background: var(--green); }
.mcp-dot.failed, .mcp-dot.rejected { background: var(--red); }
.mcp-dot.needs-auth, .mcp-dot.pending { background: var(--yellow); }
.skp-chip.mcp-st.connected { color: var(--green); }
.skp-chip.mcp-st.failed, .skp-chip.mcp-st.rejected { background: var(--red-cont); color: var(--red); }
.skp-chip.mcp-st.needs-auth, .skp-chip.mcp-st.pending { background: var(--yellow-cont); color: var(--yellow); }
.skp-row-tag.warn { color: var(--yellow); }

.mcp-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--text-2);
    cursor: pointer;
}
.mcp-toggle input:disabled + span { color: var(--text-4); }

/* ── the server form ───────────────────────────────────────────────────── */

.mcp-form { gap: var(--sp-5); }
.mcp-seg { display: flex; gap: var(--sp-6); }
.mcp-pairs { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.mcp-pair { display: flex; gap: var(--sp-3); align-items: center; width: 100%; }
.mcp-pair > .skp-input:not(.mcp-key) { flex: 1; }
.mcp-key { width: 200px; flex: none; }
.mcp-masked {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    min-width: 0;
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-sm);
    background: color-mix(in srgb, var(--s3) 60%, transparent);
    color: var(--text-3);
}
.mcp-masked .skp-mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mcp-paste { min-height: 180px; }
.mcp-preview { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.mcp-preview th { text-align: left; color: var(--text-4); font-weight: 400; padding: var(--sp-2) var(--sp-4); }
.mcp-preview td { padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--outline); vertical-align: top; }
.mcp-preview td:nth-child(2) { max-width: 360px; overflow-wrap: anywhere; color: var(--text-3); }
.mcp-preview tr.skip td { color: var(--text-4); }
.mcp-preview tr.skip td:last-child { color: var(--yellow); }

/* ── subagents ─────────────────────────────────────────────────────────── */

.sap-form { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.sap-desc { min-height: 64px; }
.sap-tools { display: flex; flex-direction: column; gap: var(--sp-3); }
.sap-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--sp-2) var(--sp-6);
    padding-left: var(--sp-8);
}
.sap-model { display: flex; gap: var(--sp-4); align-items: center; }

/* ── the elicitation card ──────────────────────────────────────────────── */

.elic .ask-dock-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.elic-title { font-weight: 600; color: var(--text); }
.elic-message { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.elic-fields { display: flex; flex-direction: column; gap: var(--sp-6); }
.elic-field { display: flex; flex-direction: column; gap: var(--sp-3); }
.elic-label { font-size: var(--fs-sm); color: var(--text-2); }
.elic-req { color: var(--red); }
.elic-input { max-width: 420px; }
.elic-url { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.elic-url-text {
    flex: 1;
    min-width: 0;
    font: 400 var(--fs-sm) var(--mono);
    color: var(--text-2);
    overflow-wrap: anywhere;
    user-select: all;
}
