/*!
 * Pasargad Chat – front-end widget styles.
 * Every token is namespaced with --pasargad-chat-* so themes cannot collide.
 */

/* ---------------------------------------------------------------------------
 * 1. Tokens & reset
 * ------------------------------------------------------------------------- */

.pasargad-chat-chat {
	--pasargad-chat-primary: #5b4bdb;
	--pasargad-chat-secondary: #8b5cf6;
	--pasargad-chat-accent: #14b8a6;
	--pasargad-chat-surface: #fff;
	--pasargad-chat-text: #182230;
	--pasargad-chat-radius: 22px;
	--pasargad-chat-launcher: 60px;
	--pasargad-chat-gap: 24px;
	--pasargad-chat-safe-bottom: env(safe-area-inset-bottom, 0px);
	--pasargad-chat-safe-top: env(safe-area-inset-top, 0px);
	--pasargad-chat-vh: 100vh;

	/* Derived neutrals borrow a little of the brand hue, so the chrome never
	   looks like generic grey next to a custom palette. */
	--pasargad-chat-ink: var(--pasargad-chat-text);
	--pasargad-chat-muted: color-mix(in srgb, var(--pasargad-chat-text) 62%, #fff);
	--pasargad-chat-faint: color-mix(in srgb, var(--pasargad-chat-text) 44%, #fff);
	--pasargad-chat-line: color-mix(in srgb, var(--pasargad-chat-primary) 11%, #e4e8f0);
	--pasargad-chat-soft: color-mix(in srgb, var(--pasargad-chat-primary) 4%, #f7f8fc);
	--pasargad-chat-bubble: #fff;
	--pasargad-chat-field: color-mix(in srgb, var(--pasargad-chat-primary) 3%, #f6f7fb);
	--pasargad-chat-tint: color-mix(in srgb, var(--pasargad-chat-primary) 9%, #fff);
	--pasargad-chat-brand: linear-gradient(135deg, var(--pasargad-chat-primary), var(--pasargad-chat-secondary));
	--pasargad-chat-ring: color-mix(in srgb, var(--pasargad-chat-primary) 16%, transparent);
	--pasargad-chat-lift: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .28);
	--pasargad-chat-float: 0 2px 6px rgba(15, 23, 42, .06), 0 24px 60px -18px rgba(15, 23, 42, .34);
	--pasargad-chat-ease: cubic-bezier(.22, .68, .32, 1);
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
	.pasargad-chat-chat {
		--pasargad-chat-muted: #5c6a80;
		--pasargad-chat-faint: #8794a8;
		--pasargad-chat-line: #e4e8f0;
		--pasargad-chat-soft: #f7f8fc;
		--pasargad-chat-field: #f6f7fb;
		--pasargad-chat-tint: #eef0fd;
		--pasargad-chat-ring: rgba(91, 75, 219, .16);
	}
}

.pasargad-chat-chat,
.pasargad-chat-chat *,
.pasargad-chat-chat *::before,
.pasargad-chat-chat *::after {
	box-sizing: border-box;
}

.pasargad-chat-chat {
	position: fixed;
	right: var(--pasargad-chat-gap);
	bottom: calc(var(--pasargad-chat-gap) + var(--pasargad-chat-safe-bottom));
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	max-width: calc(100vw - 24px);
	color: var(--pasargad-chat-ink);
	font-family: "Vazirmatn", "Vazir", "IRANSansX", Tahoma, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	direction: rtl;
	text-align: right;
	isolation: isolate;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

.pasargad-chat-chat[data-position="left"] {
	right: auto;
	left: var(--pasargad-chat-gap);
	align-items: flex-start;
}

/* Defensive resets. Themes style every button and link on the page, so the
   widget neutralises them here.

   Specificity matters: anything the widget's own component rules also set is
   declared through :where(), which contributes nothing, so a later single-class
   rule such as .pasargad-chat-chat__launcher still wins. Properties the widget
   never sets stay at full strength. */
.pasargad-chat-chat button,
.pasargad-chat-chat input,
.pasargad-chat-chat textarea,
.pasargad-chat-chat select {
	margin: 0;
	font-family: inherit;
	font-style: normal;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	text-align: inherit;
	float: none;
}

.pasargad-chat-chat :where(button, input, textarea, select) {
	width: auto;
	height: auto;
	min-width: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	box-shadow: none;
	text-decoration: none;
}

.pasargad-chat-chat :where(button) {
	cursor: pointer;
}

.pasargad-chat-chat button:disabled {
	cursor: not-allowed;
}

.pasargad-chat-chat :where(a) {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.pasargad-chat-chat :where(img) {
	max-width: 100%;
	height: auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.pasargad-chat-chat p,
.pasargad-chat-chat h2,
.pasargad-chat-chat h3 {
	margin: 0;
}

.pasargad-chat-chat [hidden] {
	display: none !important;
}

.pasargad-chat-chat :focus-visible {
	outline: 2px solid var(--pasargad-chat-primary);
	outline-offset: 2px;
}

.pasargad-chat-chat__header :focus-visible,
.pasargad-chat-chat__launcher:focus-visible {
	outline-color: #fff;
	outline-offset: 3px;
}

/* Screen-reader only. This class is what keeps the polite announcement out of
   the visual layout: the live region used to print its text next to the
   launcher and never clear it. */
.pasargad-chat-sr,
.pasargad-chat-chat__live {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 0 !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

/* ---------------------------------------------------------------------------
 * 2. Launcher
 * ------------------------------------------------------------------------- */

.pasargad-chat-chat__launcher {
	position: relative;
	display: inline-flex;
	min-width: var(--pasargad-chat-launcher);
	height: var(--pasargad-chat-launcher);
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 0 20px;
	border-radius: 999px;
	background: var(--pasargad-chat-brand);
	color: #fff;
	box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--pasargad-chat-primary) 55%, transparent), 0 2px 6px rgba(15, 23, 42, .16);
	transition: transform .22s var(--pasargad-chat-ease), box-shadow .22s var(--pasargad-chat-ease), width .22s var(--pasargad-chat-ease), padding .22s var(--pasargad-chat-ease);
}

.pasargad-chat-chat__launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--pasargad-chat-primary) 62%, transparent), 0 4px 10px rgba(15, 23, 42, .18);
}

.pasargad-chat-chat__launcher:active {
	transform: translateY(0) scale(.97);
}

.pasargad-chat-chat__launcher-icon {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .24s var(--pasargad-chat-ease), opacity .16s linear;
}

.pasargad-chat-chat__launcher-text {
	font-weight: 700;
	white-space: nowrap;
	transition: opacity .16s linear, transform .24s var(--pasargad-chat-ease);
}

.pasargad-chat-chat__launcher-text:empty {
	display: none;
}

.pasargad-chat-chat__launcher-close {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	opacity: 0;
	transform: rotate(-60deg) scale(.6);
	transition: transform .24s var(--pasargad-chat-ease), opacity .16s linear;
}

.pasargad-chat-chat__launcher-close svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
}

.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__launcher {
	width: var(--pasargad-chat-launcher);
	min-width: var(--pasargad-chat-launcher);
	padding: 0;
}

.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__launcher-icon,
.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__launcher-text {
	opacity: 0;
	transform: scale(.6);
}

.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__launcher-close {
	opacity: 1;
	transform: none;
}

.pasargad-chat-chat__pulse {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 11px;
	height: 11px;
	border: 2.5px solid var(--pasargad-chat-surface);
	border-radius: 50%;
	background: #94a3b8;
	transition: background .3s linear, opacity .2s linear;
}

.pasargad-chat-chat[data-online="true"] .pasargad-chat-chat__pulse {
	background: #22c55e;
	animation: pasargad-chat-pulse 2.4s ease-out infinite;
}

.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__pulse {
	opacity: 0;
}

.pasargad-chat-chat__badge {
	position: absolute;
	top: -6px;
	left: -6px;
	display: grid;
	min-width: 22px;
	height: 22px;
	place-items: center;
	padding: 0 6px;
	border: 2px solid var(--pasargad-chat-surface);
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	animation: pasargad-chat-pop .3s var(--pasargad-chat-ease);
}

/* ---------------------------------------------------------------------------
 * 3. New-message preview card
 * The visible half of a reply notification: it sits above the launcher, is
 * dismissible, opens the chat on click and disappears once the chat is seen.
 * ------------------------------------------------------------------------- */

.pasargad-chat-chat__peek {
	position: relative;
	display: flex;
	width: min(310px, calc(100vw - 32px));
	align-items: flex-start;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 18px;
	background: var(--pasargad-chat-surface);
	box-shadow: var(--pasargad-chat-float);
	transform-origin: bottom right;
	animation: pasargad-chat-peek-in .34s var(--pasargad-chat-ease);
}

.pasargad-chat-chat[data-position="left"] .pasargad-chat-chat__peek {
	transform-origin: bottom left;
}

.pasargad-chat-chat__peek.is-leaving {
	animation: pasargad-chat-peek-out .18s ease forwards;
}

.pasargad-chat-chat__peek-open {
	display: flex;
	flex: 1;
	min-width: 0;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 14px;
	transition: background .18s linear;
}

.pasargad-chat-chat__peek-open:hover {
	background: var(--pasargad-chat-soft);
}

.pasargad-chat-chat__peek-avatar {
	display: grid;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	place-items: center;
	overflow: hidden;
	border-radius: 13px;
	background: var(--pasargad-chat-brand);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
}

.pasargad-chat-chat__peek-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pasargad-chat-chat__peek-body {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.pasargad-chat-chat__peek-name {
	overflow: hidden;
	color: var(--pasargad-chat-ink);
	font-size: 12px;
	font-weight: 800;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-chat__peek-text {
	display: -webkit-box;
	overflow: hidden;
	color: var(--pasargad-chat-muted);
	font-size: 11.5px;
	line-height: 1.6;
	unicode-bidi: plaintext;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.pasargad-chat-chat__peek-close {
	display: grid;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	place-items: center;
	margin-top: 4px;
	border-radius: 9px;
	color: var(--pasargad-chat-faint);
	transition: background .18s linear, color .18s linear;
}

.pasargad-chat-chat__peek-close:hover {
	background: var(--pasargad-chat-soft);
	color: var(--pasargad-chat-ink);
}

.pasargad-chat-chat__peek-close svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
}

/* ---------------------------------------------------------------------------
 * 4. Panel shell
 * ------------------------------------------------------------------------- */

.pasargad-chat-chat__panel {
	position: absolute;
	right: 0;
	bottom: calc(var(--pasargad-chat-launcher) + 16px);
	display: flex;
	width: min(392px, calc(100vw - 32px));
	height: min(686px, calc(var(--pasargad-chat-vh) - var(--pasargad-chat-launcher) - 56px));
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: var(--pasargad-chat-radius);
	background: var(--pasargad-chat-surface);
	box-shadow: var(--pasargad-chat-float);
	transform-origin: bottom right;
	animation: pasargad-chat-panel-in .3s var(--pasargad-chat-ease);
}

.pasargad-chat-chat[data-position="left"] .pasargad-chat-chat__panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.pasargad-chat-chat__header {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	overflow: hidden;
	padding: 14px 16px;
	background: var(--pasargad-chat-brand);
	color: #fff;
}

.pasargad-chat-chat__header::after {
	content: "";
	position: absolute;
	top: -140px;
	left: -40px;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 66%);
	pointer-events: none;
}

.pasargad-chat-chat__agent {
	position: relative;
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 11px;
}

.pasargad-chat-chat__avatar {
	position: relative;
	display: grid;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	place-items: center;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, .5);
	border-radius: 15px;
	background: rgba(255, 255, 255, .15);
}

.pasargad-chat-chat__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pasargad-chat-chat__avatar svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: #fff;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.pasargad-chat-chat__identity {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.pasargad-chat-chat__title {
	overflow: hidden;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -.2px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-chat__subtitle {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 1px;
	overflow: hidden;
	color: rgba(255, 255, 255, .85);
	font-size: 11.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-chat__subtitle::before {
	content: "";
	flex: 0 0 6px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .5);
}

.pasargad-chat-chat[data-online="true"] .pasargad-chat-chat__subtitle::before {
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
}

.pasargad-chat-chat__header-actions {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	gap: 4px;
}

.pasargad-chat-chat__header-actions button {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 11px;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	transition: background .18s linear;
}

.pasargad-chat-chat__header-actions button:hover {
	background: rgba(255, 255, 255, .28);
}

.pasargad-chat-chat__header-actions svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pasargad-chat-chat__stage {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.pasargad-chat-chat__body {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	flex-direction: column;
	overflow: hidden;
	background: var(--pasargad-chat-soft);
}

.pasargad-chat-chat__brand {
	flex: 0 0 auto;
	padding: 5px 10px calc(5px + var(--pasargad-chat-safe-bottom));
	border-top: 1px solid var(--pasargad-chat-line);
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-faint);
	font-size: 9.5px;
	text-align: center;
}

.pasargad-chat-chat__brand:hover {
	color: var(--pasargad-chat-primary);
}

/* ---------------------------------------------------------------------------
 * 5. Loading skeleton
 * ------------------------------------------------------------------------- */

.pasargad-chat-chat__loading {
	display: flex;
	height: 100%;
	flex-direction: column;
	gap: 12px;
	padding: 18px;
}

.pasargad-chat-skeleton {
	border-radius: 14px;
	background: linear-gradient(90deg, var(--pasargad-chat-line) 25%, color-mix(in srgb, var(--pasargad-chat-line) 40%, #fff) 37%, var(--pasargad-chat-line) 63%);
	background-size: 300% 100%;
	animation: pasargad-chat-shimmer 1.4s ease-in-out infinite;
}

.pasargad-chat-skeleton--head {
	height: 78px;
}

.pasargad-chat-skeleton--line {
	height: 12px;
	border-radius: 999px;
}

.pasargad-chat-skeleton--bubble {
	width: 68%;
	height: 44px;
	border-radius: 16px 16px 6px 16px;
}

.pasargad-chat-skeleton--bubble.is-mine {
	width: 52%;
	align-self: flex-end;
	border-radius: 16px 16px 16px 6px;
}

/* ---------------------------------------------------------------------------
 * 6. Scrollable screens
 * ------------------------------------------------------------------------- */

.pasargad-chat-home,
.pasargad-chat-prechat,
.pasargad-chat-closed,
.pasargad-chat-state {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 18px 22px;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--pasargad-chat-line) transparent;
}

.pasargad-chat-chat ::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

.pasargad-chat-chat ::-webkit-scrollbar-thumb {
	border: 2px solid transparent;
	border-radius: 999px;
	background: var(--pasargad-chat-line);
	background-clip: content-box;
}

.pasargad-chat-chat ::-webkit-scrollbar-track {
	background: transparent;
}

/* Home ------------------------------------------------------------------- */

.pasargad-chat-home__welcome {
	padding: 18px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 18px;
	background: linear-gradient(150deg, var(--pasargad-chat-tint), var(--pasargad-chat-surface) 62%);
	box-shadow: var(--pasargad-chat-lift);
}

.pasargad-chat-home__welcome h2 {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.3px;
}

.pasargad-chat-home__welcome p {
	margin-top: 6px;
	color: var(--pasargad-chat-muted);
	font-size: 13px;
	line-height: 1.8;
	white-space: pre-line;
}

.pasargad-chat-home__status {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--pasargad-chat-line);
	color: var(--pasargad-chat-muted);
	font-size: 11.5px;
}

.pasargad-chat-home__status i {
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #94a3b8;
}

.pasargad-chat-home__status.is-online i {
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}

.pasargad-chat-home__section {
	margin-top: 18px;
}

.pasargad-chat-home__section h3 {
	margin-bottom: 9px;
	color: var(--pasargad-chat-faint);
	font-size: 11.5px;
	font-weight: 700;
}

.pasargad-chat-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.pasargad-chat-quick button {
	padding: 8px 13px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 999px;
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-ink);
	font-size: 12px;
	transition: border-color .18s linear, color .18s linear, transform .18s var(--pasargad-chat-ease);
}

.pasargad-chat-quick button:hover {
	border-color: var(--pasargad-chat-primary);
	color: var(--pasargad-chat-primary);
	transform: translateY(-1px);
}

.pasargad-chat-socials {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 7px;
}

.pasargad-chat-socials a {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 13px;
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-ink);
	font-size: 12px;
	font-weight: 700;
	transition: border-color .18s linear, color .18s linear;
}

.pasargad-chat-socials a span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-socials a:hover {
	border-color: var(--pasargad-chat-primary);
	color: var(--pasargad-chat-primary);
}

.pasargad-chat-faq {
	display: grid;
	gap: 6px;
}

.pasargad-chat-faq details {
	overflow: hidden;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 13px;
	background: var(--pasargad-chat-surface);
}

.pasargad-chat-faq summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 11px 13px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
	list-style: none;
}

