/* Automation 05 live demo: the call (AEX.VoiceCall, see vr-call.css), "Behind the scenes" and
   "Call summary". Stage chrome, controls and the phone frame come from demo.css and phone.css.
   Every rule is scoped under #demo; every class invented here starts with vr-.
   Layout: call | log + summary at 1280px and up; call | carousel (log / summary) with the nav
   from 901 to 1279px; one column with the carousel under the call at 900px and below. */

#demo [hidden] {
  display: none !important;
}

#demo-stage {
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}

/* ---------- Tabs: four equal pills in one row; number, label and meta in each ---------- */

#demo .vr-demo-bar {
  align-items: flex-start;
}

#demo .vr-demo-bar .tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

#demo .vr-demo-bar .tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  padding: 12px 20px;
  text-align: left;
}

#demo .vr-demo-bar .tab-n {
  grid-row: 1 / span 2;
}

#demo .vr-demo-bar .tab-l,
#demo .vr-demo-bar .tab-m {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#demo .vr-demo-bar .tab-l {
  grid-column: 2;
  grid-row: 1;
}

#demo .vr-demo-bar .tab-m {
  grid-column: 2;
  grid-row: 2;
}

#demo .vr-demo-bar .demo-note {
  margin-left: auto;
}

@media (max-width: 1099px) {
  #demo .vr-demo-bar .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #demo .vr-demo-bar .demo-note {
    margin-left: 0;
  }
}

@media (max-width: 639px) {
  #demo .vr-demo-bar .tab {
    grid-template-rows: auto;
    row-gap: 0;
  }

  #demo .vr-demo-bar .tab-n,
  #demo .vr-demo-bar .tab-l {
    grid-row: auto;
  }

  #demo .vr-demo-bar .tab-m {
    display: none;
  }

  #demo .vr-demo-bar .tab-l {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }
}

/* ---------- Grid: the call column, then the side area (log and summary) ---------- */

#demo .vr-grid {
  --vr-fs: 13.5px;
  grid-template-columns: 340px minmax(0, 1fr);
  column-gap: 28px;
  row-gap: 16px;
  align-items: start;
}

#demo .vr-stack {
  display: contents;
  min-width: 0;
}

#demo .vr-col-call {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

#demo .vr-side {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  column-gap: 28px;
  row-gap: 0;
  height: calc(44.4 * var(--vr-fs) + 52px);
  min-width: 0;
  overflow: visible;
}

#demo .vr-side > .demo-col {
  min-height: 0;
  min-width: 0;
}

#demo .vr-label {
  min-height: 40px;
}

#demo .vr-call-wrap {
  display: flex;
  justify-content: center;
}

#demo .vr-call {
  --phone-fs: var(--vr-fs);
  flex: none;
}

#demo .vr-audio-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: none;
  visibility: hidden;
}

#demo .vr-audio-note.is-on {
  visibility: visible;
}

#demo .vr-col-call .demo-controls {
  margin-top: 4px;
}

#demo .vr-nav {
  display: none;
}

#demo .vr-mini {
  display: none;
}

/* Mute switch: checked = muted (transcript only). Checked is the on state: gold track, knob right. */
#demo .vr-mute {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ash);
  cursor: pointer;
}

#demo .vr-mute:disabled {
  opacity: 0.45;
  cursor: default;
}

#demo .vr-mute:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 999px;
}

#demo .vr-mute-tx {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

#demo .vr-mute:hover .vr-mute-tx {
  color: var(--bone);
}

#demo .vr-switch {
  position: relative;
  flex: none;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--line);
}

#demo .vr-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bone);
  transition: transform 0.25s var(--ease-out);
}

#demo .vr-mute[aria-checked="true"] .vr-switch {
  background: var(--accent);
}

#demo .vr-mute[aria-checked="true"] .vr-switch::after {
  transform: translateX(12px);
  background: var(--ink);
}

/* ---------- Panels: the log and the summary share one look ---------- */

#demo .vr-log {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 10px 16px 12px;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

#demo .vr-sum {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

#demo .vr-col-log,
#demo .vr-col-sum {
  display: flex;
  flex-direction: column;
}

#demo .vr-log.is-overflow,
#demo .vr-sum.is-overflow {
  overscroll-behavior: contain;
}

