/* ==========================================================================
   Unified CX platform explorer — five capability tabs, each with a small hands-on demo.
   Markup: index.html #platform-overview. Behaviour: assets/js/platform.js.
   Uses only the tokens from style.css (single light theme). Tab and panel share one accent via [data-pv].
   ========================================================================== */

/* accent per capability. --pv-fill: AA fill behind white; --pv-fg: text on --pv-t; --pv-ring: soft halo */
[data-pv="orchestrate"] { --pv-fill: var(--color-primary-aa); --pv-fg: var(--text-accent-strong); --pv-t: var(--bg-table-head);   --pv-ring: rgba(var(--primary-rgb), .22); --pv-move: pv-nudge; }
[data-pv="manage"]      { --pv-fill: var(--color-secondary);  --pv-fg: var(--tint-secondary-fg);   --pv-t: var(--tint-secondary-bg); --pv-ring: rgba(37, 35, 93, .16);  --pv-move: pv-turn; }
[data-pv="personalize"] { --pv-fill: var(--chip-info-aa);     --pv-fg: var(--tint-info-fg);        --pv-t: var(--tint-info-bg);      --pv-ring: rgba(78, 53, 223, .2);  --pv-move: pv-beat; }
[data-pv="analyze"]     { --pv-fill: var(--chip-pink-aa);     --pv-fg: var(--tint-pink-fg);        --pv-t: var(--tint-pink-bg);      --pv-ring: rgba(194, 30, 111, .2); --pv-move: pv-hop; }
[data-pv="deliver"]     { --pv-fill: var(--tint-success-fg);  --pv-fg: var(--tint-success-fg);    --pv-t: var(--tint-success-bg);   --pv-ring: rgba(2, 122, 56, .2);   --pv-move: pv-pop; }

.pv { --pv-dwell: 9s; }

/* ── Tabs: a vertical journey rail on desktop, a scrolling pill strip on small screens ── */
.pv-tabs { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 6px; }
html:not(.js) .pv-tabs { display: none; }
.pv-tab {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  width: 100%; padding: 14px 16px 18px; text-align: left; color: var(--text-body); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-md);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pv-tab:hover { background: rgba(255, 255, 255, .7); }
.pv-tab:active { transform: scale(.985); }
.pv-tab[aria-selected="true"] { background: var(--bg-surface); border-color: var(--border); box-shadow: var(--shadow-sm); }

/* rail to the next step: runs from this chip's centre to the next chip's centre, whatever the tab heights */
.pv-tab::before {
  content: ""; position: absolute; z-index: 1; left: 40px; top: 38px; width: 2px; height: calc(100% + 8px); margin-left: -1px;
  background: var(--border-strong); transition: background var(--t-base) var(--ease);
}
.pv-tab:last-child::before { display: none; }
.pv-tab.is-past::before { background: var(--color-primary); }