.pasargad-chat-faq summary::-webkit-details-marker {
	display: none;
}

.pasargad-chat-faq summary::after {
	content: "";
	flex: 0 0 7px;
	width: 7px;
	height: 7px;
	border-right: 2px solid var(--pasargad-chat-faint);
	border-bottom: 2px solid var(--pasargad-chat-faint);
	transform: rotate(45deg) translateY(-2px);
	transition: transform .2s var(--pasargad-chat-ease);
}

.pasargad-chat-faq details[open] summary::after {
	transform: rotate(-135deg) translateY(-2px);
}

.pasargad-chat-faq details p {
	padding: 0 13px 12px;
	color: var(--pasargad-chat-muted);
	font-size: 12px;
	line-height: 1.85;
	white-space: pre-line;
}

/* Buttons ---------------------------------------------------------------- */

.pasargad-chat-primary-btn {
	display: flex;
	width: 100%;
	min-height: 48px;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
	padding: 10px 16px;
	border-radius: 15px;
	background: var(--pasargad-chat-brand);
	color: #fff;
	font-weight: 800;
	box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--pasargad-chat-primary) 60%, transparent);
	transition: transform .18s var(--pasargad-chat-ease), box-shadow .18s var(--pasargad-chat-ease), opacity .18s linear;
}

