/* ChelenyAlmATA — modal panels for .chalmata triggers */

.cheleny-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1.25rem 1.25rem;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.85);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	cursor: pointer;
	overflow-y: auto;
}

.cheleny-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* Wrapper: dialog + close button outside */
.cheleny-shell {
	position: relative;
	max-width: min(920px, 96vw);
	width: 100%;
	margin: auto;
	cursor: default;
}

.cheleny-dialog {
	max-height: 85vh;
	overflow: auto;
	background: #fff;
	color: #222;
	border-radius: 8px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
	padding: 1.5rem 1.5rem 1.25rem;
	cursor: default;
	box-sizing: border-box;
}

/* Close button OUTSIDE the white box — top right, next to the panel */
.cheleny-close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #222;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	transition: background 0.15s ease, transform 0.15s ease;
}

.cheleny-close:hover,
.cheleny-close:focus {
	background: #f0f0f0;
	transform: scale(1.05);
	outline: none;
}

.cheleny-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.cheleny-panel[hidden],
.cheleny-panel.is-cheleny-source {
	display: none !important;
}

.chalmata {
	cursor: pointer;
}

body.cheleny-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.cheleny-overlay {
		padding: 3rem 0.75rem 0.75rem;
	}

	.cheleny-dialog {
		padding: 1.25rem 1rem 1rem;
		max-height: 80vh;
	}

	/* Keep outside the box; slightly inset if screen is narrow */
	.cheleny-close {
		top: -18px;
		right: 0;
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
}
