.aimy-open-modal {
	margin-left: 12px;
	border-radius: 999px;
	padding: 0.95em 1.45em;
	background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
	border: 0;
	box-shadow: 0 18px 30px rgba(29, 78, 216, 0.18);
}

.aimy-modal {
	position: fixed;
	inset: 0;
	display: none;
	z-index: 99999;
}

.aimy-modal.is-open {
	display: block;
}

.aimy-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.62);
	backdrop-filter: blur(8px);
}

.aimy-modal__dialog {
	position: relative;
	width: min(1200px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	margin: 12px auto;
	overflow: auto;
	background:
		radial-gradient(circle at top left, rgba(191, 219, 254, 0.9), transparent 30%),
		linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 28px;
	padding: 28px;
	box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}

.aimy-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: #e2e8f0;
	color: #0f172a;
	font-size: 22px;
	cursor: pointer;
}

.aimy-modal__header h2,
.aimy-tip-card h3,
.aimy-result-panel h3 {
	margin: 0 0 10px;
	color: #0f172a;
}

.aimy-modal__header p:last-child,
.aimy-status,
.aimy-provider-empty,
.aimy-tip-card ol {
	color: #475569;
}

.aimy-badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(37, 99, 235, 0.1);
	color: #1d4ed8;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.aimy-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 22px 0;
}

.aimy-upload,
.aimy-view-switcher,
.aimy-provider-picker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.aimy-upload {
	padding: 12px 14px;
	border: 1px dashed #93c5fd;
	border-radius: 18px;
	background: rgba(239, 246, 255, 0.9);
	font-weight: 600;
	color: #0f172a;
	cursor: pointer;
}

.aimy-upload input {
	display: none;
}

.aimy-chip {
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	background: #ffffff;
	color: #0f172a;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.aimy-chip.is-active {
	background: #0f172a;
	border-color: #0f172a;
	color: #ffffff;
	box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.aimy-stage {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
	gap: 18px;
}

.aimy-canvas-shell {
	display: grid;
	place-items: center;
	min-height: 420px;
	padding: 16px;
	border-radius: 24px;
	border: 1px solid #dbe4ef;
	background:
		linear-gradient(45deg, rgba(226, 232, 240, 0.5) 25%, transparent 25%, transparent 75%, rgba(226, 232, 240, 0.5) 75%),
		linear-gradient(45deg, rgba(226, 232, 240, 0.5) 25%, #f8fafc 25%, #f8fafc 75%, rgba(226, 232, 240, 0.5) 75%);
	background-size: 28px 28px;
	background-position: 0 0, 14px 14px;
}

#aimy-canvas {
	max-width: 100%;
	border-radius: 18px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.aimy-side-panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.aimy-tip-card,
.aimy-result-panel {
	border: 1px solid #dbe4ef;
	border-radius: 22px;
	padding: 18px;
	background: rgba(255, 255, 255, 0.88);
	box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.aimy-tip-card ol {
	margin: 0;
	padding-left: 18px;
	line-height: 1.7;
}

.aimy-result-panel {
	display: none;
}

.aimy-result-panel.is-visible {
	display: block;
}

.aimy-result-panel img {
	width: 100%;
	border-radius: 16px;
	margin: 10px 0 14px;
	border: 1px solid #dbe4ef;
}

.aimy-modal__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 18px;
}

.aimy-status {
	margin: 0;
	font-size: 14px;
}

.aimy-loader {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 12px;
	background: rgba(248, 250, 252, 0.88);
	border-radius: 28px;
	text-align: center;
}

.aimy-loader[hidden] {
	display: none !important;
}

.aimy-loader__spinner {
	width: 54px;
	height: 54px;
	border-radius: 999px;
	border: 4px solid rgba(148, 163, 184, 0.25);
	border-top-color: #1d4ed8;
	animation: aimy-spin 0.9s linear infinite;
}

body.aimy-modal-open {
	overflow: hidden;
}

@keyframes aimy-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 980px) {
	.aimy-stage {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.aimy-modal__dialog {
		padding: 18px;
		border-radius: 22px;
	}

	.aimy-modal__footer {
		flex-direction: column;
		align-items: stretch;
	}

	.aimy-open-modal {
		margin-left: 0;
		margin-top: 10px;
		width: 100%;
	}
}
