/* The simulated AI agent call: incoming card, call view and the strip over the planner. */
:root { --live: #c41038; --cust: #eef0f6; }

/* Incoming call */
.ring { position: fixed; top: 60px; right: 20px; z-index: 50; width: 340px; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(35, 28, 62, .4); animation: ring-in .35s var(--ease-out); }
.ring.out { animation: ring-out .24s ease-in forwards; }
.ring-top { display: flex; align-items: center; gap: 11px; }
.ring-top b { display: block; font-family: 'Outfit', sans-serif; font-size: 16px; }
.ring-top span { font-size: 12px; color: var(--muted); }
.ring-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; color: #fff; background: var(--ok); border-radius: 50%; animation: ring-pulse 1.1s ease-out infinite; }
.ring-ic .i { width: 20px; height: 20px; animation: ring-shake 1.1s ease-in-out infinite; }
.ring-car { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.ring-acts { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ring-agent { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.ring-agent.on { color: var(--brand); }
@keyframes ring-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes ring-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes ring-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 107, 42, .45); } 100% { box-shadow: 0 0 0 14px rgba(37, 107, 42, 0); } }
@keyframes ring-shake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }

/* Live badge */
.live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--live); background: #fdeaee; border-radius: 999px; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: live-blink 1.2s infinite; }
.live.paused { color: var(--amber); background: var(--amber-bg); }
.live.paused::before, .live.off::before { animation: none; }
.live.off { color: var(--muted); background: #f1f0f4; }
@keyframes live-blink { 50% { opacity: .25; } }

/* Call view in the main area */
.call-v { height: 100%; display: flex; flex-direction: column; background: #fff; }
.call-none { margin: auto; color: var(--muted); }
.call-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.call-h b { font-family: 'Outfit', sans-serif; font-size: 17px; }
.call-h .muted { font-size: 12.5px; color: var(--muted); }
.call-h .sp, .call-f .sp { flex: 1; }
.call-by { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.call-tx { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 20px 24px 28px; scrollbar-width: thin; }
.tx-line { max-width: min(76%, 640px); padding: 10px 14px; font-size: 15px; line-height: 22px; border-radius: 16px; }
.tx-line small { display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tx-line.agent { align-self: flex-start; background: var(--brand-50); border-bottom-left-radius: 4px; }
.tx-line.customer { align-self: flex-end; background: var(--cust); border-bottom-right-radius: 4px; }
.tx-act { align-self: center; display: inline-flex; align-items: center; gap: 7px; max-width: 86%; padding: 4px 12px; font-size: 12.5px; color: var(--ink-2); background: #fff; border: 1px dashed var(--brand-200); border-radius: 999px; }
.tx-act.done { color: var(--brand); }
.tx-act .i { color: var(--ok); }
.tx-tail { min-height: 22px; }
.tx-speaking { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.tx-speaking.customer { float: right; }
.tx-speaking i { width: 3px; height: 12px; background: var(--brand); border-radius: 2px; animation: speak .8s infinite ease-in-out; }
.tx-speaking.customer i { background: #8a8fa8; }
.tx-speaking i:nth-child(2) { animation-delay: .15s; }
.tx-speaking i:nth-child(3) { animation-delay: .3s; margin-right: 5px; }
@keyframes speak { 50% { transform: scaleY(.35); } }
.call-f { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); }
.call-f .muted { font-size: 12px; color: var(--muted); }

/* Strip over the planner */
.content { position: relative; }
.call-strip { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px -12px rgba(35, 28, 62, .38); animation: ring-in .3s var(--ease-out); }
.content:has(#chat:not(.hide)) .call-strip { right: calc(var(--chat-w) + 16px); }
.call-strip.out { animation: ring-out .24s ease-in forwards; }
.call-strip .strip-n { font-family: 'Outfit', sans-serif; white-space: nowrap; }
.call-strip .muted { font-size: 12px; color: var(--muted); }
.strip-line { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; font-size: 13px; color: var(--ink-2); }
.strip-line .strip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-line b { white-space: nowrap; }

/* Copilot while the agent drives it */
.chat.agent .chat-b button:not([data-a="call-open"]):not([data-a="chat-steps"]), .chat.agent .chat-b input, .chat.agent .chat-b select { pointer-events: none; }
.agent-note { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--brand-50); border-radius: 10px; }
.agent-note.done { color: var(--ink-2); background: #f4f3f7; font-weight: 500; }
.agent-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--brand); animation: live-blink 1s infinite; }
.call-sum .bk-h { margin-bottom: -4px; }

@media (max-width: 900px) {
  .ring { left: 16px; right: 16px; width: auto; }
  .call-tx { padding: 16px; }
  .tx-line { max-width: 90%; }
  .call-strip .strip-line { display: none; }
}

/* Swap request: the advisor approves before anyone is contacted */
.swap { gap: 8px; border-color: #f0d39b; }
.swap.done { border-color: var(--line); }
.swap-moves { padding: 9px 11px; font-size: 12.5px; background: #fffbf1; border-radius: 8px; }
.swap-moves ul { margin: 4px 0 0; padding-left: 18px; }
.swap-moves li { margin-bottom: 2px; }
.swap-dead { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--amber); }
.swap-st { font-weight: 600; color: var(--ink-2); }
.swap.done .swap-st { color: var(--ok); }
.ring-ic.out { background: var(--brand); animation: none; }
.ring-ic.out .i { animation: none; }
