/* assets/pipeline.css */
.ddt-pipeline {
  position: fixed;
  right: 16px;
  top: 96px;
  bottom: 16px;
  width: 340px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.2s ease;
}

body.ddt-pipeline-open .ddt-pipeline {
  transform: translateX(0);
}

.ddt-pipeline-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 55;
}

body.ddt-pipeline-open .ddt-pipeline-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.ddt-pipeline-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ddt-pipeline-title {
  font-weight: 700;
}

.ddt-pipeline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ddt-pipeline-body {
  padding: 12px 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ddt-pipeline-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.ddt-pipeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.ddt-pipeline-step {
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ddt-pipeline-step-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.ddt-pipeline-step-title {
  font-weight: 700;
  font-size: 13px;
}

.ddt-pipeline-step-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.ddt-pipeline-step-preview {
  font-size: 12px;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-soft);
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 36px;
  white-space: pre-wrap;
  overflow: hidden;
}

.ddt-pipeline-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ddt-pipeline-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
}

.ddt-pipeline-picker {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
}

.ddt-pipeline-picker.is-open {
  display: flex;
}

.ddt-pipeline-picker-dialog {
  width: min(520px, 92vw);
  max-height: 70vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ddt-pipeline-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ddt-pipeline-picker-title {
  font-weight: 700;
}

.ddt-pipeline-picker-list {
  overflow: auto;
  display: grid;
  gap: 6px;
}

.ddt-pipeline-picker-item {
  text-align: left;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.ddt-pipeline-picker-item:hover {
  border-color: var(--border-muted);
  background: var(--card-bg);
}

.ddt-pipeline-picker-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px;
}

@media (max-width: 980px) {
  .ddt-pipeline {
    width: auto;
    right: 12px;
    left: 12px;
    top: auto;
    bottom: 12px;
    height: 55vh;
    transform: translateY(120%);
  }

  body.ddt-pipeline-open .ddt-pipeline {
    transform: translateY(0);
  }
}
