/* SyntexDev AI Chat Assistant */
#sxcb-root {
	--sx-bg: #121212;
	--sx-panel: #181818;
	--sx-bubble: #222222;
	--sx-border: #2c2c2c;
	--sx-text: #ffffff;
	--sx-muted: #a5a5a5;
	--sx-accent: #ff9776;
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	font-family: "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 300;
	color: var(--sx-text);
	line-height: 1.5;
}
#sxcb-root *, #sxcb-root *::before, #sxcb-root *::after { box-sizing: border-box; }

/* Launcher */
#sxcb-root .sxcb-launch {
	display: flex; align-items: center; gap: 10px;
	height: 56px; padding: 0 22px 0 18px;
	background: var(--sx-bg); color: var(--sx-text);
	border: 1px solid var(--sx-accent); border-radius: 999px;
	font: inherit; font-size: 16px; font-weight: 400; letter-spacing: .02em;
	cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.45);
	transition: background .2s, color .2s, transform .2s;
}
#sxcb-root .sxcb-launch:hover, #sxcb-root .sxcb-launch:focus-visible { background: var(--sx-accent); color: #121212; outline: none; }
#sxcb-root .sxcb-launch svg { width: 22px; height: 22px; flex: none; }
#sxcb-root .sxcb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sx-accent); box-shadow: 0 0 0 0 rgba(255,151,118,.6); animation: sxcb-pulse 2s infinite; }
#sxcb-root .sxcb-launch:hover .sxcb-dot { background: #121212; }
#sxcb-root.sxcb-open .sxcb-launch { display: none; }
@keyframes sxcb-pulse { 70% { box-shadow: 0 0 0 10px rgba(255,151,118,0); } 100% { box-shadow: 0 0 0 0 rgba(255,151,118,0); } }

/* Panel */
#sxcb-root .sxcb-panel {
	display: none; flex-direction: column;
	width: 380px; height: min(600px, calc(100vh - 48px));
	background: var(--sx-bg); border: 1px solid var(--sx-border); border-radius: 20px;
	overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
#sxcb-root.sxcb-open .sxcb-panel { display: flex; animation: sxcb-in .22s ease-out; }
@keyframes sxcb-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

#sxcb-root .sxcb-head {
	display: flex; align-items: center; gap: 8px;
	padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--sx-border); background: var(--sx-panel);
}
#sxcb-root .sxcb-avatar {
	width: 36px; height: 36px; border-radius: 50%; flex: none;
	border: 1px solid var(--sx-accent); color: var(--sx-accent);
	display: grid; place-items: center; font-weight: 500; font-size: 14px;
}
#sxcb-root .sxcb-head-text { flex: 1; min-width: 0; margin-left: 4px; }
#sxcb-root .sxcb-title { font-size: 16px; font-weight: 500; margin: 0; color: var(--sx-text); }
#sxcb-root .sxcb-sub { font-size: 12px; color: var(--sx-muted); display: flex; align-items: center; gap: 6px; }
#sxcb-root .sxcb-sub::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
#sxcb-root .sxcb-icon {
	width: 34px; height: 34px; border-radius: 50%; flex: none;
	background: transparent; border: 1px solid var(--sx-border); color: var(--sx-text);
	cursor: pointer; display: grid; place-items: center; padding: 0;
}
#sxcb-root .sxcb-icon:hover, #sxcb-root .sxcb-icon:focus-visible { border-color: var(--sx-accent); color: var(--sx-accent); outline: none; }
#sxcb-root .sxcb-icon svg { width: 16px; height: 16px; }
#sxcb-root .sxcb-icon[hidden] { display: none; }
#sxcb-root .sxcb-reset svg { width: 17px; height: 17px; }

