/* Call screen for automation 05 (AEX.VoiceCall). The root .vr-cs is the phone (phone.css) and
   carries the Tallow Creek palette. Every rule sits under .vr-cs; sizes are in em of the phone,
   so --phone-fs scales the whole screen. Static (.is-static) and reduced motion: no animation. */

.vr-cs {
  --tc-text: #eef3f1;
  --tc-muted: #8fa19d;
  --tc-line: rgba(255, 255, 255, 0.09);
  --tc-glass: rgba(255, 255, 255, 0.07);
  --tc-glass-2: rgba(255, 255, 255, 0.12);
  --tc-brand: #2f9e8f;
  --tc-brand-2: #1c6b61;
  --tc-glow: #134a44;
  --tc-glow-urgent: #561616;
  --tc-ai: #ffffff;
  --tc-caller: #b5d2ff;
  --tc-red: #ff453a;
  --tc-green: #30d158;
}

.vr-cs [hidden] {
  display: none !important;
}

.vr-cs .vr-cs-screen {
  background: linear-gradient(180deg, #0b1312, #070a0a);
  color: var(--tc-text);
}

/* Background: the teal glow, cross-faded to the red glow in emergency mode (.8s) */
.vr-cs .vr-cs-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(130% 55% at 50% 0%, var(--tc-glow) 0%, transparent 70%);
}

.vr-cs .vr-cs-glow--u {
  background: radial-gradient(130% 55% at 50% 0%, var(--tc-glow-urgent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.8s var(--ease-std);
}

.vr-cs.is-urgent .vr-cs-glow--u {
  opacity: 1;
}

.vr-cs .vr-cs-screen > :not(.vr-cs-glow) {
  position: relative;
  z-index: 1;
}

/* Status bar (copy of the WhatsApp phone's bar, transparent) */
.vr-cs .vr-cs-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.3em;
  padding: 0.9em 1.9em 0;
  font-size: 1em;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tc-text);
}

.vr-cs .vr-cs-time {
  min-width: 3.2em;
  font-size: 0.95em;
  font-variant-numeric: tabular-nums;
}

.vr-cs .vr-cs-island {
  position: absolute;
  left: 50%;
  top: 0.68em;
  width: 6.2em;
  height: 2.1em;
  border-radius: 1.2em;
  background: #000;
  transform: translateX(-50%);
}

.vr-cs .vr-cs-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.vr-cs .vr-cs-icons svg {
  height: 0.75em;
  width: auto;
}

/* App row: the TC mark and the business name with its product line */
.vr-cs .vr-cs-app {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.2em 1.3em 0.6em;
  border-bottom: 1px solid var(--tc-line);
}

.vr-cs .vr-cs-mark {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 28%;
  background: linear-gradient(145deg, #36b3a2, var(--tc-brand-2));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.vr-cs.is-ringing .vr-cs-mark::after {
  content: "";
  position: absolute;
  inset: -0.3em;
  border-radius: 32%;
  border: 1px solid hsl(171 45% 45% / 0.7);
  animation: vr-cs-soft 1.6s ease-out infinite;
}

.vr-cs .vr-cs-appwho {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.vr-cs .vr-cs-appname {
  overflow: hidden;
  font-size: 0.76em;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.vr-cs .vr-cs-appsub {
  font-size: 0.66em;
  color: var(--tc-muted);
}

/* Caller block: status pill, number, caller line, call timer */
.vr-cs .vr-cs-caller {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9em 1em 0.6em;
  text-align: center;
}

.vr-cs .vr-cs-pillrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
}

.vr-cs .vr-cs-tag {
  padding: 0.42em 0.75em;
  border: 1px solid hsl(4 100% 62% / 0.5);
  border-radius: 999px;
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tc-red);
}

.vr-cs .vr-cs-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.32em 0.75em;
  border-radius: 999px;
  background: var(--tc-glass);
  font-size: 0.66em;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--tc-text);
}

.vr-cs .vr-cs-dot {
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--tc-muted);
}

.vr-cs .vr-cs-pill[data-tone="gold"] .vr-cs-dot {
  background: var(--tc-ai);
}

.vr-cs .vr-cs-pill[data-tone="blue"] .vr-cs-dot {
  background: var(--tc-caller);
}

.vr-cs .vr-cs-pill[data-tone="red"] .vr-cs-dot {
  background: var(--tc-red);
}

.vr-cs .vr-cs-pill[data-tone="green"] .vr-cs-dot {
  background: var(--tc-green);
}

.vr-cs .vr-cs-pill[data-pulse] .vr-cs-dot {
  animation: vr-cs-blink 1.2s ease-in-out infinite;
}

.vr-cs .vr-cs-num {
  margin: 0.55em 0 0;
  font-size: 1.55em;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vr-cs .vr-cs-who {
  margin: 0.3em 0 0;
  font-size: 0.78em;
  color: var(--tc-muted);
}

.vr-cs .vr-cs-timer {
  margin: 0.4em 0 0;
  font-size: 1.05em;
  font-variant-numeric: tabular-nums;
  color: var(--tc-text);
  opacity: 0.85;
}

/* Waveform: 40 bars. Idle is a flat line; speaking uses the speaker's colour */
.vr-cs .vr-cs-wave {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.2em;
  margin-top: 0.2em;
  padding: 0 1.6em;
}

.vr-cs .vr-cs-bar {
  display: block;
  flex: none;
  width: 0.2em;
  height: 100%;
  border-radius: 1em;
  background: var(--tc-muted);
  opacity: 0.5;
  transform: scaleY(0.1);
  transform-origin: 50% 50%;
  transition: transform 0.35s var(--ease-out), background-color 0.3s, opacity 0.3s;
}

.vr-cs .vr-cs-wave.is-ai .vr-cs-bar {
  background: var(--tc-ai);
  opacity: 1;
  transform: scaleY(var(--h));
}

.vr-cs .vr-cs-wave.is-caller .vr-cs-bar {
  background: var(--tc-caller);
  opacity: 1;
  transform: scaleY(var(--h));
}

.vr-cs .vr-cs-wave.is-live .vr-cs-bar {
  animation: vr-cs-wave var(--d) ease-in-out infinite;
  animation-delay: var(--dl);
}

.vr-cs .vr-cs-legend {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4em;
  margin-top: 0.5em;
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tc-muted);
}

