/* Zari AI assistant: orb launcher + chat popup. Theme palette: ink, lime, charcoal, paper, stone. */
.zai-launcher, .zai-panel {
  --zai-ink: #0F0F0F; --zai-lime: #C4FE2E; --zai-charcoal: #2F2F2F; --zai-paper: #FEFEFE; --zai-stone: #808080;
  --zai-line: rgba(15, 15, 15, .12); --zai-spring: cubic-bezier(.34, 1.45, .64, 1); --zai-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: var(--sans, 'Inter', system-ui, sans-serif);
}
.zai-launcher *, .zai-panel *, .zai-launcher *::before, .zai-panel *::before, .zai-launcher *::after, .zai-panel *::after { box-sizing: border-box; }

/* ---------- orb ---------- */
.zai-orb { --orb: 62px; position: relative; display: inline-grid; place-items: center; width: var(--orb); height: var(--orb); flex: none; }
.zai-orb--hero { --orb: 104px; margin: 14px 0 22px; }
.zai-orb__halo { position: absolute; inset: -24%; border-radius: 50%; background: radial-gradient(circle, rgba(196, 254, 46, .65), rgba(196, 254, 46, 0) 68%); filter: blur(6px); animation: zai-breathe 4.2s ease-in-out infinite; transition: inset .5s var(--zai-ease, ease); }
.zai-orb__ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid #0F0F0F; opacity: 0; pointer-events: none; }
.zai-orb__body { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 35% 30%, #F4FFC8, #C4FE2E 55%, #8FC400);
  box-shadow: inset 0 -6px 14px rgba(15, 15, 15, .32), inset 0 4px 10px rgba(255, 255, 255, .7), 0 10px 26px -6px rgba(15, 15, 15, .5); transition: box-shadow .4s ease; }
.zai-orb__blob { position: absolute; width: 78%; height: 78%; border-radius: 46% 54% 58% 42% / 52% 40% 60% 48%; filter: blur(calc(var(--orb) * .12)); animation: zai-drift 9s ease-in-out infinite, zai-morph 6s ease-in-out infinite; }
.zai-orb__blob--1 { background: #FEFEFE; top: -14%; left: -10%; opacity: .9; }
.zai-orb__blob--2 { background: #2F2F2F; bottom: -22%; right: -16%; opacity: .55; animation-duration: 11s, 7s; animation-direction: reverse, normal; }
.zai-orb__blob--3 { background: #E2FF7E; top: 20%; left: 26%; width: 56%; height: 56%; animation-duration: 8s, 5s; }
.zai-orb__sheen { position: absolute; inset: 6% 14% auto 14%; height: 38%; border-radius: 50%; background: linear-gradient(to bottom, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0)); z-index: 2; }
/* Looping video icon inside the Ask Zari orb. Falls back to the CSS blobs until the first frame paints. */
.zai-orb__video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 0; transition: opacity .3s ease; }
/* The webm already carries its own transparency, so the orb body stays see-through. */
.zai-orb__body--video { background: transparent; box-shadow: none; }
.zai-orb__body--video.is-video-ready .zai-orb__video { opacity: 1; }
.zai-orb__body--video.is-video-ready .zai-orb__blob,
.zai-orb__body--video.is-video-ready .zai-orb__sheen { display: none; }
.zai-launcher:hover .zai-orb__blob, .zai-launcher.is-hover .zai-orb__blob, .zai-orb--hero:hover .zai-orb__blob { animation-duration: 3.2s, 2.4s; }
.zai-launcher:hover .zai-orb__halo, .zai-orb--hero:hover .zai-orb__halo { inset: -42%; }
.zai-launcher:hover .zai-orb__ring--a, .zai-orb--hero:hover .zai-orb__ring--a { animation: zai-ripple 1.6s var(--zai-ease, ease) infinite; }
.zai-launcher:hover .zai-orb__ring--b, .zai-orb--hero:hover .zai-orb__ring--b { animation: zai-ripple 1.6s var(--zai-ease, ease) .5s infinite; }
@keyframes zai-breathe { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes zai-drift { 0% { transform: translate(0, 0) rotate(0); } 33% { transform: translate(22%, 14%) rotate(120deg); } 66% { transform: translate(-12%, 24%) rotate(240deg); } 100% { transform: translate(0, 0) rotate(360deg); } }
@keyframes zai-morph { 0%, 100% { border-radius: 46% 54% 58% 42% / 52% 40% 60% 48%; } 50% { border-radius: 58% 42% 44% 56% / 44% 58% 42% 56%; } }
@keyframes zai-ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.75); opacity: 0; } }