.pv-tab-ico {
  position: relative; z-index: 2; width: 48px; height: 48px; display: grid; place-items: center; font-size: 22px;
  color: var(--pv-fg); background: var(--bg-surface); border: 2px solid var(--pv-ring); border-radius: 50%;
  box-shadow: 0 0 0 5px var(--bg-subtle);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.pv-tab-ico i { display: inline-block; }
.pv-tab:hover .pv-tab-ico { background: var(--pv-t); transform: scale(1.06); }
.pv-tab[aria-selected="true"] .pv-tab-ico { color: #fff; background: var(--pv-fill); border-color: var(--pv-fill); box-shadow: 0 0 0 5px var(--pv-ring); transform: none; }
.pv-tab:hover .pv-tab-ico i, .pv-tab[aria-selected="true"] .pv-tab-ico i { animation: var(--pv-move) .8s var(--ease) 1; }

.pv-tab-txt strong { display: block; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--text-title); }
.pv-tab-txt small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--text-body); }
.pv-tab-num { padding-top: 3px; font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pv-tab[aria-selected="true"] .pv-tab-num { color: var(--pv-fg); }

/* autoplay timer on the selected tab; the CSS animation's end is what advances to the next tab */
.pv-tab-bar { position: absolute; left: 16px; right: 16px; bottom: 7px; height: 3px; overflow: hidden; border-radius: 3px; background: var(--border-soft); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.pv-tab-bar::after { content: ""; position: absolute; inset: 0; background: var(--pv-fill); transform: scaleX(0); transform-origin: left; }
.pv[data-rotate="on"] .pv-tab[aria-selected="true"] .pv-tab-bar { opacity: 1; }
.pv[data-rotate="on"] .pv-tab[aria-selected="true"] .pv-tab-bar::after { animation: pv-timer var(--pv-dwell) linear forwards; }
.pv:hover .pv-tab-bar::after, .pv[data-inview="0"] .pv-tab-bar::after { animation-play-state: paused; }

@media (max-width: 991.98px) {
  .pv-tabs { flex-direction: row; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .pv-tabs::-webkit-scrollbar { display: none; }
  .pv-tabs { --fade: var(--bg-subtle); background:   /* same edge shadows as .tabs-scroll, so a clipped pill reads as "more this way" */
    linear-gradient(to right, var(--fade) 30%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--fade) 30%, transparent) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(37, 35, 93, .16), transparent) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(37, 35, 93, .16), transparent) right center / 10px 100% no-repeat scroll; }
  .pv-tab { flex: none; width: auto; grid-template-columns: auto auto; gap: 10px; align-items: center; padding: 7px 18px 9px 7px; scroll-snap-align: center; background: var(--bg-surface); border-color: var(--border); border-radius: var(--radius-pill); }
  .pv-tab::before, .pv-tab-txt small, .pv-tab-num { display: none; }
  .pv-tab-ico { width: 36px; height: 36px; font-size: 18px; box-shadow: none; }
  .pv-tab[aria-selected="true"] .pv-tab-ico { box-shadow: none; }
  .pv-tab-txt strong { font-size: 15px; }
  .pv-tab-bar { left: 22px; right: 22px; bottom: 4px; }
}

