/* ===========================================================
   دستیار پشتیبانی هوشمند — استایل فرانت‌اند
   نسخه ۲
   =========================================================== */

/* --- رفع باگ نسخه ۱ ---------------------------------------
   در نسخه قبل روی .ssc-panel و .ssc-chat هم display:flex بود و هم
   خصوصیت hidden؛ چون display از استایل کلاس بر [hidden] مرورگر
   اولویت دارد، پنل همیشه باز نمایش داده می‌شد.
   ---------------------------------------------------------- */
.ssc-root [hidden],
.ssc-root[hidden] {
	display: none !important;
}

.ssc-root {
	--ssc-primary: #16a34a;
	--ssc-primary-soft: rgba(22, 163, 74, .12);
	--ssc-radius: 16px;
	--ssc-bg: #ffffff;
	--ssc-bg-alt: #f6f7f9;
	--ssc-text: #111827;
	--ssc-muted: #6b7280;
	--ssc-border: #e5e7eb;
	--ssc-chat-height: 320px;

	direction: rtl;
	font-family: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, sans-serif;
	font-size: 14px;
	line-height: 1.8;
	color: var(--ssc-text);
	box-sizing: border-box;
}
.ssc-root *,
.ssc-root *::before,
.ssc-root *::after { box-sizing: inherit; }

.ssc-root button { font-family: inherit; }

/* =========================== حالت شناور =========================== */

.ssc-floating {
	position: fixed;
	bottom: 20px;
	z-index: 999990;
}
.ssc-floating.ssc-right { right: 20px; }
.ssc-floating.ssc-left  { left: 20px; }

.ssc-toggle {
	position: relative;
	width: 58px;
	height: 58px;
	border: none;
	border-radius: 50%;
	background: var(--ssc-primary);
	color: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .18s ease, box-shadow .18s ease;
	padding: 0;
}
.ssc-toggle:hover { transform: translateY(-2px) scale(1.04); }
.ssc-toggle:focus-visible { outline: 3px solid var(--ssc-primary-soft); outline-offset: 3px; }
.ssc-toggle-icon { font-size: 26px; line-height: 1; }
.ssc-toggle-close { display: none; font-size: 30px; line-height: 1; font-weight: 300; }

.ssc-floating.is-open .ssc-toggle-icon { display: none; }
.ssc-floating.is-open .ssc-toggle-close { display: block; }

.ssc-badge {
	position: absolute;
	top: -2px;
	inset-inline-end: -2px;
	min-width: 20px;
	height: 20px;
	border-radius: 10px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
}

/* حباب پیام کنار دکمه */
.ssc-bubble {
	position: absolute;
	bottom: 8px;
	inset-inline-end: 70px;
	max-width: 230px;
	background: #fff;
	color: var(--ssc-text);
	padding: 10px 14px;
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
	font-size: 13px;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	animation: ssc-pop .3s ease;
}
.ssc-bubble-close {
	background: none;
	border: none;
	color: var(--ssc-muted);
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}

@keyframes ssc-pop {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* پنل شناور */
.ssc-floating .ssc-panel {
	position: absolute;
	bottom: 72px;
	width: 350px;
	max-width: calc(100vw - 32px);
	background: var(--ssc-bg);
	border-radius: var(--ssc-radius);
	box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: ssc-pop .22s ease;
}
.ssc-floating.ssc-right .ssc-panel { right: 0; }
.ssc-floating.ssc-left  .ssc-panel { left: 0; }

/* =========================== حالت درون‌صفحه‌ای (شورت‌کد) =========================== */

.ssc-inline {
	--ssc-inline-width: 100%;
	width: var(--ssc-inline-width);
	max-width: 100%;
	margin: 24px 0;
}
.ssc-inline.ssc-align-center { margin-inline: auto; max-width: 560px; }
.ssc-inline.ssc-align-right  { margin-inline-start: 0; margin-inline-end: auto; max-width: 560px; }
.ssc-inline.ssc-align-left   { margin-inline-start: auto; margin-inline-end: 0; max-width: 560px; }
.ssc-inline.ssc-align-full   { max-width: 100%; }

.ssc-inline .ssc-panel {
	background: var(--ssc-bg);
	border: 1px solid var(--ssc-border);
	border-radius: var(--ssc-radius);
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
	display: flex;
	flex-direction: column;
}

/* =========================== سربرگ =========================== */

.ssc-panel-header {
	background: var(--ssc-primary);
	color: #fff;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
}
.ssc-head-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ssc-avatar {
	width: 36px; height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	display: flex; align-items: center; justify-content: center;
	font-size: 19px;
	flex-shrink: 0;
}
.ssc-head-text { display: flex; flex-direction: column; min-width: 0; }
.ssc-head-text strong { font-size: 14px; font-weight: 700; }
.ssc-head-text small { font-size: 11.5px; opacity: .85; }

.ssc-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: .85;
}
.ssc-close:hover { opacity: 1; }

