/* Home — Stories rail + fullscreen viewer + composer (mobile-first friendly) */

.cl-stories-rail {
	padding: 10px max(12px, env(safe-area-inset-left)) 14px max(12px, env(safe-area-inset-right));
	border-bottom: 1px solid var(--cl-primary-border-color);
	background:
		linear-gradient(
			180deg,
			color-mix(in srgb, var(--cl-primary-bg-color) 92%, rgba(255, 255, 255, 0.04)) 0%,
			var(--cl-primary-bg-color) 100%
		);
	-webkit-tap-highlight-color: transparent;
	touch-action: pan-y;
}

.cl-stories-rail__head {
	margin-bottom: 8px;
}

.cl-stories-rail__head-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	text-decoration: none;
}

.cl-stories-rail__title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--cl-secondary-text-color);
	text-transform: uppercase;
}

.cl-stories-rail__more {
	font-size: 11px;
	font-weight: 600;
	color: var(--cl-primary-link-color);
	text-transform: none;
}

.cl-stories-rail__track {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 12px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	padding-bottom: 2px;
	scroll-padding-inline: max(12px, env(safe-area-inset-left));
}

.cl-stories-rail__track::-webkit-scrollbar {
	display: none;
}

.cl-stories-rail__cell {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 76px;
	min-height: 104px;
	padding: 4px 2px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--cl-primary-text-color);
	-webkit-tap-highlight-color: transparent;
	transition:
		transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
		filter 0.2s ease,
		opacity 0.2s ease;
	will-change: transform;
}

.cl-stories-rail__cell:focus {
	outline: 2px solid var(--cl-primary-color);
	outline-offset: 2px;
}

.cl-stories-rail__cell:hover {
	transform: translateY(-2px);
}

.cl-stories-rail__cell:active {
	transform: translateY(0) scale(0.985);
}

.cl-stories-rail__cell--new {
	width: 72px;
}

.cl-stories-rail__new-thumb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 14px;
	overflow: hidden;
	background: linear-gradient(
		145deg,
		color-mix(in srgb, var(--cl-primary-color) 50%, #ffffff 50%),
		color-mix(in srgb, var(--cl-primary-link-color) 44%, #ffffff 56%)
	);
	box-shadow:
		0 8px 20px rgba(0, 0, 0, 0.22),
		0 0 0 1px rgba(255, 255, 255, 0.1) inset;
	transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
}

.cl-stories-rail__new-thumb::after {
	content: "";
	position: absolute;
	inset: 1px;
	border-radius: inherit;
	border: 1px solid rgba(255, 255, 255, 0.28);
	opacity: 0;
	transition: opacity 0.22s ease;
	pointer-events: none;
}

.cl-stories-rail__cell--new.has-avatar-bg .cl-stories-rail__new-thumb {
	background: #14141a;
}

.cl-stories-rail__new-thumb-blur {
	position: absolute;
	inset: -10px;
	background-size: cover;
	background-position: center;
	filter: blur(4px);
	transform: scale(1.06);
	pointer-events: none;
}

.cl-stories-rail__new-thumb-fg {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.32);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	transition: background 0.22s ease;
}

.cl-stories-rail__new-thumb-fg svg {
	width: 26px;
	height: 26px;
}

.cl-stories-rail__new-label {
	font-size: 11px;
	font-weight: 600;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Square story preview (first slide), not profile avatar */
/* Viewed: muted frame. Unseen: bold gradient (see .is-unseen). */
.cl-stories-rail__thumb-wrap,
.cl-stories-rail__thumb-wrap.is-seen {
	position: relative;
	display: block;
	width: 68px;
	height: 68px;
	padding: 3px;
	border-radius: 16px;
	background: linear-gradient(145deg, #94a3b8 0%, #cbd5e1 52%, #a8b4c4 100%);
	box-sizing: border-box;
	overflow: hidden;
	box-shadow:
		0 6px 14px rgba(15, 23, 42, 0.14),
		0 0 0 1px rgba(255, 255, 255, 0.35) inset;
	transition:
		transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.24s ease,
		filter 0.24s ease,
		background 0.24s ease;
}

.cl-stories-rail__thumb-wrap.is-unseen {
	background: linear-gradient(
		135deg,
		#7eb8dc 0%,
		#6b93d6 26%,
		#8b94d4 52%,
		#a894c4 78%,
		#8fafc9 100%
	);
	box-shadow:
		0 8px 18px rgba(30, 58, 95, 0.18),
		0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

body[data-bg="dark"] .cl-stories-rail__thumb-wrap,
body[data-bg="dark"] .cl-stories-rail__thumb-wrap.is-seen {
	background: linear-gradient(145deg, #475569 0%, #64748b 48%, #3f4f63 100%);
	box-shadow:
		0 6px 16px rgba(0, 0, 0, 0.35),
		0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.cl-stories-rail__thumb-wrap--video::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	margin-left: 2px;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
	pointer-events: none;
	z-index: 2;
}

.cl-stories-rail__thumb {
	width: 100%;
	height: 100%;
	border-radius: 13px;
	object-fit: cover;
	border: none;
	display: block;
	background: #1a1a1f;
	vertical-align: top;
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
}

.cl-stories-rail__thumb--video {
	pointer-events: none;
}

.cl-stories-rail__thumb--video-still {
	pointer-events: none;
}

.cl-stories-rail__cell:hover .cl-stories-rail__thumb-wrap,
.cl-stories-rail__cell:focus-visible .cl-stories-rail__thumb-wrap,
.cl-stories-rail__cell:hover .cl-stories-rail__new-thumb,
.cl-stories-rail__cell:focus-visible .cl-stories-rail__new-thumb {
	transform: translateY(-1px) scale(1.015);
}

.cl-stories-rail__cell:hover .cl-stories-rail__thumb,
.cl-stories-rail__cell:focus-visible .cl-stories-rail__thumb {
	transform: scale(1.04);
	filter: saturate(1.03) contrast(1.02);
}

.cl-stories-rail__cell:hover .cl-stories-rail__new-thumb::after,
.cl-stories-rail__cell:focus-visible .cl-stories-rail__new-thumb::after {
	opacity: 1;
}

.cl-stories-rail__cell:hover .cl-stories-rail__new-thumb-fg,
.cl-stories-rail__cell:focus-visible .cl-stories-rail__new-thumb-fg {
	background: rgba(0, 0, 0, 0.22);
}

.cl-stories-rail__label {
	font-size: 11px;
	font-weight: 600;
	max-width: 76px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Dedicated stories page grid */
.cl-stories-page-wrap .timeline-header .timeline-header__botline {
	border-bottom: 1px solid var(--cl-primary-border-color);
}

.cl-stories-page {
	padding: 12px max(12px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
}

.cl-stories-page__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.cl-stories-page__head-copy {
	min-width: 0;
}

.cl-stories-page__title {
	margin: 0;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--cl-primary-text-color);
}

.cl-stories-page__subtitle {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--cl-secondary-text-color);
	line-height: 1.35;
}

.cl-stories-page__new-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 13px;
	min-height: 40px;
	border-radius: 999px;
	border: 1px solid rgba(79, 70, 229, 0.5);
	background: linear-gradient(145deg, rgba(79, 70, 229, 0.26), rgba(124, 58, 237, 0.22));
	color: var(--cl-primary-text-color);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: transform 0.12s ease, border-color 0.16s ease, background 0.16s ease;
}

.cl-stories-page__new-btn:hover {
	border-color: rgba(129, 140, 248, 0.62);
	background: linear-gradient(145deg, rgba(99, 102, 241, 0.32), rgba(139, 92, 246, 0.26));
}

.cl-stories-page__new-btn:active {
	transform: scale(0.985);
}

.cl-stories-page__new-btn-icon {
	width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cl-stories-page__new-btn-icon svg {
	width: 18px;
	height: 18px;
}

.cl-stories-page__new-btn-icon svg path {
	fill: currentColor !important;
}

.cl-stories-page__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 14px;
}

.cl-stories-page__card {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	border: none;
	border-radius: 18px;
	overflow: hidden;
	padding: 0;
	margin: 0;
	background: #11131a;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
	transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.cl-stories-page__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.36);
}

.cl-stories-page__card:focus-visible {
	outline: 2px solid var(--cl-primary-color);
	outline-offset: 2px;
}

.cl-stories-page__media {
	position: absolute;
	inset: 0;
}

.cl-stories-page__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.08));
	pointer-events: none;
	z-index: 1;
}

.cl-stories-page__media.is-video::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	margin-left: 3px;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
	pointer-events: none;
	z-index: 3;
}

.cl-stories-page__media-el {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: contrast(1.02) saturate(1.06);
	transform: scale(1.001);
}

.cl-stories-page__shade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(5, 7, 10, 0.58) 0%, rgba(5, 7, 10, 0.08) 35%, rgba(5, 7, 10, 0.08) 62%, rgba(5, 7, 10, 0.72) 100%);
}

.cl-stories-page__meta {
	position: absolute;
	left: 10px;
	right: 10px;
	top: 10px;
	z-index: 2;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.cl-stories-page__user {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 8px;
}

.cl-stories-page__avatar-wrap {
	display: inline-block;
	line-height: 0;
	border-radius: 50%;
	padding: 2px;
	flex-shrink: 0;
	box-sizing: border-box;
	background: conic-gradient(
		from 215deg,
		#94a3b8,
		#cbd5e1,
		#e2e8f0,
		#cbd5e1,
		#94a3b8,
		#94a3b8
	);
}

.cl-stories-page__avatar-wrap.is-unseen {
	background: conic-gradient(
		from 215deg,
		#7eb8dc,
		#6b93d6,
		#8b94d4,
		#a894c4,
		#8fafc9,
		#7eb8dc
	);
}

body[data-bg="dark"] .cl-stories-page__avatar-wrap:not(.is-unseen) {
	background: conic-gradient(
		from 215deg,
		#475569,
		#64748b,
		#94a3b8,
		#64748b,
		#475569,
		#475569
	);
}

.cl-stories-page__avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
	border: 0;
	display: block;
	box-shadow: none;
}

