/* CSLY frontend widget. All theme values via CSS custom properties. */

/* ===== Theme isolation — neutralise host-theme styles bleeding into the widget ===== */
#csly-root, #csly-root *, #csly-root *::before, #csly-root *::after {
	box-sizing: border-box;
	font-family: var(--csly-font);
}
#csly-root {
	font-size: 14px;
	line-height: 1.45;
	letter-spacing: normal;
	text-align: left;
	font-weight: 400;
	color: var(--csly-text);
	-webkit-font-smoothing: antialiased;
}
#csly-root p { margin: 0; }
#csly-root ul, #csly-root li { margin: 0; padding: 0; list-style: none; }
#csly-root a { box-shadow: none; color: inherit; }
#csly-root .csly-product-card { text-decoration: none; }
#csly-root .csly-md-list { list-style: disc inside; }
#csly-root .csly-md-list li { list-style: disc inside; }
#csly-root img { max-width: 100%; height: auto; vertical-align: middle; }
#csly-root input, #csly-root textarea, #csly-root button {
	font-family: var(--csly-font);
	letter-spacing: normal;
	line-height: normal;
}
/* Force input text colour — themes (and iOS) often override it. */
#csly-root input, #csly-root textarea {
	color: var(--csly-text);
	-webkit-text-fill-color: var(--csly-text);
}
#csly-root input::placeholder { color: #9aa3af; -webkit-text-fill-color: #9aa3af; opacity: 1; }

/* hidden attribute must win over the display rules below. */
#csly-root [hidden] { display: none !important; }

.csly-root {
	--csly-primary: #2563eb;
	--csly-bg: #ffffff;
	--csly-text: #1f2937;
	--csly-radius: 18px;
	--csly-font: inherit;
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: var(--csly-font);
}
.csly-root.csly-pos-right { right: 20px; }
.csly-root.csly-pos-left { left: 20px; }

/* ---- Launcher (closed) ---- */
.csly-launcher {
	position: relative;
	width: var(--csly-launcher, 56px);
	height: var(--csly-launcher, 56px);
	border-radius: 50%;
	border: none;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	background: var(--csly-primary);
	color: #fff;
	cursor: pointer;
	/* Crisp-style: subtle, diffuse shadow — clean, not flashy. */
	box-shadow: 0 4px 10px rgba(0, 0, 0, .05), 0 8px 30px rgba(0, 0, 0, .16);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease;
}
.csly-launcher:hover { transform: scale(1.05); box-shadow: 0 6px 14px rgba(0, 0, 0, .08), 0 12px 36px rgba(0, 0, 0, .2); }
.csly-launcher:focus,
.csly-launcher:active { outline: none; }
.csly-launcher-icon { font-size: 25px; line-height: 1; }
.csly-launcher-svg { display: block; width: 27px; height: 27px; }
.csly-launcher-avatar { width: var(--csly-launcher, 56px); height: var(--csly-launcher, 56px); border-radius: 50%; object-fit: cover; }
/* Crisp has no pulsing ring — keep it minimal. */
.csly-launcher-ring { display: none; }
.csly-root.csly-open .csly-launcher { display: none; }

