.aieb-viewer {
	box-sizing: border-box;
	width: 100%;
	max-width: 1040px;
	margin: 24px auto;
	overflow: hidden;
	color: #1f2933;
	background: #f7f8fa;
	border: 1px solid #d7dce2;
	border-radius: 8px;
}

.aieb-viewer *,
.aieb-viewer *::before,
.aieb-viewer *::after {
	box-sizing: border-box;
}

.aieb-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 10px 12px;
	background: #ffffff;
	border-bottom: 1px solid #d7dce2;
}

.aieb-control-group {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 6px;
	align-items: center;
}

.aieb-control,
.aieb-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	color: #17202a;
	font: inherit;
	line-height: 1;
	text-decoration: none;
	background: #ffffff;
	border: 1px solid #b9c0c9;
	border-radius: 6px;
}

.aieb-control {
	width: 36px;
	padding: 0;
	font-size: 22px;
}

.aieb-download {
	min-width: 108px;
	margin-left: auto;
	padding: 0 14px;
	font-size: 14px;
	font-weight: 600;
}

.aieb-control:hover,
.aieb-control:focus,
.aieb-download:hover,
.aieb-download:focus {
	color: #0f1720;
	background: #edf6ff;
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.aieb-control:disabled {
	color: #9aa3ad;
	cursor: not-allowed;
	background: #f3f4f6;
	border-color: #d7dce2;
	box-shadow: none;
}

.aieb-status-group {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 8px;
	align-items: center;
	justify-content: center;
	min-width: 148px;
	min-height: 36px;
	padding: 0 10px;
	color: #364152;
	font-size: 14px;
	background: #f3f5f7;
	border: 1px solid #d7dce2;
	border-radius: 6px;
}

.aieb-page-status,
.aieb-zoom-status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 54px;
	white-space: nowrap;
}

.aieb-stage {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	min-height: 360px;
	padding: 18px;
	overflow: auto;
	background: #edf0f4;
}

.aieb-canvas {
	display: block;
	max-width: 100%;
	height: auto;
	background: #ffffff;
	box-shadow: 0 10px 30px rgba(31, 41, 51, 0.14);
}

.aieb-loading,
.aieb-error {
	position: absolute;
	top: 16px;
	left: 50%;
	max-width: min(90%, 420px);
	padding: 8px 12px;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	background: #ffffff;
	border: 1px solid #d7dce2;
	border-radius: 6px;
	transform: translateX(-50%);
}

.aieb-error {
	color: #7a271a;
	background: #fff4f2;
	border-color: #f2b8ad;
}

.aieb-notice {
	padding: 10px 12px;
	color: #4f3b02;
	background: #fff8d6;
	border: 1px solid #e7d27c;
	border-radius: 6px;
}

@media (max-width: 640px) {
	.aieb-viewer {
		margin: 18px auto;
		border-right: 0;
		border-left: 0;
		border-radius: 0;
	}

	.aieb-toolbar {
		gap: 8px;
		padding: 10px;
	}

	.aieb-control-group {
		flex: 1 1 calc(50% - 8px);
		justify-content: center;
	}

	.aieb-control {
		flex: 1 1 36px;
		max-width: 52px;
	}

	.aieb-status-group {
		order: 3;
		flex: 1 1 100%;
		min-width: 0;
	}

	.aieb-download {
		order: 4;
		flex: 1 1 100%;
		margin-left: 0;
	}

	.aieb-stage {
		min-height: 260px;
		padding: 10px;
	}

	.aieb-loading,
	.aieb-error {
		top: 10px;
	}
}