#demo .vr-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
}

#demo .vr-chip--gold {
  border-color: var(--accent-40);
  color: var(--accent);
}

#demo .vr-chip--new {
  height: 16px;
  padding: 0 5px;
  border-color: var(--accent-40);
  color: var(--accent);
  font-size: 10.5px;
}

/* ---------- Behind the scenes: one entry per line of the agent ---------- */

#demo .vr-log-e {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  animation: vr-log-in 0.35s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 120ms);
}

#demo .vr-log-e:first-child {
  border-top: 0;
}

#demo .vr-log-e.is-new::before {
  content: "";
  position: absolute;
  inset: 4px -10px;
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: var(--r-lg);
  pointer-events: none;
  animation: vr-log-new 1.2s var(--ease-std) forwards;
}

#demo .vr-log-e--emergency {
  margin: 0 -8px;
  padding: 12px 8px;
  border: 1px solid hsl(0 70% 56% / 0.4);
  border-radius: var(--r-lg);
  background: hsl(0 70% 56% / 0.06);
}

#demo .vr-log-e--idle {
  padding-top: 0;
}

#demo .vr-log-e--idle .vr-log-ic {
  border-color: transparent;
  background: transparent;
}

#demo .vr-log-e--idle .vr-log-t {
  color: var(--ash);
}

#demo .vr-log-ic {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--elev);
  color: var(--ash);
}

#demo .vr-log-ic svg {
  width: 14px;
  height: 14px;
}

#demo .vr-log-b {
  min-width: 0;
}

#demo .vr-log-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#demo .vr-log-t {
  min-width: 0;
  margin: 0;
  padding-top: 1px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--bone);
  overflow-wrap: anywhere;
}

#demo .vr-log-tm {
  flex: none;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--ash);
  white-space: nowrap;
}

/* Icon colours by kind: gold while pending or for leads, green when done, red for emergencies */
#demo .vr-log-e--area .vr-log-ic,
#demo .vr-log-e--booked .vr-log-ic,
#demo .vr-log-e--sms .vr-log-ic,
#demo .vr-log-e--answer .vr-log-ic,
#demo .vr-log-e--transfer .vr-log-ic,
#demo .vr-log-e--summary .vr-log-ic {
  color: var(--ok);
}

#demo .vr-log-e--calendar .vr-log-ic,
#demo .vr-log-e--lead .vr-log-ic {
  color: var(--accent);
}

#demo .vr-log-e--calendar.is-done .vr-log-ic {
  color: var(--ok);
}

#demo .vr-log-e--message .vr-log-ic {
  color: var(--info);
}

#demo .vr-log-e--emergency .vr-log-ic,
#demo .vr-log-e--ring .vr-log-ic {
  color: var(--danger);
}

#demo .vr-log-e.is-tone-danger .vr-log-ic {
  color: var(--danger);
}

#demo .vr-log-e.is-tone-ok .vr-log-ic {
  color: var(--ok);
}

/* Pending: three dots after the text and a 2px gold shimmer under it */
#demo .vr-log-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  vertical-align: middle;
}

#demo .vr-log-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  animation: vr-dot 1.2s ease-in-out infinite;
}

#demo .vr-log-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

#demo .vr-log-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

#demo .vr-log-shim {
  display: block;
  height: 2px;
  margin-top: 9px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--line) 0%, var(--accent) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: vr-shim-run 1.4s linear infinite;
}

/* Cards under an entry: the calendar slots, the map, the booking, the text, the sources, the data */
#demo .vr-log .vr-card {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--elev);
}

#demo .vr-card-t,
#demo .vr-card-k {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .vr-card-t {
  margin-bottom: 8px;
}

#demo .vr-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#demo .vr-slot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--ash);
  white-space: nowrap;
}

#demo .vr-slot--busy {
  text-decoration: line-through;
}

#demo .vr-slot--free {
  border-color: var(--ok);
  color: var(--ok);
}

#demo .vr-slot-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
}

#demo .vr-card--map {
  border-left-color: var(--ok);
}

#demo .vr-map-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#demo .vr-map {
  position: relative;
  flex: none;
  width: 172px;
  height: 86px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

