/* Zeon AI Chatbot – premium widget */
@property --zeon-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

#zeon-root {
	--zeon-bg: #2a2a2a;
	--zeon-elev: #343434;
	--zeon-text: #f5f5f5;
	--zeon-muted: #a3a3a3;
	--zeon-line: rgba(255, 255, 255, .09);
	--zeon-hover: rgba(255, 255, 255, .07);
	--zeon-user: #0d0d0d;
	--zeon-user-text: #ffffff;
	--zeon-code: rgba(255, 255, 255, .08);
	--zeon-launch-a: #2e2e2e;
	--zeon-launch-b: #1a1a1a;
	--zeon-launch-text: #ffffff;
	--zeon-shadow: 0 32px 80px -24px rgba(0, 0, 0, .6), 0 12px 32px -12px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06);
	--zeon-ease: cubic-bezier(.2, .8, .2, 1);
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 2147483000;
	font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Tamil", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--zeon-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
#zeon-root.zeon--left { right: auto; left: 24px; }
#zeon-root.zeon--light {
	--zeon-bg: #ffffff;
	--zeon-elev: #ffffff;
	--zeon-text: #111111;
	--zeon-muted: #6b6b6b;
	--zeon-line: rgba(0, 0, 0, .09);
	--zeon-hover: rgba(0, 0, 0, .05);
	--zeon-user: #111111;
	--zeon-user-text: #ffffff;
	--zeon-code: rgba(0, 0, 0, .06);
	--zeon-shadow: 0 32px 80px -24px rgba(0, 0, 0, .28), 0 10px 30px -12px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06);
}

/* Reset theme bleed */
#zeon-root *, #zeon-root *::before, #zeon-root *::after { box-sizing: border-box; }
#zeon-root button {
	font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
	cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: normal;
	line-height: 1; min-height: 0; min-width: 0; width: auto; height: auto; border-radius: 0; text-decoration: none;
}
#zeon-root button:focus-visible, #zeon-root a:focus-visible { outline: 2px solid var(--zeon-text); outline-offset: 2px; }
#zeon-root svg { display: block; width: 100%; height: 100%; }
#zeon-root h3, #zeon-root h4, #zeon-root p, #zeon-root ul, #zeon-root ol { margin: 0; padding: 0; color: inherit; font-family: inherit; letter-spacing: normal; text-transform: none; }

/* ---------- Launcher ---------- */
#zeon-root .zeon-launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	height: 60px;
	padding: 7px 26px 7px 7px;
	border-radius: 999px;
	background: linear-gradient(180deg, var(--zeon-launch-a), var(--zeon-launch-b));
	color: var(--zeon-launch-text);
	font-size: 17px;
	font-weight: 600;
	box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .4);
	transition: transform .35s var(--zeon-ease), opacity .25s ease, box-shadow .35s var(--zeon-ease);
	isolation: isolate;
}
#zeon-root .zeon-launcher::before {
	content: '';
	position: absolute;
	inset: -1.5px;
	border-radius: inherit;
	padding: 1.5px;
	background: conic-gradient(from var(--zeon-angle), rgba(255,255,255,.08) 0deg, rgba(255,255,255,.85) 60deg, rgba(255,255,255,.08) 140deg, rgba(255,255,255,.08) 360deg);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: zeon-spin 4.5s linear infinite;
	pointer-events: none;
}
#zeon-root .zeon-launcher::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: radial-gradient(120% 140% at 20% 0%, rgba(255,255,255,.12), transparent 55%);
	pointer-events: none;
}
#zeon-root .zeon-launcher:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .16); }
#zeon-root .zeon-launcher:active { transform: translateY(0) scale(.98); }
#zeon-root .zeon-launcher__icon {
	width: 46px; height: 46px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--zeon-accent); color: var(--zeon-accent-ink);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .35), inset 0 -2px 4px rgba(0, 0, 0, .08);
}
#zeon-root .zeon-launcher__icon svg { width: 22px; height: 22px; animation: zeon-twinkle 3.2s ease-in-out infinite; }
#zeon-root.zeon--open .zeon-launcher { opacity: 0; transform: scale(.85) translateY(8px); pointer-events: none; }

/* ---------- Panel ---------- */
#zeon-root .zeon-panel {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 400px;
	height: min(660px, calc(100vh - 48px));
	display: flex;
	flex-direction: column;
	background: var(--zeon-bg);
	border-radius: 26px;
	box-shadow: var(--zeon-shadow);
	overflow: hidden;
	transform-origin: bottom right;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(.94);
	pointer-events: none;
	transition: opacity .22s ease, transform .4s var(--zeon-ease), visibility 0s linear .4s, width .35s var(--zeon-ease), height .35s var(--zeon-ease), border-radius .35s var(--zeon-ease);
}
#zeon-root.zeon--left .zeon-panel { right: auto; left: 0; transform-origin: bottom left; }
#zeon-root.zeon--open .zeon-panel { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
#zeon-root.zeon--instant .zeon-panel, #zeon-root.zeon--instant .zeon-launcher { transition: none !important; }