/* =========================== بدنه و کانال‌ها =========================== */

.ssc-body { display: flex; flex-direction: column; min-height: 0; }

.ssc-channels {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
}
.ssc-channels-compact {
	flex-direction: row;
	flex-wrap: wrap;
	padding: 10px 12px;
	border-top: 1px solid var(--ssc-border);
	background: var(--ssc-bg-alt);
}
.ssc-channels-compact .ssc-channel { flex: 1 1 auto; justify-content: center; padding: 7px 10px; font-size: 12.5px; }

.ssc-layout-row .ssc-channels { flex-direction: row; flex-wrap: wrap; }
.ssc-buttons-only { margin: 16px 0; }
.ssc-buttons-title { font-weight: 700; margin-bottom: 8px; }

.ssc-channel {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 11px 13px;
	border: 1px solid var(--ssc-border);
	border-radius: 12px;
	background: var(--ssc-bg-alt);
	color: var(--ssc-text);
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	text-align: right;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
	width: 100%;
}
.ssc-channel:hover {
	background: var(--ssc-primary-soft);
	border-color: var(--ssc-primary);
	color: var(--ssc-text);
	transform: translateY(-1px);
}
.ssc-channel:focus-visible { outline: 2px solid var(--ssc-primary); outline-offset: 2px; }
.ssc-ico { font-size: 17px; line-height: 1; }
.ssc-ch-text { flex: 1; }

.ssc-live {
	width: 8px; height: 8px; border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
	animation: ssc-pulse 2s infinite;
}
@keyframes ssc-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .45; }
}

/* =========================== ناحیه چت =========================== */

.ssc-chat {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--ssc-border);
	min-height: 0;
}
.ssc-inline .ssc-chat { border-top: none; }

.ssc-messages {
	height: var(--ssc-chat-height);
	overflow-y: auto;
	overflow-wrap: break-word;
	padding: 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--ssc-bg-alt);
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}
.ssc-messages::-webkit-scrollbar { width: 6px; }
.ssc-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.ssc-msg {
	max-width: 86%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.85;
	white-space: pre-wrap;
	word-break: break-word;
	animation: ssc-pop .18s ease;
}
.ssc-msg-user {
	align-self: flex-start;         /* در RTL یعنی سمت راست */
	background: var(--ssc-primary);
	color: #fff;
	border-start-end-radius: 4px;
}
.ssc-msg-model {
	align-self: flex-end;           /* در RTL یعنی سمت چپ */
	background: #fff;
	border: 1px solid var(--ssc-border);
	color: var(--ssc-text);
	border-start-start-radius: 4px;
}
.ssc-msg-error {
	align-self: center;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	font-size: 12.5px;
	max-width: 100%;
}
.ssc-msg a { color: inherit; text-decoration: underline; }
.ssc-msg-model a { color: var(--ssc-primary); }
.ssc-msg code {
	background: rgba(0, 0, 0, .07);
	padding: 1px 5px;
	border-radius: 4px;
	font-size: .92em;
	direction: ltr;
	display: inline-block;
}

/* انیمیشن «در حال تایپ» */
.ssc-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.ssc-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--ssc-muted);
	animation: ssc-bounce 1.2s infinite;
}
.ssc-typing span:nth-child(2) { animation-delay: .18s; }
.ssc-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ssc-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* پاسخ‌های سریع */
.ssc-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 12px 0;
	background: var(--ssc-bg);
}
.ssc-quick-btn {
	border: 1px solid var(--ssc-primary);
	background: var(--ssc-primary-soft);
	color: var(--ssc-primary);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12.5px;
	cursor: pointer;
	transition: background .15s ease;
}
.ssc-quick-btn:hover { background: var(--ssc-primary); color: #fff; }

/* فرم ارسال */
.ssc-form {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	border-top: 1px solid var(--ssc-border);
	background: var(--ssc-bg);
	padding: 8px;
	margin: 0;
}
.ssc-input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 8px 6px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.7;
	color: var(--ssc-text);
	outline: none;
	resize: none;
	max-height: 110px;
	min-height: 24px;
	overflow-y: auto;
	direction: rtl;
}
.ssc-input::placeholder { color: var(--ssc-muted); }