/* ── Stage: one card, panels stacked in the same grid cell so the height never jumps ── */
.pv-stage { height: 100%; overflow: hidden; border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.pv-stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border-soft); }
.pv-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-title); }
.pv-live .dot { color: var(--tint-success-fg); }
.pv-stage-tools { display: flex; align-items: center; gap: 12px; }
html:not(.js) .pv-stage-tools { display: none; }
.pv-count { font-size: 13px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pv-motion { width: 36px; height: 36px; font-size: 16px; }

.pv-panels { position: relative; display: grid; flex: 1; }
.pv-panel {
  grid-area: 1 / 1; display: flex; flex-direction: column; padding: 28px 32px 32px;
  background: linear-gradient(180deg, var(--pv-t) 0, var(--bg-surface) 200px);
  visibility: hidden; opacity: 0; transform: translateY(10px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
}
.pv-panel.is-on { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
/* phones: panels stack their scenes vertically and differ a lot in height, so let each one size itself
   (inactive panels leave the flow; the stage clips them while they fade) */
@media (max-width: 767.98px) {
  .pv-panel:not(.is-on) { position: absolute; top: 0; left: 0; right: 0; }
}
html:not(.js) .pv-panels { display: block; }
html:not(.js) .pv-panel:not(.is-on) { position: static; }
html:not(.js) .pv-panel { visibility: visible; opacity: 1; transform: none; }
html:not(.js) .pv-panel + .pv-panel { border-top: 1px solid var(--border-soft); }

.pv-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--pv-fg); }
.pv-eyebrow span { padding: 1px 8px; font-variant-numeric: tabular-nums; color: #fff; background: var(--pv-fill); border-radius: var(--radius-pill); }
.pv-panel-title { margin-top: 8px; font-size: 26px; line-height: 1.25; letter-spacing: -.3px; }
.pv-panel-copy { margin-top: 8px; font-size: 15px; }
.pv-scene { flex: 1; display: flex; flex-direction: column; margin-top: 22px; }
.pv-scene > .pv-seg { align-self: flex-start; }

.pv-hint { display: flex; align-items: center; gap: 8px; margin: auto 0 0; padding-top: 18px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.pv-hint i { font-size: 18px; color: var(--pv-fg); animation: pv-tap 1.8s ease-in-out infinite; }
.pv-panel.is-touched .pv-hint i { animation: none; }

/* several states in one cell (captions, customers, channels): the tallest one sets the height */
.pv-stack { display: grid; }
.pv-stack > * { grid-area: 1 / 1; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
.pv-stack > :not(.is-on) { visibility: hidden; opacity: 0; pointer-events: none; }
.pv-stack > .is-on { transition-delay: 0s; }

/* shared bits */
.pv-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--pv-fg); background: var(--pv-t); border-radius: var(--radius-pill); }
.pv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pv-avatar { width: 40px; height: 40px; flex: none; object-fit: cover; border: 2px solid var(--bg-surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.pv-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

/* segmented choice (customers, metrics, channels) */
.pv-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); }
.pv-seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 4px 16px;
  font-size: 14px; font-weight: 600; color: var(--text-title); background: transparent; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pv-seg-btn.has-img { padding-left: 5px; }
.pv-seg-btn.has-img img { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; }
.pv-seg-btn i { font-size: 18px; }
.pv-seg-btn:hover { background: var(--pv-t); }
.pv-seg-btn:active { transform: scale(.96); }
.pv-seg-btn[aria-checked="true"] { color: #fff; background: var(--pv-fill); }

/* ── 1 · Orchestrate: lifecycle track ── */
.pv-track { --n: 5; --i: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.pv-track-line { position: absolute; left: calc(100% / (var(--n) * 2)); right: calc(100% / (var(--n) * 2)); top: 22px; height: 4px; border-radius: 4px; background: var(--border-strong); opacity: .55; }
.pv-track-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--i) / (var(--n) - 1) * 100%); background: var(--pv-fill); border-radius: 4px; transition: width .7s cubic-bezier(.4, 0, .2, 1); }
.pv-stop { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 2px; font-size: 13px; font-weight: 600; color: var(--text-title); background: none; border: 0; cursor: pointer; }
.pv-stop-ico {
  width: 48px; height: 48px; display: grid; place-items: center; font-size: 20px; color: var(--text-muted);
  background: var(--bg-surface); border: 2px solid var(--border-strong); border-radius: 50%;
  transition: all var(--t-fast) var(--ease);
}
.pv-stop:hover .pv-stop-ico { color: var(--pv-fg); border-color: var(--pv-fill); transform: translateY(-3px); }
.pv-stop.is-past .pv-stop-ico { color: var(--pv-fg); border-color: var(--pv-fill); }
.pv-stop[aria-checked="true"] .pv-stop-ico { color: #fff; background: var(--pv-fill); border-color: var(--pv-fill); transform: scale(1.12); box-shadow: 0 0 0 6px var(--pv-ring); }
.pv-caps { margin-top: 26px; }
.pv-cap { padding: 16px 20px 18px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.pv-cap h4 { margin-bottom: 4px; font-size: 16px; }
.pv-cap p { margin: 0 0 12px; font-size: 15px; }
.pv-cap-eg { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px; font-size: 14px; color: var(--text-title); background: var(--pv-t); border-radius: var(--radius); }
.pv-cap-eg i { flex: none; margin-top: 1px; font-size: 18px; color: var(--pv-fg); }
.pv-flow { display: flex; gap: 18px; margin: 0; padding: 0; list-style: none; }
.pv-flow li { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; font-size: 13px; font-weight: 600; line-height: 1.3; text-align: center; color: var(--pv-fg); background: var(--pv-t); border-radius: var(--radius); }
.pv-flow li i { font-size: 20px; }
.pv-flow li + li::before { content: ""; position: absolute; left: -12px; top: 50%; width: 7px; height: 7px; border-top: 2px solid var(--pv-fill); border-right: 2px solid var(--pv-fill); transform: translateY(-50%) rotate(45deg); }
/* the chain lights up step by step each time a stage is shown */
.pv-cap.is-on .pv-flow li { animation: pv-in .4s var(--ease) both; animation-delay: calc(var(--k) * .22s + .15s); }

/* ── 2 · Manage: touchpoint hub + customer timeline ── */
.pv-manage { display: grid; gap: 24px; align-items: center; }
@media (min-width: 768px) { .pv-manage { grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: 32px; } }
.pv-hub { position: relative; width: 100%; max-width: 270px; aspect-ratio: 1; margin: 0 auto 28px; }
.pv-spokes { position: absolute; inset: 0; width: 100%; height: 100%; }
.pv-spokes line { stroke: var(--pv-fill); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; animation: pv-flow 1s linear infinite; transition: opacity var(--t-base) var(--ease); }
.pv-spokes line.is-off { opacity: .14; animation: none; }
.pv-hub-core {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 80px; height: 80px; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 24px; color: #fff;
  background: var(--pv-fill); border-radius: 50%; box-shadow: 0 8px 22px var(--pv-ring); transition: filter var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.pv-hub-core b { font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.pv-hub-core::before { content: ""; position: absolute; inset: -10px; border: 2px solid var(--pv-fill); border-radius: 50%; animation: pv-ring 2.4s ease-out infinite; }
.pv-hub.is-idle .pv-hub-core { filter: grayscale(1); opacity: .55; }
.pv-hub.is-idle .pv-hub-core::before { animation: none; opacity: 0; }
.pv-node { position: absolute; left: var(--x); top: var(--y); z-index: 2; width: 50px; height: 50px; padding: 0; transform: translate(-50%, -50%); background: none; border: 0; cursor: pointer; }
.pv-node-ico {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 22px; color: #fff; background: var(--pv-fill);
  border: 3px solid var(--bg-surface); border-radius: 50%; box-shadow: 0 0 0 2px var(--pv-fill), var(--shadow-sm);
  transition: all var(--t-fast) var(--ease);
}
.pv-node:hover .pv-node-ico { transform: scale(1.12); }
.pv-node:active .pv-node-ico { transform: scale(.92); }
.pv-node[aria-pressed="false"] .pv-node-ico { color: var(--text-muted); background: var(--bg-surface); box-shadow: 0 0 0 2px var(--border-strong), var(--shadow-card); }
.pv-node-lbl { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; color: var(--text-title); }
.pv-node[aria-pressed="false"] .pv-node-lbl { color: var(--text-muted); }
.pv-hub-status { margin: 0; text-align: center; font-size: 14px; font-weight: 500; color: var(--text-title); }
.pv-hub-status strong { font-size: 18px; color: var(--pv-fg); font-variant-numeric: tabular-nums; }

.pv-tl-card { padding: 16px; }
.pv-tl-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.pv-tl-head strong { display: block; font-size: 15px; line-height: 1.25; color: var(--text-title); }
.pv-tl-head small { font-size: 12px; color: var(--text-muted); }
.pv-tl { margin: 6px 0 0; padding: 0; list-style: none; }
.pv-tl li { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s var(--ease), opacity .3s var(--ease); }
.pv-tl li > div { min-height: 0; overflow: hidden; }
.pv-tl li.is-off { grid-template-rows: 0fr; opacity: 0; }
.pv-tl-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--text-title); }
.pv-tl-row i { flex: none; font-size: 18px; color: var(--pv-fg); }
.pv-tl-row span { flex: 1; min-width: 0; }
.pv-tl-row time { display: block; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.pv-tl-empty { margin: 14px 0 6px; font-size: 14px; color: var(--text-muted); }

/* ── 3 · Personalize: same platform, three customers ── */
.pv-custs { margin-top: 18px; }
.pv-cust { display: grid; gap: 14px; align-content: start; }
.pv-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 16px; }
.pv-profile .pv-avatar { width: 52px; height: 52px; }
.pv-profile-txt strong { display: block; font-size: 17px; line-height: 1.25; color: var(--text-title); }
.pv-profile-txt span { font-size: 13px; font-weight: 600; color: var(--pv-fg); }
.pv-signals { flex-basis: 100%; }
.pv-msg { display: grid; gap: 10px; }
.pv-msg-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.pv-bubble { display: grid; padding: 14px 18px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md); box-shadow: var(--shadow-card); }
.pv-bubble > * { grid-area: 1 / 1; }
.pv-bubble-txt { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-title); }
.pv-typing { display: inline-flex; align-self: start; gap: 4px; padding-top: 8px; }
.pv-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: pv-dot 1s ease-in-out infinite; }
.pv-typing i:nth-child(2) { animation-delay: .15s; } .pv-typing i:nth-child(3) { animation-delay: .3s; }
.pv-nba { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; font-size: 14px; color: var(--pv-fg); background: var(--pv-t); border-radius: var(--radius); }
.pv-nba i { margin-top: 1px; font-size: 18px; }
.pv-nba b { display: block; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; }
/* entrance plays each time a customer is shown: dots, then the message, then the suggested action */
.pv-cust.is-on .pv-typing { animation: pv-out .01s .9s forwards; }
.pv-cust.is-on .pv-bubble-txt { animation: pv-in .4s .9s both; }
.pv-cust.is-on .pv-nba { animation: pv-in .4s 1.35s both; }

