/* OpenBus Tour Ischia — AI assistant widget. Self-contained, brand-themed, mobile-first. */
#obi-ai-root, #obi-ai-root * { box-sizing: border-box; }
#obi-ai-root {
	--obi-ai-green: #15A249;
	--obi-ai-green-d: #0f7a37;
	--obi-ai-orange: #f97316;
	--obi-ai-ink: #0f172a;
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Floating launcher */
.obi-ai-fab {
	position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
	width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
	background: linear-gradient(135deg, var(--obi-ai-green), var(--obi-ai-green-d));
	color: #fff; box-shadow: 0 12px 30px -8px rgba(21,162,73,.55);
	display: flex; align-items: center; justify-content: center;
	transition: transform .2s ease, box-shadow .2s ease;
}
.obi-ai-fab:hover { transform: translateY(-2px) scale(1.04); }
.obi-ai-fab svg { width: 28px; height: 28px; }
.obi-ai-fab .obi-ai-badge {
	position: absolute; top: -3px; right: -3px; width: 14px; height: 14px;
	background: var(--obi-ai-orange); border: 2px solid #fff; border-radius: 50%;
	animation: obi-ai-pulse 2s infinite;
}
@keyframes obi-ai-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .7; } }

/* Panel */
.obi-ai-panel {
	position: fixed; right: 20px; bottom: 20px; z-index: 2147483001;
	width: 384px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 40px);
	background: #fff; border-radius: 22px; overflow: hidden;
	box-shadow: 0 40px 80px -20px rgba(2,6,23,.45), 0 0 0 1px rgba(2,6,23,.05);
	display: none; flex-direction: column;
	transform: translateY(16px) scale(.98); opacity: 0;
	transition: transform .25s cubic-bezier(.16,1,.3,1), opacity .2s ease;
}
.obi-ai-panel.obi-ai-open { display: flex; transform: translateY(0) scale(1); opacity: 1; }

.obi-ai-head {
	background: linear-gradient(135deg, var(--obi-ai-green), var(--obi-ai-green-d));
	color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.obi-ai-head .obi-ai-av { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.obi-ai-head .obi-ai-av svg { width: 22px; height: 22px; }
.obi-ai-head h3 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.2; }
.obi-ai-head .obi-ai-status { font-size: 11.5px; opacity: .9; display: flex; align-items: center; gap: 5px; }
.obi-ai-head .obi-ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: obi-ai-live 1.8s infinite; }
@keyframes obi-ai-live { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); } 70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.obi-ai-head .obi-ai-x { margin-left: auto; background: rgba(255,255,255,.15); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.obi-ai-head .obi-ai-x:hover { background: rgba(255,255,255,.28); }

/* Messages */
.obi-ai-body { flex: 1; overflow-y: auto; padding: 18px; background: #f8fafc; display: flex; flex-direction: column; gap: 12px; }
.obi-ai-msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; animation: obi-ai-in .25s ease; }
@keyframes obi-ai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.obi-ai-msg.bot { align-self: flex-start; background: #fff; color: var(--obi-ai-ink); border: 1px solid #e8edf3; border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(2,6,23,.04); }
.obi-ai-msg.me { align-self: flex-end; background: var(--obi-ai-green); color: #fff; border-bottom-right-radius: 5px; }
.obi-ai-msg a { color: var(--obi-ai-green-d); font-weight: 700; text-decoration: underline; }
.obi-ai-msg.me a { color: #fff; }
.obi-ai-msg p { margin: 0 0 8px; } .obi-ai-msg p:last-child { margin: 0; }
.obi-ai-msg ul { margin: 4px 0; padding-left: 18px; } .obi-ai-msg li { margin: 2px 0; }

/* Thinking */
.obi-ai-think { align-self: flex-start; background: #fff; border: 1px solid #e8edf3; border-radius: 16px; border-bottom-left-radius: 5px; padding: 13px 16px; display: flex; gap: 5px; }
.obi-ai-think span { width: 8px; height: 8px; border-radius: 50%; background: #15A249; opacity: .5; animation: obi-ai-bounce 1.3s infinite; }
.obi-ai-think span:nth-child(2) { animation-delay: .18s; } .obi-ai-think span:nth-child(3) { animation-delay: .36s; }
@keyframes obi-ai-bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* Quick chips */
.obi-ai-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 4px; background: #f8fafc; }
.obi-ai-chip { background: #fff; border: 1px solid #d6e2d9; color: var(--obi-ai-green-d); font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: background .15s; }
.obi-ai-chip:hover { background: #ecfdf3; }

/* Input */
.obi-ai-foot { background: #fff; border-top: 1px solid #eef2f7; padding: 12px; }
.obi-ai-inp { display: flex; gap: 8px; align-items: flex-end; }
.obi-ai-inp textarea { flex: 1; resize: none; border: 1px solid #d8e0ea; border-radius: 13px; padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none; max-height: 96px; line-height: 1.4; }
.obi-ai-inp textarea:focus { border-color: var(--obi-ai-green); box-shadow: 0 0 0 3px rgba(21,162,73,.13); }
.obi-ai-inp button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 13px; background: var(--obi-ai-green); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.obi-ai-inp button:hover { background: var(--obi-ai-green-d); }
.obi-ai-inp button:disabled { opacity: .5; cursor: not-allowed; }
.obi-ai-inp button svg { width: 19px; height: 19px; }
.obi-ai-brand { text-align: center; margin-top: 9px; font-size: 10.5px; color: #94a3b8; }
.obi-ai-brand a { color: #64748b; font-weight: 700; text-decoration: none; }
.obi-ai-brand a:hover { color: var(--obi-ai-green); }

@media (max-width: 480px) {
	.obi-ai-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.obi-ai-fab { right: 16px; bottom: 16px; }
}
