:root {
  --bg: #05060a; --panel: #0b0e16; --line: #1b2230; --text: #e9eef7;
  --muted: #7d8798; --accent: #5ad1c8; --accent-ink: #04120f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif; overscroll-behavior: none;
}
.app {
  max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column;
}
.stage {
  position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(130% 85% at 50% 28%, #11151f 0%, #05060a 72%); overflow: hidden;
}
.face {
  position: absolute; height: 100%; max-height: 78dvh; object-fit: contain;
  opacity: 0; transition: opacity .18s ease;
}
.face.on { opacity: 1; }
/* WordSync canvas sits above the clips; shown only while it drives speech. */
canvas.wordstage { z-index: 1; background: transparent; }
.badge, .served {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; background: rgba(5,6,10,.62); z-index: 2;
}
.badge { left: 14px; color: var(--text); font-weight: 600; }
.served { right: 14px; color: var(--accent); }
.reply {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2;
  background: rgba(8,11,18,.88); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 15px; font-size: 16px; line-height: 1.45;
  opacity: 0; transform: translateY(8px); transition: opacity .28s, transform .28s;
}
.reply.show { opacity: 1; transform: translateY(0); }
.bar {
  display: flex; gap: 9px; align-items: center; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line);
}
.bar input {
  flex: 1; min-width: 0; background: #0a0d14; border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); padding: 13px 15px; font-size: 16px; outline: none;
}
.bar input:focus { border-color: var(--accent); }
.mic, .send {
  flex: 0 0 auto; height: 46px; width: 46px; border: 0; border-radius: 14px; cursor: pointer;
  font-size: 18px; display: grid; place-items: center;
}
.mic { background: #0a0d14; border: 1px solid var(--line); color: var(--muted); }
.mic.live { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 6px rgba(90,209,200,.15); }
.send { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.send:disabled, .bar input:disabled { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .face, .reply { transition: none; } }
