/* =========================================================================
   Moving With Sam — Live Chat Widget
   Brand: primary #61BC69, dark rgb(17,24,39)
   ========================================================================= */

:root {
	--mws-green:       #61bc69;
	--mws-green-dark:  #4fa758;
	--mws-dark:        rgb(17, 24, 39);
	--mws-bg:          #ffffff;
	--mws-surface:     #f3f4f6;
	--mws-border:      #e5e7eb;
	--mws-text-muted:  #9ca3af;
	--mws-radius:      18px;
	--mws-shadow:      0 16px 48px rgba(17, 24, 39, 0.2);
}

.mws-chat-widget,
.mws-chat-widget * {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.mws-chat-widget {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
}

/* ── Launcher screen ──────────────────────────────────────────────────────
   Hero header + "Chat with an Agent" card + external nav links.
   ───────────────────────────────────────────────────────────────────────── */

.mws-launcher {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.mws-launcher-hero {
	position: relative;
	background: linear-gradient(135deg, var(--mws-green) 0%, var(--mws-green-dark) 55%, var(--mws-dark) 130%);
	padding: 28px 20px 24px;
	color: #fff;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.mws-launcher-close {
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	background: transparent !important;
	border: none !important;
	color: #fff !important;
	font-size: 28px !important;
	line-height: 1 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	transition: background 0.15s ease !important;
}
.mws-launcher-close:hover { background: transparent !important; }

.mws-launcher-hero-mark {
	width: 45px;
	height: 45px;
	border-radius: 10px;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	margin-bottom: 50px;
}

.mws-launcher-hero-title {
	margin: 0;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.3;
}

/* "Chat with an Agent" — a translucent frosted card floating ON the
   gradient itself (not below it). The gradient's bottom edge lines up
   with this card's bottom edge. */
.mws-launcher-agent-card {
	background: rgba(255, 255, 255, 0.2) !important;
	backdrop-filter: blur(6px) !important;
	-webkit-backdrop-filter: blur(6px) !important;
	border: none !important;
	border-radius: 14px !important;
	padding: 14px 16px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	cursor: pointer !important;
	font-family: inherit !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	color: #fff !important;
	text-align: left !important;
	transition: background 0.15s ease !important;
}

.mws-launcher-agent-card:hover { background: rgba(255, 255, 255, 0.3) !important; }

.mws-launcher-avatars { display: flex; }

.mws-avatar-circle {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--mws-green-dark);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
	margin-left: -8px;
}
.mws-avatar-circle:first-child { margin-left: 0; }

/* The links card is a fully separate section below the hero, on plain
   white — it does not overlap the gradient at all. */
.mws-launcher-body {
	padding: 16px 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.mws-launcher-links {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
	overflow: hidden;
}

.mws-launcher-link {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100% !important;
	padding: 13px 16px !important;
	font-family: inherit !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	background: none !important;
	border: none !important;
	color: var(--mws-dark) !important;
	cursor: pointer !important;
	text-align: left !important;
	text-decoration: none !important;
	border-bottom: 1px solid var(--mws-border) !important;
	transition: background 0.15s ease !important;
}
.mws-launcher-link:last-child { border-bottom: none !important; }
.mws-launcher-link:hover { background: var(--mws-surface) !important; }
.mws-launcher-link svg { color: var(--mws-text-muted); flex-shrink: 0; }

@media ( max-width: 480px ) {
	.mws-launcher-hero { padding: 24px 18px 22px; }
}

/* ── Toggle button ──────────────────────────────────────────────────────── */

.mws-chat-toggle {
	position: relative;
	width: 50px !important;
	height: 50px;
	padding: 12px !important;
	border-radius: 50% !important;
	border: none !important;
	background: var(--mws-green) !important;
	color: #fff !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center;
	cursor: pointer !important;
	box-shadow: 0 8px 28px rgba(97, 188, 105, 0.5) !important;
	transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
	            background 0.2s ease !important;
}

.mws-chat-toggle:hover  { background: var(--mws-green-dark); transform: scale(1.07) !important; }
.mws-chat-toggle:active { transform: scale(0.96) !important; }

.mws-chat-icon { transition: transform 0.22s ease, opacity 0.18s ease; }
.mws-chat-icon--chat  { display: block; }
.mws-chat-icon--close { display: none; }

.mws-chat-widget.is-active .mws-chat-icon--chat  { display: none; }
.mws-chat-widget.is-active .mws-chat-icon--close { display: block; }

/* ── End Chat button ──────────────────────────────── */

.mws-header-end-btn {
	display: flex !important;
	align-items: center !important;
	gap: 6px !important;
	background: #dc2626 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 20px !important;
	padding: 6px 12px 6px 10px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	cursor: pointer !important;
	white-space: nowrap !important;
	flex-shrink: 0 !important;
	transition: background 0.15s ease, transform 0.12s ease !important;
}

.mws-header-end-btn:hover  { background: #b91c1c !important; }
.mws-header-end-btn:active { transform: scale(0.96) !important; }

.mws-header-end-btn svg { flex-shrink: 0 !important; }

/* ── End Chat confirmation overlay ──────────────────────────────────────── */

.mws-end-overlay {
	position: absolute;
	inset: 0;
	background: rgb(17 24 39 / 22%);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 20;
	animation: mwsFadeIn 0.2s ease;
	backdrop-filter: blur(0);
}

.mws-end-card {
	background: #fff;
	border-radius: 18px;
	padding: 26px 22px 20px;
	width: 272px;
	text-align: center;
	box-shadow: 0 20px 48px rgba(17, 24, 39, 0.22);
	animation: mwsFadeUp 0.25s ease;
}

.mws-end-card-icon {
	width: 48px;
	height: 48px;
	background: #fef2f2;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
	color: #ef4444;
}

.mws-end-card h3 {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	color: var(--mws-dark);
}

.mws-end-card p {
	margin: 0 0 20px;
	font-size: 13px;
	color: var(--mws-text-muted);
	line-height: 1.4;
}

.mws-end-card-actions {
	display: flex;
	gap: 10px;
}

.mws-btn-cancel {
	flex: 1;
	padding: 10px !important;
	border-radius: 10px !important;
	border: 1.5px solid var(--mws-border) !important;
	background: #fff;
	font-size: 13px !important;
	font-weight: 600 !important;
	font-family: inherit;
	color: var(--mws-dark) !important;
	cursor: pointer !important;
	transition: background 0.15s !important;
}

.mws-btn-cancel:hover { background: var(--mws-surface) !important; }

.mws-btn-end {
	flex: 1;
	padding: 10px !important;
	border-radius: 10px !important;
	border: none !important;
	background: #ef4444 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	color: #fff !important;
	cursor: pointer !important;
	transition: background 0.15s !important;
}

.mws-btn-end:hover      { background: #dc2626 !important; }
.mws-btn-end:disabled   { opacity: 0.6; cursor: default !important; }

/* ── Chat ended screen ───────────────────────────────────────────────────── */

.mws-chat-ended {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	gap: 10px;
	animation: mwsFadeUp 0.3s ease;
}

.mws-chat-ended-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #f0faf0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mws-green);
	margin-bottom: 4px;
}

.mws-chat-ended h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--mws-dark);
}

.mws-chat-ended p {
	margin: 0;
	font-size: 13px;
	color: var(--mws-text-muted);
}

/* Unread badge */
.mws-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #ef4444;
	color: #fff;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
	animation: mwsBadgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mwsBadgePop {
	from { transform: scale(0); }
	to   { transform: scale(1); }
}

/* ── Chat window ────────────────────────────────────────────────────────── */

.mws-chat-window {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 368px;
	height: 660px;
	max-height: 80vh;
	background: var(--mws-bg);
	border-radius: var(--mws-radius);
	box-shadow: var(--mws-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(18px) scale(0.96);
	transform-origin: bottom right;
	transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
	pointer-events: none;
}

.mws-chat-window.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.mws-chat-window[hidden] { display: none; }

/* ── Header ─────────────────────────────────────────────────────────────── */

/*
 * Built dynamically by ui.ensureChatShell() as the first child of
 * #mws-chat-layer (not a fixed sibling) so it slides together with the
 * rest of the chat screen during the minimize transition. The launcher
 * has its own separate header built into its gradient hero.
 */
.mws-chat-header {
	display: flex;
	background: var(--mws-dark);
	padding: 14px 16px;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.mws-chat-logo {
	height: 36px;
	width: auto;
	display: block;
	flex-shrink: 0;
}

.mws-chat-header-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.mws-chat-title  { font-size: 14px; font-weight: 600; color: #fff; }
.mws-chat-status {
	font-size: 11.5px;
	color: var(--mws-green);
	display: flex;
	align-items: center;
	gap: 5px;
}

.mws-status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--mws-green);
	display: inline-block;
	animation: mwsPulse 2s ease-in-out infinite;
}

@keyframes mwsPulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%       { opacity: 0.5; transform: scale(0.85); }
}

.mws-chat-minimize-btn {
	background: transparent;
	border: none !important;
	color: rgba(255,255,255,0.65) !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 6px !important;
	border-radius: 8px !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: color 0.15s, background 0.15s !important;
}
.mws-chat-minimize-btn:hover,
.mws-chat-minimize-btn:focus {
	color: #fff !important;
	background: rgba(255,255,255,0.08) !important;
}

/* Everything below the header (intake wizard / conversation) renders into
   this sub-container, so resetting it between steps never touches the
   header above it. */
.mws-chat-layer-content {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	position: relative;
}

/* ── Body ───────────────────────────────────────────────────────────────── */

.mws-chat-body {
	flex: 1;
	min-height: 0;
	position: relative;
	overflow: hidden; /* clips the sliding layers to the window's rounded corners */
	background: var(--mws-bg);
}

/* ── Layer switching (launcher ⇄ chat) ─────────────────────────────────────
   Both layers stay mounted; switching never resets the launcher or an
   in-progress intake/conversation. Matches the reference widget exactly:
   - Going TO the chat layer (Chat with an Agent): plain crossfade in place.
   - Going back TO the launcher (minimize ⌄): a push-slide — the launcher
     slides down into view from above while the chat layer is pushed down
     and out the bottom, like two stacked panels shifting as one strip.
   ───────────────────────────────────────────────────────────────────────── */

.mws-layer {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden; /* inner .mws-messages / .mws-launcher scroll themselves */
	background: var(--mws-bg);
	transform: none;
}

.mws-layer--launcher { z-index: 1; }
.mws-layer--chat     { z-index: 2; }

/* Resting (non-animating) visibility states */
.mws-window--launcher-active .mws-layer--launcher { opacity: 1; pointer-events: auto; }
.mws-window--launcher-active .mws-layer--chat      { opacity: 0; pointer-events: none; }
.mws-window--chat-active .mws-layer--chat          { opacity: 1; pointer-events: auto; }
.mws-window--chat-active .mws-layer--launcher      { opacity: 0; pointer-events: none; }

/* Forward — entering the chat layer: crossfade only, nothing moves. */
.mws-window--chat-active .mws-layer--chat,
.mws-window--chat-active .mws-layer--launcher {
	transition: opacity 0.3s ease;
}

/* Backward — minimizing to the launcher: push-slide. Opacity stays at 1
   for almost the whole animation (so the sliding panels are actually
   visible) and only drops right at the very end, once already clipped
   out of view — priming it correctly for the next forward crossfade.
   Triggered ONLY via the one-shot .mws-slide-back class (see
   ui.setActiveLayer) — never by the resting-state classes themselves,
   so it can't accidentally replay on boot or when resuming. */
@keyframes mwsLauncherSlideIn {
	from { transform: translateY(-100%); opacity: 1; }
	to   { transform: translateY(0);     opacity: 1; }
}
@keyframes mwsChatSlideOut {
	0%   { transform: translateY(0);    opacity: 1; }
	99%  { opacity: 1; }
	100% { transform: translateY(100%); opacity: 0; }
}
.mws-slide-back .mws-layer--launcher {
	animation: mwsLauncherSlideIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.mws-slide-back .mws-layer--chat {
	animation: mwsChatSlideOut 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Messages scroll area ───────────────────────────────────────────────── */

.mws-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 14px 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	scroll-behavior: smooth;
	justify-content: flex-start;
}

.mws-messages::-webkit-scrollbar       { width: 4px; }
.mws-messages::-webkit-scrollbar-track { background: transparent; }
.mws-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── Typing indicator ───────────────────────────────────────────────────── */

.mws-typing {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 11px 15px;
	background: var(--mws-surface);
	border-radius: 18px 18px 18px 4px;
	width: fit-content;
	animation: mwsFadeUp 0.2s ease;
}

.mws-typing-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mws-text-muted);
	animation: mwsBounce 1.3s ease-in-out infinite;
}
.mws-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.mws-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes mwsBounce {
	0%, 60%, 100% { transform: translateY(0);   opacity: 0.55; }
	30%            { transform: translateY(-6px); opacity: 1;    }
}

