:root {
  --bg: #050a18;
  --bg-2: #081026;
  --panel: rgba(13, 20, 40, 0.72);
  --panel-solid: #0c1530;
  --card: rgba(15, 23, 46, 0.78);
  --line: rgba(120, 150, 210, 0.14);
  --line-strong: rgba(120, 160, 230, 0.26);
  --text: #e7ecf7;
  --muted: #8a97b4;
  --dim: #5d6a88;
  --cyan: #38bdf8;
  --teal: #2dd4bf;
  --violet: #a78bfa;
  --indigo: #6366f1;
  --pink: #f0abfc;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #ef4444;
  --grad: linear-gradient(100deg, #0ea5e9 0%, #3b82f6 45%, #6366f1 75%, #8b5cf6 100%);
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  font-family: "Inter", "SF Pro Text", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #0d1b3d 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
svg { width: 18px; height: 18px; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ aurora bg -- */
.aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.aurora span {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: .16; mix-blend-mode: screen;
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: #1d4ed8; left: -20vmax; top: -25vmax; }
.aurora span:nth-child(2) { background: #7c3aed; right: -25vmax; bottom: -30vmax; animation-duration: 34s; }
.aurora span:nth-child(3) { background: #0891b2; left: 30vmax; bottom: -40vmax; animation-duration: 40s; opacity: .10; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

/* ---------------------------------------------------------------- topbar -- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 14px 28px; backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(5, 10, 24, .9), rgba(5, 10, 24, .55));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; position: relative;
  background: conic-gradient(from 200deg, #0ea5e9, #6366f1, #a78bfa, #0ea5e9);
  box-shadow: 0 0 22px rgba(99, 102, 241, .45);
  animation: spin 9s linear infinite;
}
.brand-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 8px rgba(56,189,248,.6); }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-name { font-weight: 600; letter-spacing: .3px; font-size: 15px; }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--muted);
  transition: all .2s ease; position: relative;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active {
  color: #e0f2fe; border-color: rgba(56,189,248,.55);
  background: linear-gradient(180deg, rgba(14,165,233,.18), rgba(14,165,233,.06));
  box-shadow: 0 0 0 1px rgba(56,189,248,.15), 0 6px 22px rgba(14,165,233,.18);
}
.live-count {
  font-style: normal; font-size: 11px; background: var(--red); color: #fff; border-radius: 99px;
  padding: 0 6px; margin-left: 2px; animation: pulse 1.4s ease-in-out infinite;
}
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.health { display: flex; gap: 5px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.health .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: background .3s; }
.health .dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,.7); }
.health .dot.warn { background: var(--amber); }
.health .dot.err { background: var(--red); }
.lang-switch {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
}
.lang-switch svg { color: var(--cyan); }
.lang-switch select { background: transparent; border: 0; outline: 0; cursor: pointer; width: auto; padding: 0 4px; box-shadow: none; }
.lang-switch option { background: var(--panel-solid); }

main { position: relative; z-index: 1; padding: 22px 28px 40px; }
.view { display: none; animation: fade .35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ agent grid -- */
.agent-grid {
  display: grid; grid-template-columns: minmax(300px, 360px) minmax(420px, 1fr) minmax(290px, 340px);
  gap: 24px; align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(12px); box-shadow: var(--shadow);
  height: calc(100vh - 120px); min-height: 560px; display: flex; flex-direction: column; overflow: hidden;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center; padding: 16px 18px;
  border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase;
  color: #c7d2ea; font-weight: 600;
}
.status-pill { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.status-pill.live i { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.2s infinite; }
.status-pill.live { color: #a7f3d0; }

.messages { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.messages::-webkit-scrollbar, .insights-body::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb, .insights-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 6px; }
.empty-hint { margin: auto; text-align: center; color: var(--dim); }
.empty-hint svg { width: 42px; height: 42px; opacity: .6; }
.empty-hint p { margin: 8px 0 0; font-size: 13px; }

.msg {
  max-width: 88%; padding: 11px 14px; border-radius: 14px; line-height: 1.5; font-size: 14px;
  animation: pop .28s cubic-bezier(.2,.9,.3,1.2); position: relative; word-wrap: break-word;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.agent { align-self: flex-start; background: linear-gradient(160deg, #3b1d5a 0%, #2a1a4d 100%); border: 1px solid rgba(167,139,250,.22); border-top-left-radius: 4px; }
.msg.user { align-self: flex-end; background: linear-gradient(160deg, #0f2a44 0%, #0c2138 100%); border: 1px solid rgba(56,189,248,.22); border-top-right-radius: 4px; }
.msg.user.backchannel { opacity: .6; font-style: italic; }
.msg.user.partial { opacity: .75; font-style: italic; border-style: dashed; }
.msg.user.partial::after { content: " …"; color: var(--cyan); }
.msg.cut::after { content: "✂"; position: absolute; right: -6px; bottom: -8px; font-size: 12px; background: var(--amber); color: #111; border-radius: 99px; padding: 1px 5px; }
.msg .meta { display: block; margin-top: 5px; font-size: 10.5px; color: rgba(231,236,247,.45); }
.msg.typing::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--violet); margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.speaking-chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 12px;
}
.speaking-chip.user { align-self: flex-end; }
.speaking-chip b { display: inline-flex; gap: 3px; }
.speaking-chip b i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); animation: bounce 1.1s infinite ease-in-out; }
.speaking-chip b i:nth-child(2) { animation-delay: .15s; }
.speaking-chip b i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
.tool-chip {
  align-self: center; font-size: 11.5px; color: #c4b5fd; border: 1px dashed rgba(167,139,250,.35);
  padding: 4px 10px; border-radius: 99px; background: rgba(139,92,246,.07); animation: pop .3s ease;
}
.tool-chip.err { color: #fca5a5; border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.06); }
.sys-note { align-self: center; font-size: 11.5px; color: var(--dim); }

/* ----------------------------------------------------------------- stage -- */
.stage { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage-head { margin-top: 4px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #9fb4da; font-size: 14px; }
.eyebrow svg { color: var(--cyan); }
.title {
  margin: 4px 0 8px; font-size: 42px; font-weight: 700; letter-spacing: -1px; line-height: 1.05;
  background: linear-gradient(90deg, #7dd3fc 0%, #93c5fd 40%, #c4b5fd 70%, #f0abfc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer { to { background-position: 100% 0; } }
.badges { display: flex; gap: 8px; justify-content: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px;
  border: 1px solid var(--line-strong); background: rgba(56,189,248,.06); color: #cfe3ff; font-weight: 500;
}
.badge svg { width: 15px; height: 15px; color: var(--cyan); }
.badge.bucket.b1 { color: #a7f3d0; border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.badge.bucket.b2 { color: #fde68a; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.badge.bucket.b3 { color: #fecaca; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.08); }

.orb-wrap { position: relative; width: min(340px, 80%); aspect-ratio: 1; margin: -4px 0 -18px; }
#orb { width: 100%; height: 100%; display: block; }
.orb-timer {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); font-variant-numeric: tabular-nums;
  font-size: 12.5px; color: #9fb4da; padding: 3px 10px; border-radius: 99px; background: rgba(5,10,24,.6); border: 1px solid var(--line);
}
.state-line { min-height: 22px; font-size: 15px; color: #c9d6f2; margin-bottom: 8px; transition: color .3s; }
.state-line.err { color: #fca5a5; }
.latency-chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; justify-content: center; animation: fade .4s ease; }
.latency-chips span {
  display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 4px 10px; border-radius: 99px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
}
.latency-chips b { color: var(--muted); font-weight: 500; }
.latency-chips i { font-style: normal; font-variant-numeric: tabular-nums; color: #dbeafe; }
.latency-chips .total { border-color: rgba(52,211,153,.35); }
.latency-chips .total i { color: #6ee7b7; }

.setup { width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px; text-align: left; transition: opacity .3s, max-height .4s; }
.setup.locked { opacity: .45; pointer-events: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.card.row2 { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
.voice-row { display: flex; gap: 8px; }
.voice-row .select-wrap { flex: 1; }
.btn-round.sm { width: 44px; height: 44px; flex: none; }
.btn-round.sm.playing { color: var(--cyan); border-color: rgba(56,189,248,.6); box-shadow: 0 0 12px rgba(56,189,248,.35); }
.lbl { display: block; font-size: 13.5px; color: #dbe4f6; margin-bottom: 8px; font-weight: 500; }
.lbl em { color: var(--muted); font-style: normal; font-weight: 400; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select, input, textarea {
  width: 100%; background: rgba(3, 7, 18, .75); border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 11px 14px; outline: none; transition: border-color .2s, box-shadow .2s; appearance: none;
}
select:focus, input:focus, textarea:focus { border-color: rgba(56,189,248,.6); box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
select option { background: var(--panel-solid); }
textarea { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.55; resize: vertical; }
.hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(3,7,18,.6); border: 1px solid var(--line); margin-bottom: 14px; }
.seg button { flex: 1; display: flex; gap: 7px; align-items: center; justify-content: center; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transition: all .2s; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: rgba(56,189,248,.14); color: #e0f2fe; box-shadow: inset 0 0 0 1px rgba(56,189,248,.35); }
.debtor-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.debtor-mini div { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.debtor-mini small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.debtor-mini b { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

.call-actions { display: flex; gap: 10px; width: min(520px, 100%); margin-top: 16px; }
.btn-call {
  flex: 1; display: flex; gap: 10px; align-items: center; justify-content: center; border: 0; border-radius: 999px;
  padding: 16px 22px; font-size: 16.5px; font-weight: 600; color: #fff; background: var(--grad); background-size: 160% 100%;
  box-shadow: 0 12px 34px rgba(59,130,246,.38); transition: transform .15s, box-shadow .2s, background-position .6s;
}
.btn-call:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 16px 40px rgba(99,102,241,.45); }
.btn-call:active { transform: translateY(1px) scale(.99); }
.btn-call:disabled { opacity: .6; cursor: progress; }
.btn-call.hang { background: linear-gradient(100deg, #ef4444, #dc2626); box-shadow: 0 12px 34px rgba(239,68,68,.35); }
.btn-call.small { flex: none; padding: 10px 18px; font-size: 14px; }
.btn-round { width: 54px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); display: grid; place-items: center; transition: all .2s; }
.btn-round.on { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.5); color: #fecaca; }
.btn-round.ghost { color: var(--cyan); }
.btn-round:hover { border-color: rgba(56,189,248,.5); }
.headset-tip { font-size: 12px; color: var(--dim); margin: 10px 0 0; }

/* -------------------------------------------------------------- insights -- */
.insights-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.outcome-pill { text-transform: none; letter-spacing: 0; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: rgba(52,211,153,.12); color: #a7f3d0; border: 1px solid rgba(52,211,153,.35); }
.outcome-pill.bad { background: rgba(239,68,68,.1); color: #fecaca; border-color: rgba(239,68,68,.4); }
.outcome-pill.mid { background: rgba(251,191,36,.1); color: #fde68a; border-color: rgba(251,191,36,.4); }
.steps { list-style: none; margin: 0; padding: 4px 4px 4px 2px; display: flex; flex-direction: column; gap: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--dim); position: relative; transition: color .3s; }
.steps li i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(120,150,210,.28); flex: none; position: relative; z-index: 1; background: var(--panel-solid); transition: all .35s; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 9px; top: 28px; height: calc(100% - 20px); width: 2px; background: rgba(120,150,210,.15); }
.steps li.active { color: #e0f2fe; }
.steps li.active i { border-color: var(--cyan); box-shadow: 0 0 0 5px rgba(56,189,248,.12), 0 0 14px rgba(56,189,248,.6); animation: pulse 1.6s infinite; }
.steps li.done { color: #c9f5e3; }
.steps li.done i { border-color: var(--green); background: var(--green); }
.steps li.done i::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid #04131f; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.steps li.fail i { border-color: var(--red); background: var(--red); }
.steps li.fail { color: #fecaca; }
@keyframes pulse { 50% { opacity: .55; } }
.ins-card { background: rgba(255,255,255,.028); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; animation: pop .35s ease; }
.ins-label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ins-value { font-weight: 600; font-size: 15px; }
.ins-quote { color: #aebbd8; font-size: 13px; margin-top: 4px; font-style: italic; }
.promise { border-color: rgba(52,211,153,.3); background: linear-gradient(160deg, rgba(16,185,129,.1), rgba(16,185,129,.02)); }
.promise-amount { font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.promise-meta { color: #b6f0d8; font-size: 13px; margin-top: 2px; }
.strength { text-transform: none; letter-spacing: 0; font-size: 11px; padding: 1px 8px; border-radius: 99px; }
.strength.firm { background: rgba(52,211,153,.2); color: #6ee7b7; }
.strength.tentative { background: rgba(251,191,36,.18); color: #fcd34d; }
.req-list, .tool-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.req-list li { font-size: 13px; display: flex; gap: 8px; align-items: center; }
.req-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.tool-log li { font-size: 12px; color: #b9c5de; display: grid; grid-template-columns: auto 1fr; gap: 8px; animation: pop .3s ease; }
.tool-log li time { color: var(--dim); font-variant-numeric: tabular-nums; }
.tool-log li code { font-family: ui-monospace, Menlo, monospace; color: #c4b5fd; font-size: 11.5px; }
.tool-log li.muted { color: var(--dim); display: block; }

/* ----------------------------------------------------------------- pages -- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2, .stt-wrap h2 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.filters { display: flex; gap: 10px; align-items: center; }
.chips { display: flex; gap: 6px; }
.chip { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); }
.chip.on { color: #e0f2fe; border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.12); }
.search { width: 220px; padding: 8px 12px; }
.table-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; backdrop-filter: blur(10px); }
.card-title { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; color: #c7d2ea; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.015); }
.table td { padding: 12px 16px; border-bottom: 1px solid rgba(120,150,210,.07); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(56,189,248,.04); }
.table tbody tr.click { cursor: pointer; }
.who b { display: block; font-weight: 600; }
.who small { color: var(--muted); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.pill { display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-strong); color: #cbd5e1; white-space: nowrap; }
.pill.b1, .pill.good { color: #a7f3d0; border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.07); }
.pill.b2, .pill.mid { color: #fde68a; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.07); }
.pill.b3, .pill.bad { color: #fecaca; border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.07); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-sm { display: inline-flex; gap: 6px; align-items: center; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); font-size: 12.5px; transition: all .15s; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-sm:hover { border-color: rgba(56,189,248,.55); color: #e0f2fe; }
.btn-sm.primary { background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.5); }
.btn-sm:disabled { opacity: .4; cursor: not-allowed; }
.muted { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(56,189,248,.18), transparent 70%); }
.stat small { color: var(--muted); font-size: 12px; }
.stat b { display: block; font-size: 26px; margin-top: 4px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.outcome-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin-bottom: 16px; background: rgba(255,255,255,.04); }
.outcome-bar span { height: 100%; transition: width .6s ease; }

.live-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.active-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.active-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); animation: pop .3s ease; }
.active-item .blip { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1s infinite; margin-right: 10px; }
.live-feed { list-style: none; margin: 0; padding: 10px 14px; max-height: 60vh; overflow-y: auto; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.live-feed li { display: grid; grid-template-columns: 70px 90px 1fr; gap: 8px; color: #b9c5de; animation: pop .25s ease; }
.live-feed li time { color: var(--dim); font-variant-numeric: tabular-nums; }
.live-feed li em { font-style: normal; color: var(--cyan); }
.dialer { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 13px; }

.stt-wrap { max-width: 820px; margin: 0 auto; }
.pron-card { margin-top: 16px; }
.pron-card textarea { font-family: inherit; font-size: 16px; }
.pron-card code { color: #c4b5fd; }
.pron-card td input { padding: 8px 10px; }
.stt-controls { display: flex; gap: 12px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.select-wrap.small select { padding: 9px 36px 9px 12px; }
.vu canvas { display: block; border-radius: 8px; background: rgba(3,7,18,.6); border: 1px solid var(--line); }
.stt-provider { color: var(--muted); font-size: 12.5px; }
.stt-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.stt-results li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; animation: pop .3s ease; display: flex; justify-content: space-between; gap: 16px; }
.stt-results li span { font-size: 16px; }
.stt-results li small { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stt-results li.pending span { color: var(--dim); }

/* --------------------------------------------------------- drawer/modal -- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-bg { position: absolute; inset: 0; background: rgba(2,6,16,.6); backdrop-filter: blur(3px); animation: fade .2s; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(620px, 100%); background: var(--panel-solid); border-left: 1px solid var(--line-strong); padding: 26px; overflow-y: auto; animation: slide .3s cubic-bezier(.2,.9,.3,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-x { position: absolute; right: 18px; top: 14px; font-size: 26px; border: 0; background: none; color: var(--muted); }
.drawer h3 { margin: 0 0 6px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 16px 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.transcript { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(2,6,16,.7); backdrop-filter: blur(4px); }
.modal-card { background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 18px; padding: 24px; width: min(380px, 92%); display: flex; flex-direction: column; gap: 12px; }
.modal-card h3 { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 70; background: #1e293b; border: 1px solid var(--line-strong); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); animation: pop .3s ease; max-width: 90vw; }
.toast.err { border-color: rgba(239,68,68,.5); color: #fecaca; }

@media (max-width: 1280px) {
  .agent-grid { grid-template-columns: minmax(280px, 330px) 1fr; }
  .insights { grid-column: 1 / -1; height: auto; min-height: 0; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .tabs { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .health { display: none; }
  main { padding: 16px; }
  .agent-grid { grid-template-columns: 1fr; }
  .panel.convo { height: 360px; min-height: 0; order: 2; }
  .insights { order: 3; }
  .title { font-size: 34px; }
  .card.row2 { grid-template-columns: 1fr; }
  .live-grid { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
