/* Terrassi AI Vestlusbot – vestlusakna stiilid.
   Kõik klassid on prefiksiga .tvb-, et teema CSS ei segaks. */

#tvb-root {
	--tvb-color: #1a7a4f;
	/* Tumedam toon tuletatakse brändivärvist; vanemal brauseril jääb kehtima fallback. */
	--tvb-color-dark: #14603d;
	--tvb-color-dark: color-mix(in srgb, var(--tvb-color) 82%, black);
	--tvb-text: #1d2327;
	--tvb-bg: #ffffff;
	--tvb-bot-bg: #f3f4f6;
}

.tvb-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--tvb-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, background 0.15s ease;
}

.tvb-launcher:hover { transform: scale(1.06); background: var(--tvb-color-dark); }
.tvb-launcher svg { width: 30px; height: 30px; fill: #fff; }
.tvb-launcher.tvb-open { display: none; }

.tvb-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 40px);
	background: var(--tvb-bg);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--tvb-text);
}

.tvb-panel.tvb-open { display: flex; }

.tvb-header {
	background: var(--tvb-color);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.tvb-header .tvb-title { font-weight: 600; font-size: 16px; }
.tvb-header .tvb-sub { font-size: 12px; opacity: 0.85; }
.tvb-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

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

.tvb-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.tvb-msg.tvb-bot { background: var(--tvb-bot-bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.tvb-msg.tvb-user { background: var(--tvb-color); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.tvb-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--tvb-bot-bg); border-radius: 14px; }
.tvb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; animation: tvb-blink 1.3s infinite both; }
.tvb-typing span:nth-child(2) { animation-delay: 0.2s; }
.tvb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tvb-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.tvb-input {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.tvb-input textarea {
	flex: 1;
	resize: none;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 9px 11px;
	font: inherit;
	max-height: 110px;
	outline: none;
}
.tvb-input textarea:focus { border-color: var(--tvb-color); }
.tvb-send {
	border: none;
	background: var(--tvb-color);
	color: #fff;
	border-radius: 10px;
	width: 42px;
	height: 42px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}
.tvb-send:hover { background: var(--tvb-color-dark); }
.tvb-send:disabled { opacity: 0.5; cursor: default; }
.tvb-send svg { width: 20px; height: 20px; fill: #fff; }

.tvb-foot { text-align: center; font-size: 11px; color: #9aa0a6; padding: 0 0 8px; background: #fff; }

@media (max-width: 480px) {
	.tvb-panel { right: 0; bottom: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; }
	.tvb-launcher { right: 14px; bottom: 14px; }
}
