/* HCY Chat Widget — floating WhatsApp / WeChat buttons.
   Scoped to .hcy-chat, no external dependencies, ~2KB minified. */

.hcy-chat {
	position: fixed;
	z-index: 9998;
	display: flex;
	align-items: flex-end;
	gap: .5rem;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--hcy-chat-radius: 999px;
}

.hcy-chat--right-bottom { right: 20px; bottom: 20px; flex-direction: column; align-items: flex-end; }
.hcy-chat--right-middle { right: 20px; top: 50%; transform: translateY(-50%); flex-direction: column; align-items: flex-end; }
.hcy-chat--left-bottom  { left: 20px; bottom: 20px; flex-direction: column; align-items: flex-start; }

.hcy-chat__buttons { display: flex; flex-direction: column; gap: .5rem; }

.hcy-chat__btn {
	display: inline-flex; align-items: center; gap: .55rem;
	padding: .7rem 1.05rem; border: 0; border-radius: var(--hcy-chat-radius);
	color: #fff; font-size: .92rem; font-weight: 600; line-height: 1;
	cursor: pointer; text-decoration: none;
	box-shadow: 0 6px 18px -6px rgba(16, 24, 40, .45);
	transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.hcy-chat__btn:hover,
.hcy-chat__btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px -8px rgba(16, 24, 40, .5);
	color: #fff;
	filter: brightness(1.05);
}

.hcy-chat__btn:focus-visible { outline: 3px solid #0b57a4; outline-offset: 2px; }

.hcy-chat__btn--wa { background: #25d366; }
.hcy-chat__btn--wc { background: #07c160; }

.hcy-chat__btn svg { flex: 0 0 auto; }

.hcy-chat__label { white-space: nowrap; }

/* Icon-only mode */
.hcy-chat--icons .hcy-chat__btn { padding: .75rem; }
.hcy-chat--icons .hcy-chat__label { display: none; }

/* WeChat panel */
.hcy-chat__panel {
	position: relative;
	width: 260px;
	padding: 1.1rem 1.1rem 1.25rem;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 18px 44px -18px rgba(16, 24, 40, .45);
	text-align: center;
	margin-bottom: .1rem;
}

.hcy-chat__panel[hidden] { display: none; }

.hcy-chat__title {
	margin: 0 0 .8rem;
	font-size: .95rem;
	font-weight: 700;
	color: #111827;
}

.hcy-chat__qr {
	display: block;
	width: 100%;
	max-width: 200px;
	height: auto;
	margin: 0 auto .8rem;
	border-radius: 8px;
}

.hcy-chat__empty {
	margin: 0 0 .8rem;
	font-size: .85rem;
	color: #5b6b7f;
}

.hcy-chat__hint {
	margin: 0 0 .6rem;
	font-size: .82rem;
	color: #5b6b7f;
	line-height: 1.45;
}

.hcy-chat__id {
	display: flex; align-items: center; gap: .4rem;
	justify-content: center;
}

.hcy-chat__id code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .85rem;
	background: #f5f8fc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: .35rem .55rem;
	color: #111827;
	overflow-wrap: anywhere;
}

.hcy-chat__copy {
	border: 1px solid #0b57a4;
	background: #fff;
	color: #0b57a4;
	border-radius: 6px;
	padding: .32rem .55rem;
	font-size: .78rem;
	font-weight: 600;
	cursor: pointer;
}

.hcy-chat__copy:hover { background: #e8f1fb; }
.hcy-chat__copy.is-done { background: #0a7a3d; border-color: #0a7a3d; color: #fff; }

.hcy-chat__close {
	position: absolute; top: 6px; right: 6px;
	width: 28px; height: 28px;
	display: grid; place-items: center;
	border: 0; border-radius: 6px;
	background: transparent; color: #5b6b7f;
	cursor: pointer;
}

.hcy-chat__close:hover { background: #f0f4f9; color: #111827; }

/* Mobile */
@media (max-width: 640px) {
	.hcy-chat--desktop-only { display: none !important; }

	.hcy-chat--right-bottom { right: 12px; bottom: 12px; }
	.hcy-chat--left-bottom { left: 12px; bottom: 12px; }

	.hcy-chat__btn { padding: .65rem .85rem; font-size: .85rem; }
	.hcy-chat__label { display: none; }
	.hcy-chat__btn { padding: .8rem; }

	.hcy-chat__panel { width: calc(100vw - 48px); max-width: 300px; }
}

@media (prefers-reduced-motion: reduce) {
	.hcy-chat__btn { transition: none; }
	.hcy-chat__btn:hover, .hcy-chat__btn:focus-visible { transform: none; }
}
