:root {
	--overlay: rgba(15, 23, 42, 0.55);
	--surface: #ffffff;
	--text: #111827;
	--muted: #6b7280;
	--label: #374151;
	--accent: #4c91fe;
	--radius: 16px;
	--shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	--gap: 16px;
	--maxw: 640px;
}

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

body.modal-open { overflow: hidden; }

/** Full-screen dark overlay */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: var(--overlay);
	backdrop-filter: blur(2px);
	z-index: 9998;
	opacity: 0;
	transition: opacity 160ms ease;
}

/** Modal container (centres the panel, not the text) */
.modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	z-index: 9999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease;
}

/** Visible state toggled by JS */
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-overlay.is-open { opacity: 1; }

.modal[hidden],
.modal-overlay[hidden] {
	display: block;
	opacity: 0;
	pointer-events: none;
}

/** The white card panel */
.modal-panel {
	background: var(--surface);
	color: var(--text);
	max-width: var(--maxw);
	width: 100%;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	position: relative;
	padding: 20px 24px 24px;
	text-align: left; /* ensure no unintended centring */
}

/** Close button */
.modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	border: none;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	padding: 6px 10px;
	cursor: pointer;
	color: var(--muted);
}
.modal-close:hover,
.modal-close:focus { color: var(--text); outline: none; }

/** Typography */
.modal-title {
	margin: 0 32px 6px 0;
	font-size: 20px;
	font-weight: 700;
}

.name-block { margin: 8px 0 16px; }
.name {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
	letter-spacing: 0.2px;
}

/** Labels + values */
.details {
	margin: 0;
	display: grid;
	gap: 10px;
}
.details .row {
	display: grid;
	grid-template-columns: 140px 1fr;
	align-items: start;
	gap: 12px;
}
.details .label {
	color: var(--label);
	font-weight: 600;
}
.details .value {
	color: var(--muted);
	font-size: 14px; /* smaller text for values */
	margin: 0;
}

/** Links */
.details .value a {
	color: var(--accent);
	text-decoration: none;
	word-break: break-all;
}
.details .value a:hover,
.details .value a:focus { text-decoration: underline; }

/** Accessibility helpers */
.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/** Motion-reduction */
@media (prefers-reduced-motion: reduce) {
	.modal, .modal-overlay { transition: none; }
}


/** COMMENT: Fix details layout + alignment */
.details {
	display: grid;
	grid-template-columns: 140px 1fr;
	column-gap: 12px;
	row-gap: 10px;
	text-align: left;
}

/** COMMENT: Let dt/dd become grid items even though they're wrapped */
.details .row { display: contents; }

.details dt, .details dd { margin: 0; }
.details dt { color: var(--label); font-weight: 600; }
.details dd { color: var(--muted); font-size: 14px; }
