/* Sequence timeline editor (S1) */

.ap-editor-timeline-mode #ap-timeline-editor {
	display: none;
}

.ap-editor-timeline-mode[data-guided-step="action"] #ap-timeline-editor {
	display: flex;
}

.ap-timeline-editor {
	display: flex;
	gap: 0;
	min-height: 420px;
	margin-top: 8px;
	border: 1px solid #e5e4f0;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

.ap-timeline-rail {
	flex: 0 0 260px;
	max-width: 280px;
	background: #faf9ff;
	border-right: 1px solid #e5e4f0;
	padding: 16px 12px 20px;
	overflow-y: auto;
	max-height: min(72vh, 640px);
}

.ap-timeline-rail__title {
	margin: 0 0 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6f699f;
}

.ap-timeline-rail__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ap-timeline-rail__item {
	margin: 0;
	padding: 0;
}

.ap-timeline-rail__connector {
	display: block;
	width: 2px;
	height: 10px;
	margin: 0 auto 0 22px;
	background: #d9d5f5;
}

.ap-timeline-node {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: #1a1830;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.ap-timeline-node:hover {
	background: #fff;
	border-color: #e5e4f0;
}

.ap-timeline-node.is-selected {
	background: #fff;
	border-color: #534AB7;
	box-shadow: 0 0 0 1px rgba(83, 74, 183, 0.2);
}

.ap-timeline-node__icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}

.ap-timeline-node--trigger .ap-timeline-node__icon {
	background: #EEEDFE;
	color: #534AB7;
}

.ap-timeline-node--wait .ap-timeline-node__icon {
	background: #fff3cd;
	color: #856404;
}

.ap-timeline-node--action .ap-timeline-node__icon {
	background: #cfe2ff;
	color: #084298;
}

.ap-timeline-node__body {
	flex: 1;
	min-width: 0;
}

.ap-timeline-node__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.ap-timeline-node__meta {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	color: #666;
	line-height: 1.35;
}

.ap-timeline-node__status {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	font-style: italic;
	line-height: 1.35;
}

.ap-timeline-node__status--missing {
	color: #b42318;
}

.ap-timeline-node__status--ready {
	color: #27500a;
}

.ap-timeline-wait-help {
	margin: 12px 0 0;
	max-width: 480px;
	font-size: 13px;
	color: #666;
	line-height: 1.5;
}

.ap-timeline-wait-help--initial {
	margin-top: 16px;
}

.ap-timeline-wait-editor .ap-seq-line--action {
	display: none;
}

.ap-wait-stepper {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.ap-wait-stepper__btn {
	width: 32px;
	height: 32px;
	border: 1px solid #e5e4f0;
	border-radius: 8px;
	background: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #534AB7;
}

.ap-wait-stepper__btn:hover {
	border-color: #534AB7;
	background: #faf9ff;
}

.ap-review-incomplete__list {
	margin: 8px 0 0;
	padding-left: 0;
	list-style: none;
}

.ap-review-incomplete__link {
	display: block;
	width: 100%;
	margin: 0;
	padding: 6px 0;
	border: 0;
	background: none;
	text-align: left;
	font: inherit;
	color: #534AB7;
	cursor: pointer;
	text-decoration: underline;
}

.ap-review-incomplete__link:hover {
	color: #3C3489;
}

.ap-timeline-rail__add {
	margin-top: 12px;
	width: 100%;
	justify-content: center;
}

.ap-timeline-canvas {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background-color: #f8f8fa;
	background-image: radial-gradient(#d4d2e4 1px, transparent 1px);
	background-size: 16px 16px;
}

.ap-timeline-pane {
	flex: 1;
	overflow-y: auto;
	padding: 20px 24px 24px;
	min-height: 280px;
}

.ap-timeline-pane[hidden] {
	display: none !important;
}

.ap-timeline-pane.is-active {
	display: block;
}

.ap-timeline-pane--actions .ap-action-card {
	max-width: 920px;
	margin: 0 auto;
}

.ap-editor-timeline-mode[data-guided-step="action"] #ap-actions-list .ap-action-card {
	display: none;
}

.ap-editor-timeline-mode[data-guided-step="action"] #ap-actions-list .ap-action-card.ap-timeline-card--visible {
	display: block;
}

.ap-editor-timeline-mode[data-guided-step="action"] #ap-add-action {
	max-width: 720px;
	margin: 12px auto 0;
	display: block;
}

.ap-section-then-wait.ap-timeline-embedded {
	background: #fff;
	border: 1px solid #e5e4f0;
	border-radius: 12px;
	padding: 20px 24px;
	max-width: 640px;
	margin: 0 auto;
	box-shadow: none;
}

.ap-section-then-wait.ap-timeline-embedded .ap-step-header {
	display: none;
}

.ap-editor-timeline-mode #ap-timing-sequence-wrap .ap-timing-followup-cta {
	display: none;
}

.ap-editor-timeline-mode #ap-timing-sequence-wrap .ap-timing-sequence-body {
	display: none !important;
}

.ap-timeline-seq-sync {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ap-timeline-pane--seq .ap-sequence-step {
	max-width: 560px;
	margin: 0 auto;
	border: none;
	box-shadow: 0 1px 4px rgba(26, 24, 48, 0.08);
}

.ap-timeline-pane--seq .ap-seq-line--action {
	display: none;
}

.ap-timeline-trigger-hint {
	max-width: 480px;
	margin: 40px auto;
	padding: 24px;
	text-align: center;
	background: #fff;
	border: 1px solid #e5e4f0;
	border-radius: 12px;
}

.ap-timeline-trigger-hint p {
	margin: 0 0 12px;
	color: #666;
	font-size: 14px;
}

@media (max-width: 960px) {
	.ap-editor-timeline-mode[data-guided-step="action"] #ap-timeline-editor {
		flex-direction: column;
	}

	.ap-timeline-rail {
		flex: none;
		max-width: none;
		max-height: none;
		border-right: none;
		border-bottom: 1px solid #e5e4f0;
	}

	.ap-timeline-rail__list {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.ap-timeline-rail__connector {
		display: none;
	}

	.ap-timeline-rail__item {
		flex: 1 1 auto;
	}
}

.ap-timeline-node:focus-visible,
.ap-timeline-rail__add:focus-visible,
.ap-remove-sequence-step:focus-visible,
#ap-add-sequence-step:focus-visible,
#ap-add-sequence-branch:focus-visible {
	outline: 2px solid #534AB7;
	outline-offset: 2px;
}