/* Messages */
#sxcb-root .sxcb-log {
	flex: 1; overflow-y: auto; padding: 20px 16px 8px;
	display: flex; flex-direction: column; gap: 12px;
	scrollbar-width: thin; scrollbar-color: var(--sx-border) transparent;
}
#sxcb-root .sxcb-msg { max-width: 88%; font-size: 14.5px; word-wrap: break-word; }
#sxcb-root .sxcb-msg p { margin: 0 0 8px; }
#sxcb-root .sxcb-msg p:last-child { margin-bottom: 0; }
#sxcb-root .sxcb-msg ul { margin: 4px 0 8px; padding-left: 18px; }
#sxcb-root .sxcb-msg li { margin: 2px 0; }
#sxcb-root .sxcb-msg strong { font-weight: 500; color: var(--sx-text); }
#sxcb-root .sxcb-bot .sxcb-bubble {
	background: var(--sx-bubble); border: 1px solid var(--sx-border);
	border-radius: 16px 16px 16px 4px; padding: 12px 14px; color: #e6e6e6;
}
#sxcb-root .sxcb-bot a { color: var(--sx-accent); text-decoration: underline; text-underline-offset: 2px; }
#sxcb-root .sxcb-user { align-self: flex-end; }
#sxcb-root .sxcb-user .sxcb-bubble {
	background: transparent; border: 1px solid var(--sx-accent); color: var(--sx-text);
	border-radius: 16px 16px 4px 16px; padding: 10px 14px;
}

/* Link pills under a bot reply */
#sxcb-root .sxcb-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#sxcb-root .sxcb-pill {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 14px; border: 1px solid var(--sx-border); border-radius: 999px;
	color: var(--sx-text) !important; text-decoration: none !important; font-size: 13px; font-weight: 400;
	transition: border-color .2s, color .2s;
}
#sxcb-root .sxcb-pill::after { content: "\2192"; color: var(--sx-accent); }
#sxcb-root .sxcb-pill:hover, #sxcb-root .sxcb-pill:focus-visible { border-color: var(--sx-accent); color: var(--sx-accent) !important; outline: none; }

/* Suggested questions */
#sxcb-root .sxcb-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
#sxcb-root .sxcb-chip {
	background: transparent; color: var(--sx-text); font: inherit; font-size: 13px; font-weight: 300;
	border: 1px solid var(--sx-border); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
#sxcb-root .sxcb-chip:hover, #sxcb-root .sxcb-chip:focus-visible { border-color: var(--sx-accent); color: var(--sx-accent); outline: none; }

/* Typing */
#sxcb-root .sxcb-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
#sxcb-root .sxcb-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--sx-muted); animation: sxcb-blink 1.2s infinite; }
#sxcb-root .sxcb-typing span:nth-child(2) { animation-delay: .2s; }
#sxcb-root .sxcb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sxcb-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Composer */
#sxcb-root .sxcb-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--sx-border); background: var(--sx-panel); }
#sxcb-root .sxcb-input {
	flex: 1; min-width: 0; resize: none; height: 44px; max-height: 120px;
	background: var(--sx-bg); color: var(--sx-text); font: inherit; font-size: 14.5px;
	border: 1px solid var(--sx-border); border-radius: 22px; padding: 10px 16px; margin: 0;
	box-shadow: none;
}
#sxcb-root .sxcb-input::placeholder { color: #7a7a7a; }
#sxcb-root .sxcb-input:focus { border-color: var(--sx-accent); outline: none; }
#sxcb-root .sxcb-send {
	width: 44px; height: 44px; flex: none; border-radius: 50%; padding: 0;
	background: transparent; border: 1px solid var(--sx-accent); color: var(--sx-accent);
	cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s;
}
#sxcb-root .sxcb-send:hover:not(:disabled), #sxcb-root .sxcb-send:focus-visible { background: var(--sx-accent); color: #121212; outline: none; }
#sxcb-root .sxcb-send:disabled { opacity: .4; cursor: default; }
#sxcb-root .sxcb-send svg { width: 18px; height: 18px; }
#sxcb-root .sxcb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#sxcb-root .sxcb-foot { font-size: 11px; color: #7a7a7a; text-align: center; padding: 0 12px 10px; background: var(--sx-panel); }
#sxcb-root .sxcb-foot a { color: var(--sx-muted); }

@media (max-width: 520px) {
	#sxcb-root { right: 16px; bottom: 16px; }
	#sxcb-root.sxcb-open { right: 0; bottom: 0; left: 0; top: 0; }
	#sxcb-root .sxcb-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
	#sxcb-root .sxcb-launch { height: 52px; padding: 0 18px 0 16px; font-size: 15px; }
	#sxcb-root .sxcb-input { font-size: 16px; } /* stops iOS zoom */
}
@media (prefers-reduced-motion: reduce) {
	#sxcb-root *, #sxcb-root *::before { animation: none !important; transition: none !important; }
}
