.rmpr-history {
	--rmpr-history-purple: #5747b2;
	--rmpr-history-purple-dark: #40347f;
	--rmpr-history-yellow: #fff200;
	--rmpr-history-panel: rgba(36, 32, 52, 0.9);
	--rmpr-history-preview: rgba(47, 50, 61, 0.58);
	--rmpr-history-text: #ffffff;
	--rmpr-history-sidebar-width: clamp(300px, 36vw, 520px);
	--rmpr-history-sticky-offset: 0px;
	--rmpr-history-marker-size: 40px;
	--rmpr-history-marker-half: 20px;
	--rmpr-history-nav-title-size: 1.05rem;
	--rmpr-history-nav-label-size: 0.78rem;

	position: relative;
	width: 100%;
	color: var(--rmpr-history-text);
	background: #838d88;
	isolation: isolate;
}

.rmpr-history--medium {
	--rmpr-history-marker-size: 34px;
	--rmpr-history-marker-half: 17px;
	--rmpr-history-nav-title-size: 0.92rem;
	--rmpr-history-nav-label-size: 0.7rem;
}

.rmpr-history--many {
	--rmpr-history-marker-size: 28px;
	--rmpr-history-marker-half: 14px;
	--rmpr-history-nav-title-size: 0.8rem;
	--rmpr-history-nav-label-size: 0.64rem;
}

.rmpr-history *,
.rmpr-history *::before,
.rmpr-history *::after {
	box-sizing: border-box;
}

.rmpr-history [hidden] {
	display: none !important;
}

/*
 * The stacked layout is the default.
 * JavaScript switches desktop visitors to the scroll presentation.
 */
.rmpr-history__track {
	display: none;
}

.rmpr-history__mobile {
	display: block;
	padding: 40px 20px 34px;
	color: #fff;
	background: var(--rmpr-history-purple);
}

.rmpr-history__mobile-header {
	max-width: 520px;
	margin: 0 auto 28px;
}

