.server-status {
  position: fixed;
  right: 18px;
  bottom: 8px;
  z-index: 80;
  background: var(--nav);
  color: var(--status-ok-ink);
  border: 1px solid var(--nav-line);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  max-width: min(700px, 90vw);
}
.server-status.error {
  color: var(--status-err-ink);
  background: var(--status-err-bg);
}
.wf-definition-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 18px;
}
.wf-meta {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.wf-meta .field {
  margin: 0;
}
.wf-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-strong);
  padding: 18px 0;
}
.wf-designer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 380px);
  gap: 22px;
  align-items: start;
}
.wf-canvas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  background: radial-gradient(var(--line-strong) 1px, transparent 1px) 0 0/18px 18px;
  border-radius: 10px;
  align-content: start;
}
.wf-node {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 18px;
  min-height: 140px;
  cursor: pointer;
}
.wf-node:hover,
.wf-node.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.wf-number {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 11px;
  color: var(--muted);
}
.wf-edges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.wf-inspector {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 20px;
  position: sticky;
  top: 20px;
}
.wf-inspector h3 {
  margin: 8px 0 20px;
}
.wf-inspector select,
.wf-inspector input,
.wf-inspector textarea,
.wf-meta input,
.wf-meta select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.wf-outcome {
  padding: 12px;
  margin: 12px 0;
  background: white;
  border-radius: 7px;
}
.wf-test {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
}
.wf-test label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
}
.wf-test small {
  display: block;
  width: 100%;
  color: var(--muted);
}
.wf-run {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 18px;
  margin: 16px 0;
}
.wf-task {
  padding: 16px;
  background: var(--blue-pale);
  border: 1px solid var(--blue-line);
  border-radius: 7px;
  margin: 15px 0;
}
.wf-task p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.wf-task .field {
  margin-top: 12px;
}
.wf-task textarea {
  width: 100%;
  box-sizing: border-box;
}
.wf-outcome-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wf-log {
  font-size: 12px;
  line-height: 1.8;
  padding-left: 22px;
}
.wf-log time {
  color: var(--muted);
  margin-right: 6px;
}
.wf-readonly .wf-canvas {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field-group-title {
  font-size: 11px;
  color: var(--muted);
  margin: 20px 0 10px;
  letter-spacing: 0.04em;
}
.config-stage-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.config-stage-checks label {
  font-size: 12px;
}
.stage-editor-row select {
  width: 110px;
  min-width: 90px;
  font-size: 11px;
}
.stage-editor-row input[type='color'] {
  width: 28px;
  min-width: 28px;
  padding: 0;
  flex: none;
}
.load-error {
  padding: 60px;
  color: var(--ink-2);
  background: var(--bg);
  font-size: 13px;
  min-height: 100vh;
}
.load-error a {
  color: var(--blue);
}
@media (max-width: 1000px) {
  .wf-designer {
    grid-template-columns: 1fr;
  }
  .wf-inspector {
    position: static;
  }
  .wf-meta {
    grid-template-columns: 1fr 1fr;
  }
  .wf-readonly .wf-canvas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .wf-meta,
  .wf-canvas,
  .wf-readonly .wf-canvas {
    grid-template-columns: 1fr;
  }
  .wf-canvas {
    padding: 12px;
  }
  .wf-test select {
    max-width: 100%;
  }
  .config-stage-checks {
    grid-template-columns: 1fr;
  }
  .stage-editor-row {
    flex-wrap: wrap;
  }
  .wf-definition-tabs .btn {
    white-space: normal;
    min-width: 180px;
  }
  .server-status {
    font-size: 12px;
  }
}

.wf-inspector {
  max-height: 75vh;
  overflow: auto;
}
.wf-inspector .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 12px;
}
.wf-node strong {
  font-size: 14px;
}
.wf-node.selected {
  background: var(--blue-pale);
}
.wf-outcome {
  border: 1px solid var(--line);
}
.wf-readonly .wf-canvas {
  background-color: var(--bg);
}
.wf-run > p {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .wf-inspector {
    max-height: none;
  }
}

.server-status {
  pointer-events: none;
}
.server-status.error {
  pointer-events: auto;
}
.server-status button {
  color: white;
  text-decoration: underline;
}
/* A successful save confirms itself, then gets out of the way; errors stay */
.server-status {
  transition: opacity 0.3s ease-out;
}
.server-status.settled {
  opacity: 0;
}
/* Process counts as one line, like the other screens (no metric tiles) */
.wf-summary-line {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.wf-summary-line .wf-errors {
  color: var(--red);
}
.wf-test label {
  min-width: 0;
  max-width: 100%;
}
.wf-test select {
  width: 100%;
  min-width: 0;
}
.wf-test small {
  font-size: 12px;
}
/* Process node type reads as a quiet label, not a kicker; the selected process tab is not a second primary */
.wf-kind {
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 12px;
}
.wf-definition-tabs .btn.wf-tab-active {
  background: var(--blue-pale);
  border-color: var(--blue-line);
  color: var(--blue);
  font-weight: 600;
}