/* ── 4 · Analyze: live chart ── */
.pv-metric { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-top: 20px; }
.pv-metric-val { display: block; font-size: 46px; font-weight: 700; line-height: 1.1; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.pv-metric-unit { font-size: 14px; font-weight: 500; }
.pv-bars {
  display: flex; align-items: flex-end; gap: 5px; height: 150px; margin-top: 16px; padding: 14px 14px 0;
  background: repeating-linear-gradient(to top, transparent 0 36px, var(--border-soft) 36px 37px), var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.pv-bars i { flex: 1; min-height: 6px; height: calc(var(--h, 30) * 1%); border-radius: 4px 4px 0 0; background: var(--pv-fill); opacity: calc(.25 + var(--k, 1) * .75); transition: height .7s var(--ease); }
.pv-foot { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }

/* ── 5 · Deliver: same story on every channel, same context ── */
.pv-deliver { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 768px) { .pv-deliver { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.pv-chan { display: grid; gap: 10px; align-content: start; padding: 16px; }
.pv-chan-head { display: flex; align-items: center; gap: 10px; }
.pv-chan-head strong { display: block; font-size: 15px; line-height: 1.25; color: var(--text-title); }
.pv-chan-head small { font-size: 12px; color: var(--text-muted); }
.pv-chan-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; font-size: 18px; color: #fff; background: var(--pv-fill); border-radius: 50%; }
.pv-line { max-width: 94%; margin: 0; padding: 9px 13px; font-size: 14px; line-height: 1.5; color: var(--text-title); background: var(--bg-subtle); border-radius: 4px 14px 14px 14px; }
.pv-line.is-cust { justify-self: end; background: var(--pv-t); border-radius: 14px 4px 14px 14px; }
.pv-line b { display: block; margin-bottom: 2px; font-size: 13px; }
.pv-ctx { align-content: start; padding: 16px; background: var(--bg-surface); border: 1px dashed var(--pv-fill); border-radius: var(--radius-md); }
.pv-ctx-h { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--pv-fg); }
.pv-ctx ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.pv-ctx li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius-sm); }
.pv-ctx li small { display: block; font-size: 12px; color: var(--text-muted); }
.pv-ctx li strong { display: block; font-size: 14px; line-height: 1.3; color: var(--text-title); }
.pv-ctx li i { flex: none; font-size: 18px; color: var(--pv-fg); }
.pv-ctx.is-flash li { animation: pv-carry 1s var(--ease) both; animation-delay: calc(var(--k) * .09s); }
.pv-ctx.is-flash li i { animation: pv-pop .5s var(--ease) both; animation-delay: calc(var(--k) * .09s); }
.pv-zero { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding-top: 10px; font-size: 14px; font-weight: 600; color: var(--pv-fg); border-top: 1px solid var(--border-soft); }
.pv-zero b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }

.pv-cta { margin: 32px 0 0; text-align: center; font-size: 16px; }

/* ── keyframes ── */
@keyframes pv-timer { to { transform: scaleX(1); } }
@keyframes pv-flow { to { stroke-dashoffset: -9; } }
@keyframes pv-ring { from { transform: scale(.85); opacity: .5; } to { transform: scale(1.3); opacity: 0; } }
@keyframes pv-tap { 0%, 60%, 100% { transform: none; } 30% { transform: translate(2px, 3px) scale(.88); } }
@keyframes pv-dot { 0%, 100% { opacity: .35; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes pv-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pv-out { to { opacity: 0; } }
@keyframes pv-carry { 0% { background: var(--pv-t); } 100% { background: transparent; } }
/* tab icons: one small gesture each, played on hover and when the tab is picked */
@keyframes pv-nudge { 0%, 100% { transform: none; } 35% { transform: translateX(4px) rotate(8deg); } 70% { transform: translateX(-2px) rotate(-4deg); } }
@keyframes pv-turn { to { transform: rotate(360deg); } }
@keyframes pv-beat { 0%, 100% { transform: none; } 25% { transform: scale(1.3); } 50% { transform: scale(.95); } 75% { transform: scale(1.18); } }
@keyframes pv-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-6px); } 65% { transform: translateY(1px); } }
@keyframes pv-pop { 0% { transform: scale(.5); } 60% { transform: scale(1.25); } 100% { transform: none; } }

