.tally-viewer {
	width: 100%;
	max-width: 1100px;
	margin: 2rem auto;
}

.tally-viewer-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 240px;
	padding: clamp(8px, 2vw, 24px);
	box-sizing: border-box;
	background: #f4f1e9;
}

.tally-viewer-image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 78vh;
	object-fit: contain;
}

.tally-viewer-controls {
	display: grid;
	grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
	gap: 16px;
	align-items: center;
	margin-top: 16px;
}

.tally-viewer-controls button {
	min-height: 44px;
	padding: 10px 16px;
	font: inherit;
	cursor: pointer;
}

.tally-viewer-controls button:last-child {
	justify-self: end;
}

.tally-viewer-controls button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.tally-viewer-position {
	font-weight: 600;
	text-align: center;
}

@media (max-width: 600px) {
	.tally-viewer {
		margin: 1rem auto;
	}

	.tally-viewer-stage {
		min-height: 160px;
		padding: 4px;
	}

	.tally-viewer-image {
		width: 100%;
		max-height: none;
	}

	.tally-viewer-controls {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.tally-viewer-position {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.tally-viewer-controls button {
		width: 100%;
	}
}
