/* ── Quick Actions – contextual toolbars next to entities ── */

/* Floating toolbar next to cards / junctions */
.qa-toolbar {
  position: absolute;
  z-index: var(--z-toolbar);
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  opacity: 1;
  pointer-events: auto;
}
.qa-toolbar.qa-visible {
  opacity: 1;
  pointer-events: auto;
}
.qa-toolbar.qa-vertical { flex-direction: column; }

/* Card-anchored toolbar: positioned inside canvas-wrap so it scales with zoom */
.qa-toolbar--card {
  /* inherits .qa-toolbar */
}

/* SVG foreignObject-based toolbars (segments / junctions) live in wire-svg */

.qa-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .12s;
}
.qa-btn:hover {
  background: var(--border-strong);
  color: var(--text);
}
.qa-btn--danger:hover {
  color: var(--danger);
  background: var(--danger-hover-bg);
}
.qa-btn svg.lucide { width: 13px; height: 13px; }

/* Pulsing primary action (context suggests this is the next logical step) */
.qa-btn--pulse {
  animation: qa-pulse-blue 1.5s ease-in-out infinite;
  box-shadow: 0 0 6px #3b82f6;
}
@keyframes qa-pulse-blue {
  0%, 100% { box-shadow: 0 0 4px #3b82f6; background: var(--bg-card); }
  50%      { box-shadow: 0 0 12px #3b82f6; background: rgba(59, 130, 246, 0.15); }
}

/* Hide the small hdr / splice pencils — quick-actions toolbar has Edit */
.hdr-edit,
.splice-edit { display: none !important; }

/* Floating pin toolbar (shown next to unwired pin row on hover) */
.qa-toolbar.qa-pin-tb {
  position: fixed;
  z-index: var(--z-qa-popup);
  padding: 2px;
}
.qa-toolbar.qa-pin-tb .qa-btn {
  width: 22px;
  height: 22px;
}
.qa-toolbar.qa-pin-tb .qa-btn svg.lucide { width: 13px; height: 13px; }

/* Subtle hint on unwired pin rows */
tr.pr.qa-pin-unwired:hover {
  background: var(--bg-hover, rgba(239, 68, 68, 0.08));
  cursor: pointer;
}

/* Toggle button in harness-tools toolbar (reuses .ht-btn style) */
.ht-btn.qa-toggle-active {
  background: var(--bg-accent-strong);
  border-color: var(--accent);
  color: var(--accent-bright);
}
#qa-toggle:not(.qa-toggle-active) {
  opacity: 0.5;
  position: relative;
}
#qa-toggle:not(.qa-toggle-active)::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 50%;
  height: 2px;
  background: currentColor;
  transform: rotate(-25deg);
  pointer-events: none;
}

/* SVG-side toolbar container (segment/junction): uses foreignObject */
.qa-svg-toolbar {
  position: absolute;
  z-index: var(--z-toolbar);
  pointer-events: auto;
}
