/* Xblu Voice 0.1.0 — the voice panel (floating, full-screen on phones, or embedded), its launchers,
   and the "Talk" button inside the AI Assistant chat window. The accent colour comes from the AI
   Assistant (--xv-accent); everything else derives from it with color-mix(). */

.xv, .xv * { box-sizing: border-box; }
.xv {
  --xv-accent: #146EF5;
  --xv-bg: #070b1c; --xv-panel: #0d1433; --xv-panel-2: #090f27; --xv-fg: #ece9e0; --xv-muted: #9aa2bd; --xv-dim: #5f6786;
  --xv-you: #56c9f4; --xv-line: color-mix(in srgb, var(--xv-accent) 22%, transparent);
  --xv-glow: color-mix(in srgb, var(--xv-accent) 28%, transparent);
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--xv-fg); line-height: 1.45; font-size: 15px;
  background: linear-gradient(180deg, var(--xv-panel) 0%, var(--xv-panel-2) 100%); border-radius: 24px; overflow: hidden;
  box-shadow: 0 26px 60px rgba(0,0,0,.45), 0 0 0 1px var(--xv-line), 0 0 28px color-mix(in srgb, var(--xv-accent) 12%, transparent);
  animation: xv-alive 3s ease-in-out infinite; text-align: left;
}
.xv--light {
  --xv-bg: #ffffff; --xv-panel: #ffffff; --xv-panel-2: #f3f6fb; --xv-fg: #152033; --xv-muted: #667085; --xv-dim: #98a2b3;
  --xv-you: #0e7490; --xv-line: color-mix(in srgb, var(--xv-accent) 26%, transparent); --xv-glow: color-mix(in srgb, var(--xv-accent) 22%, transparent);
  box-shadow: 0 18px 50px rgba(0,0,0,.14), 0 0 0 1px var(--xv-line);
}
@keyframes xv-alive { 50% { box-shadow: 0 26px 60px rgba(0,0,0,.45), 0 0 0 1px color-mix(in srgb, var(--xv-accent) 34%, transparent), 0 0 40px color-mix(in srgb, var(--xv-accent) 24%, transparent); } }
.xv--light { animation: xv-alive-light 3s ease-in-out infinite; }
@keyframes xv-alive-light { 50% { box-shadow: 0 18px 50px rgba(0,0,0,.14), 0 0 0 1px color-mix(in srgb, var(--xv-accent) 45%, transparent), 0 0 30px color-mix(in srgb, var(--xv-accent) 20%, transparent); } }
.xv--dark::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55), transparent 2px), radial-gradient(1px 1px at 78% 9%, rgba(255,255,255,.4), transparent 2px), radial-gradient(1px 1px at 88% 42%, rgba(255,255,255,.5), transparent 2px), radial-gradient(1px 1px at 22% 62%, rgba(255,255,255,.35), transparent 2px), radial-gradient(1px 1px at 64% 70%, rgba(255,255,255,.45), transparent 2px), radial-gradient(1px 1px at 40% 30%, rgba(255,255,255,.3), transparent 2px), radial-gradient(1px 1px at 8% 86%, rgba(255,255,255,.35), transparent 2px); }
.xv button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.xv button:focus-visible, .xv [tabindex]:focus-visible { outline: 2px solid var(--xv-you); outline-offset: 2px; }

/* header */
.xv__top { display: flex; align-items: center; gap: 11px; padding: 14px 16px 12px; border-bottom: 1px solid var(--xv-line); position: relative; flex: 0 0 auto; }
.xv__logo { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: rgba(255,255,255,.06); padding: 3px; }
.xv--light .xv__logo { background: #fff; border: 1px solid #e6eaf0; }
.xv__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.xv__logo--mark { background: transparent; padding: 0; color: var(--xv-accent); }
.xv__logo--mark .xv-mark { width: 30px; height: 30px; }
.xv__names { min-width: 0; flex: 1; }
.xv__name { font-weight: 700; font-size: 16px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xv__sub { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--xv-muted); margin-top: 3px; display: flex; align-items: center; gap: 7px; }
.xv__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--xv-dim); transition: background .3s, box-shadow .3s; }
.xv[data-mode="listening"] .xv__dot, .xv[data-mode="ready"] .xv__dot { background: var(--xv-you); box-shadow: 0 0 8px var(--xv-you); }
.xv[data-mode="speaking"] .xv__dot { background: var(--xv-accent); box-shadow: 0 0 8px var(--xv-accent); }
.xv[data-mode="thinking"] .xv__dot, .xv[data-mode="connecting"] .xv__dot { background: var(--xv-muted); animation: xv-blink 1s ease-in-out infinite; }
@keyframes xv-blink { 50% { opacity: .3; } }
.xv__timer { font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--xv-dim); }
.xv__timer[hidden] { display: none; }
.xv__x { background: none; border: 0; color: var(--xv-muted); width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; display: grid; place-items: center; }
.xv__x:hover { background: rgba(127,127,127,.15); color: var(--xv-fg); }