#demo .vr-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#demo .vr-map path {
  fill: rgb(255 255 255 / 0.07);
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-dasharray: 3 2.5;
  vector-effect: non-scaling-stroke;
}

#demo .vr-map-base {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 1px;
  background: var(--bone);
}

#demo .vr-map-bl {
  position: absolute;
  left: 8px;
  top: -4px;
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: hsl(42 30% 94% / 0.7);
}

#demo .vr-map-pin {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px hsl(152 60% 48% / 0.25);
}

#demo .vr-map-t {
  min-width: 0;
}

#demo .vr-map-place {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--bone);
}

#demo .vr-map-note {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ok);
}

#demo .vr-card--event {
  border-left: 3px solid var(--accent);
}

#demo .vr-ev-t {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--bone);
}

#demo .vr-ev-r {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--bone-70);
}

#demo .vr-card--event .vr-chip {
  margin-top: 8px;
}

#demo .vr-card--sms {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
}

#demo .vr-card--sms .vr-card-k {
  margin-bottom: 0;
}

#demo .vr-bubble-in {
  margin: 6px 0 0;
  max-width: 92%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
  color: var(--bone-70);
}

#demo .vr-src + .vr-src {
  margin-top: 8px;
}

#demo .vr-src-l {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--bone-70);
}

#demo .vr-card--kv {
  border-left-color: var(--info);
}

#demo .vr-kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  align-items: baseline;
  margin: 0;
}

#demo .vr-kv-k {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .vr-kv-v {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--bone);
  overflow-wrap: anywhere;
}

#demo .vr-card--rule {
  border-left-color: var(--danger);
}

#demo .vr-rule-r {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--bone);
}

#demo .vr-rule-k {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .vr-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

#demo .vr-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--bone-70);
  white-space: nowrap;
}

#demo .vr-pill--danger {
  border-color: hsl(0 70% 56% / 0.6);
  color: var(--danger);
}

#demo .vr-arrow {
  font-size: 12px;
  color: var(--ash);
}

#demo .vr-card--ring {
  border-left-color: var(--danger);
}

#demo .vr-ring-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#demo .vr-ring-av {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid hsl(0 70% 56% / 0.5);
  border-radius: 50%;
  background: var(--elev-2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--bone);
}

#demo .vr-ring-i {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--danger);
  border-radius: 50%;
  opacity: 0;
  animation: vr-ring-pulse 1.4s ease-out infinite;
}

#demo .vr-ring-i--2 {
  animation-delay: 0.7s;
}

#demo .vr-ring-w {
  min-width: 0;
}

#demo .vr-ring-t {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--bone);
}

#demo .vr-ring-l {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ash);
}

#demo .vr-ring-n {
  display: inline-block;
  color: var(--danger);
  animation: vr-ring-lit 1.2s ease-in-out infinite;
  animation-delay: calc(var(--k, 0) * 0.4s);
}

/* ---------- Call summary: context card, then the text to Greg ---------- */

#demo .vr-ctx {
  min-width: 0;
}

/* Calendar day view: 9 rows of 24px, the same look as the hero calendar */
#demo .vr-calc {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--elev);
  overflow: hidden;
  --rows: 9;
}

#demo .vr-calc-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

#demo .vr-calc-t {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--bone);
}

#demo .vr-calc-d {
  font-size: 11px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

#demo .vr-calc-b {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 8px 12px 8px 4px;
}

#demo .vr-calc-g,
#demo .vr-calc-v {
  position: relative;
  height: calc(var(--rows) * 24px);
}

#demo .vr-calc-hl {
  position: absolute;
  left: 0;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
  color: var(--ash);
}

#demo .vr-calc-v {
  border-left: 1px solid var(--line-soft);
}

#demo .vr-calc-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid var(--line-soft);
}

#demo .vr-calc-ev,
#demo .vr-calc-free,
#demo .vr-calc-book {
  position: absolute;
  left: 6px;
  right: 6px;
  box-sizing: border-box;
  border-radius: 4px;
}

#demo .vr-calc-ev {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: var(--elev-2);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ash);
}

#demo .vr-calc-ev b {
  font-weight: 600;
  color: var(--bone);
}

#demo .vr-calc-who {
  overflow: hidden;
  text-overflow: ellipsis;
}