/* ── Message bubbles ────────────────────────────────────────────────────── */

.mws-bubble {
	display: flex;
	flex-direction: column;
	max-width: 82%;
	animation: mwsFadeUp 0.25s ease;
}

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

.mws-bubble--bot,
.mws-bubble--staff { align-self: flex-start; }

.mws-bubble--user  { align-self: flex-end; }

.mws-bubble-inner {
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.5;
	word-break: break-word;
	white-space: pre-wrap;
}

.mws-bubble--bot   .mws-bubble-inner,
.mws-bubble--staff .mws-bubble-inner {
	background: var(--mws-surface);
	color: var(--mws-dark);
	border-radius: 18px 18px 18px 4px;
}

.mws-bubble--user .mws-bubble-inner {
	background: var(--mws-green);
	color: #fff;
	border-radius: 18px 18px 4px 18px;
}

.mws-bubble-meta {
	font-size: 10.5px;
	color: var(--mws-text-muted);
	margin-top: 4px;
	padding: 0 4px;
}
.mws-bubble--user .mws-bubble-meta { text-align: right; }

/* ── Intake wizard card ───────────────────────────────────────────────────
   Progressive form: committed fields, one active field, progress + Next/Send.
   ───────────────────────────────────────────────────────────────────────── */

.mws-intake-card {
	background: #fff;
	border: 1px solid var(--mws-border);
	border-radius: 16px;
	padding: 16px 16px 14px;
	margin-top: 6px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
	animation: mwsFadeUp 0.25s ease;
}

