/* ShieldReplay — Automation Studio (multi-step) */
.auto-studio {
  --auto-glow: rgba(79, 70, 229, 0.22);
  --auto-surface: var(--surface);
  min-height: 100vh;
  background: var(--bg);
}

.auto-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.auto-sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
}

.auto-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0 6px;
}
.auto-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}
.auto-brand strong { display: block; font-size: 0.95rem; letter-spacing: -0.02em; }
.auto-brand span { font-size: 0.72rem; color: var(--muted); }

.auto-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.auto-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.auto-nav a.is-active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(14, 165, 233, 0.08));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.18);
}

.auto-sidebar-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.08), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(79, 70, 229, 0.12);
}
.auto-sidebar-stats span {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.auto-sidebar-stats small {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.auto-main { padding: 24px 28px 32px; overflow-x: hidden; }

.auto-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.auto-eyebrow {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #06b6d4;
}
.auto-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.auto-hero p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.auto-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-secondary);
}
.btn.ghost:hover { background: var(--surface-inset); }
.btn.ghost.sm { padding: 6px 10px; font-size: 0.75rem; }

.auto-templates {
  margin-bottom: 20px;
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}
.auto-templates.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}
.auto-section-label {
  margin: 0 0 12px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.auto-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.auto-template-card {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  background: var(--auto-surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  overflow: hidden;
}
.auto-template-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--tpl-accent, #4f46e5), transparent 65%);
  opacity: 0.07;
  pointer-events: none;
}
.auto-template-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px var(--auto-glow);
  border-color: rgba(79, 70, 229, 0.28);
}
.auto-template-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 16px 40px var(--auto-glow);
}
.auto-template-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 1rem;
  color: var(--tpl-accent, #4f46e5);
  box-shadow: var(--shadow-xs);
}
.auto-template-card strong { display: block; margin-bottom: 4px; font-size: 0.88rem; }
.auto-template-card small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 8px;
}
.auto-template-steps {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
}

.auto-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 16px;
  min-height: 460px;
}
@media (max-width: 1200px) {
  .auto-workspace { grid-template-columns: 1fr; }
  .auto-shell { grid-template-columns: 1fr; }
  .auto-sidebar { border-right: none; border-bottom: 1px solid var(--line); }
}

.auto-rules-rail {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--auto-surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}
.auto-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.auto-rail-head h3 { margin: 0; font-size: 0.82rem; font-weight: 700; }
.auto-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
}

.auto-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.auto-rule-main {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.auto-rule-main:hover { background: var(--surface-inset); }
.auto-rule-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.auto-rule-delete svg {
  width: 15px;
  height: 15px;
}
.auto-rule-item:hover .auto-rule-delete,
.auto-rule-item.is-active .auto-rule-delete {
  opacity: 1;
}
.auto-rule-delete:hover {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
  transform: scale(1.04);
}
.auto-rule-delete:active {
  transform: scale(0.96);
}
.auto-rule-item:hover { background: var(--surface-inset); }
.auto-rule-item.is-active {
  background: var(--accent-soft);
  border-color: rgba(79, 70, 229, 0.22);
}
.auto-rule-copy strong { display: block; font-size: 0.8rem; margin-bottom: 2px; }
.auto-rule-copy small { font-size: 0.68rem; color: var(--muted); }

.auto-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-full);
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s;
}
.auto-toggle.is-on { background: var(--accent); }
.auto-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s;
}
.auto-toggle.is-on::after { transform: translateX(16px); }

/* Canvas + pipeline */
.auto-canvas-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 22px;
  border: 1px solid rgba(199, 210, 254, 0.7);
  background: linear-gradient(145deg, rgba(255,255,255,0.94), rgba(248,250,252,0.8));
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.1), inset 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
}
.auto-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.6);
  flex-wrap: wrap;
}
.auto-canvas-head h3 { margin: 0 0 2px; font-size: 0.88rem; }
.auto-canvas-head p { margin: 0; font-size: 0.72rem; color: var(--muted); }

