/* ─── AK Chat — Agent Builder ──────────────────────────────────────────────── */

:root {
  --ab-trigger:  #ff6b00;
  --ab-ai:       #6366f1;
  --ab-web:      #10b981;
  --ab-media:    #f59e0b;
  --ab-logic:    #64748b;
  --ab-memory:   #8b5cf6;
  --ab-output:   #f43f5e;
}

.ab-page {
  overflow: hidden;
  height: 100vh;
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────────── */
#ab-topbar {
  height: 58px;
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.ab-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ab-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.ab-back-btn:hover { background: var(--tertiary); color: var(--text); }

.ab-topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.ab-topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.ab-agent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.ab-meta-input {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
  width: 200px;
}
.ab-meta-input:focus { border-color: var(--primary); }
.ab-meta-slug { width: 140px; font-family: monospace; font-size: 12px; }

.ab-meta-select {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.ab-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ab-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
}
.ab-btn:hover { opacity: 0.85; }
.ab-btn-primary { background: var(--primary); color: #fff; }
.ab-btn-ghost   { background: var(--tertiary); border: 1px solid var(--border); color: var(--text-muted); }
.ab-btn-ghost:hover { color: var(--text); }
.ab-btn-danger  { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #ef4444; }
.ab-btn-danger:hover { background: rgba(239,68,68,0.25); opacity: 1; }
.ab-btn-sm      { padding: 4px 10px; font-size: 12px; }
.ab-btn-full    { width: 100%; }

/* ── Settings Drawer ─────────────────────────────────────────────────────────── */
.ab-settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}
.ab-settings-overlay.open { display: block; }

.ab-settings-drawer {
  position: fixed;
  top: 58px;
  right: -320px;
  width: 300px;
  height: calc(100vh - 58px);
  background: var(--secondary);
  border-left: 1px solid var(--border);
  z-index: 201;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
}
.ab-settings-drawer.open { right: 0; }

.ab-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.ab-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.ab-drawer-close:hover { background: var(--tertiary); color: var(--text); }

.ab-drawer-body { padding: 16px; overflow-y: auto; flex: 1; }

/* ── Main Layout ─────────────────────────────────────────────────────────────── */
#ab-layout {
  display: flex;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* ── Left Palette ────────────────────────────────────────────────────────────── */
#ab-palette {
  width: 220px;
  min-width: 220px;
  background: var(--secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ab-palette-header {
  padding: 12px 14px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.ab-category {
  margin-bottom: 2px;
}

.ab-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  transition: color var(--transition);
}
.ab-category-header:hover { color: var(--text); }
.ab-category-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
}
.ab-category.open .ab-category-arrow { transform: rotate(90deg); }

.ab-category-items {
  display: none;
  padding: 0 8px 6px;
}
.ab-category.open .ab-category-items { display: block; }

.ab-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.ab-palette-item:hover {
  background: var(--tertiary);
  color: var(--text);
}
.ab-palette-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ab-palette-item-info {
  margin-left: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tertiary);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.ab-palette-item:hover .ab-palette-item-info { opacity: 1; }

/* Tooltip */
.ab-palette-item[data-tooltip] { position: relative; }
.ab-palette-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: fixed;
  left: var(--tt-x, 228px);
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  width: 240px;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
  white-space: normal;
  transform: translateY(-50%);
  top: var(--tt-y, 50%);
}

/* ── Test Panel ──────────────────────────────────────────────────────────────── */
.ab-test-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 600;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.ab-test-overlay.open { display: flex; }

.ab-test-panel {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 680px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

.ab-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.ab-test-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.ab-test-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ab-test-textarea {
  flex: 1;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  min-height: 68px;
  transition: border-color var(--transition);
  font-family: inherit;
}
.ab-test-textarea:focus { outline: none; border-color: var(--primary); }

.ab-test-spinner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}
.ab-test-spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ab-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes ab-spin { to { transform: rotate(360deg); } }

.ab-test-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.ab-test-trace-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.ab-test-trace-toggle:hover { color: var(--text-muted); }

.ab-test-response-text {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.ab-test-trace-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.ab-test-trace-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}
.ab-test-trace-icon { font-size: 14px; flex-shrink: 0; }
.ab-test-trace-type { font-weight: 600; color: var(--text); flex: 1; }
.ab-test-trace-note { color: var(--text-muted); font-size: 11px; }
.ab-test-trace-ok   { color: #22c55e; font-size: 11px; flex-shrink: 0; }
.ab-test-trace-fail { color: #ef4444; font-size: 11px; flex-shrink: 0; }

/* ── Import JSON Modal ───────────────────────────────────────────────────────── */
.ab-import-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 600;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.ab-import-overlay.open { display: flex; }

.ab-import-modal {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 600px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

.ab-import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.ab-import-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ab-import-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.ab-import-hint code {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text);
}

.ab-import-textarea {
  width: 100%;
  height: 220px;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
  transition: border-color var(--transition);
}
.ab-import-textarea:focus { outline: none; border-color: var(--primary); }

.ab-import-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #ef4444;
}

.ab-import-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ── Template Gallery ────────────────────────────────────────────────────────── */
.ab-tg-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.ab-tg-overlay.open { display: flex; }

.ab-tg-gallery {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 860px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

.ab-tg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ab-tg-title {
  font-size: 17px;
  font-weight: 700;
}
.ab-tg-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.ab-tg-close:hover { background: var(--tertiary); color: var(--text); }

.ab-tg-body {
  overflow-y: auto;
  padding: 22px;
  flex: 1;
}

.ab-tg-section { margin-bottom: 28px; }
.ab-tg-section:last-child { margin-bottom: 0; }

.ab-tg-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.ab-tg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.ab-tg-card {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s;
  cursor: default;
  position: relative;
}
.ab-tg-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.ab-tg-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ab-tg-card-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  background: var(--secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ab-tg-card-name {
  font-size: 14px;
  font-weight: 700;
}

.ab-tg-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.ab-tg-card-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.ab-tg-step {
  font-size: 10px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 7px;
  color: var(--text-muted);
  white-space: nowrap;
}
.ab-tg-step-arrow {
  font-size: 10px;
  color: var(--text-dim);
}

.ab-tg-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.ab-tg-card-footer .ab-btn { flex: 1; text-align: center; }

.ab-tg-delete-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-dim);
  transition: background var(--transition), color var(--transition);
}
.ab-tg-delete-btn:hover { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.ab-tg-card .ab-tg-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.4;
}

/* ── Canvas ──────────────────────────────────────────────────────────────────── */
#ab-canvas-wrap {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-dark);
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  position: relative;
}

#ab-canvas {
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 120px;
}

