/* ===========================================================
   Filmona Movie Assistant - Frontend (Premium Dark UI)
   =========================================================== */

#fma-widget {
	--fma-brand: #ff8a00;
	--fma-brand-2: #ffb347;
	--fma-accent: #12b76a;
	--fma-accent-2: #3ddc84;
	--fma-radius: 18px;
	--fma-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
	--fma-speed: 260ms;
	--fma-offset: 110px;

	position: fixed;
	bottom: calc(var(--fma-offset) + env(safe-area-inset-bottom, 0px));
	z-index: 999999;
	direction: rtl;
	font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
	font-size: 14px;
	color: #f2f2f5;
}

#fma-widget.fma-pos-left {
	left: 22px;
}
#fma-widget.fma-pos-right {
	right: 22px;
}

/* در حال پخش ویدیو/تمام‌صفحه یا روی انتخاب‌گر تنظیم‌شده - کاملاً از دید پنهان شود */
#fma-widget.fma-suppressed {
	display: none !important;
}

/* ---------- دکمه شناور (مینیمال، به‌شکل قرص با برچسب «چی ببینیم؟») ---------- */
#fma-launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	padding: 0 18px 0 8px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	cursor: pointer;
	background: rgba(20, 21, 32, 0.86);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	color: #f2f2f5;
	font-family: inherit;
	box-shadow: var(--fma-shadow);
	animation: fma-float 3.6s ease-in-out infinite;
	transition: padding var(--fma-speed) ease, transform var(--fma-speed) ease, gap var(--fma-speed) ease;
}

#fma-widget.fma-pos-right #fma-launcher {
	padding: 0 8px 0 18px;
}

#fma-launcher:hover {
	transform: scale(1.04);
	border-color: rgba(255, 255, 255, 0.22);
}

#fma-launcher.fma-hidden {
	display: none;
}

/* حالت جمع‌شده: فقط آیکون، بعد از اسکرول صفحه */
#fma-launcher.fma-collapsed {
	padding: 0;
	width: 48px;
	gap: 0;
}
#fma-launcher.fma-collapsed .fma-launcher-label {
	opacity: 0;
	width: 0;
	transform: translateX(6px);
}
#fma-widget.fma-pos-right #fma-launcher.fma-collapsed .fma-launcher-label {
	transform: translateX(-6px);
}

.fma-launcher-icon {
	position: relative;
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 60%),
		linear-gradient(135deg, var(--fma-brand), var(--fma-brand-2));
}

.fma-launcher-label {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	transition: opacity var(--fma-speed) ease, width var(--fma-speed) ease, transform var(--fma-speed) ease;
}

#fma-launcher.fma-collapsed .fma-launcher-icon::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid var(--fma-brand);
	opacity: 0.55;
	animation: fma-pulse-ring 2.4s ease-out infinite;
}

#fma-launcher .fma-unread {
	position: absolute;
	top: -2px;
	left: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #2ecc71;
	border: 2px solid #10121a;
	display: none;
	z-index: 1;
}
#fma-widget.fma-pos-right #fma-launcher .fma-unread {
	left: auto;
	right: -2px;
}

#fma-launcher.fma-has-unread .fma-unread {
	display: block;
}

@keyframes fma-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-6px);
	}
}

@keyframes fma-pulse-ring {
	0% {
		transform: scale(0.9);
		opacity: 0.6;
	}
	100% {
		transform: scale(1.45);
		opacity: 0;
	}
}

/* ---------- پنل گفتگو: حالت تمام‌صفحه (مثل یک اپ مستقل، نه یک ویجت کوچک) ---------- */
#fma-panel {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	background: radial-gradient(circle at 85% -5%, rgba(18, 183, 106, 0.16), transparent 42%),
		linear-gradient(165deg, #0a1712 0%, #0a120f 45%, #060b09 100%);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	flex-direction: column;
	overflow: hidden;
	animation: fma-panel-in var(--fma-speed) ease;
}

@keyframes fma-panel-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

#fma-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
	background: rgba(9, 16, 13, 0.75);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	color: #f2f2f5;
	flex-shrink: 0;
	z-index: 2;
}

#fma-header .fma-header-title {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, calc(-50% + env(safe-area-inset-top, 0px) / 2));
	display: flex;
	align-items: center;
	gap: 4px;
	font-weight: 700;
	font-size: 14px;
	white-space: nowrap;
}

