/* DJN AI Chatbot — frontend styles (no external assets) */
.djn-chat-root {
	--djn-accent: #053485;
	--djn-accent-dark: #032659;
	position: fixed;
	z-index: 999998;
	bottom: 24px;
	right: 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.djn-chat-root.djn-left { right: auto; left: 24px; }

/* ---------- launcher ---------- */
.djn-chat-launcher {
	width: 60px; height: 60px; border: 0; padding: 0; margin: 0; cursor: pointer;
	border-radius: 50%;
	background: var(--djn-accent);
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 10px 26px rgba(0,0,0,.24), 0 2px 6px rgba(0,0,0,.14);
	transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.djn-chat-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.djn-chat-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.djn-chat-launcher svg { width: 27px; height: 27px; display: block; }
.djn-chat-launcher .djn-ico-close { display: none; }
.djn-chat-root.djn-open .djn-chat-launcher .djn-ico-chat { display: none; }
.djn-chat-root.djn-open .djn-chat-launcher .djn-ico-close { display: block; }

.djn-chat-dot {
	position: absolute; top: 4px; right: 4px; width: 12px; height: 12px;
	background: #ff3b30; border: 2px solid #fff; border-radius: 50%;
}
.djn-chat-root.djn-open .djn-chat-dot { display: none; }
.djn-chat-launcher { position: relative; }

/* ---------- teaser ---------- */
.djn-chat-teaser {
	position: absolute; bottom: 74px; right: 0;
	max-width: 250px; width: max-content;
	background: #fff; color: #1f2937;
	border-radius: 14px 14px 4px 14px;
	padding: 11px 14px; font-size: 13.5px; line-height: 1.45;
	box-shadow: 0 10px 28px rgba(0,0,0,.16);
	cursor: pointer;
	opacity: 0; transform: translateY(8px); pointer-events: none;
	transition: opacity .25s ease, transform .25s ease;
}
.djn-chat-teaser.djn-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.djn-chat-root.djn-left .djn-chat-teaser { right: auto; left: 0; border-radius: 14px 14px 14px 4px; }

/* ---------- panel ---------- */
.djn-chat-panel {
	position: absolute; bottom: 76px; right: 0;
	width: 380px; max-width: calc(100vw - 32px);
	height: 560px; max-height: calc(100vh - 130px);
	background: #fff; border-radius: 18px; overflow: hidden;
	box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 4px 14px rgba(0,0,0,.12);
	display: flex; flex-direction: column;
	transform: translateY(14px) scale(.97); opacity: 0; pointer-events: none;
	transition: transform .22s ease, opacity .22s ease;
}
.djn-chat-root.djn-open .djn-chat-panel { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.djn-chat-root.djn-left .djn-chat-panel { right: auto; left: 0; }

/* ---------- header ---------- */
.djn-chat-head {
	background: var(--djn-accent);
	color: #fff; padding: 14px 16px;
	display: flex; align-items: center; gap: 11px; flex: 0 0 auto;
}
.djn-chat-avatar {
	width: 38px; height: 38px; border-radius: 50%;
	background: rgba(255,255,255,.2); flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
}
.djn-chat-avatar svg { width: 21px; height: 21px; }
.djn-chat-head-txt { line-height: 1.25; min-width: 0; }
.djn-chat-title { font-size: 15px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.djn-chat-sub { font-size: 11.5px; opacity: .88; margin: 2px 0 0; display: flex; align-items: center; gap: 5px; }
.djn-online { width: 7px; height: 7px; border-radius: 50%; background: #7ef0bb; display: inline-block; box-shadow: 0 0 0 2px rgba(126,240,187,.28); }
.djn-chat-close {
	margin-left: auto; background: transparent; border: 0; color: #fff;
	font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 8px; opacity: .85;
}
.djn-chat-close:hover { opacity: 1; background: rgba(255,255,255,.14); }

/* ---------- messages ---------- */
.djn-chat-body {
	flex: 1 1 auto; overflow-y: auto; padding: 14px 14px 4px;
	background: #f6f7f9; -webkit-overflow-scrolling: touch;
}
.djn-msg { display: flex; margin-bottom: 10px; }
.djn-msg.djn-user { justify-content: flex-end; }
.djn-bubble {
	max-width: 82%; padding: 10px 13px; border-radius: 14px;
	font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.djn-msg.djn-bot .djn-bubble { background: #fff; color: #1f2937; border: 1px solid #e8ebef; border-bottom-left-radius: 5px; }
.djn-msg.djn-user .djn-bubble { background: var(--djn-accent); color: #fff; border-bottom-right-radius: 5px; }
.djn-bubble a { color: inherit; text-decoration: underline; }

.djn-typing { display: flex; gap: 4px; align-items: center; padding: 4px 2px; }
.djn-typing span {
	width: 7px; height: 7px; border-radius: 50%; background: #b8c0cc;
	animation: djn-bounce 1.2s infinite ease-in-out;
}
.djn-typing span:nth-child(2) { animation-delay: .16s; }
.djn-typing span:nth-child(3) { animation-delay: .32s; }
@keyframes djn-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .55; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- quick chips ---------- */
.djn-chips {
	display: flex; gap: 7px; overflow-x: auto; padding: 9px 12px 6px;
	background: #f6f7f9; flex: 0 0 auto; scrollbar-width: none;
}
.djn-chips::-webkit-scrollbar { display: none; }
.djn-chip {
	border: 1px solid #d9dfe7; background: #fff; color: #374151;
	font-size: 12.5px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
	white-space: nowrap; transition: all .15s ease; font-family: inherit;
}
.djn-chip:hover { border-color: var(--djn-accent); color: var(--djn-accent); background: #f2fbf9; }

/* ---------- input ---------- */
.djn-chat-foot { flex: 0 0 auto; border-top: 1px solid #e8ebef; background: #fff; padding: 9px 10px 6px; }
.djn-inrow { display: flex; align-items: flex-end; gap: 8px; }
.djn-input {
	flex: 1 1 auto; resize: none; border: 1px solid #dde3ea; border-radius: 12px;
	padding: 10px 12px; font-size: 14px; line-height: 1.4; font-family: inherit;
	max-height: 96px; min-height: 42px; color: #111827; background: #fff;
}
.djn-input:focus { outline: none; border-color: var(--djn-accent); box-shadow: 0 0 0 3px rgba(14,133,119,.12); }
.djn-send {
	width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--djn-accent); color: #fff; display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto; transition: background .15s ease, transform .15s ease;
}
.djn-send:hover { background: var(--djn-accent-dark); }
.djn-send:disabled { opacity: .5; cursor: not-allowed; }
.djn-send svg { width: 19px; height: 19px; }
.djn-note { font-size: 10.5px; color: #8b95a3; text-align: center; margin: 6px 0 0; line-height: 1.4; }
.djn-credit { font-size: 10px; color: #a7b0bd; margin: 3px 0 0; }
.djn-credit a { color: #8b95a3; text-decoration: none; border-bottom: 1px dotted #c6ccd4; }
.djn-credit a:hover { color: var(--djn-accent); }
.djn-debug-row { margin-top: -4px; }
.djn-debug {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 10.5px; line-height: 1.45; color: #b32d2e;
	background: #fdf0f0; border: 1px solid #f3c9c9; border-radius: 8px;
	padding: 6px 9px; max-width: 92%; white-space: pre-wrap; word-break: break-word;
}

/* ---------- mobile ---------- */
@media (max-width: 480px) {
	.djn-chat-root { bottom: 16px; right: 16px; }
	.djn-chat-root.djn-left { left: 16px; }
	.djn-chat-panel {
		position: fixed; left: 10px; right: 10px; bottom: 84px;
		width: auto; max-width: none; height: auto;
		top: 70px; max-height: none; border-radius: 16px;
	}
	.djn-chat-teaser { max-width: 210px; }
}
@media (prefers-reduced-motion: reduce) {
	.djn-chat-panel, .djn-chat-launcher, .djn-chat-teaser { transition: none; }
	.djn-typing span { animation: none; }
}