.auto-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.auto-palette-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-full);
  background: #fff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.auto-palette-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
}
.palette-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
}
.palette-icon.cond { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.palette-icon.act { background: rgba(5, 150, 105, 0.15); color: #059669; }
.palette-icon.dly { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.palette-icon.br { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.palette-icon.api { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }

.auto-pipeline {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 220px;
  padding: 8px 4px;
}

.auto-pipeline > .auto-step,
.auto-pipeline > .auto-pipe-connector,
.auto-pipeline > .auto-fork {
  align-self: center;
}
.auto-pipeline > .auto-fork {
  align-self: stretch;
  max-width: 560px;
}

.auto-pipeline > .auto-step {
  flex: 0 0 auto;
  width: min(220px, 100%);
}

.auto-pipeline > .auto-pipe-connector {
  width: 3px;
  height: 40px;
  flex: 0 0 40px;
  flex-direction: column;
}
.auto-pipeline > .auto-pipe-connector .auto-pipe-line {
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #4f46e5, #06b6d4, #10b981);
}
.auto-pipeline > .auto-pipe-connector .auto-connector-arrow { display: none; }

.auto-step.auto-step-branch {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.12);
}

.auto-fork {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 4px auto 16px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(139, 92, 246, 0.25);
}
@media (max-width: 600px) {
  .auto-fork { grid-template-columns: 1fr; }
}

.auto-fork-lane {
  padding: 10px;
  border-radius: 12px;
  min-height: 80px;
}
.auto-fork-lane.then {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.auto-fork-lane.else {
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.07), rgba(244, 63, 94, 0.02));
  border: 1px solid rgba(244, 63, 94, 0.18);
}
.lane-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auto-fork-lane.then .lane-label { color: #059669; }
.auto-fork-lane.else .lane-label { color: #e11d48; }

.lane-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-mini-step {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auto-mini-step:hover { border-color: var(--step-color, var(--accent)); }
.auto-mini-step.is-selected {
  border-color: var(--step-color, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--step-color, #4f46e5) 20%, transparent);
}
.auto-mini-step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.7rem;
  background: color-mix(in srgb, var(--step-color, #4f46e5) 12%, white);
  flex-shrink: 0;
}
.auto-mini-step strong {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.auto-lane-add {
  margin-top: 4px;
  padding: 6px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.auto-lane-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.auto-canvas {
  position: relative;
  flex: 1;
  padding: 24px 20px 28px;
  overflow-x: auto;
  overflow-y: hidden;
}
.auto-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(79,70,229,0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(14,165,233,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 90%);
  pointer-events: none;
}

.auto-step {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  overflow: hidden;
}
.auto-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}
.auto-step.is-selected {
  border-color: var(--step-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--step-color, #4f46e5) 22%, transparent),
    0 18px 40px rgba(79, 70, 229, 0.15);
  transform: translateY(-4px);
}
.auto-step-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--step-color, #4f46e5);
  opacity: 0.85;
}
.auto-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.auto-step-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--step-color) 12%, white);
  color: var(--step-color);
}
.auto-step-type {
  flex: 1;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--step-color);
}
.auto-step-remove {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(241, 245, 249, 0.9);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.auto-step:hover .auto-step-remove,
.auto-step.is-selected .auto-step-remove { opacity: 1; }
.auto-step-remove:hover { background: var(--danger-soft); color: var(--danger); }

.auto-step-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.auto-step-desc {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  min-height: 2.2em;
}
.auto-step-index {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0.7;
}

.auto-pipe-connector {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auto-pipe-line {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.auto-pipe-pulse {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95), transparent);
  animation: auto-shimmer 2.2s ease infinite;
}
@keyframes auto-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.auto-pipe-insert {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border: 1px dashed rgba(79, 70, 229, 0.35);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.auto-pipe-connector:hover .auto-pipe-insert {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Inspector */
.auto-inspector {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--auto-surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  max-height: 520px;
  overflow-y: auto;
}
.auto-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.auto-inspector-head h3 { margin: 0; font-size: 0.88rem; }
.auto-step-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auto-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
.auto-field { margin-bottom: 12px; }
.auto-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auto-field input,
.auto-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text);
}
.auto-field select {
  width: 100%;
}
.auto-field textarea { min-height: 68px; resize: vertical; }
.auto-field input:focus,
.auto-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.auto-hint {
  margin: -4px 0 10px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}
.auto-step-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.auto-feed {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--auto-surface);
  box-shadow: var(--shadow-sm);
}
.auto-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.auto-feed-head h3 { margin: 0; font-size: 0.9rem; }
.auto-exec-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; }
.auto-exec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  font-size: 0.78rem;
}
.auto-exec-item:last-child { border-bottom: none; }
.auto-status {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
}
.auto-status.success { background: var(--success-soft); color: var(--success); }
.auto-status.failed { background: var(--danger-soft); color: var(--danger); }
.auto-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.auto-save-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Drag & drop */
.auto-step[draggable="true"],
.auto-mini-step[draggable="true"],
.auto-palette-btn[draggable="true"],
.catalog-item[draggable="true"] {
  cursor: grab;
}
.auto-step.is-dragging,
.auto-mini-step.is-dragging {
  opacity: 0.45;
  transform: scale(0.97);
  cursor: grabbing;
}
.auto-drag-handle {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: -2px;
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.auto-step:hover .auto-drag-handle,
.auto-mini-step:hover .auto-drag-handle { opacity: 1; }

.auto-drop-zone {
  border: 2px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 0.15s, background 0.15s, min-height 0.15s;
}
.auto-drop-zone.is-drag-over {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.auto-pipe-connector.auto-drop-zone {
  min-height: 44px;
  border: none;
  background: transparent;
}
.auto-pipe-connector.auto-drop-zone.is-drag-over {
  background: rgba(79, 70, 229, 0.06);
  border-radius: 8px;
}
.auto-pipeline-end-drop {
  margin: 8px auto 0;
  padding: 14px 20px;
  text-align: center;
  max-width: 280px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.auto-pipeline-end-drop:not([hidden]) { display: block; }
.lane-steps.auto-drop-zone {
  min-height: 48px;
  padding: 6px;
  border-radius: 8px;
}
.lane-steps.auto-drop-zone.is-drag-over {
  border: 2px dashed var(--accent);
}

.auto-drag-ghost {
  position: fixed;
  z-index: 9998;
  pointer-events: none;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--accent);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.25);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  transform: translate(-50%, -120%);
}

/* Right-click context menu */
.auto-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 200px;
  max-width: 280px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}
.auto-context-menu[hidden] { display: none; }
.ctx-item,
.ctx-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.ctx-item:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.ctx-item:disabled { opacity: 0.4; cursor: not-allowed; }
.ctx-item.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.ctx-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: default;
  padding-top: 10px;
}
.ctx-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}
.ctx-icon { width: 18px; text-align: center; flex-shrink: 0; }

