/* OpenBus Tour Ischia — on-site assistant (prefix .oa) */
.oa, .oa * { box-sizing: border-box; }
.oa {
	--oa-g: #15A249; --oa-gd: #0e7534; --oa-gl: #34d17a; --oa-o: #f97316;
	--oa-ink: #0f172a; --oa-mut: #64748b; --oa-line: #e2e8f0; --oa-bg: #f8fafc;
	--oa-r: 22px; --oa-ease: cubic-bezier(.2, .8, .2, 1);
	position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
	z-index: 99990; font-family: inherit; color: var(--oa-ink); font-size: 15px; line-height: 1.5;
	opacity: 0; transform: translateY(16px) scale(.9); transition: opacity .5s var(--oa-ease), transform .5s var(--oa-ease);
}
.oa.is-ready { opacity: 1; transform: none; }
.oa button { font: inherit; cursor: pointer; }
.oa svg { width: 100%; height: 100%; display: block; }

/* Launcher */
.oa-fab {
	position: relative; width: 62px; height: 62px; border: 0; border-radius: 50%; padding: 0; color: #fff;
	background: radial-gradient(circle at 30% 25%, var(--oa-gl), var(--oa-g) 55%, var(--oa-gd));
	box-shadow: 0 12px 28px -6px rgba(21, 162, 73, .55), 0 2px 6px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
	transition: transform .35s var(--oa-ease), box-shadow .35s var(--oa-ease);
	display: grid; place-items: center;
}
.oa-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 18px 34px -8px rgba(21, 162, 73, .6), 0 3px 8px rgba(15, 23, 42, .2); }
.oa-fab:active { transform: scale(.95); }
.oa-fab:focus-visible { outline: 3px solid rgba(21, 162, 73, .45); outline-offset: 4px; }
.oa-fab-i { position: absolute; width: 27px; height: 27px; transition: transform .45s var(--oa-ease), opacity .3s; }
.oa-fab-x { opacity: 0; transform: rotate(-90deg) scale(.5); }
.oa.is-open .oa-fab-chat { opacity: 0; transform: rotate(90deg) scale(.5); }
.oa.is-open .oa-fab-x { opacity: 1; transform: none; }
.oa-pulse { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(21, 162, 73, .5); animation: oa-pulse 2.6s 3s infinite; pointer-events: none; }
.oa.is-open .oa-pulse { animation: none; }
.oa-fab.has-new::after { content: ''; position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--oa-o); border: 2px solid #fff; animation: oa-pop .4s var(--oa-ease); }
@keyframes oa-pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 162, 73, .45); } 70% { box-shadow: 0 0 0 16px rgba(21, 162, 73, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 162, 73, 0); } }

/* Teaser */
.oa-teaser {
	position: absolute; right: 74px; bottom: 10px; white-space: nowrap; border: 1px solid var(--oa-line); background: #fff; color: var(--oa-ink);
	padding: 10px 16px; border-radius: 16px 16px 4px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(15, 23, 42, .3);
	opacity: 0; transform: translateX(10px) scale(.95); pointer-events: none; transition: opacity .4s var(--oa-ease), transform .4s var(--oa-ease);
}
.oa-teaser.is-show { opacity: 1; transform: none; pointer-events: auto; }

/* Panel */
.oa-panel {
	position: absolute; right: 0; bottom: 78px; width: min(400px, calc(100vw - 36px)); height: min(640px, calc(100vh - 120px));
	background: #fff; border-radius: var(--oa-r); overflow: hidden; display: flex; flex-direction: column;
	box-shadow: 0 30px 70px -18px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06);
	transform-origin: bottom right; opacity: 0; transform: translateY(14px) scale(.94); transition: opacity .28s var(--oa-ease), transform .32s var(--oa-ease);
}
.oa-panel.is-show { opacity: 1; transform: none; }
.oa-panel[hidden] { display: none; }

.oa-head {
	display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; color: #fff;
	background: linear-gradient(135deg, #0f172a 0%, #13233b 55%, #0e3b25 100%); position: relative;
}
.oa-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--oa-g), var(--oa-gl), var(--oa-o)); }
.oa-av { width: 42px; height: 42px; border-radius: 14px; background: #fff; color: var(--oa-g); display: grid; place-items: center; padding: 7px; flex: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.oa-av img { width: 100%; height: 100%; object-fit: contain; }
.oa-av-s { width: 30px; height: 30px; border-radius: 10px; padding: 5px; box-shadow: none; border: 1px solid var(--oa-line); }
.oa-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oa-who strong { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.oa-status { font-size: 12px; color: #a7f3c4; display: flex; align-items: center; gap: 6px; }
.oa-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--oa-gl); box-shadow: 0 0 0 3px rgba(52, 209, 122, .25); animation: oa-blink 2s infinite; }
@keyframes oa-blink { 50% { opacity: .45; } }
.oa-icon { width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #e2e8f0; transition: background .2s, transform .2s; }
.oa-icon:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.oa-icon:active { transform: scale(.92); }

/* Messages */
.oa-log { flex: 1; overflow-y: auto; padding: 18px 14px 8px; background: var(--oa-bg); scroll-behavior: smooth; overscroll-behavior: contain; }
.oa-log::-webkit-scrollbar { width: 6px; }
.oa-log::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.oa-row { display: flex; gap: 8px; margin: 0 0 12px; align-items: flex-end; }
.oa-user { justify-content: flex-end; }
.oa-in { animation: oa-rise .38s var(--oa-ease) both; }
@keyframes oa-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.oa-bubble { max-width: 84%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; word-wrap: break-word; }
.oa-bot .oa-bubble { background: #fff; border: 1px solid var(--oa-line); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.oa-user .oa-bubble { color: #fff; background: linear-gradient(135deg, var(--oa-g), var(--oa-gd)); border-bottom-right-radius: 6px; box-shadow: 0 6px 16px -8px rgba(21, 162, 73, .7); }
.oa-bubble p { margin: 0 0 6px; } .oa-bubble p:last-child { margin: 0; }
.oa-bubble ul, .oa-bubble ol { margin: 4px 0 6px; padding-left: 18px; }
.oa-bubble li { margin: 2px 0; }
.oa-bubble strong { font-weight: 800; }
.oa-bot .oa-bubble a { color: var(--oa-gd); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.oa-err { background: #fff7ed !important; border-color: #fed7aa !important; color: #9a3412; }

.oa-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.oa-act {
	display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 800;
	text-decoration: none !important; border: 1px solid var(--oa-line); color: var(--oa-ink) !important; background: #fff; transition: transform .2s var(--oa-ease), box-shadow .2s, background .2s;
}
.oa-act svg { width: 15px; height: 15px; }
.oa-act:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .3); }
.oa-act-book { background: linear-gradient(135deg, var(--oa-g), var(--oa-gd)); color: #fff !important; border-color: transparent; }
.oa-act-phone { color: var(--oa-gd) !important; border-color: #bbf7d0; background: #f0fdf4; }
.oa-src { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--oa-line); display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--oa-mut); }
.oa-src span { font-weight: 700; }
.oa-src a { color: var(--oa-mut) !important; font-weight: 600 !important; }

.oa-typing { display: inline-flex; align-items: center; gap: 4px; }
.oa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--oa-g); opacity: .35; animation: oa-dot 1.1s infinite; }
.oa-typing span:nth-child(2) { animation-delay: .15s; } .oa-typing span:nth-child(3) { animation-delay: .3s; }
.oa-typing em { font-style: normal; font-size: 12.5px; color: var(--oa-mut); margin-left: 6px; }
@keyframes oa-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* Footer */
.oa-foot { padding: 10px 12px 10px; border-top: 1px solid var(--oa-line); background: #fff; }
.oa-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.oa-chips::-webkit-scrollbar { display: none; }
.oa-chips[hidden] { display: none; }
.oa-chip {
	flex: none; border: 1px solid #bbf7d0; background: #f0fdf4; color: var(--oa-gd); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
	animation: oa-rise .4s var(--oa-ease) both; animation-delay: calc(var(--i) * 50ms); transition: background .2s, transform .2s;
}
.oa-chip:hover { background: #dcfce7; transform: translateY(-1px); }
.oa-form { display: flex; align-items: flex-end; gap: 8px; background: var(--oa-bg); border: 1.5px solid var(--oa-line); border-radius: 18px; padding: 6px 6px 6px 14px; transition: border-color .2s, box-shadow .2s; }
.oa-form:focus-within { border-color: var(--oa-g); box-shadow: 0 0 0 4px rgba(21, 162, 73, .12); background: #fff; }
.oa-input { flex: 1; border: 0; outline: 0; background: transparent; resize: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 7px 0; max-height: 120px; color: var(--oa-ink); }
.oa-send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 13px; padding: 10px; color: #fff; background: #cbd5e1; transition: background .25s, transform .25s var(--oa-ease); }
.oa-send.is-ready { background: linear-gradient(135deg, var(--oa-g), var(--oa-gd)); }
.oa-send.is-ready:hover { transform: translateX(2px) rotate(-8deg); }
.oa.is-busy .oa-send { opacity: .6; pointer-events: none; }
.oa-note { margin: 8px 4px 0; font-size: 10.5px; line-height: 1.35; color: #94a3b8; text-align: center; }

/* Phones: full-height sheet */
@media (max-width: 639px) {
	.oa { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
	.oa-fab { width: 56px; height: 56px; }
	.oa-teaser { right: 66px; bottom: 7px; }
	.oa.is-open .oa-fab { opacity: 0; pointer-events: none; transform: scale(.6); }
	.oa-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; bottom: 0; transform-origin: bottom center; transform: translateY(30px); }
	.oa-head { padding-top: max(14px, env(safe-area-inset-top)); }
	.oa-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
	.oa-input { font-size: 16px; }
	.oa-bubble { max-width: 88%; }
}
html.oa-lock, html.oa-lock body { overflow: hidden; }
@media (min-width: 640px) { body.admin-bar .oa-panel { max-height: calc(100vh - 152px); } }

@media (prefers-reduced-motion: reduce) {
	.oa, .oa * { animation: none !important; transition: none !important; }
}
@media print { .oa { display: none !important; } }

/* Home: lift above the mobile "Book" bar once it slides in. */
@media (max-width: 767px) {
	.oa { transition: bottom .3s; }
	body.obi-sticky-on .oa:not(.is-open) { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* Live typing, waiting animation and AI answers */
.oa-text > :first-child { margin-top: 0; } .oa-text > :last-child { margin-bottom: 0; }
.oa-writing > p:last-child::after, .oa-writing > ul:last-child > li:last-child::after, .oa-writing > ol:last-child > li:last-child::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--oa-g); animation: oa-caret .8s steps(2, start) infinite; }
@keyframes oa-caret { 50% { opacity: 0; } }
.oa-think { display: inline-flex; flex-direction: column; gap: 7px; min-width: 188px; }
.oa-think em { font-style: normal; font-size: 12.5px; color: var(--oa-mut); }
.oa-think em.oa-step { animation: oa-step .35s var(--oa-ease) both; }
@keyframes oa-step { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.oa-road { position: relative; height: 22px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px 3px; }
.oa-road::before { content: ""; position: absolute; left: 4px; right: 4px; bottom: 6px; border-bottom: 2px dashed rgba(21, 162, 73, .35); }
.oa-road i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--oa-g); opacity: .4; animation: oa-stop 2.8s infinite; }
.oa-road i:nth-child(2) { animation-delay: .7s; } .oa-road i:nth-child(3) { animation-delay: 1.4s; } .oa-road i:nth-child(4) { animation-delay: 2.1s; }
@keyframes oa-stop { 0%, 30%, 100% { opacity: .4; transform: scale(1); } 10% { opacity: 1; transform: scale(1.35); background: var(--oa-g); } }
.oa-road-bus { position: absolute; left: 0; bottom: 7px; width: 20px; height: 20px; color: var(--oa-g); animation: oa-drive 2.8s linear infinite; }
.oa-road-bus svg { width: 20px; height: 20px; display: block; animation: oa-bump .35s ease-in-out infinite alternate; }
@keyframes oa-drive { from { left: -4px; } to { left: calc(100% - 16px); } }
@keyframes oa-bump { to { transform: translateY(-1.5px); } }
.oa-think-ai .oa-road-bus, .oa-think-ai .oa-road i { color: #f97316; border-color: #f97316; }
.oa-think-ai .oa-road::before { border-color: rgba(249, 115, 22, .35); }
.oa-tag { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: #c2410c; background: rgba(249, 115, 22, .12); }
.oa-tag svg { width: 11px; height: 11px; }
@media (prefers-reduced-motion: reduce) { .oa-road-bus, .oa-road-bus svg, .oa-road i, .oa-writing > :last-child::after { animation: none; } }