/* Sidebar (docked) mode */
#zeon-root.zeon--sidebar .zeon-panel {
	position: fixed;
	top: 0; bottom: 0; right: 0;
	width: 440px;
	height: 100vh;
	height: 100dvh;
	border-radius: 0;
	transform-origin: right center;
}
#zeon-root.zeon--sidebar.zeon--left .zeon-panel { right: auto; left: 0; transform-origin: left center; }
#zeon-root.zeon--sidebar:not(.zeon--open) .zeon-panel { transform: translateX(40px); }
#zeon-root.zeon--sidebar .zeon-act-sidebar { background: var(--zeon-hover); }

/* Header */
#zeon-root .zeon-head {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px 18px 14px 22px;
	flex-shrink: 0;
}
#zeon-root .zeon-avatar {
	position: relative;
	width: 52px; height: 52px; border-radius: 50%;
	flex-shrink: 0;
	display: grid; place-items: center;
	background: var(--zeon-accent); color: var(--zeon-accent-ink);
	box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
}
#zeon-root .zeon-avatar svg { width: 24px; height: 24px; }
#zeon-root .zeon-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#zeon-root .zeon-status {
	position: absolute; right: 1px; bottom: 2px;
	width: 12px; height: 12px; border-radius: 50%;
	background: #22c55e; border: 2.5px solid var(--zeon-bg);
}
#zeon-root .zeon-name { flex: 1; font-size: 18px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#zeon-root .zeon-actions { display: flex; align-items: center; gap: 2px; }
#zeon-root .zeon-icon-btn {
	width: 38px; height: 38px; border-radius: 12px;
	display: grid; place-items: center;
	color: var(--zeon-text); opacity: .9;
	transition: background .2s ease, opacity .2s ease;
}
#zeon-root .zeon-icon-btn svg { width: 22px; height: 22px; }
#zeon-root .zeon-icon-btn:hover { background: var(--zeon-hover); opacity: 1; }

/* Menu */
#zeon-root .zeon-menu {
	position: absolute; top: 66px; right: 18px; z-index: 5;
	min-width: 220px; padding: 6px;
	background: var(--zeon-elev);
	border-radius: 16px;
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55), 0 0 0 1px var(--zeon-line);
	opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
	transition: opacity .18s ease, transform .22s var(--zeon-ease), visibility 0s linear .22s;
}
#zeon-root.zeon--menu .zeon-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
#zeon-root .zeon-menu button {
	display: flex; align-items: center; gap: 10px; width: 100%;
	padding: 11px 12px; border-radius: 10px; font-size: 14.5px; text-align: left;
}
#zeon-root .zeon-menu button:hover { background: var(--zeon-hover); }
#zeon-root .zeon-menu svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }

/* Body */
#zeon-root .zeon-body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px 24px 18px;
	scrollbar-width: thin;
	scrollbar-color: var(--zeon-line) transparent;
}
#zeon-root .zeon-body::-webkit-scrollbar { width: 6px; }
#zeon-root .zeon-body::-webkit-scrollbar-thumb { background: var(--zeon-line); border-radius: 6px; }
#zeon-root .zeon-welcome h3 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 6px 0 10px; }
#zeon-root .zeon-welcome p { font-size: 16px; color: var(--zeon-text); opacity: .92; }
#zeon-root .zeon-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
#zeon-root .zeon-chip {
	padding: 9px 14px; border-radius: 999px; font-size: 14px; line-height: 1.25; text-align: left;
	border: 1px solid var(--zeon-line); background: transparent; color: var(--zeon-text);
	transition: background .2s ease, border-color .2s ease, transform .2s var(--zeon-ease);
}
#zeon-root .zeon-chip:hover { background: var(--zeon-hover); border-color: transparent; transform: translateY(-1px); }
#zeon-root.zeon--has-msgs .zeon-chips { display: none; }

