/* Voice call overlay (js/voice.js). Near-black, a thin off-white ring, one small amber accent. No blue, no filled orb.
   listening: slow breathing ring + inner dot; thinking: ring with a small orbiting amber dot;
   speaking: ring + symmetric thin waveform in off-white with a single amber centre bar. Own namespace: .vc-* */

.vc-root {
  --vc-lvl: 0;
  --vc-amber: #ffa800;
  --vc-ink: #f3f3f2;
  --vc-dim: #9b9b95;
  --vc-line: rgba(243, 243, 242, 0.1);
  --vc-glass: rgba(255, 255, 255, 0.07);
  position: fixed; inset: 0; z-index: 3000;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: radial-gradient(ellipse 70% 55% at 50% 42%, #131313 0%, #0b0b0b 58%, #050505 100%);
  color: var(--vc-ink);
  font-family: var(--font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.vc-root *, .vc-root *::before, .vc-root *::after { box-sizing: border-box; }
.vc-root [hidden] { display: none !important; }
:where(.vc-root) :is(button, input, select) { font: inherit; color: inherit; }
.vc-root :focus-visible { outline: 2px solid var(--vc-amber); outline-offset: 3px; }

/* ---- top row ---- */
.vc-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 0; flex: none; }
.vc-icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid transparent; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--vc-dim);
  transition: background-color 0.15s, color 0.15s;
}
.vc-icon-btn:hover, .vc-icon-btn[aria-expanded="true"] { background: var(--vc-glass); border-color: var(--vc-line); color: var(--vc-ink); }

.vc-settings {
  position: absolute; z-index: 5; top: 64px; right: 16px; width: min(320px, calc(100vw - 32px));
  background: rgba(24, 24, 24, 0.92); border: 1px solid var(--vc-line); border-radius: 22px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
}
.vc-settings label { font-size: 12px; font-weight: 500; color: var(--vc-dim); margin-top: 6px; }
.vc-settings .vc-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; color: var(--vc-ink); cursor: pointer; }
.vc-select {
  width: 100%; min-height: 40px; padding: 0 10px; border-radius: 12px; background: #0c0c0c; border: 1px solid var(--vc-line); color-scheme: dark;
}
.vc-range { width: 100%; accent-color: var(--vc-amber); min-height: 28px; }
.vc-check { width: 20px; height: 20px; accent-color: var(--vc-amber); flex: none; }
.vc-rate-out { color: var(--vc-ink); font-variant-numeric: tabular-nums; }
.vc-btn-small {
  margin-top: 8px; min-height: 40px; border-radius: 999px; border: 1px solid var(--vc-line); background: var(--vc-glass); cursor: pointer; font-size: 14px; font-weight: 500;
}
.vc-btn-small:hover { border-color: rgba(243, 243, 242, 0.3); }

