/* =====================================================
   VOICE ASSISTANT — glass launcher + chat popup
   Design language: deep royal blue #01017D, Cairo,
   glassmorphism, RTL
===================================================== */

/* =====================================================
   LAUNCHER — clean royal glass CTA
===================================================== */

@property --vc-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.vc-launcher {
  position: fixed;
  left: 26px;
  bottom: 28px;
  z-index: 2400;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 198px;
  min-height: 62px;
  padding: 9px 22px 9px 9px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(246, 248, 255, 0.72) 42%, rgba(17, 17, 155, 0.14)),
    radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.96), transparent 30%),
    linear-gradient(145deg, rgba(1, 1, 125, 0.12), rgba(0, 212, 255, 0.1));
  backdrop-filter: blur(26px) saturate(2.15);
  -webkit-backdrop-filter: blur(26px) saturate(2.15);
  color: #18184e;
  cursor: pointer;
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  isolation: isolate;
  box-shadow:
    0 16px 42px rgba(1, 1, 125, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 -1px 0 rgba(255, 255, 255, 0.36) inset,
    0 0 0 1px rgba(0, 212, 255, 0.12),
    0 0 20px 5px rgba(1, 1, 125, 0.12),
    0 0 34px 10px rgba(0, 212, 255, 0.1);
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 220ms ease,
    background 220ms ease;
  animation: vc-launcher-in 0.4s cubic-bezier(0.22, 0.8, 0.25, 1) 0.3s both;
}

@keyframes vc-launcher-in {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.vc-launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 2.5px;
  background: conic-gradient(
    from var(--vc-angle, 0deg),
    rgba(0, 212, 255, 0.14) 0deg,
    rgba(0, 212, 255, 0.68) 90deg,
    #11119b 180deg,
    rgba(1, 1, 125, 0.9) 270deg,
    rgba(255, 255, 255, 0.68) 320deg,
    rgba(0, 212, 255, 0.14) 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.82;
  pointer-events: none;
  animation: vc-angle-spin 4.5s linear infinite;
  transition: opacity 220ms ease;
}

.vc-launcher::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, 0.88) 44%, rgba(255, 255, 255, 0.28) 52%, transparent 70%);
  transform: translateX(130%) skewX(-18deg);
  transition: transform 0.75s cubic-bezier(0.22, 0.8, 0.25, 1);
  pointer-events: none;
}

@keyframes vc-angle-spin {
  to { --vc-angle: 360deg; }
}

.vc-launcher:active {
  transform: translateY(1px) scale(0.97);
}

.vc-launcher:focus-visible {
  outline: none;
  box-shadow:
    0 12px 36px rgba(1, 1, 125, 0.24),
    0 0 0 3px rgba(0, 212, 255, 0.4),
    0 0 26px 8px rgba(1, 1, 125, 0.16);
}

.vc-launcher.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.vc-launcher-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #01017d, #11119b 70%, #00b8d9);
  box-shadow: none;
  z-index: 2;
}

.vc-launcher-glow {
  display: none;
}

@keyframes vc-launcher-orb {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  37% { opacity: 0.9; transform: scale(1.18); }
  73% { opacity: 0.6; transform: scale(1.05); }
}

.vc-launcher .vc-launcher-icon svg {
  stroke: currentColor;
  stroke-width: 2;
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.vc-launcher-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.vc-launcher-label {
  font-family: "Cairo", sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  white-space: nowrap;
  color: #01017d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

/* =====================================================
   POPUP SHELL
===================================================== */

.vc-popup {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 2500;
    width: min(400px, calc(100vw - 48px));
    height: min(620px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(1, 1, 125, 0.14);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    box-shadow: 0 32px 90px rgba(1, 1, 80, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    opacity: 0;
    transform: translateY(26px) scale(0.96);
    transform-origin: bottom left;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 0.8, 0.25, 1);
}

.vc-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* header */

.vc-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(1, 1, 125, 0.08);
}

.vc-popup-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vc-brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #09098F, #3030B7);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 22px rgba(9, 9, 144, 0.32);
    overflow: hidden;
}

.vc-brand-mark--image {
    padding: 0;
    background: #ffffff;
    border: 1px solid rgba(9, 9, 144, 0.1);
    box-shadow: 0 4px 12px rgba(9, 9, 144, 0.16);
}

.vc-brand-mark--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.vc-popup-brand strong {
    display: block;
    font-family: "Cairo", sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #01017D;
    line-height: 1.35;
}

.vc-popup-brand small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Cairo", sans-serif;
    font-size: 11px;
    color: #6e6e8a;
}