#ab-canvas-inner {
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Nodes ───────────────────────────────────────────────────────────────────── */
.ab-node-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ab-node {
  width: 100%;
  background: var(--secondary);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}
.ab-node:hover {
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.ab-node.selected {
  border-color: var(--node-color, var(--primary));
  box-shadow: 0 0 0 3px rgba(var(--node-color-rgb, 255,107,0), 0.15), 0 4px 20px rgba(0,0,0,0.3);
}

.ab-node-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--node-color, var(--primary));
  border-radius: 10px 0 0 10px;
}

.ab-node-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
}

.ab-node-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--node-color-bg, rgba(255,107,0,0.12));
}

.ab-node-info { flex: 1; min-width: 0; }
.ab-node-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--node-color, var(--primary));
  margin-bottom: 2px;
}
.ab-node-summary {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ab-node-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.ab-node:hover .ab-node-actions { opacity: 1; }
.ab-node.selected .ab-node-actions { opacity: 1; }

.ab-node-btn {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
}
.ab-node-btn:hover { background: var(--bg-dark); color: var(--text); }
.ab-node-del-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* ── Connector ───────────────────────────────────────────────────────────────── */
.ab-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 44px;
  position: relative;
}
.ab-connector-line {
  width: 2px;
  flex: 1;
  background: var(--border);
}
.ab-connector-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--border);
  margin-top: -1px;
}

/* Add step button between nodes */
.ab-add-between {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-dim);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  opacity: 0;
}
.ab-connector:hover .ab-add-between {
  opacity: 1;
  border-color: var(--primary);
  color: var(--primary);
}

/* ── End node ────────────────────────────────────────────────────────────────── */
.ab-end-node {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--secondary);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  gap: 4px;
}

/* ── Empty canvas ────────────────────────────────────────────────────────────── */
.ab-canvas-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
  line-height: 1.8;
}

/* ── Right Config Panel ──────────────────────────────────────────────────────── */
#ab-config-panel {
  width: 300px;
  min-width: 300px;
  background: var(--secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ab-config-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.ab-config-empty-icon { font-size: 32px; opacity: 0.3; }
.ab-config-empty-text { font-size: 13px; color: var(--text-dim); }

#ab-config-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.ab-config-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ab-config-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.ab-config-header-info {}
.ab-config-header-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.ab-config-header-name { font-size: 14px; font-weight: 600; }

.ab-config-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.ab-config-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Form elements ───────────────────────────────────────────────────────────── */
.ab-field-group {
  margin-bottom: 14px;
}
.ab-field-group:last-child { margin-bottom: 0; }

.ab-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ab-input, .ab-select, .ab-textarea {
  width: 100%;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.ab-input:focus, .ab-select:focus, .ab-textarea:focus { border-color: var(--primary); }
.ab-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.ab-select { cursor: pointer; }
.ab-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.5;
}
.ab-hint code {
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
}

.ab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Node color helpers ──────────────────────────────────────────────────────── */
.nc-trigger { --node-color: #ff6b00; --node-color-bg: rgba(255,107,0,0.12); }
.nc-ai      { --node-color: #6366f1; --node-color-bg: rgba(99,102,241,0.12); }
.nc-web     { --node-color: #10b981; --node-color-bg: rgba(16,185,129,0.12); }
.nc-media   { --node-color: #f59e0b; --node-color-bg: rgba(245,158,11,0.12); }
.nc-logic   { --node-color: #64748b; --node-color-bg: rgba(100,116,139,0.12); }
.nc-memory  { --node-color: #8b5cf6; --node-color-bg: rgba(139,92,246,0.12); }
.nc-output  { --node-color: #f43f5e; --node-color-bg: rgba(244,63,94,0.12); }