.fma-header-title .fma-brand-word {
	color: var(--fma-brand);
	font-weight: 800;
}

#fma-close,
#fma-home {
	position: relative;
	z-index: 3;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #f2f2f5;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--fma-speed) ease;
	flex-shrink: 0;
}
#fma-close:hover,
#fma-home:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* ---------- صفحه‌ی خوش‌آمدگویی (Hero) - فقط پیش از شروع گفتگو ---------- */
.fma-hero {
	position: relative;
	padding: 12px 4px 14px;
}

.fma-hero-glow {
	position: absolute;
	top: -60px;
	right: -10%;
	left: -10%;
	height: 260px;
	background: radial-gradient(circle at 75% 25%, var(--fma-accent) 0%, transparent 60%),
		radial-gradient(circle at 15% 55%, var(--fma-accent-2) 0%, transparent 55%);
	opacity: 0.32;
	filter: blur(46px);
	pointer-events: none;
}

.fma-hero-avatar-wrap {
	position: relative;
	display: flex;
	justify-content: flex-start;
	margin-bottom: 20px;
}

.fma-hero-logo {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	animation: fma-float 4.4s ease-in-out infinite;
}

.fma-hero-logo-icon {
	display: flex;
	filter: drop-shadow(0 4px 14px rgba(255, 138, 0, 0.35));
}

.fma-hero-logo-text {
	font-size: 19px;
	font-weight: 800;
	color: var(--fma-brand);
	letter-spacing: 0.2px;
}

.fma-hero-spark {
	position: absolute;
	color: var(--fma-brand-2);
	font-size: 13px;
	animation: fma-twinkle 2.6s ease-in-out infinite;
}
.fma-hero-spark.s1 {
	top: -10px;
	right: -6px;
	animation-delay: 0.3s;
}
.fma-hero-spark.s2 {
	bottom: -8px;
	right: 26px;
	font-size: 9px;
	animation-delay: 0.9s;
}

@keyframes fma-twinkle {
	0%,
	100% {
		opacity: 0.25;
		transform: scale(0.75);
	}
	50% {
		opacity: 1;
		transform: scale(1.1);
	}
}

.fma-hero-greeting {
	position: relative;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.8;
	color: #fff;
	margin: 0 0 16px;
}

.fma-hero-subtitle {
	position: relative;
	font-size: 12.5px;
	color: #a3a3b8;
	margin: 0 0 10px;
}

.fma-starter-row {
	position: relative;
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 6px;
	scroll-snap-type: x proximity;
}
.fma-starter-row::-webkit-scrollbar {
	height: 4px;
}
.fma-starter-row::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.14);
	border-radius: 10px;
}

.fma-starter-card {
	scroll-snap-align: start;
	flex: 0 0 auto;
	max-width: 190px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 12.5px;
	line-height: 1.7;
	color: #e6e6f0;
	cursor: pointer;
	text-align: right;
	transition: transform var(--fma-speed) ease, border-color var(--fma-speed) ease, background var(--fma-speed) ease;
}
.fma-starter-card:hover {
	transform: translateY(-2px);
	border-color: var(--fma-accent);
	background: rgba(255, 255, 255, 0.08);
}

.fma-hero-secondary-title {
	position: relative;
	font-size: 12px;
	font-weight: 700;
	color: #9797ac;
	margin: 22px 0 10px;
}

/* ---------- تب‌های پیشنهاد صفحه اصلی ---------- */
#fma-suggest-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 14px 0;
	flex-shrink: 0;
}

.fma-suggest-tab {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #cfcfe0;
	font-size: 12px;
	padding: 6px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: all var(--fma-speed) ease;
}

.fma-suggest-tab.active {
	background: linear-gradient(135deg, var(--fma-accent), var(--fma-accent-2));
	color: #fff;
	border-color: transparent;
}

.fma-ask-panel {
	margin: 10px 14px 0;
	padding: 18px 16px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px dashed rgba(255, 255, 255, 0.2);
	border-radius: 14px;
	text-align: center;
}

.fma-ask-panel-icon {
	display: inline-flex;
	margin-bottom: 8px;
	animation: fma-twinkle 2.6s ease-in-out infinite;
}

.fma-ask-panel p {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.9;
	color: #d6d6e6;
}

/* ---------- بدنه گفتگو ---------- */
#fma-body {
	flex: 1;
	padding: 14px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}