.ssc-send {
	width: 38px; height: 38px;
	flex-shrink: 0;
	border: none;
	border-radius: 50%;
	background: var(--ssc-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .15s ease, transform .15s ease;
}
.ssc-send:hover { transform: scale(1.06); }
.ssc-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ssc-send svg { transform: scaleX(-1); }   /* جهت آیکون در RTL */

/* فرم دریافت شماره (لید) */
.ssc-lead {
	padding: 12px;
	background: var(--ssc-primary-soft);
	border-top: 1px solid var(--ssc-border);
	display: flex;
	flex-direction: column;
	gap: 7px;
}
.ssc-lead-title { font-size: 13px; font-weight: 700; }
.ssc-lead input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--ssc-border);
	border-radius: 9px;
	font-size: 13px;
	font-family: inherit;
	background: #fff;
	color: var(--ssc-text);
}
.ssc-lead-phone { direction: ltr; text-align: right; }
.ssc-lead-actions { display: flex; gap: 6px; }
.ssc-lead-submit {
	flex: 1;
	background: var(--ssc-primary);
	color: #fff;
	border: none;
	border-radius: 9px;
	padding: 8px;
	font-size: 13px;
	cursor: pointer;
}
.ssc-lead-skip {
	background: transparent;
	border: 1px solid var(--ssc-border);
	border-radius: 9px;
	padding: 8px 12px;
	font-size: 12.5px;
	cursor: pointer;
	color: var(--ssc-muted);
}
.ssc-lead-msg { font-size: 12px; color: #b91c1c; min-height: 16px; }
.ssc-lead-msg.ok { color: #15803d; }

/* پاورقی */
.ssc-foot {
	padding: 7px;
	text-align: center;
	font-size: 11px;
	color: var(--ssc-muted);
	background: var(--ssc-bg-alt);
	border-top: 1px solid var(--ssc-border);
}

/* =========================== موبایل =========================== */

/* قواعد موبایل به بخش «ریسپانسیو — بازنویسی یکپارچه» در انتهای فایل منتقل شدند */


/* =========================== حالت تاریک =========================== */

@media (prefers-color-scheme: dark) {
	.ssc-root {
		--ssc-bg: #1f2430;
		--ssc-bg-alt: #171b24;
		--ssc-text: #e5e7eb;
		--ssc-muted: #9ca3af;
		--ssc-border: #333a4a;
	}
	.ssc-msg-model { background: #262c39; }
	.ssc-lead input { background: #262c39; }
	.ssc-bubble { background: #262c39; color: #e5e7eb; }
	.ssc-msg code { background: rgba(255, 255, 255, .1); }
}

/* کاهش انیمیشن برای کاربرانی که ترجیح داده‌اند */
@media (prefers-reduced-motion: reduce) {
	.ssc-root *, .ssc-root *::before, .ssc-root *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}

/* ===================== دکمه‌های ارتباط مستقیم زیر پیام ===================== */

.ssc-msg-channels {
	align-self: flex-end;      /* هم‌راستا با پیام ربات */
	max-width: 92%;
	margin-top: -2px;
	animation: ssc-pop .18s ease;
}
.ssc-msg-channels-title {
	font-size: 11.5px;
	color: var(--ssc-muted);
	margin-bottom: 6px;
}
.ssc-msg-channels-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.ssc-ch-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border-radius: 999px;
	border: 1px solid var(--ssc-border);
	background: var(--ssc-bg);
	color: var(--ssc-text);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.6;
	transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.ssc-ch-btn:hover {
	transform: translateY(-1px);
	color: #fff;
	text-decoration: none;
}
.ssc-ch-btn-ico { font-size: 14px; line-height: 1; }

/* رنگ اختصاصی هر کانال */
.ssc-ch-btn-telegram:hover { background: #229ED9; border-color: #229ED9; }
.ssc-ch-btn-bale:hover     { background: #1c7a4a; border-color: #1c7a4a; }
.ssc-ch-btn-whatsapp:hover { background: #25D366; border-color: #25D366; }
.ssc-ch-btn-phone:hover    { background: var(--ssc-primary); border-color: var(--ssc-primary); }


/* ===================== کارت اتاق‌ها ===================== */

.ssc-rooms {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 10px;
	animation: ssc-pop .18s ease;
}

.ssc-room-card {
	background: var(--ssc-bg);
	border: 1px solid var(--ssc-border);
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.ssc-room-card.is-unavailable { opacity: .6; }

.ssc-room-img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	display: block;
	background: var(--ssc-bg-alt);
}

.ssc-room-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }

.ssc-room-name { font-weight: 700; font-size: 13.5px; }

.ssc-room-meta {
	font-size: 12.5px;
	color: var(--ssc-primary);
	font-weight: 600;
}

.ssc-room-amenities { display: flex; flex-wrap: wrap; gap: 4px; }
.ssc-room-amenities span {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--ssc-primary-soft);
	color: var(--ssc-text);
}

.ssc-room-excerpt {
	font-size: 12.5px;
	line-height: 1.8;
	color: var(--ssc-muted);
}

.ssc-room-actions { display: flex; gap: 6px; margin-top: 2px; }

.ssc-room-book {
	flex: 1;
	text-align: center;
	background: var(--ssc-primary);
	color: #fff;
	border: none;
	border-radius: 9px;
	padding: 7px 12px;
	font-size: 12.5px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: opacity .15s ease;
}
.ssc-room-book:hover { opacity: .88; color: #fff; text-decoration: none; }

.ssc-room-more {
	padding: 7px 12px;
	border: 1px solid var(--ssc-border);
	border-radius: 9px;
	font-size: 12.5px;
	color: var(--ssc-muted);
	text-decoration: none;
}
.ssc-room-more:hover { border-color: var(--ssc-primary); color: var(--ssc-primary); text-decoration: none; }


/* ===================== موقعیت مکانی ===================== */

.ssc-location {
	align-self: stretch;
	background: var(--ssc-bg);
	border: 1px solid var(--ssc-border);
	border-radius: 14px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	animation: ssc-pop .18s ease;
}

.ssc-loc-address { font-size: 13px; font-weight: 600; line-height: 1.9; }
.ssc-loc-note { font-size: 12.5px; color: var(--ssc-muted); line-height: 1.9; }

.ssc-loc-buttons { display: flex; flex-direction: column; gap: 7px; }

.ssc-loc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--ssc-border);
	border-radius: 11px;
	background: var(--ssc-bg-alt);
	color: var(--ssc-text);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: transform .15s ease, border-color .15s ease, color .15s ease;
}
.ssc-loc-btn:hover { transform: translateY(-2px); text-decoration: none; }
.ssc-loc-ico { font-size: 16px; line-height: 1; }

/* رنگ هر اپ */
.ssc-loc-google:hover { border-color: #4285F4; color: #4285F4; }
.ssc-loc-neshan:hover { border-color: #2878ff; color: #2878ff; }
.ssc-loc-balad:hover  { border-color: #2dae5c; color: #24944c; }

.ssc-loc-map {
	width: 100%;
	height: 190px;
	border: 0;
	border-radius: 11px;
	display: block;
	background: var(--ssc-bg-alt);
}


/* ===================== شورت‌کد نقشه ===================== */

.ssc-location-box { direction: rtl; margin: 20px 0; }
.ssc-location-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.ssc-location-address { font-size: 14px; margin-bottom: 12px; line-height: 2; }
.ssc-location-note { font-size: 13px; color: #666; margin: 12px 0; line-height: 2; }

.ssc-location-box .ssc-map-buttons {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}
.ssc-location-box .ssc-map-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 54px;
	padding: 12px 15px;
	border-radius: 12px;
	border: 1px solid #e8e8ee;
	background: #fff;
	color: #222;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .05);
	transition: all .25s ease;
}
.ssc-location-box .ssc-map-icon { font-size: 21px; line-height: 1; }

.ssc-location-box .ssc-map-google:hover { transform: translateY(-3px); border-color: #4285F4; color: #4285F4; box-shadow: 0 8px 20px rgba(66,133,244,.18); }
.ssc-location-box .ssc-map-neshan:hover { transform: translateY(-3px); border-color: #2878ff; color: #2878ff; box-shadow: 0 8px 20px rgba(43,119,255,.18); }
.ssc-location-box .ssc-map-balad:hover  { transform: translateY(-3px); border-color: #2dae5c; color: #24944c; box-shadow: 0 8px 20px rgba(45,174,92,.18); }

.ssc-location-box .ssc-google-map {
	width: 100%;
	overflow: hidden;
	border-radius: 16px;
	border: 1px solid #e8e8ee;
	box-shadow: 0 5px 20px rgba(0, 0, 0, .07);
	background: #f5f5f5;
}
.ssc-location-box .ssc-google-map iframe { width: 100%; height: 100%; border: 0; display: block; }


/* ===================== دکمه پرداخت رزرو ===================== */

.ssc-pay {
	align-self: stretch;
	animation: ssc-pop .18s ease;
}
.ssc-pay-btn {
	display: block;
	text-align: center;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--ssc-primary);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 4px 14px var(--ssc-primary-soft);
	transition: transform .15s ease, opacity .15s ease;
}
.ssc-pay-btn:hover {
	transform: translateY(-2px);
	opacity: .93;
	color: #fff;
	text-decoration: none;
}


/* ==========================================================================
   گالری عکس محیط / اتاق‌ها
   ========================================================================== */
.ssc-root .ssc-photos {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 2px 0 8px;
	min-width: 0;
}
.ssc-root .ssc-photos-title {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--ssc-text);
	margin: 0 2px 6px;
}
.ssc-root .ssc-photos-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
	border-radius: 12px;
	overflow: hidden;
}
.ssc-root .ssc-photo {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	padding: 0;
	margin: 0;
	border: 0;
	background: var(--ssc-bg-alt);
	cursor: zoom-in;
	overflow: hidden;
}
.ssc-root .ssc-photo[hidden] { display: none; }
.ssc-root .ssc-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .25s ease;
}
.ssc-root .ssc-photo:hover img { transform: scale(1.05); }
.ssc-root .ssc-photo:focus-visible { outline: 2px solid var(--ssc-primary); outline-offset: -2px; }
.ssc-root .ssc-photo-more {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	direction: ltr;
}

/* دکمه‌های لینک زیر پیام (رزرو آنلاین، وب‌سایت) */
.ssc-root .ssc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
}
.ssc-root .ssc-action-btn {
	flex: 1 1 auto;
	text-align: center;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid var(--ssc-primary);
	color: var(--ssc-primary);
	background: transparent;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: opacity .15s ease, transform .15s ease;
}
.ssc-root .ssc-action-btn.is-primary {
	background: var(--ssc-primary);
	color: #fff;
	box-shadow: 0 4px 14px var(--ssc-primary-soft);
}
.ssc-root .ssc-action-btn:hover {
	opacity: .92;
	transform: translateY(-1px);
	text-decoration: none;
}
.ssc-root .ssc-action-btn.is-primary:hover { color: #fff; }

/* نمایش تمام‌صفحه عکس — بیرون از ویجت، روی کل صفحه */
.ssc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .9);
	direction: rtl;
}
.ssc-lightbox[hidden] { display: none; }
.ssc-lightbox .ssc-lb-img {
	max-width: 92vw;
	max-height: 84vh;
	border-radius: 8px;
	object-fit: contain;
	user-select: none;
}
.ssc-lightbox button {
	position: absolute;
	border: 0;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 26px;
	line-height: 44px;
	padding: 0;
	cursor: pointer;
}
.ssc-lightbox button:hover { background: rgba(255, 255, 255, .28); }
.ssc-lightbox button[hidden] { display: none; }
.ssc-lightbox .ssc-lb-close { top: 16px; right: 16px; }
.ssc-lightbox .ssc-lb-prev { right: 16px; top: 50%; transform: translateY(-50%); }
.ssc-lightbox .ssc-lb-next { left: 16px; top: 50%; transform: translateY(-50%); }
.ssc-lightbox .ssc-lb-count {
	position: absolute;
	bottom: 18px;
	left: 0;
	right: 0;
	text-align: center;
	color: #e5e7eb;
	font-size: 13px;
	direction: ltr;
}
@media (max-width: 480px) {
	.ssc-lightbox .ssc-lb-prev,
	.ssc-lightbox .ssc-lb-next { top: auto; bottom: 10px; transform: none; }
	.ssc-lightbox .ssc-lb-img { max-width: 100vw; border-radius: 0; }
}


/* ==========================================================================
   ریسپانسیو — بازنویسی یکپارچه
   --------------------------------------------------------------------------
   قبلاً دوازده @media پراکنده با برک‌پوینت‌های ۳۸۰/۴۲۰/۴۸۰/۶۰۰/۷۶۷/۷۸۲ روی هم
   افتاده بودند و همدیگر را خنثی می‌کردند. اینجا همه‌شان با سه برک‌پوینت
   مشخص بازنویسی شده‌اند:

     تا ۴۸۰px   گوشی
     ۴۸۱–۷۶۸px  گوشی بزرگ و تبلت عمودی
     بالای ۷۶۸  دسکتاپ

   قاعده‌ها موبایل‌اول نوشته شده‌اند: حالت پایه برای گوشی است و با
   min-width بزرگ می‌شود.
   ========================================================================== */

/* ---------- پایه: قواعد مشترک همه دستگاه‌ها ---------- */

.ssc-root,
.ssc-root * {
	box-sizing: border-box;
	max-width: 100%;
}

.ssc-msg,
.ssc-room-excerpt,
.ssc-loc-address {
	overflow-wrap: anywhere;
	word-break: break-word;
}

.ssc-messages {
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* iOS هر ورودی کوچک‌تر از ۱۶px را هنگام فوکوس زوم می‌کند و برنمی‌گردد.
   تنها راه‌حل قابل اتکا همین است. در دسکتاپ پایین‌تر برمی‌گردانیم. */
.ssc-root input,
.ssc-root textarea,
.ssc-root select {
	font-size: 16px;
	max-width: 100%;
}

/* ---------- دکمه شناور ---------- */

.ssc-floating {
	position: fixed;
	z-index: 2147483000;
	bottom: calc(var(--ssc-offset-mobile, 20px) + env(safe-area-inset-bottom, 0px));
}
.ssc-floating.ssc-right { right: calc(14px + env(safe-area-inset-right, 0px)); }
.ssc-floating.ssc-left  { left: calc(14px + env(safe-area-inset-left, 0px)); }

/* ⚠️ هرگز transform/filter/will-change روی .ssc-floating نگذارید:
   برای فرزندان position:fixed یک containing block می‌سازد و پنل را
   به نوار باریک عمودی تبدیل می‌کند. روی خود دکمه بی‌خطر است. */
.ssc-toggle {
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	touch-action: manipulation;
}

/* ---------- پنل روی گوشی: تمام‌عرض، ارتفاع پویا ---------- */

@media (max-width: 480px) {
	.ssc-floating .ssc-panel {
		position: fixed;
		inset: auto 8px calc(var(--ssc-offset-mobile, 20px) + 62px + env(safe-area-inset-bottom, 0px)) 8px;
		width: auto;
		max-width: none;

		/* dvh با باز شدن کیبورد درست عمل می‌کند؛ vh در iOS نوار مرورگر را
		   حساب نمی‌کند و پنل زیر صفحه می‌رود */
		height: auto;
		max-height: 76vh;
		max-height: 76dvh;

		display: flex;
		flex-direction: column;
	}

	/* min-height:0 روی همه والدهای flex لازم است، وگرنه ناحیه پیام‌ها
	   اجازه کوچک شدن ندارد و از پنل بیرون می‌زند */
	.ssc-floating .ssc-panel .ssc-body,
	.ssc-floating .ssc-panel .ssc-chat {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-height: 0;
	}

	.ssc-floating .ssc-panel .ssc-messages {
		flex: 1 1 auto;
		min-height: 150px;
		max-height: none;
		height: auto;
	}

	/* کانال‌ها: ردیف افقی جمع‌وجور به‌جای ستون تمام‌ارتفاع */
	.ssc-floating .ssc-panel .ssc-channels {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 6px;
		padding: 8px 10px;
		flex: 0 0 auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.ssc-floating .ssc-panel .ssc-channels::-webkit-scrollbar { display: none; }

	.ssc-floating .ssc-panel .ssc-channel {
		flex: 0 0 auto;
		padding: 7px 12px;
		font-size: 12.5px;
		white-space: nowrap;
		border-radius: 999px;
	}
	.ssc-floating .ssc-panel .ssc-live { display: none; }

	/* هدر و فوتر جمع‌تر تا جا برای گفتگو بماند */
	.ssc-floating .ssc-panel .ssc-head { padding: 10px 12px; }
	.ssc-floating .ssc-panel .ssc-head-sub { font-size: 11px; }
	.ssc-floating .ssc-panel .ssc-foot { display: none; }

	/* پاسخ‌های سریع: یک ردیف اسکرول‌شونده */
	.ssc-quick {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 2px;
	}
	.ssc-quick::-webkit-scrollbar { display: none; }
	.ssc-quick-btn { flex: 0 0 auto; white-space: nowrap; }

	/* حباب پیام پهن‌تر تا متن فارسی بهتر بشکند */
	.ssc-msg { max-width: 88%; }
	.ssc-bubble { max-width: 190px; }

	/* کارت‌ها تک‌ستونی */
	.ssc-room-card { flex-direction: column; }
	.ssc-room-img { width: 100%; height: 150px; }
	.ssc-loc-buttons { flex-direction: column; }
	.ssc-loc-btn { width: 100%; }
	.ssc-loc-map { height: 160px; }
	.ssc-location-box .ssc-map-buttons { grid-template-columns: 1fr; gap: 10px; }
	.ssc-msg-channels { max-width: 100%; }
	.ssc-ch-btn { flex: 1 1 auto; justify-content: center; }
}

/* گوشی‌های باریک: فقط آیکون کانال‌ها */
@media (max-width: 360px) {
	.ssc-floating .ssc-panel .ssc-ch-text { display: none; }
	.ssc-floating .ssc-panel .ssc-channel { padding: 8px 11px; font-size: 15px; }
	.ssc-msg { max-width: 94%; font-size: 13px; }
}

/* ---------- گوشی بزرگ و تبلت عمودی ---------- */

@media (min-width: 481px) and (max-width: 768px) {
	.ssc-floating .ssc-panel {
		width: min(380px, calc(100vw - 28px));
		max-height: 72vh;
		max-height: 72dvh;
	}
	.ssc-room-card { flex-direction: row; }
	.ssc-room-img { width: 130px; height: auto; min-height: 120px; }
	.ssc-loc-buttons { flex-direction: row; }
	.ssc-location-box .ssc-map-buttons { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- دسکتاپ ---------- */

@media (min-width: 769px) {
	.ssc-root input,
	.ssc-root textarea,
	.ssc-root select,
	.ssc-input {
		font-size: 14px;   /* در دسکتاپ زوم iOS موضوعیت ندارد */
	}

	.ssc-floating {
		bottom: calc(var(--ssc-offset, 20px) + env(safe-area-inset-bottom, 0px));
	}
	.ssc-floating.ssc-right { right: calc(20px + env(safe-area-inset-right, 0px)); }
	.ssc-floating.ssc-left  { left: calc(20px + env(safe-area-inset-left, 0px)); }

	.ssc-room-card { flex-direction: row; }
	.ssc-room-img { width: 120px; height: auto; min-height: 120px; }
	.ssc-loc-buttons { flex-direction: row; }
	.ssc-loc-btn { flex: 1; }
}

/* ---------- شورت‌کد درون‌صفحه‌ای ---------- */

.ssc-inline { width: 100%; }
.ssc-inline .ssc-messages { height: min(var(--ssc-chat-height, 420px), 60vh); }

@media (max-width: 480px) {
	.ssc-inline { margin: 14px 0; }
	.ssc-inline .ssc-messages { height: min(var(--ssc-chat-height, 420px), 52vh); }
	.ssc-inline .ssc-channels { flex-direction: column; }
}

/* ---------- صفحه‌های کوتاه (گوشی افقی) ---------- */

@media (max-height: 480px) and (orientation: landscape) {
	.ssc-floating .ssc-panel {
		max-height: 88vh;
		max-height: 88dvh;
	}
	.ssc-floating .ssc-panel .ssc-messages { min-height: 90px; }
	.ssc-floating .ssc-panel .ssc-channels { display: none; }
}

/* ---------- ترجیحات کاربر ---------- */

@media (prefers-reduced-motion: reduce) {
	.ssc-root *,
	.ssc-root *::before,
	.ssc-root *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
