body.amm-doc-preview-modal-open {
	overflow: hidden;
}

.amm-doc-preview-modal[hidden] {
	display: none !important;
}

.amm-doc-preview-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.amm-doc-preview-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	cursor: pointer;
}

.amm-doc-preview-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(100%, 28rem);
	max-height: calc(100vh - 3rem);
	background: #ffffff;
	border-radius: 0.75rem;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
	overflow: hidden;
}

.amm-doc-preview-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.125rem;
	border-bottom: 1px solid #f0f0f0;
}

.amm-doc-preview-modal__header-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.amm-doc-preview-modal__figure {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: min(35vh, 20rem);
	background: #f7f8fa;
	overflow: hidden;
}

.amm-doc-preview-modal__viewer-mount {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.amm-doc-preview-modal__viewer-mount canvas {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.amm-doc-preview-modal__loader {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f7f8fa;
}

.amm-doc-preview-modal__loader[hidden] {
	display: none !important;
}

.amm-doc-preview-modal__loader-spinner {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	border: 3px solid color-mix(in srgb, var(--amm-palette-primary-1, #005762) 18%, transparent);
	border-top-color: var(--amm-palette-primary-1, #005762);
	border-radius: 50%;
	animation: amm-doc-preview-modal-spin 0.8s linear infinite;
}

@keyframes amm-doc-preview-modal-spin {
	to { transform: rotate(360deg); }
}

.amm-doc-preview-modal__error {
	color: #525252;
	font-family: var(--amm-content-font, var(--amm-font-sans));
	text-align: center;
	padding: 1rem;
}

@media (prefers-reduced-motion: reduce) {
	.amm-doc-preview-modal__loader-spinner {
		animation-duration: 2s;
	}
}

.amm-doc-preview-modal__close {
	flex-shrink: 0;
	appearance: none;
	border: 0;
	width: 1.875rem;
	height: 1.875rem;
	border-radius: 50%;
	background: transparent;
	color: #525252;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background-color 150ms ease;
}

.amm-doc-preview-modal__close:hover,
.amm-doc-preview-modal__close:focus-visible {
	background: #f7f8fa;
}

.amm-doc-preview-modal__close .material-icons {
	font-size: 1.25rem;
}

.amm-doc-preview-modal__title {
	margin: 0;
	color: #0a0a0a;
	font-family: var(--amm-content-font, var(--amm-font-sans));
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
}

.amm-doc-preview-modal__title:empty {
	display: none;
}

.amm-doc-preview-modal__subtitle {
	margin: 0;
	color: #757575;
	font-family: var(--amm-content-font, var(--amm-font-sans));
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.4;
}

.amm-doc-preview-modal__subtitle:empty {
	display: none;
}

.amm-doc-preview-modal__footer {
	padding: 0.875rem 1.125rem;
}

.amm-doc-preview-modal__download {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--amm-palette-primary-1, #005762);
	border-radius: 0.5rem;
	background: var(--amm-palette-primary-1, #005762);
	color: #ffffff;
	font-family: var(--amm-content-font, var(--amm-font-sans));
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	transition: opacity 150ms ease;
}

.amm-doc-preview-modal__download:hover,
.amm-doc-preview-modal__download:focus-visible {
	opacity: 0.9;
}

.amm-doc-preview-modal__download-icon svg {
	display: block;
	width: 1rem;
	height: 1rem;
}
