/* ===========================================================================
   Live AI Agent — demo screen
   ORION ✦ structure · LiveUCX blue accent build (Setproduct kits — see
   BrandGuide/portal/figma-kits). Self-contained, no external assets.
   Palette is the Orion Dark token set: Persian #3506EF fills,
   Birches #C084FC accent-ink/glow, Purple #7C3AED gradient partner,
   Light cherry #FF2069 live pulse, Electric Green #5EFF5A ok.
   =========================================================================== */

:root {
  /* Orion Dark surfaces */
  --bg:            #090909;   /* kit canvas fill (page 090909, verified) */
  --bg-2:          #0D0D16;   /* raised canvas */
  --surface:       #14141F;   /* card surface */
  --surface-2:     #1B1B2A;   /* caller bubble */
  --line:          rgba(255,255,255,.08);
  --line-strong:   rgba(255,255,255,.20);

  --ink:           #FFFFFF;
  --muted:         #8D8DA8;
  --faint:         #7A7B95;

  /* Orion accents (exact kit hexes) */
  --persian:       #7C3AED;   /* brand blue */
  --birches:       #C084FC;
  --purple:        #7C3AED;
  --ok:            #5EFF5A;
  --live:          #FF2069;

  /* legacy aliases still referenced below — keep pointing at kit colours */
  --cyan:          var(--birches);
  --blue:          var(--persian);

  --radius:        16px;
  --radius-lg:     22px;
  --shadow-card:   0 18px 50px rgba(0,0,0,.55);
  --shadow-glow:   0 0 0 1px rgba(192,132,252,.28), 0 10px 40px rgba(124,58,237,.22);

  --maxw:          100%;
  --font: "Inter", "Open Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Poppins", "Century Gothic", "Avenir Next", var(--font);
  --mono: "Roboto Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(1100px 640px at 82% -12%, rgba(124,58,237,.16), transparent 60%),
    radial-gradient(900px 600px at -4% 112%, rgba(124,58,237,.20), transparent 55%),
    radial-gradient(700px 420px at 50% 118%, rgba(192,132,252,.07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;               /* stage scrolls, body never does */
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--persian); color: #fff; padding: 10px 16px;
  border-radius: 10px; text-decoration: none; font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* Global focus visibility — Birches, the kit's readable accent-ink */
:focus-visible {
  outline: 2px solid var(--birches);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ─────────────────────────── App shell ─────────────────────────── */
.app {
  height: 100dvh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(14px, 2.2vw, 28px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(12px, 1.6vw, 20px);
}

/* ─────────────────────────── Header ─────────────────────────── */
.app__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(12px, 1.4vw, 18px) clamp(16px, 1.8vw, 24px);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { display: block; height: 30px; width: auto; }
/* legacy hand-drawn mark — replaced by the real LiveUCX logo <img> */
.brand__glyph, .brand__word { display: none; }

.agent { min-width: 0; }
.agent__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.98rem, 1.3vw, 1.2rem);
  letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agent__tag {
  color: var(--muted);
  font-size: clamp(.72rem, 1vw, .84rem);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 2px;
}
.agent__provider {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: .74rem; font-weight: 600;
  background: rgba(255,255,255,.04);
}
.agent__provider .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--birches), var(--purple));
  box-shadow: 0 0 6px rgba(192,132,252,.6);
}

/* Call-state pill — Orion pill, Light-cherry live pulse */
.callstate {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.04);
  font-weight: 600; font-size: .9rem; white-space: nowrap;
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}
.callstate__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 0 rgba(255,32,105,0);
}
.callstate[data-state="live"] { color: #fff; border-color: rgba(124,58,237,.6); background: rgba(124,58,237,.16); }
.callstate[data-state="live"] .callstate__dot {
  background: var(--purple);
  animation: pulse 1.6s ease-out infinite;
}
.callstate[data-state="ended"] { color: var(--muted); border-color: var(--line-strong); }
.callstate[data-state="ended"] .callstate__dot { background: var(--muted); }
.callstate[data-state="idle"] .callstate__dot { background: var(--faint); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(124,58,237,.65); }
  70%  { box-shadow: 0 0 0 12px rgba(124,58,237,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
}

/* ─────────────────────────── Stage / conversation ─────────────────────────── */
.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008)),
    var(--bg-2);
  box-shadow: var(--shadow-card);
}
.stage:focus-visible { outline-offset: -3px; }

/* Clear — floating reset, revealed after a call ends (app.js). */
.btn-clear {
  position: absolute; bottom: 16px; right: 16px; z-index: 5;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(9,9,9,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--ink); font: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-clear:hover { border-color: rgba(192,132,252,.55); background: rgba(192,132,252,.14); color: #fff; }
.btn-clear:active { transform: translateY(1px); }
.btn-clear svg { width: 15px; height: 15px; }
.btn-clear[hidden] { display: none; }   /* override inline-flex when the hidden attr is set */

/* Empty / idle — the ORION waiting panel. Was white; now the kit's raised
   canvas with a ghost watermark, glowing dial numeral and Persian step chips.
   Scoped tokens kept for the panel's own text (AA on the dark canvas). */
.empty {
  position: absolute; inset: 0;
  overflow-y: auto;
  display: flex; flex-direction: column;
  padding: clamp(18px, 3vw, 40px);
  background:
    radial-gradient(640px 320px at 50% -8%, rgba(124,58,237,.22), transparent 62%),
    radial-gradient(520px 300px at 88% 112%, rgba(124,58,237,.14), transparent 60%),
    var(--bg-2);
  color: var(--ink);
  transition: opacity .4s ease;
  /* scoped panel tokens — dark now, names kept so nothing else changes */
  --w-ink:   #FFFFFF;
  --w-body:  #C9C9DC;
  --w-muted: #8D8DA8;
  --w-line:  rgba(255,255,255,.09);
  --w-tint:  rgba(124,58,237,.14);
  --w-blue:  var(--birches);   /* readable accent on dark = Birches */
}
.empty.is-hidden { opacity: 0; pointer-events: none; }
.empty::-webkit-scrollbar { width: 10px; }
.empty::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}

.waiting {
  margin: auto;                 /* center when short, scroll when tall */
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: clamp(16px, 2.2vw, 24px);
  position: relative;           /* above the watermark */
}

.waiting__head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.waiting__badge {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; color: var(--birches);
  background: linear-gradient(135deg, rgba(192,132,252,.14), rgba(124,58,237,.22));
  border: 1px solid rgba(192,132,252,.30);
  box-shadow: 0 0 24px rgba(192,132,252,.14);
}
.waiting__badge svg { width: 28px; height: 28px; }
.waiting__title {
  margin: 4px 0 0; color: var(--w-ink);
  font-family: var(--font-display); font-weight: 600; letter-spacing: .2px;
  font-size: clamp(1.2rem, 2.1vw, 1.6rem);
}
.waiting__lead { margin: 0; color: var(--w-muted); max-width: 48ch; line-height: 1.55; }

/* Dial card — the phone number is the visual hero (Orion numeral treatment) */
.dialin {
  margin: 0; padding: clamp(16px, 2.2vw, 24px);
  display: flex; flex-direction: column; gap: 6px; text-align: center;
  border: 1px solid var(--w-line); border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
}
.dialin__kicker {
  color: var(--w-blue); font-weight: 700; font-size: .8rem;
  letter-spacing: .28em; text-transform: uppercase;
}
.dialin__num {
  display: block; margin: 6px 0 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(1.35rem, 4.6vw, 1.9rem); line-height: 1.15;
  letter-spacing: 1.5px; color: var(--w-ink);
  font-variant-numeric: tabular-nums; unicode-bidi: isolate;
  padding: 12px 16px; border-radius: 14px;
  background: var(--w-tint);
  box-shadow: inset 0 0 42px rgba(124,58,237,.26);
}
.dialin__num a { color: inherit; text-decoration: none; }
.dialin__num a:hover { text-decoration: underline; text-underline-offset: 4px; }
.dialin__num svg { width: .8em; height: .8em; vertical-align: -.06em; margin-right: .38em; color: var(--birches); }
.dialin__hint { margin: 0; color: var(--w-muted); font-size: .9rem; line-height: 1.5; }

/* Short explainer */
.works { text-align: left; }
.works__title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px; color: var(--w-blue);
  font-family: var(--font-display);
  font-size: 1.06rem; font-weight: 600; letter-spacing: .2px;
}
.works__title svg { width: 19px; height: 19px; flex: none; }
.works__intro { margin: 0 0 12px; color: var(--w-body); line-height: 1.5; }
.works__intro b { color: var(--w-ink); font-weight: 700; }
.works__list { margin: 0; padding: 0; list-style: none; counter-reset: w; display: flex; flex-direction: column; gap: 10px; }
.works__list li {
  counter-increment: w; position: relative; padding-left: 32px;
  color: var(--w-body); line-height: 1.5; font-size: .95rem;
}
.works__list li b { color: var(--w-ink); font-weight: 700; }
.works__list li i { color: var(--w-ink); font-style: italic; }
.works__list li::before {
  content: counter(w);
  position: absolute; left: 0; top: .05em;
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; color: #fff;
  background: var(--persian); border: 1px solid rgba(192,132,252,.35);
  box-shadow: 0 0 10px rgba(124,58,237,.5);
}

/* Things-to-try chips — Orion tag treatment */
.works__tries { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.works__tries-label {
  color: var(--w-muted); font-size: .72rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; margin-right: 2px;
}
.try {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  font-size: .86rem; font-weight: 600; color: var(--birches);
  background: rgba(192,132,252,.08); border: 1px solid rgba(192,132,252,.30);
}

@keyframes bob {
  0%, 100% { transform: translateY(6px) scale(.85); opacity: .5; }
  50%      { transform: translateY(-6px) scale(1);  opacity: 1;  }
}

/* Thread — the scrolling bubble column */
.thread {
  list-style: none;
  margin: 0;
  padding: clamp(16px, 2.4vw, 30px) clamp(14px, 2.2vw, 30px) clamp(20px, 3vw, 36px);
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.thread[aria-hidden="true"] { display: none; }
.thread::-webkit-scrollbar { width: 10px; }
.thread::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }

/* A turn */
.turn {
  display: flex; flex-direction: column;
  max-width: min(76%, 680px);
  animation: rise .35s cubic-bezier(.2,.7,.3,1) both;
}
.turn--caller { align-self: flex-start; align-items: flex-start; }
.turn--agent  { align-self: flex-end;   align-items: flex-end; }

.turn__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; color: var(--faint); margin: 0 4px 5px;
}
.turn__who { font-weight: 700; letter-spacing: .3px; text-transform: uppercase; font-size: .66rem; }
.turn--caller .turn__who { color: var(--muted); }
.turn--agent  .turn__who { color: var(--birches); }

.bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: clamp(.84rem, .95vw, .93rem);
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
}
.turn--caller .bubble {
  background: linear-gradient(180deg, rgba(124,58,237,.06), rgba(124,58,237,.03)), var(--surface-2);
  border-bottom-left-radius: 6px;
  color: var(--ink);
}
/* Agent voice — translucent Birches→Persian wash (the original treatment,
   kit hues): airy gradient tint, thin accent edge, soft glow */
.turn--agent .bubble {
  background: linear-gradient(135deg, rgba(192,132,252,.13), rgba(124,58,237,.22));
  border-color: rgba(192,132,252,.34);
  border-bottom-right-radius: 6px;
  color: #F2FBFF;
  box-shadow: 0 0 0 1px rgba(192,132,252,.18), 0 10px 34px rgba(124,58,237,.16);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator (agent "speaking") */
.turn--typing .bubble {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 18px;
}
.typing-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--birches);
  box-shadow: 0 0 6px rgba(192,132,252,.6);
  animation: type 1.1s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes type {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* Caret cue on the newest agent bubble while streaming (reserved for future partials) */
.caret::after {
  content: "▍";
  margin-left: 2px;
  color: var(--birches);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Call-ended divider */
.divider {
  align-self: center;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .78rem; font-weight: 600;
  padding: 6px 14px; margin: 6px 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.03);
  animation: rise .35s ease both;
}
.divider .bi { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }

/* ─────────────────────────── Footer ─────────────────────────── */
.app__footer {
  display: flex; align-items: center; gap: 12px;
  padding: 4px clamp(6px, 1vw, 12px) 2px;
  font-size: .78rem; color: var(--faint);
}
.footer__spacer { flex: 1; }
.footer__brand { letter-spacing: .3px; }

.conn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.conn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transition: background .3s; }
.conn[data-conn="live"]  .conn__dot { background: var(--ok); box-shadow: 0 0 6px rgba(94,255,90,.55); }
.conn[data-conn="mock"]  .conn__dot { background: var(--birches); box-shadow: 0 0 6px rgba(192,132,252,.55); }
.conn[data-conn="error"] .conn__dot { background: var(--live); }
.conn[data-conn="connecting"] .conn__dot { background: var(--purple); animation: bob 1s ease-in-out infinite; }
.conn[data-conn="live"]  .conn__label { color: var(--ok); }
.conn[data-conn="mock"]  .conn__label { color: var(--birches); }
.conn[data-conn="error"] .conn__label { color: var(--live); }