.cl-stories-page__user-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cl-stories-page__user-text strong {
	font-size: 13px;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cl-stories-page__user-text small {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cl-stories-page__badge-wrap {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.cl-stories-page__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 24px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	background: rgba(12, 13, 20, 0.54);
	border: 1px solid rgba(255, 255, 255, 0.24);
}

.cl-stories-page__badge--new {
	background: linear-gradient(145deg, rgba(129, 140, 248, 0.82), rgba(99, 102, 241, 0.68));
	border-color: rgba(199, 210, 254, 0.62);
}

.cl-stories-page__caption {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 12px;
	z-index: 2;
	font-size: 13px;
	line-height: 1.35;
	color: #fff;
	font-weight: 600;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.58);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.cl-stories-page__card--new {
	background:
		linear-gradient(145deg, color-mix(in srgb, var(--cl-primary-color) 88%, #0e1120), #0f1220);
}

.cl-stories-page__card--new.has-avatar-bg {
	background: #121722;
}

.cl-stories-page__new-bg {
	position: absolute;
	inset: 0;
}

.cl-stories-page__new-bg-blur {
	position: absolute;
	inset: -8px;
	background-size: cover;
	background-position: center;
	filter: blur(8px) brightness(0.66);
	transform: scale(1.07);
}

.cl-stories-page__new-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: radial-gradient(80% 60% at 50% 32%, rgba(255, 255, 255, 0.2), transparent 65%);
}

.cl-stories-page__new-pill {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 13px;
	border-radius: 999px;
	background: rgba(13, 15, 23, 0.62);
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.cl-stories-page__new-pill-icon {
	width: 16px;
	height: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cl-stories-page__new-pill-icon svg {
	width: 16px;
	height: 16px;
}

.cl-stories-page__new-pill-icon svg path {
	fill: currentColor !important;
}

.cl-stories-page__new-pill-text {
	white-space: nowrap;
}

.cl-stories-page__empty.timeline-placeholder {
	margin-top: 10px;
}

@media (max-width: 991px) {
	.cl-stories-page {
		padding-top: 10px;
	}
}

@media (max-width: 576px) {
	.cl-stories-page__head {
		margin-bottom: 10px;
	}

	.cl-stories-page__title {
		font-size: 17px;
	}

	.cl-stories-page__subtitle {
		font-size: 11px;
	}

	.cl-stories-page__new-btn {
		padding-left: 11px;
		padding-right: 11px;
	}

	.cl-stories-page__new-btn-text {
		display: none;
	}

	.cl-stories-page__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.cl-stories-page__caption {
		font-size: 12px;
	}
}

/* Fullscreen viewer */
.cl-story-viewer {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	min-height: -webkit-fill-available;
	z-index: 10050;
	display: none;
	align-items: stretch;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	overscroll-behavior: contain;
}

/* jQuery toast defaults to z-index 9000; raise above the story overlay while open */
body.cl-story-viewer-open .jq-toast-wrap {
	z-index: 10080 !important;
}

.cl-story-viewer.is-open {
	display: flex;
	/* Avoid touch-action:none on the shell — it prevents nested scroll in GIF/emoji sheets on mobile */
	touch-action: manipulation;
	animation: cl-story-viewer-fade-in 0.24s ease both;
}

.cl-story-viewer.is-open .cl-story-viewer__views-scroll {
	touch-action: pan-y;
	overscroll-behavior: contain;
}

.cl-story-viewer__backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 80% at 50% 0%, rgba(28, 24, 40, 0.94) 0%, rgba(6, 6, 10, 0.97) 55%, rgba(2, 2, 6, 0.98) 100%);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
}

.cl-story-viewer.is-open .cl-story-viewer__backdrop {
	opacity: 1;
	animation: cl-story-backdrop-in 0.28s ease forwards;
}

.cl-story-viewer__shell {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 440px;
	height: 100%;
	max-height: min(92vh, 100dvh, 860px);
	margin: auto;
	display: flex;
	flex-direction: column;
	padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
	box-sizing: border-box;
	isolation: isolate;
	overscroll-behavior: none;
	opacity: 0;
	transform: translateY(14px) scale(0.986);
}

.cl-story-viewer.is-open .cl-story-viewer__shell {
	opacity: 1;
	transform: translateY(0) scale(1);
	animation: cl-story-shell-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Viewers sheet open — dim stage so the list reads as the focus (not full-screen takeover) */
.cl-story-viewer__shell.is-views-open .cl-story-viewer__stage {
	opacity: 0.42;
	transition: opacity 0.2s ease;
}

@media (min-width: 520px) {
	.cl-story-viewer__shell {
		border-radius: 16px;
		overflow: hidden;
		box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
		max-height: min(92vh, 860px);
	}
}

.cl-story-viewer__progress {
	display: flex;
	gap: 4px;
	padding: 10px 10px 0;
	z-index: 30;
	position: relative;
}

.cl-story-viewer__progress-seg {
	flex: 1;
	height: 3px;
	border-radius: 99px;
	background: linear-gradient(
		90deg,
		rgba(30, 41, 59, 0.92) 0%,
		rgba(51, 65, 85, 0.88) 100%
	);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.14),
		0 1px 2px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}

.cl-story-viewer__progress-fill {
	display: block;
	height: 100%;
	width: 100%;
	transform-origin: left center;
	transform: scaleX(0);
	background: linear-gradient(
		90deg,
		#7eb8dc 0%,
		#6b93d6 30%,
		#8b94d4 58%,
		#a894c4 100%
	);
	border-radius: inherit;
	/* No transition — avoids stacked/delayed bar updates on rapid tap / swipe */
	transition: none;
	box-shadow: none;
	will-change: transform;
}

.cl-story-viewer__progress-seg.is-done .cl-story-viewer__progress-fill {
	transform: scaleX(1);
	transition: none;
}

.cl-story-viewer__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	z-index: 30;
	position: relative;
	color: #fafafa;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

.cl-story-viewer__user {
	display: flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
	min-width: 0;
}

/* Ring + photo; frame overlay is a sibling so it is not clipped inside the ring */
.cl-story-viewer__user-avatar-stack {
	position: relative;
	display: inline-block;
	line-height: 0;
	flex-shrink: 0;
}

.cl-story-viewer__user-photo-core {
	display: block;
	position: relative;
	border-radius: 50%;
	overflow: hidden;
	line-height: 0;
}

/*
 * Header: when a frame is shown, paint the story ring on the photo (between face and frame),
 * not as padding on the wrap — same stacking idea as `.cl-avatar-story-ring` + framed avatars.
 */
@supports selector(:has(.cl-story-viewer__avatar-frame-outer:not([hidden]))) {
	.cl-story-viewer__user-avatar-stack:has(.cl-story-viewer__avatar-frame-outer:not([hidden])) .cl-story-viewer__user-avatar-wrap {
		padding: 0;
		background: transparent !important;
		box-shadow: none;
	}

	.cl-story-viewer__user-avatar-stack:has(.cl-story-viewer__avatar-frame-outer:not([hidden])) .cl-story-viewer__user-photo-core {
		isolation: isolate;
	}

	.cl-story-viewer__user-avatar-stack:has(.cl-story-viewer__avatar-frame-outer:not([hidden])) .cl-story-viewer__user-photo-core::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: 50%;
		z-index: 1;
		pointer-events: none;
		background: var(--cl-sv-ring);
		/* Header avatar 36px desktop; gap/stroke scale so the ring never meets the frame layer */
		--cl-sv-ring-frame-gap: clamp(3px, calc(36px * 0.12), 8px);
		--cl-sv-ring-stroke: clamp(2px, calc(36px * 0.085), 3px);
		-webkit-mask: radial-gradient(
			farthest-side,
			transparent calc(100% - var(--cl-sv-ring-frame-gap) - var(--cl-sv-ring-stroke)),
			#000 calc(100% - var(--cl-sv-ring-frame-gap) - var(--cl-sv-ring-stroke) + 0.5px),
			#000 calc(100% - var(--cl-sv-ring-frame-gap)),
			transparent calc(100% - var(--cl-sv-ring-frame-gap) + 0.5px)
		);
		mask: radial-gradient(
			farthest-side,
			transparent calc(100% - var(--cl-sv-ring-frame-gap) - var(--cl-sv-ring-stroke)),
			#000 calc(100% - var(--cl-sv-ring-frame-gap) - var(--cl-sv-ring-stroke) + 0.5px),
			#000 calc(100% - var(--cl-sv-ring-frame-gap)),
			transparent calc(100% - var(--cl-sv-ring-frame-gap) + 0.5px)
		);
		box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
	}

	.cl-story-viewer__user-avatar-stack:has(.cl-story-viewer__avatar-frame-outer:not([hidden])) .cl-story-viewer__user-avatar-wrap--seen .cl-story-viewer__user-photo-core::after {
		background: var(--cl-sv-ring-seen);
		box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
	}

	@media (max-width: 991px) {
		.cl-story-viewer__user-avatar-stack:has(.cl-story-viewer__avatar-frame-outer:not([hidden])) .cl-story-viewer__user-photo-core::after {
			--cl-sv-ring-frame-gap: clamp(3px, calc(40px * 0.115), 9px);
			--cl-sv-ring-stroke: clamp(2px, calc(40px * 0.078), 3px);
		}
	}
}

.cl-story-viewer__avatar-frame-outer {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cl-story-viewer__avatar-frame-outer img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	border: none;
	box-shadow: none;
}

.cl-story-viewer__avatar-frame-outer--gif img {
	will-change: transform;
}

/* Header avatar: same soft story gradient as rail / feed rings */
.cl-story-viewer__user-avatar-wrap {
	--cl-sv-ring: conic-gradient(
		from 215deg,
		#7eb8dc,
		#6b93d6,
		#8b94d4,
		#a894c4,
		#8fafc9,
		#7eb8dc
	);
	--cl-sv-ring-seen: conic-gradient(
		from 215deg,
		#94a3b8,
		#cbd5e1,
		#e2e8f0,
		#cbd5e1,
		#94a3b8,
		#94a3b8
	);
	position: relative;
	display: inline-block;
	line-height: 0;
	border-radius: 50%;
	flex-shrink: 0;
	padding: 3px;
	box-sizing: border-box;
	background: var(--cl-sv-ring);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.cl-story-viewer__user-avatar-wrap--unseen {
	background: var(--cl-sv-ring);
}

.cl-story-viewer__user-avatar-wrap--seen {
	background: var(--cl-sv-ring-seen);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body[data-bg="dark"] .cl-story-viewer__user-avatar-wrap--seen {
	--cl-sv-ring-seen: conic-gradient(
		from 215deg,
		#475569,
		#64748b,
		#94a3b8,
		#64748b,
		#475569,
		#475569
	);
}

.cl-story-viewer__user-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	border: 0;
	display: block;
	box-shadow: none;
}

.cl-story-viewer__user-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cl-story-viewer__user-text strong {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cl-story-viewer__user-text small {
	font-size: 12px;
	opacity: 0.88;
	color: rgba(255, 255, 255, 0.82);
}

.cl-story-viewer__actions {
	display: flex;
	gap: 6px;
}

.cl-story-viewer__icon-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.cl-story-viewer__icon-btn:hover {
	background: rgba(255, 255, 255, 0.24);
	border-color: rgba(255, 255, 255, 0.45);
	color: #ffffff;
}

.cl-story-viewer__icon-btn svg {
	width: 20px;
	height: 20px;
}

/* Fluent SVGs ship with fill="#212121" on paths — override so icons read on dark header */
.cl-story-viewer__icon-btn svg path {
	fill: currentColor !important;
}

.cl-story-viewer__pause-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: currentColor;
}

.cl-story-viewer__pause-icon svg {
	display: block;
}

.cl-story-viewer__pause-icon svg path {
	fill: currentColor !important;
}

.cl-story-viewer__pause-icon--play {
	display: none;
}

.cl-story-viewer__icon-btn.is-paused .cl-story-viewer__pause-icon--pause {
	display: none;
}

.cl-story-viewer__icon-btn.is-paused .cl-story-viewer__pause-icon--play {
	display: inline-flex;
}

.cl-story-viewer__mute-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: currentColor;
}

.cl-story-viewer__mute-icon svg {
	display: block;
}

.cl-story-viewer__mute-icon svg path[fill="none"] {
	fill: none !important;
	stroke: currentColor !important;
}

.cl-story-viewer__mute-icon--unmuted {
	display: none;
}

.cl-story-viewer__icon-btn.is-muted .cl-story-viewer__mute-icon--muted {
	display: inline-flex;
}

.cl-story-viewer__icon-btn.is-muted .cl-story-viewer__mute-icon--unmuted {
	display: none;
}

.cl-story-viewer__icon-btn:not(.is-muted) .cl-story-viewer__mute-icon--muted {
	display: none;
}

.cl-story-viewer__icon-btn:not(.is-muted) .cl-story-viewer__mute-icon--unmuted {
	display: inline-flex;
}

.cl-story-viewer__views-head .cl-story-viewer__views-close svg path {
	fill: currentColor !important;
}

.cl-story-viewer__stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #060608;
	border-radius: 0 0 12px 12px;
	overflow: hidden;
	/* none: avoid vertical pan chaining to Discover/Following tab swipe; views panel keeps pan-y */
	touch-action: none;
	contain: layout paint style;
	transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
}

.cl-story-viewer__stage-fill {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
	display: block;
}

.cl-story-viewer__stage.is-story-bg-color .cl-story-viewer__stage-fill {
	background: transparent;
}

.cl-story-viewer__bg-img {
	position: absolute;
	left: 50%;
	top: 50%;
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	transform: translate(-50%, -50%) scale(1.08);
	object-fit: cover;
	filter: blur(16px) brightness(0.82) saturate(1.04);
	opacity: 0;
	transition: opacity 0.14s ease, transform 0.18s ease, filter 0.18s ease;
	will-change: opacity, transform;
}

.cl-story-viewer__bg-img.is-visible {
	opacity: 0.92;
}

/* Instant LQIP layer (slide / rail thumb only) while full-res blur decodes — heavier blur hides tiny source. */
.cl-story-viewer__bg-img.cl-story-viewer__bg-img--lqip {
	filter: blur(26px) brightness(0.68) saturate(1.02);
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
	transform: translate(-50%, -50%) scale(1.14);
}

.cl-story-viewer__media {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	contain: layout paint style;
	transform: translate3d(0, 0, 0);
}

.cl-story-viewer__media > img,
.cl-story-viewer__video-slot {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 2px;
	opacity: 1;
	transform: translateZ(0) scale(1);
	will-change: opacity, transform;
	transition:
		opacity 0.16s ease,
		transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.cl-story-viewer__media > img[hidden] {
	display: none !important;
}

.cl-story-viewer__video-stack {
	position: absolute;
	inset: 0;
	z-index: 2;
}

.cl-story-viewer__video-slot {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateZ(0) scale(0.985);
}

.cl-story-viewer__video-slot.is-active {
	opacity: 1;
	visibility: visible;
	transform: translateZ(0) scale(1);
}

.cl-story-viewer__video-loader {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(40% 40% at 50% 50%, rgba(17, 23, 36, 0.26) 0%, rgba(17, 23, 36, 0) 100%);
	pointer-events: none;
}

.cl-story-viewer__video-loader-ring {
	width: 38px;
	height: 38px;
	border: 3px solid rgba(255, 255, 255, 0.18);
	border-top-color: rgba(255, 255, 255, 0.96);
	border-radius: 50%;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
	animation: cl-story-views-spin 0.75s linear infinite;
}

.cl-story-viewer__stage.is-slide-enter .cl-story-viewer__media > img,
.cl-story-viewer__stage.is-slide-enter .cl-story-viewer__video-slot.is-active {
	animation: cl-story-media-in 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cl-story-viewer__stage.is-slide-enter .cl-story-viewer__caption {
	animation: cl-story-caption-in 0.1s ease both;
}

.cl-story-viewer__hit {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 28%;
	min-width: 56px;
	border: none;
	padding: 0;
	margin: 0;
	background: transparent;
	cursor: pointer;
	z-index: 8;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	box-shadow: none;
}

.cl-story-viewer__hit:focus,
.cl-story-viewer__hit:focus-visible {
	outline: none;
	box-shadow: none;
}

.cl-story-viewer__hit--prev {
	left: 0;
}

.cl-story-viewer__hit--next {
	right: 0;
}

.cl-story-viewer__user-nav {
	position: absolute;
	right: max(8px, env(safe-area-inset-right));
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 26;
	pointer-events: none;
}

@media (min-width: 992px) {
	/* Desktop: place user-nav arrows outside story frame */
	.cl-story-viewer__shell {
		overflow: visible;
	}

	.cl-story-viewer__user-nav {
		right: -54px;
	}
}

.cl-story-viewer__user-nav-btn {
	pointer-events: auto;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, 0.26);
	border-radius: 999px;
	background: rgba(10, 13, 22, 0.58);
	color: rgba(255, 255, 255, 0.96);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.cl-story-viewer__user-nav-btn:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.4);
	transform: translateY(-1px);
}

.cl-story-viewer__user-nav-btn:active {
	transform: translateY(0);
}

.cl-story-viewer__user-nav-btn:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}

