.mpwk-rail {
	--mpwk-ink: #2d241f;
	--mpwk-muted: #75685e;
	--mpwk-gold: #b98235;
	--mpwk-gold-deep: #8a5a22;
	--mpwk-gold-light: #f3e6d4;
	--mpwk-line: rgba(185, 130, 53, .28);
	--mpwk-peek: 44px;
	box-sizing: border-box;
	position: relative;
	min-width: 0;
	color: var(--mpwk-ink);
	background: #fffdf9;
	border: 1px solid rgba(185, 130, 53, .24);
	border-radius: 26px;
	box-shadow: 0 22px 55px rgba(70, 49, 30, .09);
	overflow: hidden;
	font: 400 14px/1.45 Manrope, Arial, sans-serif;
	text-align: left;
}
.mpwk-rail *, .mpwk-rail *::before, .mpwk-rail *::after { box-sizing: border-box; }
.mpwk-rail .mpwk-head { padding: 16px 18px 14px; }
.mpwk-rail .mpwk-head, .mpwk-rail .mpwk-nav, .mpwk-rail .mpwk-actions { align-items: center; display: flex; }
.mpwk-rail .mpwk-head { justify-content: space-between; gap: 10px; }
.mpwk-rail .mpwk-kicker, .mpwk-rail .mpwk-position {
	display: block; font: 700 11px/1.5 Manrope, Arial, sans-serif; color: var(--mpwk-gold); letter-spacing: .16em;
}
.mpwk-rail .mpwk-kicker { text-transform: uppercase; }
.mpwk-rail .mpwk-head h2 {
	margin: 3px 0 0; font: 500 24px/1.1 'Source Serif 4', Georgia, serif;
	color: var(--mpwk-ink); letter-spacing: -.02em; text-transform: none; white-space: nowrap;
}
.mpwk-rail .mpwk-enhance, .mpwk-rail .mpwk-edge { display: none; }
.mpwk-rail .mpwk-track { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(138px,100%),1fr)); gap: 8px; padding: 8px; }
.mpwk-rail .mpwk-film { position: relative; min-width: 0; }
.mpwk-rail a.mpwk-frame { position: relative; display: block; overflow: hidden; border-radius: 12px; color: #382a1e; text-decoration: none; }
.mpwk-rail .mpwk-loading { display: none; }
.mpwk-rail:not(.mpwk-ready) a.mpwk-frame {
	display: flex; align-items: center; gap: 8px; padding: 12px; min-height: 44px;
	background: #f7f1e7; color: #382a1e;
}
.mpwk-rail:not(.mpwk-ready) a.mpwk-frame::before {
	content: ""; flex: none; border-block: 5px solid transparent; border-left: 8px solid #926528;
}
.mpwk-rail .mpwk-plain-title { display: block; font: 500 15px/1.35 Georgia, serif; padding: 6px; }

/* Enhanced: one full-size reel at a time, caption and actions laid over the video. */
.mpwk-rail.mpwk-ready {
	width: min(100%, 410px); margin-inline: auto;
	height: max(760px, calc(100vh - var(--mpwk-top, 84px) - 12px));
	height: max(760px, calc(100svh - var(--mpwk-top, 84px) - 12px));
	display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr);
	container: mpwk-rail / inline-size;
}
.mpwk-rail.mpwk-ready .mpwk-enhance { display: flex; }
.mpwk-rail .mpwk-nav { gap: 6px; flex: none; }
.mpwk-rail.mpwk-ready .mpwk-stage {
	grid-row: 2; grid-column: 1;
	position: relative; min-height: 0; min-width: 0; container-type: size;
	margin: 0 8px 8px; border-radius: 18px; overflow: hidden; background: #15110d;
}
.mpwk-rail.mpwk-ready .mpwk-track {
	display: block; position: relative; height: 100%; padding: 0; overflow-x: hidden; overflow-y: auto;
	scroll-snap-type: y mandatory; overscroll-behavior-y: auto; overflow-anchor: none;
	scrollbar-width: none; scroll-behavior: auto; -webkit-overflow-scrolling: touch;
}
.mpwk-rail .mpwk-track::-webkit-scrollbar { display: none; }
/* Current reel centred; the neighbours peek in above and below. */
.mpwk-rail.mpwk-ready .mpwk-film { height: calc(100% - 2 * var(--mpwk-peek)); width: calc(100% - 16px); margin-inline: auto; scroll-snap-align: center; scroll-snap-stop: always; }
.mpwk-rail.mpwk-ready .mpwk-film + .mpwk-film { margin-top: 8px; }
.mpwk-rail.mpwk-ready .mpwk-edge { display: block; height: var(--mpwk-peek); }
/* Every slide keeps its size and brightness as it crosses the centre. */
.mpwk-rail.mpwk-ready .mpwk-frame, .mpwk-rail .mpwk-player, .mpwk-rail .mpwk-standby { width: 100%; height: 100%; display: block; padding: 0; }
.mpwk-rail.mpwk-ready .mpwk-frame { cursor: pointer; border-radius: 14px; background: linear-gradient(155deg, #faf6ef, #eee2d0); box-shadow: 0 0 0 1px rgba(234, 214, 183, .35); }
.mpwk-rail .mpwk-player, .mpwk-rail .mpwk-standby { position: absolute; inset: 0; margin: 0; max-width: none; max-height: none; object-fit: contain; border-radius: 14px; pointer-events: none; z-index: 1; opacity: 0; background: transparent; transition: none; }
.mpwk-rail .mpwk-still { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; }
.mpwk-rail .mpwk-still.is-ready, .mpwk-rail .mpwk-player.has-picture, .mpwk-rail .mpwk-standby.has-picture { opacity: 1; }
.mpwk-rail.mpwk-ready .mpwk-plain-title { display: none; }
.mpwk-rail.mpwk-ready.is-loading .mpwk-loading {
	position: absolute; z-index: 2; top: 50%; left: 50%; padding: 5px 11px; border-radius: 20px; text-align: center; transform: translate(-50%, -50%);
	display: block; pointer-events: none; white-space: nowrap; background: rgba(250,246,239,.94); color: #5b4938; font: 500 12px/1.4 Manrope, Arial, sans-serif;
	animation: mpwk-wait-label .15s .3s backwards;
}
@keyframes mpwk-wait-label { from { opacity: 0; } to { opacity: 1; } }

.mpwk-rail.mpwk-ready .mpwk-foot {
	position: absolute; z-index: 2; left: 50%; bottom: var(--mpwk-peek); width: calc(100% - 16px); transform: translateX(-50%);
	margin: 0; padding: 64px 12px 16px 16px; border-radius: 0 0 14px 14px; overflow: hidden;
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 12px; row-gap: 6px;
	background: linear-gradient(to top, rgba(15, 11, 8, .82) 0%, rgba(15, 11, 8, .45) 55%, rgba(15, 11, 8, 0) 100%);
	pointer-events: none;
}
.mpwk-rail.mpwk-ready .mpwk-foot button { pointer-events: auto; }
/* All three sizes come from the same stage: a complete 9:16 frame, its scroll
   spacers and its overlay stay aligned on both the about page and the shortcode. */
@supports (width: 1cqw) {
	.mpwk-rail.mpwk-ready .mpwk-stage > * {
		--mpwk-film-h: min(calc(100cqh - 2 * var(--mpwk-peek)), calc((100cqw - 16px) * 16 / 9));
		--mpwk-film-w: calc(var(--mpwk-film-h) * 9 / 16);
		--mpwk-frame-inset: calc((100cqh - var(--mpwk-film-h)) / 2);
	}
	.mpwk-rail.mpwk-ready .mpwk-film { width: var(--mpwk-film-w); height: var(--mpwk-film-h); }
	.mpwk-rail.mpwk-ready .mpwk-edge { height: var(--mpwk-frame-inset); }
	.mpwk-rail.mpwk-ready .mpwk-foot { width: var(--mpwk-film-w); bottom: var(--mpwk-frame-inset); }
}
.mpwk-rail .mpwk-caption { min-width: 0; grid-column: 1; grid-row: 1; padding-bottom: 4px; }
.mpwk-rail .mpwk-position { font-size: 11px; color: #ead6b7; font-variant-numeric: tabular-nums; }
.mpwk-rail .mpwk-title {
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
	margin-top: 4px; font: 500 17px/1.3 'Source Serif 4', Georgia, serif; color: #fff;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .35); text-wrap: pretty;
}
.mpwk-rail .mpwk-actions { grid-column: 2; grid-row: 1; flex-direction: column; gap: 10px; }
.mpwk-rail .mpwk-progress {
	position: absolute; left: 0; right: 0; bottom: 0; display: block; height: 3px; background: rgba(255, 255, 255, .2); overflow: hidden;
}
.mpwk-rail .mpwk-progress i {
	display: block; height: 100%; background: var(--mpwk-gold);
	transform: scaleX(var(--mpwk-p, 0)); transform-origin: left center; transition: transform .25s linear;
}

.mpwk-rail button.mpwk-btn {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 40px; height: 40px; min-width: 0; min-height: 0; padding: 0; margin: 0;
	line-height: 1; font: inherit; text-indent: 0; transform: none; box-shadow: none;
	color: var(--mpwk-ink); background: transparent; border: 1px solid var(--mpwk-line); border-radius: 50%;
	-webkit-appearance: none; appearance: none; cursor: pointer; touch-action: manipulation;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.mpwk-rail .mpwk-btn .mpwk-icon { display: block; width: 18px; height: 18px; flex: 0 0 18px; pointer-events: none; }
/* Buttons on the video */
.mpwk-rail .mpwk-actions button.mpwk-btn {
	width: 44px; height: 44px; color: #fff; border: 0;
	background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mpwk-rail .mpwk-actions .mpwk-btn .mpwk-icon { width: 21px; height: 21px; flex-basis: 21px; }
.mpwk-rail .mpwk-actions button.mpwk-play { background: var(--mpwk-gold); }
.mpwk-rail button.mpwk-play .mpwk-icon-play { fill: currentColor; }
.mpwk-rail .mpwk-actions button.mpwk-like {
	order: -1; flex-direction: column; gap: 3px; width: 44px; height: auto; padding: 0;
	background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 12px;
	font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.mpwk-rail .mpwk-actions button.mpwk-like .mpwk-icon { width: 30px; height: 30px; flex-basis: 30px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.35)); }
.mpwk-rail .mpwk-like[aria-pressed="true"] .mpwk-icon-heart { fill: #e8b25e; stroke: #e8b25e; animation: mpwk-beat .42s ease; }
@keyframes mpwk-beat { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.mpwk-rail button.mpwk-btn:disabled { opacity: .35; cursor: default; }
.mpwk-rail button.mpwk-btn:focus-visible, .mpwk-rail a.mpwk-frame:focus-visible { outline: 2px solid var(--mpwk-gold); outline-offset: 2px; }
.mpwk-rail a.mpwk-frame:focus-visible { outline-offset: -3px; }
.mpwk-rail .mpwk-btn .mpwk-icon-pause, .mpwk-rail .mpwk-btn.is-playing .mpwk-icon-play,
.mpwk-rail .mpwk-btn .mpwk-icon-sound, .mpwk-rail .mpwk-btn[aria-pressed="true"] .mpwk-icon-mute { display: none; }
.mpwk-rail .mpwk-btn.is-playing .mpwk-icon-pause, .mpwk-rail .mpwk-btn[aria-pressed="true"] .mpwk-icon-sound { display: block; }
@media (hover: hover) {
	.mpwk-rail .mpwk-nav button.mpwk-btn:not(:disabled):hover { background-color: var(--mpwk-gold-light); border-color: var(--mpwk-gold); }
	.mpwk-rail .mpwk-actions button.mpwk-btn:not(:disabled):hover { background-color: rgba(255, 255, 255, .28); }
	.mpwk-rail .mpwk-actions button.mpwk-play:not(:disabled):hover { background-color: #a8722d; }
	.mpwk-rail .mpwk-actions button.mpwk-like:not(:disabled):hover { background: none; transform: scale(1.06); }
}
.mpwk-rail .mpwk-actions button[data-act="sound"] { position: relative; overflow: visible; }
.mpwk-rail .mpwk-actions button[data-act="sound"][aria-pressed="false"] {
	background-color: rgba(37, 29, 22, .62); box-shadow: inset 0 0 0 1px rgba(237, 206, 154, .8);
}
@media (prefers-reduced-motion: no-preference) {
	.mpwk-rail .mpwk-actions button.mpwk-sound-cue[aria-pressed="false"]::after {
		content: ""; position: absolute; inset: 0; border: 1px solid #ead0a4; border-radius: 50%; pointer-events: none;
		opacity: 0; animation: mpwk-sound-pulse 1.35s ease-out 1;
	}
	@keyframes mpwk-sound-pulse {
		0% { opacity: 0; transform: scale(1); }
		22% { opacity: .65; transform: scale(1.025); }
		100% { opacity: 0; transform: scale(1.18); }
	}
}
.mpwk-rail .mpwk-origin, .mpwk-rail .mpwk-message { grid-column: 1 / -1; font: 500 11px/1.45 Manrope, Arial, sans-serif; color: rgba(255, 255, 255, .78); overflow-wrap: anywhere; }
.mpwk-rail .mpwk-message { font-size: 12px; color: #ffd9a8; }
.mpwk-rail .mpwk-origin:empty, .mpwk-rail .mpwk-message:empty { display: none; }
@media (max-width: 1120px) {
	.mpwk-rail.mpwk-ready { width: min(100%, 470px); margin-inline: auto; height: clamp(760px, 94vh, 960px); height: clamp(760px, 94svh, 960px); }
}
/* The 760px preferred height does not fit every laptop or phone below its
   sticky header. Keep the full film and controls reachable on those screens. */
@media (min-width: 1121px) and (max-height: 870px) {
	.mpwk-rail.mpwk-ready { height: calc(100vh - var(--mpwk-top, 84px) - 12px); height: calc(100svh - var(--mpwk-top, 84px) - 12px); }
}
@media (max-width: 1120px) and (max-height: 800px) {
	.mpwk-rail.mpwk-ready { height: 94vh; height: 94svh; }
}
@container mpwk-rail (max-width: 320px) {
	.mpwk-rail .mpwk-title { font-size: 16px; }
	.mpwk-rail .mpwk-head { padding: 11px 8px; gap: 6px; flex-wrap: wrap; }
	.mpwk-rail .mpwk-head h2 { font-size: 19px; }
	.mpwk-rail .mpwk-nav { gap: 4px; margin-left: auto; }
}
@media (max-height: 550px) {
	.mpwk-rail.mpwk-ready { height: 440px; --mpwk-peek: 22px; }
	.mpwk-rail .mpwk-head { padding-block: 8px; }
	.mpwk-rail.mpwk-ready .mpwk-foot { padding: 28px 6px 8px; column-gap: 5px; }
	.mpwk-rail .mpwk-actions { gap: 3px; }
	.mpwk-rail .mpwk-title { font-size: 15px; }
}
@media (pointer: coarse) { .mpwk-rail button.mpwk-btn { min-width: 44px; min-height: 44px; } }
@media (prefers-reduced-motion: reduce) {
	.mpwk-rail .mpwk-progress i, .mpwk-rail button.mpwk-btn, .mpwk-rail .mpwk-player { transition: none !important; }
	.mpwk-rail .mpwk-like .mpwk-icon-heart, .mpwk-rail .mpwk-loading { animation: none !important; }
	.mpwk-rail .mpwk-frame { transition: none !important; }
}
