.workflow-page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.setup-progress-shell {
  margin-bottom: 18px;
}

.setup-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #d9e1ef;
  border-radius: 22px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.setup-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  opacity: 0.55;
}

.setup-step-active {
  opacity: 1;
}

.setup-step-number {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.setup-step-active .setup-step-number {
  background: #2563eb;
  color: #ffffff;
}

.setup-step-label {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.setup-step-line {
  height: 2px;
  flex: 1;
  min-width: 20px;
  background: #e2e8f0;
  border-radius: 999px;
}

.workflow-main-card {
  background: #ffffff;
  border: 1px solid #d9e1ef;
  border-radius: 28px;
  padding: 24px 24px 20px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.05);
}

.workflow-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e9eef8;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 11px;
}

.workflow-title {
  margin: 14px 0 0;
  color: #0f172a;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.workflow-subtitle {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 17px;
  line-height: 1.55;
  max-width: 860px;
}

.workflow-toolbar {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.workflow-helper-text {
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.workflow-steps {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.workflow-step-card {
  border: 1px solid #d9e1ef;
  border-radius: 20px;
  padding: 16px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.workflow-step-card.drag-over {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.workflow-step-card.dragging {
  opacity: 0.55;
}

.new-step-highlight {
  border-color: #60a5fa;
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.12);
}

.workflow-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.workflow-step-header-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.step-title-wrap {
  min-width: 0;
}

.step-title-wrap h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: #0f172a;
  font-weight: 800;
}

.step-title-wrap p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: #64748b;
}

.workflow-step-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.workflow-step-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.workflow-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
}

.workflow-step-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drag-handle {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  cursor: grab;
  padding: 0;
  line-height: 1;
}

.workflow-step-title {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.workflow-step-description {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

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

.icon-btn,
.delete-btn,
.advanced-toggle,
.variable-chip,
.btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover,
.delete-btn:hover,
.advanced-toggle:hover,
.variable-chip:hover,
.btn:hover {
  transform: translateY(-1px);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #d9e1ef;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.delete-btn {
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.workflow-field-group {
  margin-top: 14px;
}

.workflow-field-group label {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workflow-field-group select,
.workflow-field-group textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid #d9e1ef;
  background: #ffffff;
  padding: 12px 14px;
  font-size: 15px;
  color: #0f172a;
  outline: none;
}

.workflow-field-group textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.workflow-field-group select:focus,
.workflow-field-group textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.field-helper {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.token-chip-inline {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  padding: 2px 9px;
  font-weight: 800;
  font-size: 12px;
}

.advanced-timing-wrap {
  margin-top: 14px;
}

.advanced-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid #d9e1ef;
  background: #f8fafc;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
}

.advanced-summary {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.advanced-panel {
  display: none;
  margin-top: 8px;
}

.advanced-panel.open {
  display: block;
}

.variable-chip {
  border: 1px solid #d9e1ef;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.workflow-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  padding: 0 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border-color: #d9e1ef;
}

.step-variable-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.step-variable-title {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.step-variable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subtle-toggle {
  min-height: 42px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.subtle-toggle .advanced-summary {
  font-size: 12px;
  color: #64748b;
}

.advanced-panel-inner {
  margin-top: 6px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 2px solid #e2e8f0;
}

.compact-field-group {
  margin-top: 6px;
}

.compact-field-group select {
  min-height: 44px;
}

.autofill-token-row {
  gap: 8px;
  margin-top: 8px;
}

.autofill-token {
  padding: 7px 11px;
  font-size: 13px;
  border-radius: 999px;
}

.workflow-step-card .section-label {
  margin-bottom: 6px;
}

.workflow-step-card .field-block {
  margin-bottom: 12px;
}

.advanced-timing-row {
  min-height: 40px;
  padding: 8px 12px;
}

.workflow-steps-list {
  gap: 14px;
}

@media (max-width: 900px) {
  .workflow-step-header {
    flex-direction: column;
  }

  .workflow-footer {
    flex-direction: column;
  }

  .workflow-footer .btn {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .workflow-page-shell {
    padding: 18px 16px 48px;
  }

  .workflow-main-card {
    border-radius: 24px;
    padding: 20px 16px 18px;
  }

  .setup-progress-bar {
    overflow-x: auto;
    padding: 12px 14px;
  }

  .workflow-title {
    line-height: 1;
  }
}

.workflow-step-card {
  border: 1px solid #d9e1ef;
  border-radius: 22px;
  padding: 18px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.workflow-step-card .workflow-field-group,
.workflow-step-card .advanced-timing-wrap {
  margin-top: 14px;
}

.workflow-step-meta-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .workflow-step-card-hero,
  .workflow-step-card-half {
    grid-column: auto;
  }

  .workflow-step-meta-grid {
    grid-template-columns: 1fr;
  }
}
.workflow-step-card {
  border: 1px solid #d9e1ef;
  border-radius: 22px;
  padding: 18px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