.mws-intake-field { display: flex; flex-direction: column; gap: 6px; }

.mws-intake-field label {
	font-size: 12px;
	font-weight: 700;
	color: var(--mws-dark);
}

.mws-intake-field.is-done input {
	border: 1px solid var(--mws-border);
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 13px;
	font-family: inherit;
	color: #6b7280;
	background: var(--mws-surface);
	width: 100%;
}

.mws-intake-done-text {
	border: 1px solid var(--mws-border);
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 13px;
	color: #6b7280;
	background: var(--mws-surface);
	white-space: pre-wrap;
}

.mws-intake-input,
.mws-intake-select,
.mws-intake-textarea {
	width: 100% !important;
	border: 1.5px solid var(--mws-border) !important;
	border-radius: 10px !important;
	padding: 10px 12px !important;
	font-size: 13.5px !important;
	font-family: inherit !important;
	color: var(--mws-dark) !important;
	background: #fff !important;
	resize: none !important;
	transition: border-color 0.18s, box-shadow 0.18s !important;
}

.mws-intake-input:focus,
.mws-intake-select:focus,
.mws-intake-textarea:focus {
	outline: none !important;
	border-color: var(--mws-green) !important;
	box-shadow: 0 0 0 3px rgba(97, 188, 105, 0.15) !important;
}