.pasargad-chat-primary-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--pasargad-chat-primary) 66%, transparent);
}

.pasargad-chat-primary-btn:disabled {
	opacity: .55;
	transform: none;
	box-shadow: none;
}

.pasargad-chat-ghost-btn {
	display: flex;
	width: 100%;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin-top: 9px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 14px;
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-muted);
	font-size: 12.5px;
	font-weight: 700;
	transition: border-color .18s linear, color .18s linear;
}

.pasargad-chat-ghost-btn:hover {
	border-color: var(--pasargad-chat-primary);
	color: var(--pasargad-chat-primary);
}

/* Forms ------------------------------------------------------------------ */

.pasargad-chat-prechat__head h2,
.pasargad-chat-closed h2,
.pasargad-chat-state h2 {
	font-size: 17px;
	font-weight: 800;
}

.pasargad-chat-prechat__head p,
.pasargad-chat-closed > p,
.pasargad-chat-state > p {
	margin: 6px 0 18px;
	color: var(--pasargad-chat-muted);
	font-size: 12.5px;
	line-height: 1.85;
}

.pasargad-chat-field {
	display: grid;
	gap: 6px;
	margin-bottom: 12px;
}

.pasargad-chat-field label {
	color: var(--pasargad-chat-ink);
	font-size: 11.5px;
	font-weight: 700;
}

