/* Deal Room — animated scenario player */

.pl {
  position: relative; background: #fff; border-radius: 18px; overflow: hidden; overflow: clip;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.05);
  font-size: 15px; color: var(--ink);
}
.pl-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfbfb; }
.pl-live { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #c9372c; }
.pl-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 0 rgba(255,77,77,.6); animation: plPulse 1.6s infinite; }
.pl.paused .pl-live i { animation: none; background: #bbb; box-shadow: none; }
.pl.paused .pl-live { color: #888; }
@keyframes plPulse { 70% { box-shadow: 0 0 0 8px rgba(255,77,77,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); } }
.pl-ctx { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-note { font-size: 12px; color: var(--muted); background: #f0f0f0; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.pl-ctrl { margin-left: auto; display: flex; gap: 6px; }
.pl-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: #fff; }
.pl-btn:hover { background: #f1f1f1; }
.pl-btn .i-play { display: none; }
.pl.paused .pl-btn .i-play { display: block; }
.pl.paused .pl-btn .i-pause { display: none; }

.pl-grid { position: relative; display: grid; grid-template-columns: 1fr 1.08fr 1fr; gap: 56px; padding: 22px 24px 26px; min-height: 470px; align-items: start; }
.pl-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.pl-wires .w { fill: none; stroke: #d7d7d7; stroke-width: 1.6; transition: stroke .4s; }
.pl-wires .w.hot { stroke: url(#plGrad); stroke: #ea4fb3; stroke-width: 2; }
.pl-wires .w.bad { stroke: #f2b8b2; stroke-dasharray: 5 5 !important; }
.pl-wires .end { fill: #fff; stroke: #999; stroke-width: 1.4; }
.pl-wires .end.bad { stroke: #e0786e; }
.pl-wires .pkt { fill: #ea4fb3; filter: drop-shadow(0 0 4px rgba(234,79,179,.8)); }
.pl-wires .pkt.bad { fill: #c9372c; filter: none; }

.pl-col { position: relative; z-index: 2; min-width: 0; }
.pl-col h6 { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pl-col h6 span { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 11px; letter-spacing: 0; }
.pl-list { display: grid; gap: 12px; }

.pl-brain { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(90deg, #fff4f4, #fbefff); margin-bottom: 12px; border: 1px solid #f6dff0; }
.pl-brain b { display: block; font-weight: 600; font-size: 15px; }
.pl-brain small { display: block; font-size: 12.5px; color: var(--muted); min-height: 1.3em; }
.pl-brain .blob { transition: transform .3s; }
.pl-brain.busy .blob { animation: plThink 0.9s ease-in-out infinite; }
.pl-brain.busy small { color: #b0359a; }
@keyframes plThink { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.12) rotate(-6deg); } 60% { transform: scale(.96) rotate(5deg); } }
.pl-brain-q { width: 34px; height: 34px; border-radius: 50%; background: #ffe6e3; color: #c9372c; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.pl-bad .pl-brain { background: #fff6f5; border-color: #f6d5d1; }

.pl-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: box-shadow .4s, border-color .4s; }
.pl-item.enter { animation: plIn .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes plIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.pl-item.hot { border-color: #eab1de; box-shadow: 0 0 0 4px rgba(234,79,179,.12), 0 10px 24px -12px rgba(0,0,0,.2); }

.pl-src-h { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.pl-src-tool { font-weight: 500; color: #444; }
.pl-time { margin-left: auto; }
.pl-src-b { display: flex; gap: 10px; align-items: flex-start; }
.pl-src-b b { font-weight: 500; font-size: 14px; display: block; }
.pl-typed { font-size: 14.5px; line-height: 1.45; color: #333; margin-top: 2px; min-height: 1.45em; }
.pl-typed:not(.done)::after { content: ""; display: inline-block; width: 2px; height: 1em; background: #ea4fb3; margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }

.pl-fact { padding: 10px 14px; }
.pl-fact-k { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pl-fact-v { font-size: 15.5px; font-weight: 500; margin: 3px 0 6px; line-height: 1.35; }
.pl-fact.risk { border-color: #f3c3be; background: #fff8f7; }
.pl-fact.risk .pl-fact-v { color: #b3261e; }
.pl-fact.bad { border-style: dashed; border-color: #eab0a9; background: #fff8f7; }
.pl-fact.bad .pl-fact-v { color: #b3261e; }
.pl-cite { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #555; background: #f4f4f4; border-radius: 99px; padding: 2px 9px 2px 7px; }

.pl-act-h { display: flex; align-items: center; gap: 8px; }
.pl-act-h b { font-weight: 500; font-size: 14.5px; }
.pl-act p { font-size: 13.5px; color: #555; line-height: 1.45; margin: 5px 0 9px; }
.pl-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.pl-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; }
.pl-pill.ok { background: var(--ok-bg); color: var(--ok); animation: plPop .35s ease; }
.pl-pill.wait { background: var(--warn-bg); color: var(--warn); }
.pl-pill.run { background: #eef1ff; color: #3a4fd6; }
.pl-pill.bad { background: var(--bad-bg); color: var(--bad); }
@keyframes plPop { 0% { transform: scale(.8); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.pl-spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: plSpin .7s linear infinite; }
@keyframes plSpin { to { transform: rotate(360deg); } }
.pl-audit { font-size: 11px; color: var(--muted); }
.pl-approve { height: 28px; padding: 0 14px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500; transition: transform .15s, background .2s; }
.pl-approve.pressed { transform: scale(.92); background: #1f9d55; }
.pl-act.done { border-color: #cfe9da; }
.pl-act.bad { border-style: dashed; border-color: #eab0a9; background: #fff8f7; }

.pl-out { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100% - 48px)); z-index: 5; }
.pl-out.enter { animation: plOut .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes plOut { from { opacity: 0; transform: translate(-50%, -44%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.pl-grid .pl-col, .pl-wires { transition: opacity .6s, filter .6s; }
.pl-grid.fin .pl-col, .pl-grid.fin .pl-wires { opacity: .28; filter: blur(1.5px); }
.pl-out-card { background: #0d0e10; color: #fff; border-radius: 16px; padding: 20px 24px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
.pl-out-card.bad { background: #3a1210; }
.pl-out-tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--p-green); color: #0d0e10; padding: 3px 8px; border-radius: 4px; }
.pl-out-card.bad .pl-out-tag { background: #ffb4ab; }
.pl-out-card h5 { margin: 12px 0 10px; font-size: 21px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
.pl-out-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pl-out-card li { font-size: 14.5px; color: #d9d9d9; padding-left: 22px; position: relative; line-height: 1.45; }
.pl-out-card li::before { content: "✓"; position: absolute; left: 0; color: var(--p-green); font-weight: 700; }
.pl-out-card.bad li::before { content: "✕"; color: #ffb4ab; }

.pl-foot { border-top: 1px solid var(--line); padding: 14px 24px 18px; background: #fbfbfb; }
.pl-segs { display: flex; gap: 6px; margin-bottom: 12px; }
.pl-seg { flex: 1; height: 16px; display: flex; align-items: center; cursor: pointer; }
.pl-seg i { display: block; width: 100%; height: 4px; border-radius: 99px; background: #e4e4e4; position: relative; overflow: hidden; }
.pl-seg i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.pl-seg.done i::after { transform: scaleX(1); }
.pl-seg.cur i::after { animation: plFill var(--d, 3s) linear forwards; }
.pl.paused .pl-seg.cur i::after { animation-play-state: paused; }
.pl-seg:hover i { background: #d2d2d2; }
@keyframes plFill { to { transform: scaleX(1); } }
.pl-cap { display: flex; gap: 16px; align-items: baseline; min-height: 54px; }
.pl-n { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.pl-cap p { font-size: clamp(16px, 1.4vw, 20px); letter-spacing: -0.015em; line-height: 1.4; }
.pl-cap p.in { animation: plCap .45s ease both; }
.pl-cap p b { font-weight: 600; }
@keyframes plCap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pl-cursor { position: absolute; left: 0; top: 0; z-index: 20; opacity: 0; transition: transform 1.1s cubic-bezier(.45,.05,.2,1), opacity .3s; pointer-events: none; }
.pl-cursor.on { opacity: 1; }
.pl-cursor::after { content: ""; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: rgba(234,79,179,.35); transform: scale(0); }
.pl-cursor.click::after { animation: plRipple .5s ease-out; }
@keyframes plRipple { from { transform: scale(0); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

/* Panel wrapper used on pages */
.pl-stage { border-radius: 28px; padding: clamp(16px, 4vw, 56px); }

@media (max-width: 980px) {
  .pl-grid { grid-template-columns: 1fr; gap: 26px; min-height: 0; padding: 18px 16px 22px; }
  .pl-wires { display: none; }
  .pl-col + .pl-col::before { content: "↓"; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); color: #bbb; font-size: 16px; }
  .pl-out { position: relative; left: auto; top: auto; transform: none; width: 100%; margin-top: 4px; }
  .pl-grid.fin .pl-col { opacity: .45; filter: none; }
  .pl-out.enter { animation: plIn .5s both; }
  .pl-note { display: none; }
  .pl-cap { flex-direction: column; gap: 4px; min-height: 76px; }
  .pl-foot { position: sticky; bottom: 0; z-index: 6; box-shadow: 0 -10px 24px -14px rgba(0,0,0,.25); }
  body.pl-on .ask-ai { opacity: 0; pointer-events: none; transform: translateY(10px); }
  .ask-ai { transition: opacity .25s, transform .25s; }
}