.cl-story-viewer__end-state {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 34;
	background: radial-gradient(90% 70% at 50% 18%, rgba(42, 52, 88, 0.24) 0%, rgba(7, 10, 18, 0.92) 70%);
}

.cl-story-viewer__end-state.is-open {
	display: flex;
}

.cl-story-viewer__end-state-card {
	width: 100%;
	max-width: 340px;
	padding: 18px 16px;
	border-radius: 18px;
	text-align: center;
	background: rgba(17, 23, 36, 0.86);
	border: 1px solid rgba(255, 255, 255, 0.16);
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.cl-story-viewer__end-state-icon {
	width: 44px;
	height: 44px;
	margin: 0 auto 10px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(129, 140, 248, 0.22);
	color: #dfe6ff;
}

.cl-story-viewer__end-state-title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #f8faff;
}

.cl-story-viewer__end-state-text {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.45;
	color: rgba(219, 228, 255, 0.84);
}

.cl-story-viewer__end-state-btn {
	margin-top: 14px;
	min-height: 38px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.12);
	color: #f5f8ff;
	padding: 0 16px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.16s ease, border-color 0.16s ease;
}

.cl-story-viewer__end-state-btn:hover {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.34);
}

.cl-story-viewer__caption {
	margin: 0;
	padding: 10px 12px;
	color: rgba(255, 255, 255, 0.96);
	font-size: 14px;
	line-height: 1.42;
	text-align: left;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
	position: absolute;
	left: max(10px, env(safe-area-inset-left));
	right: max(10px, env(safe-area-inset-right));
	bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
	z-index: 28;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(15, 17, 24, 0.58);
	backdrop-filter: blur(8px) saturate(1.15);
	-webkit-backdrop-filter: blur(8px) saturate(1.15);
}

.cl-story-viewer__footer-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: nowrap;
	gap: 8px;
	margin: 0;
	z-index: 30;
	position: absolute;
	left: max(10px, env(safe-area-inset-left));
	right: max(10px, env(safe-area-inset-right));
	bottom: max(10px, env(safe-area-inset-bottom));
	max-width: none;
	padding: 8px;
	box-sizing: border-box;
	border-radius: 16px;
	background: rgba(18, 22, 31, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(14px) saturate(1.2);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.cl-story-viewer__like {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 48px;
	min-width: 56px;
	width: auto;
	margin: 0;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.96);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition:
		background 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease,
		box-shadow 0.18s ease;
}

.cl-story-viewer__like:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.32);
}

.cl-story-viewer__like:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.55);
	outline-offset: 2px;
}

.cl-story-viewer__like.is-liked {
	background: linear-gradient(145deg, rgba(225, 29, 72, 0.44), rgba(190, 24, 93, 0.38));
	border-color: rgba(251, 113, 133, 0.55);
	color: #fff;
	box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.15) inset;
}

.cl-story-viewer__like-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	width: 22px;
	height: 22px;
}

.cl-story-viewer__like-icon--filled {
	display: none;
}

.cl-story-viewer__like.is-liked .cl-story-viewer__like-icon--outline {
	display: none;
}

.cl-story-viewer__like.is-liked .cl-story-viewer__like-icon--filled {
	display: inline-flex;
}

.cl-story-viewer__like-icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.cl-story-viewer__like-icon svg path {
	fill: currentColor !important;
}

.cl-story-viewer__like-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	min-width: 1ch;
}

.cl-story-viewer__like:disabled {
	cursor: default;
	opacity: 0.9;
	pointer-events: none;
}

/* Bottom action row: make like a clear icon+count pill next to comment (not a floating circle). */
#cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like,
.cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like {
	flex: 0 0 auto;
	min-width: 70px;
	padding: 0 13px;
	gap: 7px;
	border-color: rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.96);
}

#cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like:hover,
.cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.36);
}

#cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like.is-liked,
.cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like.is-liked {
	border-color: rgba(251, 113, 133, 0.56);
	background: linear-gradient(145deg, rgba(118, 30, 64, 0.86), rgba(150, 36, 84, 0.76));
	color: #fff;
	box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.18) inset;
}

#cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like-count,
.cl-story-viewer .cl-story-viewer__footer-row .cl-story-viewer__like-count {
	display: inline-flex !important;
	min-width: 1.3ch;
}

.cl-story-viewer__reply {
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 9px;
	flex: 1 1 auto;
	min-height: 48px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.95);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0;
	text-decoration: none;
	cursor: pointer;
	z-index: 20;
	position: relative;
	-webkit-tap-highlight-color: transparent;
	transition:
		background 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease;
}

.cl-story-viewer__reply:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.35);
	color: #fff;
	text-decoration: none;
}

.cl-story-viewer__reply:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.55);
	outline-offset: 2px;
}

.cl-story-viewer__reply-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.86;
}

.cl-story-viewer__reply-icon svg {
	width: 16px;
	height: 16px;
	display: block;
}

.cl-story-viewer__reply-icon svg path {
	fill: currentColor !important;
}

.cl-story-viewer__reply-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0.9;
}

.cl-story-viewer__views {
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	flex: 1 1 auto;
	min-height: 48px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.94);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	cursor: pointer;
	z-index: 20;
	position: relative;
	-webkit-tap-highlight-color: transparent;
	transition:
		background 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease;
}

.cl-story-viewer__views:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.35);
}

.cl-story-viewer__views:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.55);
	outline-offset: 2px;
}

.cl-story-viewer__views-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.92;
}

.cl-story-viewer__views-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.cl-story-viewer__views-icon svg path {
	fill: currentColor !important;
}

.cl-story-viewer__views-text {
	white-space: nowrap;
}

.cl-story-viewer__views [data-an="story-views-count"] {
	font-variant-numeric: tabular-nums;
}

.cl-story-viewer__next-user {
	display: none !important;
}

/* Viewers sheet — ~75% of viewport; list scrolls inside */
.cl-story-viewer__views-panel {
	position: absolute;
	left: max(10px, env(safe-area-inset-left));
	right: max(10px, env(safe-area-inset-right));
	bottom: max(48px, calc(env(safe-area-inset-bottom) + 40px));
	display: flex;
	flex-direction: column;
	flex: 0 1 auto;
	height: auto;
	width: auto;
	max-height: 75vh;
	max-height: 75dvh;
	min-height: 120px;
	background: rgba(18, 18, 22, 0.97);
	backdrop-filter: blur(16px) saturate(1.2);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 0;
	overflow: hidden;
	z-index: 40;
	color: #f4f4f8;
	box-shadow:
		0 12px 48px rgba(0, 0, 0, 0.45),
		0 0 0 1px rgba(255, 255, 255, 0.04) inset;
	opacity: 0;
	transform: translateY(16px) scale(0.985);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.cl-story-viewer__views-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.cl-story-viewer__views-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
	padding: 14px 16px 10px;
	font-weight: 600;
	font-size: 15px;
	letter-spacing: 0.01em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cl-story-viewer__views-title {
	color: rgba(255, 255, 255, 0.96);
}

.cl-story-viewer__views-head .cl-story-viewer__views-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -6px -8px -6px 0;
	border-radius: 10px;
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.88);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.cl-story-viewer__views-head .cl-story-viewer__views-close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.cl-story-viewer__views-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 4px 12px 8px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.cl-story-viewer__views-scroll::-webkit-scrollbar {
	width: 6px;
}

.cl-story-viewer__views-scroll::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.22);
	border-radius: 6px;
}

.cl-story-viewer__views-scroll.is-fetching {
	opacity: 0.65;
	pointer-events: none;
}

.cl-story-viewer__views-loadmore {
	flex-shrink: 0;
	display: block;
	width: calc(100% - 24px);
	margin: 0 12px 12px;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.92);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		opacity 0.15s ease;
}

.cl-story-viewer__views-loadmore:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.11);
	border-color: rgba(255, 255, 255, 0.18);
}

.cl-story-viewer__views-loadmore:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.cl-story-viewer__views-loadmore.is-loading {
	position: relative;
	color: transparent;
}

.cl-story-viewer__views-loadmore.is-loading::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	animation: cl-story-views-spin 0.65s linear infinite;
}

@keyframes cl-story-views-spin {
	to {
		transform: rotate(360deg);
	}
}

.cl-story-viewer__views-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cl-story-viewer__views-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 4px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cl-story-viewer__views-list li:last-child {
	border-bottom: none;
}

.cl-story-viewer__views-user {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
	color: inherit;
	text-decoration: none;
	-webkit-tap-highlight-color: rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	margin: -4px -6px;
	padding: 4px 6px;
	transition: background 0.15s ease;
}

.cl-story-viewer__views-user:hover {
	background: rgba(255, 255, 255, 0.06);
}

.cl-story-viewer__views-user:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.45);
	outline-offset: 2px;
}

.cl-story-viewer__views-user-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.cl-story-viewer__views-user-name-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
}

.cl-story-viewer__views-user-name {
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.95);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.cl-story-viewer__views-liked-badge {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: rgba(255, 220, 230, 0.98);
	background: rgba(236, 72, 153, 0.35);
	padding: 3px 8px;
	border-radius: 6px;
	flex-shrink: 0;
}

.cl-story-viewer__views-user-time {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.45);
}

.cl-story-viewer__views-list li > div:last-child {
	flex: 1;
	min-width: 0;
}

.cl-story-viewer__views-list li > div:last-child > div:first-child {
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.95);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cl-story-viewer__views-list li > div:last-child > small {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.45);
}

.cl-story-viewer__views-list img,
.cl-story-viewer__views-user img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
}

.cl-story-viewer__views-user .cl-avatar-framed--story-chip {
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
}

.cl-story-viewer__views-user .cl-avatar-framed--story-chip .cl-avatar-framed__photo img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-sizing: border-box;
}

.cl-story-viewer__views-user .cl-avatar-framed--story-chip .cl-avatar-framed__frame img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: none;
	border-radius: 0;
}

/* Story composer — minimal modal */
.cl-story-composer-modal.modal,
.cl-story-split-modal.modal,
.cl-story-upload-cancel-modal.modal {
	transition: none !important;
}

