.wtsc-attachment-preview[hidden] {
	display: none;
}

html.wtsc-attachment-preview-open,
body.wtsc-attachment-preview-open {
	overflow: hidden;
}

.wtsc-attachment-preview {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: grid;
	place-items: center;
	padding: 24px;
}

.wtsc-attachment-preview__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 18, 28, .78);
	backdrop-filter: blur(4px);
}

.wtsc-attachment-preview__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(1100px, calc(100vw - 48px));
	max-height: calc(100vh - 48px);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 18px;
	background: #111923;
	box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

.wtsc-attachment-preview__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 52px;
	padding: 10px 12px 10px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, .10);
	color: #fff;
}

.wtsc-attachment-preview__head strong {
	font-size: 14px;
	font-weight: 700;
}

.wtsc-attachment-preview__close {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, .10);
	color: #fff;
	font: 400 25px/1 Arial, sans-serif;
	cursor: pointer;
}

.wtsc-attachment-preview__close:hover,
.wtsc-attachment-preview__close:focus-visible {
	background: rgba(255, 255, 255, .18);
	outline: 2px solid rgba(255, 255, 255, .55);
	outline-offset: 2px;
}

.wtsc-attachment-preview__stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 220px;
	max-height: calc(100vh - 102px);
	overflow: auto;
	padding: 16px;
	background: #0b1118;
}

.wtsc-attachment-preview__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 136px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .30);
}

.wtsc-attachment-preview__loader,
.wtsc-attachment-preview__error {
	color: rgba(255, 255, 255, .82);
	font-size: 14px;
	text-align: center;
}

.wtsc-attachment-preview__error p {
	margin: 0 0 12px;
}

.wtsc-attachment-preview__fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 10px;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.wtsc-attachment-preview__fallback:hover,
.wtsc-attachment-preview__fallback:focus-visible {
	border-color: rgba(255, 255, 255, .50);
	background: rgba(255, 255, 255, .08);
	color: #fff;
}

@media (max-width: 640px) {
	.wtsc-attachment-preview {
		padding: 10px;
	}

	.wtsc-attachment-preview__dialog {
		width: calc(100vw - 20px);
		max-height: calc(100vh - 20px);
		border-radius: 14px;
	}

	.wtsc-attachment-preview__stage {
		max-height: calc(100vh - 74px);
		padding: 10px;
	}

	.wtsc-attachment-preview__image {
		max-height: calc(100vh - 96px);
	}
}
