.tots-chat,
.tots-chat * {
	box-sizing: border-box;
}

.tots-chat {
	--ink: #e8eef8;
	--muted: #93a0b8;
	--gold: #e8b86d;
	--mint: #3ee0a0;
	--red: #ff5d73;
	--panel: #10192b;
	width: 100%;
	max-width: none;
	margin: 0;
	color: var(--ink);
	font-family: "Segoe UI", system-ui, sans-serif;
	line-height: 1.45;
	container-type: inline-size;
}

.tots-chat__frame {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	height: var(--tots-h, 680px);
	min-height: 520px;
	border-radius: 28px;
	overflow: hidden;
	border: 1px solid rgba(232, 184, 109, 0.28);
	background:
		radial-gradient(900px 320px at 0% -10%, rgba(62, 224, 160, 0.16), transparent 50%),
		radial-gradient(700px 380px at 100% 0%, rgba(232, 184, 109, 0.18), transparent 46%),
		linear-gradient(180deg, #141c2e 0%, #090d16 100%);
	box-shadow: 0 28px 70px rgba(4, 8, 18, 0.35);
}

.tots-chat__aside,
.tots-chat__main {
	min-width: 0;
	min-height: 0;
}

.tots-chat__aside {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 22px 18px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%), #0c1322;
	border-right: 1px solid rgba(232, 184, 109, 0.16);
}

.tots-chat__brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tots-chat__kicker {
	margin: 0;
	color: var(--gold);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.tots-chat__name {
	margin: 2px 0 0;
	font-size: 22px;
	line-height: 1.1;
	font-weight: 700;
	color: #fff;
}

.tots-chat__header .tots-chat__name {
	font-size: 18px;
}

.tots-scene {
	width: 100%;
	height: auto;
	display: block;
	filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

.tots-scene__line {
	stroke-dasharray: 520;
	stroke-dashoffset: 520;
	animation: tots-draw 2.2s ease forwards;
}

.tots-points {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.tots-points li {
	display: grid;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(232, 238, 248, 0.08);
}

.tots-points strong {
	color: #fff;
	font-size: 14px;
}

.tots-points span {
	color: var(--muted);
	font-size: 13px;
}

.tots-chat__main {
	display: flex;
	flex-direction: column;
	background: linear-gradient(180deg, rgba(16, 25, 43, 0.2), rgba(8, 12, 20, 0.55));
}

.tots-chat__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px 10px;
}

.tots-chat__brand--bar {
	flex: 1;
	min-width: 0;
}

.tots-chat__status {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 2px 0 0;
	color: var(--muted);
	font-size: 13px;
}

.tots-chat__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mint);
	box-shadow: 0 0 0 0 rgba(62, 224, 160, 0.7);
	animation: tots-ping 2s infinite;
}

.tots-candles {
	display: flex;
	align-items: flex-end;
	gap: 5px;
	height: 36px;
	padding: 0 4px;
}

.tots-candles span {
	width: 7px;
	height: var(--h);
	border-radius: 2px;
	transform-origin: bottom;
	animation: tots-candle 2.8s ease-in-out infinite;
	animation-delay: var(--d);
}