.vc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa0b5;
    transition: background 0.2s ease;
}

.vc-status-dot.vc-status-live {
    background: #22a663;
    box-shadow: 0 0 0 4px rgba(34, 166, 99, 0.16);
    animation: vc-dot-pulse 1.4s ease infinite;
}

@keyframes vc-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 166, 99, 0.14); }
    50% { box-shadow: 0 0 0 7px rgba(34, 166, 99, 0.05); }
}

.vc-popup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vc-clear-btn,
.vc-close-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(1, 1, 125, 0.12);
    background: rgba(255, 255, 255, 0.7);
    color: #01017D;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.vc-clear-btn:hover,
.vc-close-btn:hover {
    background: rgba(9, 9, 144, 0.08);
    transform: translateY(-1px);
}

/* messages */

.vc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(1, 1, 125, 0.25) transparent;
}

.vc-messages::-webkit-scrollbar {
    width: 5px;
}

.vc-messages::-webkit-scrollbar-thumb {
    background: rgba(1, 1, 125, 0.22);
    border-radius: 9px;
}

.vc-welcome {
    margin: auto;
    max-width: 290px;
    text-align: center;
    padding: 26px 18px;
}

.vc-welcome.hidden {
    display: none;
}

.vc-welcome-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 14px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(9, 9, 144, 0.09), rgba(48, 48, 183, 0.16));
    border: 1px solid rgba(1, 1, 125, 0.12);
    color: #01017D;
}

.vc-welcome h3 {
    font-family: "Cairo", sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #01017D;
    margin-bottom: 8px;
}

.vc-welcome p {
    font-family: "Cairo", sans-serif;
    font-size: 12px;
    line-height: 1.9;
    color: #6e6e8a;
}

/* message bubbles */

.vc-msg {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: min(92%, 390px);
    min-width: 0;
}

.vc-msg-user {
    align-self: flex-start;
    align-items: flex-start;
}

.vc-msg-assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.vc-msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    padding: 0 6px;
}

.vc-msg-role {
    font-family: "Cairo", sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #8a8aa3;
}

.vc-msg-body {
    min-width: 0;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 18px;
}