.cl-story-composer-modal .modal-dialog,
.cl-story-split-modal .modal-dialog,
.cl-story-upload-cancel-modal .modal-dialog {
	transition: none !important;
	transform: none !important;
}

body.cl-story-composer-open .modal-backdrop,
body.cl-story-split-open .modal-backdrop,
body.cl-story-upload-cancel-open .modal-backdrop {
	transition: none !important;
}

.cl-story-composer-modal .modal-dialog.cl-story-composer__dialog {
	max-width: min(392px, calc(100vw - 24px));
	width: 100%;
	margin: 0.75rem auto;
}

.cl-story-composer-modal .modal-content.cl-story-composer {
	position: relative;
	border-radius: 14px;
	border: 1px solid var(--cl-primary-border-color);
	overflow: hidden;
	background: var(--cl-primary-bg-color);
	box-shadow: 0 14px 36px color-mix(in srgb, #000 14%, transparent);
}

.cl-story-composer__header.modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px 10px;
	border-bottom: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
	flex-wrap: nowrap;
}

.cl-story-composer__header-main {
	flex: 1;
	min-width: 0;
}

.cl-story-composer__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--cl-primary-text-color);
}

.cl-story-composer__subtitle {
	margin: 3px 0 0;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--cl-secondary-text-color);
}

/* Match standard “New post” modal close control */
.cl-story-composer-modal .cl-story-composer__header.modal-header .close {
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	outline: 0;
	line-height: 1;
	font-size: 28px;
	font-weight: 400;
	color: var(--cl-secondary-text-color);
	opacity: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.cl-story-composer-modal .cl-story-composer__header.modal-header .close:hover {
	color: var(--cl-primary-text-color);
	opacity: 1;
}

.cl-story-composer .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cl-story-composer__body {
	position: relative;
	padding: 14px 18px 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cl-story-composer__caption-block {
	margin: 0;
}

.cl-story-composer__media-shell {
	width: 100%;
	margin: 0 auto;
	padding: 0;
	border-radius: 14px;
	background: transparent;
}

.cl-story-composer__preview {
	position: relative;
	min-height: 200px;
	max-height: min(52vh, 420px);
	aspect-ratio: 9 / 16;
	width: 100%;
	margin: 0;
	border-radius: 14px;
	background: var(--cl-secondary-bg-color);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px dashed var(--cl-primary-border-color);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.cl-story-composer__preview.has-media {
	border-style: solid;
	border-color: var(--cl-primary-border-color);
	background: color-mix(in srgb, var(--cl-secondary-bg-color) 70%, #000 30%);
}

.cl-story-composer__preview:hover:not(.is-busy):not([aria-disabled="true"]) {
	border-color: color-mix(in srgb, var(--cl-primary-color) 35%, var(--cl-primary-border-color));
}

.cl-story-composer__preview:focus {
	outline: none;
}

.cl-story-composer__preview:focus-visible:not(.is-busy) {
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--cl-primary-color) 45%, transparent);
}

.cl-story-composer__preview.is-busy,
.cl-story-composer__preview[aria-disabled="true"] {
	cursor: default;
	opacity: 0.92;
}

.cl-story-composer__preview.is-busy {
	pointer-events: none;
}

.cl-story-composer__preview.is-busy .cl-story-composer__preview-controls,
.cl-story-composer__preview.is-busy .cl-story-composer__preview-controls .cl-story-composer__preview-btn {
	pointer-events: auto;
}

.cl-story-composer__empty {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 16px 14px;
	text-align: center;
	pointer-events: none;
}

.cl-story-composer__empty-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: 0;
	border-radius: 12px;
	background: color-mix(in srgb, var(--cl-secondary-bg-color) 88%, var(--cl-primary-bg-color));
	color: var(--cl-secondary-text-color);
}

.cl-story-composer__empty-svg {
	display: block;
	width: 28px;
	height: 28px;
}

.cl-story-composer__empty-title {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.35;
	color: var(--cl-primary-text-color);
}

.cl-story-composer__empty-hint {
	font-size: 12px;
	font-weight: 400;
	color: var(--cl-secondary-text-color);
}

.cl-story-composer__preview-img,
.cl-story-composer__preview-vid {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	max-height: min(52vh, 420px);
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

.cl-story-composer__preview-loader {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	background: radial-gradient(36% 36% at 50% 50%, rgba(10, 13, 22, 0.22) 0%, rgba(10, 13, 22, 0) 100%);
}

.cl-story-composer__preview-loader-ring {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, 0.16);
	border-top-color: rgba(255, 255, 255, 0.96);
	border-radius: 50%;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
	animation: cl-story-views-spin 0.75s linear infinite;
}

.cl-story-composer__preview-controls {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	pointer-events: none;
}

.cl-story-composer__preview-btn {
	pointer-events: auto;
	width: 40px;
	height: 40px;
	border: 1px solid color-mix(in srgb, var(--cl-primary-border-color) 88%, transparent);
	border-radius: 999px;
	padding: 0;
	background: color-mix(in srgb, var(--cl-primary-bg-color) 58%, transparent);
	color: var(--cl-primary-text-color);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 8px 20px color-mix(in srgb, #000 18%, transparent);
	cursor: pointer;
	transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease, color 0.16s ease;
}

.cl-story-composer__preview-btn svg,
.cl-story-composer__preview-btn-icon svg {
	fill: currentColor;
}

.cl-story-composer__preview-btn-icon--muted svg path[fill="none"],
.cl-story-composer__preview-btn-icon--unmuted svg path[fill="none"] {
	fill: none;
	stroke: currentColor;
}

.cl-story-composer__preview-btn:hover {
	background: color-mix(in srgb, var(--cl-primary-bg-color) 78%, var(--cl-primary-text-color) 8%);
	border-color: color-mix(in srgb, var(--cl-primary-color) 42%, var(--cl-primary-border-color));
	transform: translateY(-1px);
}

.cl-story-composer__preview-btn:active {
	transform: translateY(0);
}

.cl-story-composer__preview-btn:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--cl-primary-color) 55%, transparent);
	outline-offset: 2px;
}

.cl-story-composer__preview-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cl-story-composer__preview-btn-icon svg {
	display: block;
}

.cl-story-composer__preview-btn-icon--play,
.cl-story-composer__preview-btn-icon--unmuted {
	display: none;
}

.cl-story-composer__preview-btn.is-paused .cl-story-composer__preview-btn-icon--pause,
.cl-story-composer__preview-btn:not(.is-muted) .cl-story-composer__preview-btn-icon--muted {
	display: none;
}

.cl-story-composer__preview-btn.is-paused .cl-story-composer__preview-btn-icon--play,
.cl-story-composer__preview-btn:not(.is-muted) .cl-story-composer__preview-btn-icon--unmuted {
	display: inline-flex;
}

.cl-story-composer__caption-glass {
	border-radius: 10px;
	padding: 0;
	background: var(--cl-secondary-bg-color);
	border: 1px solid var(--cl-primary-border-color);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cl-story-composer__caption-glass .form-control.cl-story-composer__textarea,
.cl-story-composer__textarea {
	display: block;
	width: 100%;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.45;
	resize: none;
	min-height: 72px;
	max-height: 200px;
	padding: 12px;
	background: transparent;
	border: none;
	color: var(--cl-primary-text-color);
	box-sizing: border-box;
	overflow-y: hidden;
	vertical-align: top;
	box-shadow: none;
}

.cl-story-composer__textarea::placeholder {
	color: var(--cl-secondary-text-color);
	opacity: 0.75;
}

.cl-story-composer__textarea:focus {
	outline: none;
	box-shadow: none;
}

.cl-story-composer__caption-glass:focus-within {
	border-color: color-mix(in srgb, var(--cl-primary-color) 40%, var(--cl-primary-border-color));
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--cl-primary-color) 14%, transparent);
}

.cl-story-composer__upload {
	margin-top: 0;
	padding: 0;
	border: none;
	background: transparent;
}

.cl-story-composer__upload-inner {
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--cl-secondary-bg-color);
	border: 1px solid var(--cl-primary-border-color);
}

.cl-story-composer__upload-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.cl-story-composer__upload-head-end {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.cl-story-composer__upload-dismiss {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 8px;
	background: color-mix(in srgb, var(--cl-primary-text-color) 8%, transparent);
	color: var(--cl-secondary-text-color);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.cl-story-composer__upload-dismiss:hover {
	background: color-mix(in srgb, var(--cl-danger-color, #ef4444) 18%, transparent);
	color: var(--cl-primary-text-color);
}

.cl-story-composer__upload-dismiss:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--cl-primary-color) 45%, transparent);
	outline-offset: 2px;
}

.cl-story-composer__upload-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--cl-primary-text-color);
}

.cl-story-composer__upload-pct {
	font-size: 12px;
	font-weight: 600;
	color: var(--cl-secondary-text-color);
	font-variant-numeric: tabular-nums;
}

.cl-story-composer__upload-track {
	margin-top: 8px;
	height: 4px;
	border-radius: 999px;
	overflow: hidden;
	background: color-mix(in srgb, var(--cl-primary-border-color) 80%, transparent);
}