/* ---- Close FAB (open) ---- */
.csly-fab-close {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: none;
	background: var(--csly-primary);
	color: #fff;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}
.csly-fab-close:hover { transform: scale(1.06) rotate(90deg); }

/* ---- Panel ---- */
.csly-panel {
	position: absolute;
	bottom: 78px;
	right: 0;
	width: var(--csly-width, 380px);
	max-width: calc(100vw - 32px);
	height: var(--csly-height, 600px);
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: var(--csly-radius);
	box-shadow: var(--csly-shadow, 0 10px 2px rgba(0, 0, 0, .02), 0 4px 20px rgba(0, 0, 0, .12), 0 24px 48px rgba(0, 0, 0, .14));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: csly-rise .22s ease;
}
.csly-root.csly-pos-left .csly-panel { right: auto; left: 0; }
.csly-root.csly-pos-left .csly-fab-close { right: auto; left: 0; }
@keyframes csly-rise {
	from { transform: translateY(16px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* ---- Clean header (Intercom/Crisp style) ---- */
.csly-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 13px 14px 13px 16px;
	background: #fff;
	border-bottom: 1px solid #eef0f3;
	flex-shrink: 0;
}
.csly-header-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.csly-avatar2 {
	position: relative; width: 40px; height: 40px; border-radius: 50%;
	background: var(--csly-primary); color: #fff; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
}
.csly-avatar2 img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.csly-status-dot {
	position: absolute; right: -1px; bottom: -1px;
	width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #9aa3af;
}
.csly-status-dot.online { background: #22c55e; }
.csly-status-dot.away { background: #f59e0b; }
.csly-header-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.csly-header-name { font-size: 15px; font-weight: 700; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csly-header-status { font-size: 12px; color: #6b7280; }
.csly-header-status.is-live { color: var(--csly-primary); font-weight: 600; }
.csly-header-status.is-live::before { content: '🔴 '; }
.csly-header-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.csly-icon-btn {
	width: 32px; height: 32px; border-radius: 50%; border: none; background: none;
	color: #9aa3af; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	transition: background .15s ease, color .15s ease;
}
.csly-icon-btn:hover { background: #f1f3f5; color: #374151; }

/* Sharp bubble variant */
.csly-bubbles-sharp .csly-bubble { border-radius: 8px; }

/* ---- Body (scroll area) ---- */
.csly-body {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f7f8fa;
}

/* Quick links card group */
.csly-quicklinks {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
/* Match the green/white quick-action cards. */
.csly-ql-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	background: var(--csly-primary);
	border: 0;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	text-align: left;
	cursor: pointer;
	font-family: inherit;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.csly-ql-item:hover { filter: brightness(1.05); }
.csly-ql-item .csly-ql-chevron { color: #fff; flex-shrink: 0; font-size: 18px; opacity: .8; }

/* Messages */
.csly-messages { display: flex; flex-direction: column; gap: 10px; }
.csly-bubble-row { display: flex; align-items: flex-end; gap: 8px; animation: csly-msg-in .22s ease; }
.csly-bubble-row.user { justify-content: flex-end; }
.csly-bubble-row.bot,
.csly-bubble-row.admin { justify-content: flex-start; }
@keyframes csly-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.csly-msg-avatar {
	width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; align-self: flex-end;
	background: var(--csly-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
}
.csly-msg-avatar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.csly-bubble {
	padding: 10px 14px;
	border-radius: 18px;
	max-width: 78%;
	font-size: var(--csly-fontsize, 14px);
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.csly-bubble.user { background: var(--csly-user-bubble, var(--csly-primary)); color: var(--csly-user-text, #fff); border-bottom-right-radius: 6px; }
.csly-bubble.bot,
.csly-bubble.admin { background: var(--csly-bot-bubble, #fff); color: var(--csly-bot-text, var(--csly-text)); border: 1px solid #eef0f3; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.csly-bubble.admin { border-left: 3px solid var(--csly-primary); }
/* Markdown inside bubbles */
.csly-bubble strong { font-weight: 700; }
.csly-bubble.bot strong,
.csly-bubble.admin strong { color: #0b1324; } /* bold + darker than body text */
.csly-bubble.user strong { color: #fff; }
.csly-bubble a { color: inherit; text-decoration: underline; }
.csly-bubble code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.csly-bubble.user code { background: rgba(255,255,255,.22); }
.csly-bubble .csly-md-list { margin: 8px 0 2px; padding-left: 2px; list-style-position: inside; }
.csly-bubble .csly-md-list li { margin: 5px 0; padding-left: 0; }
.csly-bubble .csly-md-list li::marker { color: var(--csly-primary); }

.csly-typing { display: inline-flex; gap: 4px; padding: 11px 14px; }
.csly-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b3b3b8; animation: csly-blink 1.2s infinite; }
.csly-typing span:nth-child(2) { animation-delay: .2s; }
.csly-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes csly-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* ---- Product cards ---- */
.csly-products { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.csly-product-card {
	display: flex; align-items: center; gap: 12px;
	background: var(--csly-bg); border-radius: 14px; padding: 10px;
	text-decoration: none; color: var(--csly-text);
	box-shadow: 0 2px 10px rgba(0,0,0,.08);
	transition: transform .12s, box-shadow .12s;
}
.csly-product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.csly-product-img { width: 56px; height: 56px; border-radius: 10px; background-size: cover; background-position: center; flex-shrink: 0; background-color: #eee; }
.csly-product-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.csly-product-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csly-product-price { font-size: 13px; font-weight: 700; color: var(--csly-primary); }
.csly-product-btn { font-size: 11px; color: var(--csly-primary); font-weight: 600; margin-top: 2px; }

/* ---- Image message bubble ---- */
.csly-bubble.is-image { padding: 4px; background: transparent !important; box-shadow: none; max-width: 70%; }
.csly-bubble-img { display: block; max-width: 100%; border-radius: 12px; }

/* ---- FAQ suggestion chips ---- */
.csly-faq { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; flex-shrink: 0; }
.csly-faq-chip {
	background: var(--csly-bg); border: 1px solid #e0e2e7; color: var(--csly-text);
	border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
	max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.csly-faq-chip:hover { border-color: var(--csly-primary); color: var(--csly-primary); }

/* ---- Attach button ---- */
.csly-attach { background: none; border: none; font-size: 18px; cursor: pointer; flex-shrink: 0; opacity: .7; padding: 0 2px; }
.csly-attach:hover { opacity: 1; }

/* ---- Rating ---- */
.csly-rating {
	display: flex; align-items: center; gap: 8px; justify-content: center;
	background: var(--csly-bg); border-top: 1px solid #e7e9ee; padding: 10px 14px;
	font-size: 13px; color: var(--csly-text); flex-shrink: 0;
}
.csly-rate-btn { background: #f1f1f4; border: none; border-radius: 999px; width: 36px; height: 36px; font-size: 17px; cursor: pointer; transition: transform .1s; }
.csly-rate-btn:hover { transform: scale(1.15); }

/* ---- PDPA ---- */
.csly-pdpa {
	background: #fffbe6;
	border-top: 1px solid #f0e6b8;
	padding: 12px 16px;
	font-size: 12px;
	flex-shrink: 0;
}
.csly-pdpa p { margin: 0 0 8px; }
.csly-pdpa-accept {
	background: var(--csly-primary); color: #fff; border: none;
	border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 12px;
}

/* ---- Lead form ---- */
.csly-lead { background: var(--csly-bg); border-top: 1px solid #e7e9ee; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.csly-lead-title { margin: 0; font-size: 13px; font-weight: 600; }
.csly-lead input {
	border: 1px solid #d7d7db; border-radius: 8px; padding: 8px 10px;
	font-size: 14px; width: 100%; box-sizing: border-box;
}
.csly-lead-actions { display: flex; justify-content: space-between; gap: 8px; }
.csly-lead-skip { background: none; border: none; color: #888; cursor: pointer; font-size: 13px; }
.csly-lead-save { background: var(--csly-primary); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; }

/* ---- Compose (pill input) ---- */
.csly-compose {
	display: flex; align-items: center; gap: 6px;
	padding: 12px 12px; background: #fff; border-top: 1px solid #eef0f3;
	flex-shrink: 0;
}
.csly-compose input {
	flex: 1; border: 1px solid #e3e6ea; border-radius: 999px;
	padding: 11px 16px; font-size: 14px; outline: none;
	background: #f7f8fa; color: var(--csly-text);
	transition: border-color .15s ease, background .15s ease;
}
.csly-compose input:focus { border-color: var(--csly-primary); background: #fff; }
.csly-send {
	width: 40px; height: 40px; border-radius: 50%; border: none;
	background: var(--csly-primary); color: #fff; cursor: pointer; font-size: 15px; flex-shrink: 0;
	display: inline-flex; align-items: center; justify-content: center;
	transition: transform .12s ease, filter .12s ease;
}
.csly-send:hover { filter: brightness(1.07); transform: scale(1.05); }
.csly-send:disabled { opacity: .5; cursor: default; transform: none; }

/* ---- Powered by footer ---- */
.csly-powered {
	background: var(--csly-bg);
	text-align: center;
	font-size: 9px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #c2c7cf;
	padding: 7px;
	border-top: 1px solid #f3f4f6;
	flex-shrink: 0;
}
.csly-powered a { color: #aeb4bd; text-decoration: none; font-weight: 600; }
.csly-powered a:hover { color: #8c929b; }

/* ===== Theme-proof resets (stop the host theme styling our controls) ===== */
#csly-root button {
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	margin: 0;
	min-height: 0;
	line-height: 1;
	/* Defeat aggressive host themes that border/outline every <button>. */
	border: 0 !important;
	outline: 0 !important;
	-webkit-tap-highlight-color: transparent;
	text-shadow: none;
}
/* Re-assert the controls' own look (themes can't override these now). */
.csly-launcher { background: var(--csly-primary) !important; border-radius: 50% !important; width: 56px !important; height: 56px !important; min-width: 56px !important; max-width: 56px !important; padding: 0 !important; box-sizing: border-box !important; }
/* Force the launcher icon size — host themes (Elementor) globally collapse <svg> width to 0/auto. */
#csly-root .csly-launcher .csly-launcher-svg,
#csly-root .csly-launcher svg { width: 27px !important; height: 27px !important; min-width: 27px !important; max-width: none !important; flex: 0 0 auto !important; }
#csly-root .csly-launcher .csly-launcher-avatar { width: 56px !important; height: 56px !important; min-width: 56px !important; flex: 0 0 auto !important; }
.csly-send { background: var(--csly-primary) !important; color: #fff !important; border-radius: 50% !important; width: 40px !important; height: 40px !important; min-width: 40px !important; padding: 0 !important; flex-shrink: 0; }
/* Same svg-collapse guard for the other widget icons (send, header, message avatars, action chevrons). */
#csly-root .csly-send svg,
#csly-root .csly-icon-btn svg,
#csly-root .csly-msg-avatar svg,
#csly-root .csly-avatar2 svg,
#csly-root .csly-action-btn svg { flex: 0 0 auto !important; max-width: none !important; }
/* Quick-action cards (Buat Pesanan / Semak Status): force brand green bg + white text — host themes recolour buttons. */
#csly-root .csly-action-btn { background: var(--csly-primary) !important; color: #fff !important; border: 0 !important; }
#csly-root .csly-action-btn span,
#csly-root .csly-action-btn .csly-action-chev { color: #fff !important; }
/* Label holds the SVG icon + text together. */
#csly-root .csly-action-label { display: inline-flex !important; align-items: center !important; gap: 8px !important; }
/* Stroke icons — keep fill:none, force white stroke + size (host themes collapse svg width to 0). */
#csly-root .csly-action-btn .csly-action-ico { width: 18px !important; height: 18px !important; min-width: 18px !important; flex: 0 0 auto !important; color: #fff !important; stroke: #fff !important; fill: none !important; }
.csly-icon-btn { background: none !important; color: #9aa3af !important; border-radius: 50% !important; }
.csly-icon-btn:hover { background: #f1f3f5 !important; color: #374151 !important; }
.csly-attach { background: none !important; }
/* Header icon buttons (new-chat / close): host themes (Elementor) inflate the button width AND collapse the inline svg to 0 — force both back. */
#csly-root .csly-icon-btn { width: 32px !important; height: 32px !important; min-width: 32px !important; max-width: 32px !important; padding: 0 !important; box-sizing: border-box !important; flex: 0 0 auto !important; }
#csly-root .csly-icon-btn svg { width: 18px !important; height: 18px !important; min-width: 18px !important; }
/* Attach (paperclip) button must not stretch to a theme button width (was 102px → looked centred). */
#csly-root .csly-attach { width: 34px !important; min-width: 34px !important; max-width: 34px !important; padding: 0 !important; box-sizing: border-box !important; flex: 0 0 auto !important; text-align: center !important; }
/* Keep the compose row padded so the send button isn't flush to the panel edge, and let the input absorb the slack. */
#csly-root .csly-compose { padding: 12px !important; gap: 6px !important; box-sizing: border-box !important; }
#csly-root .csly-compose input { flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; }
.csly-fab-close { background: var(--csly-primary) !important; border-radius: 50% !important; }
/* Close FAB: host themes inflate it to an oval and mangle the × glyph — force a clean circle + centred mark.
   NOTE: do NOT force `display` here — the button is toggled via the [hidden] attribute, and a `display:*!important`
   would override [hidden] and leave the × showing (and blocking the launcher) while the panel is closed. */
#csly-root .csly-fab-close:not([hidden]) { width: 62px !important; height: 62px !important; min-width: 62px !important; max-width: 62px !important; padding: 0 !important; box-sizing: border-box !important; align-items: center !important; justify-content: center !important; font-size: 30px !important; line-height: 1 !important; font-weight: 400 !important; text-align: center !important; text-shadow: none !important; }
.csly-faq-chip { border: 1px solid #e0e2e7 !important; color: var(--csly-text) !important; background: var(--csly-bg) !important; }
/* Quick links: match the green/white action cards (theme forces button width/display/colour). */
#csly-root .csly-quicklinks { display: flex !important; flex-direction: column !important; gap: 8px !important; background: none !important; border: 0 !important; box-shadow: none !important; }
#csly-root .csly-ql-item {
	display: flex !important;
	width: 100% !important;
	border: 0 !important;
	border-radius: 12px !important;
	color: #fff !important;
	background: var(--csly-primary) !important;
	text-align: left !important;
	font-size: 15px !important;
	padding: 14px 16px !important;
}
#csly-root .csly-ql-item:hover { filter: brightness(1.05) !important; background: var(--csly-primary) !important; }
#csly-root .csly-ql-item span,
#csly-root .csly-ql-item .csly-ql-chevron { color: #fff !important; }
/* Bubble text colours (theme bleeds its body/link colour into the bubbles). */
.csly-bubble.bot, .csly-bubble.admin { color: var(--csly-bot-text, var(--csly-text)) !important; }
.csly-bubble.user { color: var(--csly-user-text, #fff) !important; }
.csly-bubble.user a, .csly-bubble.user strong { color: var(--csly-user-text, #fff) !important; }
.csly-pdpa-accept,
.csly-lead-save { background: var(--csly-primary) !important; }
.csly-hero-close,
.csly-hero-restart {
	/* Translucent white chip so the controls are visible on ANY header colour. */
	background: rgba(255, 255, 255, .2) !important;
	border: 0 !important;
	border-radius: 50% !important;
	outline: none !important;
	box-shadow: none !important;
	width: 30px !important;
	height: 30px !important;
	color: #fff !important;
	opacity: 1 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	cursor: pointer;
	transition: background .15s ease;
}
.csly-hero-close:hover,
.csly-hero-restart:hover { background: rgba(255, 255, 255, .35) !important; }
.csly-hero-close { font-size: 19px !important; line-height: 1; }
.csly-hero-restart { font-size: 15px !important; line-height: 1; }
#csly-root *,
#csly-root *::before,
#csly-root *::after { box-sizing: border-box; }

/* ===== Mobile: compact anchored panel (NOT full-screen) ===== */
@media ( max-width: 600px ) {
	.csly-root { bottom: 16px; right: 16px; }
	.csly-root.csly-pos-left { left: 16px; right: auto; }

	.csly-panel {
		position: fixed;
		right: 14px;
		left: auto;
		bottom: 86px;            /* sits above the launcher / FAB */
		/* Width never exceeds the viewport → no horizontal scroll. */
		width: min( 360px, calc( 100vw - 28px ) );
		/* Use svh (stable) so the box doesn't grow/shrink as the browser bar shows/hides. */
		height: auto;
		max-height: 72vh;
		max-height: 72svh;
		border-radius: var( --csly-radius );
	}
	.csly-root.csly-pos-left .csly-panel { left: 14px; right: auto; }

	/* Full-screen mode (opt-in via Appearance → Mobile display). */
	.csly-root.csly-mobile-full.csly-open { inset: 0; right: 0; left: 0; bottom: 0; }
	.csly-root.csly-mobile-full .csly-panel {
		position: fixed; inset: 0; left: 0; right: 0; bottom: 0;
		width: 100%; height: 100vh; height: 100dvh;
		max-width: none; max-height: none;
		border-radius: 0;
	}

	/* Keyboard open: pin the panel from the top of the screen down to the top of
	   the keyboard (bottom = measured keyboard height). Header stays visible, the
	   input sits just above the keys, messages scroll in between. */
	.csly-root.csly-kb .csly-panel {
		position: fixed;
		top: 0; left: 0; right: 0;
		bottom: var( --csly-kbh, 0px );
		width: 100%;
		height: auto;
		max-width: none; max-height: none;
		border-radius: 0;
	}

	/* The floating close bubble would overlap the page on mobile — use the header × instead. */
	.csly-fab-close { display: none !important; }

	.csly-bubble { max-width: 86%; }

	/* iOS auto-zooms when a focused input is < 16px — force 16px on mobile. */
	.csly-compose input,
	.csly-lead input,
	.csly-prechat input { font-size: 16px; }
}

/* ===== Brand-coloured header (Appearance → Header style = Brand) ===== */
.csly-header-brand .csly-header { background: var(--csly-primary); border-bottom-color: rgba(0, 0, 0, .06); }
.csly-header-brand .csly-header-name { color: var(--csly-header-text, #fff); }
.csly-header-brand .csly-header-status { color: rgba(255, 255, 255, .85); }
.csly-header-brand .csly-header-status.is-live { color: #fff; }
.csly-header-brand .csly-avatar2 { background: rgba(255, 255, 255, .22); }
.csly-header-brand .csly-avatar2 img { background: #fff; }
.csly-header-brand .csly-status-dot { border-color: var(--csly-primary); }
.csly-header-brand .csly-icon-btn { color: rgba(255, 255, 255, .92) !important; }
.csly-header-brand .csly-icon-btn:hover { background: rgba(255, 255, 255, .2) !important; color: #fff !important; }

/* Send icon — nudge right for optical centring (paper-plane mass sits left). */
.csly-send svg { display: block; margin: 0 auto; transform: translateX(1px); }

/* ===== Pre-chat contact gate ===== */
.csly-prechat { flex: 1; overflow-y: auto; background: #f7f8fa; display: flex; }
.csly-prechat-inner { margin: auto; width: 100%; max-width: 300px; padding: 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.csly-prechat-title { font-size: 18px; font-weight: 800; color: var(--csly-text); margin: 0; line-height: 1.2; }
.csly-prechat-sub { font-size: 13px; color: #6b7280; margin: 0 0 4px; line-height: 1.45; }
/* 16px so iOS Safari never zooms in on focus. */
.csly-prechat input { width: 100%; box-sizing: border-box; border: 1px solid #e3e6ea; border-radius: 10px; padding: 11px 14px; font-size: 16px; background: #fff; color: var(--csly-text); }
.csly-prechat input:focus { border-color: var(--csly-primary); outline: none; }
.csly-pc-err { color: #dc2626; font-size: 12px; margin: 0; }
.csly-pc-start { background: var(--csly-primary) !important; color: #fff !important; border: 0 !important; border-radius: 10px !important; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.csly-pc-start:hover { filter: brightness(1.06); }

/* ===== Launcher greeting teaser ===== */
.csly-teaser {
	position: absolute;
	bottom: 6px;
	right: 46px;
	max-width: 220px;
	background: #fff;
	color: #1f2937;
	padding: 11px 14px;
	border-radius: 16px;
	box-shadow: 0 6px 22px rgba(0, 0, 0, .16);
	font-size: 13px;
	line-height: 1.35;
	font-weight: 500;
	cursor: pointer;
	animation: csly-teaser-in .35s ease both;
	animation-delay: .5s;
}
.csly-root.csly-pos-left .csly-teaser { right: auto; left: 46px; }
.csly-teaser::after {
	content: '';
	position: absolute;
	bottom: 16px;
	right: -5px;
	width: 12px;
	height: 12px;
	background: #fff;
	transform: rotate(45deg);
}
.csly-root.csly-pos-left .csly-teaser::after { right: auto; left: -5px; }
.csly-teaser-close {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 22px !important;
	height: 22px !important;
	min-width: 22px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #9aa3af !important;
	border: 1px solid #eef0f3 !important;
	font-size: 15px !important;
	line-height: 1 !important;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
	display: flex !important; align-items: center; justify-content: center;
	z-index: 1;
}
.csly-teaser-close:hover { color: #374151 !important; }
@keyframes csly-teaser-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.csly-root.csly-open .csly-teaser { display: none; }

/* ===== Structured action buttons (KasiFly-style) ===== */
.csly-actions { display: flex; flex-direction: column; gap: 8px; }
.csly-action-btn {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	width: 100%; text-align: left; cursor: pointer;
	background: var(--csly-primary); color: #fff;
	border: 0; border-radius: 12px; padding: 14px 16px;
	font-size: 15px; font-weight: 600;
	box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.csly-action-btn:hover { filter: brightness(1.05); }
.csly-action-chev { opacity: .8; font-size: 18px; }

/* ===== Structured forms (order / track) ===== */
.csly-form { flex: 1; overflow-y: auto; background: #f7f8fa; display: flex; flex-direction: column; }
.csly-form-head {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 14px; background: #fff; border-bottom: 1px solid #eef0f3; flex-shrink: 0;
}
.csly-form-back { background: none !important; border: 0 !important; color: var(--csly-primary) !important; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.csly-form-head strong { font-size: 15px; color: #111827; }
.csly-form-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.csly-form-back { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px !important; }
.csly-form-back:hover { background: #f1f3f5 !important; }
.csly-form-label { font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.csly-form-sub { font-size: 13px; color: #6b7280; margin: 0 0 4px; line-height: 1.4; }
.csly-form input, .csly-form select {
	width: 100%; box-sizing: border-box; border: 1px solid #e3e6ea; border-radius: 10px;
	padding: 11px 13px; font-size: 16px; background: #fff; color: var(--csly-text);
	transition: border-color .15s, box-shadow .15s;
}
.csly-form input::placeholder { color: #a3a9b3; }
.csly-form input:focus, .csly-form select:focus {
	border-color: var(--csly-primary); outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--csly-primary) 18%, transparent);
}

/* Grouped cards */
.csly-fo-card {
	background: #fff; border: 1px solid #edeff2; border-radius: 14px; padding: 14px;
	display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.csly-fo-card-title { font-size: 11px; font-weight: 800; color: #9096a1; text-transform: uppercase; letter-spacing: .05em; }
.csly-fo-sublabel { font-size: 12px; font-weight: 600; color: #6b7280; margin: 2px 0 -4px; }

/* Product line item */
.csly-fo-item { display: flex; flex-direction: column; gap: 8px; }
.csly-fo-item + .csly-fo-item { border-top: 1px dashed #eceef1; padding-top: 10px; }
.csly-fo-itemrow { display: flex; align-items: center; gap: 10px; }
.csly-fo-qtybox { display: inline-flex; align-items: center; border: 1px solid #e3e6ea; border-radius: 9px; overflow: hidden; background: #fff; }
.csly-fo-step {
	width: 34px; height: 36px; border: 0 !important; background: #fff !important; color: var(--csly-primary);
	font-size: 18px; font-weight: 600; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.csly-fo-step:hover { background: #f3f4f6 !important; }
.csly-fo-qty {
	width: 40px !important; text-align: center; border: 0 !important; border-radius: 0 !important;
	border-left: 1px solid #e3e6ea !important; border-right: 1px solid #e3e6ea !important;
	padding: 8px 0 !important; box-shadow: none !important; -moz-appearance: textfield; appearance: textfield;
}
.csly-fo-qty::-webkit-outer-spin-button, .csly-fo-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.csly-fo-line { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--csly-text); white-space: nowrap; }
.csly-fo-remove {
	background: transparent !important; border: 0 !important; width: 30px; height: 30px; flex-shrink: 0;
	color: #9aa0aa; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 50% !important;
	display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.csly-fo-remove:hover { background: #fef2f2 !important; color: #dc2626; }
.csly-fo-add {
	display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
	background: none !important; border: 1px dashed #c7ccd3 !important; border-radius: 9px !important;
	color: var(--csly-primary); padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.csly-fo-add:hover { border-color: var(--csly-primary) !important; background: color-mix(in srgb, var(--csly-primary) 6%, transparent) !important; }
.csly-fo-row { display: flex; gap: 10px; }
.csly-fo-row > * { flex: 1; }

/* Sticky footer with running total */
.csly-fo-foot {
	position: sticky; bottom: 0; flex-shrink: 0; background: #fff; border-top: 1px solid #edeff2;
	padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -2px 10px rgba(16,24,40,.05);
}
.csly-fo-total { display: flex; align-items: center; justify-content: space-between; }
.csly-fo-total span { font-size: 13px; color: #6b7280; font-weight: 600; }
.csly-fo-total b { font-size: 18px; font-weight: 800; color: var(--csly-text); }
.csly-fo-submit, .csly-ft-submit {
	background: var(--csly-primary) !important; color: #fff !important; border: 0 !important;
	border-radius: 11px !important; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer;
	box-shadow: 0 2px 8px color-mix(in srgb, var(--csly-primary) 30%, transparent); transition: filter .15s;
}
.csly-ft-submit { margin-top: 4px; }
.csly-fo-submit:hover, .csly-ft-submit:hover { filter: brightness(1.05); }
.csly-fo-submit:disabled, .csly-ft-submit:disabled { opacity: .6; cursor: default; box-shadow: none; }
.csly-form-err { color: #dc2626; font-size: 12px; margin: 0; }
.csly-ft-result { margin-top: 8px; }
.csly-ft-card { background: #fff; border: 1px solid #eef0f3; border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.csly-ft-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.csly-ft-row b { color: #6b7280; font-weight: 600; }
.csly-ft-row span { color: var(--csly-text); text-align: right; }
.csly-ft-none { color: #6b7280; font-size: 13px; padding: 8px 0; }

/* ===== Launcher pulse + panel entrance animation (Appearance) ===== */
.csly-root.csly-pulse .csly-launcher::after {
	content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	animation: csly-pulse 2.2s ease-out infinite;
}
.csly-root.csly-pulse.csly-open .csly-launcher::after { animation: none; }
@keyframes csly-pulse {
	0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--csly-primary) 55%, transparent); }
	70%  { box-shadow: 0 0 0 16px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}
/* Entrance animation on open — overrides the panel's default rise via specificity. */
.csly-root.csly-anim-slide .csly-panel { animation: csly-rise .22s ease; }
.csly-root.csly-anim-fade  .csly-panel { animation: csly-fade .26s ease; }
.csly-root.csly-anim-pop   .csly-panel { animation: csly-pop .26s cubic-bezier(.2,.8,.2,1); }
.csly-root.csly-anim-none  .csly-panel { animation: none; }
@keyframes csly-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes csly-pop  { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
