/* «Ask AI» widget for all BLOZ sites (bloz-ai.js). Everything is scoped to #bzai so the host page (bootstrap on the
   explorer, own styles on pool/bridge) can't break it and it can't break the host page. Same look as the community chat. */
#bzai, #bzai * { box-sizing: border-box; }
#bzai { --bzai-steel: #11161D; --bzai-steel2: #161d27; --bzai-blue: #3FA9FF; --bzai-cyan: #6FE7FF; --bzai-silver: #BFC7D5;
	--bzai-white: #F5F7FA; --bzai-teal: #2EE6A8; --bzai-muted: #79849a; --bzai-line: rgba(111,231,255,.14);
	font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--bzai-silver); text-align: left;
	letter-spacing: normal; text-transform: none; }
#bzai [hidden] { display: none !important; }
#bzai button, #bzai textarea { font: inherit; margin: 0; letter-spacing: normal; text-transform: none; }
#bzai p { margin: 0; }
#bzai a { color: var(--bzai-cyan); text-decoration: underline; }
#bzai :focus-visible { outline: 2px solid var(--bzai-cyan); outline-offset: 2px; }

.bzai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
	padding: 12px 20px; border-radius: 99px; border: 1px solid var(--bzai-teal); background: linear-gradient(180deg, #2EE6A8, #1fbf8a);
	color: #03130d; font-weight: 700 !important; font-size: 15px !important; line-height: 1.2 !important;
	box-shadow: 0 8px 28px rgba(0,0,0,.5), 0 0 22px rgba(46,230,168,.35); transition: box-shadow .2s, transform .2s; }
.bzai-fab:hover { box-shadow: 0 8px 28px rgba(0,0,0,.5), 0 0 30px rgba(46,230,168,.55); transform: translateY(-1px); }
.bzai-dot { width: 10px; height: 10px; border-radius: 50%; background: #03130d; box-shadow: 0 0 0 3px rgba(3,19,13,.25); flex: none; }

.bzai-panel { position: fixed; right: 20px; bottom: 20px; z-index: 2147483001; width: min(420px, calc(100vw - 24px)); height: min(620px, calc(100vh - 40px));
	display: flex; flex-direction: column; border: 1px solid rgba(111,231,255,.35); border-radius: 20px; background: var(--bzai-steel);
	box-shadow: 0 18px 60px rgba(0,0,0,.65); overflow: hidden; }
.bzai-embed .bzai-panel { position: static; width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
.bzai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--bzai-line);
	background: linear-gradient(90deg, rgba(63,169,255,.16), rgba(46,230,168,.08)); }
.bzai-head strong { font: 700 16px/1.2 "Rajdhani", "Inter", sans-serif; letter-spacing: .04em; color: var(--bzai-white); }
.bzai-x { cursor: pointer; background: none; border: 0; color: var(--bzai-silver); font-size: 26px !important; line-height: 1; min-width: 40px; min-height: 40px; padding: 0; }
.bzai-x:hover { color: var(--bzai-white); }
.bzai-body { flex: 1; display: flex; flex-direction: column; padding: 12px 14px; min-height: 0; }
.bzai-log { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 4px 2px 10px; min-height: 0; }
.bzai-intro { color: var(--bzai-silver); font-size: 14px; margin-bottom: 10px !important; }
.bzai-msg { display: flex; }
.bzai-msg .bzai-b { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bzai-msg .bzai-b p + p { margin-top: 8px; }
.bzai-me { justify-content: flex-end; }
.bzai-me .bzai-b { background: rgba(63,169,255,.22); border: 1px solid rgba(63,169,255,.4); color: var(--bzai-white); border-bottom-right-radius: 4px; }
.bzai-bot .bzai-b { background: var(--bzai-steel2); border: 1px solid var(--bzai-line); color: var(--bzai-silver); border-bottom-left-radius: 4px; }
.bzai-wait .bzai-b { color: var(--bzai-muted); font-style: italic; }
.bzai-b code { font: .85em "JetBrains Mono", ui-monospace, monospace; background: rgba(111,231,255,.08); padding: 1px 5px; border-radius: 5px; color: var(--bzai-white); }
.bzai-b pre { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #070a0e; border: 1px solid var(--bzai-line); color: var(--bzai-white);
	font: 13px/1.45 "JetBrains Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.bzai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.bzai-chip { cursor: pointer; border: 1px solid var(--bzai-line); background: rgba(17,22,29,.8); color: var(--bzai-silver); border-radius: 99px;
	padding: 6px 14px; font-size: 13.5px !important; min-height: 34px; line-height: 1.3 !important; text-align: left; }
.bzai-chip:hover { color: var(--bzai-white); border-color: rgba(111,231,255,.5); }
.bzai-form { display: flex; gap: 10px; align-items: flex-end; }
.bzai-form textarea { flex: 1; resize: none; min-height: 52px; max-height: 160px; padding: 10px 12px; border-radius: 12px; border: 1px solid #263040;
	background: rgba(11,15,20,.85); color: var(--bzai-white); font-size: 15px !important; line-height: 1.4 !important; }
.bzai-form textarea:focus { outline: none; border-color: var(--bzai-blue); box-shadow: 0 0 0 3px rgba(63,169,255,.18); }
.bzai-send { cursor: pointer; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--bzai-teal);
	background: linear-gradient(180deg, #2EE6A8, #1fbf8a); color: #03130d; font-weight: 700 !important; }
.bzai-send:disabled { opacity: .55; cursor: default; }
.bzai-note { margin-top: 8px; font-size: 13.5px; }
.bzai-note.err { color: #ffb4b4; }
.bzai-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--bzai-muted); }
.bzai-quota { color: var(--bzai-teal); }
.bzai-tools { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 13px; }
.bzai-tools:empty { display: none; }
.bzai-link { cursor: pointer; background: none; border: 0; padding: 0; color: var(--bzai-cyan); text-decoration: underline; font-size: 13px !important; }
.bzai-warn { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(247,147,26,.45); background: rgba(247,147,26,.08);
	color: #ffd7a8; font-size: 12.5px; line-height: 1.45; }

@media (max-width: 640px) {
	.bzai-fab { right: 14px; bottom: 14px; padding: 11px 16px; }
	.bzai-panel { right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
	.bzai-form textarea { font-size: 16px !important; }   /* iOS: no zoom on focus */
}
@media print { #bzai { display: none !important; } }

/* /ai-chat/ (sandboxed iframe on bridge.bloz.org): the page is just the panel */
html.bzai-host, html.bzai-host body { margin: 0; height: 100%; background: #11161D; }

.bzai-full { margin-left: auto; margin-right: 10px; font-size: 12px; opacity: .85; color: inherit; text-decoration: underline; white-space: nowrap; }