.cl-story-composer__upload-bar {
	display: block;
	width: 100%;
	height: 100%;
	transform-origin: left center;
	transform: scaleX(0);
	background: var(--cl-primary-color, #4361ee);
	transition: transform 0.12s linear;
}

.cl-story-composer__upload-note {
	margin: 6px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: var(--cl-secondary-text-color);
}

.cl-story-composer__footer {
	display: block;
	padding: 2px 18px max(18px, env(safe-area-inset-bottom));
	border-top: none;
	background: transparent;
}

.cl-story-composer__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.cl-story-composer__btn-cancel {
	margin: 0;
	width: auto;
	min-height: 0;
	padding: 8px 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--cl-secondary-text-color);
	background: transparent;
	border: none;
	border-radius: 0;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cl-story-composer__btn-cancel:hover:not(:disabled) {
	background: transparent;
	color: var(--cl-primary-text-color);
}

.cl-story-composer__btn-share {
	margin: 0 0 0 auto;
	width: auto;
	min-height: 44px;
	min-width: 124px;
	padding: 0 18px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.01em;
	border: none;
	border-radius: 10px;
	color: #fff;
	background: var(--cl-primary-color, #4361ee);
	box-shadow: none;
	transition: filter 0.15s ease, opacity 0.15s ease, transform 0.12s ease;
}

.cl-story-composer__btn-share:hover:not(:disabled) {
	filter: brightness(1.05);
}

.cl-story-composer__btn-share:active:not(:disabled) {
	transform: scale(0.99);
}

.cl-story-composer__btn-share:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	filter: none;
	box-shadow: none;
}

.cl-story-composer-modal .cl-story-composer__header.modal-header .close:disabled,
.cl-story-composer__btn-cancel:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Beat Bootstrap .btn defaults inside composer */
.cl-story-composer__footer .btn.cl-story-composer__btn-share {
	background-image: none;
	border: none;
}

.cl-story-composer__footer .btn.cl-story-composer__btn-cancel {
	box-shadow: none;
}

body.cl-story-composer-open .modal-backdrop.show {
	background: color-mix(in srgb, #0a0c10 45%, transparent);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

html.cl-story-viewer-open {
	overflow: hidden !important;
	height: 100%;
	width: 100%;
	overscroll-behavior: none;
}

body.cl-story-viewer-open {
	overflow: hidden !important;
	position: fixed;
	width: 100%;
	left: 0;
	right: 0;
	overscroll-behavior: none;
}

/* ——— Mobile: stories rail ——— */
@media (max-width: 576px) {
	.cl-stories-rail {
		padding-top: 8px;
		padding-bottom: 12px;
	}

	.cl-stories-rail__title {
		font-size: 12px;
	}

	.cl-stories-rail__track {
		gap: 10px;
	}

	.cl-stories-rail__cell {
		width: 72px;
		min-height: 100px;
	}

	.cl-stories-rail__cell--new {
		width: 68px;
	}

	.cl-stories-rail__new-thumb {
		width: 60px;
		height: 60px;
		border-radius: 12px;
	}

	.cl-stories-rail__thumb-wrap {
		width: 62px;
		height: 62px;
		padding: 2px;
		border-radius: 14px;
	}

	.cl-stories-rail__label {
		font-size: 10px;
		max-width: 72px;
	}

	.cl-stories-rail__new-label {
		font-size: 10px;
	}
}

/* ——— Mobile: story viewer full-bleed ——— */
@media (max-width: 991px) {
	.cl-story-viewer__shell {
		--story-user-nav-dy: 0px;
	}

	/* Mobile gesture feedback: move stage only (lighter than moving entire shell). */
	.cl-story-viewer__stage {
		transform: translate3d(0, 0, 0);
		will-change: transform;
		transition: transform 0.14s ease-out;
	}

	.cl-story-viewer__shell.is-user-nav-dragging .cl-story-viewer__stage {
		transform: translate3d(0, var(--story-user-nav-dy), 0);
		transition: none !important;
	}

	/* Mobile/smaller screens: keep user-nav arrows off the story media */
	.cl-story-viewer__user-nav {
		display: none !important;
	}

	.cl-story-viewer.is-open {
		inset: 0;
		width: 100vw;
		width: 100dvw;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		height: 100svh;
		max-height: none;
		min-height: -webkit-fill-available;
		align-items: stretch;
		justify-content: stretch;
	}

	.cl-story-viewer__shell {
		max-width: none;
		max-height: none;
		width: 100%;
		height: 100%;
		min-height: 100%;
		min-height: 100dvh;
		min-height: -webkit-fill-available;
		flex: 1 1 auto;
		margin: 0;
		padding: max(0px, env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
		border-radius: 0;
	}

	.cl-story-viewer__progress {
		padding-left: 4px;
		padding-right: 4px;
		/* Shell already applies safe-area-inset-top; do not add it again here */
		padding-top: 6px;
	}

	.cl-story-viewer__top {
		padding-left: 6px;
		padding-right: 6px;
	}

	.cl-story-viewer__stage {
		border-radius: 0;
		flex: 1 1 auto;
	}

	.cl-story-viewer__caption {
		left: max(8px, env(safe-area-inset-left));
		right: max(8px, env(safe-area-inset-right));
		bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px));
		font-size: 13px;
		padding: 9px 10px;
	}

	.cl-story-viewer__footer-row {
		left: max(8px, env(safe-area-inset-left));
		right: max(8px, env(safe-area-inset-right));
		bottom: max(8px, env(safe-area-inset-bottom));
		padding: 7px;
		border-radius: 14px;
	}

	.cl-story-viewer__user-nav {
		right: max(6px, env(safe-area-inset-right));
		gap: 7px;
	}

	.cl-story-viewer__user-nav-btn {
		width: 44px;
		height: 44px;
	}

	.cl-story-viewer__end-state {
		padding: 14px;
	}

	.cl-story-viewer__end-state-card {
		max-width: 360px;
	}

	.cl-story-viewer__icon-btn {
		width: 44px;
		height: 44px;
	}

	.cl-story-viewer__user-avatar {
		width: 40px;
		height: 40px;
	}

	/* In app WebView, force edge-to-edge top without extra safe-area inset (home + profile + story page + native shell). */
	body.cl-app-home .cl-story-viewer__shell,
	body.cl-app-profile .cl-story-viewer__shell,
	body.cl-app-story .cl-story-viewer__shell,
	body.cl-native-app-shell .cl-story-viewer__shell {
		padding-top: 0;
	}

	body.cl-app-home .cl-story-viewer__progress,
	body.cl-app-profile .cl-story-viewer__progress,
	body.cl-app-story .cl-story-viewer__progress,
	body.cl-native-app-shell .cl-story-viewer__progress {
		padding-top: 0;
	}

	/* While viewer is open, remove affix header stack that can create a top offset in WebView. */
	body.cl-app-home.cl-story-viewer-open .timeline-container[data-app="homepage"]:not(.no-affix),
	body.cl-app-profile.cl-story-viewer-open .timeline-container[data-app="profile"]:not(.no-affix),
	body.cl-app-story.cl-story-viewer-open .timeline-container[data-app="story"]:not(.no-affix) {
		padding-top: 0 !important;
	}

	body.cl-app-home.cl-story-viewer-open .timeline-container[data-app="homepage"]:not(.no-affix) > .timeline-header[data-el="tl-header"],
	body.cl-app-home.cl-story-viewer-open .timeline-container[data-app="homepage"] .timeline-header__tabs,
	body.cl-app-profile.cl-story-viewer-open .timeline-container[data-app="profile"]:not(.no-affix) > .timeline-header[data-el="tl-header"],
	body.cl-app-profile.cl-story-viewer-open .timeline-container[data-app="profile"] .timeline-header__tabs,
	body.cl-app-story.cl-story-viewer-open .timeline-container[data-app="story"]:not(.no-affix) > .timeline-header[data-el="tl-header"] {
		display: none !important;
	}

	/* Mobile/WebView: freeze heavy page layers while story viewer is open (home + profile + story page). */
	body.cl-app-home.cl-story-viewer-open .timeline-container[data-app="homepage"] > :not(#cl-story-viewer),
	body.cl-app-profile.cl-story-viewer-open .timeline-container[data-app="profile"] > :not(#cl-story-viewer),
	body.cl-app-story.cl-story-viewer-open .timeline-container[data-app="story"] > :not(#cl-story-viewer) {
		visibility: hidden !important;
		pointer-events: none !important;
	}

	body.cl-app-home.cl-story-viewer-open #cl-story-viewer,
	body.cl-app-profile.cl-story-viewer-open #cl-story-viewer,
	body.cl-app-story.cl-story-viewer-open #cl-story-viewer {
		visibility: visible !important;
		pointer-events: auto !important;
	}

	/* Reduce expensive blur/compositing while viewing stories over dense feeds. */
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__backdrop,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__footer-row,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__caption,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__icon-btn,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__like,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__reply,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__end-state-card,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__backdrop,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__footer-row,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__caption,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__icon-btn,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__like,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__reply,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__end-state-card,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__backdrop,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__footer-row,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__caption,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__icon-btn,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__like,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__reply,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__end-state-card {
		backdrop-filter: none !important;
		-webkit-backdrop-filter: none !important;
	}

	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__bg-img,
	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__stage-fill,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__bg-img,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__stage-fill,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__bg-img,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__stage-fill {
		display: block !important;
	}

	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__bg-img,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__bg-img,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__bg-img {
		filter: blur(16px) brightness(0.88) saturate(1.02);
	}

	body.cl-app-home.cl-story-viewer-open .cl-story-viewer__progress-fill,
	body.cl-app-profile.cl-story-viewer-open .cl-story-viewer__progress-fill,
	body.cl-app-story.cl-story-viewer-open .cl-story-viewer__progress-fill {
		box-shadow: none;
	}
}

/* ——— Mobile: composer as full-screen sheet ——— */
@media (max-width: 576px) {
	.cl-story-viewer__reply-sheet {
		padding-left: 0;
		padding-right: 0;
	}

	.cl-story-viewer__reply-sheet-inner {
		width: 100%;
		max-width: none;
		border-radius: 20px 20px 0 0;
		padding-left: max(12px, env(safe-area-inset-left, 0px));
		padding-right: max(12px, env(safe-area-inset-right, 0px));
		box-sizing: border-box;
	}

	.cl-story-composer-modal {
		padding: 0 !important;
	}

	.cl-story-composer-modal .modal-dialog.cl-story-composer__dialog {
		margin: 0;
		max-width: none;
		width: 100%;
		height: 100%;
		min-height: 100%;
		min-height: -webkit-fill-available;
		min-height: 100dvh;
		min-height: 100svh;
		max-height: 100dvh;
		max-height: 100svh;
		padding: 0;
		display: flex;
		align-items: stretch;
	}

	.cl-story-composer-modal .modal-content.cl-story-composer {
		border-radius: 0;
		border: none;
		height: 100%;
		max-height: inherit;
		min-height: 0;
		display: flex;
		flex-direction: column;
		box-shadow: none;
		padding-bottom: 0;
	}

	.cl-story-composer__header.modal-header {
		flex-shrink: 0;
		padding-top: max(10px, env(safe-area-inset-top));
		padding-left: max(16px, env(safe-area-inset-left));
		padding-right: max(16px, env(safe-area-inset-right));
		padding-bottom: 10px;
	}

	.cl-story-composer__header-main {
		padding-right: 6px;
	}

	.cl-story-composer__body {
		flex: 1 1 0;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		padding: 10px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
		gap: 10px;
	}

	.cl-story-composer__media-shell {
		max-width: 100%;
		width: 100%;
		margin-left: auto;
		margin-right: auto;
	}

	.cl-story-composer__preview {
		max-width: none;
		min-height: 140px;
		max-height: min(36svh, 40dvh, 360px);
		aspect-ratio: 9 / 16;
	}

	.cl-story-composer__caption-glass .form-control.cl-story-composer__textarea,
	.cl-story-composer__textarea {
		min-height: 68px;
	}

	.cl-story-composer__upload {
		margin-top: 10px;
		padding: 0;
	}

	.cl-story-composer__footer {
		flex-shrink: 0;
		margin-top: 0;
		padding-left: max(16px, env(safe-area-inset-left));
		padding-right: max(16px, env(safe-area-inset-right));
		padding-bottom: max(16px, env(safe-area-inset-bottom));
		padding-top: 0;
	}

	.cl-story-composer__actions {
		gap: 10px;
	}

	.cl-story-composer__footer .btn {
		font-size: 14px;
	}

	.cl-story-composer__btn-share {
		min-height: 46px;
		min-width: 120px;
	}
}

.cl-story-split-modal {
	z-index: 1070 !important;
}

.cl-story-split-modal .modal-dialog {
	z-index: 1071;
	max-width: min(420px, calc(100vw - 24px));
}

body.cl-story-split-open #cl-story-composer {
	z-index: 1050;
}

body.cl-story-split-open .modal-backdrop.show {
	background: color-mix(in srgb, #0a0c10 38%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

body.cl-story-split-open .modal-backdrop.show:last-of-type {
	z-index: 1065 !important;
	background: color-mix(in srgb, #0a0c10 52%, transparent);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.cl-story-split-modal .modal-content.cl-story-split-modal__content {
	border-radius: 14px;
	border: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
	box-shadow: 0 14px 36px color-mix(in srgb, #000 14%, transparent);
	overflow: hidden;
}

.cl-story-split-modal .modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px 10px;
	border-bottom: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
}

.cl-story-split-modal .modal-header .modal-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--cl-primary-text-color);
}

.cl-story-split-modal .modal-header .close {
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	outline: 0;
	line-height: 1;
	font-size: 28px;
	font-weight: 400;
	color: var(--cl-secondary-text-color);
	opacity: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.cl-story-split-modal .modal-header .close:hover,
.cl-story-split-modal .modal-header .close:focus {
	color: var(--cl-primary-text-color);
	opacity: 1;
}

.cl-story-split-modal .modal-body {
	padding: 14px 18px 16px;
	background: var(--cl-primary-bg-color);
}

.cl-story-split-modal__text {
	font-size: 15px;
	line-height: 1.45;
	color: var(--cl-primary-text-color);
}

.cl-story-split-modal .modal-footer.cl-story-split-modal__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px 18px 16px;
	border-top: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
}

.cl-story-split-modal .modal-footer .btn-secondary {
	color: var(--cl-primary-text-color);
	background: var(--cl-secondary-bg-color);
	border-color: var(--cl-primary-border-color);
}

.cl-story-split-modal .modal-footer .btn-primary {
	background: var(--cl-primary-color);
	border-color: var(--cl-primary-color);
	color: #fff;
}

/* Inline reply — minimal comment sheet */
.cl-story-viewer .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cl-story-viewer__shell.is-reply-open .cl-story-viewer__stage {
	opacity: 0.35;
	transition: opacity 0.22s ease;
	pointer-events: none;
}

.cl-story-viewer__reply-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	padding: 0 12px max(12px, env(safe-area-inset-bottom));
	touch-action: pan-y;
	overscroll-behavior: contain;
	pointer-events: none;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.cl-story-viewer__reply-sheet.is-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.cl-story-viewer__reply-sheet-inner {
	background:
		linear-gradient(152deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.035) 24%, rgba(2, 4, 10, 0.9) 100%),
		rgba(2, 4, 9, 0.76);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-bottom: none;
	border-radius: 24px 24px 0 0;
	padding: 18px 16px 20px;
	box-shadow: 0 -30px 78px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.14);
	height: min(85dvh, 85vh, 720px);
	max-height: min(85dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 12px));
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	backdrop-filter: saturate(145%) blur(34px);
	-webkit-backdrop-filter: saturate(145%) blur(34px);
	overflow: hidden;
	overscroll-behavior: contain;
	contain: layout paint style;
}