#fma-body::-webkit-scrollbar {
	width: 6px;
}
#fma-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 10px;
}

.fma-msg {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 92%;
	animation: fma-msg-in var(--fma-speed) ease;
}

@keyframes fma-msg-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.fma-msg.fma-bot {
	align-self: flex-start;
}
.fma-msg.fma-user {
	align-self: flex-end;
}

.fma-bubble {
	padding: 10px 14px;
	border-radius: 14px;
	line-height: 1.7;
	word-wrap: break-word;
	font-size: 13px;
}

.fma-bot .fma-bubble {
	background: rgba(255, 255, 255, 0.07);
	color: #ececf5;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-bottom-left-radius: 4px;
}

.fma-user .fma-bubble {
	background: linear-gradient(135deg, var(--fma-accent), var(--fma-accent-2));
	color: #fff;
	border-bottom-right-radius: 4px;
}

.fma-bubble.fma-typing {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 13px 16px;
}
.fma-bubble.fma-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #bcbccb;
	display: inline-block;
	animation: fma-blink 1.2s infinite ease-in-out;
}
.fma-bubble.fma-typing span:nth-child(2) {
	animation-delay: 0.2s;
}
.fma-bubble.fma-typing span:nth-child(3) {
	animation-delay: 0.4s;
}
@keyframes fma-blink {
	0%,
	80%,
	100% {
		opacity: 0.25;
	}
	40% {
		opacity: 1;
	}
}

/* ---------- گرید/کاروسل کارت‌ها ---------- */
.fma-cards-row {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
	scroll-snap-type: x proximity;
}
.fma-cards-row::-webkit-scrollbar {
	height: 5px;
}
.fma-cards-row::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 10px;
}

.fma-cards-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.fma-card {
	scroll-snap-align: start;
	flex: 0 0 150px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	overflow: hidden;
	transition: transform var(--fma-speed) ease, box-shadow var(--fma-speed) ease, border-color var(--fma-speed) ease;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	display: block;
}

.fma-card:hover,
.fma-card.fma-active {
	transform: translateY(-4px);
	box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
	border-color: var(--fma-accent);
}

.fma-card-poster-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 2 / 3;
	background: #1c1d2b;
	overflow: hidden;
}

.fma-card-poster-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.4s ease;
}
.fma-card-poster-wrap img.fma-loaded {
	opacity: 1;
}

.fma-badge-row {
	position: absolute;
	top: 6px;
	right: 6px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-end;
}

.fma-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 6px;
	backdrop-filter: blur(4px);
}
.fma-badge-rating {
	background: rgba(255, 193, 7, 0.92);
	color: #26200a;
}
.fma-badge-hd {
	background: rgba(20, 20, 28, 0.75);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.25);
}
.fma-badge-dub {
	background: rgba(46, 204, 113, 0.92);
	color: #063d1e;
}
.fma-badge-sub {
	background: rgba(52, 152, 219, 0.92);
	color: #08263d;
}
.fma-badge-status {
	position: absolute;
	bottom: 6px;
	right: 6px;
	left: 6px;
	font-size: 10px;
	text-align: center;
	padding: 3px 4px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
}

.fma-card-info {
	padding: 8px 9px 10px;
}

.fma-card-title {
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	margin: 0 0 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fma-card-meta {
	font-size: 10.5px;
	color: #a6a6b8;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- کارت بزرگ نتیجه اصلی (تطابق دقیق) ---------- */
.fma-hero-poster {
	position: relative;
	width: 92px;
	flex-shrink: 0;
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 2 / 3;
	background: #1c1d2b;
	transition: width var(--fma-speed) ease;
}
.fma-hero-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.4s ease;
}
.fma-hero-poster img.fma-loaded {
	opacity: 1;
}

.fma-play-btn {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	border: 1.5px solid rgba(255, 255, 255, 0.7);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(2px);
}
.fma-play-btn:hover {
	background: var(--fma-accent);
	border-color: transparent;
}

.fma-trailer-frame {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
	object-fit: cover;
}

.fma-trailer-exit {
	position: absolute;
	top: 6px;
	left: 6px;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	font-size: 10.5px;
	padding: 4px 9px;
	border-radius: 999px;
	cursor: pointer;
}

.fma-hero-card {
	display: flex;
	gap: 12px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 12px;
	animation: fma-msg-in var(--fma-speed) ease;
}

.fma-hero-card.fma-trailer-active {
	flex-direction: column;
}
.fma-hero-card.fma-trailer-active .fma-hero-poster {
	width: 100%;
	aspect-ratio: 16 / 9;
}

.fma-hero-info {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	flex: 1;
}

.fma-hero-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.fma-hero-title {
	font-size: 14px;
	font-weight: 800;
	color: #fff;
	text-decoration: none;
}
.fma-hero-original {
	font-size: 11px;
	color: #9a9ab0;
	direction: ltr;
	text-align: right;
}

.fma-hero-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 2px 0;
}
.fma-chip {
	font-size: 10.5px;
	background: rgba(255, 255, 255, 0.08);
	color: #d6d6e4;
	padding: 3px 9px;
	border-radius: 999px;
}
.fma-chip.fma-chip-rating {
	background: rgba(255, 193, 7, 0.18);
	color: #ffcf3f;
}