.rmpr-history__mobile-header .rmpr-history__eyebrow {
	margin: 0 0 10px;
	color: var(--rmpr-history-yellow);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rmpr-history__mobile-header h2 {
	margin: 0 0 14px;
	color: #fff;
	font-size: clamp(2rem, 9vw, 2.75rem);
	line-height: 1.05;
}

.rmpr-history__mobile-header > p:last-child {
	margin: 0;
	font-size: 0.94rem;
	line-height: 1.5;
	opacity: 0.92;
}

.rmpr-history__mobile-navigation {
	display: grid;
	gap: 0;
	max-width: 520px;
	margin: 0 auto 30px;
	padding: 0;
	list-style: none;
}

.rmpr-history__mobile-navigation-item {
	position: relative;
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	min-height: 64px;
}

.rmpr-history__mobile-navigation-item:not(:last-child)::after {
	position: absolute;
	z-index: 0;
	top: calc(50% + 15px);
	bottom: calc(-50% + 15px);
	left: 14px;
	width: 2px;
	content: "";
	background: rgba(255, 255, 255, 0.7);
}

.rmpr-history__mobile-number {
	position: relative;
	z-index: 1;
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	font-size: 0.72rem;
	color: #fff;
	background: #68647e;
	border: 1px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	transition:
		color 200ms ease,
		background-color 200ms ease,
		transform 200ms ease;
}

.rmpr-history__mobile-navigation-item.is-active .rmpr-history__mobile-number {
	color: #302947;
	background: var(--rmpr-history-yellow);
	transform: scale(1.08);
}

.rmpr-history__mobile-navigation-copy {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.rmpr-history__mobile-navigation-copy strong {
	font-size: 0.88rem;
	line-height: 1.25;
}

.rmpr-history__mobile-navigation-copy small {
	font-size: 0.7rem;
	line-height: 1.25;
	opacity: 0.7;
}

.rmpr-history--many .rmpr-history__mobile-navigation-item {
	min-height: 52px;
}

.rmpr-history--many .rmpr-history__mobile-navigation-copy strong {
	font-size: 0.8rem;
}

.rmpr-history__mobile-stage {
	position: relative;
	display: block;
	max-width: 520px;
	margin: 0 auto;
	padding: 0 16px 16px;
	overflow: hidden;
	background: #9aac91;
	border-radius: 14px;
}

.rmpr-history__mobile-media-stack {
	position: relative;
	width: calc(100% + 32px);
	height: clamp(250px, 68vw, 330px);
	margin: 0 -16px;
}

.rmpr-history__mobile-media,
.rmpr-history__mobile-media img,
.rmpr-history__mobile-media-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.rmpr-history__mobile-media {
	margin: 0;
	opacity: 0;
	transform: scale(1.025);
	transition:
		opacity 420ms ease,
		transform 700ms ease;
}

.rmpr-history__mobile-media.is-active {
	opacity: 1;
	transform: scale(1);
}

.rmpr-history__mobile-media img {
	object-fit: cover;
}

.rmpr-history__mobile-media-overlay {
	z-index: 1;
	content: "";
	background:
		linear-gradient(
			180deg,
			rgba(83, 101, 76, 0.36),
			rgba(115, 136, 105, 0.76)
		);
}

.rmpr-history__mobile-story-stack {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 236px;
	margin-top: -28px;
}

.rmpr-history__mobile-story {
	position: absolute;
	inset: 0;
	padding: 22px;
	overflow: auto;
	color: #fff;
	background: var(--rmpr-history-panel);
	border-radius: 14px;
	opacity: 0;
	transform: translateY(18px);
	visibility: hidden;
	transition:
		opacity 320ms ease,
		transform 380ms ease,
		visibility 0s linear 380ms;
	backdrop-filter: blur(9px);
}

.rmpr-history__mobile-story.is-active {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
	transition-delay: 0s;
}

.rmpr-history__mobile-story-label {
	margin: 0 0 10px;
	color: var(--rmpr-history-yellow);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.rmpr-history__mobile-story h3 {
	margin: 0 0 14px;
	color: #fff;
	font-size: 1.3rem;
	line-height: 1.15;
}

.rmpr-history__mobile-story-content {
	font-size: 0.84rem;
	line-height: 1.5;
}

.rmpr-history__mobile-story-content a {
	color: #fff;
	text-decoration: underline;
}

.rmpr-history__mobile-story-content > :last-child {
	margin-bottom: 0;
}

.rmpr-history__mobile-controls {
	display: flex;
	gap: 12px;
	max-width: 520px;
	margin: 20px auto 0;
}

.rmpr-history__mobile-control {
	min-width: 96px;
	padding: 11px 20px;
	font-size: 0.76rem;
	font-weight: 700;
	color: #29243d;
	background: #fff;
	border: 0;
	border-radius: 999px;
}

.rmpr-history__mobile-control--next {
	background: var(--rmpr-history-yellow);
}

.rmpr-history__mobile-control:disabled {
	opacity: 0.4;
}

.rmpr-history__mobile-control:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
}

.rmpr-history__mobile-navigation-item.is-active .rmpr-history__mobile-navigation-copy,
.rmpr-history__mobile-navigation-item.is-active .rmpr-history__mobile-navigation-copy strong,
.rmpr-history__mobile-navigation-item.is-active .rmpr-history__mobile-navigation-copy small {
	color: #000 !important;
}

.rmpr-history__admin-message {
	padding: 16px;
	border-left: 4px solid #dba617;
	background: #fff8d8;
}

/* Desktop interaction */
@media (min-width: 768px) {
	.rmpr-history.is-enhanced .rmpr-history__track {
		display: block;
		height: calc(100vh - var(--rmpr-history-sticky-offset));
		height: calc(100dvh - var(--rmpr-history-sticky-offset));
	}

	.rmpr-history.is-enhanced .rmpr-history__mobile {
		display: none;
	}

	.rmpr-history__stage {
		position: relative;
		height: 100%;
		overflow: hidden;
	}

	.rmpr-history__media-stack {
		position: absolute;
		inset: 0 0 0 var(--rmpr-history-sidebar-width);
		overflow: hidden;
		background: #87918c;
	}

	.rmpr-history__media {
		position: absolute;
		inset: 0;
		margin: 0;
		opacity: 0;
		transform: scale(1.025);
		transition:
			opacity 500ms ease,
			transform 900ms ease;
	}

	.rmpr-history__media.is-active {
		opacity: 1;
		transform: scale(1);
	}

	.rmpr-history__background-image,
	.rmpr-history__background-video {
		position: absolute;
		inset: 0;
		display: block;
		width: 100% !important;
		height: 100% !important;
		min-width: 100%;
		min-height: 100%;
		max-width: none !important;
		max-height: none !important;
		object-fit: cover !important;
		object-position: center center;
	}

	.rmpr-history__background-video {
		z-index: 1;
	}

	.rmpr-history__media-overlay {
		position: absolute;
		z-index: 2;
		inset: 0;
		background:
			linear-gradient(
				90deg,
				rgba(30, 34, 39, 0.34),
				rgba(30, 34, 39, 0.14)
			);
		pointer-events: none;
	}

	.rmpr-history__desktop-layout {
		position: relative;
		z-index: 3;
		display: grid;
		grid-template-columns: var(--rmpr-history-sidebar-width) 1fr;
		height: 100%;
	}

	.rmpr-history__sidebar {
		display: flex;
		flex-direction: column;
		min-width: 0;
		background: var(--rmpr-history-purple);
	}

	.rmpr-history__sidebar-content {
		display: flex;
		flex: 1;
		flex-direction: column;
		min-height: 0;
		padding: clamp(32px, 5vh, 64px) clamp(28px, 4vw, 54px) 24px;
		overflow: hidden;
	}

	.rmpr-history__eyebrow {
		margin: 0 0 12px;
		font-size: 0.72rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
	}

	.rmpr-history__heading {
		margin: 0 0 16px;
		color: #fff;
		font-size: clamp(2rem, 3.2vw, 3.3rem);
		line-height: 1.05;
	}

	.rmpr-history__intro {
		max-width: 34rem;
		margin: 0 0 clamp(28px, 5vh, 52px);
		line-height: 1.55;
	}

	.rmpr-history__navigation {
		display: grid;
		flex: 1;
		grid-template-rows: repeat(var(--rmpr-history-count), minmax(0, 1fr));
		gap: 0;
		min-height: 0;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.rmpr-history__navigation-item {
		position: relative;
		display: grid;
		grid-template-columns: var(--rmpr-history-marker-size) minmax(0, 1fr);
		gap: clamp(14px, 1.6vw, 22px);
		align-items: center;
		min-height: 0;
	}

	.rmpr-history__navigation-item:not(:last-child)::after {
		position: absolute;
		z-index: 0;
		top: calc(50% + var(--rmpr-history-marker-half));
		bottom: calc(-50% + var(--rmpr-history-marker-half));
		left: calc(var(--rmpr-history-marker-half) - 1px);
		width: 2px;
		content: "";
		background: rgba(255, 255, 255, 0.55);
	}

	.rmpr-history__number {
		position: relative;
		z-index: 1;
		display: grid;
		width: var(--rmpr-history-marker-size);
		height: var(--rmpr-history-marker-size);
		place-items: center;
		font-size: var(--rmpr-history-nav-label-size);
		color: #fff;
		background: #73758a;
		border: 1px solid rgba(255, 255, 255, 0.8);
		border-radius: 50%;
		transition:
			color 200ms ease,
			background-color 200ms ease,
			transform 200ms ease;
	}

	.rmpr-history__navigation-item.is-active .rmpr-history__number {
		color: #302947;
		background: var(--rmpr-history-yellow);
		transform: scale(1.08);
	}

	.rmpr-history__navigation-copy {
		display: grid;
		gap: 4px;
		min-width: 0;
	}

	.rmpr-history__navigation-copy strong {
		font-size: var(--rmpr-history-nav-title-size);
		line-height: 1.22;
	}

	.rmpr-history__navigation-copy small {
		font-size: var(--rmpr-history-nav-label-size);
		line-height: 1.25;
		opacity: 0.76;
	}

	.rmpr-history--many .rmpr-history__navigation {
		grid-template-rows: repeat(var(--rmpr-history-count), minmax(42px, 1fr));
		overflow-y: auto;
		scrollbar-width: thin;
	}

	.rmpr-history__control:focus-visible {
		outline: 3px solid #fff;
		outline-offset: 4px;
	}

	.rmpr-history__controls {
		display: flex;
		gap: 14px;
		padding: 24px clamp(28px, 4vw, 54px);
		background: var(--rmpr-history-purple-dark);
	}

	.rmpr-history__control {
		min-width: 104px;
		padding: 11px 22px;
		font-size: 0.78rem;
		font-weight: 700;
		color: #29243d;
		background: #fff;
		border: 0;
		border-radius: 999px;
		cursor: pointer;
	}

	.rmpr-history__control--next {
		background: var(--rmpr-history-yellow);
	}

	.rmpr-history__control:disabled {
		cursor: not-allowed;
		opacity: 0.4;
	}

	.rmpr-history__story-area {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: clamp(20px, 4vh, 36px);
		min-width: 0;
		padding: clamp(32px, 6vw, 92px);
		overscroll-behavior: contain;
	}

	.rmpr-history__preview,
	.rmpr-history__story-stack {
		width: min(680px, 86%);
		margin-inline: auto;
	}

	.rmpr-history__preview {
		height: clamp(88px, 12vh, 112px);
		padding: 18px 24px;
		overflow: hidden;
		background: var(--rmpr-history-preview);
		border-radius: 14px;
		opacity: 1;
		visibility: visible;
		transition:
			opacity 220ms ease,
			visibility 0s linear 0s;
		backdrop-filter: blur(8px);
	}

	.rmpr-history__preview.is-empty {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition:
			opacity 220ms ease,
			visibility 0s linear 220ms;
	}

	.rmpr-history__preview span {
		display: block;
		margin-bottom: 5px;
		font-size: 0.66rem;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		opacity: 0.75;
	}

	.rmpr-history__preview strong {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
	}

	.rmpr-history__preview p {
		display: -webkit-box;
		margin: 5px 0 0;
		overflow: hidden;
		font-size: 0.78rem;
		opacity: 0.8;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.rmpr-history__story-stack {
		position: relative;
		height: min(42vh, 390px);
		min-height: 280px;
	}

	.rmpr-history__story {
		position: absolute;
		inset: 0;
		padding: clamp(28px, 4vw, 46px);
		overflow: auto;
		color: #fff;
		background: var(--rmpr-history-panel);
		border-radius: 22px;
		opacity: 0;
		transform: translateY(35px);
		visibility: hidden;
		transition:
			opacity 350ms ease,
			transform 450ms ease,
			visibility 0s linear 450ms;
		backdrop-filter: blur(10px);
	}

	.rmpr-history__story.is-active {
		opacity: 1;
		transform: translateY(0);
		visibility: visible;
		transition-delay: 0s;
	}

	.rmpr-history__story-label {
		margin: 0 0 12px;
		font-size: 0.7rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		opacity: 0.78;
	}

	.rmpr-history__story h3 {
		margin: 0 0 22px;
		color: #fff;
		font-size: clamp(1.7rem, 3vw, 2.7rem);
		line-height: 1.1;
	}

	.rmpr-history__story-content {
		line-height: 1.6;
	}

	.rmpr-history__story-content a {
		color: #fff;
		text-decoration: underline;
	}

	.rmpr-history__story-content > :last-child {
		margin-bottom: 0;
	}
}

.rmpr-history__navigation-item.is-active .rmpr-history__navigation-copy,
.rmpr-history__navigation-item.is-active .rmpr-history__navigation-copy strong,
.rmpr-history__navigation-item.is-active .rmpr-history__navigation-copy small {
	color: #000 !important;
}

.rmpr-history__control,
.rmpr-history__mobile-control {
	--rmpr-history-control-background: #fff;
	--rmpr-history-control-text: #29243d;
	position: relative;
	overflow: hidden;
	font-family: inherit !important;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	color: var(--rmpr-history-control-text) !important;
	background-color: var(--rmpr-history-control-background) !important;
	background-image: none !important;
}

.rmpr-history__control--next,
.rmpr-history__mobile-control--next {
	--rmpr-history-control-background: var(--rmpr-history-yellow);
}

.rmpr-history__control:not(:disabled):hover,
.rmpr-history__control:not(:disabled):active,
.rmpr-history__control:not(:disabled):focus-visible,
.rmpr-history__mobile-control:not(:disabled):hover,
.rmpr-history__mobile-control:not(:disabled):active,
.rmpr-history__mobile-control:not(:disabled):focus-visible {
	color: var(--rmpr-history-control-text) !important;
	background-color: var(--rmpr-history-control-background) !important;
	background-image: none !important;
	box-shadow: none;
	transform: none;
}

.rmpr-history__control::before,
.rmpr-history__control::after,
.rmpr-history__mobile-control::before,
.rmpr-history__mobile-control::after {
	content: none !important;
}

.rmpr-history__control > span,
.rmpr-history__mobile-control > span {
	position: relative;
	display: inline-block;
	font: inherit !important;
	letter-spacing: inherit !important;
	text-transform: inherit !important;
	color: inherit !important;
}

.rmpr-history__control > span::after,
.rmpr-history__mobile-control > span::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -3px;
	left: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 240ms ease;
	pointer-events: none;
}

.rmpr-history__control:not(:disabled):hover > span::after,
.rmpr-history__control:not(:disabled):active > span::after,
.rmpr-history__control:not(:disabled):focus-visible > span::after,
.rmpr-history__mobile-control:not(:disabled):hover > span::after,
.rmpr-history__mobile-control:not(:disabled):active > span::after,
.rmpr-history__mobile-control:not(:disabled):focus-visible > span::after {
	transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
	.rmpr-history *,
	.rmpr-history *::before,
	.rmpr-history *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
