/* /product/analytics/ (components/site/demo_stage/product_analytics/): three scenes on the home stage, each the owner's
   conversation on the left and the Zellwo views it reads on the right, then the four still section panels (.pa-*).
   Only what this page adds to demo_stage.css. */
.demo-stage :is([data-demo-scene=sources], [data-demo-scene=support], [data-demo-scene=campaigns]) {
  .side { display: contents; }
  .side > .box { height: auto; align-self: center; }

  .thread { mask-image: linear-gradient(to bottom, transparent, #000 34px); }
  .thread > .grow > div > * { margin-bottom: 10px; }
  .bubble { max-width: 86%; width: fit-content; border-radius: 17px; padding: 9px 13px; font-size: 13.5px; line-height: 1.42; }
  .bubble.me { margin-left: auto; background: var(--brand); color: var(--brand-foreground); border-bottom-right-radius: 5px; }
  .bubble.them { background: var(--muted); border-bottom-left-radius: 5px; }
  .composer-row span { color: var(--foreground); }
  .composer-row span:empty::before { content: attr(data-placeholder); color: var(--muted-foreground); }

  .side .box { padding: 22px; }
  .side .box > b, .draft header b { display: block; font-size: 16px; font-weight: 600; }
  .side .box > small { display: block; font-size: 13px; color: var(--muted-foreground); margin: 2px 0 16px; }
  .side > .box { transition: background-color .3s, box-shadow .3s, border-color .3s; }
  .side > .box.waiting { background: color-mix(in oklab, var(--card) 40%, transparent); border-color: transparent; box-shadow: none; }

  .table { font-size: 14px; font-variant-numeric: tabular-nums; }
  .row { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 10px; align-items: center; min-height: 42px; margin: 0 -10px; padding: 4px 10px; border-radius: 10px; transition: background-color .3s; }
  .row > :not(.name) { text-align: right; }
  .row + .row:not(.head) { border-top: 1px solid var(--border); }
  .row.head { min-height: 0; padding-bottom: 6px; font-size: 12.5px; color: var(--muted-foreground); }
  .row .name { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
  .row .name svg { width: 16px; height: 16px; flex: none; }
  .row .name small { display: block; font-size: 12px; font-weight: 500; color: var(--brand); }
  .row.best { background: color-mix(in oklab, var(--brand) 8%, transparent); border-color: transparent; }
  .row.best + .row { border-top-color: transparent; }

  .figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .figures p { display: flex; flex-direction: column; gap: 2px; }
  .figures b { font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
  .figures span { font-size: 13px; color: var(--muted-foreground); }
  .figures .lead b { color: var(--brand); }

}

/* Sources: the table reads in, the landing pages, the compare column, Anna's record. */
.demo-stage [data-demo-scene=sources] {
  .sources .row:not(.head) { min-height: 38px; }
  .sources .row > :not(.name, .then) { opacity: 0; transition: opacity .4s; }
  .sources.read .row > :not(.name, .then) { opacity: 1; }
  .sources .then { opacity: 0; transition: opacity .4s; color: var(--muted-foreground); }
  .sources .then.up { color: var(--brand); font-weight: 600; }
  .sources.compared .then { opacity: 1; }
  .sources .row.best { background: transparent; }
  .sources.read .row.best { background: color-mix(in oklab, var(--brand) 8%, transparent); }
  .page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 12px 0; font-size: 14px; }
  .page + .page { border-top: 1px solid var(--border); }
  .page em { font-style: normal; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .page.hot em { color: var(--brand); }
  .user { padding: 18px 20px; }
  .user .person { margin-bottom: 10px; }
  .user .person .face { width: 40px; height: 40px; }
  .user .facts { padding: 6px 0; margin-bottom: 12px; }
  .user .facts b { font-size: 17px; }
  .user .event { padding-bottom: 8px; }
  .user .event:last-child { padding-bottom: 0; }
}

/* Support: four figures, the topics, the article suggestion and its approval. */
.demo-stage [data-demo-scene=support] {
  .numbers .figures { opacity: 0; transition: opacity .4s; }
  .numbers.read .figures { opacity: 1; }
  .topics .row { grid-template-columns: minmax(0, 1.8fr) repeat(2, minmax(0, 1fr)); }
  .topics .row .name { flex-direction: column; align-items: flex-start; gap: 0; }
  .topics .table { opacity: 0; transition: opacity .4s; }
  .topics.read .table { opacity: 1; }
  .topics.read .row.hot { background: color-mix(in oklab, var(--brand) 8%, transparent); }
  .topics.read .row.hot + .row { border-top-color: transparent; }
  .article h4 { font-size: 16px; font-weight: 600; line-height: 1.3; }
  .article p { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: var(--muted-foreground); }
  .approve { display: inline-flex; margin-top: 16px; min-height: 36px; align-items: center; border-radius: 99px; padding: 0 18px; background: var(--brand); color: var(--brand-foreground); font-size: 13px; font-weight: 500; transition: background-color .25s, color .25s; }
  .approve.done { background: var(--ds-good-bg); color: var(--ds-good); }
}

/* Campaigns: mailed against held back, the versions, the cost line, the next draft. */
.demo-stage [data-demo-scene=campaigns] {
  .bar { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 6px 12px; align-items: center; font-size: 14px; margin-bottom: 14px; }
  .bar .track { grid-column: 1; height: 10px; border-radius: 99px; background: var(--muted); overflow: hidden; }
  .bar .track i { display: block; height: 100%; width: 0; border-radius: 99px; background: color-mix(in oklab, var(--foreground) 34%, transparent); transition: width .9s var(--ds-ease); }
  .bar.mailed .track i { background: var(--brand); }
  .bar em { grid-column: 2; grid-row: 1 / 3; align-self: end; text-align: right; font-style: normal; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .3s .5s; }
  .bar.mailed em { color: var(--brand); }
  .read .bar .track i { width: var(--share); }
  .read .bar em { opacity: 1; }
  .sum { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; border-top: 1px solid var(--border); padding-top: 12px; font-size: 14px; }
  .sum b { font-size: 20px; font-weight: 600; color: var(--brand); }
  .earned { opacity: 0; transition: opacity .4s; }
  .read .earned { opacity: 1; }
  .spent .sum { margin-top: 12px; color: var(--muted-foreground); }
  .version { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 42px; margin: 0 -10px; padding: 4px 10px; border-radius: 10px; font-size: 14px; transition: background-color .3s; }
  .version + .version { border-top: 1px solid var(--border); }
  .version .key { font-weight: 600; color: var(--muted-foreground); }
  .version em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
  .version.best { background: color-mix(in oklab, var(--brand) 8%, transparent); }
  .version.best, .version.best + .version { border-top-color: transparent; }
  .version.best :is(.key, em) { color: var(--brand); }
  .draft header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .draft .tag { margin-left: auto; }
  .draft h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
  .draft p { font-size: 13.5px; line-height: 1.45; color: var(--muted-foreground); }
  .activate { display: inline-flex; margin-top: 14px; min-height: 36px; align-items: center; border-radius: 99px; padding: 0 18px; background: color-mix(in oklab, var(--brand) 12%, transparent); color: var(--brand); font-size: 13px; font-weight: 500; }
}

/* The section panels: still, fluid from 360 px. */
.demo-stage .panel.still:is(.pa-overview, .pa-searches, .pa-assistant, .pa-steps) {
  > :is(.box, .phone) { display: block; }
  > :is(.chat, .usage) { display: flex; }
  .box { padding: 22px; }
  .box > b { display: block; font-size: 16px; font-weight: 600; }
  .box > small { display: block; font-size: 13px; color: var(--muted-foreground); margin: 2px 0 16px; }
}
.demo-stage .panel.pa-overview {
  .figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .figures p { display: flex; flex-direction: column; gap: 2px; }
  .figures b { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .figures span { font-size: 13px; color: var(--muted-foreground); }
  .figures .lead b { color: var(--brand); }
  .plot { display: block; width: 100%; height: 170px; margin-top: 24px; overflow: visible; }
  .plot path, .plot line { vector-effect: non-scaling-stroke; fill: none; }
  .plot .grid { stroke: var(--border); stroke-width: 1; }
  .plot .before { stroke: color-mix(in oklab, var(--foreground) 30%, transparent); stroke-width: 2; }
  .plot .now { stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
  .legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: 13px; color: var(--muted-foreground); }
  .legend span { display: inline-flex; align-items: center; gap: 8px; }
  .legend span::before { content: ''; width: 18px; height: 2.5px; border-radius: 2px; background: color-mix(in oklab, var(--foreground) 30%, transparent); }
  .legend .now::before { background: var(--brand); }
}
.demo-stage .panel.pa-searches {
  .phone { height: auto; padding-bottom: 16px; }
  .address { margin: 14px auto 0; width: max-content; font-size: 12px; color: var(--muted-foreground); background: var(--ds-panel); border-radius: 99px; padding: 3px 14px; }
  .search { margin: 14px 8px 0; }
  .answer { font-size: 13px; line-height: 1.45; }
  .results { padding: 16px; }
  .products img { aspect-ratio: 4 / 3; }
  .table { font-size: 14px; font-variant-numeric: tabular-nums; }
  .row { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 10px; align-items: center; min-height: 44px; }
  .row > :not(.name) { text-align: right; }
  .row + .row:not(.head) { border-top: 1px solid var(--border); }
  .row.head { min-height: 0; padding-bottom: 6px; font-size: 12.5px; color: var(--muted-foreground); }
  .row .name { font-weight: 500; }
  .note { margin-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--muted-foreground); }
  .action { display: inline-flex; margin-top: 16px; min-height: 38px; align-items: center; border-radius: 99px; padding: 0 18px; background: color-mix(in oklab, var(--brand) 12%, transparent); color: var(--brand); font-size: 13.5px; font-weight: 500; }
}
.demo-stage .panel.pa-assistant {
  .chat { background: var(--ds-bezel); color: #f5f5f4; border-color: transparent; display: flex; flex-direction: column; gap: 14px; }
  .ask { align-self: flex-end; max-width: 86%; background: rgb(255 255 255 / .12); border-radius: 17px; border-bottom-right-radius: 5px; padding: 10px 14px; font-size: 14px; }
  .answer { font-size: 15px; line-height: 1.5; }
  .via { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 12.5px; color: #c4c0bb; }
  .via svg { width: 15px; height: 15px; flex: none; }
  .right { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding: 12px 0; font-size: 14px; font-weight: 500; }
  .right + .right { border-top: 1px solid var(--border); }
  .right small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted-foreground); }
  .right em { font-style: normal; font-size: 13.5px; color: var(--muted-foreground); }
}
.demo-stage .panel.pa-steps {
  .step { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 14px; }
  .step + .step { border-top: 1px solid var(--border); }
  .step em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
  .usage { display: flex; flex-direction: column; }
  .usage > b { margin-bottom: 14px; }
  .spent { font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .usage > small { margin: 4px 0 16px; }
  .track { display: block; height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; }
  .track i { display: block; width: 31%; height: 100%; border-radius: 99px; background: var(--brand); }
}
@media (min-width: 640px) {
  .demo-stage .panel.pa-overview .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .demo-stage :is([data-demo-scene=sources], [data-demo-scene=support], [data-demo-scene=campaigns]) {
    .desk { grid-template-columns: 430px minmax(0, 1fr); gap: 16px; height: 600px; }
    .side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr); gap: 16px; min-height: 0; }
    .side > .box { align-self: stretch; }
    .side > .box:first-child { grid-column: 1 / -1; }
    .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  .demo-stage .panel.still:is(.pa-overview, .pa-searches, .pa-assistant, .pa-steps) { display: grid; padding: 24px; }
  .demo-stage .panel.pa-searches { grid-template-columns: 334px minmax(0, 1fr); align-items: center; }
  .demo-stage .panel.pa-assistant { grid-template-columns: minmax(0, 1fr) 360px; }
  .demo-stage .panel.pa-steps { grid-template-columns: minmax(0, 1fr) 320px; }
}