/* Scroll lives only here — keeps the composer from inheriting “list scroll” layout bugs. */
.cl-story-viewer__reply-sheet-body {
	flex: 1 1 0%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cl-story-viewer__reply-sheet-footer {
	flex: 0 0 auto;
	min-width: 0;
}

.cl-story-viewer__reply-list-wrap {
	flex: 1 1 0%;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: pan-y;
	padding: 2px 2px 4px 0;
	margin: 0;
	overflow-x: hidden;
	width: 100%;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.cl-story-viewer__reply-list-wrap::-webkit-scrollbar {
	width: 4px;
}

.cl-story-viewer__reply-list-wrap::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 4px;
}

.cl-story-viewer__reply-list {
	list-style: none;
	margin: 0;
	padding: 0 2px 0 0;
	width: 100%;
	box-sizing: border-box;
	overflow-x: hidden;
}

.cl-story-viewer__reply-loadmore {
	margin: 0 0 4px;
	width: 100%;
	padding: 10px 0;
	border: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.5);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: color 0.15s ease;
}

.cl-story-viewer__reply-loadmore:hover:not(:disabled) {
	color: rgba(255, 255, 255, 0.85);
}

.cl-story-viewer__reply-loadmore:disabled,
.cl-story-viewer__reply-loadmore.is-loading {
	opacity: 0.4;
	cursor: wait;
}

.cl-story-viewer__reply-sheet-head {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	padding: 0;
}

.cl-story-viewer__reply-sheet-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.03em;
	color: rgba(255, 255, 255, 0.96);
}

.cl-story-viewer__sheet-like {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-shrink: 0;
	min-height: 36px;
	padding: 0 12px;
	margin-right: 2px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.07);
	color: rgba(255, 255, 255, 0.96);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.cl-story-viewer__sheet-like:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.28);
}

.cl-story-viewer__sheet-like.is-liked {
	background: linear-gradient(145deg, rgba(225, 29, 72, 0.44), rgba(190, 24, 93, 0.38));
	border-color: rgba(251, 113, 133, 0.55);
}

.cl-story-viewer__sheet-like .cl-story-viewer__like-icon {
	width: 20px;
	height: 20px;
}

.cl-story-viewer__sheet-like .cl-story-viewer__like-icon svg {
	width: 20px;
	height: 20px;
}

.cl-story-viewer__sheet-like-count {
	display: inline !important;
	min-width: 1.25em;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.cl-story-viewer__reply-sheet-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.55);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease;
}

.cl-story-viewer__reply-sheet-close:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.cl-story-viewer__reply-sheet-close svg path {
	fill: currentColor !important;
}

/* Clip any stray overflow so list scroll never reads as a “textarea scrollbar”. */
.cl-story-reply-input-shell {
	overflow: hidden;
	max-height: 76px;
	min-height: 0;
}

#cl-story-viewer .cl-story-viewer__reply-input,
.cl-story-viewer .cl-story-viewer__reply-input {
	width: 100%;
	box-sizing: border-box;
	border: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.95);
	font-size: 14px;
	line-height: 1.45;
	padding: 10px 12px;
	min-height: 40px;
	max-height: 76px;
	resize: none !important;
	overflow: hidden !important;
	overflow-y: hidden !important;
	overflow-x: hidden !important;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

#cl-story-viewer .cl-story-viewer__reply-input::-webkit-scrollbar,
.cl-story-viewer .cl-story-viewer__reply-input::-webkit-scrollbar {
	display: none;
	width: 0 !important;
	height: 0 !important;
	background: transparent;
}

.cl-story-viewer__reply-comment-text {
	display: block;
	margin-top: 4px;
	font-size: 15px;
	line-height: 1.55;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.88);
	white-space: pre-wrap;
	word-break: break-word;
}

.cl-story-viewer__reply-input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

.cl-story-viewer__reply-input:focus {
	outline: none;
}

.cl-story-reply-composer,
.cl-reel-comment-composer--story {
	margin: 0;
	padding: 0;
	border: none;
	width: 100%;
	max-width: 100%;
	flex-shrink: 0;
	overflow-x: hidden;
}

.cl-story-reply-composer__body {
	border-radius: 14px;
	background: rgba(10, 14, 24, 0.52);
	border: 1px solid rgba(255, 255, 255, 0.12);
	overflow: visible;
	max-width: 100%;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cl-story-reply-composer__body:focus-within {
	border-color: rgba(255, 255, 255, 0.14);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--cl-primary-color, #8b8cf8) 35%, transparent);
}

.cl-story-reply-composer__body--idle {
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: none;
}

.cl-story-reply-composer__body--idle .cl-story-reply-input-shell {
	opacity: 0.78;
	transition: opacity 0.2s ease;
}

.cl-story-reply-composer__body--idle .cl-story-viewer__reply-input::placeholder {
	color: rgba(255, 255, 255, 0.28);
}

.cl-story-reply-composer__body--idle:focus-within {
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: none;
}

.cl-story-reply-composer__bar {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
	padding: 4px 6px 6px 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	position: relative;
}

.cl-story-reply-composer__bar-start {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	position: relative;
	z-index: 2;
}

/* Template order is toolbar → pops → media row; stack column and pull previews above the tools */
.cl-story-viewer .cl-story-reply-composer__bar-start {
	flex-direction: column;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 6px;
}

.cl-story-viewer .cl-story-reply-composer__bar-start .cl-cc-media-row {
	order: -1;
	width: 100%;
}

.cl-story-viewer .cl-story-reply-composer__bar-start .cl-cc-toolbar {
	flex-shrink: 0;
}

/* Emoji / GIF: full-area bottom-sheet modals (fixed to story reply sheet; WebView-safe) */
.cl-story-viewer .cl-story-reply-composer__bar-start > .cl-cc-pop {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	width: 100%;
	max-width: 100%;
	height: 100%;
	min-height: 100%;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	overflow: hidden;
	z-index: 400;
	display: none;
	flex-direction: column;
	justify-content: flex-end;
	align-items: stretch;
}

.cl-story-viewer .cl-story-reply-composer__bar-start > .cl-cc-pop:not(.d-none) {
	display: flex !important;
}

.cl-story-viewer .cl-story-reply-composer__bar-start > .cl-cc-pop::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.52);
	z-index: 0;
}

/* Bottom sheet card layout */
.cl-story-viewer .cl-story-reply-composer__bar-start > .cl-cc-pop--emoji > .cl-cc-emoji-panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: min(300px, 54vh, 54dvh);
	overflow: hidden;
	box-sizing: border-box;
}

.cl-story-viewer .cl-cc-pop--emoji:not(.d-none) > .cl-cc-emoji-panel {
	margin: 0;
	padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
	border-radius: 20px 20px 0 0;
	background: rgba(10, 16, 28, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-bottom: none;
	box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

.cl-story-viewer .cl-cc-pop--emoji:not(.d-none) .cl-cc-emoji-head {
	margin: 0 0 10px;
	padding: 0;
	flex-shrink: 0;
}

.cl-story-viewer .cl-cc-pop--emoji:not(.d-none) .cl-cc-emoji-head__title {
	font-size: 15px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.92);
}

.cl-story-viewer .cl-cc-pop--emoji:not(.d-none) .cl-cc-emoji-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-y;
	overscroll-behavior: contain;
}

.cl-story-viewer .cl-story-reply-composer__bar-start > .cl-cc-pop--gif > .cl-cc-gif-panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: min(360px, 72vh, 72dvh);
	box-sizing: border-box;
}

.cl-story-viewer .cl-cc-pop--gif:not(.d-none) > .cl-cc-gif-panel {
	margin: 0;
	padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
	border-radius: 20px 20px 0 0;
	background: rgba(10, 16, 28, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-bottom: none;
	box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cl-story-viewer .cl-cc-pop--gif:not(.d-none) .cl-cc-gif-topbar {
	margin: 0 0 10px;
	padding: 0;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
	background: transparent;
}

.cl-story-viewer .cl-cc-pop--gif:not(.d-none) .cl-cc-gif-topbar__title {
	font-size: 15px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.92);
}

.cl-story-viewer .cl-cc-pop--gif:not(.d-none) .cl-cc-gif-head {
	margin: 0 0 10px;
	padding: 0;
	flex-shrink: 0;
	background: transparent;
	border: none;
}

/* Pane must shrink inside max-height panel or .cl-cc-gif-scroll never gets a scrollport.
   Exclude .d-none — body .d-none has no !important, so a bare .cl-cc-gif-pane { display:flex }
   would override Bootstrap-style hiding and show both GIF + My images panes at once. */
.cl-story-viewer .cl-cc-pop--gif:not(.d-none) .cl-cc-gif-pane:not(.d-none) {
	display: flex;
	flex-direction: column;
	flex: 1 1 0%;
	min-height: 0;
	overflow: hidden;
}

/* Scroll on wrapper — grid keeps default tile math (same idea as .cl-cc-emoji-scroll) */
.cl-story-viewer .cl-cc-pop--gif:not(.d-none) .cl-cc-gif-scroll {
	min-height: 0;
	flex: 1 1 auto;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.cl-story-reply-composer__bar-end {
	display: flex !important;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	flex-shrink: 0;
	position: relative;
	z-index: 3;
	visibility: visible;
	opacity: 1;
}

#cl-story-viewer .cl-story-viewer__reply-btn,
.cl-reel-comments-modal .cl-story-viewer__reply-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	visibility: visible;
	opacity: 1;
}

.cl-story-reply-limit-ring {
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.45);
}

.cl-story-reply-limit-ring__svg {
	width: 22px;
	height: 22px;
	display: block;
	transform: rotate(-90deg);
}

.cl-story-reply-limit-ring__bg {
	fill: none;
	stroke: rgba(255, 255, 255, 0.18);
	stroke-width: 2;
}

.cl-story-reply-limit-ring__fg {
	fill: none;
	stroke: rgba(255, 255, 255, 0.72);
	stroke-width: 2;
	stroke-linecap: round;
	transition: stroke 0.15s ease, stroke-dashoffset 0.15s ease;
}

.cl-story-reply-limit-ring.is-near .cl-story-reply-limit-ring__fg {
	stroke: #fbbf24;
}

.cl-story-reply-limit-ring.is-full .cl-story-reply-limit-ring__fg {
	stroke: #f87171;
}

.cl-story-reply-composer .cl-cc-toolbar,
.cl-reel-comment-composer--story .cl-cc-toolbar {
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
}

.cl-story-reply-composer .cl-cc-toolbar__inner,
.cl-reel-comment-composer--story .cl-cc-toolbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
}

.cl-story-reply-composer .cl-cc-tool,
.cl-reel-comment-composer--story .cl-cc-tool {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.55);
	transition: color 0.15s ease, background 0.15s ease;
}

.cl-story-reply-composer .cl-cc-tool:hover,
.cl-reel-comment-composer--story .cl-cc-tool:hover {
	color: rgba(255, 255, 255, 0.95);
	background: rgba(255, 255, 255, 0.07);
}

.cl-story-reply-video-btn {
	color: rgba(255, 255, 255, 0.55);
}

.cl-story-reply-video-btn:focus-visible {
	outline: 2px solid var(--cl-primary-color, #60a5fa);
	outline-offset: 2px;
}

.cl-story-viewer__reply-btn {
	min-height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: opacity 0.15s ease, transform 0.12s ease;
}

.cl-story-viewer__reply-btn:active {
	transform: scale(0.97);
}

.cl-story-viewer__reply-btn--ghost {
	background: transparent;
	color: rgba(255, 255, 255, 0.45);
}

.cl-story-viewer__reply-btn--ghost:hover {
	color: rgba(255, 255, 255, 0.85);
}

.cl-story-viewer__reply-btn--send {
	background: var(--cl-primary-color, #6366f1);
	color: #fff;
	padding: 0 20px;
	box-shadow: none;
}

.cl-story-viewer__reply-btn--send:hover {
	filter: brightness(1.08);
}

.cl-story-viewer .cl-cc-submit {
	display: none !important;
}

.cl-story-viewer .cl-cc-gif-done,
.cl-story-viewer .cl-cc-emoji-done {
	background: rgba(3, 9, 20, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.86);
}

.cl-story-viewer .cl-cc-gif-done:hover,
.cl-story-viewer .cl-cc-emoji-done:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.cl-story-viewer .cl-cc-emoji-cell {
	background: rgba(3, 9, 20, 0.9);
}

.cl-story-viewer .cl-cc-emoji-cell:hover {
	transform: scale(1.08);
	background: rgba(255, 255, 255, 0.1);
}

.cl-story-viewer__reply-context {
	margin: 0 0 8px;
}

.cl-story-viewer__reply-context-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.82);
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.cl-story-viewer__reply-context-text {
	flex: 1;
	min-width: 0;
	line-height: 1.35;
}

.cl-story-viewer__reply-context-line--title {
	font-weight: 600;
	color: rgba(255, 255, 255, 0.9);
}

.cl-story-viewer__reply-context-line--sub {
	margin-top: 2px;
	font-size: 11px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.58);
}