.fma-hero-excerpt {
	font-size: 11.5px;
	color: #b7b7c8;
	line-height: 1.6;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fma-more-btn {
	align-self: flex-start;
	background: none;
	border: none;
	color: var(--fma-accent-2);
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
}

.fma-hero-actions {
	display: flex;
	gap: 6px;
	margin-top: 4px;
	flex-wrap: wrap;
}

.fma-icon-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.fma-icon-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #d6d6e6;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 13px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all var(--fma-speed) ease;
}
.fma-icon-btn:hover {
	border-color: var(--fma-accent);
}
.fma-icon-btn.fma-icon-active {
	background: var(--fma-accent);
	border-color: transparent;
	color: #fff;
}
.fma-icon-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.fma-icon-btn-text {
	width: auto;
	border-radius: 999px;
	padding: 0 13px;
	font-size: 11px;
	font-weight: 700;
}

.fma-feedback-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #c7c7da;
}
.fma-feedback-row .fma-icon-btn {
	width: 30px;
	height: 30px;
}

.fma-btn {
	font-size: 11.5px;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 999px;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: transform var(--fma-speed) ease, opacity var(--fma-speed) ease;
}
.fma-btn:hover {
	transform: translateY(-1px);
}
.fma-btn-primary {
	background: linear-gradient(135deg, var(--fma-accent), var(--fma-accent-2));
	color: #fff;
}
.fma-btn-ghost {
	background: rgba(255, 255, 255, 0.08);
	color: #eee;
	border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ---------- چیپ پیشنهاد ---------- */
.fma-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.fma-suggestion-chip {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #e6e6f0;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 11.5px;
	transition: all var(--fma-speed) ease;
}
.fma-suggestion-chip:hover,
.fma-suggestion-chip.fma-kbd-active {
	background: var(--fma-accent);
	border-color: transparent;
	color: #fff;
}

.fma-searchsite-link {
	font-size: 11.5px;
	color: var(--fma-accent-2);
	text-decoration: underline;
}

/* ---------- اسکلت لودینگ ---------- */
.fma-skeleton-row {
	display: flex;
	gap: 10px;
}
.fma-skeleton-card {
	flex: 0 0 100px;
	height: 150px;
	border-radius: 12px;
	background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 70%);
	background-size: 200% 100%;
	animation: fma-shimmer 1.3s infinite linear;
}
@keyframes fma-shimmer {
	from {
		background-position: 150% 0;
	}
	to {
		background-position: -50% 0;
	}
}

/* ---------- بخش عنوان داخل بدنه (مثلا «پرطرفدارترین‌ها») ---------- */
.fma-section-title {
	font-size: 12px;
	font-weight: 700;
	color: #d6d6e6;
	margin: 4px 0 -4px;
}

/* ---------- فوتر ورودی ---------- */
#fma-footer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
	background: rgba(255, 255, 255, 0.02);
}

#fma-active-filters {
	display: none;
	flex-wrap: wrap;
	gap: 6px;
}

.fma-active-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--fma-accent);
	color: #fff;
	font-size: 11.5px;
	padding: 4px 6px 4px 10px;
	border-radius: 999px;
}
.fma-active-filter-chip button {
	background: rgba(255, 255, 255, 0.12);
	border: none;
	color: #fff;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	font-size: 9px;
	cursor: pointer;
	line-height: 1;
}