/* ---- stage: ring, status ---- */
.vc-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 8px 24px; text-align: center; }
.vc-orb-btn {
  --size: min(60vw, 248px, 36dvh);
  width: var(--size); height: var(--size); padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; position: relative;
}
.vc-orb-wrap { position: absolute; inset: 0; display: block; border-radius: 50%; animation: vc-breathe 6s ease-in-out infinite; }
/* very soft neutral glow behind the ring */
.vc-glow {
  position: absolute; inset: -34%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(243, 243, 242, 0.075) 0%, rgba(243, 243, 242, 0.03) 40%, rgba(243, 243, 242, 0) 68%);
  opacity: calc(0.7 + var(--vc-lvl) * 0.6);
  transform: scale(calc(1 + var(--vc-lvl) * 0.08));
  transition: opacity 0.2s linear;
}
/* the ring: 1.5px, off-white */
.vc-orb {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(243, 243, 242, 0.88);
  background: transparent;
  box-shadow: 0 0 36px rgba(243, 243, 242, 0.07), inset 0 0 28px rgba(243, 243, 242, 0.035);
  transform: scale(calc(1 + var(--vc-lvl) * 0.05));
  transition: filter 0.4s ease, opacity 0.3s ease;
}
/* thinking: a small amber dot orbits the ring */
.vc-swirl { position: absolute; inset: -1.5px; border-radius: 50%; opacity: 0; transition: opacity 0.4s ease; }
.vc-swirl::before {
  content: ""; position: absolute; top: -3.5px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: var(--vc-amber); box-shadow: 0 0 10px 1px rgba(255, 168, 0, 0.45);
}
/* inner dot (listening) */
.vc-shine {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--vc-ink); opacity: 0.9;
  transform: scale(calc(1 + var(--vc-lvl) * 1.6));
  transition: opacity 0.3s ease;
}
/* speaking: symmetric waveform of thin bars, single amber centre bar */
.vc-wave { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.vc-wave i {
  --k: 0.3; display: block; width: 2px; border-radius: 1px; background: rgba(243, 243, 242, 0.85);
  height: max(3px, calc(var(--k) * (12% + var(--vc-lvl) * 88%) * 0.9));
  transition: height 0.09s linear;
  animation: vc-bar 1.3s ease-in-out infinite;
}
.vc-wave i:nth-child(1), .vc-wave i:nth-child(15) { --k: 0.22; animation-delay: -0.2s; }
.vc-wave i:nth-child(2), .vc-wave i:nth-child(14) { --k: 0.32; animation-delay: -0.9s; }
.vc-wave i:nth-child(3), .vc-wave i:nth-child(13) { --k: 0.46; animation-delay: -0.5s; }
.vc-wave i:nth-child(4), .vc-wave i:nth-child(12) { --k: 0.6; animation-delay: -1.1s; }
.vc-wave i:nth-child(5), .vc-wave i:nth-child(11) { --k: 0.74; animation-delay: -0.3s; }
.vc-wave i:nth-child(6), .vc-wave i:nth-child(10) { --k: 0.86; animation-delay: -0.7s; }
.vc-wave i:nth-child(7), .vc-wave i:nth-child(9) { --k: 0.95; animation-delay: -1.2s; }
.vc-wave i:nth-child(8) { --k: 1; background: var(--vc-amber); animation-delay: -0.1s; }

.vc-root[data-state="thinking"] .vc-orb-wrap { animation: none; }
.vc-root[data-state="thinking"] .vc-swirl { opacity: 1; animation: vc-spin 3.4s linear infinite; }
.vc-root[data-state="thinking"] .vc-orb { filter: brightness(0.78); }
.vc-root[data-state="thinking"] .vc-shine { opacity: 0.35; }
.vc-root[data-state="speaking"] .vc-orb-wrap { animation: none; }
.vc-root[data-state="speaking"] .vc-orb { filter: brightness(1.08); }
.vc-root[data-state="speaking"] .vc-wave { opacity: 1; }
.vc-root[data-state="speaking"] .vc-shine { opacity: 0; }
.vc-root[data-muted="true"] .vc-orb { filter: brightness(0.5); }
.vc-root[data-muted="true"] .vc-glow { opacity: 0.3; }
.vc-root[data-muted="true"] .vc-shine { opacity: 0.35; }

@keyframes vc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes vc-spin { to { transform: rotate(360deg); } }
@keyframes vc-bar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.72); } }

.vc-status { margin: 30px 0 0; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: var(--vc-ink); min-height: 1.4em; }
.vc-caption { margin: 0; max-width: 34ch; min-height: 1.4em; font-size: 15px; line-height: 1.45; color: var(--vc-dim); overflow-wrap: anywhere; }
.vc-notice {
  max-width: 420px; margin-top: 4px; padding: 10px 16px; border-radius: 18px; font-size: 13.5px; line-height: 1.45;
  background: var(--vc-glass); border: 1px solid var(--vc-line); color: #d6d6d2; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center;
}
.vc-link { background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--vc-ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--vc-amber); text-underline-offset: 4px; cursor: pointer; }