/* Options catalog */
.auto-options-catalog {
  margin-top: 20px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.65);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.catalog-head h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
}
.catalog-head input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  margin-bottom: 10px;
}
.catalog-groups {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
}
.catalog-group { margin-bottom: 12px; }
.catalog-group-title {
  margin: 0 0 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.catalog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  margin-bottom: 4px;
  border: 1px solid rgba(241, 245, 249, 0.95);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  cursor: grab;
  transition: border-color 0.15s, transform 0.15s;
}
.catalog-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.catalog-item span:first-child {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.catalog-hint {
  margin: 10px 0 0;
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.4;
}

.auto-sidebar { overflow-y: auto; }

.auto-palette-btn { cursor: grab; }
.auto-palette-btn:active { cursor: grabbing; }

.auto-inspector .auto-field-group {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
}
.auto-inspector .auto-field-group h5 {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.btn-sm { padding: 4px 10px; font-size: 0.72rem; }

.auto-panels {
  margin: 0 0 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.auto-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.auto-panel p { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
.auto-sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.auto-sim-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; }
.auto-sim-output {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-inset);
  font-size: 0.72rem;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}
.auto-secrets-list, .auto-versions-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.auto-secrets-list li, .auto-versions-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.auto-secret-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auto-secret-form input { flex: 1; min-width: 120px; }