.mws-intake-input.mws-intake-error,
.mws-intake-select.mws-intake-error,
.mws-intake-textarea.mws-intake-error {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.mws-intake-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 2px;
}

.mws-intake-progress {
	font-size: 11.5px;
	color: var(--mws-text-muted);
}

.mws-intake-next {
	background: var(--mws-green) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 20px !important;
	padding: 9px 20px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	cursor: pointer !important;
	transition: background 0.15s ease !important;
}
.mws-intake-next:hover     { background: var(--mws-green-dark) !important; }
.mws-intake-next:disabled  { opacity: 0.5; cursor: default !important; }

/* ── Recap bubble ─────────────────────────────────────────────────────────
   Summary of the wizard answers, shown as a bot bubble before connecting.
   ───────────────────────────────────────────────────────────────────────── */

.mws-recap-inner { display: flex; flex-direction: column; gap: 10px; }
.mws-recap-item { display: flex; flex-direction: column; gap: 2px; }
.mws-recap-label { font-size: 11.5px; font-weight: 700; color: var(--mws-dark); }
.mws-recap-value { font-size: 13px; color: #374151; white-space: pre-wrap; }

/* ── Text input bar ─────────────────────────────────────────────────────── */

.mws-input-bar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	background: #fff;
	border-top: 1px solid var(--mws-border);
	flex-shrink: 0;
}