.cl-story-viewer__reply-context-dismiss {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cl-story-viewer__reply-context-dismiss svg {
	width: 14px;
	height: 14px;
	display: block;
}

.cl-story-viewer__reply-context-dismiss svg path {
	fill: currentColor !important;
	stroke: currentColor !important;
}

.cl-story-viewer__reply-context-dismiss:hover {
	background: rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.96);
	border-color: rgba(255, 255, 255, 0.2);
}

/* Story comment — custom delete confirmation */
.cl-story-delete-confirm {
	position: absolute;
	inset: 0;
	z-index: 120;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	box-sizing: border-box;
}

.cl-story-delete-confirm.is-open {
	display: flex;
}

.cl-story-delete-confirm__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 4, 10, 0.72);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.cl-story-delete-confirm__card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 300px;
	padding: 22px 20px 18px;
	border-radius: 18px;
	text-align: center;
	background:
		linear-gradient(155deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(8, 12, 22, 0.92) 100%),
		rgba(6, 10, 18, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
	backdrop-filter: saturate(150%) blur(18px);
	-webkit-backdrop-filter: saturate(150%) blur(18px);
	animation: cl-story-delete-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cl-story-delete-pop {
	from {
		opacity: 0;
		transform: scale(0.94) translateY(8px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.cl-story-delete-confirm__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: rgba(248, 113, 113, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.28);
	color: rgba(254, 202, 202, 0.95);
}

.cl-story-delete-confirm__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: rgba(255, 255, 255, 0.96);
	line-height: 1.25;
}

.cl-story-delete-confirm__text {
	margin: 0 0 20px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.55);
}

.cl-story-delete-confirm__actions {
	display: flex;
	gap: 10px;
	justify-content: stretch;
}

.cl-story-delete-confirm__btn {
	flex: 1 1 0;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	border: none;
	transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.cl-story-delete-confirm__btn:active {
	transform: scale(0.98);
}

.cl-story-delete-confirm__btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.cl-story-delete-confirm__btn--ghost {
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.cl-story-delete-confirm__btn--ghost:hover {
	background: rgba(255, 255, 255, 0.1);
}

.cl-story-delete-confirm__btn--danger {
	background: linear-gradient(165deg, rgba(248, 113, 113, 0.95), rgba(220, 38, 38, 0.92));
	color: #fff;
	border: 1px solid rgba(254, 202, 202, 0.35);
	box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.cl-story-delete-confirm__btn--danger:hover {
	filter: brightness(1.06);
}

.cl-story-comment__on-story-hint {
	margin: 2px 0 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.42);
}

/* Comments — airy, no heavy dividers */
.cl-story-comment {
	margin: 0;
	padding: 6px 0;
	border-bottom: none;
}

.cl-story-comment + .cl-story-comment {
	border-top: none;
}

.cl-story-comment:last-child {
	padding-bottom: 4px;
}

.cl-story-comment--nested {
	margin-left: 12px;
	margin-top: 6px;
	padding: 0;
	border-top: none !important;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 0;
}

.cl-story-comment__inner {
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.015);
	border: 1px solid rgba(255, 255, 255, 0.05);
	box-shadow: none;
	overflow: hidden;
}

.cl-story-comment__head {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	margin-bottom: 4px;
}

.cl-story-comment__menu-wrap {
	margin-left: auto;
	position: relative;
	flex-shrink: 0;
}

.cl-story-comment__more {
	width: 26px;
	height: 26px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
	color: rgba(255, 255, 255, 0.62);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cl-story-comment__more:hover {
	background: rgba(255, 255, 255, 0.09);
	color: rgba(255, 255, 255, 0.9);
	border-color: rgba(255, 255, 255, 0.2);
}

.cl-story-comment__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	min-width: 92px;
	padding: 4px;
	border-radius: 10px;
	background: rgba(8, 12, 20, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
	z-index: 4;
}

.cl-story-comment__menu-delete {
	width: 100%;
	min-height: 30px;
	padding: 0 10px;
	text-align: left;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: rgba(248, 113, 113, 0.92);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.cl-story-comment__menu-delete:hover {
	background: rgba(248, 113, 113, 0.14);
	color: rgba(254, 202, 202, 1);
}

.cl-story-comment .cl-story-viewer__views-user img {
	width: 32px;
	height: 32px;
	border: none;
}

.cl-story-comment .cl-avatar-framed--story-chip {
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
}

.cl-story-comment .cl-avatar-framed--story-chip .cl-avatar-framed__photo img {
	width: 32px;
	height: 32px;
	border: none;
}

.cl-story-comment .cl-avatar-framed--story-chip .cl-avatar-framed__frame img {
	border: none;
	border-radius: 0;
}

.cl-story-comment__meta {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
	flex: 1;
}

.cl-story-comment__meta .cl-story-viewer__views-user-name {
	font-size: 13px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.92);
}

.cl-story-comment__owner-badge {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	border: 1px solid rgba(144, 170, 255, 0.45);
	background: rgba(84, 115, 214, 0.2);
	color: rgba(226, 235, 255, 0.96);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cl-story-comment__time {
	font-size: 11px;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.38);
}

.cl-story-comment__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	border: none;
	flex-shrink: 0;
}

.cl-story-comment__media {
	margin-top: 10px;
	border-radius: 14px;
	overflow: hidden;
	border: none;
	background: rgba(0, 0, 0, 0.25);
}

.cl-story-comment__media-img,
.cl-story-comment__media-gif {
	max-width: 100%;
	max-height: 200px;
	display: block;
	vertical-align: middle;
}

.cl-story-comment__media-vid {
	max-width: 100%;
	max-height: 200px;
	display: block;
	background: #000;
}

.cl-story-comment__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 8px;
	margin-top: 6px;
	background: transparent;
}

.cl-story-comment__react {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 28px;
	padding: 0 6px;
	border-radius: 8px;
	border: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.52);
	font-size: 11px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.cl-story-comment__react:hover {
	color: rgba(255, 255, 255, 0.88);
	background: rgba(255, 255, 255, 0.035);
}

.cl-story-comment__react:disabled,
.cl-story-comment__react.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
	background: rgba(255, 255, 255, 0.03);
}

.cl-story-comment__react:disabled:hover,
.cl-story-comment__react.is-disabled:hover {
	color: rgba(255, 255, 255, 0.65);
	background: rgba(255, 255, 255, 0.03);
}

.cl-story-comment__react-ic {
	display: inline-flex;
	opacity: 0.75;
}

.cl-story-comment__react-svg {
	display: block;
	flex-shrink: 0;
}

.cl-story-comment__react-n {
	min-width: 1.15em;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, 0.62);
}

.cl-story-comment__react:hover .cl-story-comment__react-n {
	color: inherit;
}

.cl-story-comment__react.is-active.is-like {
	color: rgba(255, 255, 255, 0.95);
	background: rgba(52, 211, 153, 0.14);
}

.cl-story-comment__react.is-active.is-like .cl-story-comment__react-n {
	color: rgba(217, 249, 236, 0.98);
}

.cl-story-comment__react.is-active.is-dislike {
	color: rgba(255, 235, 235, 0.96);
	background: rgba(248, 113, 113, 0.12);
}

.cl-story-comment__reply {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.44);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 0 6px;
	min-height: 28px;
	margin: 0;
	border-radius: 8px;
	text-decoration: none;
	transition: color 0.15s ease, background 0.15s ease;
}

.cl-story-comment__reply:hover {
	color: rgba(255, 255, 255, 0.9);
	background: rgba(255, 255, 255, 0.03);
}

.cl-story-comment__delete {
	background: transparent;
	border: none;
	color: rgba(248, 113, 113, 0.82);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 0 6px;
	min-height: 28px;
	margin: 0;
	border-radius: 8px;
	text-decoration: none;
	transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.cl-story-comment__delete:hover {
	color: rgba(254, 202, 202, 0.98);
	background: rgba(248, 113, 113, 0.1);
}

.cl-story-comment__delete:disabled {
	opacity: 0.5;
	cursor: wait;
}

/*
 * Home Discover/Following: keep in normal document order (below stories).
 * Global mobile rule uses position:fixed — override to sticky so the bar isn’t ripped out of flow.
 * Visibility is still driven by .is-sticky-to-header (near top or scrolling up) in master.script.js.
 */
body.cl-app-home .timeline-container[data-app="homepage"]:not(.no-affix) .timeline-header__tabs {
	position: -webkit-sticky !important;
	position: sticky !important;
	top: 60px !important;
	left: auto !important;
	right: auto !important;
	width: 100% !important;
	max-width: 100% !important;
}

@keyframes cl-story-viewer-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes cl-story-backdrop-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes cl-story-shell-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.986);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes cl-story-media-in {
	from {
		opacity: 0;
		transform: translate3d(0, 3px, 0) scale(0.998);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
}

@keyframes cl-story-caption-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cl-stories-rail__cell,
	.cl-stories-rail__new-thumb,
	.cl-stories-rail__new-thumb-fg,
	.cl-stories-rail__thumb-wrap,
	.cl-stories-rail__thumb,
	.cl-story-viewer,
	.cl-story-viewer__backdrop,
	.cl-story-viewer__shell,
	.cl-story-viewer__media img,
	.cl-story-viewer__media video,
	.cl-story-viewer__views-panel,
	.cl-story-viewer__reply-sheet {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 1199.98px) {
	body.cl-app-home .timeline-container[data-app="homepage"]:not(.no-affix) .timeline-header__tabs.is-sticky-to-header + .tab-content,
	body.cl-app-home .timeline-container[data-app="homepage"]:not(.no-affix) .timeline-header__tabs + .tab-content {
		padding-top: 0 !important;
	}
}

.cl-story-viewer .cl-cc-gif-tabbar {
	margin-bottom: 10px;
}
.cl-story-viewer .cl-cc-gif-tab {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.72);
}
.cl-story-viewer .cl-cc-gif-tab.is-active {
	background: rgba(255, 255, 255, 0.16);
	color: rgba(255, 255, 255, 0.95);
}
.cl-story-viewer .cl-cc-myimg-upload {
	border-color: rgba(255, 255, 255, 0.2);
	color: rgba(255, 255, 255, 0.9);
}

.cl-story-viewer .cl-story-comment__menu-save {
	color: rgba(255, 255, 255, 0.95);
}
.cl-story-viewer .cl-story-comment__menu-save.is-saved,
.cl-story-viewer .cl-story-comment__menu-save:disabled {
	color: rgba(255, 255, 255, 0.55);
}
.cl-story-viewer .cl-story-comment__menu-delete {
	color: rgba(255, 200, 200, 0.95);
}
.cl-story-viewer .cl-cc-library-tile.is-selected {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}
.cl-story-viewer .cl-cc-library-saved-badge {
	background: rgba(0, 0, 0, 0.62);
	color: rgba(255, 255, 255, 0.96);
}

/* Story viewer ultra-lite mode: disable expensive blur layers while open. */
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__backdrop,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__icon-btn,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__user-nav-btn,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__caption,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__footer-row,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__end-state-card,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__views-panel,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__reply-sheet-inner,
body.cl-story-viewer-open #cl-story-viewer .cl-story-delete-confirm__backdrop,
body.cl-story-viewer-open #cl-story-viewer .cl-story-delete-confirm__card {
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
}

body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__stage-fill,
body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__bg-img {
	display: block !important;
}

body.cl-story-viewer-open #cl-story-viewer .cl-story-viewer__bg-img {
	filter: blur(14px) brightness(0.85) !important;
}

/* Pinned story upload progress (all pages with stories bundle) */
.cl-story-upload-dock {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 750;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
}

@media (max-width: 1199px) {
	body:not(.cl-app-conversation) .cl-story-upload-dock {
		bottom: calc(62px + env(safe-area-inset-bottom, 0px));
	}
}

.cl-story-upload-dock.is-visible {
	pointer-events: auto;
}