/* ---------- launcher (top of the bottom-right stack) ---------- */
.zai-launcher { position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 0; margin: 0 -3px 2px 0; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.zai-launcher__tag { margin-right: -14px; padding: 9px 22px 9px 16px; border-radius: 999px; background: #0F0F0F; color: #C4FE2E; font: 400 20px/1 var(--heading, 'Bebas Neue', sans-serif); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(15, 15, 15, .6); opacity: 0; transform: translateX(14px) scale(.92); transform-origin: right center; pointer-events: none; transition: opacity .3s ease, transform .45s var(--zai-spring); }
.zai-launcher:hover .zai-launcher__tag, .zai-launcher:focus-visible .zai-launcher__tag { opacity: 1; transform: none; }
.zai-launcher:focus-visible { outline: 2px solid #0F0F0F; outline-offset: 6px; border-radius: 999px; }

/* ---------- panel ---------- */
.zai-panel { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 8800; width: min(392px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 36px));
  display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; color: #0F0F0F; transform-origin: calc(100% - 30px) calc(100% - 30px);
  background: radial-gradient(120% 55% at 50% -10%, rgba(196, 254, 46, .38), transparent 62%), radial-gradient(90% 45% at 100% 100%, rgba(196, 254, 46, .22), transparent 60%), #FEFEFE;
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 30px 80px -20px rgba(15, 15, 15, .55), 0 0 0 1px var(--zai-line); }
.zai-panel[hidden] { display: none !important; }
.zai-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 18px; background: rgba(254, 254, 254, .6); border-bottom: 1px solid var(--zai-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.zai-head__brand { display: flex; align-items: center; gap: 10px; }
.zai-head__mark { display: grid; place-items: center; width: 40px; height: 40px; background: transparent; }
.zai-head__mark .zai-orb { --orb: 40px; }
.zai-head__title { font: 400 26px/1 var(--heading, 'Bebas Neue', sans-serif); letter-spacing: .04em; text-transform: uppercase; }
.zai-iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid var(--zai-line); color: #0F0F0F; cursor: pointer; transition: transform .35s var(--zai-spring), background .2s; }
.zai-iconbtn:hover { transform: rotate(90deg) scale(1.06); background: #C4FE2E; }
.zai-body { flex: 1; overflow-y: auto; padding: 22px 18px 8px; scrollbar-width: thin; scrollbar-color: var(--zai-line) transparent; overscroll-behavior: contain; }
.zai-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; }
.zai-welcome[hidden], .zai-thread[hidden] { display: none; }
.zai-welcome__title { margin: 0; font: 400 34px/1 var(--heading, 'Bebas Neue', sans-serif); letter-spacing: .03em; text-transform: uppercase; }
.zai-welcome__sub { margin: 10px 0 0; max-width: 30ch; font-size: 13.5px; line-height: 1.55; color: #2F2F2F; }
.zai-welcome__label { align-self: flex-start; margin: 24px 0 10px; font-size: 13px; font-weight: 700; color: #808080; }
.zai-prompts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zai-prompt { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 112px; padding: 12px; text-align: left; font: 600 12.5px/1.4 var(--sans, 'Inter', sans-serif); color: #0F0F0F; border-radius: 16px; background: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 6px 18px -12px rgba(15, 15, 15, .5); cursor: pointer; transition: transform .35s var(--zai-spring), box-shadow .3s, border-color .3s; }
.zai-prompt:hover { transform: translateY(-3px); border-color: #0F0F0F; box-shadow: 0 14px 26px -14px rgba(15, 15, 15, .55); }
.zai-prompt__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #C4FE2E; color: #0F0F0F; }
.zai-thread { display: flex; flex-direction: column; gap: 12px; padding-bottom: 10px; }
.zai-msg { max-width: 88%; padding: 11px 14px; font-size: 13.5px; line-height: 1.55; border-radius: 18px; }
.zai-msg p { margin: 0; }
.zai-msg p + p, .zai-msg p + ol, .zai-msg p + ul, .zai-msg ol + p, .zai-msg ul + p { margin-top: 8px; }
.zai-msg ol, .zai-msg ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; list-style: revert; }
.zai-msg--user { align-self: flex-end; background: #0F0F0F; color: #fff; border-bottom-right-radius: 6px; }
.zai-msg--ai { align-self: flex-start; background: rgba(255, 255, 255, .92); border: 1px solid var(--zai-line); border-bottom-left-radius: 6px; }
.zai-msg--ai.is-error { border-color: rgba(176, 0, 32, .4); }
/* Product pictures the assistant attaches to an answer. */
.zai-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(102px, 1fr)); gap: 8px; margin-top: 10px; }
.zai-img { margin: 0; }
.zai-img__link { display: block; border-radius: 14px; overflow: hidden; background: #F4F4F1; border: 1px solid var(--zai-line); transition: transform .3s var(--zai-spring), box-shadow .3s; }
.zai-img__link:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(15, 15, 15, .6); }
.zai-img img { display: block; width: 100%; height: 116px; object-fit: cover; }
.zai-img figcaption { margin-top: 5px; font: 600 11.5px/1.35 var(--sans, 'Inter', sans-serif); color: #2F2F2F; }
.zai-typing { display: flex; gap: 5px; padding: 14px 16px; }
.zai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #0F0F0F; animation: zai-dot 1.1s ease-in-out infinite; }
.zai-typing i:nth-child(2) { animation-delay: .15s; } .zai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes zai-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
.zai-foot { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
.zai-field { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--zai-line); box-shadow: 0 8px 22px -14px rgba(15, 15, 15, .6); transition: border-color .25s, box-shadow .25s; }
.zai-field:focus-within { border-color: #0F0F0F; box-shadow: 0 0 0 4px rgba(196, 254, 46, .5); }
.zai-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 14px var(--sans, 'Inter', sans-serif); color: #0F0F0F; }
.zai-field input::placeholder { color: #808080; }
.zai-send, .zai-mic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; transition: transform .3s var(--zai-spring), opacity .2s; }
.zai-send { background: #C4FE2E; color: #0F0F0F; }
.zai-mic { background: #0F0F0F; color: #C4FE2E; }
.zai-send:hover:not(:disabled), .zai-mic:hover { transform: scale(1.1); }
.zai-send:disabled { opacity: .45; cursor: default; }
.zai-mic.is-on { animation: zai-listen 1.2s ease-in-out infinite; }
@keyframes zai-listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 254, 46, .8); } 50% { box-shadow: 0 0 0 9px rgba(196, 254, 46, 0); } }
body.burger-open .zai-launcher { display: none; }

@media (max-width: 1023px) { .zai-panel { bottom: calc(18px + env(safe-area-inset-bottom)); } }
@media (max-width: 520px) {
  .zai-panel { inset: auto 0 0 0; width: 100%; height: min(88dvh, 720px); border-radius: 28px 28px 0 0; transform-origin: 50% 100%; }
  .zai-launcher__tag { display: none; }
}
@media (max-width: 360px) { .zai-prompts { grid-template-columns: 1fr; } .zai-prompt { min-height: 0; flex-direction: row; align-items: center; } }
@media (prefers-reduced-motion: reduce) { .zai-orb__blob, .zai-orb__halo, .zai-typing i { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } }
