.storyfa-wrap,
.reelsfa-wrap {
	direction: rtl;
	font-family: inherit;
	box-sizing: border-box;
}

.storyfa-wrap *,
.reelsfa-wrap *,
.sfa-comments-sheet *,
.sfa-share-sheet *,
.sfa-stats-sheet * {
	box-sizing: border-box;
}

.storyfa-empty,
.reelsfa-empty {
	direction: rtl;
	padding: 28px;
	text-align: center;
	color: #9099a3;
	font-size: 14px;
	border: 1px dashed #d8dde3;
	border-radius: 14px;
}

.storyfa-viewer,
.reelsfa-viewer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 14, 0.92);
	backdrop-filter: blur(6px);
}

.storyfa-viewer[hidden],
.reelsfa-viewer[hidden] {
	display: none;
}

.storyfa-stage,
.reelsfa-stage {
	position: relative;
	height: min(88vh, 780px);
	aspect-ratio: 9 / 16;
	max-width: 92vw;
	perspective: 1400px;
}

@media (max-width: 720px) {
	.storyfa-stage,
	.reelsfa-stage {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
	}
}

.sfa-slide {
	position: absolute;
	inset: 0;
	border-radius: 18px;
	overflow: hidden;
	background: #000;
	opacity: 0;
	pointer-events: none;
	transform: translateX(0) scale(0.8) rotateY(0deg);
	transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.4s ease, filter 0.45s ease;
	filter: blur(0);
}

@media (max-width: 720px) {
	.sfa-slide {
		border-radius: 0;
	}
}

.sfa-slide.is-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 3;
	transform: translateX(0) scale(1) rotateY(0deg);
	filter: blur(0);
}

.sfa-slide.is-prev {
	opacity: 0.65;
	pointer-events: auto;
	z-index: 2;
	cursor: pointer;
	transform: translateX(40%) scale(0.82) rotateY(-16deg);
	filter: blur(5px);
}

.sfa-slide.is-next {
	opacity: 0.65;
	pointer-events: auto;
	z-index: 2;
	cursor: pointer;
	transform: translateX(-40%) scale(0.82) rotateY(16deg);
	filter: blur(5px);
}

.sfa-progressbar {
	position: absolute;
	top: 10px;
	right: 10px;
	left: 10px;
	z-index: 20;
	display: flex;
	gap: 4px;
}

.sfa-progress-seg {
	flex: 1;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.35);
	overflow: hidden;
	position: relative;
}

.sfa-progress-fill {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 0%;
	background: #fff;
	border-radius: 3px;
}

.sfa-story-item {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	font-family: var(--sfa-story-font);
}

.sfa-story-item .sfa-el-link,
.sfa-story-item .sfa-caption-text,
.sfa-story-item .sfa-user-name,
.sfa-story-item .sfa-time-ago,
.sfa-story-item .sfa-ig-username,
.sfa-story-item .sfa-ig-follow-btn {
	font-family: var(--sfa-story-font) !important;
}

.sfa-story-item.is-current {
	display: flex;
}