.cl-story-upload-dock__inner {
	display: flex;
	flex-direction: column;
	max-width: 560px;
	margin: 0 auto;
	background: var(--cl-primary-bg-color, #fff);
	border: 1px solid var(--cl-primary-border-color, rgba(0, 0, 0, 0.08));
	border-radius: 12px;
	box-shadow: 0 -10px 40px color-mix(in srgb, #000 16%, transparent);
	overflow: hidden;
}

/* Windows-style title bar */
.cl-story-upload-dock__chrome {
	display: flex;
	flex-direction: column;
	background: color-mix(in srgb, var(--cl-secondary-bg-color, #f3f4f6) 88%, var(--cl-primary-bg-color, #fff));
	border-bottom: 1px solid var(--cl-primary-border-color, rgba(0, 0, 0, 0.08));
}

.cl-story-upload-dock__chrome-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 36px;
	padding: 0 4px 0 12px;
}

.cl-story-upload-dock__chrome-title {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 8px 0;
	border: none;
	background: transparent;
	display: flex;
	align-items: center;
	gap: 6px;
	text-align: left;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.25;
	color: var(--cl-primary-text-color, #111);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.cl-story-upload-dock__chrome-title-text {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cl-story-upload-dock__chrome-pct {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--cl-primary-color, #4361ee);
}

.cl-story-upload-dock__chrome-progress {
	display: none;
	padding: 0 12px 8px;
}

.cl-story-upload-dock.is-collapsed .cl-story-upload-dock__chrome-progress {
	display: block;
}

.cl-story-upload-dock.is-collapsed .cl-story-upload-dock__chrome-top {
	padding-bottom: 2px;
}

.cl-story-upload-dock__chrome-track {
	display: block;
	height: 4px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--cl-primary-color, #4361ee) 18%, var(--cl-primary-border-color, rgba(0, 0, 0, 0.08)));
	overflow: hidden;
}

.cl-story-upload-dock__chrome-bar {
	display: block;
	height: 100%;
	width: 100%;
	border-radius: inherit;
	background: var(--cl-primary-color, #4361ee);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.12s linear;
	will-change: transform;
}

.cl-story-upload-dock__chrome-title:hover,
.cl-story-upload-dock__chrome-title:focus-visible {
	color: var(--cl-primary-link-color, #0d6efd);
	outline: none;
}

.cl-story-upload-dock__chrome-actions {
	display: flex;
	align-items: stretch;
	flex-shrink: 0;
}

.cl-story-upload-dock__win-btn {
	width: 40px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--cl-secondary-text-color, #6b7280);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.12s ease, color 0.12s ease;
}

.cl-story-upload-dock__win-btn span {
	display: block;
	pointer-events: none;
}

.cl-story-upload-dock__win-btn--minimize span {
	width: 10px;
	height: 1.5px;
	border-radius: 1px;
	background: currentColor;
}

.cl-story-upload-dock__win-btn--close span {
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
}

.cl-story-upload-dock__win-btn:hover,
.cl-story-upload-dock__win-btn:focus-visible {
	outline: none;
}

.cl-story-upload-dock__win-btn--minimize:hover,
.cl-story-upload-dock__win-btn--minimize:focus-visible {
	background: color-mix(in srgb, var(--cl-primary-text-color, #111) 8%, transparent);
	color: var(--cl-primary-text-color, #111);
}

.cl-story-upload-dock__win-btn--close:hover,
.cl-story-upload-dock__win-btn--close:focus-visible {
	background: #e81123;
	color: #fff;
}

.cl-story-upload-dock__body {
	display: block;
}

.cl-story-upload-dock.is-collapsed .cl-story-upload-dock__body {
	display: none;
}

.cl-story-upload-dock.is-collapsed {
	box-shadow: 0 -4px 20px color-mix(in srgb, #000 10%, transparent);
}

.cl-story-upload-dock__main {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	padding: 12px 14px 14px;
	border: none;
	background: transparent;
	text-align: left;
	cursor: pointer;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

.cl-story-upload-dock__main:hover,
.cl-story-upload-dock__main:focus-visible {
	background: color-mix(in srgb, var(--cl-primary-text-color, #111) 4%, transparent);
	outline: none;
}

.cl-story-upload-dock__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.cl-story-upload-dock__title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--cl-primary-text-color, #111);
}

.cl-story-upload-dock__pct {
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--cl-primary-color, #4361ee);
	flex-shrink: 0;
}

.cl-story-upload-dock__track {
	display: block;
	height: 6px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--cl-primary-color, #4361ee) 18%, var(--cl-primary-border-color, rgba(0, 0, 0, 0.08)));
	overflow: hidden;
}

.cl-story-upload-dock__bar {
	display: block;
	height: 100%;
	width: 100%;
	border-radius: inherit;
	background: var(--cl-primary-color, #4361ee);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.12s linear;
	will-change: transform;
}

.cl-story-upload-dock__note {
	font-size: 12px;
	line-height: 1.35;
	color: color-mix(in srgb, var(--cl-primary-text-color, #111) 62%, transparent);
}

body.cl-story-upload-active {
	padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

body.cl-story-upload-active:has(.cl-story-upload-dock.is-collapsed) {
	padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 1199px) {
	body.cl-story-upload-active:not(.cl-app-conversation) {
		padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
	}

	body.cl-story-upload-active:not(.cl-app-conversation):has(.cl-story-upload-dock.is-collapsed) {
		padding-bottom: calc(114px + env(safe-area-inset-bottom, 0px));
	}
}

/* Composer window controls (minimize / close while uploading) */
.cl-story-composer__window-controls {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 2px;
	margin: -4px -6px -4px 0;
}

.cl-story-composer.has-upload-window-chrome .cl-story-composer__header.modal-header {
	align-items: flex-start;
}

.cl-story-composer__win-btn {
	width: 36px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--cl-secondary-text-color);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.12s ease, color 0.12s ease;
}

.cl-story-composer__win-btn--minimize span {
	display: block;
	width: 10px;
	height: 1.5px;
	border-radius: 1px;
	background: currentColor;
}

.cl-story-composer__win-btn--minimize:hover,
.cl-story-composer__win-btn--minimize:focus-visible {
	background: color-mix(in srgb, var(--cl-primary-text-color) 8%, transparent);
	color: var(--cl-primary-text-color);
	outline: none;
}

.cl-story-composer__win-btn--close.close {
	float: none;
	width: 36px;
	height: 32px;
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
	opacity: 1;
	border-radius: 6px;
}

.cl-story-composer__win-btn--close.close:hover,
.cl-story-composer__win-btn--close.close:focus {
	background: #e81123;
	color: #fff;
	opacity: 1;
	outline: none;
}

/* Stop upload confirmation — matches split / composer modals */
.cl-story-upload-cancel-modal {
	z-index: 1080 !important;
}

.cl-story-upload-cancel-modal .modal-dialog.cl-story-upload-cancel-modal__dialog {
	z-index: 1081;
	max-width: min(440px, calc(100vw - 24px));
}

body.cl-story-upload-cancel-open #cl-story-composer,
body.cl-story-upload-cancel-open .cl-story-upload-dock {
	z-index: 1050;
}

body.cl-story-upload-cancel-open .modal-backdrop.show:last-of-type {
	z-index: 1075 !important;
	background: color-mix(in srgb, #0a0c10 52%, transparent);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.cl-story-upload-cancel-modal .modal-content.cl-story-upload-cancel-modal__content {
	border-radius: 14px;
	border: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
	box-shadow: 0 14px 36px color-mix(in srgb, #000 14%, transparent);
	overflow: hidden;
}

.cl-story-upload-cancel-modal__header.modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 18px 12px;
	border-bottom: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
}

.cl-story-upload-cancel-modal__header-text {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
	flex: 1;
}

.cl-story-upload-cancel-modal__icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: color-mix(in srgb, #f59e0b 14%, var(--cl-secondary-bg-color));
	color: #d97706;
}

.cl-story-upload-cancel-modal__header .modal-title {
	margin: 4px 0 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.02em;
	color: var(--cl-primary-text-color);
}

.cl-story-upload-cancel-modal__header .close {
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	outline: 0;
	line-height: 1;
	font-size: 28px;
	font-weight: 400;
	color: var(--cl-secondary-text-color);
	opacity: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.cl-story-upload-cancel-modal__header .close:hover,
.cl-story-upload-cancel-modal__header .close:focus {
	color: var(--cl-primary-text-color);
	opacity: 1;
}

.cl-story-upload-cancel-modal__body.modal-body {
	padding: 14px 18px 18px;
	background: var(--cl-primary-bg-color);
}

.cl-story-upload-cancel-modal__lead {
	font-size: 15px;
	line-height: 1.45;
	color: var(--cl-primary-text-color);
}

.cl-story-upload-cancel-modal__hint {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--cl-secondary-text-color);
}

.cl-story-upload-cancel-modal__footer.modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px 18px 16px;
	border-top: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
}

.cl-story-upload-cancel-modal__btn-stop {
	color: #b42318;
	background: color-mix(in srgb, #dc3545 8%, var(--cl-primary-bg-color));
	border: 1px solid color-mix(in srgb, #dc3545 35%, var(--cl-primary-border-color));
	font-weight: 600;
}

.cl-story-upload-cancel-modal__btn-stop:hover,
.cl-story-upload-cancel-modal__btn-stop:focus {
	color: #fff;
	background: #dc3545;
	border-color: #dc3545;
}

.cl-story-upload-cancel-modal__btn-keep {
	color: #fff;
	background: var(--cl-primary-color);
	border-color: var(--cl-primary-color);
	font-weight: 600;
}

.cl-story-upload-cancel-modal__btn-keep:hover,
.cl-story-upload-cancel-modal__btn-keep:focus {
	filter: brightness(1.05);
	color: #fff;
}

#cl-reel-comments-modal .cl-story-viewer__reply-sheet-inner {
	height: 100%;
	max-height: none;
}

#cl-reel-comments-modal .cl-story-viewer__reply-input {
	color: rgba(255, 255, 255, 0.95);
}

#cl-reel-comments-modal .cl-story-viewer__reply-input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

.cl-reel-comments-modal .cl-story-reply-composer__bar-end {
	display: flex !important;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	position: relative;
	z-index: 3;
}

.cl-reel-comments-modal .cl-reel-comment-composer--story .cl-story-reply-composer__bar {
	flex-wrap: nowrap;
}

/* Reel mobile comments — share story reply composer rules (GIF pop stays in reel_viewer.css) */
.cl-reel-comments-modal .cl-story-reply-composer__bar-start {
	flex-direction: column;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 6px;
}

.cl-reel-comments-modal .cl-story-reply-composer__bar-start .cl-cc-media-row {
	order: -1;
	width: 100%;
}

.cl-reel-comments-modal .cl-reel-comment-composer--story .cl-cc-toolbar {
	flex-shrink: 0;
}

/* Reel mobile: keep Post in toolbar visible as fallback (Send/Cancel stay in bar-end) */
.cl-reel-comments-modal .cl-reel-comment-composer--story .cl-cc-submit {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}

.cl-reel-comments-modal .cl-cc-gif-done,
.cl-reel-comments-modal .cl-cc-emoji-done {
	background: rgba(3, 9, 20, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.86);
}

.cl-reel-comments-modal .cl-cc-gif-done:hover,
.cl-reel-comments-modal .cl-cc-emoji-done:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.cl-reel-comments-modal .cl-cc-emoji-cell {
	background: rgba(3, 9, 20, 0.9);
}

.cl-reel-comments-modal .cl-cc-emoji-cell:hover {
	transform: scale(1.08);
	background: rgba(255, 255, 255, 0.1);
}

.cl-reel-comments-modal .cl-cc-gif-tabbar {
	margin-bottom: 10px;
}

.cl-reel-comments-modal .cl-cc-gif-tab {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.72);
}

.cl-reel-comments-modal .cl-cc-gif-tab.is-active {
	background: rgba(255, 255, 255, 0.16);
	color: rgba(255, 255, 255, 0.95);
}

.cl-reel-comments-modal .cl-cc-myimg-upload {
	border-color: rgba(255, 255, 255, 0.2);
	color: rgba(255, 255, 255, 0.9);
}

.cl-reel-comments-modal .cl-cc-library-tile.is-selected {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}

.cl-reel-comments-modal .cl-cc-library-saved-badge {
	background: rgba(0, 0, 0, 0.62);
	color: rgba(255, 255, 255, 0.96);
}