.pasargad-chat-field label em {
	color: #ef4444;
	font-style: normal;
}

.pasargad-chat-field input,
.pasargad-chat-field textarea,
.pasargad-chat-field select {
	width: 100%;
	min-height: 46px;
	padding: 11px 13px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 13px;
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-ink);
	font-size: 13px;
	outline: 0;
	transition: border-color .18s linear, box-shadow .18s linear;
}

.pasargad-chat-field textarea {
	min-height: 84px;
	line-height: 1.8;
	resize: vertical;
}

.pasargad-chat-field input:focus,
.pasargad-chat-field textarea:focus,
.pasargad-chat-field select:focus {
	border-color: var(--pasargad-chat-primary);
	box-shadow: 0 0 0 3px var(--pasargad-chat-ring);
}

.pasargad-chat-field input::placeholder,
.pasargad-chat-field textarea::placeholder {
	color: var(--pasargad-chat-faint);
}

.pasargad-chat-field.has-error input,
.pasargad-chat-field.has-error textarea,
.pasargad-chat-field.has-error select {
	border-color: #ef4444;
}

.pasargad-chat-field__error {
	color: #ef4444;
	font-size: 10.5px;
}

.pasargad-chat-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 4px 0 14px;
	color: var(--pasargad-chat-muted);
	font-size: 11.5px;
	line-height: 1.7;
}

.pasargad-chat-consent.has-error {
	color: #b91c1c;
}

.pasargad-chat-consent.has-error input {
	outline: 2px solid #ef4444;
	outline-offset: 2px;
}

.pasargad-chat-consent input {
	width: 16px;
	height: 16px;
	min-height: 0;
	margin-top: 3px;
	accent-color: var(--pasargad-chat-primary);
}

.pasargad-chat-honeypot {
	position: absolute !important;
	right: -9999px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* ---------------------------------------------------------------------------
 * 7. Chat room
 * ------------------------------------------------------------------------- */

.pasargad-chat-chatroom {
	display: flex;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.pasargad-chat-stream {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.pasargad-chat-messages {
	position: relative;
	flex: 1;
	min-height: 0;
	padding: 14px 14px 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--pasargad-chat-line) transparent;
}

.pasargad-chat-day {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0 10px;
	color: var(--pasargad-chat-faint);
	font-size: 10.5px;
}

.pasargad-chat-day:first-child {
	margin-top: 2px;
}

.pasargad-chat-day::before,
.pasargad-chat-day::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--pasargad-chat-line);
}

.pasargad-chat-message {
	display: flex;
	align-items: flex-end;
	gap: 7px;
	margin-top: 9px;
	animation: pasargad-chat-message-in .22s var(--pasargad-chat-ease);
}

/* Grouping: consecutive messages from one sender sit closer together. */
.pasargad-chat-message.is-grouped {
	margin-top: 2px;
}

.pasargad-chat-message--visitor {
	flex-direction: row-reverse;
	justify-content: flex-start;
}

.pasargad-chat-message--system {
	justify-content: center;
	margin: 12px 0;
}

.pasargad-chat-message__avatar {
	display: grid;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	place-items: center;
	overflow: hidden;
	border-radius: 9px;
	background: var(--pasargad-chat-tint);
	color: var(--pasargad-chat-primary);
	font-size: 11px;
	font-weight: 800;
}

.pasargad-chat-message__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pasargad-chat-message__avatar--bot {
	background: var(--pasargad-chat-brand);
	color: #fff;
	font-size: 12px;
	font-weight: 900;
}