#demo .vr-calc-free {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  border: 1px dashed var(--ok);
  opacity: 0;
  transition: opacity 0.5s var(--ease-std);
}

#demo .vr-calc-free span {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ok);
}

#demo .vr-calc[data-cal="free"] .vr-calc-free,
#demo .vr-calc[data-cal="book"] .vr-calc-free {
  opacity: 1;
}

#demo .vr-calc[data-cal="book"] .vr-calc-free.is-faded {
  opacity: 0.35;
}

#demo .vr-calc[data-cal="book"] .vr-calc-free.is-gone {
  opacity: 0;
}

#demo .vr-calc-book {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--accent-40);
  border-left: 3px solid var(--accent);
  background: rgb(255 255 255 / 0.1);
  opacity: 0;
  transform: translateX(1.2em);
}

#demo .vr-calc[data-cal="book"] .vr-calc-book {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  animation: vr-book-glow 1.4s var(--ease-out) both;
}

#demo .vr-calc-bt {
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--bone);
}

#demo .vr-calc-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: none;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgb(255 255 255 / 0.6);
}

#demo .vr-calc[data-cal="scan"] .vr-calc-scan {
  display: block;
  animation: vr-scan 1.2s linear infinite;
}

#demo .vr-calc-foot {
  margin: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.6s var(--ease-std);
}

#demo .vr-calc[data-cal="book"] .vr-calc-foot {
  opacity: 1;
}

/* Fields card (question and message): rows fill in as the caller answers */
#demo .vr-fields {
  padding: 10px 14px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--elev);
}

#demo .vr-fields-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

#demo .vr-fields-t {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--bone);
}

#demo .vr-rows {
  margin: 0;
}

#demo .vr-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

#demo .vr-row:first-child {
  border-top: 0;
}

#demo .vr-row-k {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ash);
}

#demo .vr-row-v {
  position: relative;
  min-width: 0;
  margin: 0;
  min-height: 17px;
}

#demo .vr-shim {
  display: block;
  width: 60%;
  height: 6px;
  margin: 6px 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--line) 0%, var(--accent) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: vr-shim-run 1.4s linear infinite;
}

#demo .vr-val {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  color: var(--bone);
  overflow-wrap: anywhere;
  opacity: 0;
}

#demo .vr-row.is-filled .vr-shim {
  display: none;
}

#demo .vr-row.is-filled .vr-val {
  opacity: 1;
  transition: opacity 0.4s var(--ease-std);
}

#demo .vr-row.is-flash {
  animation: vr-flash 0.8s ease-out;
}

#demo .vr-sms {
  margin-top: 2px;
}

#demo .vr-sms-k {
  margin: 0 0 8px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ash);
}

#demo .vr-sms-w {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  animation: vr-rise 0.5s var(--ease-out) both;
}

#demo .vr-bubble {
  max-width: 92%;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid hsl(214 85% 66% / 0.35);
  border-radius: 14px 14px 4px 14px;
  background: hsl(214 85% 66% / 0.14);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--bone);
}

#demo .vr-sms-d {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ash);
}

/* Rota card (emergency): who is called, in order */
#demo .vr-rota {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-top-width: 1px;
  border-radius: 8px;
  background: var(--elev);
  transition: border-color 0.4s;
}

#demo .vr-rota.is-urgent {
  border-top: 2px solid var(--danger);
}

#demo .vr-rota-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

#demo .vr-rota-t {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--bone);
}

#demo .vr-rota-d {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

#demo .vr-rota-l {
  margin: 0;
  padding: 0;
  list-style: none;
}

#demo .vr-rota-r {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 -8px;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-top: 1px solid var(--line-soft);
  border-radius: 6px;
  transition: border-color 0.4s, background-color 0.4s;
}

#demo .vr-rota-r:first-child {
  border-top-color: transparent;
}

#demo .vr-rota-n {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ash);
}

#demo .vr-rota-w {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#demo .vr-rota-name {
  font-size: 15px;
  line-height: 1.3;
  color: var(--bone);
}

#demo .vr-rota-role {
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ash);
}

#demo .vr-rota-c {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ash);
}

#demo .vr-rota-c svg {
  width: 11px;
  height: 11px;
}

