/* Tempered Chatbox widget - colors via CSS custom properties set from plugin settings */

.tcb-root {
	position: fixed;
	right: 14px;
	bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.tcb-root *, .tcb-root *::before, .tcb-root *::after { box-sizing: border-box; }

/* Launcher: call-to-action label pill + mascot circle, one tappable button */
.tcb-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
}
.tcb-launcher-label {
	padding: 12px 16px;
	background: #fff;
	color: #1e1e1e;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	white-space: nowrap;
}
.tcb-launcher-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	flex: 0 0 68px;
	border-radius: 50%;
	background: var(--tcb-primary, #1f6f8b);
	color: var(--tcb-on-primary, #fff);
	border: 1px solid var(--tcb-bubble-border, transparent);
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	transition: transform 0.15s ease, background 0.15s ease;
}
.tcb-launcher-icon svg { width: 30px; height: 30px; }
.tcb-launcher-mascot {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.tcb-launcher:hover .tcb-launcher-icon { background: var(--tcb-primary-hover, #17566c); transform: scale(1.05); }
.tcb-launcher:hover .tcb-launcher-label { color: var(--tcb-focus, #1f6f8b); }
.tcb-launcher:focus-visible { outline: 3px solid var(--tcb-focus, #1f6f8b); outline-offset: 4px; border-radius: 999px; }
.tcb-launcher.tcb-hidden { display: none; }

@media (min-width: 768px) {
	.tcb-launcher-icon { width: 76px; height: 76px; flex-basis: 76px; }
	.tcb-launcher-icon svg { width: 32px; height: 32px; }
	.tcb-launcher-label { font-size: 15px; padding: 13px 18px; }
}

/* Panel. Phones first: the panel fills the visible screen. chat.js keeps
   --tcb-vh and --tcb-top matched to the area above the on-screen keyboard,
   so the message box and send button are never hidden behind it. */
.tcb-panel[hidden] { display: none !important; }
.tcb-panel {
	position: fixed;
	top: 0;
	top: var(--tcb-top, 0px);
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	height: var(--tcb-vh, 100dvh);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: #fff;
	overflow: hidden;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
}

/* Tablets and desktops: a floating panel anchored to the launcher corner. */
@media (min-width: 481px) {
	.tcb-root { right: 20px; bottom: 20px; }
	.tcb-panel {
		position: absolute;
		top: auto;
		left: auto;
		right: 0;
		bottom: 0;
		width: 372px;
		height: 580px;
		max-height: calc(100vh - 40px);
		padding-bottom: 0;
		border: 1px solid #c0c0c0;
		border-radius: 8px;
	}
}

/* While the chat fills a phone screen, the page behind it must not scroll. */
html.tcb-lock, html.tcb-lock body { overflow: hidden; }

/* Header */
.tcb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--tcb-header, #1e1e1e);
	color: #fff;
	border-bottom: 3px solid var(--tcb-primary, #1f6f8b);
}
/* Mascot sits left of the title; the text block grows so the close button
   stays pinned right now that the header has three children. */
.tcb-header-text { flex: 1 1 auto; min-width: 0; }
.tcb-header-avatar {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	margin-right: 10px;
	border-radius: 50%;
	object-fit: contain;
	background: rgba(255, 255, 255, 0.12);
}
.tcb-title { font-family: inherit; font-weight: 700; font-size: 15px; }
.tcb-subtitle { color: #c0c0c0; font-size: 12px; margin-top: 2px; }
.tcb-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	margin: -6px -8px -6px 0;
	border: 0;
	background: transparent;
	color: #c0c0c0;
	cursor: pointer;
}
.tcb-close svg { width: 18px; height: 18px; }
.tcb-close:hover { color: #fff; }
.tcb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Emergency call bar */
.tcb-callbar {
	display: block;
	padding: 8px 16px;
	background: var(--tcb-primary, #1f6f8b);
	color: var(--tcb-on-primary, #fff);
	text-align: center;
	text-decoration: none;
	font-size: 13px;
}
.tcb-callbar:hover { background: var(--tcb-primary-hover, #17566c); color: var(--tcb-on-primary, #fff); }
.tcb-callbar strong { font-family: inherit; }
/* Site themes often force their own link color; keep the bar text readable on the brand color. */
.tcb-root a.tcb-callbar,
.tcb-root a.tcb-callbar:link,
.tcb-root a.tcb-callbar:visited,
.tcb-root a.tcb-callbar:hover,
.tcb-root a.tcb-callbar:focus,
.tcb-root .tcb-callbar span,
.tcb-root .tcb-callbar strong { color: var(--tcb-on-primary, #fff) !important; text-decoration: none; }

/* Message log */
.tcb-log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 16px 14px;
	background: #fff;
}
.tcb-msg { display: flex; margin-bottom: 10px; }
.tcb-msg.tcb-user { justify-content: flex-end; }
.tcb-bubble {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 10px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.tcb-msg-avatar {
	flex: 0 0 auto;
	align-self: flex-end;
	width: 28px;
	height: 28px;
	margin-right: 8px;
	border-radius: 50%;
	object-fit: contain;
	background: #f2f2f2;
}
.tcb-assistant .tcb-bubble { background: #f2f2f2; color: #000; border-bottom-left-radius: 3px; }
.tcb-user .tcb-bubble {
	background: var(--tcb-primary, #1f6f8b);
	color: var(--tcb-on-primary, #fff);
	border: 1px solid var(--tcb-bubble-border, transparent);
	border-bottom-right-radius: 3px;
}
.tcb-bubble a.tcb-tel { color: inherit; font-weight: 700; text-decoration: underline; }

/* Typing indicator */
.tcb-typing { display: flex; gap: 5px; align-items: center; padding: 13px 15px; }
.tcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--tcb-focus, #1f6f8b);
	animation: tcb-pulse 1.1s infinite ease-in-out;
}
.tcb-typing span:nth-child(2) { animation-delay: 0.18s; }
.tcb-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tcb-pulse {
	0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
	35% { opacity: 1; transform: translateY(-3px); }
}

/* Footer */
.tcb-footer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	flex: 0 0 auto;
	padding: 10px 12px;
	border-top: 1px solid #f2f2f2;
	background: #fff;
	margin: 0;
}
/* 16px text: iPhones zoom the page in on any smaller field, which pushed the
   send button off the right edge of the screen. */
.tcb-input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	margin: 0;
	resize: none;
	border: 1px solid #c0c0c0;
	border-radius: 6px;
	padding: 10px 11px;
	font: inherit;
	font-size: 16px;
	line-height: 1.35;
	overflow-y: hidden;
	color: #000;
	background: #fff;
	max-height: 110px;
}
.tcb-input:focus { outline: 2px solid var(--tcb-focus, #1f6f8b); outline-offset: -1px; border-color: var(--tcb-focus, #1f6f8b); }
.tcb-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: var(--tcb-primary, #1f6f8b);
	color: var(--tcb-on-primary, #fff);
	border: 1px solid var(--tcb-bubble-border, transparent);
	cursor: pointer;
}
.tcb-send svg { width: 20px; height: 20px; }
.tcb-send:hover:not(:disabled) { background: var(--tcb-primary-hover, #17566c); }
.tcb-send:disabled { background: #c0c0c0; cursor: default; }
.tcb-send:focus-visible { outline: 2px solid var(--tcb-focus, #1f6f8b); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.tcb-launcher-icon { transition: none; }
	.tcb-launcher:hover .tcb-launcher-icon { transform: none; }
	.tcb-typing span { animation: none; opacity: 0.6; }
}

/* Powered by */
.tcb-powered { flex: 0 0 auto; text-align: center; padding: 5px 0 7px; background: #fff; }
.tcb-powered a { color: #9a9a9a; font-size: 11px; text-decoration: none; }
.tcb-powered a:hover { color: #666; text-decoration: underline; }

/* After-hours info bar variant of the call bar */
.tcb-infobar { background: #efefef; color: #333; cursor: default; }
.tcb-infobar:hover { background: #efefef; color: #333; }
