/* Dean AI — internetdean.com chat widget styles, scoped to #dai-ai-root.
   Theme matches the site: dark #0d0f13, panels #14161c/#11141a,
   cyan accent #11bef0, ice text #d6f6ff, Hanken Grotesk, generous radii. */
#dai-ai-root {
	--dai-accent: #11bef0;
	--dai-accent-2: #0d7fb8;
	--dai-on-accent: #04141c;
	--dai-bg: #0d0f13;
	--dai-panel: #14161c;
	--dai-panel-2: #1a1e26;
	--dai-text: #d6f6ff;
	--dai-muted: #92a3a8;
	--dai-dim: #6a7a80;
	--dai-line: rgba(214, 246, 255, .1);
	--dai-radius: 14px;
	position: fixed;
	z-index: 99990;
	bottom: calc(18px + var(--dai-lift, 0px)); /* lifts above fixed bottom bars */
	right: 18px;
	font-family: "Hanken Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	color: var(--dai-text);
	direction: ltr;
}
#dai-ai-root *, #dai-ai-root *::before, #dai-ai-root *::after { box-sizing: border-box; }

/* launcher */
#dai-launcher {
	width: 58px; height: 58px;
	border: 1px solid rgba(17, 190, 240, .5);
	border-radius: 50%;
	background: linear-gradient(135deg, var(--dai-accent), var(--dai-accent-2));
	color: var(--dai-on-accent); cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 12px 32px -8px rgba(17, 190, 240, .5);
	position: relative;
	transition: transform .18s ease;
}
#dai-launcher:hover { transform: translateY(-2px); }
#dai-launcher svg { width: 27px; height: 27px; }
#dai-launcher .dai-dot {
	position: absolute; top: 3px; right: 3px;
	width: 11px; height: 11px; border-radius: 50%;
	background: #4ade80; border: 2px solid #0d0f13;
}
#dai-launcher.dai-pulsing::after {
	content: "";
	position: absolute; inset: -5px;
	border-radius: 50%;
	border: 2px solid var(--dai-accent);
	animation: dai-pulse 1.8s ease-out infinite;
}
@keyframes dai-pulse {
	0% { transform: scale(.85); opacity: .9; }
	100% { transform: scale(1.35); opacity: 0; }
}

/* teaser */
#dai-teaser {
	position: absolute; bottom: 68px; right: 0;
	max-width: 240px;
	background: var(--dai-panel);
	border: 1px solid var(--dai-line);
	border-radius: var(--dai-radius);
	padding: 10px 14px;
	font-size: .86rem; line-height: 1.4;
	color: var(--dai-text);
	box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6);
	cursor: pointer;
	opacity: 0; transform: translateY(6px); pointer-events: none;
	transition: opacity .3s ease, transform .3s ease;
}
#dai-teaser.dai-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#dai-teaser::after {
	content: "";
	position: absolute; bottom: -6px; right: 22px;
	width: 10px; height: 10px;
	background: var(--dai-panel);
	border-right: 1px solid var(--dai-line);
	border-bottom: 1px solid var(--dai-line);
	transform: rotate(45deg);
}

/* panel */
#dai-panel {
	position: absolute; bottom: 74px; right: 0;
	width: 366px; max-width: calc(100vw - 24px);
	height: 540px; max-height: calc(100vh - 110px);
	background: var(--dai-bg);
	border: 1px solid var(--dai-line);
	border-radius: 22px;
	display: flex; flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .75);
	opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
	transition: opacity .22s ease, transform .22s ease;
}
#dai-panel.dai-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* header */
.dai-head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 16px;
	background: var(--dai-panel-2);
	border-bottom: 1px solid var(--dai-line);
}
.dai-ava {
	width: 36px; height: 36px; border-radius: 50%;
	background: linear-gradient(135deg, var(--dai-accent), var(--dai-accent-2));
	display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
}
.dai-ava svg { width: 20px; height: 20px; }
.dai-who { flex: 1; min-width: 0; }
.dai-name { font-weight: 700; font-size: .95rem; color: #fff; letter-spacing: .2px; }
.dai-status { font-size: .74rem; color: var(--dai-muted); }
.dai-x {
	width: 30px; height: 30px;
	background: rgba(255, 255, 255, .04);
	border: 1px solid var(--dai-line);
	border-radius: 10px;
	color: var(--dai-muted); cursor: pointer;
	font-size: .8rem; line-height: 1;
}
.dai-x:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* messages */
.dai-msgs {
	flex: 1; overflow-y: auto;
	padding: 14px 14px 6px;
	display: flex; flex-direction: column; gap: 8px;
	scrollbar-width: thin; scrollbar-color: var(--dai-panel) transparent;
}
.dai-msgs::-webkit-scrollbar { width: 5px; }
.dai-msgs::-webkit-scrollbar-thumb { background: var(--dai-panel); border-radius: 3px; }
.dai-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.6; }
.dai-msg.bot {
	align-self: flex-start;
	background: var(--dai-panel);
	border: 1px solid var(--dai-line);
	border-bottom-left-radius: 5px;
}
.dai-msg.user {
	align-self: flex-end;
	background: linear-gradient(135deg, var(--dai-accent), var(--dai-accent-2));
	color: var(--dai-on-accent);
	font-weight: 600;
	border-bottom-right-radius: 5px;
}
.dai-msg ul { margin: 6px 0 2px; padding-inline-start: 18px; }
.dai-msg li { margin: 3px 0; }
.dai-msg b { color: var(--dai-accent); }
.dai-msg a { color: var(--dai-accent); }