/* ─────────────────────────── Responsive ─────────────────────────── */
@media (max-width: 640px) {
  .app__header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand state" "agent agent";
    row-gap: 10px;
  }
  .brand    { grid-area: brand; }
  .callstate{ grid-area: state; }
  .agent    { grid-area: agent; }
  .turn { max-width: 88%; }
  .footer__brand { display: none; }
}

/* Big-screen / presentation mode — scale type up for a room */
@media@media (min-width: 1600px) {
  body { font-size: 15px; }
  .turn { max-width: min(70%, 820px); }
  .brand__logo { height: 36px; }
}

/* ─────────────────────────── Reduced motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
  .callstate[data-state="live"] .callstate__dot { box-shadow: 0 0 0 3px rgba(124,58,237,.4); }
  .typing-dot { opacity: .8; }
}

/* ─────────────────── Call journey — Orion glow stepper ─────────────────── */
.stageframe {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 20px);
  min-height: 0;                    /* let the stage own the scroll */
}
.stageframe > .stage { min-height: 0; }

.journey {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(320px 220px at 50% -10%, rgba(124,58,237,.14), transparent 65%),
    var(--bg-2);
  box-shadow: var(--shadow-card);
  padding: clamp(16px, 2vw, 24px) clamp(14px, 1.6vw, 20px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.journey__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}

.jstep {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 34px;
}
.jstep:last-child { padding-bottom: 0; }
/* connector segment beneath each ring */
.jstep:not(:last-child)::before {
  content: "";
  position: absolute; left: 22px; top: 50px; bottom: 4px;
  width: 2px; border-radius: 2px;
  background: var(--line-strong);
  transition: background .4s ease;
}
.jstep[data-state="done"]:not(:last-child)::before {
  background: linear-gradient(180deg, var(--purple), rgba(124,58,237,.25));
}

.jstep__ring {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2.5px solid var(--line-strong);
  color: var(--faint);
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.05rem;
  background: var(--bg-2);
  transition: border-color .35s ease, color .35s ease, box-shadow .35s ease;
}
.jstep__num { line-height: 1; }
/* done — purple glow ring with a check */
.jstep[data-state="done"] .jstep__ring {
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 0 18px rgba(124,58,237,.55), inset 0 0 12px rgba(124,58,237,.28);
}
.jstep[data-state="done"] .jstep__num { font-size: 0; }
.jstep[data-state="done"] .jstep__num::after {
  content: "✓"; font-size: 1.15rem; font-weight: 700;
}
/* current — cherry glow ring, live pulse */
.jstep[data-state="current"] .jstep__ring {
  border-color: var(--live);
  color: #fff;
  box-shadow: 0 0 20px rgba(255,32,105,.5), inset 0 0 12px rgba(255,32,105,.22);
  animation: jpulse 2.2s ease-in-out infinite;
}
@keyframes jpulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255,32,105,.35), inset 0 0 10px rgba(255,32,105,.18); }
  50%      { box-shadow: 0 0 26px rgba(255,32,105,.65), inset 0 0 14px rgba(255,32,105,.3); }
}

.jstep__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
.jstep__eyebrow {
  font-size: .62rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
}
.jstep[data-state="done"]    .jstep__eyebrow { color: var(--purple); }
.jstep[data-state="current"] .jstep__eyebrow { color: var(--live); }
.jstep__title {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.02rem; letter-spacing: .2px;
  color: var(--faint);
}
.jstep[data-state="done"]    .jstep__title { color: var(--ink); }
.jstep[data-state="current"] .jstep__title { color: var(--ink); }
.jstep__sub { font-size: .78rem; color: var(--faint); line-height: 1.45; }
.jstep[data-state="current"] .jstep__sub { color: var(--muted); }

/* the rail is a desktop garnish — the transcript always wins on small screens */
@media (max-width: 980px) {
  .stageframe { grid-template-columns: 1fr; }
  .journey { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .jstep[data-state="current"] .jstep__ring { animation: none; }
}

/* ───────────── Turn layout v2 — avatars, chips, outcome, meta-under ───────── */
.turn { flex-direction: row; align-items: flex-end; gap: 10px; }
.turn__col { display: flex; flex-direction: column; min-width: 0; }
.turn--caller .turn__col { align-items: flex-start; }
.turn--agent  .turn__col { align-items: flex-end; }
.turn__meta { margin: 6px 4px 0; }   /* now sits under the bubble */

/* Avatars — agent = Orion dot-burst, caller = neutral ring */
.tav {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  margin-bottom: 22px;               /* optically align with the bubble, above meta */
}
.tav svg { width: 21px; height: 21px; }
.tav--agent {
  border: 1.5px solid rgba(192,132,252,.45);
  background:
    radial-gradient(circle at 50% 42%, rgba(124,58,237,.55), rgba(13,13,22,.9) 72%);
  box-shadow: 0 0 12px rgba(192,132,252,.28);
}
.tav--caller {
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
}

/* Insight chips inside agent bubbles — "Flight EZY1921 · On time" style */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.2;
  border: 1px solid rgba(192,132,252,.38);
  background: rgba(9,9,9,.35);
  color: #DFFDFB;
}
.chip svg { width: 13px; height: 13px; flex: none; color: var(--birches); }

