/*
 * Live voice session (apps/web/src/voice/call.ts), shared by the demos: a push-to-talk character in a strip
 * under the chat log. A page sets --call-ink, --call-accent and --call-bg (and the usual --paper, --line,
 * --muted, --mono). Character parts: .buddy-face pieces are shared, each character colours its own body.
 */
.call { flex: none; display: grid; gap: 6px; padding: 8px 14px 12px; border-top: 1px solid var(--line); background: var(--call-bg); }
.call-top { display: flex; align-items: center; gap: 8px; }
.call-model { font: 500 12px var(--mono); color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 3px 10px; }
.call-model:hover { color: var(--call-ink); border-color: var(--call-ink); }
.call-close { margin-left: auto; border: 0; background: var(--call-accent); color: #fff; border-radius: 999px; padding: 5px 16px; font-weight: 600; cursor: pointer; }
.call-stage { display: flex; align-items: center; gap: 12px; }
.call-status { margin: 0; flex: 1; font-weight: 500; color: var(--call-ink); }
.call-gate { padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 10px; }
.call-gate p { margin: 0; }
.call-gate .small { font-size: 12px; }
.call-download, .call-forget { justify-self: start; border: 0; background: var(--call-ink); color: #fff; border-radius: 999px; padding: 8px 18px; font-weight: 600; cursor: pointer; }
.call-forget { background: none; color: var(--call-ink); border: 1px solid var(--call-ink); }
.call-error { color: var(--call-accent); }
.call-bar { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.call-bar-fill { display: block; height: 100%; width: 0; background: var(--call-accent); transition: width .2s; }

.call-btn[aria-pressed="true"] { background: rgba(255,255,255,.18); }
.buddy { --lvl: 0; position: relative; flex: none; width: 120px; height: 114px; border: 0; padding: 0; background: none; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 50%; }
.buddy:focus-visible { outline: 3px solid var(--call-ink); outline-offset: 6px; }
.buddy-svg { width: 100%; height: 100%; overflow: visible; }
.buddy-shadow { fill: rgba(31,42,68,.14); }
.buddy-mawa .rice { fill: #fffdf8; stroke: #e2dccf; stroke-width: 3; }
.buddy-mawa .grains path { fill: none; stroke: #e6dfd0; stroke-width: 2.5; stroke-linecap: round; }
.buddy-mawa .fish { fill: #f08a5d; stroke: #d9663a; stroke-width: 3; stroke-linejoin: round; }
.buddy-mawa .fat { fill: none; stroke: #ffd9c7; stroke-width: 5; stroke-linecap: round; }
.buddy-eye { fill: var(--ink); transform-box: fill-box; transform-origin: center; transition: transform .15s; }
.buddy-glint { fill: #fff; }
.buddy-lids { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: 0; }
.buddy-blush { fill: #f6a99a; opacity: .7; }
.buddy-mouth { fill: #8c2a1a; transform-box: fill-box; transform-origin: center top; transform: scaleY(.35); transition: transform .06s; }
.buddy-body { transform-box: fill-box; transform-origin: 50% 100%; animation: buddy-bob 3.2s ease-in-out infinite; }
.buddy-dots { opacity: 0; }
.buddy-dots circle { fill: var(--paper); stroke: var(--line); stroke-width: 2; }
.buddy-rings { position: absolute; inset: 0; pointer-events: none; }
.buddy-rings i { position: absolute; left: 50%; top: 58%; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 3px solid var(--call-accent); opacity: 0; }

/* idle: blinks now and then */
.buddy[data-face="idle"] .buddy-eye { animation: buddy-blink 5s infinite; }
/* sleepy: not loaded yet */
.buddy[data-face="sleepy"] { cursor: default; }
.buddy[data-face="sleepy"] .buddy-eye, .buddy[data-face="sleepy"] .buddy-glint { opacity: 0; }
.buddy[data-face="sleepy"] .buddy-lids { opacity: 1; }
.buddy[data-face="sleepy"] .buddy-body { animation-duration: 5s; }
/* listening: squeezed, wide eyes, rings follow your voice */
.buddy[data-face="listening"] .buddy-body { animation: none; transform: scale(1.04, .93); }
.buddy[data-face="listening"] .buddy-eye { transform: scale(1.25); }
.buddy[data-face="listening"] .buddy-mouth { transform: scaleY(.7); }
.buddy[data-face="listening"] .buddy-rings i { animation: buddy-ring 1.4s ease-out infinite; }
.buddy[data-face="listening"] .buddy-rings i:nth-child(2) { animation-delay: .45s; }
.buddy[data-face="listening"] .buddy-rings i:nth-child(3) { animation-delay: .9s; }
.buddy[data-face="listening"] .buddy-rings { transform: scale(calc(1 + var(--lvl) * .25)); }
/* thinking: looks up, thought bubbles */
.buddy[data-face="thinking"] .buddy-eyes { transform: translate(4px, -5px); }
.buddy[data-face="thinking"] .buddy-dots { opacity: 1; }
.buddy[data-face="thinking"] .buddy-dots circle { animation: buddy-dot 1.2s infinite; }
.buddy[data-face="thinking"] .buddy-dots circle:nth-child(2) { animation-delay: .2s; }
.buddy[data-face="thinking"] .buddy-dots circle:nth-child(3) { animation-delay: .4s; }
/* speaking: mouth follows the sound */
.buddy[data-face="speaking"] .buddy-mouth { transform: scaleY(calc(.35 + var(--lvl) * 1.6)); }
.buddy[data-face="speaking"] .buddy-body { animation-duration: 1.1s; }

@keyframes buddy-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes buddy-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes buddy-ring { from { transform: scale(.7); opacity: .55; } to { transform: scale(1.35); opacity: 0; } }
@keyframes buddy-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .buddy *, .buddy-rings i { animation: none !important; } }

/* Tee, the store's T-shirt */
.buddy-tee .shirt { fill: #f4efe6; stroke: #cfc6b6; stroke-width: 3; stroke-linejoin: round; }
.buddy-tee .collar { fill: none; stroke: #cfc6b6; stroke-width: 3; stroke-linecap: round; }
.buddy-tee .stripe { fill: var(--call-accent); opacity: .9; }
.buddy-tee .tag { fill: var(--call-ink); }