/* pause button: freezes the endless loops only, so one-shot entrances still finish */
.pv.is-still .pv-spokes line, .pv.is-still .pv-hub-core::before, .pv.is-still .pv-hint i,
.pv.is-still .dot-live, .pv.is-still .pv-typing i { animation-play-state: paused; }

@media (max-width: 575.98px) {
  .pv-panel { padding: 22px 16px 26px; }
  .pv-panel-title { font-size: 22px; }
  .pv-stage-bar { padding: 10px 16px; }
  .pv-scene > .pv-seg { align-self: stretch; }
  .pv-seg { display: flex; width: 100%; border-radius: var(--radius-lg); }
  .pv-seg-btn { flex: 1 1 0; padding-inline: 8px; }
  .pv-seg-btn.has-img { padding-left: 4px; }
  .pv-metric-val { font-size: 34px; }
  .pv-stop { font-size: 12px; }
  .pv-stop-ico { width: 42px; height: 42px; }
  .pv-track-line { top: 19px; }
  .pv-line { max-width: 100%; }
  .pv-flow { gap: 14px; }
  .pv-flow li { font-size: 12px; padding: 8px 4px; }
  .pv-flow li + li::before { left: -10px; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-cust.is-on .pv-typing, .pv-cust.is-on .pv-bubble-txt, .pv-cust.is-on .pv-nba { animation-delay: 0s; }
  .pv-ctx.is-flash li, .pv-ctx.is-flash li i { animation-delay: 0s; }
  .pv-cap.is-on .pv-flow li { animation-delay: 0s; }
  .pv-panel { transform: none; }
}
