/* Workflow editor — Studio surface
 * Cohérent avec studio.css (tokens definis dans /studio.css). */

.wf-main {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.wf-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

/* ===== List view ===== */

.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.wf-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}
.wf-card:hover {
  border-color: rgba(125, 211, 252, 0.5);
  transform: translateY(-1px);
}
.wf-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #E2E8F0;
}
.wf-card .desc {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.7);
  flex: 1;
  min-height: 2.4em;
}
.wf-card .meta {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.5);
}

/* ===== Editor shell ===== */

.wf-editor-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  margin-top: 1rem;
  min-height: 70vh;
}
@media (max-width: 900px) {
  .wf-editor-shell {
    grid-template-columns: 1fr;
  }
}

.wf-side {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid rgba(125, 211, 252, 0.15);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 80vh;
  overflow-y: auto;
}

.wf-side-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wf-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(125, 211, 252, 0.85);
}

.wf-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 6px;
  color: #E2E8F0;
  font: inherit;
  padding: 0.5rem 0.6rem;
}
.wf-input:focus {
  outline: 2px solid rgba(125, 211, 252, 0.55);
  outline-offset: 1px;
}
textarea.wf-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.wf-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.wf-chip {
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 999px;
  color: #E2E8F0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}
.wf-chip:hover {
  background: rgba(125, 211, 252, 0.16);
}

.wf-hint {
  margin: 0;
  color: rgba(226, 232, 240, 0.6);
  font-size: 0.8rem;
}

.wf-json {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.85);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(125, 211, 252, 0.1);
  border-radius: 6px;
  padding: 0.6rem;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== Canvas ===== */

.wf-canvas-wrap {
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, rgba(125, 211, 252, 0.06) 1px, transparent 0)
    0 0 / 18px 18px,
    rgba(11, 17, 32, 0.55);
  border: 1px solid rgba(125, 211, 252, 0.15);
  border-radius: 10px;
  min-height: 70vh;
  overflow: hidden;
}

#wf-canvas {
  position: absolute;
  inset: 0;
}

.wf-canvas-hint {
  position: absolute;
  bottom: 0.6rem;
  right: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(226, 232, 240, 0.45);
  pointer-events: none;
  background: rgba(11, 17, 32, 0.7);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* ===== Toast ===== */

.wf-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 17, 32, 0.95);
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  color: #E2E8F0;
  font-size: 0.9rem;
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.wf-toast[data-tone="error"] {
  border-color: rgba(248, 113, 113, 0.5);
}
.wf-toast[data-tone="success"] {
  border-color: rgba(74, 222, 128, 0.5);
}