.pasargad-chat-message__avatar.is-spacer {
	visibility: hidden;
}

.pasargad-chat-message__bubble {
	position: relative;
	max-width: 80%;
	padding: 9px 12px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 16px 16px 6px 16px;
	background: var(--pasargad-chat-bubble);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
	word-break: break-word;
}

.pasargad-chat-message.is-grouped .pasargad-chat-message__bubble {
	border-radius: 16px 6px 6px 16px;
}

.pasargad-chat-message--visitor .pasargad-chat-message__bubble {
	border-color: transparent;
	border-radius: 16px 16px 16px 6px;
	background: var(--pasargad-chat-brand);
	color: #fff;
	box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--pasargad-chat-primary) 70%, transparent);
}

.pasargad-chat-message--visitor.is-grouped .pasargad-chat-message__bubble {
	border-radius: 6px 16px 16px 6px;
}

.pasargad-chat-message--bot .pasargad-chat-message__bubble {
	border-color: color-mix(in srgb, var(--pasargad-chat-primary) 20%, var(--pasargad-chat-line));
	background: linear-gradient(160deg, var(--pasargad-chat-tint), var(--pasargad-chat-bubble) 70%);
}

.pasargad-chat-message--system .pasargad-chat-message__bubble {
	max-width: 92%;
	padding: 6px 12px;
	border: 0;
	border-radius: 999px;
	background: var(--pasargad-chat-tint);
	color: var(--pasargad-chat-primary);
	box-shadow: none;
	font-size: 11px;
	text-align: center;
}

.pasargad-chat-message.has-commerce .pasargad-chat-message__bubble {
	width: min(92%, 330px);
	max-width: 92%;
}

.pasargad-chat-message__sender {
	display: block;
	margin-bottom: 3px;
	color: var(--pasargad-chat-primary);
	font-size: 10.5px;
	font-weight: 800;
}

.pasargad-chat-message__text {
	font-size: 13px;
	line-height: 1.85;
	white-space: pre-wrap;
	text-align: start;
	unicode-bidi: plaintext;
}

.pasargad-chat-message__text:empty {
	display: none;
}

.pasargad-chat-message__text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-all;
}

.pasargad-chat-message__meta {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 5px;
	margin-top: 3px;
	color: var(--pasargad-chat-faint);
	font-size: 9.5px;
	font-variant-numeric: tabular-nums;
}

.pasargad-chat-message--visitor .pasargad-chat-message__meta {
	color: rgba(255, 255, 255, .78);
}

.pasargad-chat-ticks {
	display: inline-flex;
	padding-left: 4px;
	font-weight: 800;
	letter-spacing: -4px;
}

.pasargad-chat-ticks.is-read {
	color: #a7f3d0;
}

.pasargad-chat-message.is-pending .pasargad-chat-message__bubble {
	opacity: .72;
}

.pasargad-chat-message.is-failed .pasargad-chat-message__bubble {
	border-color: #fecaca;
	background: #fef2f2;
	color: #991b1b;
	box-shadow: none;
}

.pasargad-chat-message.is-failed .pasargad-chat-message__meta {
	color: #b91c1c;
}

