/* ==========================================================================
   Real cases showcase: the call screen (a replica of the product's), the
   "On your screen" panel, the chat components, and the case gallery.
   Logical properties throughout, so RTL needs no overrides.
   ========================================================================== */

.pa-root { --pa-indigo: #818cf8; --pa-indigo-2: #a5b4fc; --pa-emerald: #34d399; --pa-rose: #f43f5e; --pa-amber: #fbbf24;
  --pa-glass: rgba(15, 23, 42, 0.72); --pa-line: rgba(255, 255, 255, 0.09); }

/* ---- Case tabs -------------------------------------------------------- */
.pa-case-tabs { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pa-case-tab { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 1rem 0.45rem 0.45rem; padding-inline: 0.45rem 1rem;
  border-radius: 999px; border: 1px solid var(--border-color); background: rgba(255,255,255,0.03); color: var(--text-secondary);
  text-align: start; transition: border-color .2s, background .2s, color .2s; }
.pa-case-tab img { width: 44px; height: 44px; border-radius: 50%; background: #1e293b; flex-shrink: 0; }
.pa-case-tab b { display: block; color: var(--text-primary); font-size: 0.92rem; }
.pa-case-tab small { display: block; font-size: 0.74rem; opacity: .75; max-width: 12.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-case-tab:hover { border-color: rgba(96,165,250,.55); color: var(--text-primary); }
.pa-case-tab[aria-selected="true"] { background: rgba(59,130,246,.16); border-color: var(--primary-light); color: var(--text-primary);
  box-shadow: 0 10px 30px -18px rgba(59,130,246,.9); }

/* ---- Stage: phone + side panel ---------------------------------------- */
.pa-stage { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.pa-side { min-width: 0; }
@media (max-width: 767.98px) {
  /* One row that scrolls sideways, rather than four stacked tabs before the call */
  .pa-case-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; margin-inline: -12px; padding-inline: 12px; }
  .pa-case-tabs::-webkit-scrollbar { display: none; }
  .pa-case-tab { flex-shrink: 0; }
  .pa-case-tab small { max-width: 9.5rem; }
}
@media (max-width: 991.98px) {
  /* minmax(0, …): a long badge row or card must not widen the page */
  .pa-stage { grid-template-columns: minmax(0, 1fr); }
  .pa-phone { max-width: 360px; margin-inline: auto; width: 100%; }
}

.pa-phone { position: relative; }
.pa-summary { margin-bottom: 1rem; }
.pa-sum-title { font-weight: 700; font-size: 1.15rem; color: var(--text-primary); margin: 0 0 .25rem; }
.pa-sum-text { color: var(--text-secondary); margin: 0 0 .6rem; font-size: .93rem; }
.pa-caps { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---- Capability badge -------------------------------------------------- */
.pa-cap { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 600;
  letter-spacing: .02em; color: #ccfbf1; background: rgba(45,212,191,.1); border: 1px solid rgba(45,212,191,.35); white-space: nowrap; }
.pa-cap i { font-size: .72rem; color: var(--accent-color); }
.pa-cap-approval, .pa-cap-otp { color: #fde68a; background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.38); }
.pa-cap-approval i, .pa-cap-otp i { color: var(--pa-amber); }
.pa-cap-kb { color: #c7d2fe; background: rgba(129,140,248,.12); border-color: rgba(129,140,248,.4); }
.pa-cap-kb i { color: var(--pa-indigo-2); }

/* ---- Call screen (VoiceCallOverlay replica) ---------------------------- */
.pa-call { position: relative; overflow: hidden; color: #fff; aspect-ratio: 9 / 17.5; max-height: 720px; width: 100%;
  border-radius: 2.4rem; border: 8px solid #0b1120; background: linear-gradient(180deg, #020617 0%, #0f172a 50%, #1e1b4b 100%);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06); display: flex; flex-direction: column; }
.pa-call-glow { position: absolute; inset: 0; pointer-events: none; opacity: .4; transition: opacity .6s ease;
  background: radial-gradient(circle at 50% 38%, rgba(99,102,241,.28), transparent 60%); }
.pa-call[data-status="speaking"] .pa-call-glow { opacity: 1; }

.pa-call-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.1rem 1.2rem 0;
  font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #94a3b8; }
.pa-call[lang="ar"] .pa-call-head { letter-spacing: 0; font-size: .72rem; }
.pa-live { display: inline-flex; align-items: center; gap: .45rem; }
.pa-live i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--pa-emerald); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pa-pulse 2s infinite; }
.pa-langs { display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255,255,255,.08); letter-spacing: 0; }
.pa-langs button { border: 0; background: none; color: #cbd5e1; font-size: .66rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.pa-langs button.on { background: #fff; color: #0f172a; }
.pa-timer { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; font-size: .72rem; color: #cbd5e1; }

.pa-call-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .5rem 1.2rem; text-align: center; }
.pa-orb-wrap { position: relative; width: 62%; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 1rem; }
.pa-orb { position: relative; width: 78%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #1e293b;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15), 0 20px 40px -12px rgba(0,0,0,.7); }
.pa-avatar-host, .pa-avatar-host .pa-avatar { position: absolute; inset: 0; }
.pa-avatar { position: relative; overflow: hidden; width: 100%; height: 100%; }
.pa-avatar > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pa-avatar-fallback { width: 100%; height: 100%; object-fit: cover; }
.pa-ripple { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(165,180,252,.5); opacity: 0; }
.pa-call[data-status="speaking"] .pa-ripple { animation: pa-ripple 2.1s cubic-bezier(.2,.6,.4,1) infinite; }
.pa-call[data-status="speaking"] .pa-ripple:nth-child(2) { animation-delay: .7s; }
.pa-call[data-status="speaking"] .pa-ripple:nth-child(3) { animation-delay: 1.4s; }
.pa-call[data-status="thinking"] .pa-orb::after,
.pa-call[data-status="ringing"] .pa-orb::after { content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(165,180,252,.9)); -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%);
  mask: radial-gradient(circle, transparent 66%, #000 67%); animation: pa-spin 1.1s linear infinite; }
.pa-call[data-status="listening"] .pa-orb { box-shadow: 0 0 0 2px rgba(52,211,153,.55), 0 0 30px -4px rgba(52,211,153,.55); }

.pa-name { font-size: 1.35rem; font-weight: 700; margin: 0; }
.pa-role { font-size: .74rem; color: #94a3b8; margin: .1rem 0 .3rem; }
.pa-status { display: inline-flex; align-items: center; gap: .45rem; color: #c7d2fe; font-size: .82rem; font-weight: 500; min-height: 1.3rem; margin: 0; }
.pa-bars { display: none; align-items: center; gap: 2px; height: .8rem; }
.pa-call[data-status="speaking"] .pa-bars { display: inline-flex; }
.pa-bars i { width: 3px; height: 100%; border-radius: 2px; background: var(--pa-indigo-2); animation: pa-bar 0.9s ease-in-out infinite; }
.pa-bars i:nth-child(2) { animation-delay: .15s; } .pa-bars i:nth-child(3) { animation-delay: .3s; } .pa-bars i:nth-child(4) { animation-delay: .45s; }

.pa-captions { width: 100%; margin-top: 1rem; padding: .7rem .9rem; border-radius: 1rem; background: rgba(2,6,23,.55);
  border: 1px solid var(--pa-line); backdrop-filter: blur(8px); min-height: 4.6rem; text-align: start; transition: opacity .3s; }
.pa-captions.empty { opacity: .35; }
.pa-captions .who { display: block; font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; margin-bottom: .2rem; }
.pa-call[lang="ar"] .pa-captions .who { letter-spacing: 0; font-size: .7rem; }
.pa-captions .line { margin: 0; font-size: .9rem; line-height: 1.45; font-style: italic; color: #f1f5f9;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.pa-call-foot { position: relative; display: flex; align-items: center; justify-content: center; gap: .65rem; padding: .8rem 1rem 1.3rem; }
.pa-ctl { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #e2e8f0; display: grid; place-items: center; transition: background .2s; }
.pa-ctl:hover, .pa-ctl:focus-visible { background: rgba(255,255,255,.2); }
.pa-ctl-main { width: 3rem; height: 3rem; background: rgba(129,140,248,.3); }
[dir="rtl"] .pa-ctl[data-act="prev"] i, [dir="rtl"] .pa-ctl[data-act="next"] i { transform: scaleX(-1); }
.pa-end { width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0; background: var(--pa-rose); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px rgba(244,63,94,.8); }

.pa-start { position: absolute; inset: 0; z-index: 2; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: .4rem; padding-bottom: 22%; background: linear-gradient(180deg, transparent 30%, rgba(2,6,23,.55) 60%, rgba(2,6,23,.85)); cursor: pointer; }
.pa-start[hidden] { display: none; }
.pa-start-icon { width: 4.2rem; height: 4.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--pa-emerald); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pa-pulse 2s infinite; }
.pa-start-label { font-weight: 700; font-size: 1.05rem; }
.pa-start small { color: #cbd5e1; font-size: .75rem; }

/* ---- Progress ---------------------------------------------------------- */
.pa-progress { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); margin: 1.4rem 0 .3rem; cursor: pointer; }
.pa-progress-bar { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 6px; background: var(--gradient-primary); width: 0; }
.pa-mark { position: absolute; top: -3px; width: 2px; height: 12px; border-radius: 2px; background: rgba(255,255,255,.35); }
.pa-progress-time { position: absolute; right: 0; top: 12px; font-size: .72rem; color: var(--text-muted); font-family: ui-monospace, Menlo, monospace; }

/* ---- Panel ------------------------------------------------------------- */
.pa-panel { border-radius: 1.5rem; background: rgba(2,6,23,.6); border: 1px solid var(--border-color); padding: .9rem; min-height: 420px; }
.pa-panel-tabs { display: flex; gap: .3rem; padding: .25rem; border-radius: 999px; background: rgba(255,255,255,.05); margin-bottom: .9rem; width: fit-content; }
.pa-panel-tabs button { border: 0; background: none; color: var(--text-secondary); font-size: .8rem; font-weight: 600; padding: .35rem .9rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .4rem; }
.pa-panel-tabs button[aria-selected="true"] { background: rgba(59,130,246,.22); color: #fff; }
.pa-tabpane { max-height: 560px; overflow-y: auto; padding-inline-end: .2rem; scrollbar-width: thin; }
.pa-tabpane[hidden] { display: none; }
.pa-empty { color: var(--text-muted); font-size: .85rem; text-align: center; padding: 2rem 1rem; margin: 0; }

.pa-flow { border-radius: 1.2rem; background: rgba(15,23,42,.85); border: 1px solid var(--pa-line); padding: .8rem .9rem; margin-bottom: .8rem; }
.pa-flow[hidden] { display: none; }
.pa-flow-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .5rem; }
.pa-flow-head small { display: block; font-size: .66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; }
[lang="ar"] .pa-flow-head small { letter-spacing: 0; }
.pa-flow-head b { display: block; color: #fff; font-size: .92rem; }
.pa-now { text-transform: none !important; letter-spacing: 0 !important; color: var(--pa-indigo-2) !important; font-size: .74rem !important; }
.pa-flow-icon { width: 2.2rem; height: 2.2rem; border-radius: .8rem; display: grid; place-items: center; background: rgba(129,140,248,.18); color: var(--pa-indigo-2); flex-shrink: 0; }
.pa-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.pa-steps li { display: flex; align-items: center; gap: .55rem; font-size: .82rem; color: #cbd5e1; animation: pa-in .35s ease both; }
.pa-steps li > i, .pa-steps li > span:first-child { width: 1rem; flex-shrink: 0; text-align: center; }
.pa-steps li.done > i { color: var(--pa-emerald); }
.pa-steps li.error > i { color: var(--pa-rose); }
.pa-steps li.active { color: #fff; font-weight: 600; }
.pa-tag { font-style: normal; font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 999px;
  background: rgba(52,211,153,.14); color: #6ee7b7; margin-inline-start: auto; }
.pa-tag.warn { background: rgba(251,191,36,.14); color: #fcd34d; }
.pa-spin { display: inline-block; width: .8rem !important; height: .8rem; border-radius: 50%; border: 2px solid rgba(165,180,252,.3); border-top-color: var(--pa-indigo-2); animation: pa-spin .8s linear infinite; }
.pa-dot { display: inline-block; width: .5rem !important; height: .5rem; border-radius: 50%; background: var(--pa-amber); animation: pa-blink 1.2s ease-in-out infinite; margin-inline: .25rem; }

.pa-feed { display: grid; gap: .7rem; }
.pa-feed-item { display: grid; gap: .4rem; justify-items: start; }
.pa-feed-item.pa-new { animation: pa-in .45s cubic-bezier(.2,.8,.2,1) both; }

/* ---- Components (cards, forms, lists…) --------------------------------- */
.pa-c { width: 100%; border-radius: 1rem; background: rgba(15,23,42,.92); border: 1px solid var(--pa-line); padding: .75rem .85rem; font-size: .84rem; color: #e2e8f0; }
.pa-c p { margin: 0 0 .35rem; } .pa-c p:last-child { margin-bottom: 0; }
.pa-c hr { border-color: var(--pa-line); margin: .5rem 0; opacity: 1; }
.pa-c ul, .pa-c ol { margin: .2rem 0 .3rem; padding-inline-start: 1.1rem; }
.pa-c-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.pa-c-head > i { color: var(--pa-indigo-2); }
.pa-c-head strong { font-size: .88rem; color: #fff; }
.pa-c-head .pa-pill, .pa-c-head .pa-ms { margin-inline-start: auto; }
.pa-muted { color: #94a3b8; }
.pa-strong { font-weight: 700; }
.pa-c .small, .pa-c small { font-size: .74rem; }
.pa-ltr { direction: ltr; text-align: start; unicode-bidi: plaintext; }
.pa-pill { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700; background: rgba(148,163,184,.18); color: #cbd5e1; }
.pa-pill.ok { background: rgba(52,211,153,.16); color: #6ee7b7; }
.pa-pill.warn { background: rgba(251,191,36,.16); color: #fcd34d; }
.pa-pill.err { background: rgba(244,63,94,.16); color: #fda4af; }
.pa-pill.info { background: rgba(129,140,248,.18); color: #c7d2fe; }
.pa-ms { font-size: .68rem; color: var(--text-muted); font-family: ui-monospace, Menlo, monospace; }
.pa-kv { display: grid; gap: .2rem; margin: .3rem 0; }
.pa-kv div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed rgba(255,255,255,.06); padding-bottom: .15rem; }
.pa-kv dt { font-weight: 500; color: #94a3b8; text-transform: capitalize; }
.pa-kv dd { margin: 0; text-align: end; color: #f1f5f9; font-weight: 600; unicode-bidi: plaintext; }
.pa-card.ok { border-color: rgba(52,211,153,.35); } .pa-card.warn { border-color: rgba(251,191,36,.4); }
.pa-card.err { border-color: rgba(244,63,94,.45); } .pa-card.info { border-color: rgba(129,140,248,.4); }
.pa-md p { margin-bottom: .35rem; }

.pa-list { list-style: none; padding: 0 !important; margin: .2rem 0 0; display: grid; gap: .35rem; }
.pa-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: .7rem; background: rgba(255,255,255,.04); border: 1px solid transparent; }
.pa-list li > div { flex: 1; min-width: 0; }
.pa-list b { display: block; font-size: .82rem; color: #fff; }
.pa-list small { display: block; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-list li.off { opacity: .45; }
.pa-list li.on { border-color: rgba(129,140,248,.6); background: rgba(129,140,248,.12); }
.pa-meta { font-size: .72rem; color: #cbd5e1; white-space: nowrap; font-weight: 600; }
.pa-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; }
.pa-plan { padding: .55rem; border-radius: .7rem; background: rgba(255,255,255,.04); border: 1px solid var(--pa-line); display: grid; gap: .1rem; }
.pa-plan.hi { border-color: var(--pa-indigo); }
.pa-price { font-weight: 700; font-size: 1rem; color: #fff; }
.pa-total { display: flex; justify-content: space-between; font-size: .9rem; margin: .3rem 0; }
.pa-card-mask { font-family: ui-monospace, Menlo, monospace; padding: .45rem .6rem; border-radius: .6rem; background: rgba(255,255,255,.05); color: #cbd5e1; }
.pa-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin-top: .3rem; }
.pa-slots span { text-align: center; padding: .35rem .2rem; border-radius: .55rem; background: rgba(255,255,255,.05); font-size: .72rem; border: 1px solid transparent; }
.pa-slots span.off { opacity: .35; text-decoration: line-through; }
.pa-slots span.on { border-color: var(--pa-indigo); background: rgba(129,140,248,.18); }
.pa-otp { display: flex; gap: .35rem; justify-content: center; margin: .4rem 0 .2rem; }
.pa-otp span { width: 2rem; height: 2.4rem; border-radius: .55rem; border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.2rem; }
.pa-otp span.on { border-color: var(--pa-indigo); background: rgba(129,140,248,.15); }
.pa-stages { list-style: none; padding: 0 !important; margin: .4rem 0; display: grid; gap: .3rem; }
.pa-stages li { display: flex; align-items: center; gap: .5rem; color: #94a3b8; font-size: .78rem; }
.pa-stages li span { width: .6rem; height: .6rem; border-radius: 50%; border: 2px solid #475569; flex-shrink: 0; }
.pa-stages li.done { color: #cbd5e1; } .pa-stages li.done span { background: var(--pa-emerald); border-color: var(--pa-emerald); }
.pa-stages li.now { color: #fff; font-weight: 600; } .pa-stages li.now span { border-color: var(--pa-indigo-2); box-shadow: 0 0 0 3px rgba(129,140,248,.25); }
.pa-stages small { margin-inline-start: auto; }
.pa-ref { font-family: ui-monospace, Menlo, monospace; color: #cbd5e1; }
.pa-rules { list-style: none; padding: 0 !important; display: grid; gap: .3rem; }
.pa-rules li { display: flex; gap: .5rem; align-items: baseline; }
.pa-rules li.ok i { color: var(--pa-emerald); } .pa-rules li.warn i { color: var(--pa-amber); } .pa-rules li.err i { color: var(--pa-rose); }
.pa-ok { color: #6ee7b7; }
.pa-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.pa-btn { padding: .3rem .75rem; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .74rem; font-weight: 600; }
.pa-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .35rem; }
.pa-fields label { display: grid; gap: .1rem; padding: .4rem .55rem; border-radius: .6rem; background: rgba(255,255,255,.04); border: 1px solid var(--pa-line); margin: 0; }
.pa-fields label span { font-size: .68rem; color: #94a3b8; }
.pa-fields label em { font-style: normal; font-size: .82rem; color: #fff; min-height: 1.1rem; unicode-bidi: plaintext; }
.pa-fields label.filled { border-color: rgba(52,211,153,.4); }
.pa-approval { border-color: rgba(251,191,36,.45); }
.pa-approval.ok { border-color: rgba(52,211,153,.45); }
.pa-approval.err { border-color: rgba(244,63,94,.45); }
.pa-sources { list-style: none; padding: 0 !important; display: grid; gap: .45rem; }
.pa-sources b { display: block; font-size: .8rem; color: #fff; }
.pa-sources b i { color: var(--pa-indigo-2); margin-inline-end: .25rem; }
.pa-sources q { display: block; color: #94a3b8; font-size: .76rem; margin-top: .15rem; quotes: "“" "”"; }
.pa-score { display: block; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: .3rem; overflow: hidden; }
.pa-score span { display: block; height: 100%; background: linear-gradient(90deg, var(--pa-indigo), var(--accent-color)); }
.pa-note { border-color: rgba(45,212,191,.35); }

/* ---- Transcript -------------------------------------------------------- */
.pa-msg { margin-bottom: .6rem; max-width: 88%; }
.pa-msg small { display: block; font-size: .64rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .15rem; }
.pa-msg > div { padding: .55rem .8rem; border-radius: 1rem; font-size: .86rem; line-height: 1.5; }
.pa-msg > div p:last-child { margin-bottom: 0; }
.pa-msg.agent > div { background: rgba(255,255,255,.07); border-end-start-radius: .3rem; }
.pa-msg.user { margin-inline-start: auto; }
.pa-msg.user small { text-align: end; }
.pa-msg.user > div { background: #6366f1; color: #fff; border-end-end-radius: .3rem; }
.pa-msg.user.action > div { background: rgba(99,102,241,.25); border: 1px dashed rgba(165,180,252,.6); font-style: italic; }
.pa-transcript-details { margin-top: 1.8rem; }
/* The time is written left to right (dir=ltr), so it is placed physically: at the end of the bar. */
[dir="rtl"] .pa-progress-time { right: auto; left: 0; }
.pa-transcript-details summary { cursor: pointer; color: var(--text-secondary); font-size: .88rem; }
.pa-transcript-full { padding: 1rem 0 0; }

/* ---- Animations -------------------------------------------------------- */
@keyframes pa-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 12px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
@keyframes pa-ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.32); opacity: 0; } }
@keyframes pa-spin { to { transform: rotate(360deg); } }
@keyframes pa-bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes pa-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes pa-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

/* ---- Gallery ----------------------------------------------------------- */
.pa-filters { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-bottom: 1.5rem; }
.pa-filter { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border-color); background: rgba(255,255,255,.03); color: var(--text-secondary); transition: all .2s; }
.pa-filter i { color: var(--accent-color); font-size: .78rem; }
.pa-filter:hover { color: var(--text-primary); border-color: rgba(96,165,250,.55); }
.pa-filter[aria-pressed="true"] { background: rgba(59,130,246,.18); border-color: var(--primary-light); color: #fff; }
.pa-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.pa-agent { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem; border-radius: 1.25rem; background: var(--card-bg);
  border: 1px solid var(--border-color); transition: transform .25s, border-color .25s, box-shadow .25s; animation: pa-in .4s ease both; }
.pa-agent:hover { transform: translateY(-3px); border-color: rgba(96,165,250,.5); box-shadow: 0 18px 40px -24px rgba(59,130,246,.8); }
.pa-agent header { display: flex; align-items: center; gap: .8rem; }
.pa-agent header img { width: 64px; height: 64px; border-radius: 50%; background: #1e293b; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.pa-agent header small { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-color); }
[dir="rtl"] .pa-agent header small { letter-spacing: 0; }
.pa-agent h3 { font-size: 1.15rem; margin: .1rem 0 0; font-weight: 700; color: #fff; }
.pa-agent-title { margin: 0; font-weight: 600; color: #e2e8f0; font-size: .95rem; }
.pa-agent-sum { margin: 0; color: var(--text-secondary); font-size: .85rem; line-height: 1.5; flex: 1; }
.pa-agent-prompts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.pa-agent-prompts li { font-size: .72rem; padding: .2rem .6rem; border-radius: 999px; background: rgba(129,140,248,.12); color: #c7d2fe; }
.pa-agent-facts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .74rem; color: var(--text-muted); }
.pa-agent-facts i { color: var(--primary-light); margin-inline-end: .3rem; }
/* The replay button sits on the opposite side from the capability badges (end side, mirrored in RTL). */
.pa-agent footer { margin-top: 1rem; display: flex; justify-content: flex-end; }

/* ---- Chat replay (gallery dialog) -------------------------------------- */
.pa-dialog { width: min(720px, calc(100vw - 2rem)); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--border-color); border-radius: 1.5rem;
  background: #050a16; color: #e2e8f0; box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); overflow: hidden; }
.pa-dialog::backdrop { background: rgba(2,6,23,.75); backdrop-filter: blur(4px); }
.pa-dialog[open] { display: flex; flex-direction: column; }
.pa-dialog-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--pa-line); }
.pa-dialog-bar .pa-progress { flex: 1; margin: 0; }
.pa-dialog-bar .pa-ctl { width: 2.2rem; height: 2.2rem; }
.pa-dialog-body { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.pa-chat { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.pa-chat-head { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--pa-line); }
.pa-chat-head img { width: 36px; height: 36px; border-radius: 50%; }
.pa-chat-head b { display: block; color: #fff; } .pa-chat-head small { display: block; font-size: .72rem; color: var(--text-muted); }
.pa-chat-flow { margin-inline-start: auto; font-size: .72rem; color: #c7d2fe; background: rgba(129,140,248,.14); padding: .2rem .6rem; border-radius: 999px; }
.pa-chat-flow:empty { display: none; }
.pa-chat-body { flex: 1; overflow-y: auto; padding: 1rem; min-height: 50vh; scrollbar-width: thin; }
.pa-inline { display: grid; gap: .5rem; margin-top: .5rem; max-width: 520px; }
.pa-inline .pa-feed-item > .pa-cap { display: none; }
.pa-caret { display: inline-block; width: .45rem; height: 1em; margin-inline-start: .15rem; vertical-align: -.15em; background: var(--pa-indigo-2); animation: pa-blink 1s infinite; }
.pa-typing { display: inline-flex; gap: .25rem; padding: .7rem .9rem !important; }
.pa-typing i { width: .4rem; height: .4rem; border-radius: 50%; background: #94a3b8; animation: pa-blink 1.2s infinite; }
.pa-typing i:nth-child(2) { animation-delay: .2s; } .pa-typing i:nth-child(3) { animation-delay: .4s; }
.pa-progress-sm { height: 4px; }

/* ---- Arabic ------------------------------------------------------------ */
.pa-call[lang="ar"], .pa-panel[lang="ar"], .pa-chat[lang="ar"], .pa-transcript-full[lang="ar"] { font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif; }

/* ---- Two languages in the static markup (gallery cards): show the page's one ---- */
html:not([lang="ar"]) [data-l="ar"],
html[lang="ar"] [data-l="en"] { display: none !important; }
.pa-agent[hidden], #cases[hidden] { display: none !important; }

/* A long line in a row (an account summary) must not push the row's pill or price off the card. */
.pa-c { min-width: 0; overflow-wrap: anywhere; }
.pa-list li { min-width: 0; }
.pa-list .pa-pill, .pa-list .pa-meta { flex-shrink: 0; }

/* The call loads after the page: reserve its room so nothing below it moves when it arrives. */
[data-showcase-call]:empty { aspect-ratio: 9 / 17.5; max-height: 720px; border-radius: 2.4rem; background: linear-gradient(180deg, #020617, #1e1b4b); }
[data-showcase-panel]:empty { min-height: 420px; }
[data-showcase-tabs]:empty { min-height: 62px; }

/* "Show all agents": the summary is a button; the grid after it continues the one above. */
.pa-more { margin-top: 1rem; }
.pa-more > summary { display: table; margin: 1.25rem auto 0; list-style: none; cursor: pointer; }
.pa-more > summary::-webkit-details-marker { display: none; }
.pa-more[open] > summary { display: none; }
.pa-more > .pa-gallery { margin-top: 0; }


/* ---- Activity panel: on screen now / workflow / behind the scenes ---- */
.pa-activity { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-content: start; }
.pa-block { border-radius: 1.1rem; background: rgba(15,23,42,.6); border: 1px solid var(--pa-line); padding: .8rem .9rem; }
.pa-block[hidden] { display: none; }
.pa-block-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
[lang="ar"] .pa-block-title { letter-spacing: 0; font-size: .78rem; }
.pa-block-title i { color: var(--primary-light); }
.pa-now { background: linear-gradient(180deg, rgba(59,130,246,.08), rgba(15,23,42,.6)); border-color: rgba(96,165,250,.3); }
.pa-now-body { min-height: 5.5rem; display: grid; align-items: center; }
.pa-now-body .pa-empty { padding: .8rem; }
.pa-now-card { animation: pa-in .45s cubic-bezier(.2,.8,.2,1) both; }
.pa-now-card .pa-c { background: rgba(2,6,23,.55); }
.pa-flow { padding: .7rem .9rem; margin: 0; }
.pa-flow-head { margin-bottom: .45rem; }
.pa-flow-text { flex: 1; min-width: 0; }
.pa-flow-count { font-family: ui-monospace, Menlo, monospace; font-size: .74rem; color: var(--text-secondary); }
.pa-flow-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; margin-bottom: .55rem; }
.pa-flow-bar span { display: block; height: 100%; width: 0; background: var(--gradient-primary); transition: width .5s ease; }
.pa-steps-more { color: var(--text-muted) !important; font-size: .74rem !important; padding-inline-start: 1.55rem; }
.pa-log { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.pa-log li { display: flex; align-items: center; gap: .6rem; padding: .38rem .2rem; font-size: .82rem; color: #cbd5e1; border-bottom: 1px dashed rgba(255,255,255,.05); }
.pa-log li:last-child { border-bottom: 0; }
.pa-log li > i { width: 1.1rem; text-align: center; color: var(--accent-color); flex-shrink: 0; }
.pa-log li > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-log li > small { color: var(--text-muted); font-family: ui-monospace, Menlo, monospace; font-size: .7rem; flex-shrink: 0; }
.pa-log li.pa-log-kb > i { color: var(--pa-indigo-2); }
.pa-log li.pa-log-otp > i, .pa-log li.warn > i { color: var(--pa-amber); }
.pa-log li.ok > i { color: var(--pa-emerald); }
.pa-log li.err > i { color: var(--pa-rose); }
.pa-log li.pa-new { animation: pa-in .4s ease both; background: rgba(45,212,191,.06); border-radius: .5rem; }
.pa-panel { min-height: 0; }
.pa-activity.pa-tabpane { max-height: none; overflow: visible; }


/* ---- Activity panel layout: what the caller sees is the focus; the rest sits to its right ---- */
.pa-now-body { min-height: 9rem; }
@media (min-width: 1200px) {
  .pa-activity {
    grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr);
    grid-template-areas: "now flow" "now log";
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  .pa-now { grid-area: now; align-self: stretch; display: flex; flex-direction: column; }
  .pa-now-body { flex: 1; min-height: 22rem; align-content: center; }
  .pa-flow { grid-area: flow; }
  .pa-log-block { grid-area: log; }
  /* The card on screen reads at a size a caller would see it */
  .pa-now-card .pa-c { font-size: .92rem; padding: 1rem 1.1rem; }
  .pa-now-card .pa-c-head strong { font-size: 1rem; }
  .pa-now-card .pa-list b { font-size: .9rem; }
  .pa-now-card .pa-otp span { width: 2.6rem; height: 3rem; font-size: 1.4rem; }
  .pa-now-card .pa-slots span { padding: .55rem .3rem; font-size: .82rem; }
  .pa-panel { min-height: 0; }
}
/* Grid items default to their content's width; long one-line entries must shorten (…) instead. */
.pa-block { min-width: 0; overflow: hidden; }
.pa-log li { min-width: 0; }
/* Three agents per row on desktop (the first six fill two rows), two on tablets, one on phones. */
@media (min-width: 576px) { .pa-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .pa-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* ---- Big Play: stands where the panel will be until the call starts ---- */
.pa-bigplay { width: 100%; min-height: 420px; border-radius: 1.5rem; border: 1px solid rgba(96,165,250,.35); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 2rem;
  background: radial-gradient(circle at 50% 42%, rgba(59,130,246,.22), rgba(2,6,23,.6) 62%); transition: border-color .2s, transform .2s; }
.pa-bigplay[hidden] { display: none; }
.pa-bigplay:hover, .pa-bigplay:focus-visible { border-color: var(--primary-light); }
.pa-bigplay:hover .pa-bigplay-icon { transform: scale(1.06); }
.pa-bigplay-icon { width: 7.5rem; height: 7.5rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem;
  background: var(--pa-emerald); color: #04130d; box-shadow: 0 0 0 0 rgba(52,211,153,.55), 0 24px 50px -18px rgba(52,211,153,.8);
  animation: pa-pulse 2.2s infinite; transition: transform .2s; }
.pa-bigplay-icon .fa-play { margin-left: .35rem; } /* media controls are not mirrored in RTL */
.pa-bigplay-label { font-size: 1.6rem; font-weight: 700; margin-top: .6rem; }
.pa-bigplay-sub { color: #cbd5e1; font-size: 1rem; }
.pa-bigplay small { color: var(--text-muted); font-size: .82rem; }
@media (max-width: 991.98px) {
  .pa-bigplay { min-height: 240px; } .pa-bigplay-icon { width: 5.5rem; height: 5.5rem; font-size: 2rem; }
  /* Stacked: the Play button comes right after the phone, before the case summary. */
  .pa-side { display: flex; flex-direction: column; }
  .pa-side > .pa-bigplay { order: -1; margin-bottom: 1rem; }
}


/* ---- Conversation (transcript + what was on screen, together) ---- */
.pa-convo { display: flex; flex-direction: column; min-height: 0; }
.pa-block-hint { margin-inline-start: .4rem; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .74rem; color: var(--text-muted); opacity: .85; }
.pa-convo-body { flex: 1; min-height: 22rem; max-height: 560px; overflow-y: auto; padding: .2rem .25rem .4rem; scrollbar-width: thin; scroll-behavior: smooth; }
.pa-convo-body .pa-msg { max-width: 86%; margin-bottom: .55rem; }
.pa-convo-body .pa-msg.user > div { background: #4f46e5; }
.pa-convo-body .pa-msg.user.action > div { background: rgba(99,102,241,.2); }
.pa-screen { margin: .1rem 0 .8rem; max-width: 94%; }
.pa-screen-now { border-radius: 1rem; padding: .55rem; background: linear-gradient(180deg, rgba(59,130,246,.12), rgba(15,23,42,.4)); border: 1px solid rgba(96,165,250,.35); }
.pa-screen-now.pa-new { animation: pa-in .45s cubic-bezier(.2,.8,.2,1) both; }
.pa-screen-label { display: flex; align-items: center; gap: .4rem; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-light); margin: 0 0 .45rem .2rem; }
[lang="ar"] .pa-screen-label { letter-spacing: 0; font-size: .74rem; }
.pa-screen-now .pa-c { background: rgba(2,6,23,.6); }
.pa-screen-past { list-style: none; padding: 0; opacity: .75; }
.pa-screen-past li { display: inline-flex; gap: .45rem; align-items: center; font-size: .76rem; color: #94a3b8; padding: .25rem .6rem; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--pa-line); max-width: 100%; }
.pa-screen-past li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-screen-past li > i { color: var(--primary-light); }
@media (min-width: 1200px) {
  .pa-activity { grid-template-areas: "convo flow" "convo log"; }
  .pa-convo { grid-area: convo; align-self: stretch; }
}

/* ---- Conversation window (gallery): the same panel as the calls ---- */
.pa-dialog { width: min(1180px, calc(100vw - 2rem)); max-height: min(92vh, 980px); }
.pa-dialog-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--pa-line); }
.pa-dialog-head img { width: 48px; height: 48px; border-radius: 50%; background: #1e293b; }
.pa-dialog-head b { display: block; color: #fff; font-size: 1.05rem; }
.pa-dialog-head small { display: block; color: var(--text-secondary); font-size: .8rem; }
.pa-dialog-head [data-act="close"] { margin-inline-start: auto; }
.pa-dialog-body { display: block; overflow-y: auto; padding: 1rem; }
.pa-dialog-body .pa-panel { border: 0; padding: 0; background: none; }
.pa-dialog-bar { border-top: 1px solid var(--pa-line); border-bottom: 0; }
.pa-dialog-time { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--text-muted); }


/* ---- Conversation tabs: as it happens (default) / all of it ---- */
.pa-convo-tabs { display: flex; gap: .3rem; padding: .25rem; margin-bottom: .45rem; border-radius: .8rem; background: rgba(2,6,23,.45); border: 1px solid var(--pa-line); width: max-content; max-width: 100%; }
.pa-convo-tabs button { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; color: var(--text-muted); font-size: .78rem; font-weight: 600; padding: .4rem .8rem; border-radius: .6rem; cursor: pointer; }
.pa-convo-tabs button[aria-selected="true"] { background: rgba(59,130,246,.18); color: #fff; }
.pa-convo-tabs button:hover { color: #fff; }
.pa-convo > .pa-block-hint { margin: 0 0 .5rem; padding-inline-start: .2rem; }
.pa-convo-full .pa-msg { max-width: 92%; }

/* ---- Desktop: the panel ends where the phone ends; the conversation scrolls inside ---- */
@media (min-width: 1200px) {
  .pa-stage { align-items: stretch; }
  .pa-stage .pa-side { display: flex; flex-direction: column; }
  .pa-stage [data-showcase-panel] { flex: 1 1 0; min-height: 0; display: flex; }
  .pa-stage [data-showcase-panel][hidden] { display: none; }
  .pa-stage .pa-panel { flex: 1; min-height: 0; display: flex; }
  .pa-stage .pa-activity { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .pa-stage .pa-convo { min-height: 0; display: flex; flex-direction: column; }
  .pa-stage .pa-convo-body { flex: 1 1 0; min-height: 0; max-height: none; }
  .pa-stage .pa-log-block { min-height: 0; overflow: hidden; }
}
@media (min-width: 1200px) { .pa-stage .pa-bigplay { flex: 1; min-height: 0; } }

/* ---- Agent card: three labelled groups, kept together at the bottom so rows line up ---- */
.pa-agent-groups { margin-top: auto; display: grid; gap: .7rem; padding-top: .8rem; border-top: 1px solid var(--pa-line); }
.pa-agent-group { display: grid; gap: .4rem; }
.pa-agent-group-title { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .64rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
[lang="ar"] .pa-agent-group-title, [dir="rtl"] .pa-agent-group-title { letter-spacing: 0; font-size: .74rem; }
.pa-agent-group-title i { color: var(--primary-light); font-size: .7rem; }
.pa-agent footer { margin-top: .9rem; }