/* Messages */
#zeon-root .zeon-msgs { display: flex; flex-direction: column; gap: 18px; padding-top: 22px; }
#zeon-root .zeon-msg { display: flex; flex-direction: column; animation: zeon-in .35s var(--zeon-ease) both; }
#zeon-root .zeon-msg--user { align-items: flex-end; }
#zeon-root .zeon-msg--user .zeon-bubble {
	max-width: 82%;
	padding: 12px 18px;
	background: var(--zeon-user); color: var(--zeon-user-text);
	border-radius: 22px 8px 22px 22px;
	white-space: pre-wrap; word-wrap: break-word;
	font-size: 16px;
}
#zeon-root .zeon-msg--assistant .zeon-bubble { font-size: 16px; line-height: 1.6; word-wrap: break-word; }
#zeon-root .zeon-bubble p + p, #zeon-root .zeon-bubble p + ul, #zeon-root .zeon-bubble p + ol,
#zeon-root .zeon-bubble ul + p, #zeon-root .zeon-bubble ol + p, #zeon-root .zeon-bubble h4 + p { margin-top: 10px; }
#zeon-root .zeon-bubble h4 { font-size: 16px; font-weight: 700; margin: 14px 0 6px; }
#zeon-root .zeon-bubble h4:first-child { margin-top: 0; }
#zeon-root .zeon-bubble ul, #zeon-root .zeon-bubble ol { padding-left: 20px; margin: 8px 0; }
#zeon-root .zeon-bubble li { margin: 4px 0; }
#zeon-root .zeon-bubble li::marker { color: var(--zeon-muted); }
#zeon-root .zeon-bubble strong { font-weight: 650; }
#zeon-root .zeon-bubble a { color: inherit; text-decoration: underline; text-decoration-color: var(--zeon-muted); text-underline-offset: 3px; }
#zeon-root .zeon-bubble a:hover { text-decoration-color: currentColor; }
#zeon-root .zeon-bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--zeon-code); }
#zeon-root .zeon-bubble pre { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--zeon-code); overflow-x: auto; }
#zeon-root .zeon-bubble pre code { padding: 0; background: none; }
#zeon-root .zeon-bubble hr { border: 0; border-top: 1px solid var(--zeon-line); margin: 12px 0; }

#zeon-root .zeon-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
#zeon-root .zeon-sources span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--zeon-muted); margin-right: 2px; }
#zeon-root .zeon-sources a {
	display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
	padding: 5px 10px; border-radius: 999px; font-size: 13px; color: var(--zeon-text); text-decoration: none;
	border: 1px solid var(--zeon-line); transition: background .2s ease;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#zeon-root .zeon-sources a:hover { background: var(--zeon-hover); }
#zeon-root .zeon-sources a svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .7; }

/* Typing indicator */
#zeon-root .zeon-typing { flex-direction: row; gap: 5px; padding: 6px 0; }
#zeon-root .zeon-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--zeon-muted); animation: zeon-dot 1.2s infinite ease-in-out; }
#zeon-root .zeon-typing span:nth-child(2) { animation-delay: .15s; }
#zeon-root .zeon-typing span:nth-child(3) { animation-delay: .3s; }

/* Composer */
#zeon-root .zeon-composer { padding: 10px 20px 20px; flex-shrink: 0; }
#zeon-root .zeon-field {
	position: relative;
	display: flex; align-items: flex-end; gap: 8px;
	padding: 7px 7px 7px 22px;
	min-height: 58px;
	border-radius: 29px;
	border: 1px solid var(--zeon-line);
	background: transparent;
	transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
#zeon-root .zeon-field:focus-within { border-color: color-mix(in srgb, var(--zeon-text) 28%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--zeon-text) 6%, transparent); }
#zeon-root .zeon-field textarea {
	flex: 1; align-self: center;
	min-height: 24px; max-height: 140px; height: 24px;
	margin: 0; padding: 0; border: 0; outline: 0; box-shadow: none; resize: none; overflow-y: auto;
	background: transparent; color: var(--zeon-text);
	font: inherit; font-size: 16px; line-height: 24px;
}
#zeon-root .zeon-field textarea::placeholder { color: var(--zeon-muted); opacity: 1; }
#zeon-root .zeon-send {
	width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
	display: grid; place-items: center;
	background: var(--zeon-accent); color: var(--zeon-accent-ink);
	opacity: 0; transform: scale(.6);
	transition: opacity .2s ease, transform .3s var(--zeon-ease);
	pointer-events: none;
}
#zeon-root .zeon-send svg { width: 20px; height: 20px; }
#zeon-root.zeon--typing .zeon-send { opacity: 1; transform: scale(1); pointer-events: auto; }
#zeon-root .zeon-send:disabled { opacity: .35; cursor: default; }
#zeon-root:not(.zeon--typing) .zeon-send:disabled { opacity: 0; }
#zeon-root .zeon-brand { text-align: center; font-size: 12px; color: var(--zeon-muted); margin-top: 10px; }
#zeon-root .zeon-brand a { color: inherit; text-decoration: none; }
#zeon-root .zeon-brand a:hover { color: var(--zeon-text); }

/* ---------- Animations ---------- */
@keyframes zeon-spin { to { --zeon-angle: 360deg; } }
@keyframes zeon-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(.88) rotate(12deg); } }
@keyframes zeon-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes zeon-dot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	#zeon-root *, #zeon-root *::before { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
	#zeon-root { bottom: 16px; right: 16px; }
	#zeon-root.zeon--left { left: 16px; }
	#zeon-root .zeon-launcher { height: 54px; font-size: 16px; padding-right: 22px; }
	#zeon-root .zeon-launcher__icon { width: 40px; height: 40px; }
	#zeon-root .zeon-panel, #zeon-root.zeon--sidebar .zeon-panel {
		position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0;
		transform-origin: bottom center;
	}
	#zeon-root .zeon-act-sidebar { display: none; }
	#zeon-root .zeon-body { padding: 6px 18px 14px; }
	#zeon-root .zeon-composer { padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); }
}