.mws-input {
	flex: 1;
	resize: none;
	border: 1px solid var(--mws-border);
	border-radius: 22px;
	padding: 9px 14px;
	font-size: 13.5px;
	font-family: inherit;
	color: var(--mws-dark);
	max-height: 90px;
	background: var(--mws-surface);
	transition: border-color 0.18s, box-shadow 0.18s;
	line-height: 1.4;
}

.mws-input:focus {
	outline: none;
	border-color: var(--mws-green);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(97, 188, 105, 0.15);
}

.mws-send-btn {
	flex-shrink: 0 !important;
	width: 38px !important;
	height: 38px !important;
	border-radius: 50% !important;
	border: none !important;
	background: var(--mws-green) !important;
	color: #fff !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer !important;
	padding: 0 !important;
	transition: background 0.18s ease, transform 0.15s ease !important;
}

.mws-send-btn:hover  { background: var(--mws-green-dark); }
.mws-send-btn:active { transform: scale(0.92); }
.mws-send-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Connecting / status line ───────────────────────────────────────────── */

.mws-status-line {
	text-align: center;
	font-size: 12px;
	color: var(--mws-text-muted);
	padding: 6px 12px;
	animation: mwsFadeUp 0.25s ease;
}

.mws-status-line--agent {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 12px;
	color: var(--mws-text-muted);
	padding: 6px 12px;
	animation: mwsFadeUp 0.25s ease;
}

.mws-status-line--agent::before,
.mws-status-line--agent::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--mws-border);
}

/* ── Toast notification (widget closed) ─────────────────────────────────── */