/* the symbol */
.xv__sigil { position: relative; flex: 1 1 auto; min-height: 220px; display: grid; place-items: center; cursor: default; }
.xv[data-mode="speaking"] .xv__sigil { cursor: pointer; }
.xv__rings { width: min(76%, 320px); max-width: 100%; height: auto; aspect-ratio: 1; display: block; max-height: 92%; }
.xv__rings stop { stop-color: var(--xv-accent); }
.xv__ring { fill: none; stroke: var(--xv-accent); stroke-width: 1; opacity: .32; }
.xv__ring.outer { opacity: .5; } .xv__ring.inner { opacity: .22; }
.xv__ring.dash { stroke-dasharray: 2 7; opacity: .45; transform-box: fill-box; transform-origin: center; }
.xv__ticks line { stroke: var(--xv-accent); stroke-width: 1; opacity: .32; }
.xv__ticks line.maj { opacity: .62; stroke-width: 1.3; }
.xv__corners rect { fill: var(--xv-accent); opacity: .85; }
.xv__glow { transform-box: fill-box; transform-origin: center; animation: xv-breathe 4.6s ease-in-out infinite; }
@keyframes xv-breathe { 0%, 100% { transform: scale(.95); opacity: .7; } 50% { transform: scale(1.05); opacity: 1; } }
.xv[data-mode="speaking"] .xv__glow { animation-duration: 1.5s; }
.xv[data-mode="listening"] .xv__glow { opacity: .45; animation: none; }
.xv__ripple { fill: none; stroke: var(--xv-you); stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.xv[data-mode="listening"] .xv__ripple { animation: xv-ripple 2.4s ease-out infinite; }
.xv[data-mode="listening"] .xv__ripple.r2 { animation-delay: 1.2s; }
@keyframes xv-ripple { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.6); opacity: 0; } }
.xv[data-mode="thinking"] .xv__ring.dash, .xv[data-mode="connecting"] .xv__ring.dash { opacity: .85; animation: xv-spin 7s linear infinite; }
@keyframes xv-spin { to { transform: rotate(360deg); } }
.xv__wave { position: absolute; left: 50%; top: 50%; width: min(68%, 290px); height: 40%; max-height: 150px; transform: translate(-50%, -50%); pointer-events: none; } /* JS resizes it to the ring */

/* status + captions */
.xv__status { flex: 0 0 auto; text-align: center; font-size: 12.5px; color: var(--xv-muted); min-height: 18px; padding: 0 20px; letter-spacing: .02em; }
.xv[data-mode="listening"] .xv__status, .xv[data-mode="ready"] .xv__status { color: var(--xv-you); }
.xv[data-mode="speaking"] .xv__status { color: var(--xv-accent); }
.xv[data-mode="error"] .xv__status { color: #ff8a80; }
.xv--light.xv[data-mode="error"] .xv__status { color: #b42318; }
.xv__caps { flex: 0 0 auto; position: relative; padding: 10px 22px 0; min-height: 84px; max-height: 150px; overflow-y: auto; scrollbar-width: thin; display: grid; align-content: start; gap: 6px;
  -webkit-mask-image: linear-gradient(180deg, #000 84%, transparent); mask-image: linear-gradient(180deg, #000 84%, transparent); }
.xv__caps[hidden] { display: none; }
.xv__you { color: var(--xv-you); font-size: 13px; font-style: italic; }
.xv__say { font-size: 15.5px; line-height: 1.5; max-width: 52ch; }

/* controls */
.xv__bar { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 22px 8px; }
.xv__side { width: 42px; height: 42px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--xv-fg) 14%, transparent); background: color-mix(in srgb, var(--xv-fg) 4%, transparent); color: var(--xv-muted); display: grid; place-items: center; justify-self: start; }
.xv__side:disabled { opacity: .35; cursor: default; }
.xv__side--ghost { visibility: hidden; }
.xv__keys { justify-self: end; }
.xv__mute .xv-mute-x { display: none; }
.xv__mute[aria-pressed="true"] { color: var(--xv-fg); border-color: color-mix(in srgb, var(--xv-fg) 30%, transparent); }
.xv__mute[aria-pressed="true"] .xv-mute-x { display: block; }
.xv__mic { width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid var(--xv-accent); background: color-mix(in srgb, var(--xv-accent) 12%, transparent); color: var(--xv-accent); display: grid; place-items: center; position: relative; transition: background .25s, color .25s, transform .15s; justify-self: center; }
.xv__mic:active { transform: scale(.96); }
.xv__mic::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--xv-accent) 38%, transparent); opacity: .6; }
.xv[data-mode="off"] .xv__mic, .xv[data-mode="error"] .xv__mic { animation: xv-pulse 2.6s ease-in-out infinite; }
@keyframes xv-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--xv-accent) 0%, transparent), 0 0 24px var(--xv-glow); } }
.xv:not([data-mode="off"]):not([data-mode="error"]) .xv__mic { background: color-mix(in srgb, var(--xv-fg) 8%, transparent); border-color: color-mix(in srgb, var(--xv-fg) 25%, transparent); color: var(--xv-fg); }
.xv[data-mode="listening"] .xv__mic::after, .xv[data-mode="ready"] .xv__mic::after { border-color: color-mix(in srgb, var(--xv-you) 70%, transparent); animation: xv-micpulse 1.6s ease-out infinite; }
@keyframes xv-micpulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.xv__foot { flex: 0 0 auto; font-size: 11px; color: var(--xv-dim); text-align: center; padding: 2px 20px 14px; line-height: 1.4; }
.xv__audio { display: none; }