.vr-cs .vr-cs-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.vr-cs .vr-cs-lg i {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
}

.vr-cs .vr-cs-lg--ai i {
  background: var(--tc-ai);
}

.vr-cs .vr-cs-lg--caller i {
  background: var(--tc-caller);
}

/* Transcript: bottom-anchored lines, masked at the top, slides up as lines are added */
.vr-cs .vr-cs-tx {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  margin-top: 0.5em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.4em);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.4em);
}

.vr-cs .vr-cs-txin {
  position: absolute;
  left: 1.1em;
  right: 1.1em;
  bottom: 0.7em;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  transition: transform 0.55s var(--ease-out);
}

.vr-cs .vr-cs-chip {
  align-self: center;
  padding: 0.35em 0.9em;
  border-radius: 999px;
  background: var(--tc-glass);
  font-size: 0.66em;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--tc-muted);
}

.vr-cs .vr-cs-line {
  transition: opacity 0.4s var(--ease-std);
}

.vr-cs .vr-cs-line.is-old {
  opacity: 0.62;
}

.vr-cs .vr-cs-lw {
  margin: 0 0 0.3em;
  font-size: 0.7em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tc-muted);
}

.vr-cs .vr-cs-line.is-ai .vr-cs-lw {
  color: var(--tc-ai);
}

.vr-cs .vr-cs-line.is-caller .vr-cs-lw {
  color: var(--tc-caller);
}

.vr-cs .vr-cs-text {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.42;
  color: var(--tc-text);
  overflow-wrap: anywhere;
}

.vr-cs .vr-cs-w {
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.vr-cs .vr-cs-w.is-on {
  opacity: 1;
}

/* Transfer band: shown only while a transfer runs */
.vr-cs .vr-cs-band {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin: 0.4em 1em 0.6em;
  padding: 0.7em 0.9em;
  border: 1px solid var(--tc-line);
  border-radius: 1em;
  background: var(--tc-glass);
}

.vr-cs .vr-cs-av {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--tc-glass-2);
  font-size: 0.9em;
  font-weight: 600;
  color: var(--tc-text);
  transition: border-color 0.4s;
}

.vr-cs .vr-cs-ring {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--tc-red);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.vr-cs .vr-cs-band.is-ringing .vr-cs-ring {
  animation: vr-cs-ring 1.4s ease-out infinite;
}

.vr-cs .vr-cs-band.is-ringing .vr-cs-ring--2 {
  animation-delay: 0.7s;
}

.vr-cs .vr-cs-avck {
  display: none;
  width: 1.1em;
  height: 1.1em;
  color: var(--tc-green);
}

.vr-cs .vr-cs-avck svg {
  display: block;
  width: 100%;
  height: 100%;
}

.vr-cs .vr-cs-band.is-connected .vr-cs-av {
  border-color: var(--tc-green);
}

.vr-cs .vr-cs-band.is-connected .vr-cs-avl {
  display: none;
}

.vr-cs .vr-cs-band.is-connected .vr-cs-avck {
  display: block;
}

.vr-cs .vr-cs-bt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.vr-cs .vr-cs-bt-t {
  font-size: 0.82em;
  font-weight: 600;
  color: var(--tc-text);
}

.vr-cs .vr-cs-bt-s {
  font-size: 0.68em;
  color: var(--tc-muted);
}

/* Controls: four round glass buttons; the end button is red with the handset turned */
.vr-cs .vr-cs-ctrls {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0.3em 1.6em 0.9em;
}

.vr-cs .vr-cs-btn {
  display: grid;
  place-items: center;
  width: 2.7em;
  height: 2.7em;
  border-radius: 50%;
  background: var(--tc-glass);
  color: var(--tc-text);
}

.vr-cs .vr-cs-btn svg {
  width: 1.2em;
  height: 1.2em;
}

.vr-cs .vr-cs-btn--end {
  background: var(--tc-red);
  color: #fff;
}

.vr-cs .vr-cs-btn--end svg {
  transform: rotate(135deg);
}

.vr-cs .vr-cs-home {
  position: relative;
  flex: none;
  height: 1.5em;
}

.vr-cs .vr-cs-home::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.5em;
  width: 7.6em;
  height: 0.3em;
  border-radius: 0.3em;
  background: rgba(255, 255, 255, 0.38);
  transform: translateX(-50%);
}

/* Paused demo: the waveform freezes where it is, like the transcript and the timer */
.vr-cs.is-paused .vr-cs-wave.is-live .vr-cs-bar {
  animation-play-state: paused;
}

/* Static and reduced motion: nothing moves, the finished state is shown at once */
.vr-cs.is-static,
.vr-cs.is-static *,
.vr-cs.is-static *::before,
.vr-cs.is-static *::after {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .vr-cs,
  .vr-cs *,
  .vr-cs *::before,
  .vr-cs *::after {
    transition: none !important;
    animation: none !important;
  }
}

@keyframes vr-cs-wave {
  0% {
    transform: scaleY(0.18);
  }
  50% {
    transform: scaleY(var(--h));
  }
  100% {
    transform: scaleY(0.3);
  }
}

@keyframes vr-cs-ring {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes vr-cs-soft {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes vr-cs-blink {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}
