/* =============================================================
   Weloop — animated vector product illustrations (see js/product-illustrations.js)
   Each scene is laid out on a fixed-pixel stage, then scaled to
   its container. All values below are stage pixels.
   ============================================================= */
.pi { position: relative; width: 100%; overflow: hidden; display: block; background: #fff;
  --pi-violet: #7B3FFF; --pi-mint: #24C38A; --pi-ink: #14141F; --pi-muted: #6A6B78; --pi-soft: #9A9BAA;
  --pi-line: #E8E9F1; --pi-canvas: #FCFCFF; --pi-surface: #F5F4FB; --pi-amber: #F5A623; --pi-red: #E0335F; --pi-blue: #2E7CF6;
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif); color: var(--pi-ink); font-size: 12px; line-height: 1.35; letter-spacing: 0; text-align: left; }
.pi-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; display: flex; flex-direction: column; background: #fff; }
.pi-scene { position: relative; flex: 1; min-height: 0; display: flex; overflow: hidden; }
.pi * { box-sizing: border-box; }
.pi b { font-weight: 700; }
.pi p { margin: 0; }
.pi h3 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.pi-ic { width: 14px; height: 14px; flex: none; }
.pi-mark { width: 18px; height: 16px; flex: none; }
.pi-av { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; font-size: 8px; font-weight: 800; color: #fff; background: var(--pi-blue); flex: none; letter-spacing: 0; }
.pi-av.blue { background: #DCE8FF; color: #1D5FD3; }
.pi-av.ink { background: var(--pi-ink); }
.pi-av.brown { background: #C98A45; }
.pi-av.green { background: #4DD54D; }
.pi-av.ring { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #B6F0B6; }

/* browser chrome bar (optional, data-pi-bar) */
.pi-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--pi-line); background: #FBFAFF; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; color: var(--pi-soft); flex: none; }
.pi-dots { display: flex; gap: 5px; }
.pi-dots i { width: 10px; height: 10px; border-radius: 999px; background: #DDDEE9; display: block; }
.pi-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; color: var(--pi-mint); }
.pi-live i { width: 6px; height: 6px; border-radius: 999px; background: var(--pi-mint); animation: pi-pulse 2s ease-in-out infinite; }

/* ---------- shared: buttons, pills, labels, statuses ---------- */
.pi-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--pi-line); background: #fff; font-size: 12px; font-weight: 600; color: var(--pi-ink); white-space: nowrap; position: relative; }
.pi-btn .pi-ic { width: 13px; height: 13px; }
.pi-btn.primary { background: var(--pi-violet); border-color: var(--pi-violet); color: #fff; box-shadow: 0 6px 14px hsl(260 100% 69% / .28); }
.pi-btn.sm { height: 26px; font-size: 11px; padding: 0 10px; }
.pi-btn.xs { height: 22px; font-size: 10px; padding: 0 8px; border-radius: 7px; }
.pi-btn.on { background: var(--pi-surface); }
.pi-btn.icon { width: 26px; padding: 0; justify-content: center; color: var(--pi-muted); }
.pi-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--pi-line); background: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pi-pill .pi-ic { width: 12px; height: 12px; color: var(--pi-muted); }
.pi-label { font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--pi-muted); }
.pi-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--pi-surface); font-size: 9.5px; font-weight: 600; color: var(--pi-muted); white-space: nowrap; }
.pi-count { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--pi-line); font-size: 10px; font-weight: 600; color: var(--pi-muted); }
.pi-count.violet { border: 0; background: var(--pi-violet); color: #fff; font-weight: 800; }
.pi-search { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--pi-line); background: #fff; color: var(--pi-soft); font-size: 11.5px; flex: 1; min-width: 0; white-space: nowrap; }
.pi-search .pi-ic { color: var(--pi-muted); }
.pi-status { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pi-status i { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pi-status.draft { background: #FFF4DB; color: #A66A00; }
.pi-status.pub { background: #E3F8EF; color: #0B7A52; }
.pi-status.arch { background: var(--pi-surface); color: var(--pi-muted); }
.pi-status.online .pi-ic { width: 12px; height: 12px; }
.pi-status.badge { height: 24px; padding: 0 10px; font-size: 11px; }
.pi-soon { margin-left: auto; font-size: 7.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pi-muted); padding: 2px 5px; border-radius: 4px; background: var(--pi-surface); font-style: normal; }
.pi-chip { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 9.5px; font-weight: 700; background: var(--pi-surface); }
.pi-chip i { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.pi-chip.bug { color: #D62D53; background: #FFE9EE; }
.pi-chip.idea { color: #1D5FD3; background: #E6EEFF; }
.pi-chip.ux { color: #6C3CE0; background: #EFE8FF; }
.pi-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.pi-toolbar.wrap { flex-wrap: nowrap; }

/* ---------- the back-office left panel ---------- */
.pi-nav { width: 176px; flex: none; display: flex; flex-direction: column; background: var(--pi-canvas); border-right: 1px solid var(--pi-line); padding: 12px 10px 10px; gap: 8px; }
.pi-nav-top { display: flex; align-items: center; gap: 8px; color: var(--pi-muted); }
.pi-org { flex: 1; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--pi-line); background: #fff; color: var(--pi-ink); min-width: 0; }
.pi-org .pi-ic { width: 12px; height: 12px; color: var(--pi-muted); }
.pi-org-av { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #7B3FFF, #B08CFF); color: #fff; font-size: 10px; font-weight: 800; flex: none; }
.pi-org-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; flex: 1; }
.pi-org-meta b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-org-meta i { font-style: normal; font-size: 9.5px; color: var(--pi-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-nav-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pi-nav-group { display: flex; flex-direction: column; gap: 1px; padding-bottom: 6px; }
.pi-nav-item { display: flex; align-items: center; gap: 9px; height: 27px; padding: 0 9px; border-radius: 9px; font-size: 11.5px; font-weight: 600; color: var(--pi-ink); white-space: nowrap; }
.pi-nav-item > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pi-nav-item .pi-ic { width: 14px; height: 14px; color: var(--pi-violet); }
.pi-nav-item.sub { margin-left: 13px; height: 25px; font-size: 10.5px; font-weight: 500; border-left: 1.5px solid var(--pi-line); border-radius: 0 9px 9px 0; padding-left: 11px; }
.pi-nav-item.sub .pi-ic { width: 12px; height: 12px; color: var(--pi-ink); }
.pi-nav-item.active { background: linear-gradient(135deg, #7B3FFF, #6E33F5); color: #fff; box-shadow: 0 8px 18px hsl(260 100% 69% / .32); border-color: transparent; }
.pi-nav-item.active .pi-ic { color: #fff; }
.pi-nav-item.sub.active { border-radius: 9px; border-left-color: transparent; margin-left: 13px; }
.pi-nav-bottom { display: flex; flex-direction: column; gap: 8px; }
.pi-user { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 10px; background: var(--pi-surface); }
.pi-user .pi-av { width: 26px; height: 26px; font-size: 9px; }
.pi-user .pi-ic { color: var(--pi-muted); width: 12px; }

/* ---------- main area ---------- */
.pi-main { flex: 1; min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; background: #fff; }
.pi-main.full { padding: 20px 24px; }
.pi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pi-head p { margin-top: 5px; font-size: 11px; color: var(--pi-muted); }
.pi-head-row { display: flex; align-items: center; gap: 10px; }
.pi-head-actions { display: flex; gap: 8px; flex: none; }
.pi-head.tight { margin-bottom: 12px; }

/* ============================================================
   WIDGET scene
   ============================================================ */
.pi-widget .pi-scene { background: #EEF0F6; }
.pi-host { position: absolute; inset: 0; display: flex; background: #F4F5FA; }
.pi-host-side { width: 130px; background: #fff; border-right: 1px solid var(--pi-line); padding: 26px 16px; display: flex; flex-direction: column; gap: 16px; }
.pi-host i { display: block; height: 9px; border-radius: 999px; background: #E6E7EF; }
.pi-host .w40 { width: 40%; } .pi-host .w50 { width: 50%; } .pi-host .w55 { width: 55%; } .pi-host .w60 { width: 60%; } .pi-host .w70 { width: 70%; } .pi-host .w80 { width: 80%; } .pi-host .w85 { width: 85%; } .pi-host .w90 { width: 90%; }
.pi-host-main { flex: 1; padding: 28px 30px; display: flex; flex-direction: column; gap: 18px; }
.pi-host-title { display: flex; justify-content: space-between; align-items: center; }
.pi-host-title i { height: 14px; background: #DCDDE8; }
.pi-host-title b { width: 74px; height: 22px; border-radius: 7px; background: #DCDDE8; }
.pi-host-cards { display: flex; gap: 12px; }
.pi-host-cards i { flex: 1; height: 62px; border-radius: 12px; background: #fff; border: 1px solid var(--pi-line); }
.pi-host-table { border-radius: 12px; background: #fff; border: 1px solid var(--pi-line); padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }

/* launcher bubble — mirrors apps/snippet fab.css */
.pi-fab { position: absolute; right: 26px; bottom: 26px; width: 64px; height: 64px; }
.pi-fab-glow { position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, hsl(260 100% 69% / .6), transparent 70%); opacity: .5; }
.pi-fab-circle { position: absolute; inset: 0; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px hsl(260 100% 69% / .28), 0 2px 6px rgb(0 0 0 / .08); }
.pi-fab-circle .pi-mark { width: 34px; height: 30px; }
.pi-fab-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #e04a7c; border: 2px solid #fff; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgb(0 0 0 / .18); opacity: 0; transform: scale(.4); }
.pi-fab-tip { position: absolute; right: -4px; bottom: calc(100% + 14px); padding: 8px 14px; border-radius: 10px; background: var(--pi-ink); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px rgb(0 0 0 / .2); opacity: 0; transform: translateY(6px); }
.pi-fab-tip::after { content: ""; position: absolute; right: 28px; bottom: -4px; width: 8px; height: 8px; background: var(--pi-ink); transform: rotate(45deg); }

/* drawer — full-height panel docked right */
.pi-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 440px; background: #fff; box-shadow: -18px 0 50px rgb(20 20 31 / .14); display: flex; flex-direction: column; transform: translateX(104%); }
.pi-wh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--pi-line); }
.pi-wh-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pi-wh-mark { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--pi-line); background: #fff; display: grid; place-items: center; flex: none; }
.pi-wh-mark .pi-mark { width: 26px; height: 23px; }
.pi-wh-mark i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--pi-mint); box-shadow: 0 0 0 2px #fff; }
.pi-wh-txt { display: flex; flex-direction: column; line-height: 1.25; }
.pi-wh-txt b { font-size: 14px; font-weight: 800; }
.pi-wh-txt i { font-style: normal; font-size: 10.5px; font-weight: 700; color: #0B7A52; }
.pi-wh-actions { display: flex; align-items: center; gap: 10px; color: var(--pi-muted); }
.pi-wh-actions .pi-av { width: 30px; height: 30px; font-size: 10px; }
.pi-wh-actions .pi-ic { width: 17px; height: 17px; color: var(--pi-ink); }
.pi-wh-div { width: 1px; height: 18px; background: var(--pi-line); }
.pi-wsub { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--pi-line); background: #FCFCFF; font-size: 12px; }
.pi-wsub .pi-ic { width: 14px; height: 14px; color: var(--pi-muted); }
.pi-wsub b { font-size: 12px; white-space: nowrap; }
.pi-wsub-part { margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--pi-muted); white-space: nowrap; }
.pi-wsub-avs { display: inline-flex; align-items: center; padding: 2px 6px 2px 4px; border-radius: 999px; background: #EEF0F8; gap: 2px; }
.pi-wsub-avs .pi-mark { width: 13px; height: 12px; }
.pi-wsub-avs .pi-av { width: 14px; height: 14px; font-size: 6.5px; }
.pi-wsub-close { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--pi-line); background: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pi-wsub-close .pi-ic { width: 11px; height: 11px; color: var(--pi-ink); }
.pi-thread { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.pi-tmeta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--pi-muted); }
.pi-tdate { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--pi-muted); }
.pi-tdate::before, .pi-tdate::after { content: ""; flex: 1; height: 1px; background: var(--pi-line); }
.pi-tdate span { padding: 2px 8px; border-radius: 999px; background: var(--pi-surface); }
.pi-msg { display: flex; flex-direction: column; gap: 5px; max-width: 86%; }
.pi-msg.me { align-self: flex-end; align-items: flex-end; }
.pi-msg-who { display: flex; align-items: center; gap: 6px; font-size: 10.5px; }
.pi-msg-who i { font-style: normal; color: var(--pi-muted); }
.pi-msg-who .pi-av { width: 18px; height: 18px; font-size: 7px; }
.pi-bub { padding: 9px 12px; border-radius: 14px; background: #F1F2F7; font-size: 12px; line-height: 1.45; }
.pi-msg.me .pi-bub { border-bottom-right-radius: 4px; }
.pi-bub.agent { background: #F3EEFF; border-bottom-left-radius: 4px; }
.pi-cite { display: flex; width: fit-content; align-items: center; gap: 5px; margin-top: 7px; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--pi-line); font-size: 10px; font-weight: 700; color: var(--pi-muted); }
.pi-cite .pi-ic { width: 11px; height: 11px; color: var(--pi-violet); }
.pi-cite.ok { color: #0B7A52; border-color: #CDEFE0; }
.pi-cite.ok .pi-ic { color: #0B7A52; }
.pi-typing { display: flex; flex-direction: column; gap: 5px; }
.pi-bub.dots { display: inline-flex; gap: 4px; align-self: flex-start; padding: 10px 12px; }
.pi-bub.dots i { width: 6px; height: 6px; border-radius: 999px; background: #A78BFA; animation: pi-dot 1s ease-in-out infinite; }
.pi-bub.dots i:nth-child(2) { animation-delay: .15s; } .pi-bub.dots i:nth-child(3) { animation-delay: .3s; }
.pi-compose { margin: 0 14px 14px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: 12px; border: 1px solid var(--pi-line); background: #fff; font-size: 12px; color: var(--pi-soft); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.pi-compose span { flex: 1; }
.pi-compose .pi-ic { color: var(--pi-muted); width: 16px; height: 16px; }
.pi-compose b { width: 28px; height: 28px; border-radius: 9px; background: var(--pi-violet); color: #fff; display: grid; place-items: center; }
.pi-compose b .pi-ic { color: #fff; width: 14px; height: 14px; }

/* widget timeline (14s) */
.pi-widget .pi-msg, .pi-widget .pi-typing { opacity: 0; transform: translateY(8px); }
.pi-widget .pi-typing { display: none; }
.pi-widget.is-on .pi-fab-glow { animation: pi-fab-glow 1.6s ease-in-out 0s 1; }
.pi-widget.is-on .pi-fab-badge { animation: pi-pop .4s cubic-bezier(.34,1.56,.64,1) .5s both; }
.pi-widget.is-on .pi-fab-tip { animation: pi-tip 1.1s ease .7s both; }
.pi-widget.is-on .pi-fab { animation: pi-fab-cycle 14s linear both; }
.pi-widget.is-on .pi-drawer { animation: pi-drawer 14s cubic-bezier(.22,1,.36,1) both; }
.pi-widget.is-on .pi-msg { animation: pi-in .45s cubic-bezier(.22,1,.36,1) both; }
.pi-widget.is-on .pi-msg.me { animation-delay: 2.5s; }
.pi-widget.is-on .pi-typing { display: flex; animation: pi-typing 14s linear both; }
.pi-widget.is-on .pi-msg.agent { animation-delay: 4.5s; }
.pi-widget.is-on .pi-msg.me.two { animation-delay: 6.6s; }
.pi-widget.is-on .pi-msg.agent.two { animation-delay: 8.9s; }
.pi-widget.is-static .pi-drawer { transform: none; }
.pi-widget.is-static .pi-fab { opacity: 0; }
.pi-widget.is-static .pi-msg { opacity: 1; transform: none; }
@keyframes pi-fab-cycle { 0%, 12% { opacity: 1; transform: scale(1); } 13% { transform: scale(.88); } 15%, 90% { opacity: 0; transform: scale(.4); } 93% { opacity: 1; transform: scale(1.14); } 96% { transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pi-drawer { 0%, 13% { transform: translateX(104%); } 17.5%, 89% { transform: translateX(0); } 93%, 100% { transform: translateX(104%); } }
@keyframes pi-typing { 0%, 22% { opacity: 0; transform: translateY(8px); } 24%, 30% { opacity: 1; transform: none; } 31.5%, 52% { opacity: 0; transform: translateY(8px); } 53%, 61% { opacity: 1; transform: none; } 62.5%, 100% { opacity: 0; transform: translateY(8px); } }
@keyframes pi-fab-glow { 0%, 100% { inset: -10px; opacity: .5; } 50% { inset: -20px; opacity: 1; } }
@keyframes pi-tip { 0%, 100% { opacity: 0; transform: translateY(6px); } 25%, 75% { opacity: 1; transform: none; } }

/* ============================================================
   KB scene
   ============================================================ */
.pi-kb-grid { display: flex; gap: 14px; flex: 1; min-height: 0; }
.pi-cats { width: 150px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.pi-cats .pi-label { padding: 0 4px 4px; }
.pi-cat { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--pi-line); background: #fff; border-radius: 10px; }
.pi-cat.active { background: var(--pi-surface); border-left: 3px solid var(--pi-violet); }
.pi-cat .pi-ic { width: 26px; height: 26px; padding: 6px; border-radius: 8px; background: #EFE8FF; color: var(--pi-violet); }
.pi-cat:nth-child(3) .pi-ic { background: #FFF1D6; color: #C77700; }
.pi-cat span { display: flex; flex-direction: column; line-height: 1.2; }
.pi-cat b { font-size: 11.5px; }
.pi-cat i { font-style: normal; font-size: 10px; color: var(--pi-muted); }
.pi-kb-list { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pi-table { border: 1px solid var(--pi-line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.pi-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--pi-line); font-size: 11px; color: var(--pi-muted); position: relative; }
.pi-row.head { border-top: 0; background: #FCFCFF; font-size: 11px; padding: 8px 12px; }
.pi-cb { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #D5D6E2; background: #fff; flex: none; }
.pi-row-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--pi-surface); color: var(--pi-muted); }
.pi-row-ic .pi-ic { width: 15px; height: 15px; }
.pi-row-ic.draft { background: #EFE8FF; color: var(--pi-violet); }
.pi-row-ic.pub { background: #FFF4DB; color: #A66A00; }
.pi-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pi-row-t b { color: var(--pi-ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.pi-row-t b .t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pi-row-t b > .pi-ai, .pi-row-t b > .pi-vote { flex: none; }
.pi-row-t i { font-style: normal; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-row-type { display: none; }
.pi-row-who { width: 86px; flex: none; display: flex; align-items: center; gap: 6px; color: var(--pi-ink); white-space: nowrap; }
.pi-row-who .pi-av { width: 18px; height: 18px; font-size: 7px; }
.pi-row-when { width: 68px; flex: none; text-align: right; white-space: nowrap; }
.pi-row .pi-status { width: 66px; justify-content: center; flex: none; }
.pi-vote { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: #0B7A52; font-weight: 700; }
.pi-vote .pi-ic { width: 10px; height: 10px; }
.pi-ai { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 999px; background: linear-gradient(90deg, #EFE8FF, #E3F4FF); color: var(--pi-violet); font-size: 9px; font-weight: 800; }
.pi-ai .pi-ic { width: 10px; height: 10px; }
.pi-review { position: absolute; right: 96px; top: -9px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--pi-ink); color: #fff; font-size: 9px; font-weight: 700; box-shadow: 0 6px 14px rgb(20 20 31 / .2); opacity: 0; transform: translateY(6px) scale(.9); }
.pi-review .pi-ic { width: 10px; height: 10px; color: #7CF0B8; }
.pi-status.flip { position: relative; }
.pi-status.flip .s1, .pi-status.flip .s2 { position: absolute; inset: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 999px; }
.pi-status.flip .s1 { background: #FFF4DB; color: #A66A00; }
.pi-status.flip .s2 { background: #E3F8EF; color: #0B7A52; opacity: 0; transform: scale(.8); }
.pi-import-file { position: absolute; left: 0; top: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; background: #fff; border: 1px solid var(--pi-line); box-shadow: 0 8px 20px hsl(260 100% 69% / .18); color: var(--pi-ink); font-size: 10.5px; font-weight: 600; opacity: 0; pointer-events: none; }
.pi-import-file .pi-ic { color: #D62D53; }
.pi-row.new { overflow: visible; }
.pi-row.new::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, hsl(260 100% 69% / .08), transparent); opacity: 0; }
/* KB timeline */
.pi-kb .pi-row.new { opacity: 0; transform: translateY(-8px); max-height: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; }
.pi-kb.is-on .pi-import { animation: pi-btn-press .6s ease .8s both; }
.pi-kb.is-on .pi-import-file { animation: pi-file-fly 1.3s cubic-bezier(.22,1,.36,1) 1.4s both; }
.pi-kb.is-on .pi-row.new { animation: pi-row-in .6s cubic-bezier(.22,1,.36,1) 2.6s both; }
.pi-kb.is-on .pi-row.new::before { animation: pi-shimmer 1.4s ease 3s 2; }
.pi-kb.is-on .pi-review { animation: pi-pop .5s cubic-bezier(.34,1.56,.64,1) 6.2s both; }
.pi-kb.is-on .pi-status.flip .s1 { animation: pi-fade-out .35s ease 7.6s both; }
.pi-kb.is-on .pi-status.flip .s2 { animation: pi-pop .5s cubic-bezier(.34,1.56,.64,1) 7.7s both; }
.pi-cat-count { position: relative; display: block; }
.pi-cat-count .c5 { position: absolute; left: 0; top: 0; opacity: 0; }
.pi-kb.is-on .pi-cat.active .c4 { animation: pi-fade-out .3s ease 2.9s both; }
.pi-kb.is-on .pi-cat.active .c5 { animation: pi-in .4s ease 3s both; }
.pi-kb.is-static .pi-cat.active .c4 { opacity: 0; } .pi-kb.is-static .pi-cat.active .c5 { opacity: 1; }
.pi-kb.is-static .pi-row.new { opacity: 1; transform: none; max-height: 60px; padding: 9px 12px; border-top-width: 1px; }
.pi-kb.is-static .pi-review { opacity: 1; transform: none; }
.pi-kb.is-static .pi-status.flip .s1 { opacity: 0; } .pi-kb.is-static .pi-status.flip .s2 { opacity: 1; transform: none; }
@keyframes pi-btn-press { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 hsl(260 100% 69% / 0); } 40% { transform: scale(.95); box-shadow: 0 0 0 6px hsl(260 100% 69% / .18); } }
@keyframes pi-file-fly { 0% { opacity: 0; transform: translate(0, -6px) scale(.9); } 15% { opacity: 1; transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(-150px, 168px) scale(1); } 100% { opacity: 0; transform: translate(-150px, 176px) scale(.6); } }
@keyframes pi-row-in { 0% { opacity: 0; transform: translateY(-8px); max-height: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; } 60% { max-height: 60px; padding-top: 9px; padding-bottom: 9px; border-top-width: 1px; } 100% { opacity: 1; transform: none; max-height: 60px; padding-top: 9px; padding-bottom: 9px; border-top-width: 1px; } }
@keyframes pi-shimmer { 0% { opacity: 0; transform: translateX(-60%); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(60%); } }
@keyframes pi-count-flip { 0% { opacity: 1; } 49% { opacity: 0; transform: translateY(-4px); } 50% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }

/* ============================================================
   KANBAN scene
   ============================================================ */
.pi-kanban .pi-main { padding: 16px 18px; }
.pi-kanban .pi-search { flex: 0 1 190px; }
.pi-kanban .pi-pill { padding: 0 8px; }
.pi-kanban .pi-head { margin-bottom: 10px; }
.pi-sla-group { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; margin-left: 2px; border: 1px dashed #D5D6E2; border-radius: 999px; position: relative; }
.pi-sla-group em { position: absolute; top: -7px; left: 10px; padding: 0 4px; background: #fff; font-style: normal; font-size: 8.5px; font-weight: 800; color: var(--pi-muted); letter-spacing: .06em; }
.pi-board { flex: 1; min-height: 0; display: flex; gap: 8px; overflow: hidden; }
.pi-col { flex: 1; min-width: 0; min-height: 0; overflow: hidden; border-radius: 12px; background: #FAFAFD; border: 1px solid var(--pi-line); padding: 8px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.pi-col.open { flex: 2.15; background: #fff; }
.pi-col.done { border-style: dashed; background: transparent; }
.pi-col-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 2px 4px; }
.pi-col-h i { width: 7px; height: 7px; border-radius: 999px; }
.pi-col-h i.violet { background: var(--pi-violet); } .pi-col-h i.amber { background: var(--pi-amber); } .pi-col-h i.mint { background: var(--pi-mint); }
.pi-col-h .pi-ic { width: 11px; height: 11px; color: var(--pi-muted); }
.pi-col-h .pi-ic:last-child { margin-left: auto; }
.pi-col-n { font-style: normal; font-weight: 600; color: var(--pi-muted); }
.pi-col-split { display: flex; gap: 8px; flex: 1; min-height: 0; }
.pi-lane { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pi-lane.parked { background: #FAFAFD; border-radius: 10px; padding: 8px; border: 1px solid var(--pi-line); }
.pi-lane-h { display: flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pi-violet); padding: 2px 2px; }
.pi-lane.parked .pi-lane-h { color: var(--pi-ink); }
.pi-lane-h em { font-style: normal; font-weight: 600; color: var(--pi-muted); letter-spacing: 0; }
.pi-lane-h.dim { color: var(--pi-muted); border-top: 1px dashed var(--pi-line); padding-top: 8px; margin-top: 2px; }
.pi-lane p { font-size: 10px; color: var(--pi-muted); line-height: 1.35; }
.pi-lane p.center { text-align: center; padding: 8px 0; }
.pi-tcard { border-radius: 10px; background: #fff; border: 1px solid var(--pi-line); padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgb(20 20 31 / .04); position: relative; }
.pi-tcard-top { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--pi-muted); }
.pi-kind { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: 5px; background: #E3F8EF; color: #0B7A52; font-size: 8.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pi-id { font-family: var(--font-mono, ui-monospace, monospace); font-size: 9.5px; }
.pi-cnt { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
.pi-cnt .pi-ic { width: 11px; height: 11px; }
.pi-tcard > b { font-size: 11.5px; line-height: 1.3; letter-spacing: -.01em; }
.pi-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.pi-tcard-foot { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--pi-ink); flex-wrap: wrap; }
.pi-tcard-foot .pi-av { width: 16px; height: 16px; font-size: 6.5px; }
.pi-tcard-foot i { font-style: normal; color: var(--pi-muted); margin-left: auto; white-space: nowrap; }
.pi-avs { display: inline-flex; }
.pi-avs .pi-av { width: 15px; height: 15px; font-size: 6px; margin-left: -4px; box-shadow: 0 0 0 1.5px #fff; }
.pi-sla { display: inline-flex; align-items: center; gap: 4px; height: 17px; padding: 0 6px; border-radius: 999px; background: #FFF4DB; color: #A66A00; font-size: 9px; font-weight: 700; white-space: nowrap; }
.pi-sla i { width: 6px; height: 6px; border-radius: 999px; background: currentColor; margin: 0; animation: pi-pulse 1.4s ease-in-out infinite; }
.pi-tcard.parked { opacity: .85; }
.pi-slot { height: 0; overflow: hidden; }
.pi-empty { text-align: center; font-size: 10.5px; color: var(--pi-muted); margin-top: 20px; }
.pi-announce { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: #FFF0F7; border: 1px solid #FFD3E6; opacity: 0; transform: translateY(8px); }
.pi-announce .pi-ic { color: #D62D53; }
.pi-announce span { display: flex; flex-direction: column; line-height: 1.25; }
.pi-announce b { font-size: 10.5px; }
.pi-announce i { font-style: normal; font-size: 9.5px; color: var(--pi-muted); }
.pi-ghost { position: absolute; left: 0; top: 0; width: var(--w, 120px); opacity: 0; pointer-events: none; z-index: 5; transform: translate(var(--x0), var(--y0)); }
.pi-ghost .pi-tcard { box-shadow: 0 18px 40px hsl(260 100% 69% / .25), 0 2px 6px rgb(0 0 0 / .08); border-color: #C9B5FF; }
/* SLA chip swap + Done count flip (ghost card only) */
.pi-sla-wrap { position: relative; display: inline-flex; }
.pi-sla-wrap .pi-sla.done { position: absolute; left: 0; top: 0; background: #E3F8EF; color: #0B7A52; opacity: 0; }
.pi-sla.done .pi-ic { width: 9px; height: 9px; }
.pi-col-n.flip { position: relative; display: inline-block; }
.pi-col-n.flip .b { position: absolute; left: 0; top: 0; opacity: 0; }
.pi-kanban.is-on .pi-sla-wrap .pi-sla.open { animation: pi-fade-out .3s ease 9.2s both; }
.pi-kanban.is-on .pi-sla-wrap .pi-sla.done { animation: pi-pop .4s cubic-bezier(.34,1.56,.64,1) 9.3s both; }
.pi-kanban.is-on .pi-col-n.flip .a { animation: pi-fade-out .3s ease 9s both; }
.pi-kanban.is-on .pi-col-n.flip .b { animation: pi-in .3s ease 9.1s both; }
.pi-kanban.is-static .pi-sla-wrap .pi-sla.open, .pi-kanban.is-static .pi-col-n.flip .a { opacity: 0; }
.pi-kanban.is-static .pi-sla-wrap .pi-sla.done, .pi-kanban.is-static .pi-col-n.flip .b { opacity: 1; }
/* KANBAN timeline */
.pi-kanban .pi-tcard.moving { opacity: 0; transform: translateY(-10px); }
.pi-kanban.is-on .pi-tcard.moving { animation: pi-card-life 14s linear both; }
.pi-kanban.is-on .pi-ghost { animation: pi-ghost 14s cubic-bezier(.22,1,.36,1) both; }
.pi-kanban.is-on .pi-slot.slot-progress { animation: pi-slot 14s linear both; --open: 27%; --close: 60%; }
.pi-kanban.is-on .pi-slot.slot-done { animation: pi-slot-done 14s linear both; }
.pi-kanban.is-on .pi-announce { animation: pi-in .5s cubic-bezier(.22,1,.36,1) 10.4s both; }
.pi-kanban.is-on .pi-col.done .pi-empty { animation: pi-fade-out .3s ease 8.6s both; }
.pi-kanban.is-static .pi-tcard.moving { opacity: 1; transform: none; }
.pi-kanban.is-static .pi-announce { opacity: 1; transform: none; }
@keyframes pi-card-life { 0%, 4% { opacity: 0; transform: translateY(-10px); max-height: 140px; } 8%, 22% { opacity: 1; transform: none; max-height: 140px; } 23%, 100% { opacity: 0; max-height: 0; padding: 0; margin: 0; border-width: 0; } }
/* ghost: appears in place at 22%, moves to progress slot by 30%, to done slot 58–66%, fades at 95% */
@keyframes pi-ghost {
  0%, 22% { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(1); }
  22.5% { opacity: 1; transform: translate(var(--x0), var(--y0)) scale(1.04); }
  30%, 57% { opacity: 1; transform: translate(var(--x1), var(--y1)) scale(1); }
  58% { transform: translate(var(--x1), var(--y1)) scale(1.04); }
  66%, 94% { opacity: 1; transform: translate(var(--x2), var(--y2)) scale(1); }
  100% { opacity: 0; transform: translate(var(--x2), var(--y2)) scale(1); }
}
@keyframes pi-slot { 0%, 23% { height: 0; margin-bottom: -8px; } 27%, 58% { height: var(--h, 110px); margin-bottom: 0; } 62%, 100% { height: 0; margin-bottom: -8px; } }
@keyframes pi-slot-done { 0%, 58% { height: 0; margin-bottom: -8px; } 62%, 100% { height: var(--h, 110px); margin-bottom: 0; } }

/* ============================================================
   NPS scene
   ============================================================ */
.pi-filters { border: 1px solid var(--pi-line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.pi-filters-row { display: flex; align-items: center; gap: 4px; padding: 8px 10px; }
.pi-filters-row > .pi-ic { color: var(--pi-muted); margin-right: 4px; }
.pi-filters-row > span:not(.pi-pill):not(.pi-toggle) { padding: 5px 9px; border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--pi-muted); }
.pi-filters-row > span.on { background: var(--pi-ink); color: #fff; }
.pi-filters-row .pi-pill.right { margin-left: auto; }
.pi-filters-row .pi-pill b { font-weight: 800; }
.pi-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; margin-left: 6px; }
.pi-toggle .pi-ic { color: var(--pi-muted); }
.pi-toggle i { width: 30px; height: 17px; border-radius: 999px; background: #E3E4EE; position: relative; }
.pi-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.pi-filters-note { padding: 8px 12px; background: #F7F5FF; border-top: 1px solid var(--pi-line); font-size: 11px; color: var(--pi-ink); }
.pi-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--pi-line); margin-bottom: 12px; }
.pi-tabs span { padding: 4px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--pi-muted); display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pi-tabs span.on { color: var(--pi-violet); border-bottom-color: var(--pi-violet); }
.pi-stats { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; border: 1px solid var(--pi-line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.pi-stat { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; font-size: 11px; color: var(--pi-muted); position: relative; }
.pi-stat b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--pi-ink); line-height: 1; }
.pi-stat b.red { color: #D62D53; }
.pi-stat.main { padding-left: 0; border-right: 1px solid var(--pi-line); margin-right: 8px; }
.pi-stat-v { display: flex; align-items: center; gap: 10px; }
.pi-stat-v b.big { font-size: 40px; }
.pi-followup { position: absolute; right: 0; bottom: 0; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--pi-ink); color: #fff; font-size: 9.5px; font-weight: 700; box-shadow: 0 6px 14px rgb(20 20 31 / .2); opacity: 0; transform: translateY(6px) scale(.9); }
.pi-followup .pi-ic { width: 10px; height: 10px; color: #C9B5FF; }
.pi-chart-card { flex: 1; min-height: 0; border: 1px solid var(--pi-line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.pi-chart-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pi-chart-h span:not(.pi-chart-ic) { display: flex; flex-direction: column; line-height: 1.25; }
.pi-chart-h b { font-size: 13px; font-weight: 800; }
.pi-chart-h i { font-style: normal; font-size: 10.5px; color: var(--pi-muted); }
.pi-chart-ic { width: 32px; height: 32px; border-radius: 9px; background: #EFE8FF; color: var(--pi-violet); display: grid; place-items: center; flex: none; }
.pi-chart { flex: 1; min-height: 0; display: flex; gap: 8px; }
.pi-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 9.5px; color: var(--pi-muted); padding: 2px 0; width: 24px; text-align: right; }
.pi-chart-svg { flex: 1; height: 100%; overflow: visible; }
.pi-npath, .pi-npath-glow { stroke-dasharray: 1; stroke-dashoffset: 1; }
.pi-npt { opacity: 0; transform-box: fill-box; transform-origin: center; }
.pi-nps.is-on .pi-npath, .pi-nps.is-on .pi-npath-glow { animation: pi-draw 2.6s cubic-bezier(.4,0,.2,1) .5s both; }
.pi-nps.is-on .pi-npt { animation: pi-npt .45s cubic-bezier(.34,1.56,.64,1) calc(.55s + var(--i) * .16s) both; }
.pi-nps.is-on .pi-followup { animation: pi-pop .5s cubic-bezier(.34,1.56,.64,1) 4.2s both; }
.pi-nps.is-static .pi-npath, .pi-nps.is-static .pi-npath-glow { stroke-dashoffset: 0; }
.pi-nps.is-static .pi-npt { opacity: 1; }
.pi-nps.is-static .pi-followup { opacity: 1; transform: none; }
@keyframes pi-draw { to { stroke-dashoffset: 0; } }
@keyframes pi-npt { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: scale(1); } }

/* ============================================================
   MONITORING scene
   ============================================================ */
.pi-monitoring .pi-main { padding: 12px; background: var(--pi-canvas); }
.pi-panel { flex: 1; min-height: 0; border: 1px solid var(--pi-line); border-radius: 14px; background: #fff; padding: 16px 18px; display: flex; flex-direction: column; box-shadow: 0 1px 2px hsl(260 100% 69% / .04), 0 8px 24px hsl(260 100% 69% / .05); }
.pi-range { font-size: 10.5px; white-space: nowrap; color: var(--pi-muted); }
.pi-range b { color: var(--pi-ink); }
.pi-seg { display: flex; align-items: center; gap: 10px; font-size: 10.5px; font-weight: 600; color: var(--pi-muted); white-space: nowrap; }
.pi-seg .on { color: var(--pi-violet); border-bottom: 2px solid var(--pi-violet); padding-bottom: 2px; }
.pi-seg a { color: var(--pi-violet); font-weight: 700; }
.pi-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; border-top: 1px solid var(--pi-line); padding-top: 12px; margin-bottom: 10px; }
.pi-kpi { border-left: 2px solid var(--pi-violet); padding-left: 10px; display: flex; flex-direction: column; gap: 4px; }
.pi-kpi.violet2 { border-color: #B08CFF; } .pi-kpi.mint { border-color: var(--pi-mint); } .pi-kpi.amber { border-color: var(--pi-amber); }
.pi-kpi .pi-label { font-size: 8.5px; line-height: 1.3; min-height: 22px; }
.pi-kpi b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pi-kpi i { font-style: normal; font-size: 9.5px; color: var(--pi-muted); line-height: 1.3; }
.pi-delta { font-size: 10px; font-weight: 700; }
.pi-delta i { font-style: normal; color: var(--pi-ink); }
.pi-delta i.up { color: #0B7A52; } .pi-delta i.down { color: #0B7A52; }
.pi-inline { display: flex; gap: 18px; align-items: center; padding: 10px 0; border-top: 1px solid var(--pi-line); border-bottom: 1px solid var(--pi-line); font-size: 11px; color: var(--pi-muted); margin-bottom: 12px; white-space: nowrap; }
.pi-inline b { font-size: 15px; color: var(--pi-ink); margin-right: 2px; }
.pi-inline .ok { margin-left: auto; color: #0B7A52; font-weight: 700; }
.pi-mon-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; }
.pi-mon-grid > div { display: flex; flex-direction: column; min-height: 0; }
.pi-legend { display: flex; gap: 12px; font-size: 9.5px; color: var(--pi-muted); margin-bottom: 8px; }
.pi-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pi-legend i, .pi-out-l i { width: 7px; height: 7px; border-radius: 999px; }
.pi i.mint { background: var(--pi-mint); } .pi i.violet { background: var(--pi-violet); } .pi i.amber { background: var(--pi-amber); } .pi i.grey { background: #A0A1B2; }
.pi-bars { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 14px; padding: 0 8px; position: relative; }
.pi-bars-grid { position: absolute; inset: 0 8px 16px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.pi-bars-grid i { display: block; height: 1px; background: var(--pi-line); }
.pi-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; position: relative; }
.pi-bar-col span { font-size: 9px; color: var(--pi-muted); }
.pi-bar-stack { width: 22px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 2px 2px; overflow: hidden; transform-origin: bottom; transform: scaleY(0); }
.pi-bar-stack i { display: block; }
.pi-outs { display: flex; flex-direction: column; gap: 9px; margin-top: 2px; }
.pi-out { display: grid; grid-template-columns: 1fr auto; row-gap: 4px; font-size: 11px; }
.pi-out-l { display: flex; align-items: center; gap: 6px; }
.pi-out-n { display: flex; align-items: baseline; gap: 5px; }
.pi-out-n b { font-size: 12px; } .pi-out-n em { font-style: normal; color: var(--pi-muted); font-size: 10px; }
.pi-out-bar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: #EEEFF5; overflow: hidden; }
.pi-out-bar i { display: block; height: 100%; width: var(--w); border-radius: 999px; transform: scaleX(0); transform-origin: left; }
.pi-suggest { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; background: linear-gradient(90deg, #F5F0FF, #EEF7FF); border: 1px solid #E2D6FF; opacity: 0; transform: translateY(8px); }
.pi-suggest > .pi-ic { color: var(--pi-violet); width: 16px; height: 16px; }
.pi-suggest span:not(.pi-btn) { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.pi-suggest b { font-size: 10.5px; }
.pi-suggest i { font-style: normal; font-size: 9.5px; color: var(--pi-muted); }
.pi-monitoring.is-on .pi-bar-stack { animation: pi-grow .7s cubic-bezier(.22,1,.36,1) calc(.3s + var(--i) * .12s) both; }
.pi-monitoring.is-on .pi-out-bar i { animation: pi-fill 1.1s cubic-bezier(.22,1,.36,1) .8s both; }
.pi-monitoring.is-on .pi-suggest { animation: pi-in .5s cubic-bezier(.22,1,.36,1) 3.6s both; }
.pi-monitoring.is-on .pi-suggest .pi-btn { animation: pi-btn-press .6s ease 6.4s both; }
.pi-monitoring.is-static .pi-bar-stack { transform: none; }
.pi-monitoring.is-static .pi-out-bar i { transform: none; }
.pi-monitoring.is-static .pi-suggest { opacity: 1; transform: none; }
@keyframes pi-grow { to { transform: scaleY(1); } }
@keyframes pi-fill { to { transform: scaleX(1); } }

/* ---------- shared keyframes ---------- */
@keyframes pi-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pi-pop { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pi-fade-out { to { opacity: 0; } }
@keyframes pi-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes pi-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-3px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pi *, .pi *::before, .pi *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ============================================================
   TOUR scene — the widget from the bubble, step-driven (data-step)
   ============================================================ */
.pi-tour .pi-scene { background: #EEF0F6; }
.pi-tour .pi-drawer { width: 380px; transform: translateX(104%); transition: transform .55s cubic-bezier(.22,1,.36,1), width .3s ease-in-out; }
.pi-tour[data-step="thread"] .pi-drawer, .pi-tour[data-step="routed"] .pi-drawer, .pi-tour[data-step="csat"] .pi-drawer { width: 440px; }
/* narrow container: the drawer fills the width, like the real widget on a phone */
.pi.is-narrow .pi-drawer { width: 100% !important; box-shadow: none; }
.pi.is-narrow .pi-host-side { display: none; }
.pi.is-narrow .pi-nps-pop { width: calc(100% - 52px); }
.pi.is-narrow .pi-fab-tip { display: none; }
.pi-tour[data-step="home"] .pi-drawer, .pi-tour[data-step="thread"] .pi-drawer, .pi-tour[data-step="routed"] .pi-drawer, .pi-tour[data-step="csat"] .pi-drawer, .pi-tour[data-step="news"] .pi-drawer, .pi-tour[data-step="kb"] .pi-drawer, .pi-tour[data-step="article"] .pi-drawer, .pi-tour[data-step="survey"] .pi-drawer { transform: translateX(0); }
.pi-tour .pi-fab { transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .2s ease; }
.pi-tour:not([data-step="nps"]):not([data-step="thanks"]):not([data-step="bug"]):not([data-step="close"]) .pi-fab { opacity: 0; transform: scale(.4); }
.pi-tour[data-step="rec"] .pi-fab { opacity: 0; }
.pi-tour[data-step="bug"] .pi-fab-glow { animation: pi-fab-glow 1.2s ease-in-out infinite; }
.pi-tour[data-step="close"] .pi-fab { animation: pi-fab-arrive .65s cubic-bezier(.22,1,.36,1) both; }
.pi-tour .pi-fab-badge { opacity: 1; transform: none; }
.pi-tour[data-step="nps"] .pi-fab-glow { animation: pi-fab-glow 1.6s ease-in-out infinite; }
@keyframes pi-fab-arrive { 0% { opacity: 0; transform: translateY(-420px) rotate(-540deg) scale(.45); } 10% { opacity: 1; } 62% { transform: translateY(0) rotate(0) scale(1.14); } 78% { transform: translateY(-10px) scale(.96); } 100% { opacity: 1; transform: none; } }

/* NPS popup above the bubble */
.pi-nps-pop { position: absolute; right: 26px; bottom: 104px; width: 316px; background: #fff; border-radius: 16px; box-shadow: 0 18px 44px rgb(20 20 31 / .18), 0 2px 6px rgb(0 0 0 / .06); padding: 14px 16px; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .3s ease, transform .35s cubic-bezier(.22,1,.36,1); }
.pi-nps-pop::after { content: ""; position: absolute; right: 26px; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); }
.pi-tour[data-step="nps"] .pi-nps-pop, .pi-tour[data-step="thanks"] .pi-nps-pop { opacity: 1; transform: none; }
.pi-nps-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 11px; }
.pi-nps-head i { font-style: normal; color: var(--pi-muted); margin-left: auto; }
.pi-nps-q p { font-size: 12.5px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.pi-nps-scale { display: flex; gap: 4px; margin-top: 10px; }
.pi-nps-scale i { flex: 1; height: 24px; border-radius: 7px; border: 1px solid var(--pi-line); display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--pi-ink); background: #fff; }
.pi-nps-scale i.on { background: var(--pi-violet); color: #fff; border-color: var(--pi-violet); box-shadow: 0 6px 14px hsl(260 100% 69% / .35); }
.pi-tour[data-step="nps"] .pi-nps-scale i.on { animation: pi-nps-pick 2.6s ease both; }
@keyframes pi-nps-pick { 0%, 55% { background: #fff; color: var(--pi-ink); border-color: var(--pi-line); box-shadow: none; transform: none; } 62% { transform: scale(1.18); } 70%, 100% { background: var(--pi-violet); color: #fff; border-color: var(--pi-violet); transform: none; } }
.pi-nps-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 9.5px; color: var(--pi-muted); }
.pi-nps-thanks { display: none; align-items: center; gap: 10px; }
.pi-nps-thanks .pi-ic { width: 22px; height: 22px; color: #0B7A52; }
.pi-nps-thanks span { display: flex; flex-direction: column; line-height: 1.3; }
.pi-nps-thanks b { font-size: 12.5px; }
.pi-nps-thanks i { font-style: normal; font-size: 10.5px; color: var(--pi-muted); }
.pi-tour[data-step="thanks"] .pi-nps-q { display: none; }
.pi-tour[data-step="thanks"] .pi-nps-thanks { display: flex; animation: pi-in .4s ease both; }

/* panes */
.pi-panes { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.pi-pane { display: none; flex: 1; min-height: 0; flex-direction: column; overflow: hidden; }
.pi-pane.is-show { display: flex; animation: pi-in .4s cubic-bezier(.22,1,.36,1) both; }
.pi-tour[data-step="home"] .pi-pane-home, .pi-tour[data-step="thread"] .pi-pane-thread, .pi-tour[data-step="routed"] .pi-pane-thread, .pi-tour[data-step="csat"] .pi-pane-thread, .pi-tour[data-step="news"] .pi-pane-news, .pi-tour[data-step="kb"] .pi-pane-kb, .pi-tour[data-step="article"] .pi-pane-kb, .pi-tour[data-step="survey"] .pi-pane-survey { display: flex; animation: pi-in .4s cubic-bezier(.22,1,.36,1) both; }
.pi-tour[data-step="csat"] .pi-pane-thread, .pi-tour[data-step="article"] .pi-pane-kb { animation: none; }
.pi-tour[data-step="routed"] .pi-pane-thread { animation: pi-in .4s cubic-bezier(.22,1,.36,1) both; }
.pi-pane-h { padding: 14px 16px 6px; }
.pi-pane-h h4 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.pi-pane-h p { font-size: 11px; color: var(--pi-muted); margin-top: 3px; }

/* tab bar */
.pi-tabbar { display: flex; border-top: 1px solid var(--pi-line); background: #fff; flex: none; }
.pi-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; font-size: 9.5px; color: var(--pi-muted); }
.pi-tab .pi-ic { width: 16px; height: 16px; }
.pi-tab b { font-weight: 600; }
.pi-tour[data-step="home"] .pi-tab[data-tab="home"], .pi-tour[data-step="thread"] .pi-tab[data-tab="home"], .pi-tour[data-step="routed"] .pi-tab[data-tab="home"], .pi-tour[data-step="csat"] .pi-tab[data-tab="home"], .pi-tour[data-step="survey"] .pi-tab[data-tab="home"], .pi-tour[data-step="news"] .pi-tab[data-tab="news"], .pi-tour[data-step="kb"] .pi-tab[data-tab="kb"], .pi-tour[data-step="article"] .pi-tab[data-tab="kb"] { color: var(--pi-violet); }
.pi-tour[data-step="news"] .pi-tab[data-tab="news"] .pi-ic, .pi-tour[data-step="kb"] .pi-tab[data-tab="kb"] .pi-ic { animation: pi-pop .35s cubic-bezier(.34,1.56,.64,1) both; }

/* home */
.pi-home-hero { padding: 16px 16px 14px; background: linear-gradient(160deg, #F3EEFF 0%, #EAF7FF 55%, #fff 100%); border-bottom: 1px solid var(--pi-line); }
.pi-home-hi { font-size: 11px; font-weight: 700; color: var(--pi-violet); }
.pi-home-hero h4 { margin: 4px 0 12px; font-size: 17px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.pi-ask { position: relative; display: flex; align-items: center; height: 40px; padding: 0 6px 0 14px; border-radius: 12px; border: 1px solid #D9D2F5; background: #fff; box-shadow: 0 6px 18px hsl(260 100% 69% / .10); font-size: 12px; overflow: hidden; }
.pi-ask-ph { color: var(--pi-soft); flex: 1; }
.pi-ask-typed { position: absolute; left: 14px; top: 0; line-height: 40px; white-space: nowrap; overflow: hidden; width: 0; color: var(--pi-ink); border-right: 2px solid var(--pi-violet); }
.pi-ask b { margin-left: auto; width: 28px; height: 28px; border-radius: 9px; background: var(--pi-violet); color: #fff; display: grid; place-items: center; flex: none; }
.pi-ask b .pi-ic { color: #fff; }
.pi-tour[data-step="home"] .pi-ask-typed { animation: pi-type 1.5s steps(38) 1s both; }
.pi-tour[data-step="home"] .pi-ask-ph { animation: pi-fade-out .1s ease 1s both; }
@keyframes pi-type { from { width: 0; } to { width: 262px; } }
.pi-chips-row { display: flex; gap: 6px; margin-top: 10px; }
.pi-chips-row span { padding: 5px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--pi-line); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.pi-recent { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.pi-recent-h { display: flex; justify-content: space-between; font-size: 12px; }
.pi-recent-h i { font-style: normal; color: var(--pi-violet); font-weight: 700; font-size: 11px; }
.pi-recent-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--pi-line); background: #fff; }
.pi-recent-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pi-recent-row b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-recent-row i { font-style: normal; font-size: 10px; color: var(--pi-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-recent-row em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--pi-muted); white-space: nowrap; }
.pi-recent-row em.ok { color: #0B7A52; background: #E3F8EF; padding: 2px 7px; border-radius: 999px; }

/* thread + csat */
.pi-tour .pi-thread { gap: 10px; }
.pi-tour .pi-msg, .pi-tour .pi-typing { opacity: 0; transform: translateY(8px); }
.pi-tour .pi-typing { display: none; }
.pi-tour[data-step="thread"] .pi-msg.me, .pi-tour[data-step="routed"] .pi-msg.me, .pi-tour[data-step="csat"] .pi-msg.me { animation: pi-in .4s ease .3s both; }
.pi-tour[data-step="thread"] .pi-typing { display: flex; animation: pi-typing-once 2.3s linear .8s both; }
.pi-tour[data-step="thread"] .pi-msg.agent, .pi-tour[data-step="routed"] .pi-msg.agent, .pi-tour[data-step="csat"] .pi-msg.agent { animation: pi-in .45s cubic-bezier(.22,1,.36,1) 2.9s both; }
.pi-tour[data-step="thread"] .pi-msg.agent.routed { animation: none; }
.pi-tour[data-step="routed"] .pi-msg.me, .pi-tour[data-step="routed"] .pi-msg.agent:not(.routed), .pi-tour[data-step="csat"] .pi-msg.me, .pi-tour[data-step="csat"] .pi-msg.agent { animation-delay: 0s; animation-duration: .01s; }
.pi-tour[data-step="routed"] .pi-msg.agent.routed { animation: pi-in .5s cubic-bezier(.22,1,.36,1) .6s both; }
.pi-tour[data-step="routed"] .pi-msg.agent:not(.routed), .pi-tour[data-step="csat"] .pi-msg.agent:not(.routed) { display: none; }
.pi-tour[data-step="thread"] .pi-recbtn { animation: pi-btn-press .5s ease 4s both; }
.pi-tour[data-step="csat"] .pi-msg.agent.routed .pi-fields { display: none; }
.pi-tour[data-step="csat"] .pi-msg.agent.routed .pi-routed-card { animation: none; }
@keyframes pi-typing-once { 0% { opacity: 0; transform: translateY(8px); } 12%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.pi-tour[data-step="routed"] .pi-wsub-close { animation: pi-btn-press .5s ease 3.2s both; }
.pi-csat { display: none; margin-top: auto; padding: 12px 14px; border-radius: 14px; border: 1px solid #E2D6FF; background: linear-gradient(135deg, #F7F3FF, #FFF); box-shadow: 0 10px 24px hsl(260 100% 69% / .12); flex-direction: column; gap: 6px; }
.pi-csat b { font-size: 12.5px; }
.pi-faces { display: flex; gap: 6px; margin-top: 2px; }
.pi-faces i { flex: 1; height: 34px; border-radius: 10px; border: 1px solid var(--pi-line); background: #fff; display: grid; place-items: center; font-style: normal; font-size: 17px; }
.pi-faces i.on { border-color: var(--pi-violet); background: #EFE8FF; }
.pi-csat-thanks { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: #0B7A52; opacity: 0; }
.pi-csat-thanks .pi-ic { width: 12px; height: 12px; }
.pi-tour[data-step="csat"] .pi-csat { display: flex; animation: pi-in .45s cubic-bezier(.22,1,.36,1) both; }
.pi-tour[data-step="csat"] .pi-faces i.on { animation: pi-face-pick 1.6s ease both; }
.pi-tour[data-step="csat"] .pi-csat-thanks { animation: pi-in .4s ease 1.7s both; }
@keyframes pi-face-pick { 0%, 55% { border-color: var(--pi-line); background: #fff; transform: none; } 65% { transform: scale(1.22); } 75%, 100% { border-color: var(--pi-violet); background: #EFE8FF; transform: none; } }

/* announcements */
.pi-news { padding: 6px 16px; display: flex; flex-direction: column; gap: 8px; }
.pi-news-card { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--pi-line); background: #fff; display: flex; flex-direction: column; gap: 4px; }
.pi-news-card.new { border-color: #E2D6FF; box-shadow: 0 8px 20px hsl(260 100% 69% / .10); }
.pi-news-meta { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--pi-muted); }
.pi-news-meta i { font-style: normal; }
.pi-tag.hot { background: #EFE8FF; color: var(--pi-violet); }
.pi-news-card b { font-size: 12px; letter-spacing: -.01em; }
.pi-news-card p { font-size: 10.5px; color: var(--pi-muted); line-height: 1.4; }
.pi-news-from { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 10px; font-weight: 700; color: #0B7A52; }
.pi-news-from .pi-ic { width: 11px; height: 11px; }
.pi-tour[data-step="news"] .pi-news-card { animation: pi-in .45s cubic-bezier(.22,1,.36,1) both; }
.pi-tour[data-step="news"] .pi-news-card:nth-child(2) { animation-delay: .15s; }
.pi-tour[data-step="news"] .pi-news-card:nth-child(3) { animation-delay: .3s; }

/* knowledge base */
.pi-pane-kb .pi-search { margin: 6px 16px 8px; flex: none; }
.pi-kb-typed { color: var(--pi-ink); white-space: nowrap; overflow: hidden; width: 0; border-right: 2px solid var(--pi-violet); }
.pi-tour[data-step="kb"] .pi-kb-typed { animation: pi-type-kb 1s steps(10) .5s both; }
@keyframes pi-type-kb { from { width: 0; } to { width: 60px; } }
.pi-kb-cats { display: flex; gap: 6px; padding: 0 16px 10px; }
.pi-kb-cats span { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--pi-line); font-size: 10px; font-weight: 600; color: var(--pi-muted); }
.pi-kb-cats span.on { background: var(--pi-ink); color: #fff; border-color: var(--pi-ink); }
.pi-kb-rows { padding: 0 16px; display: flex; flex-direction: column; gap: 6px; }
.pi-kb-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--pi-line); background: #fff; }
.pi-kb-row > .pi-ic:first-child { color: var(--pi-violet); }
.pi-kb-row > .pi-ic:last-child { color: var(--pi-soft); width: 12px; }
.pi-kb-row span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pi-kb-row b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-kb-row i { font-style: normal; font-size: 10px; color: var(--pi-muted); }
.pi-tour[data-step="kb"] .pi-kb-row { animation: pi-in .4s ease 1.3s both; }
.pi-tour[data-step="kb"] .pi-kb-row.hit { animation: pi-in .4s ease 1.3s both, pi-row-hl .6s ease 2.4s both; }
@keyframes pi-row-hl { 0%, 100% { border-color: var(--pi-line); background: #fff; } 50% { border-color: var(--pi-violet); background: #F7F3FF; } }
.pi-article { position: absolute; inset: 0; background: #fff; display: none; flex-direction: column; }
.pi-tour[data-step="article"] .pi-article { display: flex; animation: pi-slide-in .4s cubic-bezier(.22,1,.36,1) both; }
@keyframes pi-slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pi-article-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pi-article-body i { display: block; height: 8px; border-radius: 999px; background: #EAEBF2; }
.pi-article-body .w40 { width: 40%; } .pi-article-body .w60 { width: 60%; } .pi-article-body .w70 { width: 70%; } .pi-article-body .w80 { width: 80%; } .pi-article-body .w85 { width: 85%; } .pi-article-body .w90 { width: 90%; }
.pi-article-img { height: 56px; border-radius: 10px; background: linear-gradient(135deg, #EFE8FF, #E3F4FF); margin: 3px 0; }
.pi-vote-row { display: flex; align-items: center; gap: 6px; padding: 10px 16px 12px; border-top: 1px solid var(--pi-line); font-size: 11px; }
.pi-vote-row b { flex: 1; }
.pi-vote-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--pi-line); font-size: 10.5px; font-weight: 700; background: #fff; }
.pi-vote-btn .pi-ic { width: 11px; height: 11px; }
.pi-vote-btn.down .pi-ic { transform: rotate(180deg); }
.pi-vote-btn.on { border-color: #0B7A52; color: #0B7A52; background: #E3F8EF; }
.pi-tour[data-step="article"] .pi-vote-btn.on { animation: pi-vote-pick 1.4s ease both; }
@keyframes pi-vote-pick { 0%, 60% { border-color: var(--pi-line); color: var(--pi-ink); background: #fff; transform: none; } 70% { transform: scale(1.15); } 80%, 100% { border-color: #0B7A52; color: #0B7A52; background: #E3F8EF; transform: none; } }

/* questionnaire */
.pi-qcard { margin: 6px 16px; padding: 14px; border-radius: 14px; border: 1px solid var(--pi-line); background: #fff; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 20px hsl(260 100% 69% / .08); }
.pi-qprog { height: 4px; border-radius: 999px; background: #EEEFF5; overflow: hidden; }
.pi-qprog i { display: block; height: 100%; width: 50%; background: var(--pi-violet); border-radius: 999px; transform: scaleX(0); transform-origin: left; }
.pi-tour[data-step="survey"] .pi-qprog i { animation: pi-fill .8s cubic-bezier(.22,1,.36,1) .3s both; }
.pi-qcard > b { font-size: 13px; letter-spacing: -.01em; line-height: 1.3; }
.pi-qopts { display: flex; flex-direction: column; gap: 6px; }
.pi-qopts span { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--pi-line); font-size: 11.5px; font-weight: 600; }
.pi-qopts span::before { content: ""; width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid #C9CAD6; flex: none; }
.pi-qopts span.on { border-color: var(--pi-violet); background: #F7F3FF; }
.pi-qopts span.on::before { border: 4px solid var(--pi-violet); }
.pi-tour[data-step="survey"] .pi-qopts span.on { animation: pi-opt-pick 1.6s ease both; }
@keyframes pi-opt-pick { 0%, 60% { border-color: var(--pi-line); background: #fff; } 75%, 100% { border-color: var(--pi-violet); background: #F7F3FF; } }
.pi-qfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.pi-qfoot i { font-style: normal; font-size: 9.5px; color: var(--pi-muted); }
.pi-qfoot .pi-btn .pi-ic { width: 11px; height: 11px; color: #fff; }
.pi-tour[data-step="survey"] .pi-qfoot .pi-btn { animation: pi-btn-press .5s ease 2.6s both; }

/* narrow container refinements */
.pi-wh-txt { min-width: 0; }
.pi-wh-txt b, .pi-wh-txt i { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi.is-narrow .pi-wsub-part { display: none; }
.pi.is-narrow .pi-wsub-close { margin-left: auto; }
.pi.is-narrow .pi-wh-actions .pi-wh-div, .pi.is-narrow .pi-wh-actions > .pi-ic:not(:last-child) { display: none; }


/* bug marker on the host app, recording bar, moving cursor */
.pi-bugmark { position: absolute; left: 44%; top: 46%; opacity: 0; transform: scale(.6); z-index: 2; }
.pi-bugmark-ring { position: absolute; left: -12px; top: -12px; width: 56px; height: 56px; border-radius: 50%; border: 2px solid #FF4A7A; opacity: 0; }
.pi-bugmark-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 8px 22px rgb(255 74 122 / .35), 0 2px 6px rgb(0 0 0 / .1); font-size: 18px; border: 2px solid #FF4A7A; }
.pi-bugmark-tip { position: absolute; left: 42px; top: 2px; padding: 6px 10px; border-radius: 9px; background: var(--pi-ink); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px rgb(0 0 0 / .2); opacity: 0; transform: translateX(-6px); }
.pi-bugmark-tip::before { content: ""; position: absolute; left: -4px; top: 10px; width: 8px; height: 8px; background: var(--pi-ink); transform: rotate(45deg); }
.pi-tour[data-step="bug"] .pi-bugmark, .pi-tour[data-step="rec"] .pi-bugmark { animation: pi-pop .45s cubic-bezier(.34,1.56,.64,1) both; }
.pi-tour[data-step="bug"] .pi-bugmark-ring { animation: pi-ring 1.3s ease-out .3s infinite; }
.pi-tour[data-step="bug"] .pi-bugmark-tip { animation: pi-tip-in .4s ease .5s both; }
.pi-tour[data-step="rec"] .pi-bugmark-ic { animation: pi-shake .5s ease 2.2s 2; }
@keyframes pi-ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes pi-tip-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes pi-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px) rotate(-6deg); } 75% { transform: translateX(3px) rotate(6deg); } }
.pi-tag.bug { background: #FFE9EE; color: #D62D53; margin-right: 6px; vertical-align: 1px; }
.pi-recbtn { display: flex; width: fit-content; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 11px; border-radius: 999px; background: var(--pi-violet); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 6px 14px hsl(260 100% 69% / .3); }
.pi-recbtn .pi-ic { color: #fff; width: 13px; height: 13px; }
.pi-recbar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--pi-ink); color: #fff; font-size: 11px; transform: translateY(-110%); transition: transform .4s cubic-bezier(.22,1,.36,1); z-index: 3; }
.pi-recbar b { font-weight: 600; }
.pi-recbar em { font-style: normal; font-family: var(--font-mono, ui-monospace, monospace); }
.pi-rec { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; letter-spacing: .1em; font-size: 10px; color: #FF4A7A; }
.pi-rec i { width: 8px; height: 8px; border-radius: 50%; background: #FF4A7A; animation: pi-pulse 1s ease-in-out infinite; }
.pi-rec-mask { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: #C9C9D8; }
.pi-rec-mask .pi-ic { width: 12px; height: 12px; }
.pi-recbar .pi-btn { background: transparent; border-color: #4A4A5F; color: #fff; }
.pi-tour[data-step="rec"] .pi-recbar { transform: none; }
.pi-tour[data-step="rec"] .pi-rec-time { animation: pi-rec-count 4.4s steps(1) both; }
@keyframes pi-rec-count { 0% { content: "00:00"; } }
.pi-tour[data-step="rec"] .pi-host-table i:nth-child(2) { animation: pi-mask-line 1s ease 1.6s both; }
@keyframes pi-mask-line { to { background: repeating-linear-gradient(90deg, #CFCFDD 0 6px, #E6E7EF 6px 10px); } }
.pi-tour[data-step="rec"] .pi-host { animation: pi-rec-frame 4.4s linear both; }
@keyframes pi-rec-frame { 0%, 100% { box-shadow: inset 0 0 0 3px #FF4A7A; } 50% { box-shadow: inset 0 0 0 3px rgb(255 74 122 / .35); } }
.pi-cursor { position: absolute; left: 30%; top: 30%; width: 14px; height: 18px; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 18"><path d="M1 1l12 8-5 1 3 6-2 1-3-6-4 4z" fill="%2314141F" stroke="%23fff" stroke-width="1"/></svg>') no-repeat; opacity: 0; z-index: 4; }
.pi-tour[data-step="rec"] .pi-cursor { animation: pi-cursor-move 4.4s cubic-bezier(.4,0,.2,1) both; }
@keyframes pi-cursor-move { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 45% { transform: translate(150px, 96px); } 52% { transform: translate(150px, 96px) scale(.85); } 60% { transform: translate(150px, 96px) scale(1); } 100% { opacity: 1; transform: translate(190px, 70px); } }
.pi-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pi-fields span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--pi-line); font-size: 10px; font-weight: 600; }
.pi-fields .pi-ic { width: 10px; height: 10px; color: #0B7A52; }
.pi-tour[data-step="routed"] .pi-fields span { animation: pi-pop .35s cubic-bezier(.34,1.56,.64,1) both; }
.pi-tour[data-step="routed"] .pi-fields span:nth-child(1) { animation-delay: 1.1s; } .pi-tour[data-step="routed"] .pi-fields span:nth-child(2) { animation-delay: 1.3s; } .pi-tour[data-step="routed"] .pi-fields span:nth-child(3) { animation-delay: 1.5s; } .pi-tour[data-step="routed"] .pi-fields span:nth-child(4) { animation-delay: 1.7s; }
.pi-routed-card { display: flex; align-items: center; gap: 9px; margin-top: 9px; padding: 9px 10px; border-radius: 10px; background: #fff; border: 1px solid #D7E3FF; }
.pi-routed-card img { width: auto; height: 22px; flex: none; }
.pi-routed-card span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pi-routed-card b { font-size: 11px; }
.pi-routed-card i { font-style: normal; font-size: 9.5px; color: var(--pi-muted); }
.pi-tour[data-step="routed"] .pi-routed-card { animation: pi-in .45s cubic-bezier(.22,1,.36,1) 2.2s both; }
.pi.is-narrow .pi-bugmark-tip { display: none; }
.pi.is-narrow .pi-rec-mask { display: none; }
