.canvas-run-status-badge {
  gap: var(--ms-space-1);
}

.canvas-run-status-badge[data-loading="true"] {
  border-color: transparent;
}

.canvas-run-status-badge__icon {
  display: inline-flex;
}

.canvas-run-status-badge[data-loading="true"] .canvas-run-status-badge__icon {
  animation: ms-spin 900ms linear infinite;
}

.canvas-workflow-history {
  background: transparent;
}

.canvas-workflow-history[data-embedded="true"] {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.canvas-workflow-history:not([data-embedded="true"]) {
  height: 208px;
  flex-shrink: 0;
}

.canvas-workflow-history__header {
  flex-shrink: 0;
}

.canvas-workflow-history__header[data-compact="true"] {
  display: flex;
  align-items: center;
  gap: var(--ms-space-2);
  padding: var(--ms-space-2);
}

.canvas-workflow-history__header:not([data-compact="true"]) {
  display: flex;
  height: 44px;
  align-items: center;
  gap: var(--ms-space-3);
  padding-inline: var(--ms-space-4);
}

.canvas-workflow-history__title-row {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: var(--ms-space-2);
}

.canvas-workflow-history__header-icon,
.canvas-workflow-history__controls-icon,
.canvas-workflow-history__state-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--ms-color-muted-foreground);
}

.canvas-workflow-history__header-icon > svg,
.canvas-workflow-history__controls-icon > svg {
  width: 14px;
  height: 14px;
}

.canvas-workflow-history__title-body {
  min-width: 0;
  flex: 1;
}

.canvas-workflow-history__title {
  display: block;
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-label);
  font-weight: 650;
  line-height: var(--ms-leading-label);
}

.canvas-workflow-history__description {
  display: block;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.canvas-workflow-history__actions,
.canvas-workflow-history__controls {
  display: flex;
  align-items: center;
  gap: var(--ms-space-2);
}

.canvas-workflow-history__header[data-compact="true"] .canvas-workflow-history__actions {
  margin-left: auto;
}

.canvas-workflow-history__select {
  height: 28px;
  padding-inline: var(--ms-space-2);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-history__header[data-compact="true"] .canvas-workflow-history__select {
  width: 92px;
  min-width: 0;
}

.canvas-workflow-history__page-button {
  flex-shrink: 0;
}

.canvas-workflow-history__page-indicator {
  width: 48px;
  flex-shrink: 0;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
  text-align: center;
}

.canvas-workflow-history__header[data-compact="true"] .canvas-workflow-history__page-indicator {
  width: 40px;
}

.canvas-workflow-history__body {
  overflow: auto;
}

.canvas-workflow-history[data-embedded="true"] .canvas-workflow-history__body {
  min-height: 0;
  flex: 1;
}

.canvas-workflow-history:not([data-embedded="true"]) .canvas-workflow-history__body {
  height: calc(100% - 44px);
}

.canvas-workflow-history__state {
  display: flex;
  height: 96px;
  align-items: center;
  justify-content: center;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-history__state-icon {
  margin-right: var(--ms-space-2);
}

.canvas-workflow-history__state-icon > svg {
  width: 14px;
  height: 14px;
  animation: ms-spin 900ms linear infinite;
}

.canvas-workflow-history__compact-list {
  display: grid;
  gap: 6px;
  padding: var(--ms-space-2);
}

.canvas-workflow-history-compact-item {
  width: 100%;
  padding: var(--ms-space-2);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-history-compact-item__header,
.canvas-workflow-history-compact-item__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--ms-space-2);
}

.canvas-workflow-history-compact-item__run {
  color: var(--ms-color-foreground);
  font-weight: 650;
}

.canvas-workflow-history-compact-item__time {
  margin-left: auto;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.canvas-workflow-history-compact-item__meta {
  margin-top: 4px;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.canvas-workflow-history-duration {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: var(--ms-space-1);
}

.canvas-workflow-history-duration__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: inherit;
}

.canvas-workflow-history-duration__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-history-compact-item__duration,
.canvas-workflow-history-compact-item__snapshot {
  min-width: 0;
}

.canvas-workflow-history-compact-item__error,
.canvas-workflow-history-table__error {
  overflow: hidden;
  color: var(--ms-color-danger);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-history-compact-item__error {
  display: block;
  margin-top: var(--ms-space-1);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.canvas-workflow-history-table {
  min-width: 0;
}

.canvas-workflow-history-table__header,
.canvas-workflow-history-table__row {
  display: grid;
  grid-template-columns: 96px 104px 112px minmax(0, 1fr) 120px;
  align-items: center;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  padding: var(--ms-space-2) var(--ms-space-4);
}

.canvas-workflow-history-table__header {
  border-top: 0;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  font-weight: 500;
  line-height: var(--ms-leading-caption);
}

.canvas-workflow-history-table__row {
  width: 100%;
  height: auto;
  border-top: 0;
  text-align: left;
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
  transition: border-color var(--ms-duration-fast) var(--ms-easing-standard), background-color var(--ms-duration-fast) var(--ms-easing-standard);
}

.canvas-workflow-history-table__row:hover {
  border-color: color-mix(in srgb, var(--ms-color-foreground) 25%, transparent);
}

.canvas-workflow-history-table__row[data-selected="true"] {
  background: color-mix(in srgb, var(--ms-color-primary) 5%, transparent);
}

.canvas-workflow-history-table__row .ms-button__content {
  display: contents;
}

.canvas-workflow-history-table__run {
  color: var(--ms-color-foreground);
  font-weight: 500;
}

.canvas-workflow-history-table__duration,
.canvas-workflow-history-table__snapshot,
.canvas-workflow-history-table__time {
  color: var(--ms-color-muted-foreground);
}

.canvas-workflow-history-table__duration,
.canvas-workflow-history-table__snapshot {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--ms-space-1);
}

.canvas-workflow-history-table__snapshot {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-history-table__error {
  margin-left: var(--ms-space-2);
}

.canvas-workflow-history-table__right,
.canvas-workflow-history-table__time {
  text-align: right;
}

.canvas-workflow-side-rail {
  display: flex;
  width: 48px;
  height: 100%;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: var(--ms-space-2);
  order: 2;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 76%, transparent);
  border-radius: var(--ms-radius-md);
  background: var(--ms-color-surface-raised);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ms-color-foreground) 5%, transparent);
  padding-block: var(--ms-space-3);
}

.canvas-workflow-side-panel {
  order: 1;
  position: relative;
  display: flex;
  height: 100%;
  flex-shrink: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 76%, transparent);
  border-radius: var(--ms-radius-panel);
  background: var(--ms-color-surface-raised);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ms-color-foreground) 5%, transparent);
}

