/*
 * Shared overlay layer — scrim, modal, toasts.
 *
 * Declarations copied from the prototype. Selector map:
 *   .scrim  → .mgk-scrim        .toasts → .mgk-toasts
 *   .mo     → .mgk-modal        .toast  → .mgk-toast
 *   .mo-c   → .mgk-modal__box
 *   .mo-h   → .mgk-modal__head
 *   .mo-b   → .mgk-modal__body
 *   .mo-f   → .mgk-modal__foot
 *
 * Loaded on every page from mgk-v2-overlay.php — a screen that opens a modal
 * should not have to remember to enqueue the thing that draws it.
 */

/* ── scrim ─────────────────────────────────────────────────────────────── */

.mgk-scrim {
	position: fixed;
	inset: 0;
	background: rgba(27, 42, 50, .45);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--mgk-t2);
	z-index: 80;
}

.mgk-scrim--on { opacity: 1; pointer-events: auto; }

/* ── modal ─────────────────────────────────────────────────────────────── */

.mgk-modal {
	position: fixed;
	inset: 0;
	z-index: 92;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.mgk-modal--on { display: flex; }

.mgk-modal__box {
	background: #fff;
	border-radius: var(--mgk-radius);
	width: min(520px, 100%);
	max-height: 88vh;
	overflow-y: auto;
	box-shadow: var(--mgk-elev-2);
}

.mgk-modal__box--wide { width: min(760px, 100%); }

.mgk-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--mgk-line);
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 2;
}

.mgk-modal__head h3 { font-size: 16.5px; }

.mgk-modal__close {
	display: grid;
	place-items: center;
	width: 30px; height: 30px;
	border-radius: var(--mgk-radius-b);
	color: var(--mgk-ink-3);
	transition: background var(--mgk-t1);
}

.mgk-modal__close:hover { background: var(--mgk-wash); color: var(--mgk-ink); }

.mgk-modal__body { padding: 20px; }

.mgk-modal__foot {
	padding: 16px 20px 20px;
	border-top: 1px solid var(--mgk-line);
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

/* ── toasts ────────────────────────────────────────────────────────────── */

.mgk-toasts {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 22px;
	z-index: 100;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	pointer-events: none;
}

.mgk-toast {
	background: var(--mgk-ink);
	color: #fff;
	border-radius: var(--mgk-radius-b);
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 600;
	display: flex;
	gap: 9px;
	align-items: center;
	box-shadow: var(--mgk-elev-2);
	animation: mgk-toast-in var(--mgk-t2) var(--mgk-ease);
	max-width: min(520px, 92vw);
}

.mgk-toast--out { animation: mgk-toast-out var(--mgk-t1) forwards; }

@keyframes mgk-toast-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

@keyframes mgk-toast-out {
	to { opacity: 0; }
}