/* typing */
.dai-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--dai-panel); border-radius: 16px; border-bottom-left-radius: 5px; }
.dai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--dai-muted); animation: dai-blink 1.2s infinite; }
.dai-typing i:nth-child(2) { animation-delay: .2s; }
.dai-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes dai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* chips */
.dai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 4px; }
.dai-chip {
	background: rgba(17, 190, 240, .12);
	border: 1px solid rgba(17, 190, 240, .35);
	color: #7ddcff;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: .78rem;
	cursor: pointer;
	transition: background .15s ease;
	font-family: inherit;
}
.dai-chip:hover { background: rgba(17, 190, 240, .22); }

/* input */
.dai-input { display: flex; gap: 8px; padding: 10px 14px; }
.dai-input input {
	flex: 1; min-width: 0;
	background: var(--dai-panel-2);
	border: 1px solid var(--dai-line);
	border-radius: 12px;
	padding: 11px 13px;
	color: var(--dai-text);
	font-size: .88rem;
	font-family: inherit;
	outline: none;
}
.dai-input input:focus { border-color: rgba(17, 190, 240, .55); }
.dai-input input::placeholder { color: var(--dai-dim); }
.dai-input button {
	width: 42px;
	background: linear-gradient(135deg, var(--dai-accent), var(--dai-accent-2));
	border: none; border-radius: 12px;
	color: var(--dai-on-accent); cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.dai-input button:disabled { opacity: .55; cursor: default; }
.dai-input button svg { width: 18px; height: 18px; }

/* footer */
.dai-foot {
	padding: 8px 14px 11px;
	font-size: .68rem;
	color: var(--dai-dim);
	text-align: center;
	border-top: 1px solid var(--dai-line);
	background: var(--dai-bg);
	line-height: 1.6;
}

/* ---------- handoff card ---------- */
.dai-msg.dai-handoff {
	max-width: 94%;
	background: var(--dai-panel-2);
	border: 1px solid rgba(17, 190, 240, .4);
	padding: 14px;
}
.dai-ho-title { font-weight: 700; font-size: .9rem; color: #fff; margin-bottom: 4px; }
.dai-ho-sub { font-size: .78rem; color: var(--dai-muted); margin-bottom: 10px; }
.dai-ho-form { display: flex; flex-direction: column; gap: 4px; }
.dai-ho-form label { font-size: .72rem; color: var(--dai-dim); margin-top: 4px; }
.dai-ho-form input, .dai-ho-form textarea {
	background: var(--dai-bg);
	border: 1px solid var(--dai-line);
	border-radius: 10px;
	padding: 9px 11px;
	color: var(--dai-text);
	font-size: .84rem;
	font-family: inherit;
	outline: none;
	width: 100%;
}
.dai-ho-form textarea { min-height: 64px; resize: vertical; }
.dai-ho-form input:focus, .dai-ho-form textarea:focus { border-color: rgba(17, 190, 240, .55); }
.dai-ho-send {
	margin-top: 10px;
	background: linear-gradient(135deg, var(--dai-accent), var(--dai-accent-2));
	border: none; border-radius: 11px;
	padding: 10px;
	color: var(--dai-on-accent); font-weight: 700; font-size: .85rem;
	cursor: pointer;
	font-family: inherit;
}
.dai-ho-send:disabled { opacity: .6; cursor: default; }
.dai-ho-ok, .dai-ho-err { display: none; font-size: .8rem; margin-top: 8px; line-height: 1.5; }
.dai-ho-ok.dai-show, .dai-ho-err.dai-show { display: block; }
.dai-ho-err { color: #ff8a95; }

/* ---------- RTL (Arabic UI) ---------- */
#dai-ai-root.dai-rtl { direction: rtl; }
#dai-ai-root.dai-rtl #dai-panel,
#dai-ai-root.dai-rtl .dai-msg,
#dai-ai-root.dai-rtl .dai-ho-form { text-align: right; }
#dai-ai-root.dai-rtl #dai-teaser { right: auto; left: 0; }
#dai-ai-root.dai-rtl #dai-teaser::after { right: auto; left: 22px; }
#dai-ai-root.dai-rtl .dai-msg.bot { border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
#dai-ai-root.dai-rtl .dai-msg.user { border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }

/* ---------- mobile ---------- */
@media (max-width: 480px) {
	#dai-ai-root { bottom: calc(12px + var(--dai-lift, 0px)); right: 12px; left: 12px; }
	#dai-panel { width: 100%; right: 0; height: calc(100vh - 96px); max-height: none; }
	#dai-teaser { max-width: 200px; }
}
