/* ── Tools tab layout ──────────────────────────────────────────────────────── */
#tools-container { display: flex; height: 100%; }

.tools-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Tool list items ───────────────────────────────────────────────────────── */
.tool-item {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 2px;
}
.tool-item:hover          { background: var(--surface2); }
.tool-item.active         { background: var(--accent-dim); color: var(--accent); }
.tool-item.quarantined-item { border-left: 2px solid var(--error); padding-left: 8px; }

.tool-item .tool-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tool-venv-badge {
    color: var(--text-faint);
    font-weight: 400;
    font-size: 9px;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 3px;
}
.tool-item .tool-desc {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Detail pane ───────────────────────────────────────────────────────────── */
#tool-detail {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#tool-detail-inner {
    padding: 16px 18px;
    flex: 1;
    overflow-y: auto;
}

.tool-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}
.tool-detail-header h3 {
    font-size: 15px;
    color: var(--accent);
    margin: 0;
}
.tool-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }

.tool-description {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.5;
}
.tool-venv-info {
    font-size: 10px;
    color: var(--success);
    margin-bottom: 8px;
}

.tool-section { margin-top: 18px; }
.tool-section h4 {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.tool-code {
    background: var(--surface2);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 11px;
    overflow-x: auto;
    line-height: 1.55;
    white-space: pre;
    max-height: 400px;
    overflow-y: auto;
}
.tool-no-params {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    font-style: italic;
}

/* ── Test-run section ──────────────────────────────────────────────────────── */
.tool-param-field { margin-bottom: 10px; }
.tool-param-label {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.tool-param-type {
    font-size: 10px;
    color: var(--text-faint);
    background: var(--surface3);
    padding: 1px 5px;
    border-radius: 3px;
}
.tool-param-required {
    font-size: 10px;
    color: var(--error);
}
.tool-param-desc {
    font-size: 10px;
    color: var(--text-faint);
    margin-bottom: 4px;
}
.tool-param-input {
    width: 100%;
    font-family: var(--font);
    font-size: 12px;
}
.tool-run-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.tool-run-status {
    font-size: 11px;
    font-weight: 600;
}
.tool-run-result {
    margin-top: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}
.tool-run-result.error {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-dim);
}
.tool-run-result.hidden { display: none; }

/* ── Quarantine banner ─────────────────────────────────────────────────────── */
.tool-quarantine-banner {
    background: var(--error-dim);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--error);
    line-height: 1.5;
}
.tool-quarantine-banner strong { display: block; margin-bottom: 4px; }

/* ── Tool editor modal ─────────────────────────────────────────────────────── */
.tool-editor-content {
    min-width: min(90vw, 900px);
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}
.tool-editor-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tool-editor-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tool-editor-textarea {
    font-family: var(--font);
    font-size: 11px;
    line-height: 1.55;
    resize: vertical;
    min-height: 220px;
    tab-size: 4;
}

@media (max-width: 700px) {
    .tool-editor-two-col { grid-template-columns: 1fr; }
    .tool-editor-content { min-width: unset; }
}