.mws-toast {
	position: absolute;
	bottom: 72px;
	right: 0;
	width: 292px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(17, 24, 39, 0.22);
	overflow: hidden;
	cursor: pointer;
	animation: mwsToastIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes mwsToastIn {
	from { opacity: 0; transform: translateY(20px) scale(0.9); }
	to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.mws-toast-header {
	background: var(--mws-dark);
	padding: 10px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.mws-toast-logo   { height: 20px; width: auto; }
.mws-toast-brand  { flex: 1; font-size: 12px; font-weight: 600; color: #fff; }

.mws-toast-x {
	background: none;
	border: none;
	color: rgba(255,255,255,0.6);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
}
.mws-toast-x:hover { color: #fff; }

.mws-toast-body {
	padding: 12px 14px;
}

.mws-toast-who     { font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 3px; }
.mws-toast-preview {
	font-size: 13px;
	color: #6b7280;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* ── Error toast ────────────────────────────────────────────────────────── */

.mws-error-toast {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 68px;
	background: #dc2626;
	color: #fff;
	font-size: 12px;
	padding: 9px 12px;
	border-radius: 10px;
	text-align: center;
	animation: mwsFadeUp 0.2s ease;
	z-index: 10;
}

/* ── Loading / empty ────────────────────────────────────────────────────── */

.mws-loading,
.mws-empty {
	margin: auto;
	font-size: 13px;
	color: var(--mws-text-muted);
	text-align: center;
	padding: 16px;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media ( max-width: 480px ) {
	.mws-chat-widget { right: 14px; bottom: 14px; }

	.mws-chat-window {
		position: fixed;
		right: 12px;
		left: auto;
		bottom: 80px;
		width: min(88vw, 320px);
		height: 65vh;
		max-height: 520px;
	}

	.mws-chat-toggle { width: 48px; height: 48px; }
	.mws-toast       { right: 0; left: 0; width: auto; }

	.mws-intake-input,
	.mws-intake-select,
	.mws-intake-textarea,
	.mws-input,
	.mws-feedback-textarea {
		font-size: 16px !important;
	}
}

/* ── Ended screen scroll wrapper ─────────────────────────────────────────── */

.mws-ended-scroll {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	padding-bottom: 12px;
}

.mws-ended-scroll::-webkit-scrollbar       { width: 4px; }
.mws-ended-scroll::-webkit-scrollbar-track { background: transparent; }
.mws-ended-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Compact variant when feedback card is below */
.mws-chat-ended--compact {
	flex: none;
	padding-top: 22px;
	padding-bottom: 10px;
}

/* ── Feedback card ───────────────────────────────────────────────────────── */

.mws-feedback-card {
	margin: 0 12px;
	background: #fff;
	border: 1px solid var(--mws-border);
	border-radius: 16px;
	padding: 18px 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.mws-feedback-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--mws-dark);
	margin: 0 0 10px;
}

/* Stars */
.mws-stars {
	display: flex;
	gap: 4px;
	justify-content: center;
	margin-bottom: 6px;
}

.mws-star {
	background: none;
	border: none !important;
	cursor: pointer !important;
	padding: 3px !important;
	color: #d1d5db !important;
	line-height: 0;
	transition: transform 0.12s ease, color 0.12s ease !important;
}

.mws-star:hover         { background: transparent !important; transform: scale(1.18) !important; }
.mws-star--active       { background: transparent !important; color: #f59e0b !important; }
.mws-star--hover        { background: transparent !important; color: #fbbf24 !important; }

.mws-star svg path {
	fill: currentColor;
	stroke: none;
}

.mws-stars-label {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--mws-text-muted);
}

/* Comment textarea */
.mws-feedback-textarea {
	width: 100%;
	border: 1px solid var(--mws-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
	font-family: inherit;
	color: var(--mws-dark);
	resize: none;
	background: var(--mws-surface);
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.mws-feedback-textarea:focus {
	outline: none;
	border-color: var(--mws-green);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(97, 188, 105, 0.15);
}

.mws-feedback-counter {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--mws-text-muted);
	margin-top: 4px;
}

/* Submit + skip */
.mws-feedback-submit {
	width: 100% !important;
	padding: 12px !important;
	border-radius: 12px !important;
	border: none !important;
	background: var(--mws-green) !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	cursor: pointer !important;
	transition: background 0.15s !important;
}

.mws-feedback-submit:hover     { background: var(--mws-green-dark) !important; }
.mws-feedback-submit:disabled  { opacity: 0.65; cursor: default !important; }

.mws-feedback-skip {
	width: 100% !important;
	background: none !important;
	border: none !important;
	font-size: 12px !important;
	color: var(--mws-text-muted) !important;
	cursor: pointer !important;
	text-align: center !important;
	padding: 2px !important;
	font-family: inherit !important;
	transition: color 0.15s;
	margin-top: -6px;
}

.mws-feedback-skip:hover   { color: var(--mws-dark) !important; }
.mws-feedback-skip:disabled { opacity: 0.5; cursor: default !important; } 

/* ── Out-of-hours bot message ─────────────────────────────────────────────── */

.mws-bubble.mws-bubble--staff.mws-bubble--offline .mws-bubble-inner {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
}