/* Link Chat Assistant, Humanity Link */
#hl-link-root {
	--hl-navy: #2e2842;
	--hl-cream: #fef9f2;
	--hl-ink: #2b2b33;
	--hl-muted: #6b6878;
	--hl-line: #e8e1d6;
	--hl-user: #2e2842;
	--hl-grad: linear-gradient(90deg, #ff1a1a 0%, #ff7a00 30%, #ffb000 45%, #20a050 60%, #00a0a8 78%, #0058b8 100%);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	font-family: Inter, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--hl-ink);
}
#hl-link-root *, #hl-link-root *::before, #hl-link-root *::after { box-sizing: border-box; }
#hl-link-root [hidden] { display: none !important; }

/* Launcher */
#hl-link-launcher {
	width: 64px; height: 64px; border-radius: 50%;
	border: 0; padding: 0; margin: 0; cursor: pointer;
	background: #fff;
	box-shadow: 0 6px 20px rgba(46, 40, 66, .22), 0 0 0 1px rgba(46, 40, 66, .06);
	display: grid; place-items: center;
	transition: transform .18s ease, box-shadow .18s ease;
	position: relative;
}
#hl-link-launcher:hover { transform: translateY(-2px) scale(1.04); }
#hl-link-launcher:hover, #hl-link-root.hl-link-open #hl-link-launcher {
	border: 3px solid transparent;
	background: linear-gradient(#fff, #fff) padding-box, var(--hl-grad) border-box;
}
#hl-link-launcher:focus-visible { outline: 3px solid #0058b8; outline-offset: 3px; }
.hl-link-launcher-img { width: 46px; height: auto; display: block; animation: hl-link-bob 3.2s ease-in-out infinite; }
@keyframes hl-link-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Greeting bubble */
#hl-link-greet {
	position: absolute; right: 0; bottom: 78px;
	background: #fff; color: var(--hl-ink);
	border-radius: 16px 16px 4px 16px;
	padding: 10px 34px 10px 14px; white-space: nowrap;
	box-shadow: 0 6px 20px rgba(46, 40, 66, .18);
	font-weight: 500; animation: hl-link-pop .25s ease-out;
}
#hl-link-greet span { cursor: pointer; }
.hl-link-greet-x {
	position: absolute; top: 4px; right: 6px; width: 24px; height: 24px;
	border: 0; background: none; color: var(--hl-muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0;
}

/* Panel */
#hl-link-panel {
	position: absolute; right: 0; bottom: 80px;
	width: 380px; height: min(600px, calc(100vh - 120px));
	background: var(--hl-cream);
	border-radius: 20px; overflow: hidden;
	box-shadow: 0 18px 50px rgba(46, 40, 66, .28), 0 0 0 1px rgba(46, 40, 66, .06);
	display: flex; flex-direction: column;
	animation: hl-link-pop .22s ease-out;
}
@keyframes hl-link-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.hl-link-head {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 14px 14px 16px;
	background: var(--hl-navy); color: #fff; position: relative;
}
.hl-link-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--hl-grad); }
.hl-link-avatar { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.hl-link-avatar img { width: 34px; height: auto; display: block; }
.hl-link-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hl-link-title strong { font-family: "Bebas Neue", Helvetica, Arial, sans-serif; font-size: 26px; font-weight: 400; letter-spacing: .03em; line-height: 1; }
.hl-link-title span { font-size: 13px; opacity: .8; }
.hl-link-close {
	width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; padding: 0;
}
.hl-link-close:hover { background: rgba(255, 255, 255, .2); }
.hl-link-close:focus-visible, .hl-link-send:focus-visible, .hl-link-chip:focus-visible { outline: 3px solid #00a0a8; outline-offset: 2px; }

.hl-link-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.hl-link-row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.hl-link-user { justify-content: flex-end; }
.hl-link-mini { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 1px 3px rgba(46, 40, 66, .12); }
.hl-link-mini img { width: 22px; height: auto; display: block; }
.hl-link-bubble {
	padding: 10px 13px; border-radius: 16px; max-width: 82%;
	overflow-wrap: anywhere; word-break: normal;
}
.hl-link-assistant .hl-link-bubble { background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(46, 40, 66, .08); }
.hl-link-user .hl-link-bubble { background: var(--hl-user); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.hl-link-error .hl-link-bubble { background: #fff4f2; color: #8a1f11; }
.hl-link-bubble p { margin: 0 0 .5em; }
.hl-link-bubble p:last-child { margin-bottom: 0; }
.hl-link-bubble ul { margin: .2em 0 .5em; padding-left: 1.2em; }
.hl-link-bubble li { margin: .15em 0; }
.hl-link-bubble a { color: #0058b8; text-decoration: underline; }
.hl-link-bubble strong { font-weight: 600; }

.hl-link-typing .hl-link-bubble { display: flex; gap: 4px; padding: 14px 14px; }
.hl-link-typing .hl-link-bubble span { width: 7px; height: 7px; border-radius: 50%; background: #b8b3c4; animation: hl-link-dot 1.2s infinite ease-in-out; }
.hl-link-typing .hl-link-bubble span:nth-child(2) { animation-delay: .15s; }
.hl-link-typing .hl-link-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes hl-link-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.hl-link-actions { padding: 4px 14px 8px; display: flex; gap: 8px; }
.hl-link-chip {
	display: inline-block; font-size: 13px; font-weight: 500; text-decoration: none;
	color: var(--hl-navy); background: #fff; border: 1px solid var(--hl-line);
	border-radius: 999px; padding: 6px 12px;
}
.hl-link-chip:hover { border-color: var(--hl-navy); }

.hl-link-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; background: #fff; border: 1px solid var(--hl-line); border-radius: 22px; }
.hl-link-form:focus-within { border-color: var(--hl-navy); }
#hl-link-input {
	flex: 1; resize: none; border: 0; outline: 0; background: transparent;
	font: inherit; color: inherit; padding: 7px 0; margin: 0; min-height: 22px; max-height: 120px; box-shadow: none;
}
.hl-link-send {
	width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
	background: var(--hl-navy); color: #fff; display: grid; place-items: center; padding: 0;
}
.hl-link-send:disabled { opacity: .5; cursor: default; }
/* Turnstile stays in the layout (it hides itself unless a visitor must interact). */
.hl-link-ts { display: flex; justify-content: center; padding: 0 12px; max-height: 0; overflow: hidden; }
.hl-link-ts.hl-link-ts-visible { max-height: 90px; padding-bottom: 8px; }
.hl-link-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.hl-link-note { margin: 8px 14px 12px; font-size: 11.5px; color: var(--hl-muted); line-height: 1.35; }
.hl-link-note a { color: inherit; text-decoration: underline; }

/* Phones: full-width sheet */
@media (max-width: 480px) {
	#hl-link-root { right: 16px; bottom: 16px; }
	#hl-link-panel {
		position: fixed; left: 0; right: 0; bottom: 0; top: auto;
		width: 100%; height: 88vh; height: 88dvh; border-radius: 20px 20px 0 0;
	}
	#hl-link-root.hl-link-open #hl-link-launcher, #hl-link-root.hl-link-open #hl-link-greet { display: none; }
	#hl-link-input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	#hl-link-root *, #hl-link-launcher { animation: none !important; transition: none !important; }
}
