.saishift-chat-root {
	--saishift-chat-accent: #2c5282;
	--saishift-chat-panel-bg: #ffffff;
	--saishift-chat-bubble-bg: #ffffff;
	--saishift-chat-bubble-text: #1d2327;
	--saishift-chat-font-size: 13.5px;
	position: fixed;
	z-index: 999999;
	right: 20px;
	bottom: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- position ----------
   Default is bottom-right (no class needed); this class flips
   everything to bottom-left instead. */
.saishift-chat-root.saishift-chat-pos-left {
	right: auto;
	left: 20px;
}
.saishift-chat-root.saishift-chat-pos-left .saishift-chat-panel {
	right: auto;
	left: 20px;
}
.saishift-chat-root.saishift-chat-pos-left .saishift-chat-nudge {
	right: auto;
	left: 0;
}
.saishift-chat-root.saishift-chat-pos-left .saishift-chat-nudge::after {
	right: auto;
	left: 26px;
}

/* ---------- font ---------- */

.saishift-chat-root.saishift-chat-font-sans {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.saishift-chat-root.saishift-chat-font-serif {
	font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}
.saishift-chat-root.saishift-chat-font-rounded {
	font-family: ui-rounded, "Century Gothic", Futura, "Trebuchet MS", sans-serif;
}

/* ---------- corners ----------
   Each style sets its own radius scale; everything that should round
   (the panel, message bubbles, the input and its buttons) reads from
   these instead of a fixed pixel value. */
.saishift-chat-root,
.saishift-chat-root.saishift-chat-corners-rounded {
	--saishift-chat-radius-panel: 16px;
	--saishift-chat-radius-msg: 14px;
	--saishift-chat-radius-pill: 999px;
}
.saishift-chat-root.saishift-chat-corners-soft {
	--saishift-chat-radius-panel: 8px;
	--saishift-chat-radius-msg: 8px;
	--saishift-chat-radius-pill: 8px;
}
.saishift-chat-root.saishift-chat-corners-square {
	--saishift-chat-radius-panel: 2px;
	--saishift-chat-radius-msg: 2px;
	--saishift-chat-radius-pill: 2px;
}

/* ---------- theme/plugin isolation ----------
   Many WordPress themes and page-builder plugins set global rules on
   button, input, textarea (border-radius, box-shadow, custom focus
   rings, box-sizing) that would otherwise bleed into the widget and
   make it look broken or off-brand on some sites and not others.
   Everything under .saishift-chat-root is reset to a known baseline
   here so the widget renders the same regardless of what theme or
   page builder is active. */
.saishift-chat-root,
.saishift-chat-root *,
.saishift-chat-root *::before,
.saishift-chat-root *::after {
	box-sizing: border-box;
}
.saishift-chat-root button,
.saishift-chat-root input,
.saishift-chat-root textarea {
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	background-image: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
}
.saishift-chat-root button:focus,
.saishift-chat-root input:focus,
.saishift-chat-root textarea:focus {
	box-shadow: none;
}
.saishift-chat-root ul,
.saishift-chat-root ol {
	margin: 0;
	padding: 0;
	list-style: none;
}
.saishift-chat-root p {
	margin: 0;
}
.saishift-chat-root img {
	max-width: none;
}

/* ---------- bubble ---------- */

.saishift-chat-bubble {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: none;
	border-radius: var(--saishift-chat-radius-pill);
	background: var(--saishift-chat-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,.18);
	transition: transform .15s ease, box-shadow .15s ease;
}
.saishift-chat-bubble:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.saishift-chat-bubble.is-open { display: none; }
.saishift-chat-bubble-icon { font-size: 18px; line-height: 1; }

/* ---------- panel ---------- */

.saishift-chat-panel {
	display: none;
	flex-direction: column;
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 100px);
	background: var(--saishift-chat-panel-bg);
	border-radius: var(--saishift-chat-radius-panel);
	overflow: hidden;
	box-shadow: 0 16px 48px rgba(0,0,0,.22);
}

.saishift-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 16px 18px;
	background: var(--saishift-chat-accent);
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	flex: 0 0 auto;
}
.saishift-chat-header-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.saishift-chat-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}
.saishift-chat-header-live-btn {
	background: rgba(255,255,255,.16);
	border: 1px solid rgba(255,255,255,.4);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color .12s ease;
}
.saishift-chat-header-live-btn:hover { background: rgba(255,255,255,.3); }
.saishift-chat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	opacity: .85;
}
.saishift-chat-close:hover { opacity: 1; }

