.mermaid-wrapper {
	position: relative;
	cursor: zoom-in;
	margin: 1.5rem 0;
	transition: transform 0.2s;
}

.mermaid-wrapper:hover {
	transform: scale(1.01);
}

.mermaid-wrapper:hover::after {
	content: 'Click to enlarge';
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.75);
	color: white;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 10;
}

.mermaid-wrapper:hover::after {
	opacity: 1;
}

.mermaid-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

.mermaid-lightbox.active {
	display: flex;
}

.mermaid-lightbox-inner {
	position: relative;
	background: var(--sl-color-bg, white);
	border-radius: 12px;
	padding: 2rem;
	max-width: 95vw;
	max-height: 95vh;
	overflow: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.mermaid-lightbox-inner svg {
	width: auto;
	height: auto;
	min-width: 800px;
	max-width: 90vw;
}

.mermaid-lightbox-close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: rgba(0, 0, 0, 0.1);
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: var(--sl-color-text, #333);
	line-height: 1;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s, color 0.2s;
	z-index: 10;
}

.mermaid-lightbox-close:hover {
	background: rgba(0, 0, 0, 0.2);
	color: var(--sl-color-text-accent, #000);
}

@media (max-width: 768px) {
	.mermaid-lightbox-inner svg {
		min-width: unset;
		width: 100%;
	}
}