/* floating host: desktop card bottom-right, full screen on phones */
.xv-float { position: fixed; right: 22px; bottom: 22px; z-index: 1000000; width: min(440px, calc(100vw - 28px)); height: min(700px, calc(100vh - 44px)); }
.xv-float[hidden] { display: none; }
@media (max-width: 640px) {
  .xv-float { inset: 0; width: auto; height: auto; }
  .xv-float .xv { border-radius: 0; height: 100%; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); animation: none; }
  .xv-float .xv__sigil { min-height: 260px; }
  .xv-float .xv__rings { width: min(84%, 360px); }
  .xv-float .xv__caps { max-height: 190px; }
  .xv-float .xv__mic { width: 80px; height: 80px; }
  body.xv-open { overflow: hidden; }
}

/* embedded: [xblu_voice] */
.xv-embed { display: block; width: 100%; height: var(--xv-h, 560px); max-height: 90vh; margin: 0 auto; }
.xv-embed .xv { height: 100%; }
.xv-embed .xv__rings { width: min(70%, 420px); }

.xv-embed .xv__say { font-size: 17px; max-width: 60ch; }
@media (max-width: 640px) { .xv-embed { height: min(var(--xv-h, 560px), 88vh); } .xv-embed .xv { border-radius: 18px; } }

/* launchers */
.xv-launcher { --xv-accent: #146EF5; position: fixed; right: 22px; bottom: 86px; z-index: 999998; display: flex; align-items: center; gap: 9px; border: 1px solid color-mix(in srgb, var(--xv-accent) 55%, transparent);
  background: linear-gradient(180deg, #0d1433, #090f27); color: #ece9e0; border-radius: 999px; padding: 9px 16px 9px 10px; font: 700 14px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 14px 34px rgba(0,0,0,.35), 0 0 22px color-mix(in srgb, var(--xv-accent) 20%, transparent); cursor: pointer; animation: xv-alive 3s ease-in-out infinite; }
.xv-launcher__ring { color: var(--xv-accent); display: flex; }
.xv-launcher__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--xv-accent); box-shadow: 0 0 8px var(--xv-accent); animation: xv-breathe 2.4s ease-in-out infinite; }
body.xv-open .xv-launcher { visibility: hidden; }
.xv-launcher--solo { padding: 12px 20px 12px 12px; font-size: 15px; }
.xv-launcher--solo .xv-launcher__ring svg { width: 28px; height: 28px; }
@media (max-width: 600px) { .xv-launcher { right: 12px; bottom: 74px; padding: 9px 14px 9px 9px; } }

.xv-chat-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--xblu-accent, #146EF5) 40%, transparent); background: color-mix(in srgb, var(--xblu-accent, #146EF5) 12%, transparent); color: var(--xa-link-l, var(--xblu-accent, #146EF5)); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 6px 12px 6px 9px; margin: 6px 0 4px; cursor: pointer; }
.xv-chat-btn:hover { background: color-mix(in srgb, var(--xblu-accent, #146EF5) 22%, transparent); }
.xblu-ai--dark .xv-chat-btn { color: var(--xa-link-d, #8fc2ff); }
@media (prefers-color-scheme: dark) { .xblu-ai--auto .xv-chat-btn { color: var(--xa-link-d, #8fc2ff); } }
.xv-chat-btn__ico { display: flex; }

@media (prefers-reduced-motion: reduce) {
  .xv, .xv-launcher, .xv__glow, .xv__ripple, .xv__ring.dash, .xv__mic, .xv__mic::after, .xv__dot, .xv-launcher__dot { animation: none !important; }
}