.pasargad-chat-retry {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: inherit;
	font-size: 9.5px;
	font-weight: 800;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Attachments ------------------------------------------------------------ */

.pasargad-chat-attachment {
	display: block;
	margin-bottom: 5px;
	color: inherit;
}

.pasargad-chat-attachment img {
	display: block;
	width: 100%;
	max-height: 240px;
	border-radius: 12px;
	background: var(--pasargad-chat-line);
	object-fit: cover;
}

.pasargad-chat-attachment__file {
	display: flex;
	min-width: 190px;
	align-items: center;
	gap: 9px;
	padding: 8px;
	border-radius: 11px;
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.pasargad-chat-attachment__file i {
	display: grid;
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	place-items: center;
	border-radius: 10px;
	background: color-mix(in srgb, currentColor 12%, transparent);
	font-style: normal;
}

.pasargad-chat-attachment__file span {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.pasargad-chat-attachment__file strong {
	overflow: hidden;
	font-size: 11.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-attachment__file small {
	opacity: .72;
	font-size: 9.5px;
}

/* Product cards ---------------------------------------------------------- */

.pasargad-chat-products {
	display: grid;
	gap: 7px;
	margin-top: 9px;
	padding-top: 9px;
	border-top: 1px solid var(--pasargad-chat-line);
}

.pasargad-chat-product {
	display: grid;
	align-items: center;
	gap: 9px;
	grid-template-columns: 56px minmax(0, 1fr);
	padding: 7px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 13px;
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-ink);
	text-align: right;
}

.pasargad-chat-product > img,
.pasargad-chat-product__placeholder {
	display: grid;
	width: 56px;
	height: 56px;
	place-items: center;
	border-radius: 10px;
	background: var(--pasargad-chat-soft);
	color: var(--pasargad-chat-faint);
	font-size: 20px;
	object-fit: cover;
}

.pasargad-chat-product__body {
	min-width: 0;
}

.pasargad-chat-product__name {
	display: block;
	overflow: hidden;
	color: var(--pasargad-chat-ink) !important;
	font-size: 12px;
	font-weight: 800;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-product__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin: 4px 0;
	font-size: 10px;
}

.pasargad-chat-product__meta .is-stock {
	color: #059669;
}

.pasargad-chat-product__meta .is-out {
	color: #dc2626;
}

.pasargad-chat-product__meta strong {
	color: var(--pasargad-chat-ink);
	font-size: 10.5px;
}

.pasargad-chat-product__action {
	display: inline-flex;
	padding: 5px 10px;
	border-radius: 9px;
	background: var(--pasargad-chat-tint);
	color: var(--pasargad-chat-primary) !important;
	font-size: 10px;
	font-weight: 800;
}

.pasargad-chat-product__action:hover {
	background: color-mix(in srgb, var(--pasargad-chat-primary) 16%, #fff);
}

/* Typing ----------------------------------------------------------------- */

.pasargad-chat-typing {
	display: flex;
	height: 0;
	align-items: center;
	gap: 8px;
	overflow: hidden;
	padding: 0 16px;
	color: var(--pasargad-chat-muted);
	font-size: 10.5px;
	opacity: 0;
	transition: height .2s var(--pasargad-chat-ease), opacity .2s linear;
}

.pasargad-chat-typing.is-visible {
	height: 26px;
	opacity: 1;
}

.pasargad-chat-typing__dots {
	display: flex;
	gap: 3px;
}

.pasargad-chat-typing__dots i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--pasargad-chat-primary);
	animation: pasargad-chat-dot 1.2s ease-in-out infinite;
}

.pasargad-chat-typing__dots i:nth-child(2) {
	animation-delay: .16s;
}

.pasargad-chat-typing__dots i:nth-child(3) {
	animation-delay: .32s;
}

/* Jump-to-latest pill ---------------------------------------------------- */

.pasargad-chat-jump {
	position: absolute;
	right: 50%;
	bottom: 12px;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 999px;
	background: var(--pasargad-chat-brand);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	box-shadow: 0 8px 20px -8px rgba(15, 23, 42, .55);
	transform: translateX(50%);
	animation: pasargad-chat-pop .24s var(--pasargad-chat-ease);
}

.pasargad-chat-jump svg {
	width: 13px;
	height: 13px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------------------------------------------------------------------------
 * 8. Composer
 * ------------------------------------------------------------------------- */

.pasargad-chat-composer {
	position: relative;
	flex: 0 0 auto;
	padding: 10px 11px calc(8px + var(--pasargad-chat-safe-bottom));
	border-top: 1px solid var(--pasargad-chat-line);
	background: var(--pasargad-chat-surface);
}

.pasargad-chat-composer__row {
	display: flex;
	align-items: flex-end;
	gap: 5px;
	padding: 5px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 17px;
	background: var(--pasargad-chat-field);
	transition: border-color .18s linear, box-shadow .18s linear;
}

.pasargad-chat-composer__row:focus-within {
	border-color: var(--pasargad-chat-primary);
	box-shadow: 0 0 0 3px var(--pasargad-chat-ring);
}

.pasargad-chat-composer textarea {
	flex: 1;
	min-height: 36px;
	max-height: 116px;
	padding: 8px 6px;
	border: 0;
	background: transparent;
	color: var(--pasargad-chat-ink);
	font-size: 13px;
	line-height: 1.65;
	outline: 0;
	resize: none;
	unicode-bidi: plaintext;
}

.pasargad-chat-composer textarea::placeholder {
	color: var(--pasargad-chat-faint);
}

.pasargad-chat-composer button {
	display: grid;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	place-items: center;
	border-radius: 12px;
	color: var(--pasargad-chat-muted);
	transition: background .18s linear, color .18s linear, transform .18s var(--pasargad-chat-ease);
}

.pasargad-chat-composer button:hover {
	background: var(--pasargad-chat-soft);
	color: var(--pasargad-chat-primary);
}

.pasargad-chat-composer .pasargad-chat-send {
	background: var(--pasargad-chat-brand);
	color: #fff;
}

.pasargad-chat-composer .pasargad-chat-send:hover {
	color: #fff;
	transform: scale(1.05);
}

.pasargad-chat-composer .pasargad-chat-send:disabled {
	background: var(--pasargad-chat-line);
	color: var(--pasargad-chat-faint);
	transform: none;
}

.pasargad-chat-composer .pasargad-chat-send svg {
	transform: scaleX(-1);
}

.pasargad-chat-composer svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pasargad-chat-emoji-toggle.is-active {
	background: var(--pasargad-chat-tint);
	color: var(--pasargad-chat-primary);
}

.pasargad-chat-composer__hint {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 6px 0;
	color: var(--pasargad-chat-faint);
	font-size: 9.5px;
}

.pasargad-chat-composer__hint button {
	display: inline;
	width: auto;
	height: auto;
	flex: 0 0 auto;
	padding: 0;
	border-radius: 0;
	color: inherit;
	font-size: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color .18s linear;
}

.pasargad-chat-composer__hint button:hover {
	background: none;
	color: var(--pasargad-chat-primary);
}

.pasargad-chat-counter {
	font-variant-numeric: tabular-nums;
}

.pasargad-chat-counter.is-near {
	color: #d97706;
}

.pasargad-chat-counter.is-over {
	color: #dc2626;
	font-weight: 800;
}

.pasargad-chat-emoji {
	position: absolute;
	right: 11px;
	bottom: calc(100% - 8px);
	z-index: 6;
	display: grid;
	width: 246px;
	padding: 8px;
	gap: 2px;
	grid-template-columns: repeat(6, 1fr);
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 16px;
	background: var(--pasargad-chat-surface);
	box-shadow: var(--pasargad-chat-float);
	animation: pasargad-chat-pop .18s var(--pasargad-chat-ease);
}

.pasargad-chat-chat[data-position="left"] .pasargad-chat-emoji {
	right: auto;
	left: 11px;
}

.pasargad-chat-emoji button {
	width: 100%;
	height: 34px;
	border-radius: 9px;
	font-size: 19px;
	line-height: 1;
	transition: background .14s linear, transform .14s var(--pasargad-chat-ease);
}

.pasargad-chat-emoji button:hover {
	background: var(--pasargad-chat-soft);
	transform: scale(1.15);
}

/* Upload progress -------------------------------------------------------- */

.pasargad-chat-uploading {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 8px;
	padding: 8px 10px;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 13px;
	background: var(--pasargad-chat-soft);
	color: var(--pasargad-chat-muted);
	font-size: 11px;
	animation: pasargad-chat-pop .2s var(--pasargad-chat-ease);
}

.pasargad-chat-uploading__name {
	overflow: hidden;
	flex: 1;
	min-width: 0;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pasargad-chat-uploading__bar {
	position: relative;
	flex: 0 0 74px;
	height: 5px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--pasargad-chat-line);
}

.pasargad-chat-uploading__bar i {
	position: absolute;
	inset: 0 auto 0 0;
	display: block;
	width: 0;
	border-radius: 999px;
	background: var(--pasargad-chat-brand);
	transition: width .18s linear;
}

.pasargad-chat-uploading__cancel {
	flex: 0 0 auto;
	color: var(--pasargad-chat-faint);
	font-size: 15px;
	line-height: 1;
}

.pasargad-chat-uploading__cancel:hover {
	color: #dc2626;
}

/* ---------------------------------------------------------------------------
 * 9. Closed screen & rating
 * ------------------------------------------------------------------------- */

.pasargad-chat-closed__icon,
.pasargad-chat-state__icon {
	display: grid;
	width: 52px;
	height: 52px;
	place-items: center;
	margin-bottom: 14px;
	border-radius: 18px;
	background: var(--pasargad-chat-tint);
	color: var(--pasargad-chat-primary);
}

.pasargad-chat-closed__icon svg,
.pasargad-chat-state__icon svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pasargad-chat-state__icon.is-error {
	background: #fef2f2;
	color: #dc2626;
}

.pasargad-chat-rating {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 4px 0 16px;
}

.pasargad-chat-rating button {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border: 1px solid var(--pasargad-chat-line);
	border-radius: 13px;
	background: var(--pasargad-chat-surface);
	color: var(--pasargad-chat-line);
	font-size: 20px;
	transition: transform .18s var(--pasargad-chat-ease), color .18s linear, border-color .18s linear, background .18s linear;
}

.pasargad-chat-rating button:hover,
.pasargad-chat-rating button.is-active {
	border-color: #f59e0b;
	background: #fffbeb;
	color: #f59e0b;
	transform: translateY(-2px);
}

.pasargad-chat-rating.is-sent button {
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * 10. Toast, connection strip, confirmation sheet
 * ------------------------------------------------------------------------- */

.pasargad-chat-chat__toast {
	position: absolute;
	top: 10px;
	right: 12px;
	left: 12px;
	z-index: 9;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 13px;
	border-radius: 13px;
	background: #1f2937;
	color: #fff;
	font-size: 11.5px;
	line-height: 1.6;
	box-shadow: 0 10px 28px -10px rgba(15, 23, 42, .6);
	animation: pasargad-chat-toast-in .24s var(--pasargad-chat-ease);
}

.pasargad-chat-chat__toast.is-error {
	background: #b91c1c;
}

.pasargad-chat-chat__toast.is-success {
	background: #047857;
}

.pasargad-chat-chat__toast.is-leaving {
	animation: pasargad-chat-toast-out .18s ease forwards;
}

.pasargad-chat-chat__offline {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 6px 12px;
	background: #fef3c7;
	color: #92400e;
	font-size: 10.5px;
	font-weight: 700;
}

.pasargad-chat-chat__offline i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #f59e0b;
	animation: pasargad-chat-blink 1.4s ease-in-out infinite;
}

.pasargad-chat-confirm {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 14px;
	background: color-mix(in srgb, var(--pasargad-chat-ink) 42%, transparent);
	animation: pasargad-chat-fade-in .18s linear;
}

.pasargad-chat-confirm__box {
	width: 100%;
	padding: 18px;
	border-radius: 18px;
	background: var(--pasargad-chat-surface);
	box-shadow: var(--pasargad-chat-float);
	animation: pasargad-chat-sheet-in .24s var(--pasargad-chat-ease);
}

.pasargad-chat-confirm__box h3 {
	font-size: 14px;
	font-weight: 800;
}

.pasargad-chat-confirm__box p {
	margin: 6px 0 16px;
	color: var(--pasargad-chat-muted);
	font-size: 12px;
	line-height: 1.8;
}

.pasargad-chat-confirm__actions {
	display: grid;
	gap: 8px;
	grid-template-columns: 1fr 1fr;
}

.pasargad-chat-confirm__actions button {
	min-height: 44px;
	border-radius: 13px;
	font-size: 12.5px;
	font-weight: 800;
	transition: filter .18s linear, border-color .18s linear, color .18s linear;
}

.pasargad-chat-confirm__actions .is-cancel {
	border: 1px solid var(--pasargad-chat-line);
	color: var(--pasargad-chat-muted);
}

.pasargad-chat-confirm__actions .is-cancel:hover {
	border-color: var(--pasargad-chat-primary);
	color: var(--pasargad-chat-primary);
}

.pasargad-chat-confirm__actions .is-danger {
	background: #dc2626;
	color: #fff;
}

.pasargad-chat-confirm__actions .is-danger:hover {
	filter: brightness(1.08);
}

/* ---------------------------------------------------------------------------
 * 11. Shortcode launcher & no-script notice
 * ------------------------------------------------------------------------- */

.pasargad-chat-inline-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border: 0;
	border-radius: 13px;
	background: linear-gradient(135deg, #5b4bdb, #8b5cf6);
	color: #fff;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 8px 20px -8px rgba(91, 75, 219, .7);
	transition: transform .18s cubic-bezier(.22, .68, .32, 1);
}

.pasargad-chat-inline-launcher:hover {
	transform: translateY(-1px);
}

.pasargad-chat-chat__noscript {
	padding: 10px;
	border: 1px solid #fca5a5;
	background: #fef2f2;
	color: #991b1b;
}

/* ---------------------------------------------------------------------------
 * 12. Motion
 * ------------------------------------------------------------------------- */

@keyframes pasargad-chat-panel-in {
	from { opacity: 0; transform: translateY(14px) scale(.97); }
	to { opacity: 1; transform: none; }
}

@keyframes pasargad-chat-message-in {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: none; }
}

@keyframes pasargad-chat-peek-in {
	0% { opacity: 0; transform: translateY(14px) scale(.9); }
	60% { transform: translateY(-2px) scale(1.01); }
	100% { opacity: 1; transform: none; }
}

@keyframes pasargad-chat-peek-out {
	to { opacity: 0; transform: translateY(8px) scale(.95); }
}

@keyframes pasargad-chat-toast-in {
	from { opacity: 0; transform: translateY(-10px); }
	to { opacity: 1; transform: none; }
}

@keyframes pasargad-chat-toast-out {
	to { opacity: 0; transform: translateY(-8px); }
}

@keyframes pasargad-chat-sheet-in {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

@keyframes pasargad-chat-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pasargad-chat-pop {
	from { opacity: 0; transform: scale(.82); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes pasargad-chat-dot {
	0%, 60%, 100% { opacity: .4; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-4px); }
}

@keyframes pasargad-chat-pulse {
	0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); }
	70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pasargad-chat-blink {
	0%, 100% { opacity: 1; }
	50% { opacity: .35; }
}

@keyframes pasargad-chat-shimmer {
	from { background-position: 100% 0; }
	to { background-position: -100% 0; }
}

@keyframes pasargad-chat-mobile-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
 * 13. Responsive
 * ------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.pasargad-chat-chat {
		--pasargad-chat-gap: 14px;
	}

	.pasargad-chat-chat__launcher {
		width: var(--pasargad-chat-launcher);
		min-width: var(--pasargad-chat-launcher);
		padding: 0;
	}

	.pasargad-chat-chat__launcher-text {
		display: none;
	}

	.pasargad-chat-chat__peek {
		width: min(300px, calc(100vw - 28px));
	}

	.pasargad-chat-chat__panel,
	.pasargad-chat-chat[data-position="left"] .pasargad-chat-chat__panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: auto;
		left: 0;
		width: 100%;
		height: var(--pasargad-chat-vh);
		max-height: none;
		border: 0;
		border-radius: 0;
		animation: pasargad-chat-mobile-in .24s var(--pasargad-chat-ease);
	}

	.pasargad-chat-chat__header {
		padding-top: max(14px, var(--pasargad-chat-safe-top));
	}

	.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__launcher,
	.pasargad-chat-chat[data-state="open"] .pasargad-chat-chat__peek {
		display: none;
	}

	.pasargad-chat-message__bubble {
		max-width: 85%;
	}

	.pasargad-chat-emoji {
		width: calc(100% - 22px);
		grid-template-columns: repeat(8, 1fr);
	}

	/* 16px keeps iOS Safari from zooming the page when a field is focused. */
	.pasargad-chat-composer textarea,
	.pasargad-chat-field input,
	.pasargad-chat-field textarea,
	.pasargad-chat-field select {
		font-size: 16px;
	}
}

@media (max-width: 600px) {
	html.pasargad-chat-is-open,
	html.pasargad-chat-is-open body {
		overflow: hidden !important;
		overscroll-behavior: none;
	}
}

/* ---------------------------------------------------------------------------
 * 14. Dark mode
 * Applied only when the site owner kept the default light surface, so custom
 * palettes are never overridden.
 * ------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.pasargad-chat-chat[data-scheme="auto"] {
		--pasargad-chat-surface: #181b24;
		--pasargad-chat-ink: #e9ecf5;
		--pasargad-chat-muted: #a4adc2;
		--pasargad-chat-faint: #7b8499;
		--pasargad-chat-line: rgba(255, 255, 255, .1);
		--pasargad-chat-soft: #12141b;
		--pasargad-chat-bubble: #222632;
		--pasargad-chat-field: #12141b;
		--pasargad-chat-tint: color-mix(in srgb, var(--pasargad-chat-primary) 24%, #181b24);
		--pasargad-chat-lift: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .7);
		--pasargad-chat-float: 0 2px 6px rgba(0, 0, 0, .45), 0 24px 60px -18px rgba(0, 0, 0, .8);
	}

	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-message__bubble {
		box-shadow: none;
	}

	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-message.is-failed .pasargad-chat-message__bubble {
		border-color: #7f1d1d;
		background: #3b1d1d;
		color: #fecaca;
	}

	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-rating button:hover,
	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-rating button.is-active {
		background: #3a2c07;
	}

	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-chat__offline {
		background: #422c06;
		color: #fcd34d;
	}

	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-state__icon.is-error {
		background: #3b1d1d;
		color: #fca5a5;
	}

	.pasargad-chat-chat[data-scheme="auto"] .pasargad-chat-product__action:hover {
		background: color-mix(in srgb, var(--pasargad-chat-primary) 34%, #181b24);
	}
}

/* ---------------------------------------------------------------------------
 * 15. Accessibility preferences
 * ------------------------------------------------------------------------- */

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

.pasargad-chat-chat[data-animation="none"] *,
.pasargad-chat-chat[data-animation="none"] *::before,
.pasargad-chat-chat[data-animation="none"] *::after {
	animation: none !important;
	transition: none !important;
}

@media (forced-colors: active) {
	.pasargad-chat-chat__launcher,
	.pasargad-chat-primary-btn,
	.pasargad-chat-composer .pasargad-chat-send,
	.pasargad-chat-jump {
		border: 1px solid ButtonText;
	}

	.pasargad-chat-message__bubble,
	.pasargad-chat-chat__peek,
	.pasargad-chat-chat__panel {
		border: 1px solid CanvasText;
	}
}
