:root {
	--tdc-ink: #102b33;
	--tdc-muted: #60737a;
	--tdc-line: #d9e7e8;
	--tdc-panel: #fbfefe;
	--tdc-accent: #31aaa8;
	--tdc-accent-dark: #1c7f7e;
	--tdc-warm: #f7f2e9;
	--tdc-danger: #b72f3a;
}

.tdc-widget {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1200;
	font-family: "Trebuchet MS", Verdana, sans-serif;
	color: var(--tdc-ink);
}

.tdc-widget * {
	box-sizing: border-box;
	letter-spacing: 0;
}

.tdc-widget button,
.tdc-widget input,
.tdc-widget textarea {
	font-family: inherit;
}

.tdc-launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 54px;
	padding: 6px 16px 6px 8px;
	border: 0;
	border-radius: 8px;
	background: var(--tdc-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	box-shadow: 0 10px 28px rgba(16, 43, 51, .18);
	cursor: pointer;
	isolation: isolate;
	transform-origin: calc(100% - 28px) 50%;
	animation: tdc-invite-nudge 7.5s ease-in-out 1.8s infinite;
	transition: background .2s ease, box-shadow .2s ease;
}

.tdc-launcher:after {
	content: "";
	position: absolute;
	inset: -6px;
	z-index: -1;
	border: 2px solid rgba(49, 170, 168, .34);
	border-radius: 10px;
	opacity: 0;
	transform: scale(.94);
	animation: tdc-invite-ring 7.5s ease-out 1.8s infinite;
	pointer-events: none;
}

.tdc-launcher:hover {
	background: var(--tdc-accent-dark);
	box-shadow: 0 14px 34px rgba(16, 43, 51, .24);
}

.tdc-launcher-icon {
	display: block;
	width: 42px;
	height: 42px;
	padding: 3px;
	border-radius: 8px;
	background: rgba(255, 255, 255, .96);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 6px 16px rgba(16, 43, 51, .18);
	object-fit: contain;
	transform-origin: 50% 70%;
	animation: tdc-invite-icon 7.5s ease-in-out 1.8s infinite;
}

.tdc-widget.open .tdc-launcher,
.tdc-widget.open .tdc-launcher:after,
.tdc-widget.open .tdc-launcher-icon {
	animation: none;
}

.tdc-panel {
	position: fixed;
	right: 24px;
	bottom: 88px;
	z-index: 1201;
	display: none;
	width: min(420px, calc(100vw - 32px));
	height: min(660px, calc(100vh - 112px));
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	background: var(--tdc-panel);
	box-shadow: 0 20px 60px rgba(16, 43, 51, .22);
	overflow: hidden;
}

.tdc-panel.open {
	display: grid;
	grid-template-rows: auto 1fr auto;
}

.tdc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--tdc-line);
	background: #fff;
}

.tdc-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.tdc-head-icon {
	display: block;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 3px;
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	background: #f7fcfc;
	object-fit: contain;
	box-shadow: 0 6px 16px rgba(16, 43, 51, .08);
}

.tdc-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
}

.tdc-subtitle {
	margin-top: 2px;
	font-size: 12px;
	color: var(--tdc-muted);
}

.tdc-head-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.tdc-clear {
	min-height: 34px;
	padding: 0 10px;
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	background: #fff;
	color: var(--tdc-muted);
	font-size: 12px;
	cursor: pointer;
}

.tdc-clear:hover {
	color: var(--tdc-danger);
	border-color: #efc3c8;
}

.tdc-close {
	width: 34px;
	height: 34px;
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	background: #fff;
	color: var(--tdc-ink);
	cursor: pointer;
}

.tdc-messages {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	overflow: auto;
	background: linear-gradient(180deg, #f8fcfc 0%, #fff 100%);
}

.tdc-message {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.45;
}

.tdc-message.bot {
	align-self: flex-start;
	border: 1px solid var(--tdc-line);
	background: #fff;
}

.tdc-message.user {
	align-self: flex-end;
	background: var(--tdc-accent);
	color: #fff;
}

.tdc-disclaimer {
	border-left: 3px solid var(--tdc-accent);
	background: var(--tdc-warm);
	color: var(--tdc-ink);
}

.tdc-cards {
	display: grid;
	gap: 10px;
}

.tdc-card {
	display: grid;
	grid-template-columns: 58px 1fr;
	gap: 10px;
	padding: 10px;
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	background: #fff;
}

.tdc-card.no-image {
	grid-template-columns: 1fr;
}

.tdc-card img {
	width: 58px;
	height: 58px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--tdc-warm);
}

.tdc-card-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
}

.tdc-card-meta {
	margin-top: 4px;
	font-size: 12px;
	color: var(--tdc-muted);
	line-height: 1.35;
}

.tdc-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.tdc-card-actions a,
.tdc-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 0 10px;
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	background: #fff;
	color: var(--tdc-accent-dark);
	font-size: 12px;
	text-decoration: none;
	cursor: pointer;
}

.tdc-card-actions a.primary {
	border-color: var(--tdc-accent);
	background: var(--tdc-accent);
	color: #fff;
}

.tdc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tdc-retry {
	margin-top: -4px;
}

.tdc-retry .tdc-action {
	border-color: var(--tdc-accent);
	color: var(--tdc-accent-dark);
	font-weight: 700;
}

.tdc-form {
	display: grid;
	grid-template-columns: 1fr 42px;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--tdc-line);
	background: #fff;
}

.tdc-input {
	min-height: 42px;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--tdc-line);
	border-radius: 8px;
	outline: none;
	color: var(--tdc-ink);
}

.tdc-input:focus {
	border-color: var(--tdc-accent);
}

.tdc-send {
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 8px;
	background: var(--tdc-accent);
	color: #fff;
	cursor: pointer;
}

.tdc-send:before {
	content: "";
	display: block;
	width: 0;
	height: 0;
	margin: 0 auto;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 13px solid #fff;
	transform: translateX(2px);
}

.tdc-send[disabled] {
	background: #a8c9ca;
	cursor: wait;
}

@keyframes tdc-invite-nudge {
	0%, 68%, 100% {
		transform: translateY(0) scale(1);
	}
	71% {
		transform: translateY(-2px) scale(1.012);
	}
	74% {
		transform: translateY(0) scale(1);
	}
	77% {
		transform: translateY(-1px) scale(1.006);
	}
	80% {
		transform: translateY(0) scale(1);
	}
}

@keyframes tdc-invite-ring {
	0%, 66%, 100% {
		opacity: 0;
		transform: scale(.94);
	}
	70% {
		opacity: .42;
	}
	84% {
		opacity: 0;
		transform: scale(1.16);
	}
}

@keyframes tdc-invite-icon {
	0%, 68%, 100% {
		transform: translateY(0) rotate(0);
	}
	71% {
		transform: translateY(-2px) rotate(-3deg);
	}
	75% {
		transform: translateY(0) rotate(2deg);
	}
	79% {
		transform: translateY(-1px) rotate(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tdc-launcher,
	.tdc-launcher:after,
	.tdc-launcher-icon {
		animation: none;
	}
}

@media (max-width: 520px) {
	.tdc-widget {
		right: 12px;
		bottom: 12px;
	}

	.tdc-panel {
		right: 8px;
		bottom: 68px;
		width: calc(100vw - 16px);
		height: min(640px, calc(100vh - 92px));
	}

	.tdc-launcher {
		min-height: 44px;
		padding: 0 12px;
	}

	.tdc-launcher-icon {
		width: 36px;
		height: 36px;
	}
}
