html,
body {
	height: 100%;
	margin: 0;
	overflow: hidden;
	background: var(--tg-theme-secondary-bg-color, #e9e9ee);
	color: var(--tg-theme-hint-color, #8e8e93);
	font: 15px/1.4 -apple-system, system-ui, sans-serif;
}

#slides {
	display: flex;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-user-select: none;
	user-select: none;
}

#slides.dragging {
	scroll-snap-type: none;
}

#slides::-webkit-scrollbar {
	display: none;
}

.slide {
	display: flex;
	flex: 0 0 100%;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 12px 12px 40px;
	scroll-snap-align: center;
	/* один свайп - одна страница */
	scroll-snap-stop: always;
}

.slide img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

#counter {
	position: fixed;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 13px;
}

/* стрелки только на десктопе */
.nav {
	display: none;
	position: fixed;
	top: 50%;
	width: 40px;
	height: 40px;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

#prev {
	left: 8px;
}

#next {
	right: 8px;
}

.nav:disabled {
	visibility: hidden;
}

@media (hover: hover) {
	.nav {
		display: block;
	}

	#slides {
		cursor: grab;
	}

	#slides.dragging {
		cursor: grabbing;
	}
}

#status {
	position: fixed;
	inset: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	text-align: center;
}

#status:empty {
	display: none;
}