/* Call Outcome badge — appended to the closing agent bubble */
.outcome {
  display: flex; align-items: center; gap: 9px;
  margin-top: 11px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: .8rem;
}
.outcome__label { color: rgba(244,242,255,.7); font-weight: 600; }
.chip--positive { border-color: rgba(94,255,90,.42);  background: rgba(94,255,90,.12);  color: #D8FFD6; }
.chip--positive svg { color: var(--ok); }
.chip--neutral  { border-color: var(--line-strong);   background: rgba(255,255,255,.06); color: var(--ink); }
.chip--neutral svg { color: var(--muted); }
.chip--negative { border-color: rgba(255,32,105,.45); background: rgba(255,32,105,.12); color: #FFD9E4; }
.chip--negative svg { color: var(--live); }

@media (max-width: 640px) {
  .tav { width: 28px; height: 28px; margin-bottom: 20px; }
  .tav svg { width: 17px; height: 17px; }
}

/* ───────────── Journey v3 — reference-matched glow blooms · senti · summary ── */
.stageframe { grid-template-columns: 264px minmax(0, 1fr); }

.jstep { grid-template-columns: 66px 1fr; gap: 14px; padding-bottom: 40px; }
.jstep:not(:last-child)::before {
  left: 27px; top: 62px; bottom: 6px; width: 3px;
  background: var(--line);
}
.jstep[data-state="done"]:not(:last-child)::before {
  background: linear-gradient(180deg, var(--purple), rgba(124,58,237,.2));
}
.jstep[data-state="current"]:not(:last-child)::before {
  background: linear-gradient(180deg, rgba(124,58,237,.6), var(--line));
}

.jstep__ring {
  width: 56px; height: 56px;
  position: relative; isolation: isolate;
  border-width: 2.5px;
  background: #0D0D16;
  font-size: 1.15rem;
}
/* the soft radial bloom BEHIND the ring — the reference's background gradient */
.jstep__ring::before {
  content: ""; position: absolute; inset: -26px; z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.55) 0%, rgba(124,58,237,.18) 42%, transparent 70%);
  opacity: 0; transition: opacity .5s ease;
  pointer-events: none;
}
.jstep[data-state="done"] .jstep__ring::before    { opacity: .5; }
.jstep[data-state="current"] .jstep__ring::before { opacity: 1; }
.jstep[data-state="done"] .jstep__ring {
  border-color: var(--purple); color: #fff;
  box-shadow: none;                      /* the bloom carries the glow now */
}
.jstep[data-state="current"] .jstep__ring {
  border-color: var(--purple); color: #fff;
  box-shadow: inset 0 0 14px rgba(124,58,237,.35);
  animation: none;
}
.jstep[data-state="current"] .jstep__eyebrow { color: #7CBBFF; }
.jstep[data-state="done"]    .jstep__eyebrow { color: rgba(124,58,237,.85); }
.jstep__title { font-size: .98rem; }
.jstep__sub   { font-size: .75rem; }

/* ── Live sentiment meter (journey rail) ── */
.senti {
  margin-top: 6px; padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}
.senti__head { display: flex; align-items: baseline; justify-content: space-between; }
.senti__label {
  font-size: .62rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
}
.senti__val {
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.senti__val[data-mood="pos"] { color: var(--ok); }
.senti__val[data-mood="neu"] { color: var(--muted); }
.senti__val[data-mood="neg"] { color: var(--live); }
.senti__track {
  position: relative; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255,32,105,.5), rgba(122,123,149,.3) 50%, rgba(94,255,90,.55));
}
.senti__marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--purple);
  box-shadow: 0 0 10px rgba(124,58,237,.6);
  transition: left .6s cubic-bezier(.4,0,.2,1);
}
.senti__ends {
  display: flex; justify-content: space-between;
  font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint);
}