.vc-msg-user .vc-msg-body {
    background: linear-gradient(135deg, #09098F, #2424B2);
    border-bottom-right-radius: 6px;
    box-shadow: 0 10px 26px rgba(9, 9, 144, 0.24);
}

.vc-msg-assistant .vc-msg-body {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(1, 1, 125, 0.1);
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 22px rgba(10, 10, 80, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.vc-msg-audio {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 24px;
}

.vc-play-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.18s ease;
}

.vc-play-btn:hover {
    transform: scale(1.1);
}

.vc-msg-user .vc-play-btn {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.vc-msg-assistant .vc-play-btn {
    background: #01017D;
    color: #ffffff;
}

/* animated bars */

.vc-bars {
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 22px;
    flex: 1;
}

.vc-bars i {
    width: 3px;
    height: 5px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.85;
    transform-origin: center;
    transition: transform 0.15s ease;
}

.vc-msg-audio.playing .vc-bars i {
    animation: vc-bar-wave 1.1s ease-in-out infinite;
}

.vc-msg-audio.playing .vc-bars i:nth-child(odd) {
    animation-delay: -0.55s;
}

.vc-msg-audio.playing .vc-bars i:nth-child(3n) {
    animation-delay: -0.25s;
}

@keyframes vc-bar-wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(3.6); }
}

.vc-msg-user .vc-bars { color: #ffffff; }
.vc-msg-assistant .vc-bars { color: #01017D; }

.vc-duration {
    font-family: "Cairo", sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    direction: ltr;
    opacity: 0.85;
    flex-shrink: 0;
}

.vc-msg-assistant .vc-duration {
    font-weight: 700;
    color: #01017D;
    opacity: 1;
}

.vc-msg-audio {
    display: none;
}

.vc-msg-text {
    display: block;
    margin: 0;
    font-family: "Cairo", sans-serif;
    font-size: 12.5px;
    line-height: 1.8;
    color: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
}

.vc-msg-user .vc-msg-text { color: rgba(255, 255, 255, 0.95); }
.vc-msg-assistant .vc-msg-text { color: #33335a; }

.vc-msg-text.visible {
    display: block;
}

/* =====================================================
   RECORDER — Apple style
===================================================== */

.vc-recorder {
    padding: 12px 18px 18px;
    border-top: 1px solid rgba(1, 1, 125, 0.08);
    background: rgba(255, 255, 255, 0.42);
}

.vc-wave {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#vcWaveCanvas {
    width: 100%;
    max-width: 280px;
    height: 46px;
}

.vc-recorder-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.vc-timer {
    font-family: "Cairo", sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 700;
    color: #01017D;
    direction: ltr;
    min-width: 44px;
    text-align: center;
}

.vc-thinking {
    min-width: 64px;
    text-align: center;
    font-family: "Cairo", sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: #8a8aa3;
    transition: opacity 0.2s ease;
    opacity: 0.55;
}

.vc-thinking-active {
    opacity: 1;
    color: #01017D;
}

/* the big mic button */

.vc-mic-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #09098F, #3030B7);
    box-shadow: 0 14px 34px rgba(9, 9, 144, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.vc-mic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(9, 9, 144, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.vc-mic-btn:active {
    transform: scale(0.95);
}

.vc-mic-btn:focus-visible {
    outline: 2px solid #01017D;
    outline-offset: 4px;
}

.vc-mic-icon,
.vc-stop-icon {
    display: grid;
    place-items: center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.vc-stop-icon {
    position: absolute;
    opacity: 0;
    transform: scale(0.5);
}

.vc-mic-btn.recording .vc-mic-icon {
    opacity: 0;
    transform: scale(0.5);
}

.vc-mic-btn.recording .vc-stop-icon {
    opacity: 1;
    transform: scale(1);
}

.vc-mic-btn.recording {
    background: linear-gradient(135deg, #e02828, #f1603d);
    box-shadow: 0 14px 40px rgba(224, 40, 40, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* pulse ring while recording */

.vc-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(224, 40, 40, 0.5);
    opacity: 0;
    pointer-events: none;
}

.vc-mic-btn.recording .vc-pulse {
    animation: vc-pulse-ring 1.6s ease-out infinite;
}

@keyframes vc-pulse-ring {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* =====================================================
   LIVE CALL EXPERIENCE — mirrors chatbot-voice-ai layout
===================================================== */

.vc-popup {
    width: min(760px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 48px));
    max-height: 760px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 255, 0.88)),
        radial-gradient(circle at 18% 10%, rgba(68, 87, 255, 0.13), transparent 36%);
}

.vc-live-shell {
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(250px, 0.9fr) minmax(320px, 1.1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    overflow: hidden;
}

.vc-call-console {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    gap: 12px;
    overflow: hidden;
    text-align: center;
}

.vc-voice-heading {
    position: relative;
    z-index: 5;
    width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.18)),
        radial-gradient(circle at 50% 0%, rgba(68, 87, 255, 0.12), transparent 56%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.vc-voice-heading h2 {
    max-width: none;
    margin: 0 auto;
    color: #01017d;
    font-family: "Cairo", sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.vc-voice-heading p {
    margin: 4px 0 0;
    color: #303577;
    font-family: "Cairo", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.55;
}

.vc-signal-dial {
    position: relative;
    z-index: 4;
    width: clamp(148px, 18vw, 190px);
    height: clamp(148px, 18vw, 190px);
    display: grid;
    place-items: center;
    margin-top: 2px;
}

.vc-ambient-wave {
    position: absolute;
    left: 50%;
    top: 48%;
    width: min(420px, 150%);
    height: 64px;
    border-top: 2px solid rgba(68, 87, 255, 0.17);
    border-radius: 50%;
    pointer-events: none;
}

.vc-wave-a { transform: translateX(-50%) rotate(-3deg) scaleY(0.65); }
.vc-wave-b { opacity: 0.65; transform: translateX(-50%) translateY(20px) rotate(2deg) scaleY(0.42); }
.vc-wave-c { opacity: 0.4; transform: translateX(-50%) translateY(-17px) rotate(4deg) scaleY(0.32); }

.vc-dial-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 600ms ease, border-color 220ms ease;
}

.vc-ring-a {
    width: 98%;
    height: 98%;
    border: 1px solid rgba(1, 1, 125, 0.08);
}

.vc-ring-b {
    width: 76%;
    height: 76%;
    border: 1px solid rgba(68, 87, 255, 0.15);
}

.vc-ring-c {
    width: 60%;
    height: 60%;
    border: 1px solid rgba(68, 87, 255, 0.19);
    background: rgba(225, 230, 255, 0.28);
}

.vc-dial-core,
.vc-mic-btn.vc-dial-core {
    position: relative;
    z-index: 2;
    width: 62%;
    height: 62%;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #2525d5, #09099c 42%, #01017d 100%);
    color: #ffffff;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.86),
        0 0 0 9px rgba(76, 92, 255, 0.15),
        0 14px 34px rgba(1, 1, 125, 0.22),
        0 0 42px rgba(66, 88, 255, 0.26);
    transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 400ms ease, opacity 200ms ease;
    -webkit-tap-highlight-color: transparent;
}

.vc-mic-btn.vc-dial-core:hover {
    transform: scale(1.055);
    box-shadow:
        0 0 0 8px #ffffff,
        0 0 0 12px rgba(76, 92, 255, 0.18),
        0 22px 55px rgba(1, 1, 125, 0.3),
        0 0 80px rgba(66, 88, 255, 0.4);
}

.vc-orb-action-icon {
    grid-area: 1 / 1;
    width: 42%;
    height: 42%;
    display: grid;
    place-items: center;
}

.vc-orb-action-icon svg {
    width: 100%;
    height: 100%;
}

.vc-voice-bars {
    grid-area: 1 / 1;
    width: 58%;
    max-width: 74px;
    height: 42%;
    max-height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, 0.45vw, 5px);
    overflow: hidden;
}

.vc-voice-bars i,
.vc-assistant-mini-orb span {
    display: block;
    border-radius: 999px;
}

.vc-voice-bars i {
    width: clamp(2px, 0.35vw, 4px);
    height: 10px;
    background: currentColor;
    transform-origin: center;
}

.vc-voice-bars i:nth-child(2),
.vc-voice-bars i:nth-child(8) { height: 16px; }
.vc-voice-bars i:nth-child(3),
.vc-voice-bars i:nth-child(7) { height: 22px; }
.vc-voice-bars i:nth-child(4),
.vc-voice-bars i:nth-child(6) { height: 28px; }
.vc-voice-bars i:nth-child(5) { height: 34px; }

.vc-popup[data-call-state="listening"] .vc-orb-action-icon,
.vc-popup[data-call-state="speaking"] .vc-orb-action-icon,
.vc-popup[data-call-state="thinking"] .vc-orb-action-icon {
    display: none;
}

.vc-popup[data-call-state="listening"] .vc-voice-bars,
.vc-popup[data-call-state="speaking"] .vc-voice-bars,
.vc-popup[data-call-state="thinking"] .vc-voice-bars {
    display: flex;
}

.vc-popup[data-call-state="listening"] .vc-voice-bars i,
.vc-popup[data-call-state="speaking"] .vc-voice-bars i,
.vc-popup[data-call-state="thinking"] .vc-voice-bars i {
    animation: vc-live-voice-wave 760ms ease-in-out infinite alternate;
}

.vc-voice-bars i:nth-child(2) { animation-delay: 80ms; }
.vc-voice-bars i:nth-child(3) { animation-delay: 160ms; }
.vc-voice-bars i:nth-child(4) { animation-delay: 240ms; }
.vc-voice-bars i:nth-child(5) { animation-delay: 320ms; }
.vc-voice-bars i:nth-child(6) { animation-delay: 400ms; }
.vc-voice-bars i:nth-child(7) { animation-delay: 480ms; }

.vc-popup[data-call-state="connecting"] .vc-dial-core,
.vc-popup[data-call-state="listening"] .vc-dial-core,
.vc-popup[data-call-state="speaking"] .vc-dial-core,
.vc-popup[data-call-state="thinking"] .vc-dial-core {
    transform: scale(1.03);
    box-shadow:
        0 0 0 6px #ffffff,
        0 0 0 11px rgba(76, 92, 255, 0.15),
        0 16px 44px rgba(1, 1, 125, 0.28),
        0 0 72px rgba(68, 87, 255, 0.42);
}

.vc-popup[data-call-state="listening"] .vc-ring-c,
.vc-popup[data-call-state="speaking"] .vc-ring-c,
.vc-popup[data-call-state="thinking"] .vc-ring-c,
.vc-popup[data-call-state="connecting"] .vc-ring-c {
    animation: vc-live-pulse-ring 1.7s ease-out infinite;
}

.vc-popup[data-call-state="listening"] .vc-ring-b,
.vc-popup[data-call-state="speaking"] .vc-ring-b,
.vc-popup[data-call-state="thinking"] .vc-ring-b,
.vc-popup[data-call-state="connecting"] .vc-ring-b {
    animation: vc-live-pulse-ring 1.7s 250ms ease-out infinite;
}

.vc-popup[data-call-state="listening"] .vc-ring-a,
.vc-popup[data-call-state="speaking"] .vc-ring-a,
.vc-popup[data-call-state="thinking"] .vc-ring-a,
.vc-popup[data-call-state="connecting"] .vc-ring-a {
    animation: vc-live-pulse-ring 1.7s 500ms ease-out infinite;
}

.vc-voice-status {
    position: relative;
    z-index: 5;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(235, 239, 255, 0.74);
    color: #303577;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.55;
    text-wrap: pretty;
    backdrop-filter: blur(12px);
}

.vc-voice-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #4457ff;
}

.vc-voice-status-dot.vc-status-live,
.vc-popup[data-call-state="listening"] .vc-voice-status-dot,
.vc-popup[data-call-state="speaking"] .vc-voice-status-dot,
.vc-popup[data-call-state="thinking"] .vc-voice-status-dot,
.vc-popup[data-call-state="connecting"] .vc-voice-status-dot {
    animation: vc-live-status-blink 0.8s ease-in-out infinite alternate;
}

.vc-campaign-line {
    display: none;
}

.vc-campaign-line span {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(1, 1, 125, 0.25));
}

.vc-campaign-line span:last-child {
    background: linear-gradient(-90deg, transparent, rgba(1, 1, 125, 0.25));
}

.vc-campaign-line strong {
    white-space: nowrap;
}

.vc-wave-canvas {
    position: relative;
    z-index: 5;
    width: min(220px, 70%);
    height: 22px;
    opacity: 0.55;
}

.vc-call-console > .vc-timer {
    position: relative;
    z-index: 5;
    min-width: 72px;
    padding: 5px 11px;
    border: 1px solid rgba(1, 1, 125, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
}

.vc-audio-panel {
    min-width: 0;
    height: 100%;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(22px);
    box-shadow: 0 8px 8px rgba(1, 1, 125, 0.05);
}

.vc-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #01017d;
}

.vc-panel-title h2 {
    flex: 1;
    margin: 0;
    font-family: "Cairo", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.vc-assistant-mini-orb {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 50%;
    background: #edf0ff;
}

.vc-assistant-mini-orb span {
    width: 3px;
    background: #01017d;
}

.vc-assistant-mini-orb span:nth-child(1) { height: 10px; }
.vc-assistant-mini-orb span:nth-child(2) { height: 19px; }
.vc-assistant-mini-orb span:nth-child(3) { height: 28px; }
.vc-assistant-mini-orb span:nth-child(4) { height: 18px; }
.vc-assistant-mini-orb span:nth-child(5) { height: 9px; }

.vc-audio-panel .vc-messages {
    min-width: 0;
    min-height: 0;
    padding: 0;
    flex: 1;
    gap: 12px;
    scrollbar-width: none;
}

.vc-audio-panel .vc-messages::-webkit-scrollbar {
    display: none;
}

.vc-audio-panel .vc-msg {
    width: auto;
    max-width: 94%;
    animation: vc-live-message-in 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vc-audio-panel .vc-msg-body {
    width: auto;
    max-width: 100%;
    padding: 12px 14px;
}

.vc-audio-panel .vc-msg-user .vc-msg-body {
    border-bottom-left-radius: 5px;
}

.vc-audio-panel .vc-msg-assistant .vc-msg-body {
    border-bottom-right-radius: 5px;
}

.vc-msg-pending .vc-msg-body p::after {
    content: "";
    display: inline-block;
    width: 0.35em;
    height: 0.35em;
    margin-inline-start: 0.35em;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
    animation: vc-live-status-blink 0.8s ease-in-out infinite alternate;
}

.vc-popup[data-call-state="listening"] .vc-assistant-mini-orb span,
.vc-popup[data-call-state="speaking"] .vc-assistant-mini-orb span {
    animation: vc-mini-wave 820ms ease-in-out infinite alternate;
}

.vc-popup[data-call-state="listening"] .vc-assistant-mini-orb span:nth-child(2),
.vc-popup[data-call-state="speaking"] .vc-assistant-mini-orb span:nth-child(2) {
    animation-delay: 100ms;
}

.vc-popup[data-call-state="listening"] .vc-assistant-mini-orb span:nth-child(3),
.vc-popup[data-call-state="speaking"] .vc-assistant-mini-orb span:nth-child(3) {
    animation-delay: 200ms;
}

@keyframes vc-live-status-blink {
    to { opacity: 0.25; transform: scale(0.65); }
}

@keyframes vc-live-voice-wave {
    from { height: 22%; }
    to { height: 88%; }
}

@keyframes vc-live-pulse-ring {
    0% { opacity: 0.75; transform: scale(0.88); }
    100% { opacity: 0; transform: scale(1.18); }
}

@keyframes vc-live-message-in {
    from { opacity: 0; transform: translateY(12px); }
}

@keyframes vc-mini-wave {
    to { transform: scaleY(0.55); opacity: 0.6; }
}

/* =====================================================
   MOBILE ADAPTATION
===================================================== */

@media (max-width: 1200px) {
    .vc-launcher {
        left: 18px;
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
        min-height: 48px;
        min-width: 176px;
        padding: 6px 15px 6px 6px;
        gap: 8px;
    }

    .vc-launcher-icon {
        width: 34px;
        height: 34px;
    }

    .vc-launcher-label {
        font-size: 13.5px;
    }

    .vc-popup {
        left: 16px;
        right: auto;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: min(430px, calc(100vw - 32px));
        height: min(720px, calc(100dvh - 32px));
        max-height: calc(100dvh - 32px);
        border-radius: 24px;
        transform-origin: bottom left;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 255, 0.88)),
            radial-gradient(circle at 18% 10%, rgba(68, 87, 255, 0.13), transparent 36%);
    }

    .vc-popup.open {
        border-radius: 24px;
    }

    .vc-live-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
        overflow: hidden;
    }

    .vc-call-console {
        min-height: 0;
        gap: 8px;
    }

    .vc-voice-heading {
        width: 100%;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .vc-voice-heading h2 {
        max-width: none;
        font-size: 1.25rem;
        line-height: 1.12;
    }

    .vc-voice-heading p {
        margin-top: 4px;
        font-size: 0.78rem;
    }

    .vc-signal-dial {
        width: 118px;
        height: 118px;
    }

    .vc-voice-status {
        max-width: 100%;
        border-radius: 18px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .vc-campaign-line {
        width: min(100%, 420px);
        gap: 12px;
        font-size: 0.86rem;
    }

    .vc-audio-panel {
        min-height: 0;
        height: 100%;
        padding: 14px;
        border-radius: 18px;
    }

    .vc-msg {
        max-width: 92%;
    }
}

@media (max-width: 900px) {
    /* On mobile the floating launcher is redundant — the bottom tab bar
       center button (#mVoiceChatBtn) is the entry point. Hide the floater
       to avoid duplicate icons and overlapping the tab bar. */
    .vc-launcher {
        display: none !important;
    }
    .vc-popup {
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 96px);
    }
}

/* Mirror the floating assistant entry point in Latin-language layouts. */
[dir="ltr"] .vc-launcher {
    left: auto;
    right: 26px;
    direction: ltr;
}

@media (max-width: 1200px) {
    [dir="ltr"] .vc-launcher {
        left: auto;
        right: 18px;
    }
}