/* ---- transcript (slides up above the bar) ---- */
.vc-transcript {
  flex: none; max-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
  background: #0e0e0e; border-top: 1px solid var(--vc-line); border-radius: 26px 26px 0 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.3s;
}
.vc-root.tx-open .vc-transcript { max-height: 42dvh; max-height: 42vh; visibility: visible; opacity: 1; transition: max-height 0.3s ease, opacity 0.2s ease; }
.vc-log { max-height: 42vh; max-height: 42dvh; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.vc-msg { display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.5; max-width: 720px; width: 100%; margin: 0 auto; }
.vc-who { font-size: 12px; font-weight: 500; color: var(--vc-dim); }
.vc-msg.user .vc-who { color: var(--vc-ink); }
.vc-txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.vc-msg.error .vc-txt { color: #ff9a9a; }

/* ---- bottom bar: neutral glass circles ---- */
.vc-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px 24px; width: 100%; max-width: 640px; margin: 0 auto; }
.vc-pill, .vc-round { -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.vc-pill { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; height: 52px; border-radius: 26px; background: var(--vc-glass); border: 1px solid var(--vc-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); padding: 0 6px 0 20px; }
.vc-pill:focus-within { border-color: rgba(243, 243, 242, 0.32); }
.vc-root .vc-input { border: 0; box-shadow: none; border-radius: 0; padding: 0; flex: 1; min-width: 0; height: 100%; background: none; outline: none; font-size: 16px; color: var(--vc-ink); }
.vc-input::placeholder { color: var(--vc-dim); }
.vc-send { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: var(--vc-ink); color: #0a0a0a; display: grid; place-items: center; flex: none; }
.vc-round { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--vc-line); background: var(--vc-glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); color: var(--vc-ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color 0.15s; }
.vc-round:hover { background: rgba(255, 255, 255, 0.12); }
.vc-round:disabled { opacity: 0.4; cursor: default; }
.vc-round[aria-pressed="true"] { background: rgba(243, 243, 242, 0.92); border-color: transparent; color: #0a0a0a; }
/* End: calm red-tinted circle with an X */
.vc-end { width: 60px; height: 60px; background: rgba(255, 99, 99, 0.16); border-color: rgba(255, 120, 120, 0.4); color: #ff9a9a; }
.vc-end:hover { background: rgba(255, 99, 99, 0.26); }

/* ---- privacy card ---- */
.vc-privacy { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.78); }
.vc-card { width: min(420px, 100%); background: #181818; border: 1px solid var(--vc-line); border-radius: 26px; padding: 26px; }
.vc-card h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.vc-card p { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: #c9c9c4; }
.vc-card-actions { display: flex; justify-content: flex-end; gap: 10px; }
.vc-btn { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--vc-line); background: var(--vc-glass); font-weight: 500; cursor: pointer; }
.vc-btn-main { background: var(--vc-ink); border-color: var(--vc-ink); color: #0a0a0a; }
.vc-btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 480px) {
  .vc-bar { gap: 10px; padding: 10px 12px 18px; }
  .vc-round { width: 48px; height: 48px; }
  .vc-end { width: 56px; height: 56px; }
  .vc-pill { height: 48px; padding-left: 16px; }
}
@media (max-height: 520px) {
  .vc-orb-btn { --size: min(40vh, 200px); }
  .vc-status { margin-top: 2px; }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .vc-root { --vc-glass: #1c1c1c; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .vc-root { --vc-glass: #1c1c1c; --vc-line: rgba(243, 243, 242, 0.3); }
  .vc-pill, .vc-round, .vc-settings { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Reduced motion: no movement; state shows by brightness only. */
@media (prefers-reduced-motion: reduce) {
  .vc-orb-wrap, .vc-root[data-state] .vc-orb-wrap { animation: none; }
  .vc-orb, .vc-glow, .vc-shine { transform: none !important; transition: none; }
  .vc-swirl, .vc-root[data-state="thinking"] .vc-swirl { animation: none; opacity: 0; }
  .vc-wave i { animation: none; transition: none; }
  .vc-transcript { transition: none; }
  .vc-root[data-state="listening"] .vc-orb { filter: none; }
  .vc-root[data-state="thinking"] .vc-orb { filter: brightness(0.6); }
  .vc-root[data-state="speaking"] .vc-orb { filter: brightness(1.15); }
}