#demo .vr-rota-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  animation: vr-blink 1.2s ease-in-out infinite;
}

#demo .vr-rota-r[data-state="ringing"] {
  border-color: hsl(0 70% 56% / 0.6);
  background: hsl(0 70% 56% / 0.06);
}

#demo .vr-rota-r[data-state="ringing"] .vr-rota-c {
  border-color: hsl(0 70% 56% / 0.5);
  color: var(--danger);
}

#demo .vr-rota-r[data-state="connected"] {
  border-color: hsl(152 60% 48% / 0.5);
  background: hsl(152 60% 48% / 0.05);
}

#demo .vr-rota-r[data-state="connected"] .vr-rota-c {
  border-color: hsl(152 60% 48% / 0.4);
  color: var(--ok);
}

/* The text to Greg: a dashed placeholder, then the notification that lands when the call ends */
#demo .vr-note-k {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ash);
}

#demo .vr-note-k svg {
  flex: none;
  width: 14px;
  height: 14px;
}

#demo .vr-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--elev);
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.8);
  animation: vr-rise 0.5s var(--ease-out) both;
}

#demo .vr-note-h {
  display: flex;
  align-items: center;
  gap: 8px;
}

#demo .vr-tc {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 28%;
  background: linear-gradient(145deg, #36b3a2, #1c6b61);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}

#demo .vr-note-app {
  font-size: 15px;
  font-weight: 600;
  color: var(--bone);
}

#demo .vr-note-now {
  margin-left: auto;
  font-size: 11px;
}

#demo .vr-note-t {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 8px 0 5px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--bone);
}

#demo .vr-note-ok {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--ok);
}

#demo .vr-note-ok svg {
  width: 100%;
  height: 100%;
}

#demo .vr-note-chip {
  padding: 3px 6px;
  border: 1px solid hsl(0 70% 56% / 0.5);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--danger);
}

#demo .vr-note-tt {
  min-width: 0;
}

#demo .vr-note-l {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#demo .vr-note-l li {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--bone-70);
}

#demo .vr-note-f {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ash);
}

#demo .vr-note-f svg {
  width: 12px;
  height: 12px;
}

#demo .vr-note-f.is-ok {
  color: var(--ok);
}

#demo .vr-note[data-tone="gold"] .vr-note-tt {
  color: var(--accent);
}

#demo .vr-note[data-tone="danger"] {
  border-color: hsl(0 70% 56% / 0.55);
  background: hsl(0 70% 56% / 0.07);
  animation: vr-rise 0.5s var(--ease-out) both, vr-note-glow 1.6s ease-out both;
}

/* ---------- Caption under the stage (booking only; the space stays reserved) ---------- */

#demo .vr-caption {
  margin: 16px 0 0;
  max-width: 60ch;
  min-height: calc(1.5em * 2);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--bone-70);
}

#demo .vr-caption.is-off {
  visibility: hidden;
}

/* ---------- Status line and clock (as the other demos) ---------- */

#demo .vr-demo-stage.is-urgent .demo-top {
  border-bottom-color: hsl(0 70% 56% / 0.45);
}

#demo .demo-clock-state.is-danger {
  color: var(--danger);
}

#demo .demo-after {
  margin-top: 8px;
}

#demo .demo-after .link-mono {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
}

/* ---------- 1280px and up: all three columns share one top and one bottom ---------- */

@media (min-width: 1280px) {
  #demo .vr-grid {
    --vr-fs: 13.5px;
  }
}

/* ---------- 901 to 1279px: the call, then the carousel with the nav under it ---------- */

@media (max-width: 1279px) {
  #demo .vr-grid {
    --vr-fs: 12.5px;
    grid-template-columns: 320px minmax(0, 1fr);
  }

  #demo .demo-status,
  #demo .demo-status-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  #demo .vr-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
  }

  #demo .vr-side {
    grid-column: auto;
    grid-row: auto;
    display: flex;
    gap: 0;
    width: 100%;
    overflow: hidden;
  }

  #demo .vr-side > .demo-col {
    flex: none;
    width: 100%;
    transition: transform 0.6s var(--ease-out), visibility 0.6s;
  }

  #demo .vr-side[data-show="sum"] > .demo-col {
    transform: translateX(-100%);
  }

  #demo .vr-side[data-show="sum"] > .vr-col-log,
  #demo .vr-side:not([data-show="sum"]) > .vr-col-sum {
    visibility: hidden;
  }

  #demo .vr-nav {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  #demo .vr-nav button {
    min-height: 32px;
    height: auto;
    padding: 0 14px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.2;
    color: var(--ash);
  }

  #demo .vr-nav button[aria-pressed="true"] {
    background: var(--bone);
    color: var(--ink);
  }
}

