#twc-widget {
	--twc-accent: #2AABEE;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#twc-launcher {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: none;
	background: #ffffff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#twc-icon-close {
	background: var(--twc-accent);
	border-radius: 50%;
	padding: 7px;
	width: 34px;
	height: 34px;
	box-sizing: border-box;
}

#twc-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

#twc-launcher:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

#twc-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 330px;
	max-width: calc(100vw - 32px);
	height: 460px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	animation: twc-pop-in 0.16s ease-out;
}

#twc-panel.twc-hidden {
	display: none;
}

@keyframes twc-pop-in {
	from { opacity: 0; transform: scale(0.92) translateY(8px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

#twc-header {
	background: var(--twc-accent);
	color: #fff;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 600;
	flex-shrink: 0;
}

#twc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f4f6f8;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.twc-msg {
	display: flex;
	flex-direction: column;
	max-width: 80%;
}

.twc-msg-visitor {
	align-self: flex-end;
	align-items: flex-end;
}

.twc-msg-admin {
	align-self: flex-start;
	align-items: flex-start;
}

.twc-bubble {
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
}

.twc-msg-visitor .twc-bubble {
	background: var(--twc-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.twc-msg-admin .twc-bubble {
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #e3e6ea;
	border-bottom-left-radius: 4px;
}

.twc-time {
	font-size: 11px;
	color: #9aa3ab;
	margin-top: 3px;
	padding: 0 4px;
}

#twc-form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e8eaed;
	background: #fff;
	flex-shrink: 0;
}

#twc-input {
	flex: 1;
	border: 1px solid #dde1e5;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
}

#twc-input:focus {
	border-color: var(--twc-accent);
}

#twc-send {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: var(--twc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

#twc-send:disabled {
	opacity: 0.6;
	cursor: default;
}

@media (max-width: 420px) {
	#twc-panel {
		width: calc(100vw - 24px);
		right: -8px;
	}
}