.canvas-workflow-side-panel__resize-handle.panel-resize-handle--left {
  width: 8px;
  transform: translateX(-4px);
}

.canvas-workflow-side-panel__header {
  display: flex;
  height: 48px;
  flex-shrink: 0;
  align-items: center;
  gap: var(--ms-space-2);
  padding: 0 var(--ms-space-3) 0 var(--ms-space-4);
}

.canvas-workflow-side-panel__tabs {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ms-color-border);
  border-radius: var(--ms-radius-sm);
}

.canvas-workflow-side-panel__tab {
  min-width: 0;
  flex: 1;
  border-radius: 0;
  gap: 6px;
  padding: 6px var(--ms-space-2);
}

.canvas-workflow-side-panel__tab + .canvas-workflow-side-panel__tab {
  border-left: 1px solid var(--ms-color-border);
}

.canvas-workflow-side-panel__tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-side-panel__icon-button {
  flex-shrink: 0;
}

.canvas-workflow-side-panel__icon-button[data-active="true"] {
  border-color: var(--ms-color-primary);
  background: color-mix(in srgb, var(--ms-color-primary) 10%, transparent);
  color: var(--ms-color-primary);
}

.canvas-workflow-side-panel__body {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.canvas-workflow-reference-picker {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: var(--ms-space-2);
  padding: var(--ms-space-2);
}

.canvas-workflow-reference-picker__search {
  position: relative;
  flex-shrink: 0;
}

.canvas-workflow-reference-picker__search > svg {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: var(--ms-space-2);
  z-index: 1;
  transform: translateY(-50%);
  color: var(--ms-color-muted-foreground);
}

.canvas-workflow-reference-picker__search input {
  height: 28px;
  padding-left: 28px;
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-reference-picker__body {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.canvas-workflow-reference-picker__state {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  gap: var(--ms-space-2);
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
  text-align: center;
}

.canvas-workflow-reference-picker__state > svg {
  animation: ms-spin 900ms linear infinite;
}

.canvas-workflow-reference-picker__list {
  display: grid;
  gap: var(--ms-space-2);
}

.canvas-workflow-reference-picker__card {
  display: grid;
  gap: var(--ms-space-2);
  border: 1px solid var(--ms-color-border);
  border-radius: var(--ms-radius-md);
  background: var(--ms-color-card);
  padding: var(--ms-space-2);
  text-align: left;
  box-shadow: var(--ms-shadow-sm);
}

.canvas-workflow-reference-picker__card-main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: var(--ms-space-2);
}

.canvas-workflow-reference-picker__card-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--ms-radius-md);
  background: var(--ms-color-muted);
  color: var(--ms-color-muted-foreground);
}

.canvas-workflow-reference-picker__card-text {
  min-width: 0;
  flex: 1 1 auto;
}

.canvas-workflow-reference-picker__card-title {
  overflow: hidden;
  color: var(--ms-color-foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--ms-text-label);
  font-weight: 650;
  line-height: var(--ms-leading-label);
}