.tots-candles .is-up {
	background: linear-gradient(#d9ffe9, var(--mint));
}

.tots-candles .is-down {
	background: linear-gradient(#ffd0d6, var(--red));
}

.tots-chat__reset,
.tots-chip,
.tots-chat__send {
	font-family: inherit;
	cursor: pointer;
}

.tots-chat__reset {
	appearance: none;
	-webkit-appearance: none;
	margin: 0 !important;
	border: 1px solid rgba(232, 184, 109, 0.35) !important;
	background: transparent !important;
	color: var(--gold) !important;
	border-radius: 999px !important;
	padding: 6px 12px !important;
	line-height: 1.2 !important;
	height: auto !important;
	min-height: 0 !important;
	width: auto !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
}

.tots-tape {
	overflow: hidden;
	border-top: 1px solid rgba(232, 238, 248, 0.06);
	border-bottom: 1px solid rgba(232, 238, 248, 0.06);
	background: rgba(0, 0, 0, 0.18);
}

.tots-tape__track {
	display: flex;
	gap: 22px;
	width: max-content;
	padding: 7px 0;
	animation: tots-marquee 28s linear infinite;
}

.tots-tape__track span {
	color: #c5d0e4;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.tots-tape__track span::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 22px;
	border-radius: 50%;
	background: var(--gold);
	vertical-align: middle;
}

.tots-chat__log {
	flex: 1;
	overflow: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}

.tots-msg {
	display: flex;
	gap: 10px;
	max-width: min(100%, 640px);
	animation: tots-in 0.28s ease;
}

.tots-msg.is-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.tots-msg__avatar {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	font-size: 11px;
	font-weight: 700;
	color: #1a1408;
	background: linear-gradient(160deg, #ffe3b0, var(--gold));
}

.tots-msg.is-user .tots-msg__avatar {
	color: #06281c;
	background: linear-gradient(160deg, #dcfff1, var(--mint));
}

.tots-msg__body {
	padding: 10px 12px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(232, 238, 248, 0.08);
	color: var(--ink);
	font-size: 14.5px;
}

.tots-msg.is-user .tots-msg__body {
	background: rgba(232, 184, 109, 0.12);
	border-color: rgba(232, 184, 109, 0.28);
}

.tots-msg.is-error .tots-msg__body {
	border-color: rgba(255, 93, 115, 0.45);
}

.tots-msg__body p {
	margin: 0 0 8px;
}

.tots-msg__body p:last-child,
.tots-msg__body ul:last-child {
	margin-bottom: 0;
}

.tots-msg__body ul {
	margin: 0;
	padding-left: 18px;
}

.tots-msg__body li + li {
	margin-top: 4px;
}

.tots-typing {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	height: 16px;
}

.tots-typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--gold);
	animation: tots-bounce 1s infinite;
}

.tots-typing i:nth-child(2) { animation-delay: 0.15s; }
.tots-typing i:nth-child(3) { animation-delay: 0.3s; }

.tots-chat__composer {
	margin: 14px 14px 0;
	padding: 14px;
	border-radius: 20px;
	background: #070b14;
	border: 1px solid rgba(232, 184, 109, 0.55);
	box-shadow: 0 0 0 1px rgba(232, 184, 109, 0.12), 0 14px 30px rgba(0, 0, 0, 0.28);
}

.tots-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px 2px 8px;
	margin: 0 0 20px;
	scrollbar-width: thin;
	scrollbar-color: rgba(232, 184, 109, 0.6) transparent;
}

.tots-chips::-webkit-scrollbar {
	height: 8px;
}

.tots-chips::-webkit-scrollbar-thumb {
	background: rgba(232, 184, 109, 0.6);
	border-radius: 999px;
}

.tots-chips::-webkit-scrollbar-track {
	background: transparent;
}

.tots-chip {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	margin: 0 !important;
	border-radius: 999px !important;
	border: 1px solid rgba(232, 184, 109, 0.32) !important;
	background: rgba(255, 255, 255, 0.03) !important;
	color: #f4f7fb !important;
	padding: 7px 12px !important;
	font-size: 12.5px !important;
	line-height: 1.3 !important;
	height: auto !important;
	min-height: 0 !important;
	width: auto !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-weight: 600 !important;
}

.tots-chip:hover,
.tots-chat__reset:hover {
	border-color: var(--gold) !important;
	background: rgba(232, 184, 109, 0.12) !important;
}

.tots-chat__form {
	display: flex;
	gap: 10px;
	align-items: flex-end;
	padding: 0;
}

.tots-chat__input {
	flex: 1;
	resize: none;
	width: 100% !important;
	max-width: none !important;
	min-height: 64px !important;
	max-height: 120px;
	margin: 0 !important;
	padding: 16px 16px !important;
	border-radius: 16px !important;
	border: 1px solid rgba(232, 184, 109, 0.7) !important;
	background: #121a2c !important;
	color: #f4f7fb !important;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.25) !important;
	font-family: inherit !important;
	font-size: 16px !important;
	line-height: 1.4 !important;
	overflow: hidden !important;
}

.tots-chat__input::placeholder {
	color: #7f8da6;
}

.tots-chat__input:focus {
	outline: none;
	border-color: rgba(232, 184, 109, 0.85) !important;
	box-shadow: 0 0 0 4px rgba(232, 184, 109, 0.15) !important;
}

.tots-chat__send {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	height: 64px !important;
	min-height: 64px !important;
	padding: 0 16px !important;
	border: 0 !important;
	border-radius: 16px !important;
	background: linear-gradient(180deg, #f3d7a4, #e0a84a) !important;
	color: #1a1408 !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1 !important;
	width: auto !important;
	box-shadow: none !important;
}

.tots-chat__send:disabled {
	opacity: 0.45;
	cursor: default;
}

.tots-chat__hint,
.tots-chat__disclaimer,
.tots-chat__noscript {
	margin: 10px 18px 0;
	color: var(--muted);
	font-size: 12px;
}

.tots-chat__disclaimer {
	margin-bottom: 14px;
}

.tots-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.tots-admin__shortcode {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0;
}

.tots-admin__shortcode code {
	font-size: 14px;
	padding: 6px 10px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.tots-admin .notice.inline {
	margin: 12px 0;
}

@keyframes tots-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes tots-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@keyframes tots-ping {
	0% { box-shadow: 0 0 0 0 rgba(62, 224, 160, 0.55); }
	70% { box-shadow: 0 0 0 8px rgba(62, 224, 160, 0); }
	100% { box-shadow: 0 0 0 0 rgba(62, 224, 160, 0); }
}

@keyframes tots-candle {
	0%, 100% { transform: scaleY(0.82); }
	50% { transform: scaleY(1); }
}

@keyframes tots-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
	40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes tots-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

@container (max-width: 820px) {
	.tots-chat__frame {
		grid-template-columns: 1fr;
		height: auto;
		min-height: 0;
	}

	.tots-chat__aside {
		border-right: 0;
		border-bottom: 1px solid rgba(232, 184, 109, 0.16);
	}

	.tots-points {
		grid-template-columns: 1fr;
	}

	.tots-chat__log {
		min-height: 320px;
		max-height: 480px;
	}

}

.tots-chat.is-compact .tots-chat__aside {
	display: none;
}

.tots-chat.is-compact .tots-chat__frame {
	grid-template-columns: 1fr;
}

@media (max-width: 640px) {
	.tots-chat__frame {
		border-radius: 18px;
	}

	.tots-candles {
		display: none;
	}

	.tots-chat__send span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.tots-chat__send {
		width: 64px !important;
		padding: 0 !important;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tots-chat *,
	.tots-chat *::before {
		animation: none !important;
		scroll-behavior: auto !important;
	}

	.tots-scene__line {
		stroke-dashoffset: 0;
	}
}