#fma-input-row {
	display: flex;
	gap: 8px;
}

#fma-input {
	flex: 1;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #fff;
	border-radius: 999px;
	padding: 10px 16px;
	font-family: inherit;
	font-size: 13px;
	outline: none;
	min-width: 0;
	transition: border-color var(--fma-speed) ease;
}
#fma-input::placeholder {
	color: #8b8ba0;
}
#fma-input:focus {
	border-color: var(--fma-accent);
}

#fma-send {
	background: linear-gradient(135deg, var(--fma-accent), var(--fma-accent-2));
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 0 18px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	flex-shrink: 0;
}
#fma-send:disabled {
	opacity: 0.55;
	cursor: default;
}

#fma-filter-btn {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #e6e6f0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--fma-speed) ease, border-color var(--fma-speed) ease;
}
#fma-filter-btn:hover {
	background: rgba(255, 255, 255, 0.13);
	border-color: var(--fma-accent);
}

/* ---------- پنل فیلتر (Bottom Sheet): حس‌وحال / کشور / ژانر ---------- */
#fma-filter-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 5;
	align-items: flex-end;
	justify-content: center;
}

#fma-filter-sheet {
	width: 100%;
	max-height: 82%;
	background: #14151f;
	border-radius: 20px 20px 0 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: fma-sheet-up var(--fma-speed) ease;
}

@keyframes fma-sheet-up {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.fma-sheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	font-weight: 700;
	font-size: 14px;
	color: #fff;
	flex-shrink: 0;
}

.fma-sheet-close-btn {
	background: rgba(255, 255, 255, 0.08);
	border: none;
	color: #fff;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 13px;
}

.fma-sheet-body {
	padding: 16px 18px 4px;
	overflow-y: auto;
}

.fma-sheet-group {
	margin-bottom: 20px;
}

.fma-sheet-question {
	font-size: 13px;
	color: #d6d6e6;
	margin: 0 0 10px;
}

.fma-chip-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fma-filter-chip {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: #dcdce8;
	font-family: inherit;
	font-size: 12.5px;
	padding: 7px 15px;
	border-radius: 999px;
	cursor: pointer;
	transition: all var(--fma-speed) ease;
}
.fma-filter-chip.fma-chip-selected {
	background: linear-gradient(135deg, var(--fma-accent), var(--fma-accent-2));
	border-color: transparent;
	color: #fff;
	font-weight: 700;
}

.fma-sheet-footer {
	padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	flex-shrink: 0;
}

.fma-sheet-confirm {
	width: 100%;
	background: linear-gradient(135deg, var(--fma-accent), var(--fma-accent-2));
	color: #fff;
	border: none;
	border-radius: 14px;
	padding: 13px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}

/* ---------- موبایل: تنظیمات ریز صفحه‌ی کوچک (پنل خودش همیشه تمام‌صفحه است) ---------- */
@media (max-width: 480px) {
	#fma-widget.fma-pos-left {
		left: 16px;
	}
	#fma-widget.fma-pos-right {
		right: 16px;
	}

	.fma-hero-logo-text {
		font-size: 17px;
	}

	.fma-cards-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ---------- بلوک پیشنهادهای صفحه اصلی ---------- */
.fma-suggestions-block {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ---------- Dropdown جستجوی زنده (بالای ورودی) ---------- */
.fma-dropdown {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 12px;
	left: 12px;
	background: rgba(24, 25, 38, 0.98);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	box-shadow: var(--fma-shadow);
	max-height: 280px;
	overflow-y: auto;
	padding: 6px;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	animation: fma-msg-in var(--fma-speed) ease;
}

.fma-dd-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	border-radius: 10px;
	text-decoration: none;
	color: #eee;
	transition: background var(--fma-speed) ease;
}
.fma-dd-item:hover,
.fma-dd-item.fma-kbd-active {
	background: rgba(255, 255, 255, 0.09);
}
.fma-dd-item img {
	width: 34px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	background: #1c1d2b;
	flex-shrink: 0;
	opacity: 0;
	transition: opacity 0.3s ease;
}
.fma-dd-item img.fma-loaded {
	opacity: 1;
}
.fma-dd-text {
	min-width: 0;
}
.fma-dd-title {
	font-size: 12.5px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.fma-dd-meta {
	font-size: 11px;
	color: #9a9ab0;
}
.fma-dd-loading {
	padding: 6px;
}