.saishift-chat-live-bar {
	flex: 0 0 auto;
	text-align: center;
	padding: 6px 12px;
	background: #f7f8fa;
	border-top: 1px solid #e3e6ea;
}
.saishift-chat-live-bar-btn {
	background: none;
	border: none;
	color: var(--saishift-chat-accent);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	padding: 2px;
}

.saishift-chat-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fa;
}

.saishift-chat-msg {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: var(--saishift-chat-radius-msg);
	font-size: var(--saishift-chat-font-size);
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.saishift-chat-msg-bot {
	align-self: flex-start;
	background: var(--saishift-chat-bubble-bg);
	border: 1px solid #e3e6ea;
	color: var(--saishift-chat-bubble-text);
	border-bottom-left-radius: 4px;
}
.saishift-chat-msg-tag {
	display: block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #8b6f13;
	margin-bottom: 3px;
}
/* A real person, not the local matcher or the optional AI fallback — worth reading as distinctly different from both, not just a colour variant of "AI-assisted". */
.saishift-chat-msg-tag--team {
	color: #14663a;
}
.saishift-chat-msg-user {
	align-self: flex-end;
	background: var(--saishift-chat-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.saishift-chat-typing { opacity: .6; font-style: italic; }

.saishift-chat-quickreplies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-self: flex-start;
	max-width: 100%;
}
.saishift-chat-quickreply {
	padding: 7px 13px;
	border-radius: var(--saishift-chat-radius-pill);
	border: 1.5px solid var(--saishift-chat-accent);
	background: #fff;
	color: var(--saishift-chat-accent);
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .12s ease, color .12s ease;
}
.saishift-chat-quickreply:hover { background: var(--saishift-chat-accent); color: #fff; }
.saishift-chat-quickreply:disabled {
	cursor: default;
	opacity: .5;
	border-color: #c9ccd1;
	color: #8c9098;
	background: #fff;
}
.saishift-chat-quickreply:disabled:hover { background: #fff; color: #8c9098; }

.saishift-chat-flag-link {
	align-self: flex-start;
	background: none;
	border: none;
	padding: 0 4px;
	font-size: 11px;
	color: #9aa0a8;
	text-decoration: underline;
	cursor: pointer;
}
.saishift-chat-flag-link:hover { color: #6b7178; }
.saishift-chat-flag-link:disabled { cursor: default; text-decoration: none; }

.saishift-chat-inputrow {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e3e6ea;
	background: #fff;
	flex: 0 0 auto;
}
.saishift-chat-input {
	flex: 1;
	border: 1.5px solid #dcdfe4;
	border-radius: var(--saishift-chat-radius-pill);
	padding: 10px 15px;
	font-size: var(--saishift-chat-font-size);
	outline: none;
}
.saishift-chat-input:focus { border-color: var(--saishift-chat-accent); }
.saishift-chat-send {
	border: none;
	background: var(--saishift-chat-accent);
	color: #fff;
	border-radius: var(--saishift-chat-radius-pill);
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.saishift-chat-send:hover { filter: brightness(1.08); }

/* Real visitors never see or reach this; some bots skip display:none, so
   it's pushed off-screen instead rather than hidden that way. */
.saishift-chat-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* ---------- proactive nudge ---------- */

.saishift-chat-nudge {
	position: absolute;
	right: 0;
	bottom: 68px;
	width: 240px;
	background: #fff;
	border-radius: 14px;
	padding: 14px 32px 14px 16px;
	box-shadow: 0 10px 32px rgba(0,0,0,.18);
	cursor: pointer;
	animation: saishift-chat-nudge-in .25s ease;
}
.saishift-chat-nudge::after {
	content: "";
	position: absolute;
	right: 26px;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 3px 3px 6px rgba(0,0,0,.06);
}
.saishift-chat-nudge-text {
	font-size: 13.5px;
	line-height: 1.4;
	color: #1d2327;
}
.saishift-chat-nudge-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	font-size: 16px;
	line-height: 1;
	color: #8c8f94;
	cursor: pointer;
	padding: 4px;
}
.saishift-chat-nudge-close:hover { color: #1d2327; }

@keyframes saishift-chat-nudge-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
	.saishift-chat-panel {
		right: 12px;
		bottom: 12px;
		left: 12px;
		width: auto;
	}
	.saishift-chat-root { right: 12px; bottom: 12px; }
	.saishift-chat-root.saishift-chat-pos-left { left: 12px; right: 12px; }
}