/* ── End-of-call summary bar (in the thread) ── */
.summary {
  align-self: stretch; max-width: none;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--surface);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 18px; margin-top: 4px;
  animation: rise .35s ease both;
}
.summary__title {
  font-family: var(--font-display); font-weight: 600; font-size: .92rem;
  color: var(--ink); margin-bottom: 10px;
}
.summary__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.summary__cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.summary__k {
  font-size: .6rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint);
}
.summary__v {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.summary__na { color: var(--faint); }
.summary__note { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .senti__marker { transition: none; }
}

/* ───────────── Rail v4 — tighter type · radial sentiment gauge ───────────── */
.stageframe { grid-template-columns: 236px minmax(0, 1fr); }
.jstep { grid-template-columns: 56px 1fr; gap: 12px; padding-bottom: 32px; }
.jstep__ring { width: 46px; height: 46px; border-width: 2px; font-size: .95rem; }
.jstep__ring::before { inset: -20px; }
.jstep:not(:last-child)::before { left: 22px; top: 52px; width: 2.5px; }
.jstep__eyebrow { font-size: .55rem; letter-spacing: .16em; }
.jstep__title   { font-size: .86rem; }
.jstep__sub     { font-size: .68rem; }

/* Radial sentiment gauge — replaces the linear meter */
.senti { align-items: center; gap: 4px; }
.senti__head, .senti__track, .senti__marker, .senti__label, .senti__val:not(text) { display: none; }
.senti__gauge { width: 132px; height: auto; display: block; }
.senti__trackarc {
  stroke: rgba(255,255,255,.09); stroke-width: 9; stroke-linecap: round;
}
.senti__arc {
  stroke: url(#sgrad); stroke-width: 9; stroke-linecap: round;
  transition: stroke-dasharray .8s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 0 6px rgba(124,58,237,.45));
}
.senti[data-mood="pos"] .senti__arc { filter: drop-shadow(0 0 7px rgba(94,255,90,.5)); }
.senti[data-mood="neg"] .senti__arc { filter: drop-shadow(0 0 7px rgba(255,32,105,.5)); }
.senti__hub { fill: #0D0D16; stroke: rgba(255,255,255,.07); }
.senti__num {
  fill: var(--ink); font-family: var(--font-display);
  font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.senti[data-mood="pos"] .senti__num { fill: var(--ok); }
.senti[data-mood="neg"] .senti__num { fill: var(--live); }
.senti__cap { fill: var(--faint); font-size: 7.5px; font-weight: 800; }
.senti__ends {
  width: 132px; display: flex; justify-content: space-between;
  font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-top: -6px;
}
@media (prefers-reduced-motion: reduce) { .senti__arc { transition: none; } }

/* ───────────── v7 — purple waiting page · crisper small caps ───────────── */
/* The rail's purple scheme now carries the idle panel too */
.empty { --w-blue: #7CBBFF; }                 /* readable purple accent-ink */
.waiting__badge {
  color: #7CBBFF;
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(124,58,237,.20));
  border-color: rgba(124,58,237,.34);
  box-shadow: 0 0 26px rgba(124,58,237,.20);
}
.dialin__num {
  box-shadow: inset 0 0 42px rgba(124,58,237,.26), 0 0 20px rgba(124,58,237,.20);
}
.dialin__num svg { color: #7CBBFF; }
.works__list li::before {
  border-color: rgba(124,58,237,.45);
  box-shadow: 0 0 10px rgba(124,58,237,.45);
}
.try {
  color: #7CBBFF;
  background: rgba(124,58,237,.10);
  border-color: rgba(124,58,237,.32);
}
.btn-clear:hover { border-color: rgba(124,58,237,.6); background: rgba(124,58,237,.16); }

/* Crispness — tiny 800-weight tracked caps render soft; ease all three levers */
.jstep__eyebrow { font-size: .6rem;  font-weight: 700; letter-spacing: .13em; }
.jstep__sub     { font-size: .7rem; }
.senti__cap     { font-size: 8.5px;  font-weight: 700; }
.senti__ends    { font-size: .6rem;  letter-spacing: .07em; }
.dialin__kicker { letter-spacing: .2em; font-weight: 700; }
.summary__k, .works__tries-label { font-weight: 700; }
body { font-synthesis: none; }

/* ───────────── v8 — glassy summary · backstage systems trace ───────────── */
/* Summary bar: white gradient glass */
.summary {
  background: linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.08) 50%, rgba(255,255,255,.16));
  border: 1px solid rgba(255,255,255,.32);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -20px 40px rgba(255,255,255,.04);
}
.summary__k { color: rgba(255,255,255,.55); }
.summary__v, .summary__title { color: #fff; }

/* Backstage trace — the systems the agent is talking to */
.trace {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 4px 6px;
  animation: rise .3s ease both;
}
.turn--agent .trace { justify-content: flex-end; }
.trace__item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sysc, var(--muted));
  background: rgba(255,255,255,.05);
  border: 1px solid color-mix(in srgb, var(--sysc, #fff) 35%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--sysc, #fff) 18%, transparent);
}
.trace__item svg { width: 12px; height: 12px; flex: none; }
.trace__item i { font-style: normal; }

/* Typing bubble: "querying Booking System…" */
.typing-sys {
  margin-left: 8px;
  font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); font-style: italic; white-space: nowrap;
}

/* v9 — summary: textual recap + sentiment-journey sparkline */
.summary__note {
  margin: 2px 0 12px; font-size: .88rem; line-height: 1.5;
  color: rgba(255,255,255,.85); max-width: 88ch;
}
.summary__row { display: flex; gap: 26px; align-items: flex-end; flex-wrap: wrap; }
.summary__row .summary__grid { flex: 1 1 380px; }
.summary__spark { display: flex; flex-direction: column; gap: 6px; min-width: 240px; flex: 1 1 260px; }
.summary__spark svg { width: 100%; height: auto; aspect-ratio: 240 / 76; display: block; }

/* ───────────── v10 — white, shiny chat stage (scoped to the live thread) ── */
.stage {
  background:
    radial-gradient(1100px 340px at 18% -12%, rgba(255,255,255,.95), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F3F7FE 55%, #EBF1FC 100%);
  border-color: rgba(255,255,255,.65);
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 1.5px 0 #FFFFFF;
}
.stage:focus-visible { outline-color: #5B21B6; }
.thread { scrollbar-color: #C4CFE6 transparent; }
.thread::-webkit-scrollbar-thumb { background: #C4CFE6; }

/* turns on light */
.turn__meta { color: #8A94B0; }
.turn--caller .turn__who { color: #5A6785; }
.turn--agent  .turn__who { color: #0B7A72; }
.turn--caller .bubble {
  background: #FFFFFF;
  border-color: #DFE6F5;
  color: #1A2340;
  box-shadow: 0 3px 10px rgba(16,24,40,.06);
}
.turn--agent .bubble {
  background: linear-gradient(135deg, rgba(192,132,252,.16), rgba(124,58,237,.14));
  border-color: rgba(11,122,114,.35);
  color: #0D1B3D;
  box-shadow: 0 0 0 1px rgba(192,132,252,.2), 0 8px 24px rgba(124,58,237,.14);
}
.typing-dot { background: #0E8F87; box-shadow: none; }
.typing-sys { color: #5A6785; }
.caret::after { color: #0E8F87; }

/* insight chips + outcome on light */
.turn--agent .bubble .chip {
  background: rgba(255,255,255,.75);
  border-color: rgba(11,122,114,.4);
  color: #0B6E67;
}
.turn--agent .bubble .chip svg { color: #0E8F87; }
.outcome { border-top-color: rgba(16,24,40,.12); }
.outcome__label { color: #4A5578; }
.turn--agent .bubble .chip--positive { background: rgba(31,168,92,.14); border-color: rgba(31,168,92,.45); color: #136E2F; }
.turn--agent .bubble .chip--positive svg { color: #1FA85C; }
.turn--agent .bubble .chip--neutral  { background: rgba(90,103,133,.12); border-color: #B9C6DE; color: #3C4763; }
.turn--agent .bubble .chip--neutral svg { color: #5A6785; }
.turn--agent .bubble .chip--negative { background: rgba(228,30,84,.1); border-color: rgba(228,30,84,.4); color: #B3123F; }
.turn--agent .bubble .chip--negative svg { color: #E41E54; }

/* backstage trace tags on light */
.trace__item {
  background: rgba(255,255,255,.85);
  color: color-mix(in srgb, var(--sysc, #5A6785) 55%, #0A2540);
  border-color: color-mix(in srgb, var(--sysc, #B9C6DE) 45%, #C7D2E8);
  box-shadow: 0 2px 8px rgba(16,24,40,.08);
}

/* avatars on light */
.tav--caller { background: #EEF2FB; border-color: #CBD5EA; color: #5A6785; }
.tav--agent  { border-color: rgba(11,122,114,.45); box-shadow: 0 0 10px rgba(192,132,252,.35); }

/* divider + summary on light */
.divider { background: #FFFFFF; border-color: #DFE6F5; color: #5A6785; }
.divider .bi { background: #98A5C4; }
.summary {
  background: linear-gradient(135deg, #FFFFFF, #F6FAFF 55%, #EFF5FF);
  border: 1px solid #E0E8F7;
  box-shadow: 0 12px 32px rgba(16,24,40,.12), inset 0 1px 0 #FFFFFF;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.summary__title { color: #101828; }
.summary__note  { color: #26314B; }
.summary__k     { color: #7A86A8; }
.summary__v     { color: #101828; }
.summary .chip--positive { background: rgba(31,168,92,.14); border-color: rgba(31,168,92,.45); color: #136E2F; }
.summary .chip--positive svg { color: #1FA85C; }
.summary .chip--neutral  { background: rgba(90,103,133,.12); border-color: #B9C6DE; color: #3C4763; }
.summary .chip--negative { background: rgba(228,30,84,.1); border-color: rgba(228,30,84,.4); color: #B3123F; }
.summary__spark svg polyline[fill] { fill: rgba(124,58,237,.12); }

/* v11 — brand logo tiles in trace · per-turn caller mood tags */
.trace__logo {
  width: 16px; height: 16px; border-radius: 4.5px; flex: none;
  display: grid; place-items: center; overflow: hidden;
}
.trace__logo svg { width: 12px; height: 12px; }
.trace__logo--code {
  color: #fff; font-size: 7px; font-weight: 800; letter-spacing: .02em;
  font-family: var(--font-display);
}
.mood {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em;
}
.mood svg { width: 11px; height: 11px; }
.mood--positive { color: #1FA85C; background: rgba(31,168,92,.12);  border: 1px solid rgba(31,168,92,.35); }
.mood--neutral  { color: #7A86A8; background: rgba(122,134,168,.12); border: 1px solid rgba(122,134,168,.3); }
.mood--negative { color: #E41E54; background: rgba(228,30,84,.1);   border: 1px solid rgba(228,30,84,.35); }

/* ───────────── v12 — live process-flow rail (right) ───────────── */
.stageframe { grid-template-columns: 236px minmax(0, 1fr) 292px; }
.stageframe > .procflow[hidden] { display: none; }
@media (max-width: 1360px) { .stageframe { grid-template-columns: 236px minmax(0,1fr); } .procflow { display: none; } }

.procflow {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #FFFFFF, #F4F8FE);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), inset 0 1.5px 0 #fff;
  padding: 20px 16px;
  overflow-y: auto;
  opacity: 0; transform: translateX(14px);
}
.procflow.is-in { animation: procin .45s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes procin { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .procflow.is-in { animation: none; opacity: 1; transform: none; } }

.procflow__head { text-align: center; margin-bottom: 16px; }
.procflow__kicker {
  font-size: .6rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: #7A86A8;
}
.procflow__name {
  margin: 3px 0 2px; font-family: var(--font-display);
  font-weight: 600; font-size: 1.06rem; color: #101828;
}
.procflow__meta { font-size: .68rem; color: #7A86A8; }

.procflow__list { list-style: none; margin: 0; padding: 0; }
.pstep {
  position: relative;
  display: grid; grid-template-columns: 44px 1fr; gap: 10px;
  padding-bottom: 18px; align-items: start;
}
.pstep:last-child { padding-bottom: 0; }
.pstep:not(:last-child)::before {
  content: ""; position: absolute; left: 21px; top: 46px; bottom: 2px;
  width: 2px; background: #DCE4F2; border-radius: 2px;
}
.pstep[data-state="done"]:not(:last-child)::before { background: #1FA85C; }

.pstep__ring {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2.2px solid #D4DCEC; background: #fff;
  color: #93A0BE; font-family: var(--font-display);
  font-weight: 600; font-size: .88rem;
}
.pstep__ring svg { width: 19px; height: 19px; }
.pstep[data-state="done"] .pstep__ring { border-color: #1FA85C; color: #1FA85C; }
.pstep[data-state="current"] .pstep__ring {
  border-color: #0E8F87; background: #0E8F87; color: #fff;
  box-shadow: 0 0 0 5px rgba(14,143,135,.16), 0 0 18px rgba(192,132,252,.55);
}

.pstep__card {
  display: flex; flex-direction: column; gap: 2px;
  background: #FFFFFF; border: 1px solid #E4EAF6; border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(16,24,40,.05);
}
.pstep[data-state="current"] .pstep__card {
  border: 1.6px solid #0E8F87;
  box-shadow: 0 0 0 4px rgba(14,143,135,.1), 0 8px 22px rgba(14,143,135,.16);
}
.pstep__t { font-weight: 700; font-size: .82rem; color: #101828; }
.pstep[data-state="upcoming"] .pstep__t { color: #93A0BE; }
.pstep[data-state="current"]  .pstep__t { color: #0B6E67; }
.pstep__sub { font-size: .72rem; color: #7A86A8; line-height: 1.4; }
.pstep__done { font-size: .66rem; font-weight: 700; color: #1FA85C; margin-top: 2px; }
.pstep__status {
  margin-top: 5px; font-size: .68rem; font-weight: 700; color: #0E8F87;
  display: flex; flex-direction: column; gap: 4px;
}
.pstep__bar {
  height: 5px; border-radius: 99px; background: #E4EAF6; overflow: hidden;
}
.pstep__bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #0E8F87, #01D1C4);
  transition: width .5s ease;
}

/* ═════════ v13 — FULL LIGHT PAGE (white + grey gradient) · catchy summary ═════════ */
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124,58,237,.04), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFDFE 50%, #F7F9FC 100%);
  color: #26314B;
}
.skip-link { background: #7C3AED; }
:focus-visible { outline-color: #5B21B6; }

/* header goes light */
.app__header {
  background: linear-gradient(180deg, #FFFFFF, #F7F9FD);
  border-color: #E4E9F4;
  box-shadow: 0 6px 20px rgba(16,24,40,.06);
}
.agent__name { color: #101828; }
.agent__tag { color: #7A86A8; }
.agent__provider { border-color: #D8DFEE; background: #FFFFFF; color: #26314B; }
.callstate { border-color: #D8DFEE; background: #FFFFFF; color: #3C4763; }
.callstate[data-state="live"] { color: #5B21B6; border-color: rgba(124,58,237,.5); background: rgba(124,58,237,.1); }
.callstate[data-state="live"] .callstate__dot { background: #7C3AED; }
.callstate[data-state="ended"] { color: #7A86A8; }
.callstate__dot { background: #B6C0D8; }

/* journey rail goes light */
.journey {
  background: linear-gradient(180deg, #FFFFFF, #F4F8FE);
  border-color: #E4E9F4;
  box-shadow: 0 14px 40px rgba(16,24,40,.08);
}
.jstep__ring { background: #FFFFFF; border-color: #D4DCEC; color: #93A0BE; }
.jstep__ring::before {
  background: radial-gradient(circle, rgba(124,58,237,.4) 0%, rgba(124,58,237,.12) 42%, transparent 70%);
}
.jstep[data-state="done"] .jstep__ring { border-color: #7C3AED; color: #7C3AED; box-shadow: none; }
.jstep[data-state="current"] .jstep__ring {
  border-color: #7C3AED; color: #5B21B6;
  box-shadow: inset 0 0 12px rgba(124,58,237,.16);
}
.jstep:not(:last-child)::before { background: #DCE4F2; }
.jstep[data-state="done"]:not(:last-child)::before {
  background: linear-gradient(180deg, #7C3AED, rgba(124,58,237,.25));
}
.jstep[data-state="current"]:not(:last-child)::before {
  background: linear-gradient(180deg, rgba(124,58,237,.55), #DCE4F2);
}
.jstep__eyebrow { color: #93A0BE; }
.jstep[data-state="done"] .jstep__eyebrow { color: #7C3AED; }
.jstep[data-state="current"] .jstep__eyebrow { color: #5B21B6; }
.jstep__title { color: #93A0BE; }
.jstep[data-state="done"] .jstep__title,
.jstep[data-state="current"] .jstep__title { color: #101828; }
.jstep__sub { color: #93A0BE; }
.senti { border-top-color: #E4E9F4; }
.senti__trackarc { stroke: #E2E8F4; }
.senti__hub { fill: #FFFFFF; stroke: #E4E9F4; }
.senti__num { fill: #101828; }
.senti[data-mood="pos"] .senti__num { fill: #1FA85C; }
.senti[data-mood="neg"] .senti__num { fill: #E41E54; }
.senti__cap { fill: #93A0BE; }
.senti__ends { color: #93A0BE; }

/* waiting panel goes light (full-circle to the original) */
.empty {
  background:
    radial-gradient(640px 320px at 50% -8%, rgba(124,58,237,.1), transparent 62%),
    linear-gradient(180deg, #FFFFFF, #F4F8FE);
  --w-ink:   #0B1220;
  --w-body:  #26314B;
  --w-muted: #5A6785;
  --w-line:  #E4E9F5;
  --w-tint:  #EEF4FE;
  --w-blue:  #5B21B6;
}
.waiting__badge {
  color: #5B21B6;
  background: linear-gradient(135deg, rgba(192,132,252,.14), rgba(124,58,237,.14));
  border-color: rgba(124,58,237,.3);
  box-shadow: 0 0 24px rgba(124,58,237,.12);
}
.dialin {
  background: linear-gradient(180deg, #FFFFFF, #FAFCFF);
  border-color: #E4E9F5;
  box-shadow: 0 10px 28px rgba(16,24,40,.08);
}
.dialin__num {
  color: #0B1220;
  background: #EEF4FE;
  box-shadow: inset 0 0 0 1px rgba(124,58,237,.25);
}
.dialin__num svg { color: #7C3AED; }
.works__list li::before {
  color: #fff; background: #7C3AED;
  border-color: rgba(124,58,237,.4);
  box-shadow: 0 0 8px rgba(124,58,237,.35);
}
.try { color: #5B21B6; background: #EEF4FE; border-color: rgba(124,58,237,.3); }
.empty::-webkit-scrollbar-thumb { background: #CBD5EA; }

/* footer + conn on light */
.app__footer { color: #93A0BE; }
.conn[data-conn="live"]  .conn__dot { background: #1FA85C; box-shadow: none; }
.conn[data-conn="mock"]  .conn__dot { background: #0E8F87; box-shadow: none; }
.conn[data-conn="connecting"] .conn__dot { background: #7C3AED; }
.conn[data-conn="live"]  .conn__label { color: #1FA85C; }
.conn[data-conn="mock"]  .conn__label { color: #0E8F87; }
.btn-clear { background: rgba(16,24,40,.85); border-color: rgba(16,24,40,.2); }

/* mood tag emoji sizing */
.mood em, .chip em { font-style: normal; font-size: 1.05em; line-height: 1; }

/* ── CALL SUMMARY — the catchy branded gradient card ── */
.summary {
  background:
    radial-gradient(560px 200px at 88% -30%, rgba(192,132,252,.35), transparent 60%),
    linear-gradient(120deg, #5B21B6 0%, #7C3AED 46%, #A855F7 100%);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 18px 44px rgba(91,33,182,.35), inset 0 1px 0 rgba(255,255,255,.5);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.summary__title { color: #FFFFFF; }
.summary__note  { color: rgba(255,255,255,.92); }
.summary__k     { color: rgba(255,255,255,.65); }
.summary__v     { color: #FFFFFF; }
.summary__na    { color: rgba(255,255,255,.6); }
.summary .chip--positive,
.summary .chip--neutral,
.summary .chip--negative {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.45);
  color: #FFFFFF;
}
.summary__spark .summary__k { color: rgba(255,255,255,.65); }
.summary__spark svg polyline[fill] { fill: rgba(255,255,255,.2); }

/* white logo → dark silhouette on the light header */
.brand__logo { filter: brightness(0) opacity(.82); }

/* v15 — kill the dark edge-shadows on the light page */
.stage {
  border-color: #E7ECF5;
  box-shadow: 0 10px 28px rgba(16,24,40,.07), inset 0 1.5px 0 #FFFFFF;
}
.journey, .procflow {
  border-color: #E7ECF5;
  box-shadow: 0 10px 28px rgba(16,24,40,.06);
}
.app__header { box-shadow: 0 4px 16px rgba(16,24,40,.05); }
.btn-clear { box-shadow: 0 6px 16px rgba(16,24,40,.18); }

/* ── v17 · Top bar = proucx.com main-site chrome ─────────────────────── */
.app__header {
  background: rgba(21,8,38,.92);
  border-color: #3A2A5C;
  box-shadow: 0 14px 34px rgba(21,8,38,.18);
  font-family: Roboto, Arial, Helvetica, sans-serif;
}
.brand__logo { height: 40px; filter: none; }
.agent__name { color: #FFFFFF; font-family: Roboto, Arial, Helvetica, sans-serif; font-weight: 700; }
.agent__tag  { color: #C9D2E8; }
.agent__provider { background: #1D0F33; border: 1px solid #3A2A5C; color: #C9D2E8; }
.agent__provider .dot { background: #C084FC; }
.callstate { background: #1D0F33; border-color: #3A2A5C; color: #C9D2E8; }
.callstate[data-state="idle"] .callstate__dot { background: #64719C; }
.callstate[data-state="live"] {
  background: linear-gradient(180deg, #7C3AED, #4632DA);
  border-color: rgba(124,58,237,.65);
  color: #FFFFFF;
}
.callstate[data-state="live"] .callstate__dot { background: #C084FC; }
.callstate[data-state="ended"] { color: #AEB6CC; border-color: #3A2A5C; background: #1D0F33; }
.callstate[data-state="ended"] .callstate__dot { background: #AEB6CC; }

/* ── v18 · Footer connection chip (pill + live call timer) ───────────── */
.app__footer .conn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #E1E8F4;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(16,24,40,.05);
  gap: 9px;
}
.conn__div { width: 1px; height: 14px; background: #E1E8F4; display: inline-block; }
.conn__timer {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
  color: #7A86A3;
}
.conn__timer[data-active="1"] { color: #157A43; }
.conn[data-conn="live"]  { border-color: rgba(31,168,92,.38); background: rgba(31,168,92,.05); }
.conn[data-conn="live"] .conn__label { color: #157A43; }
.conn[data-conn="live"] .conn__dot {
  background: #1FA85C;
  box-shadow: none;
  animation: connPulse 1.8s ease-out infinite;
}
.conn[data-conn="mock"]  { border-color: rgba(168,85,247,.4); background: rgba(168,85,247,.05); }
.conn[data-conn="mock"] .conn__label { color: #0B8FA0; }
.conn[data-conn="mock"] .conn__dot {
  background: #A855F7;
  box-shadow: none;
  animation: connPulseCyan 1.8s ease-out infinite;
}
.conn[data-conn="mock"] .conn__timer[data-active="1"] { color: #0B8FA0; }
.conn[data-conn="connecting"] { border-color: #D8DFEE; }
.conn[data-conn="error"] { border-color: rgba(255,32,105,.4); background: rgba(255,32,105,.04); }
.conn[data-conn="error"] .conn__label { color: #C81E5B; }
@keyframes connPulse {
  0%   { box-shadow: 0 0 0 0 rgba(31,168,92,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(31,168,92,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,168,92,0); }
}
@keyframes connPulseCyan {
  0%   { box-shadow: 0 0 0 0 rgba(168,85,247,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(168,85,247,0); }
  100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
}

/* ── v19 · Process flow behind a header toggle button ─────────────────── */
.app__header { grid-template-columns: auto 1fr auto auto; }
.procbtn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid #3A2A5C;
  background: #1D0F33;
  color: #C9D2E8;
  font: 600 .85rem/1 Roboto, Arial, Helvetica, sans-serif;
  letter-spacing: .2px;
  cursor: pointer;
  transition: border-color .25s ease, background .25s ease, color .25s ease;
}
.procbtn:hover { border-color: #7C3AED; color: #FFFFFF; }
.procbtn[hidden] { display: none; }
.procbtn__ic { width: 15px; height: 15px; }
.procbtn__count { font-style: normal; font-weight: 700; color: #C084FC; }
.procbtn.is-on {
  background: linear-gradient(180deg, #7C3AED, #4632DA);
  border-color: rgba(124,58,237,.65);
  color: #FFFFFF;
}
.procbtn.is-on .procbtn__count { color: #FFFFFF; }
/* rail collapsed by default — the stage takes the width until the user opens it */
.stageframe { grid-template-columns: 236px minmax(0,1fr); }
body.proc-open .stageframe { grid-template-columns: 236px minmax(0,1fr) 292px; }
@media (max-width: 1360px) {
  .procbtn { display: none !important; }
  body.proc-open .stageframe { grid-template-columns: 236px minmax(0,1fr); }
}

/* ── v20 · Gear button + agent settings panel ─────────────────────────── */
.app__header { grid-template-columns: auto 1fr auto auto auto; }
.gearbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid #3A2A5C;
  background: #1D0F33;
  color: #C9D2E8;
  cursor: pointer;
  transition: border-color .25s ease, color .25s ease, transform .4s ease;
}
.gearbtn:hover { border-color: #7C3AED; color: #FFFFFF; transform: rotate(40deg); }
.gearbtn svg { width: 18px; height: 18px; }
.settings {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  background: rgba(21,8,38,.45);
  backdrop-filter: blur(4px);
}
.settings[hidden] { display: none; }
.settings__card {
  width: min(440px, calc(100vw - 40px));
  background: #FFFFFF;
  border: 1px solid #E7ECF5;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(21,8,38,.35);
  padding: 22px 24px 20px;
  font-family: Roboto, Arial, Helvetica, sans-serif;
  color: #1C2540;
}
.settings__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.settings__head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: .2px; }
.settings__x {
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid #E1E8F4; background: #F7F9FC;
  color: #5A6684; font-size: .8rem; line-height: 1;
}
.settings__x:hover { border-color: #7C3AED; color: #7C3AED; }
.set__lab { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7A86A3; margin: 12px 0 0; }
.set__lab select, .set__lab input, .set__custom {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #D8DFEE; border-radius: 10px;
  background: #FFFFFF; color: #1C2540;
  font: 500 .9rem/1.2 Roboto, Arial, Helvetica, sans-serif;
}
.set__custom { margin-top: 8px; }
.set__lab select:focus, .set__lab input:focus, .set__custom:focus { outline: 2px solid rgba(124,58,237,.45); outline-offset: 1px; border-color: #7C3AED; }
.settings__status { margin-top: 14px; font-size: .82rem; color: #5A6684; min-height: 1.2em; }
.settings__status.is-bad { color: #C81E5B; }
.settings__row { margin-top: 14px; display: flex; justify-content: flex-end; }
.settings__apply {
  border: 0; cursor: pointer;
  padding: 11px 20px; border-radius: 999px;
  background: linear-gradient(180deg, #7C3AED, #4632DA);
  color: #FFFFFF; font: 600 .88rem/1 Roboto, Arial, Helvetica, sans-serif; letter-spacing: .2px;
}
.settings__apply:hover { opacity: .92; }
@media (max-width: 1360px) { .gearbtn { display: none; } }
.set__custom[hidden] { display: none; }

/* ── v21 · Left rail (journey + sentiment) back to Orion dark — user request ── */
.journey {
  background: linear-gradient(180deg, #120A24 0%, #0A0514 100%);
  border-color: #251743;
  box-shadow: 0 18px 44px rgba(3,6,16,.5);
}
.journey .jstep__title { color: #FFFFFF; }
.journey .jstep__sub   { color: #7E88A6; }
.journey .jstep__eyebrow { color: #6F7A99; }
.journey .jstep[data-state="done"] .jstep__eyebrow,
.journey .jstep[data-state="current"] .jstep__eyebrow { color: #7C3AED; }
.journey .jstep__ring {
  background: #160C2C;
  border-color: #7C3AED;
  color: #EAF1FF;
  box-shadow: 0 0 0 4px rgba(124,58,237,.10), 0 0 18px rgba(124,58,237,.30);
}
.journey .jstep[data-state="upcoming"] .jstep__ring {
  background: #140B26;
  border-color: #302050;
  color: #6F7A99;
  box-shadow: none;
}
.journey .jstep:not(:last-child)::before { background: #2A1C47; }
.journey .jstep[data-state="done"]:not(:last-child)::before,
.journey .jstep[data-state="current"]:not(:last-child)::before {
  background: linear-gradient(180deg, #7C3AED, rgba(124,58,237,.12));
}
.journey .senti { border-color: rgba(255,255,255,.08); }
.journey .senti__trackarc { stroke: #2E2052; }
.journey .senti__hub { fill: #140B26; stroke: #2A1C47; }
.journey .senti__num { fill: #FFFFFF; }
.journey .senti__cap { fill: #7E88A6; }
.journey .senti__ends { color: #7E88A6; }
.journey .jstep[data-state="done"] .jstep__title,
.journey .jstep[data-state="current"] .jstep__title { color: #FFFFFF; }
.journey .jstep[data-state="current"] .jstep__sub { color: #9AA6C4; }

/* ── v22 · Speaking-style tag chips in the settings panel ─────────────── */
.set__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tagchip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #D8DFEE;
  background: #F7F9FC;
  color: #3C4763;
  font: 600 .78rem/1 Roboto, Arial, Helvetica, sans-serif;
  letter-spacing: .2px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.tagchip:hover { border-color: #7C3AED; color: #7C3AED; }
.tagchip.is-on {
  background: linear-gradient(180deg, #7C3AED, #4632DA);
  border-color: rgba(124,58,237,.65);
  color: #FFFFFF;
}