.sfa-topbar {
	position: absolute;
	top: 22px;
	right: 12px;
	left: 12px;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.sfa-user-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.sfa-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background-color: #444;
	background-size: cover;
	background-position: center;
	flex-shrink: 0;
	border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.sfa-user-text {
	display: flex;
	flex-direction: column;
	color: #fff;
	min-width: 0;
}

.sfa-user-name {
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.sfa-time-ago {
	font-size: 11px;
	opacity: 0.8;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.sfa-topbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.sfa-mute-btn,
.sfa-close-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.sfa-media-box {
	position: absolute;
	inset: 0;
	background: #111;
}

.sfa-media-box.is-letterboxed {
	background-color: #14161c;
	background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgZmlsbD0iIzE0MTYxYyIvPjxnIHN0cm9rZT0icmdiYSgyNTUsMjU1LDI1NSwwLjA3KSIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMwIiB5PSI0MCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjMwIiByeD0iNiIvPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTUiIHI9IjkiLz48cmVjdCB4PSIxMjgiIHk9IjM4IiB3aWR0aD0iNDQiIGhlaWdodD0iMzAiIHJ4PSIxMCIvPjxwb2x5Z29uIHBvaW50cz0iMTQwLDY4IDEzNCw4MCAxNDgsNzAiLz48Y2lyY2xlIGN4PSI1MCIgY3k9IjE1MCIgcj0iNiIvPjxsaW5lIHgxPSI1MCIgeTE9IjEzMCIgeDI9IjUwIiB5Mj0iMTM4Ii8+PGxpbmUgeDE9IjUwIiB5MT0iMTYyIiB4Mj0iNTAiIHkyPSIxNzAiLz48bGluZSB4MT0iMzAiIHkxPSIxNTAiIHgyPSIzOCIgeTI9IjE1MCIvPjxsaW5lIHgxPSI2MiIgeTE9IjE1MCIgeDI9IjcwIiB5Mj0iMTUwIi8+PGxpbmUgeDE9IjM2IiB5MT0iMTM2IiB4Mj0iNDEiIHkyPSIxNDEiLz48bGluZSB4MT0iNTkiIHkxPSIxNTkiIHgyPSI2NCIgeTI9IjE2NCIvPjxsaW5lIHgxPSI2NCIgeTE9IjEzNiIgeDI9IjU5IiB5Mj0iMTQxIi8+PGxpbmUgeDE9IjQxIiB5MT0iMTU5IiB4Mj0iMzYiIHkyPSIxNjQiLz48Y2lyY2xlIGN4PSIxNTAiIGN5PSIxNTAiIHI9IjE0Ii8+PHBvbHlnb24gcG9pbnRzPSIxNDUsMTQzIDE0NSwxNTcgMTYwLDE1MCIvPjwvZz48L3N2Zz4=");
	background-size: 200px 200px;
	background-repeat: repeat;
}

.sfa-media-box.is-letterboxed .sfa-media-el {
	object-fit: contain;
	border: 2px solid rgba(255, 255, 255, 0.85);
}

.sfa-media-embed {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sfa-media-embed iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.sfa-media-el {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sfa-elements-layer {
	position: absolute;
	inset: 0;
	z-index: 17;
	pointer-events: none;
}

.sfa-elements-layer .sfa-el-link {
	pointer-events: auto;
}

.sfa-el {
	position: absolute;
	transform: translate(-50%, -50%);
	max-width: 82%;
	word-wrap: break-word;
	white-space: pre-wrap;
	line-height: 1.5;
}

.sfa-el-text {
	padding: 6px 12px;
	border-radius: 8px;
}

.sfa-el-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	color: #111 !important;
	font-size: 13px;
	font-weight: 700;
	padding: 9px 16px;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	white-space: nowrap;
}

.sfa-el-link-arrow {
	font-size: 14px;
}

.sfa-el-emoji {
	line-height: 1;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.sfa-ig-follow {
	position: absolute;
	top: 68px;
	right: 14px;
	z-index: 18;
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(0, 0, 0, 0.32);
	padding: 5px 6px 5px 14px;
	border-radius: 999px;
}

.sfa-ig-username {
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
}

.sfa-ig-follow-btn {
	color: #fff !important;
	border: 1.4px solid #fff;
	border-radius: 999px;
	padding: 4px 14px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	background: transparent;
}

.sfa-side-icons {
	position: absolute;
	right: 12px;
	bottom: 110px;
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}

.sfa-side-icons button {
	background: none;
	border: none;
	color: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	padding: 0;
}

.sfa-side-icons svg {
	width: 27px;
	height: 27px;
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

.sfa-icon-count {
	font-size: 11px;
	font-weight: 600;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.sfa-like-btn.is-liked svg {
	fill: #ff3b5c;
	stroke: #ff3b5c;
}

.sfa-like-btn.sfa-pop svg {
	animation: sfa-like-pop 0.35s ease;
}

@keyframes sfa-like-pop {
	0% { transform: scale(1); }
	35% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

.sfa-caption-shadow {
	position: absolute;
	right: 0;
	left: 0;
	bottom: 0;
	z-index: 19;
	padding: 46px 64px 16px 16px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
	cursor: pointer;
}

.sfa-caption-text {
	margin: 0;
	color: #fff;
	font-size: 13px;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sfa-caption-shadow.is-expanded {
	bottom: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0));
	padding-top: 80px;
}

.sfa-caption-shadow.is-expanded .sfa-caption-text {
	-webkit-line-clamp: unset;
	max-height: 34vh;
	overflow-y: auto;
}

.sfa-tap-zone {
	position: absolute;
	top: 64px;
	bottom: 96px;
	width: 34%;
	z-index: 16;
}

.sfa-tap-right {
	right: 0;
}

.sfa-tap-left {
	left: 0;
}

.sfa-comments-sheet,
.sfa-share-sheet,
.sfa-stats-sheet {
	position: fixed;
	inset: 0;
	z-index: 100000;
	direction: rtl;
}

.sfa-comments-sheet[hidden],
.sfa-share-sheet[hidden],
.sfa-stats-sheet[hidden] {
	display: none;
}

.sfa-sheet-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.sfa-sheet-panel {
	position: absolute;
	right: 0;
	left: 0;
	bottom: 0;
	max-width: 460px;
	margin: 0 auto;
	background: #fff;
	border-radius: 20px 20px 0 0;
	max-height: 72vh;
	display: flex;
	flex-direction: column;
	transform: translateY(100%);
	transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.sfa-comments-sheet.is-open .sfa-sheet-panel,
.sfa-share-sheet.is-open .sfa-sheet-panel,
.sfa-stats-sheet.is-open .sfa-sheet-panel {
	transform: translateY(0);
}

.sfa-sheet-handle {
	width: 40px;
	height: 4px;
	border-radius: 4px;
	background: #ddd;
	margin: 10px auto 4px;
}

.sfa-sheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px 14px;
	font-weight: 700;
	font-size: 14.5px;
	border-bottom: 1px solid #f0f0f2;
	color: #1c1c1e;
}

.sfa-sheet-header button {
	background: none;
	border: none;
	font-size: 15px;
	cursor: pointer;
	color: #888;
}

.sfa-sheet-list {
	flex: 1;
	overflow-y: auto;
	padding: 10px 16px;
}

.sfa-comment-row {
	display: flex;
	gap: 10px;
	padding: 10px 0;
}

.sfa-comment-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #eee;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	color: #999;
}

.sfa-comment-body {
	flex: 1;
	min-width: 0;
}

.sfa-comment-name {
	font-size: 12.5px;
	font-weight: 700;
	color: #1c1c1e;
}

.sfa-comment-text {
	font-size: 13px;
	color: #1c1c1e;
	line-height: 1.6;
	margin: 2px 0 4px;
	word-wrap: break-word;
}

.sfa-comment-meta {
	display: flex;
	gap: 14px;
	font-size: 11px;
	color: #999;
}

.sfa-comment-meta button {
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	font-size: 11px;
	padding: 0;
}

.sfa-comment-like-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.sfa-comment-like-btn svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.sfa-comment-meta.is-liked .sfa-comment-like-btn {
	color: #ed4956;
}

.sfa-comment-meta.is-liked .sfa-comment-like-btn svg {
	fill: #ed4956;
	stroke: #ed4956;
}

.sfa-comment-like {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sfa-comment-like button {
	display: flex;
	align-items: center;
	gap: 3px;
}

.sfa-comment-like svg {
	width: 13px;
	height: 13px;
}

.sfa-comment-like.is-liked svg {
	fill: #ff3b5c;
	stroke: #ff3b5c;
}

.sfa-comment-replies {
	margin-top: 8px;
	margin-right: 42px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sfa-reply-form {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.sfa-reply-form input {
	flex: 1;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 6px 10px;
	font-size: 12.5px;
}

.sfa-sheet-empty {
	text-align: center;
	color: #9099a3;
	padding: 40px 10px;
	font-size: 13px;
}

.sfa-sheet-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid #f0f0f2;
}

.sfa-sheet-name {
	width: 100%;
	border: 1px solid #e5e5e7;
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 13px;
	direction: rtl;
	outline: none;
}

.sfa-sheet-name:focus {
	border-color: #c9c9cc;
}

.sfa-sheet-input {
	width: 100%;
	min-height: 56px;
	max-height: 130px;
	resize: none;
	border: 1px solid #e5e5e7;
	border-radius: 16px;
	padding: 10px 16px;
	font-size: 13px;
	font-family: inherit;
	direction: rtl;
	outline: none;
}

.sfa-sheet-input:focus {
	border-color: #c9c9cc;
}

.sfa-sheet-send {
	width: 100%;
	border: none;
	background: #0095f6;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	border-radius: 12px;
	padding: 11px;
	cursor: pointer;
}

.sfa-sheet-pending-note {
	text-align: center;
	color: #9099a3;
	font-size: 11.5px;
	padding: 6px 0 0;
}

.sfa-share-panel {
	max-height: unset;
	padding-bottom: 20px;
}

.sfa-share-options {
	display: flex;
	gap: 14px;
	padding: 18px 16px 10px;
	justify-content: center;
}

.sfa-share-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #1c1c1e;
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: none;
}

.sfa-share-emoji {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #f4f4f5;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}

.sfa-safe-zone {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 78px;
	height: 240px;
	background: repeating-linear-gradient(-45deg, rgba(255, 59, 92, 0.18), rgba(255, 59, 92, 0.18) 6px, transparent 6px, transparent 12px);
	border: 1px dashed rgba(255, 59, 92, 0.6);
	z-index: 30;
	pointer-events: none;
	display: none;
}

.sfa-stats-trigger {
	position: absolute;
	bottom: 128px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 19;
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(0, 0, 0, 0.4);
	border: none;
	color: #fff;
	font-size: 11.5px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 999px;
	cursor: pointer;
}

.sfa-stats-trigger svg {
	width: 14px;
	height: 14px;
}

.sfa-stats-panel {
	max-height: unset;
	padding-bottom: 24px;
}

.sfa-stats-body {
	padding: 6px 20px 4px;
}

.sfa-stats-loading {
	text-align: center;
	color: #9099a3;
	font-size: 13px;
	padding: 30px 10px;
}

.sfa-stats-donut-wrap {
	position: relative;
	width: 150px;
	height: 150px;
	margin: 6px auto 18px;
}

.sfa-stats-donut {
	width: 100%;
	height: 100%;
}

.sfa-stats-donut-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.sfa-stats-donut-center strong {
	font-size: 22px;
	color: #1c1c1e;
}

.sfa-stats-donut-center span {
	font-size: 11px;
	color: #9099a3;
}

.sfa-stats-legend {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 18px;
}

.sfa-stats-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #1c1c1e;
}

.sfa-stats-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.sfa-stats-dot-member {
	background: #e4405f;
}

.sfa-stats-dot-guest {
	background: #833ab4;
}

.sfa-stats-mini-row {
	display: flex;
	gap: 12px;
}

.sfa-stats-mini {
	flex: 1;
	background: #f6f7f9;
	border-radius: 14px;
	padding: 14px;
	text-align: center;
}

.sfa-stats-mini strong {
	display: block;
	font-size: 18px;
	color: #1c1c1e;
}

.sfa-stats-mini span {
	font-size: 11.5px;
	color: #9099a3;
}

@media (prefers-reduced-motion: reduce) {
	.sfa-slide,
	.sfa-sheet-panel,
	.sfa-progress-fill,
	.sfa-like-btn.sfa-pop svg {
		transition: none !important;
		animation: none !important;
	}
}
