/* ── Agent Config Badges (on project header) ── */

.agent-config-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  margin-right: 4px;
}

.agent-config-setup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border, #30363d);
  background: transparent;
  color: var(--text-dim, #8b949e);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.agent-config-setup-btn:active {
  background: rgba(88, 166, 255, 0.12);
  border-color: var(--accent, #58a6ff);
  color: var(--accent, #58a6ff);
}

.agent-config-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
  border: 1.5px solid transparent;
}

.agent-config-dot:active {
  transform: scale(1.4);
}

.agent-config-dot.cfg-ok     { background: #22c55e; }
.agent-config-dot.cfg-warn   { background: #f59e0b; }
.agent-config-dot.cfg-error  { background: #ef4444; }
.agent-config-dot.cfg-missing { background: #6b7280; border-color: #4b5563; }

/* Tooltip label on dot */
.agent-config-dot[data-cli]::after {
  content: attr(data-cli);
  position: absolute;
  display: none;
}

/* ── Agent Config Inspector Panel ── */

.agent-config-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 6px 8px 8px;
  padding: 12px;
  animation: agentCfgSlideIn 0.15s ease;
}

.agent-config-panel.no-anim {
  animation: none;
}

@keyframes agentCfgSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.agent-config-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.agent-config-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.agent-config-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* CLI config card inside panel */
.agent-cfg-card {
  background: var(--surface-hover);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.agent-cfg-card:last-child {
  margin-bottom: 0;
}

.agent-cfg-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.agent-cfg-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.agent-cfg-card-status {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: auto;
}

.agent-cfg-card-status.status-ok    { background: rgba(34,197,94,0.15); color: #22c55e; }
.agent-cfg-card-status.status-warn  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.agent-cfg-card-status.status-error { background: rgba(239,68,68,0.15); color: #ef4444; }
.agent-cfg-card-status.status-none  { background: rgba(107,114,128,0.15); color: #9ca3af; }

.agent-cfg-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
}

.agent-cfg-label {
  color: var(--text-dim);
  min-width: 72px;
  flex-shrink: 0;
}

.agent-cfg-value {
  color: var(--text);
  word-break: break-all;
}

.agent-cfg-source {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: auto;
}

/* Warnings list */
.agent-cfg-warnings {
  margin-top: 8px;
  padding: 8px;
  background: rgba(245,158,11,0.08);
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

.agent-cfg-warning-item {
  font-size: 11px;
  color: #f59e0b;
  padding: 2px 0;
  display: flex;
  gap: 4px;
}

.agent-cfg-warning-item.level-error {
  color: #ef4444;
}

.agent-cfg-warning-item .warn-cli {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9px;
  opacity: 0.8;
}

/* Scaffold button */
.agent-cfg-scaffold-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: var(--primary, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.agent-cfg-scaffold-btn:active {
  opacity: 0.8;
}

.agent-cfg-scaffold-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-cfg-scaffold-result {
  font-size: 11px;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(34,197,94,0.1);
  color: #22c55e;
}

.agent-cfg-scaffold-result.has-errors {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

/* ── Auto-Configure Section ── */

.agent-cfg-autoconfig {
  margin-top: 8px;
}

.agent-cfg-autoconfig-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  background: transparent;
  color: var(--accent, #58a6ff);
  border: 1px dashed var(--border, #30363d);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.agent-cfg-autoconfig-btn:active {
  background: rgba(88, 166, 255, 0.08);
  border-color: var(--accent, #58a6ff);
}

/* Progress spinner */
.agent-cfg-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.agent-cfg-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border, #30363d);
  border-top-color: var(--accent, #58a6ff);
  border-radius: 50%;
  animation: agentCfgSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes agentCfgSpin {
  to { transform: rotate(360deg); }
}

.agent-cfg-progress span {
  font-size: 12px;
  color: var(--text-dim, #8b949e);
}

/* Proposal summary */
.agent-cfg-proposal-summary {
  font-size: 12px;
  color: var(--text, #c9d1d9);
  padding: 8px 0 4px;
}

/* Stack tags */
.agent-cfg-proposal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 8px;
}

.agent-cfg-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(88, 166, 255, 0.12);
  color: #58a6ff;
}

/* Clarifying questions */
.agent-cfg-proposal-questions {
  margin: 6px 0 10px;
  padding: 10px;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: rgba(88, 166, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-cfg-questions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #c9d1d9);
}

.agent-cfg-question-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-cfg-question-text {
  font-size: 11px;
  color: var(--text-dim, #8b949e);
}

.agent-cfg-question-select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #c9d1d9);
  font-size: 12px;
}

.agent-cfg-question-input {
  width: 100%;
  min-height: 78px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #c9d1d9);
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
}

/* Conversational setup agent */
.agent-cfg-chat {
  margin: 8px 0 10px;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: rgba(88, 166, 255, 0.04);
  padding: 10px;
}

.agent-cfg-chat-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #c9d1d9);
  margin-bottom: 8px;
}

.agent-cfg-chat-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.agent-cfg-chat-msg {
  font-size: 12px;
  line-height: 1.45;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-cfg-chat-msg.msg-agent {
  background: rgba(88, 166, 255, 0.1);
  color: var(--text, #c9d1d9);
  align-self: flex-start;
}

.agent-cfg-chat-msg.msg-user {
  background: rgba(63, 185, 80, 0.12);
  color: #d1fae5;
  align-self: flex-end;
}

.agent-cfg-chat-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim, #8b949e);
}

.agent-cfg-chat-compose {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.agent-cfg-chat-input {
  flex: 1;
  min-height: 56px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #c9d1d9);
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
}

.agent-cfg-chat-send {
  min-width: 74px;
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid var(--accent, #58a6ff);
  background: transparent;
  color: var(--accent, #58a6ff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.agent-cfg-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* File list */
.agent-cfg-proposal-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-cfg-proposal-file {
  background: var(--surface-hover, rgba(255,255,255,0.04));
  border-radius: 6px;
  overflow: hidden;
}

.agent-cfg-proposal-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.agent-cfg-proposal-file-header.expanded {
  border-bottom: 1px solid var(--border, #30363d);
}

.agent-cfg-proposal-file-name {
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  color: var(--text, #c9d1d9);
}

.agent-cfg-proposal-file-action {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.agent-cfg-proposal-file-action.action-create {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

.agent-cfg-proposal-file-action.action-skip {
  background: rgba(139, 148, 158, 0.15);
  color: #8b949e;
}

.agent-cfg-proposal-file-content {
  display: none;
  margin: 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  color: var(--text-dim, #8b949e);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.agent-cfg-proposal-file-content.expanded {
  display: block;
}

/* Proposal actions */
.agent-cfg-proposal-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.agent-cfg-proposal-actions .agent-cfg-scaffold-btn {
  flex: 1;
  margin-top: 0;
}

.agent-cfg-cancel-btn {
  padding: 10px 16px;
  background: transparent;
  color: var(--text-dim, #8b949e);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.agent-cfg-cancel-btn:active {
  background: rgba(139, 148, 158, 0.08);
}

.agent-cfg-inline-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim, #8b949e);
}

.agent-cfg-inline-status.status-ok {
  color: #22c55e;
}

.agent-cfg-inline-status.status-error {
  color: #ef4444;
}

/* Success/Error messages */
.agent-cfg-success-msg {
  font-size: 12px;
  padding: 10px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  text-align: center;
}

.agent-cfg-error-msg {
  font-size: 12px;
  padding: 10px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
