/* Live (voice) mode chrome — deliberately minimal. Live mode IS the normal ai-search UI with mic +
   audio; the only voice-specific surface is the 🎙 toggle's active state and a small status pill.
   Uses the same theme tokens as search.css (--ai, --ai2, --surface, --ink…). */

/* mic toggle — sits between ⚙ and → in the ask bar, matching .ask-ctx */
.ask-mic {
  flex: none; cursor: pointer; width: 42px; height: 42px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, border-color .12s, background .12s;
}
.ask-mic svg { width: 19px; height: 19px; }
.ask-mic:hover { color: var(--ai); border-color: color-mix(in srgb, var(--ai) 45%, var(--line)); }
/* active (live mode on): filled accent + a soft pulse so it's clearly "hot" */
.ask-mic.on {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--ai), var(--ai2));
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ai) 55%, transparent);
  animation: mic-pulse 1.8s ease-out infinite;
}
@keyframes mic-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ai) 55%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ai) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ai) 0%, transparent); }
}

/* status pill — floats bottom-center while live mode is active. Tap to skip the answer / stop. */
#live-pill[hidden] { display: none; }
#live-pill {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none;
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  box-shadow: 0 6px 22px rgba(20,30,55,.18); animation: pill-in .18s ease both;
}
@keyframes pill-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
#live-pill:hover { border-color: color-mix(in srgb, var(--ai) 50%, var(--line)); }

.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ai); flex: none; }
/* phase cues on the dot */
#live-pill[data-phase="listening"]    .live-dot { background: #22c55e; animation: dot-pulse 1.4s ease-in-out infinite; }
#live-pill[data-phase="loading"]      .live-dot,
#live-pill[data-phase="transcribing"] .live-dot { background: var(--ai); animation: dot-pulse 1s ease-in-out infinite; }
#live-pill[data-phase="thinking"]     .live-dot { background: var(--ai); animation: dot-spin 1s linear infinite; border-radius: 50%;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ai) 35%, transparent); }
#live-pill[data-phase="speaking"]     .live-dot { background: var(--ai2); animation: dot-speak .5s ease-in-out infinite alternate; }
/* wake (idle): a slow, dim breath — clearly "asleep, waiting for the wake phrase" */
#live-pill[data-phase="wake"]         .live-dot { background: var(--ink-3); animation: dot-breathe 2.6s ease-in-out infinite; }
#live-pill[data-phase="wake"] { color: var(--ink-2); }
#live-pill[data-phase="error"]        .live-dot { background: #e2554f; animation: none; }

@keyframes dot-pulse { 0%,100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes dot-spin  { to { transform: rotate(360deg); } }
@keyframes dot-speak { from { transform: scaleY(.6); } to { transform: scaleY(1.15); } }
@keyframes dot-breathe { 0%,100% { opacity: .3; } 50% { opacity: .7; } }

/* phones: match the smaller search-bar buttons, and float the status pill above the bottom nav bar */
@media (max-width: 640px) {
  .ask-mic { width: 40px; height: 40px; }
  #live-pill { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