/* ---------- 900px and below: one column; the nav sits under the call, then the carousel ---------- */

@media (max-width: 900px) {
  #demo .vr-grid {
    --vr-fs: 12.5px;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
    column-gap: 0;
  }

  #demo .vr-stack {
    display: contents;
  }

  #demo .vr-col-call {
    grid-column: 1;
    grid-row: 1;
  }

  #demo .vr-nav {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
  }

  #demo .vr-mini {
    grid-column: 1;
    grid-row: 3;
  }

  #demo .vr-side {
    grid-column: 1;
    grid-row: 4;
    height: 540px;
  }

  #demo .vr-side > .demo-col {
    height: 100%;
  }
}

/* Phones: the mini status of the newest line sits above the carousel */
@media (max-width: 640px) {
  #demo .vr-mini {
    display: block;
    margin: 0;
    padding: 0 2px 10px;
    min-width: 0;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ash);
  }
}

@media (max-width: 480px) {
  #demo .vr-grid {
    --vr-fs: 12px;
  }

  #demo .vr-label {
    min-height: 36px;
  }

  #demo .vr-demo-stage .demo-top {
    padding: 12px 14px;
  }
}

/* Touch: bigger targets for the mute switch and the nav */
@media (pointer: coarse) {
  #demo .vr-mute {
    min-height: 44px;
  }

  #demo .vr-nav button {
    min-height: 40px;
  }
}

/* ---------- Static (finished state) and reduced motion: nothing animates ---------- */

#demo .vr-demo-stage.is-static,
#demo .vr-demo-stage.is-static *,
#demo .vr-demo-stage.is-static *::before,
#demo .vr-demo-stage.is-static *::after {
  transition: none !important;
  animation: none !important;
}

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

/* ---------- Keyframes ---------- */

@keyframes vr-log-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes vr-log-new {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes vr-dot {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes vr-shim-run {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes vr-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes vr-note-glow {
  from {
    box-shadow: 0 0 0 1px hsl(0 70% 56% / 0.5), 0 0 28px -6px hsl(0 70% 56% / 0.45);
  }
  to {
    box-shadow: 0 0 0 1px hsl(0 70% 56% / 0), 0 0 28px -6px hsl(0 70% 56% / 0);
  }
}

@keyframes vr-flash {
  from {
    background-color: rgb(255 255 255 / 0.16);
  }
  to {
    background-color: transparent;
  }
}

@keyframes vr-scan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(var(--rows) * 24px - 2px));
  }
}

@keyframes vr-book-glow {
  from {
    box-shadow: 0 0 22px -4px rgb(255 255 255 / 0.6);
  }
  to {
    box-shadow: 0 0 22px -4px rgb(255 255 255 / 0);
  }
}

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

@keyframes vr-ring-lit {
  0%,
  100% {
    opacity: 0.35;
  }
  30% {
    opacity: 1;
  }
}

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

/* ---------- Live step caption: wraps to two lines instead of an ellipsis; the step label sits level ---------- */

#demo .demo-top {
  align-items: center;
}

#demo .demo-status {
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
}

#demo .demo-status-text {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.4;
}

#demo .demo-step {
  flex: none;
}

/* Below 1100px the caption takes the full width under the live label and the clock */
@media (min-width: 901px) and (max-width: 1099px) {
  #demo .demo-top {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 12px;
  }

  #demo .demo-top > .demo-status {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ---------- Phone: 44px hit areas for the scenario tabs, the switch and the side nav ---------- */

@media (max-width: 640px) {
  #demo .vr-demo-bar .tab,
  #demo .vr-mute,
  #demo .vr-nav button {
    min-height: 44px;
  }
}
