.memory-summary {
  display: grid;
  gap: 10px;
}

.memory-summary p {
  margin: 0;
}

.memory-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.memory-list div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
}

.memory-list dt {
  color: var(--brand-dark);
  font-weight: 850;
}

.memory-list dd {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
}

.memory-workflow {
  color: var(--ink);
  font-weight: 760;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #a8d0bf;
  border-radius: 8px;
  font-weight: 850;
}

.icon-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.workflow-diagram-dialog {
  width: min(92vw, 980px);
  max-width: 96vw;
  max-height: 88vh;
  padding: 0;
  background: transparent;
  border: 0;
}

.workflow-diagram-dialog::backdrop {
  background: rgba(16, 35, 30, 0.42);
}

.workflow-diagram-panel {
  min-width: min(92vw, 520px);
  min-height: 360px;
  max-width: 96vw;
  max-height: 88vh;
  padding: 22px;
  overflow: auto;
  resize: both;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.workflow-diagram-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin: -22px -22px 16px;
  padding: 18px 22px 14px;
  background: #fff;
  border-radius: 8px 8px 0 0;
}

.workflow-diagram-header .kicker {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  padding-bottom: 13px;
  margin-bottom: 0;
}

.workflow-diagram-header .kicker::after {
  left: -22px;
  right: -22px;
}

.workflow-diagram-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.workflow-diagram-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.workflow-diagram-stage {
  display: grid;
  align-content: center;
  place-items: center;
  min-height: 220px;
  overflow: auto;
  padding: 14px;
  background: #fbfdfb;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.workflow-diagram-stage svg {
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

.workflow-diagram-source {
  margin-top: 12px;
}

.workflow-diagram-source pre,
.mermaid-fallback {
  white-space: pre-wrap;
}

.diagram-status {
  margin: 0 0 10px;
  color: var(--muted);
}