.canvas-workflow-reference-picker__card-meta {
  margin-top: 2px;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.canvas-workflow-reference-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ms-space-1);
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.canvas-workflow-reference-picker__chips > span {
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--ms-radius-sm);
  background: var(--ms-color-muted);
  padding: 2px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-run-results-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, black 50%, transparent);
  padding: var(--ms-space-4);
}

.canvas-workflow-run-results-shell {
  display: flex;
  width: 100%;
  max-width: 896px;
  max-height: 86vh;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--ms-shadow-lg);
}

.canvas-workflow-run-results-header {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ms-space-4);
  border-bottom: 1px solid var(--ms-color-border);
  padding: var(--ms-space-4) 20px;
}

.canvas-workflow-run-results-header__body {
  min-width: 0;
}

.canvas-workflow-run-results-header__title {
  margin: 0;
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-body);
  font-weight: 650;
  line-height: var(--ms-leading-body);
}

.canvas-workflow-run-results-header__description {
  margin: var(--ms-space-1) 0 0;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-run-results-header__action,
.canvas-workflow-run-results-close {
  flex-shrink: 0;
}

.canvas-workflow-run-results-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.canvas-workflow-run-results-empty {
  min-height: 220px;
}

.canvas-workflow-run-results-grid {
  display: grid;
  gap: var(--ms-space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.canvas-workflow-run-results-card {
  overflow: hidden;
  padding: 0;
}

.canvas-workflow-run-results-card[data-removed="true"] {
  opacity: 0.55;
}

.canvas-workflow-run-results-media {
  display: flex;
  height: 176px;
  align-items: center;
  justify-content: center;
}

.canvas-workflow-run-results-removed {
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-run-results-code {
  width: 100%;
  max-height: 100%;
  padding: var(--ms-space-3);
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-workflow-run-results-card__body {
  display: grid;
  gap: var(--ms-space-3);
  padding: var(--ms-space-3);
}

.canvas-workflow-run-results-card__content {
  min-width: 0;
}

.canvas-workflow-run-results-card__title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--ms-space-2);
}

.canvas-workflow-run-results-card__title {
  min-width: 0;
  overflow: hidden;
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-body);
  font-weight: 500;
  line-height: var(--ms-leading-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-run-results-card__type {
  flex-shrink: 0;
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.canvas-workflow-run-results-card__meta {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-workflow-run-results-card__actions {
  display: flex;
  gap: var(--ms-space-2);
}

.canvas-workflow-run-results-card__action {
  flex: 1;
}

@media (max-width: 720px) {
  .canvas-workflow-run-results-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.canvas-runtime-input-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, black 50%, transparent);
}

.canvas-runtime-input-dialog {
  display: grid;
  width: min(100% - 32px, 420px);
  gap: var(--ms-space-4);
  padding: 24px;
  box-shadow: var(--ms-shadow-lg);
}

.canvas-runtime-input-dialog[data-size="node"] {
  width: min(100% - 32px, 460px);
  max-height: 80vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.canvas-runtime-input-dialog__header {
  min-width: 0;
}

.canvas-runtime-input-dialog__title {
  margin: 0;
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-body);
  font-weight: 650;
  line-height: var(--ms-leading-body);
}

.canvas-runtime-input-dialog__description {
  margin: 2px 0 0;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-runtime-input-dialog__body {
  display: grid;
  gap: var(--ms-space-4);
  min-height: 0;
}

.canvas-runtime-input-dialog[data-size="node"] .canvas-runtime-input-dialog__body {
  overflow-y: auto;
  padding-right: var(--ms-space-1);
}

.canvas-runtime-input-dialog__field {
  min-width: 0;
}

.canvas-runtime-input-dialog__label {
  display: flex;
  align-items: center;
  gap: var(--ms-space-1);
  margin-bottom: var(--ms-space-1);
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-label);
  font-weight: 500;
  line-height: var(--ms-leading-label);
}

.canvas-runtime-input-dialog__label .ms-label__required {
  display: none;
}

.canvas-runtime-input-dialog__label-text {
  min-width: 0;
}

.canvas-runtime-input-dialog__port-type {
  color: color-mix(in srgb, var(--ms-color-muted-foreground) 70%, transparent);
  font-weight: 400;
}

.canvas-runtime-input-dialog__required {
  color: var(--ms-color-danger);
}

.canvas-runtime-input-dialog__checkbox {
  height: 36px;
  padding-inline: var(--ms-space-3);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-runtime-input-dialog__textarea[data-code="true"] {
  font-family: var(--ms-font-mono);
  font-size: var(--ms-text-label);
  line-height: var(--ms-leading-label);
}

.canvas-runtime-input-dialog__actions {
  display: flex;
  gap: var(--ms-space-2);
  padding-top: var(--ms-space-1);
}

.canvas-runtime-input-dialog[data-size="node"] .canvas-runtime-input-dialog__actions {
  padding-top: var(--ms-space-1);
}

.canvas-runtime-input-dialog__action[data-stretch="true"] {
  flex: 1;
}
