.tfgg-tania {
	--tfgg-tania-accent: #ffb347;
	--tfgg-tania-dark: #20252b;
	--tfgg-tania-light: #f7f5f0;
	--tfgg-tania-border: #d8d6d0;
	--tfgg-tania-focus: #1473e6;
	position: fixed;
	top: 50%;
	right: 24px;
	bottom: auto;
	transform: translateY(-50%);
	z-index: 99999;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.45;
}

.tfgg-tania *,
.tfgg-tania *::before,
.tfgg-tania *::after {
	box-sizing: border-box;
}

.tfgg-tania [hidden] { display: none !important; }
.tfgg-tania button,
.tfgg-tania textarea { font: inherit; }

.tfgg-tania button:focus-visible,
.tfgg-tania textarea:focus-visible {
	outline: 3px solid var(--tfgg-tania-focus);
	outline-offset: 2px;
}

.tfgg-tania__launcher {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 52px;
	padding: 10px 18px;
	border: 0;
	border-radius: 999px;
	background: #42251a;
	color: #fff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.tfgg-tania__launcher-icon {
	display: block;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	object-fit: contain;
}

.tfgg-tania__launcher-label {
	color: var(--tfgg-tania-accent) !important;
	font-weight: 700;
}
.tfgg-tania--open .tfgg-tania__launcher { display: none; }

.tfgg-tania__dialog {
	display: flex;
	width: min(390px, calc(100vw - 32px));
	height: min(650px, calc(100vh - 48px));
	min-height: 420px;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--tfgg-tania-border);
	border-radius: 16px;
	background: #fff;
	color: #20252b;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

.tfgg-tania__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	background: #42251a;
	color: var(--tfgg-tania-accent);
}

.tfgg-tania__header h2,
.tfgg-tania__header p { margin: 0; color: inherit; }
.tfgg-tania__header h2 { font-size: 1.3rem; line-height: 1.2; }
.tfgg-tania__header p { margin-top: 4px; font-size: 0.9rem; line-height: 1.3; }

.tfgg-tania__header-identity {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 10px;
}

.tfgg-tania__icon {
	display: block;
	width: 52px;
	height: 52px;
	flex: 0 0 52px;
	object-fit: contain;
}

.tfgg-tania__heading { min-width: 0; }

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

.tfgg-tania__close {
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--tfgg-tania-accent) !important;
	font-size: 2.75rem !important;
	font-weight: 400;
	line-height: 0.9 !important;
	cursor: pointer;
}

.tfgg-tania__messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	background: #faddc7;
	overscroll-behavior: contain;
}

.tfgg-tania__message {
	width: fit-content;
	max-width: 88%;
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	overflow-wrap: anywhere;
}

.tfgg-tania__message--assistant {
	background: #fff;
	color: #20252b;
}

.tfgg-tania__message--user {
	margin-left: auto;
	background: var(--tfgg-tania-accent);
	color: #42251a;
}

.tfgg-tania__message-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 3px;
}

.tfgg-tania__message-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 700;
	opacity: 0.9;
}

.tfgg-tania__message-time {
	font: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	opacity: 0.9;
}

.tfgg-tania__message p { margin: 0; color: inherit; white-space: pre-wrap; }

.tfgg-tania__message--typing {
	min-width: 86px;
}

.tfgg-tania__typing-dots {
	display: flex;
	align-items: center;
	gap: 5px;
	height: 18px;
}

.tfgg-tania__typing-dots > span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #42251a;
	animation: tfgg-tania-typing 1.1s infinite ease-in-out;
}

.tfgg-tania__typing-dots > span:nth-child(2) { animation-delay: 140ms; }
.tfgg-tania__typing-dots > span:nth-child(3) { animation-delay: 280ms; }

@keyframes tfgg-tania-typing {
	0%,
	60%,
	100% { opacity: 0.35; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-4px); }
}

.tfgg-tania__form {
	padding: 10px 14px 8px;
	border-top: 1px solid var(--tfgg-tania-border);
	background: #fff;
}

.tfgg-tania__composer {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.tfgg-tania__form textarea {
	display: block;
	width: auto;
	min-height: 64px;
	max-height: 140px;
	flex: 1 1 auto;
	resize: vertical;
	padding: 10px;
	border: 1px solid #888;
	border-radius: 8px;
	background: #fff;
	color: #20252b;
}

.tfgg-tania__clear {
	padding: 7px 9px;
	border: 1px solid var(--tfgg-tania-accent);
	border-radius: 6px;
	background: transparent;
	color: var(--tfgg-tania-accent) !important;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.tfgg-tania__clear:hover,
.tfgg-tania__clear:focus-visible {
	background: var(--tfgg-tania-accent);
	color: #42251a !important;
}

.tfgg-tania__send {
	min-width: 82px;
	padding: 9px 14px;
	border: 0;
	border-radius: 8px;
	background: #42251a;
	color: var(--tfgg-tania-accent) !important;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.tfgg-tania__send:hover,
.tfgg-tania__send:focus-visible {
	background: var(--tfgg-tania-accent);
	color: #42251a !important;
}

.tfgg-tania button:disabled,
.tfgg-tania textarea:disabled { cursor: not-allowed; opacity: 0.55; }

.tfgg-tania__status {
	min-height: 0;
	margin: 0;
	padding: 4px 14px;
	background: #fff;
	color: #4a4f55;
	font-size: 0.85rem;
}

.tfgg-tania__status:empty { display: none; }

.tfgg-tania__notice {
	margin: 0;
	padding: 7px 14px 12px;
	background: #fff;
	color: #555;
	font-size: 0.82rem;
	line-height: 1.45;
}

.tfgg-tania__screen-reader {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media (max-width: 520px) {
	.tfgg-tania { right: 12px; bottom: auto; left: 12px; }
	.tfgg-tania__launcher { margin-left: auto; }
	.tfgg-tania__dialog { width: 100%; height: min(700px, calc(100dvh - 24px)); min-height: 0; }
}

@media (prefers-reduced-motion: no-preference) {
	.tfgg-tania__launcher,
	.tfgg-tania__dialog { animation: tfgg-tania-enter 160ms ease-out; }

	@keyframes tfgg-tania-enter {
		from { opacity: 0; transform: translateY(8px); }
		to { opacity: 1; transform: translateY(0); }
	}
}

@media (prefers-reduced-motion: reduce) {
	.tfgg-tania__typing-dots > span {
		animation: none;
		opacity: 0.75;
	}
}
