:root {
  --ink: #e8eef8;
  --muted: #9aa8bd;
  --panel: rgba(16, 28, 44, 0.78);
  --line: rgba(180, 210, 255, 0.14);
  --accent: #3dd6c6;
  --accent-ink: #062429;
  --danger: #ff7b72;
  --ok: #3dd6c6;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #071018;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -5%, rgba(61, 214, 198, 0.22), transparent 55%),
    radial-gradient(800px 480px at 88% 8%, rgba(64, 120, 255, 0.2), transparent 50%),
    linear-gradient(165deg, #071018 0%, #0c1a2b 48%, #102033 100%);
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 1rem;
  flex-wrap: wrap;
}

.brand-mark {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.brand-line {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

.top-actions {
  display: flex;
  gap: 0.6rem;
  align-items: end;
  flex-wrap: wrap;
}

.preset-label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.suggest-label input {
  min-width: min(100%, 16rem);
}

select,
input {
  font: inherit;
  color: var(--ink);
  background: rgba(8, 16, 28, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  min-width: 12rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1.2fr) minmax(260px, 0.9fr);
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2.5rem) 2rem;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.2rem;
  backdrop-filter: blur(14px);
}

.panel h2,
.panel h3 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hint,
.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.runtime-filter {
  display: flex;
  gap: 0.35rem;
  margin: 0.55rem 0 0.35rem;
  flex-wrap: wrap;
}

.chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.chip.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}

.catalog-search {
  width: 100%;
  margin-top: 0.45rem;
  min-width: 0;
}

.catalog-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
  max-height: 70vh;
  overflow: auto;
}

.step-card.disabled-step {
  opacity: 0.55;
}

.step-chip {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.55);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.step-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 214, 198, 0.55);
  background: rgba(61, 214, 198, 0.08);
}

.step-chip strong {
  display: block;
  font-size: 0.92rem;
}

.step-chip span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--mono);
}

.pipeline-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.pipeline-head .field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.pipeline-head input {
  min-width: min(100%, 22rem);
}

.pipe-actions,
.out-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.status {
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.status.ok {
  background: rgba(61, 214, 198, 0.12);
  color: var(--ok);
}

.status.err {
  background: rgba(255, 123, 114, 0.12);
  color: var(--danger);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.portability {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

.step-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(8, 16, 28, 0.45);
  animation: rise 0.28s ease both;
  cursor: grab;
}

.step-card.dragging {
  opacity: 0.55;
}

.step-card.drag-over {
  border-color: rgba(61, 214, 198, 0.7);
  box-shadow: inset 0 0 0 1px rgba(61, 214, 198, 0.35);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.step-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.step-tools {
  display: flex;
  gap: 0.25rem;
}

.icon-btn {
  border: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.7);
  color: var(--ink);
  border-radius: 10px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

.params {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.params label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.params input[type="text"],
.params input[type="number"] {
  min-width: 0;
  width: 100%;
}

.params .check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.code {
  margin: 0.4rem 0 0;
  padding: 0.85rem;
  border-radius: 14px;
  background: #050b12;
  color: #d7e7ff;
  overflow: auto;
  max-height: 48vh;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  border: 1px solid var(--line);
}

.code.small {
  max-height: 8rem;
}

.empty[hidden],
.status[hidden] {
  display: none !important;
}
