/* T&T Graphics live chat widget. Everything is scoped under .ttgc-. */
.ttgc-root {
	--ttgc-blue: #0370af;
	--ttgc-blue-dark: #024f7c;
	--ttgc-orange: #e26835;
	--ttgc-ink: #1a2733;
	--ttgc-muted: #5b6b7a;
	--ttgc-line: #e6ecf2;
	--ttgc-soft: #f4f7fa;
	--ttgc-green: #168454;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	font: 15px/1.45 "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--ttgc-ink);
	-webkit-font-smoothing: antialiased;
}
.ttgc-root *, .ttgc-root *::before, .ttgc-root *::after { box-sizing: border-box; }
.ttgc-root [hidden] { display: none !important; }
.ttgc-root .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

.ttgc-launcher {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 54px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 27px;
	background: var(--ttgc-blue);
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(3, 40, 66, .28);
	transition: background-color .15s ease, transform .15s ease;
}
.ttgc-launcher:hover { background: var(--ttgc-blue-dark); transform: translateY(-1px); }
.ttgc-launcher:focus-visible, .ttgc-root button:focus-visible, .ttgc-root textarea:focus-visible, .ttgc-root input:focus-visible {
	outline: 3px solid var(--ttgc-orange);
	outline-offset: 2px;
}
.ttgc-launcher svg { width: 24px; height: 24px; flex: none; }
.ttgc-badge {
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--ttgc-orange);
	font-size: 12px;
	line-height: 20px;
	text-align: center;
}
.ttgc-root.is-open .ttgc-launcher { display: none; }

.ttgc-panel {
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(600px, calc(100vh - 40px));
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 48px rgba(3, 40, 66, .28);
	overflow: hidden;
	animation: ttgc-in .18s ease-out;
}
@keyframes ttgc-in { from { opacity: 0; transform: translateY(12px); } }

.ttgc-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	background: var(--ttgc-blue);
	color: #fff;
}
.ttgc-avatar {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	color: var(--ttgc-blue);
	font-weight: 700;
	font-size: 14px;
	flex: none;
}
.ttgc-title { flex: 1; min-width: 0; }
.ttgc-title strong { display: block; font-size: 16px; line-height: 1.2; }
.ttgc-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .92; }
.ttgc-dot { width: 8px; height: 8px; border-radius: 50%; background: #9fb3c3; flex: none; }
.ttgc-dot.is-on { background: #5ee08f; }
.ttgc-iconbtn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.ttgc-iconbtn:hover { background: rgba(255, 255, 255, .16); }
.ttgc-iconbtn svg { width: 20px; height: 20px; }

.ttgc-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px 8px;
	background: var(--ttgc-soft);
	overscroll-behavior: contain;
}
.ttgc-msg { display: flex; flex-direction: column; margin: 0 0 10px; max-width: 86%; }
.ttgc-msg.is-customer { margin-left: auto; align-items: flex-end; }
.ttgc-bubble {
	padding: 9px 13px;
	border-radius: 14px;
	background: #fff;
	border: 1px solid var(--ttgc-line);
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.ttgc-msg.is-customer .ttgc-bubble { background: var(--ttgc-blue); border-color: var(--ttgc-blue); color: #fff; border-bottom-right-radius: 4px; }
.ttgc-msg.is-ai .ttgc-bubble, .ttgc-msg.is-staff .ttgc-bubble { border-bottom-left-radius: 4px; }
.ttgc-msg.is-staff .ttgc-bubble { border-color: #b9dcc9; background: #f1faf5; }
.ttgc-bubble a { color: var(--ttgc-blue); font-weight: 600; text-decoration: underline; }
.ttgc-msg.is-customer .ttgc-bubble a { color: #fff; }
.ttgc-bubble ul { margin: 4px 0; padding-left: 18px; white-space: normal; }
.ttgc-bubble li { margin: 2px 0; }
.ttgc-meta { margin-top: 3px; font-size: 12px; color: var(--ttgc-muted); }
.ttgc-msg.is-system { max-width: 100%; align-items: center; text-align: center; }
.ttgc-msg.is-system .ttgc-bubble { background: transparent; border: 0; padding: 2px 8px; color: var(--ttgc-muted); font-size: 13px; }

.ttgc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.ttgc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9fb3c3; animation: ttgc-blink 1.2s infinite both; }
.ttgc-typing span:nth-child(2) { animation-delay: .2s; }
.ttgc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ttgc-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ttgc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; background: var(--ttgc-soft); }
.ttgc-chip {
	padding: 6px 12px;
	border: 1px solid #b7d3e6;
	border-radius: 16px;
	background: #fff;
	color: var(--ttgc-blue-dark);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.ttgc-chip:hover { background: #eaf4fb; }

.ttgc-form { padding: 12px 14px; border-top: 1px solid var(--ttgc-line); background: #fff; }
.ttgc-form h3 { margin: 0 0 8px; font-size: 15px; color: var(--ttgc-ink); }
.ttgc-form label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ttgc-muted); }
.ttgc-root .ttgc-form input, .ttgc-root .ttgc-form textarea {
	display: block;
	width: 100%;
	margin-top: 3px;
	padding: 8px 10px;
	border: 1px solid #c9d6e1;
	border-radius: 8px;
	background: #fff;
	color: var(--ttgc-ink);
	font: inherit;
	font-weight: 400;
	font-size: 16px;
}
.ttgc-form .ttgc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ttgc-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ttgc-btn {
	padding: 8px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--ttgc-blue);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.ttgc-btn:hover { background: var(--ttgc-blue-dark); }
.ttgc-btn.is-plain { background: transparent; color: var(--ttgc-muted); }
.ttgc-btn[disabled] { opacity: .6; cursor: default; }
.ttgc-error { margin: 0 0 8px; color: #b42318; font-size: 13px; }

.ttgc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--ttgc-line); background: #fff; }
.ttgc-root .ttgc-compose textarea {
	background: #fff;
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid #c9d6e1;
	border-radius: 10px;
	resize: none;
	color: var(--ttgc-ink);
	font: inherit;
	font-size: 16px;
	line-height: 1.35;
}
.ttgc-send {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--ttgc-orange);
	color: #fff;
	cursor: pointer;
	flex: none;
}
.ttgc-send:hover { background: #c2501f; }
.ttgc-send[disabled] { opacity: .55; cursor: default; }
.ttgc-send svg { width: 20px; height: 20px; }
.ttgc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 0 14px 10px; background: #fff; font-size: 12px; color: var(--ttgc-muted); }
.ttgc-foot > span:last-child { white-space: nowrap; }
.ttgc-foot a, .ttgc-linkbtn { color: var(--ttgc-muted); text-decoration: underline; }
.ttgc-linkbtn { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

@media (max-width: 520px) {
	.ttgc-root { right: 16px; bottom: 16px; }
	.ttgc-launcher { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; position: relative; }
	.ttgc-launcher .ttgc-badge { position: absolute; top: -4px; right: -4px; }
	.ttgc-launcher-label { display: none; }
	.ttgc-root.is-open { inset: 0; z-index: 2147483000; }
	.ttgc-root.is-open .ttgc-panel { width: 100%; height: 100%; height: 100dvh; border-radius: 0; animation: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ttgc-panel, .ttgc-typing span { animation: none; }
	.ttgc-launcher { transition: none; }
}
@media print { .ttgc-root { display: none; } }
