/* A code-native diagram: preserve the original information and flow. */
.architecture-map {
	--arch-blue: #3266e3;
	--arch-line: #d9e3f2;
	position: relative;
	margin: 36px 0 0;
	padding: 0 24px 24px;
	border: 1px solid #dce4ef;
	border-radius: 16px;
	background: linear-gradient(145deg, #f7faff, #fff 55%);
	box-shadow: 0 12px 40px rgb(23 44 78 / 4%);
}
.arch-caption {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin: 0 -24px;
	padding: 21px 24px;
	border-bottom: 1px solid #dce4ef;
	border-radius: 15px 15px 0 0;
	background: #13253f;
	color: #fff;
}
.arch-caption > div {
	display: flex;
	align-items: center;
	gap: 12px;
}
.arch-caption h3 {
	font-size: 17px;
	font-weight: 550;
	letter-spacing: 0.3px;
}
.arch-caption-mark {
	width: 7px;
	height: 18px;
	border-radius: 3px;
	background: #6797ff;
}
.arch-caption > span {
	font-size: 14px;
	color: #aebfd9;
}
.arch-body {
	position: relative;
	display: grid;
	grid-template-columns: 362px minmax(0, 1fr);
	gap: 24px;
	padding-top: 24px;
}
.arch-group-heading {
	margin-bottom: 18px;
	font-size: 14px;
	font-weight: 550;
	color: #697a91;
	letter-spacing: 0.8px;
}
.arch-source-list,
.arch-stages,
.arch-nodes,
.arch-assets {
	list-style: none;
	padding: 0;
	margin: 0;
}
.arch-sources {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.arch-source-list {
	display: grid;
	flex: 1;
	align-items: start;
	align-content: space-between;
	gap: 8px;
}
.arch-source {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 6px;
	align-content: start;
	padding: 8px 12px;
	border: 1px solid #e0e7f2;
	border-radius: 10px;
	background: #fff;
}
.arch-source-brand {
	display: flex;
	align-items: center;
	gap: 8px;
}
.arch-source-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	color: #3266e3;
	background: #edf3ff;
}
.arch-source-mark .icon {
	width: 16px;
	height: 16px;
}
.arch-source-brand > div {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	min-width: 0;
}
.arch-source-brand h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	color: #1c3455;
}
.arch-source-brand > div > span {
	font-size: 14px;
	line-height: 1.6;
	color: #8491a3;
}
.arch-source-data {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	padding-top: 0;
}
.arch-source-data p {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	margin: 0;
	font-size: 14px;
	line-height: 1.65;
	color: #586b83;
}
.arch-source-data p + p {
	margin: 0;
	padding-left: 12px;
	border-left: 1px solid #e6edf6;
}
.arch-source-data strong {
	display: block;
	margin-bottom: 2px;
	font-size: 16px;
	line-height: 1.4;
	white-space: nowrap;
	font-weight: 600;
	color: #3266e3;
}
.arch-source-arrow.icon {
	display: none;
	position: absolute;
	right: -23px;
	width: 21px;
	height: 15px;
	stroke-width: 1.3;
	color: #89a5d6;
}
.arch-data-connectors {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	fill: none;
	stroke: #9db6de;
	stroke-width: 1.2;
	stroke-dasharray: 3 3;
}
.arch-governance {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.arch-flow-scroll {
	padding-inline: 5px;
	flex: 1;
	display: flex;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: #b5c6e9 #f3f6fc;
	overscroll-behavior-x: contain;
}
.arch-flow-scroll:focus-visible {
	outline: 2px solid #3266e3;
	outline-offset: 3px;
	border-radius: 8px;
}
.arch-cycle {
	position: relative;
	width: 100%;
	display: flex;
	flex-direction: column;
	padding: 0 15px 0;
}
.arch-connectors {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}
.arch-loop-track,
.arch-stage-links,
.arch-loop-directions {
	fill: none;
	stroke: #9db6de;
	stroke-width: 1.2;
}
.arch-loop-track {
	stroke-dasharray: 3 3;
}
.arch-loop-directions {
	stroke-dasharray: 3 3;
}
.arch-stages {
	position: relative;
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1.65fr 1fr 1fr 1fr;
	gap: 10px;
}
.arch-stage {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.arch-stage h4 {
	margin: 0;
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 6px 4px;
	margin-bottom: 14px;
	border: 1px solid #92b0e3;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.7;
	white-space: nowrap;
	color: #244c8e;
	background: #f8fbff;
}
.arch-stage h4 > span {
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 1.3px;
	line-height: 1;
	color: #8ca2c2;
}

.arch-nodes {
	flex: 1;
	display: grid;
	grid-template-rows: repeat(var(--node-rows), minmax(0, 1fr));
	gap: 10px;
	padding-bottom: 14px;
}
.arch-stage-discovery .arch-nodes {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.arch-nodes > li {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 5px;
	border: 1px solid #d7e2f4;
	border-radius: 8px;
	background: #eaf1fc;
	color: #364e70;
	font-size: 14px;
	line-height: 1.8;
	text-align: center;
}
.arch-nodes > li:nth-child(even) {
	background: #dfeafa;
	border-color: #d0def2;
}
.arch-stage:last-child .arch-nodes > li {
	background: #dce8fc;
	border-color: #c4d6f4;
	color: #244c8e;
}
.arch-feedback {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto 1.2fr auto 1fr;
	align-items: center;
	gap: 8px;
	height: 37px;
}
.arch-feedback > span:not(.arch-feedback-line) {
	padding: 2px 10px;
	border: 1px solid #c9d9f3;
	border-radius: 20px;
	font-size: 14px;
	line-height: 1.7;
	color: #3266e3;
	background: #f3f7ff;
}
.arch-feedback-line {
	height: 1px;
}
.arch-asset-connector {
	height: 16px;
	flex-shrink: 0;
}
.arch-asset-connector .icon {
	display: none;
}
.arch-input {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas: "label types" "assets assets";
	align-items: center;
	gap: 12px 16px;
	padding: 14px 16px;
	border: 1px solid #d7e3f4;
	border-radius: 10px;
	background: #f0f5fd;
	color: #28476f;
}
.arch-input-label {
	grid-area: label;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
}
.arch-input-label .icon {
	width: 19px;
	height: 19px;
	color: #5d85cb;
}
.arch-input-label strong {
	font-weight: 500;
}
.arch-assets {
	grid-area: assets;
	display: flex;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 8px;
}
.arch-assets li {
	padding: 3px 9px;
	border: 1px solid #d5e1f2;
	border-radius: 5px;
	font-size: 14px;
	line-height: 1.6;
	color: #405a7d;
	background: #fff;
}
.arch-asset-types {
	grid-area: types;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	min-height: 0;
	white-space: nowrap;
	font-size: 14px;
	line-height: 1.5;
	color: #7183a0;
}
.arch-asset-types > span::before {
	content: "";
	display: inline-block;
	width: 4px;
	height: 4px;
	margin: 0 7px 2px 0;
	border-radius: 50%;
	background: #6f98dd;
}
/* Preserve the desktop composition; scale the entire diagram as one canvas. */
.architecture-frame { position: relative; width: 100%; margin-top: 36px; }
.architecture-frame .architecture-map {
 width: 1200px;
 margin: 0;
 transition: opacity .55s;
 transform-origin: top left;
 transform: scale(var(--architecture-scale, 1));
}
