/* Product UI replica components for the homepage (website-first-load-opening#29).
   Drawn in the same style as the first-screen demo: Orlino's real interface, simplified.
   Colours come only from brand.css tokens; every fallback equals the registered value.
   Markup and the state interface live in product-ui/gallery.html and product-ui/README.md.

   Shared state interface
   - data-pui-play on a component: absent = the complete static frame (safe default);
     "idle" = the starting frame; "run" = play from start to complete.
   - .pui-staged[data-step="0…7"]: children with data-from="n" appear from step n on,
     children with data-until="n" disappear once step n is reached. No data-step = everything shown.
   - .pui-desk[data-scene="1…4"]: children with data-in="…" show only in the listed scenes;
     with no data-scene, only children whose data-in lists "static" show.
   - prefers-reduced-motion: no movement; idle frames are ignored, so the complete frame shows. */

.pui {
  --pui-ink: var(--product-ui-ink, #0F1115);
  --pui-text: var(--product-ui-text, #3A3F45);
  --pui-muted: var(--product-ui-muted, #61666B);
  --pui-faint: var(--product-ui-faint, #ADB2B8); /* decoration only, never text (contrast 2.13) */
  --pui-stroke: var(--product-ui-stroke, #E2E2E2);
  --pui-rule: var(--ui-rule, #E8EAF0);
  --pui-surface: var(--ui-surface, #F6F7FB);
  --pui-white: var(--brand-white, #FFFFFF);
  --pui-blue: var(--brand-blue, #3264FF);
  --pui-blue-soft: var(--brand-blue-soft, #EEF3FF);
  --pui-green: var(--ui-success, #1F7244);
  --pui-green-bg: var(--cal-event-green-bg, #E3F5E8);
  --pui-violet: var(--cal-event-violet-ink, #5B3CC4);
  --pui-violet-bg: var(--cal-event-violet-bg, #EFEAFD);
  --pui-warn: var(--ui-warning, #8A5300);
  --pui-hair: color-mix(in srgb, var(--product-ui-black, #000000) 6%, transparent);
  --pui-tint: color-mix(in srgb, var(--product-ui-black, #000000) 4%, transparent);
  --pui-shadow: 0 1px 2px color-mix(in srgb, var(--product-ui-ink, #0F1115) 4%, transparent), 0 10px 28px -14px color-mix(in srgb, var(--product-ui-ink, #0F1115) 25%, transparent);
  --pui-ease: var(--motion-ease, ease);
  position: relative;
  box-sizing: border-box;
  font: 400 12px/1.4 var(--brand-font-body, Inter, system-ui, sans-serif);
  color: var(--pui-ink);
  -webkit-font-smoothing: antialiased;
}
.pui *, .pui *::before, .pui *::after { box-sizing: border-box; }
.pui svg { display: block; width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Zero-specificity reset: a component's own spacing (pill padding, bubble padding) always wins over it (#34). */
:where(.pui) :where(p, h4, ul, ol) { margin: 0; padding: 0; list-style: none; }

/* ── Shared pieces ─────────────────────────────────────────────── */
.pui-window { position: relative; overflow: hidden; border: 1px solid var(--pui-rule); border-radius: 12px; background: var(--pui-white); box-shadow: var(--pui-shadow); }
.pui-titlebar { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-bottom: 1px solid var(--pui-rule); background: var(--pui-surface); font-size: 10px; color: var(--pui-muted); }
.pui-titlebar i { width: 8px; height: 8px; border-radius: 50%; background: var(--pui-stroke); }
.pui-titlebar--win { justify-content: flex-end; gap: 12px; }
.pui-titlebar--win i { width: 9px; height: 1.5px; border-radius: 0; background: var(--pui-muted); }
.pui-titlebar--win i + i { width: 8px; height: 8px; border: 1.5px solid var(--pui-muted); background: none; }
.pui-titlebar--win i + i + i { border: 0; background: linear-gradient(45deg, transparent 44%, var(--pui-muted) 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--pui-muted) 44% 56%, transparent 56%); }
.pui-titlebar--win span { margin-right: auto; }
.pui-url { flex: 1; height: 16px; margin-left: 6px; padding: 0 8px; border-radius: 8px; background: var(--pui-white); border: 1px solid var(--pui-rule); font-size: 9.5px; line-height: 14px; color: var(--pui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pui-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border: 1px solid var(--pui-hair); border-radius: 6px; background: var(--pui-white); font-size: 10.5px; color: var(--pui-text); white-space: nowrap; }
.pui-chip--blue { border-color: transparent; background: var(--pui-blue-soft); color: var(--pui-blue); font-weight: 600; }
.pui-chip--green { border-color: transparent; background: var(--pui-green-bg); color: var(--pui-green); font-weight: 600; }
.pui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 7px; background: var(--pui-ink); color: var(--pui-white); font-size: 11px; font-weight: 500; white-space: nowrap; }
.pui-btn--blue { background: var(--pui-blue); }
.pui-btn--ghost { background: var(--pui-white); color: var(--pui-text); border: 1px solid var(--pui-stroke); }
.pui-avatar { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: var(--pui-blue-soft); color: var(--pui-blue); }
.pui-line { display: block; height: 5px; border-radius: 3px; background: var(--pui-rule); }
.pui-dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--pui-green); }
.pui-check { display: grid; place-items: center; width: 13px; height: 13px; flex: none; border-radius: 4px; border: 1.5px solid var(--pui-stroke); color: transparent; }
.pui-check svg { width: 9px; height: 9px; stroke-width: 2.4; }
.pui-done .pui-check, .pui-check.is-on { border-color: var(--pui-blue); background: var(--pui-blue); color: var(--pui-white); }
.pui-cursor { position: absolute; z-index: 4; width: 14px; height: 14px; color: var(--pui-ink); pointer-events: none; }
.pui-cursor svg { width: 14px; height: 14px; fill: var(--pui-white); stroke: var(--pui-ink); stroke-width: 1.5; }
.pui-label { position: absolute; z-index: 5; left: 50%; top: 10px; transform: translateX(-50%); padding: 5px 10px; border-radius: 999px; background: var(--pui-ink); color: var(--pui-white); font-size: 11px; font-weight: 500; white-space: nowrap; }

/* Mini app layout: sidebar + main, as in the product's desktop and web app. */
.pui-app { display: grid; grid-template-columns: 30% 1fr; min-height: 0; }
.pui-side { display: grid; align-content: start; gap: 4px; padding: 8px 7px; background: var(--pui-surface); border-right: 1px solid var(--pui-rule); font-size: 10px; color: var(--pui-text); }
.pui-side b { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 11px; font-weight: 650; color: var(--pui-ink); }
.pui-side b::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--pui-blue); }
.pui-side span { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pui-side span svg { width: 11px; height: 11px; }
/* The row is a flex box, which cannot draw an ellipsis; the label inside it does (#34). */
.pui-side span > em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.pui-side .is-new { justify-content: center; margin-bottom: 2px; border: 1px solid var(--pui-rule); background: var(--pui-white); }
.pui-side .is-active { background: var(--pui-tint); color: var(--pui-ink); }
.pui-side small { margin-top: 6px; padding: 0 5px; font-size: 9px; color: var(--pui-muted); }
.pui-main { position: relative; display: grid; align-content: start; gap: 7px; min-width: 0; padding: 10px 12px; }
.pui-ask { justify-self: end; max-width: 82%; padding: 6px 9px; border-radius: 10px 10px 3px 10px; background: var(--pui-blue-soft); color: var(--pui-ink); font-size: 11px; }
.pui-took { font-size: 10px; color: var(--pui-muted); }
.pui-steps { display: grid; gap: 4px; font-size: 10.5px; color: var(--pui-text); }
.pui-steps li { display: flex; align-items: center; gap: 6px; }
.pui-steps li svg { width: 12px; height: 12px; color: var(--pui-green); stroke-width: 2.2; }
.pui-steps li.is-wait svg { color: var(--pui-blue); }
.pui-progress { display: block; height: 4px; border-radius: 4px; background: var(--pui-blue-soft); overflow: hidden; }
.pui-progress b { display: block; height: 100%; width: var(--pui-progress, 70%); background: var(--pui-blue); border-radius: inherit; transition: width var(--motion-slow, 900ms) var(--pui-ease); }
.pui-composer { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 5px 0 9px; border: 1px solid var(--pui-rule); border-radius: 9px; font-size: 10.5px; color: var(--pui-muted); }
.pui-composer span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pui-composer i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--pui-blue); color: var(--pui-white); }
.pui-composer i svg { width: 10px; height: 10px; stroke-width: 2.2; }
.pui-file { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: var(--pui-white); border: 1px solid var(--pui-rule); font-size: 10px; color: var(--pui-text); white-space: nowrap; }
.pui-file svg { width: 11px; height: 11px; color: var(--pui-blue); }

/* ── 02 · Expert outcome thumbnails ─────────────────────────────── */
.pui-outcome { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.pui-outcome-art { position: relative; width: 100%; aspect-ratio: 5 / 4; container-type: size; overflow: hidden; padding: 12px; border: 1px solid var(--pui-rule); border-radius: 12px; background: var(--pui-white); box-shadow: var(--pui-shadow); }
.pui-outcome-art h4 { font-size: 11px; font-weight: 650; color: var(--pui-ink); }
.pui-outcome-art h4 small { display: block; margin-top: 1px; font: 500 8.5px/1.2 var(--brand-font-mono, ui-monospace, Menlo, monospace); letter-spacing: .06em; color: var(--pui-muted); text-transform: uppercase; }
.pui-outcome-name { font-size: 13px; font-weight: 600; color: var(--pui-ink); }
.pui-says { min-height: 2.8em; font-size: 12px; line-height: 1.4; color: var(--pui-muted); }
.pui-says b { font-weight: 600; color: var(--pui-text); }
.pui-outcome:not(.is-active) .pui-says { visibility: hidden; }

/* Industry brief: highlighted conclusion with source tags. */
.pui-brief { display: grid; gap: 6px; margin-top: 9px; }
.pui-brief p { font-size: 10px; line-height: 1.45; color: var(--pui-text); }
.pui-brief mark { padding: 1px 2px; border-radius: 3px; background: linear-gradient(var(--pui-blue-soft), var(--pui-blue-soft)) no-repeat 0 0 / 100% 100%; color: var(--pui-ink); transition: background-size var(--motion-slow, 900ms) var(--pui-ease) var(--motion-fast, 250ms); }
.pui-brief sup { margin-left: 2px; padding: 0 3px; border-radius: 3px; background: var(--pui-surface); font-size: 7.5px; font-weight: 600; color: var(--pui-blue); }
.pui-brief .pui-line { width: var(--w, 100%); }
.pui-sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.pui-sources span { padding: 1px 5px; border-radius: 4px; background: var(--pui-surface); font-size: 8.5px; color: var(--pui-muted); }
/* Monthly report: bars that grow. */
.pui-bars { display: flex; align-items: flex-end; gap: 7%; height: 58%; margin-top: 10px; padding: 0 2px 4px; border-bottom: 1px solid var(--pui-rule); }
.pui-bars i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--brand-blue, #3264FF) 35%, transparent); transform-origin: 50% 100%; transition: transform var(--motion-base, 600ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-bars i:last-child { background: var(--pui-blue); }
.pui-outcome-art:has(.pui-kpi) h4 { padding-right: 64px; }
.pui-kpi { position: absolute; right: 12px; top: 12px; text-align: right; font-size: 15px; font-weight: 700; color: var(--pui-ink); }
.pui-kpi small { display: block; font-size: 8.5px; font-weight: 600; color: var(--pui-green); }
/* Gantt timeline with the critical path in blue. */
.pui-gantt { display: grid; gap: 7px; margin-top: 10px; }
.pui-gantt li { display: grid; grid-template-columns: 34% 1fr; align-items: center; gap: 6px; font-size: 9px; color: var(--pui-text); }
.pui-gantt li span { position: relative; height: 9px; }
.pui-gantt li i { position: absolute; left: var(--x); width: var(--w); height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--brand-blue, #3264FF) 30%, transparent); transform-origin: 0 50%; transition: transform var(--motion-base, 600ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-gantt li.is-critical i { background: var(--pui-blue); }
.pui-gantt li em { position: absolute; left: var(--x); top: -1px; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: var(--pui-ink); }
/* Content calendar: a month filled with topics. */
.pui-month { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 9px; }
.pui-month span { height: 17px; border-radius: 4px; background: var(--pui-surface); }
.pui-month span.is-topic { display: grid; place-items: center; padding: 0 2px; background: var(--pui-blue-soft); color: var(--pui-blue); font-size: 7.5px; font-weight: 600; white-space: nowrap; overflow: hidden; transition: opacity var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); transition-delay: calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-month span.is-topic.is-alt { background: var(--pui-violet-bg); color: var(--pui-violet); }
/* Weekly menu with ingredient icons, and a shopping list that gets ticked. */
.pui-menu { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 9px; }
.pui-menu ol { display: grid; gap: 4px; }
.pui-menu ol li { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--pui-text); white-space: nowrap; }
.pui-menu ol li b { width: 22px; font-weight: 600; color: var(--pui-muted); }
.pui-menu ol li svg { width: 12px; height: 12px; color: var(--pui-green); }
.pui-menu ul { display: grid; align-content: start; gap: 4px; padding: 6px 7px; border-radius: 8px; background: var(--pui-surface); }
.pui-menu ul li, .pui-moving li { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--pui-text); }
.pui-menu ul li .pui-check, .pui-moving li .pui-check { transition: background-color var(--motion-fast, 250ms) var(--pui-ease), border-color var(--motion-fast, 250ms) var(--pui-ease), color var(--motion-fast, 250ms) var(--pui-ease); transition-delay: calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
/* Moving checklist with due dates. */
.pui-moving { display: grid; gap: 6px; margin-top: 10px; }
.pui-moving li > span:not(.pui-check) { flex: 1; }
.pui-moving li em { font-style: normal; padding: 1px 5px; border-radius: 4px; background: var(--pui-surface); font-size: 8.5px; color: var(--pui-muted); }
.pui-moving li strong { width: 46px; font-size: 8.5px; font-weight: 600; color: var(--pui-blue); }
/* Pet care: a small calendar with the vaccine reminder. */
.pui-petcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 9px; font-size: 8px; color: var(--pui-muted); text-align: center; }
.pui-petcal span { height: 15px; line-height: 15px; border-radius: 4px; }
.pui-petcal span.is-event { background: var(--pui-blue); color: var(--pui-white); font-weight: 600; transition: transform var(--motion-fast, 250ms) var(--pui-ease) var(--motion-fast, 250ms), opacity var(--motion-fast, 250ms) var(--motion-fast, 250ms) var(--pui-ease); }
.pui-petcal span.is-event.is-green { background: var(--pui-green-bg); color: var(--pui-green); }
.pui-reminder { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--pui-rule); background: var(--pui-white); box-shadow: var(--pui-shadow); font-size: 9.5px; color: var(--pui-text); transition: opacity var(--motion-fast, 250ms) var(--motion-base, 600ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease) var(--motion-base, 600ms); }
.pui-reminder b { display: block; font-size: 10px; color: var(--pui-ink); }
.pui-reminder .pui-avatar { width: 22px; height: 22px; }
/* Weekly learning tracker: cells light up. */
.pui-learn { display: grid; grid-template-columns: 26px repeat(7, 1fr); gap: 3px; margin-top: 9px; font-size: 8px; color: var(--pui-muted); align-items: center; }
.pui-learn i { height: 14px; border-radius: 4px; background: var(--pui-surface); transition: background-color var(--motion-fast, 250ms) calc(var(--i, 0) * var(--motion-stagger, 120ms)) var(--pui-ease); }
.pui-learn i.is-on { background: var(--pui-blue); }
.pui-learn i.is-half { background: color-mix(in srgb, var(--brand-blue, #3264FF) 35%, transparent); }
.pui-streak { margin-top: 8px; font-size: 10px; font-weight: 600; color: var(--pui-ink); }
.pui-streak span { color: var(--pui-green); }

@media (prefers-reduced-motion: no-preference) {
  .pui-outcome[data-pui-play="idle"] .pui-brief mark { background-size: 0 100%; }
  .pui-outcome[data-pui-play="idle"] .pui-bars i { transform: scaleY(.15); }
  .pui-outcome[data-pui-play="idle"] .pui-gantt li i { transform: scaleX(0); }
  .pui-outcome[data-pui-play="idle"] .pui-month span.is-topic { opacity: 0; transform: scale(.7); }
  .pui-outcome[data-pui-play="idle"] .pui-check.is-on { border-color: var(--pui-stroke); background: transparent; color: transparent; }
  .pui-outcome[data-pui-play="idle"] .pui-petcal span.is-event { opacity: 0; transform: scale(.6); }
  .pui-outcome[data-pui-play="idle"] .pui-reminder { opacity: 0; transform: translateY(6px); }
  .pui-outcome[data-pui-play="idle"] .pui-learn i.is-on, .pui-outcome[data-pui-play="idle"] .pui-learn i.is-half { background: var(--pui-surface); }
  .pui-outcome-art { transition: transform var(--motion-base, 600ms) var(--pui-ease); }
  .pui-outcome.is-flipped .pui-outcome-art { transform: rotateY(90deg); }
}

/* Small tiles (#34): the week menu narrows its columns and, when short, drops its last dish rather than cut it. */
@container (max-width: 210px) {
  .pui-menu { grid-template-columns: 1.15fr 1fr; gap: 6px; }
  .pui-menu ul { padding: 5px; }
  .pui-menu ul li { font-size: 9px; gap: 4px; }
}
@container (max-height: 160px) {
  .pui-menu ol li:nth-child(n+5) { display: none; }
}

/* ── 03 · Desktop app + phone + cloud, four scenes ──────────────── */
.pui-desk { display: grid; grid-template-columns: 1fr; aspect-ratio: 16 / 10; container-type: inline-size; }
/* The window leaves a free band on top and a gutter on the right, so the cloud keeps clear of the window and the phone
   (homepage decision #42: the droplet lines between them must show). The phone still overlaps the window. */
.pui-desk-screen { position: absolute; inset: 22% 28% 0 0; display: grid; grid-template-rows: auto 1fr; transition: filter var(--motion-base, 600ms) var(--pui-ease), opacity var(--motion-base, 600ms) var(--pui-ease); }
.pui-desk-screen .pui-app { height: 100%; }
/* The phone covers the window's right edge (4% of the stage); text and the send button stay left of it. */
.pui-desk-screen .pui-main { padding-right: calc(4cqw + 18px); }
.pui-desk-dim { position: absolute; inset: 26px 0 0; z-index: 3; background: color-mix(in srgb, var(--product-ui-ink, #0F1115) 45%, transparent); transition: opacity var(--motion-base, 600ms) var(--pui-ease); }
.pui-desk-off { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: var(--pui-ink); color: var(--pui-muted); font-size: 11px; transition: opacity var(--motion-base, 600ms) var(--pui-ease); }
.pui-folder { display: grid; gap: 4px; padding: 7px; border: 1px dashed var(--pui-stroke); border-radius: 8px; background: var(--pui-surface); }
.pui-folder strong { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; color: var(--pui-text); }
.pui-folder strong svg { width: 12px; height: 12px; color: var(--pui-blue); }
.pui-folder > div { display: flex; flex-wrap: wrap; gap: 4px; }
/* The dropped file only exists while it flies in; at rest (and with reduced motion) it is not drawn. */
.pui-flying { position: absolute; z-index: 4; left: 46%; top: 54%; opacity: 0; pointer-events: none; }
.pui-desk[data-scene] .pui-flying.pui-file { opacity: 0; }
/* The spreadsheet opens over the whole task pane (title bar to bottom, sidebar to just short of the phone), so it hides
   whole lines and controls, never half of one, whatever the window's height (#34). */
.pui-sheet { position: absolute; z-index: 2; inset: 26px calc(4cqw + 6px) 0 30%; border: 1px solid var(--pui-rule); border-radius: 8px; background: var(--pui-white); box-shadow: var(--pui-shadow); overflow: hidden; }
.pui-sheet table, .pui-grid table { width: 100%; border-collapse: collapse; font-size: 9px; color: var(--pui-text); }
.pui-sheet th, .pui-grid th { padding: 3px 5px; background: var(--pui-surface); font-weight: 600; text-align: left; color: var(--pui-muted); }
.pui-sheet td, .pui-grid td { padding: 3px 5px; border-top: 1px solid var(--pui-rule); white-space: nowrap; }
.pui-sheet td.is-filling { background: var(--pui-blue-soft); color: var(--pui-blue); font-weight: 600; }
.pui-phone { position: absolute; z-index: 5; right: 12%; bottom: 0; width: 20%; aspect-ratio: 9 / 18.5; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; padding: 18px 7px 8px; border: 4px solid var(--pui-ink); border-radius: 18px; background: var(--pui-white); box-shadow: var(--pui-shadow); transition: box-shadow var(--motion-base, 600ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
.pui-phone::before { content: ""; position: absolute; top: 5px; left: 50%; width: 30%; height: 5px; transform: translateX(-50%); border-radius: 4px; background: var(--pui-ink); }
.pui-phone-head { font-size: 9.5px; font-weight: 600; color: var(--pui-ink); }
.pui-phone-head small { display: block; font-weight: 400; color: var(--pui-muted); }
.pui-phone-body { display: grid; align-content: start; gap: 5px; font-size: 9px; color: var(--pui-text); }
.pui-phone .pui-btn { width: 100%; height: 22px; font-size: 10px; }
/* The question (scenes 1–3) and the sent message (scene 4) take turns in one cell, so the phone never grows. */
.pui-phone-body > .pui-phone-note, .pui-phone-body > .pui-ask { grid-row: 3; grid-column: 1; }
.pui-phone-note { margin-top: 4px; padding: 6px; border-radius: 7px; background: var(--pui-surface); font-size: 9px; color: var(--pui-ink); }
.pui-badge { position: absolute; top: -9px; right: -10px; padding: 2px 6px; border-radius: 999px; background: var(--pui-ink); color: var(--pui-white); font-size: 8.5px; font-weight: 600; white-space: nowrap; }
.pui-phone.is-lit, .pui-desk[data-scene="2"] .pui-phone, .pui-desk[data-scene="4"] .pui-phone { box-shadow: 0 0 0 3px var(--pui-blue-soft), var(--pui-shadow); transform: translateY(-4px); }
/* The cloud floats above the window's corner (24px over the stage; the homepage leaves room above it). */
.pui-cloud { position: absolute; z-index: 5; right: 0; top: -24px; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border: 1px solid var(--pui-rule); border-radius: 999px; background: var(--pui-white); box-shadow: var(--pui-shadow); font-size: 10.5px; font-weight: 600; color: var(--pui-ink); transition: box-shadow var(--motion-base, 600ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
.pui-cloud svg { width: 16px; height: 16px; color: var(--pui-blue); }
.pui-cloud.is-lit, .pui-desk[data-scene="4"] .pui-cloud { box-shadow: 0 0 0 4px var(--pui-blue-soft), var(--pui-shadow); transform: scale(1.06); }
.pui-desk [data-anchor] { isolation: isolate; }
.pui-desk[data-scene] [data-in] { opacity: 0; visibility: hidden; transition: opacity var(--motion-base, 600ms) var(--pui-ease), visibility var(--motion-base, 600ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
.pui-desk:not([data-scene]) [data-in]:not([data-in~="static"]) { display: none; }
.pui-desk[data-scene="1"] [data-in~="1"], .pui-desk[data-scene="2"] [data-in~="2"], .pui-desk[data-scene="3"] [data-in~="3"], .pui-desk[data-scene="4"] [data-in~="4"] { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: no-preference) {
  .pui-desk[data-scene="1"] .pui-flying { animation: pui-drop-in calc(var(--motion-slow, 900ms) * 3) var(--pui-ease) both; }
  .pui-desk[data-scene="2"] .pui-progress b { animation: pui-grow calc(var(--motion-slow, 900ms) * 3) var(--pui-ease) both; }
  .pui-desk[data-scene="3"] .pui-sheet .pui-cursor { animation: pui-click-path calc(var(--motion-slow, 900ms) * 3) var(--pui-ease) both; }
  .pui-desk[data-scene="3"] .pui-sheet td.is-filling { animation: pui-fill calc(var(--motion-slow, 900ms) * 3) var(--pui-ease) both; }
  .pui-desk[data-scene="4"] .pui-phone-body .pui-ask { animation: pui-rise var(--motion-base, 600ms) var(--pui-ease) var(--motion-fast, 250ms) both; }
}

/* Narrow stage (phones, #34): the window drops its sidebar, the scene label sits left of the cloud in smaller type. */
@container (max-width: 480px) {
  .pui-desk-screen .pui-app { grid-template-columns: 1fr; }
  .pui-desk-screen .pui-side { display: none; }
  .pui-desk-screen .pui-folder > div { display: none; }
  .pui-desk-screen .pui-composer { display: none; }
  .pui-label { left: 0; top: -28px; max-width: calc(100% - 130px); transform: none; font-size: 9.5px; }
  .pui-sheet { inset: 26px calc(4cqw + 6px) 0 0; }
  /* Cloud, badge, phone top: three rows, each with its own room (the badge sits above the phone, not on it). */
  .pui-cloud { top: -32px; }
  .pui-badge { top: auto; bottom: calc(100% + 10px); right: -4px; }
  /* The phone keeps its shape (its content no longer stretches it up under the cloud): title, progress, Approve. */
  .pui-phone { width: 26%; min-height: 0; }
  .pui-phone .pui-steps, .pui-phone-note { display: none; }
}

/* ── 04 · Seven small scenes on the capability rail ─────────────── */
.pui-mini { display: grid; place-items: center; aspect-ratio: 4 / 3; container-type: inline-size; overflow: hidden; padding: 10px; border: 1px solid var(--pui-rule); border-radius: 12px; background: var(--pui-white); box-shadow: var(--pui-shadow); }
.pui-mini > * { width: 100%; }
.pui-mini-expert { display: flex; align-items: center; gap: 8px; }
.pui-mini-expert .pui-avatar { width: 32px; height: 32px; border-radius: 9px; }
.pui-mini-expert .pui-avatar svg { width: 17px; height: 17px; }
.pui-mini-expert b { display: block; font-size: 11px; font-weight: 650; line-height: 1.25; }
.pui-mini-expert .pui-chip { margin-top: 4px; }
.pui-inbox { position: relative; height: 70px; }
.pui-inbox > svg { position: absolute; left: 50%; bottom: 0; width: 40px; height: 40px; transform: translateX(-50%); color: var(--pui-blue); stroke-width: 1.4; }
.pui-receipt { position: absolute; left: 50%; bottom: 20px; width: 26px; height: 32px; margin-left: -13px; padding: 5px 4px; border-radius: 3px; border: 1px solid var(--pui-rule); background: var(--pui-white); box-shadow: var(--pui-shadow); transform: translate(var(--tx), var(--ty)) rotate(var(--r)); transition: transform var(--motion-base, 600ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)), opacity var(--motion-fast, 250ms) calc(var(--i, 0) * var(--motion-stagger, 120ms)) var(--pui-ease); }
.pui-receipt i { display: block; height: 2px; margin-bottom: 3px; border-radius: 2px; background: var(--pui-stroke); }
.pui-receipt b { display: block; font-size: 6.5px; font-weight: 700; color: var(--pui-ink); }
.pui-grid { overflow: hidden; border: 1px solid var(--pui-rule); border-radius: 7px; }
.pui-grid td:nth-child(n+2) { text-align: right; }
@container (max-width: 230px) { .pui-grid table.is-list :is(th, td):nth-child(3) { display: none; } }
.pui-grid tr { transition: opacity var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); transition-delay: calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-grid td.is-save { background: var(--pui-green-bg); color: var(--pui-green); font-weight: 600; transition: background-color var(--motion-fast, 250ms) calc(var(--i, 0) * var(--motion-stagger, 120ms)) var(--pui-ease), color var(--motion-fast, 250ms) calc(var(--i, 0) * var(--motion-stagger, 120ms)) var(--pui-ease); }
.pui-tabs { position: relative; height: 84px; }
.pui-tab { position: absolute; left: var(--x); top: var(--y); width: 78%; border: 1px solid var(--pui-rule); border-radius: 7px; background: var(--pui-white); box-shadow: var(--pui-shadow); overflow: hidden; transition: opacity var(--motion-fast, 250ms) calc(var(--i, 0) * var(--motion-stagger, 120ms)) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-tab .pui-titlebar { height: 13px; padding: 0 5px; gap: 3px; }
.pui-tab .pui-titlebar i { width: 4px; height: 4px; }
.pui-tab div { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 5px 6px; font-size: 8.5px; color: var(--pui-text); }
.pui-tab .pui-chip { height: 15px; padding: 0 4px; font-size: 8px; }
.pui-dialog { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--pui-rule); border-radius: 10px; background: var(--pui-white); box-shadow: var(--pui-shadow); }
.pui-dialog b { font-size: 11.5px; font-weight: 650; }
.pui-dialog p { font-size: 10px; color: var(--pui-muted); }
.pui-dialog div { display: flex; gap: 6px; justify-content: flex-end; }
.pui-dialog .pui-btn.is-pressed { box-shadow: 0 0 0 3px var(--pui-blue-soft); }
.pui-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-size: 8px; text-align: center; color: var(--pui-muted); }
.pui-cal span { position: relative; height: 15px; line-height: 15px; border-radius: 4px; background: var(--pui-surface); }
.pui-cal span.is-renew::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--pui-blue); transition: transform var(--motion-fast, 250ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-cal span.is-trial::after { background: var(--pui-warn); }
.pui-cal-note { margin-top: 6px; font-size: 9.5px; color: var(--pui-text); }
@media (prefers-reduced-motion: no-preference) {
  .pui-mini[data-pui-play="idle"] .pui-mini-expert { opacity: 0; transform: scale(.9); }
  .pui-mini[data-pui-play="idle"] .pui-receipt { --tx: 0px; --ty: 18px; --r: 0deg; opacity: 0; }
  .pui-mini[data-pui-play="idle"] .pui-grid tr.is-row { opacity: 0; transform: translateY(-6px); }
  .pui-mini[data-pui-play="idle"] .pui-tab { opacity: 0; transform: translateY(8px); }
  .pui-mini[data-pui-play="idle"] .pui-grid td.is-save { background: transparent; color: var(--pui-text); font-weight: 400; }
  .pui-mini[data-pui-play="idle"] .pui-dialog { opacity: 0; transform: scale(.94); }
  .pui-mini[data-pui-play="idle"] .pui-dialog .pui-btn.is-pressed { box-shadow: none; }
  .pui-mini[data-pui-play="idle"] .pui-cal span::after { transform: scale(0); }
  .pui-mini-expert, .pui-dialog { transition: opacity var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
  .pui-mini[data-pui-play="run"] .pui-dialog .pui-btn.is-pressed { animation: pui-press var(--motion-base, 600ms) var(--motion-slow, 900ms) both var(--pui-ease); }
}

/* ── 04 · Creator card: six small scenes, one per node (R4-1, #38). Same frame as the rail minis; short labels, shapes. ── */
.pui-cr-trend { overflow: hidden; border: 1px solid var(--pui-rule); border-radius: 8px; background: var(--pui-white); }
.pui-cr-trend .pui-titlebar { height: 16px; padding: 0 6px; gap: 3px; }
.pui-cr-trend .pui-titlebar i { width: 4px; height: 4px; }
.pui-cr-trend .pui-url { height: 11px; margin-left: 4px; padding: 0 5px; font-size: 7.5px; line-height: 9px; }
.pui-cr-trend ol { display: grid; gap: 2px; padding: 5px; }
.pui-cr-trend li { display: grid; grid-template-columns: 12px 1fr 26%; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 5px; font-size: 8.5px; color: var(--pui-text); }
.pui-cr-trend li b { font-weight: 650; color: var(--pui-muted); }
.pui-cr-trend li span { white-space: nowrap; }
.pui-cr-trend li em { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--pui-blue) var(--h), var(--pui-blue-soft) 0); }
.pui-cr-trend li.is-pick { background: var(--pui-blue-soft); color: var(--pui-blue); font-weight: 600; }
.pui-cr-hook { display: grid; grid-template-columns: 1fr 1.5fr; align-items: center; gap: 8px; padding-top: 8px; }
.pui-cr-script { display: grid; gap: 5px; }
.pui-cr-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pui-cr-frame { position: relative; display: grid; gap: 3px; justify-items: center; }
.pui-cr-frame i { width: 100%; aspect-ratio: 9 / 14; border-radius: 4px; border: 1px solid var(--pui-rule); background-color: var(--pui-surface); }
.pui-cr-frame small { font-size: 7.5px; color: var(--pui-muted); white-space: nowrap; }
.pui-cr-frame.is-hook i { border-color: var(--pui-blue); box-shadow: 0 0 0 2px var(--pui-blue-soft); }
.pui-cr-frame.is-hook small { color: var(--pui-blue); font-weight: 600; }
/* The Hook tag sits on the 0–3 s frame it marks. */
.pui-cr-hook-tag { position: absolute; top: -8px; left: 50%; height: 15px; padding: 0 5px; transform: translateX(-50%); font-size: 8px; font-style: normal; }
.pui-cr-cover { display: grid; place-items: center; }
.pui-cr-poster { width: 38%; aspect-ratio: 9 / 16; border-radius: 8px; background-color: var(--pui-surface); box-shadow: var(--pui-shadow); }
/* R4-6 (#41): the frames are the sample video's own (site/assets/creator/), taken at 0.9 s, 10 s and 14 s; the cover is its
   title frame. */
.pui-cr-shot { background-position: center; background-size: cover; background-repeat: no-repeat; }
.pui-cr-shot--hook { background-image: url("creator/shot-hook.jpg"); }
.pui-cr-shot--lake { background-image: url("creator/shot-lake.jpg"); }
.pui-cr-shot--polaroids { background-image: url("creator/shot-polaroids.jpg"); }
.pui-cr-shot--cover { background-image: url("creator/shot-cover.jpg"); }
.pui-cr-platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.pui-cr-version { display: grid; align-content: start; gap: 4px; padding: 6px; border: 1px solid var(--pui-rule); border-radius: 7px; background: var(--pui-white); box-shadow: var(--pui-shadow); }
.pui-cr-version b { font-size: 8.5px; font-weight: 650; color: var(--pui-ink); white-space: nowrap; }
.pui-cr-version .pui-line { height: 4px; }
.pui-cr-caption { font-size: 7.5px; line-height: 1.2; color: var(--pui-text); }
.pui-cr-week { position: relative; display: grid; gap: 3px; }
.pui-cr-days, .pui-cr-slots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.pui-cr-days span { font-size: 7.5px; text-align: center; color: var(--pui-muted); }
.pui-cr-slots span { height: 46px; border-radius: 4px; background: var(--pui-surface); }
.pui-cr-slots span.is-post { display: grid; align-content: end; padding: 2px; background: var(--pui-blue-soft); box-shadow: inset 0 0 0 1px var(--pui-blue); }
.pui-cr-slots span.is-post small { font-size: 6.5px; font-weight: 700; line-height: 1.1; text-align: center; color: var(--pui-blue); }
.pui-cr-sched { justify-self: start; height: 16px; margin-top: 3px; padding: 0 5px; font-size: 8px; }
.pui-cr-results { display: grid; gap: 6px; }
.pui-cr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pui-cr-stats span { display: grid; gap: 1px; padding: 4px 5px; border: 1px solid var(--pui-rule); border-radius: 6px; }
.pui-cr-stats small { font-size: 7.5px; color: var(--pui-muted); }
.pui-cr-stats b { font-size: 11px; font-weight: 700; color: var(--pui-ink); }
.pui-cr-bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.pui-cr-bars i { flex: 1; height: var(--h); border-radius: 2px 2px 0 0; background: var(--pui-blue-soft); }
.pui-cr-bars i:nth-child(5) { background: var(--pui-blue); }
/* Their own small plays (idle → run): rows, frames, versions, stats come in one after another; the bars grow. */
.pui-cr-trend li, .pui-cr-cell, .pui-cr-version, .pui-cr-stats span, .pui-cr-poster { transition: opacity var(--motion-fast, 250ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)), transform var(--motion-base, 600ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-cr-bars i { transition: height var(--motion-base, 600ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)); }
.pui-cr-hook-tag, .pui-cr-sched, .pui-cr-slots span.is-post { transition: opacity var(--motion-fast, 250ms) var(--pui-ease) var(--motion-base, 600ms), transform var(--motion-fast, 250ms) var(--pui-ease) var(--motion-base, 600ms); }
@media (prefers-reduced-motion: no-preference) {
  .pui-mini[data-pui-play="idle"] :is(.pui-cr-trend li, .pui-cr-cell, .pui-cr-version, .pui-cr-stats span, .pui-cr-poster) { opacity: 0; transform: translateY(5px); }
  .pui-mini[data-pui-play="idle"] .pui-cr-bars i { height: 0; }
  .pui-mini[data-pui-play="idle"] :is(.pui-cr-sched, .pui-cr-slots span.is-post) { opacity: 0; transform: scale(.9); }
  .pui-mini[data-pui-play="idle"] .pui-cr-hook-tag { opacity: 0; transform: translateX(-50%) scale(.9); }
}

/* Office card: three finished documents, fanned out. The pages fill the card (A4, #35): each is 41% of the fan wide
   (30% before), everything inside a page scales with it (--u is one old page pixel), and the fan spreads them by 55%
   so the three, tilted, still fit inside the fan. */
.pui-fan { position: relative; aspect-ratio: 5 / 4; container-type: inline-size; }
.pui-doc { --dw: 41cqw; --u: calc(var(--dw) / 90); position: absolute; left: 50%; bottom: 9cqw; width: var(--dw); aspect-ratio: 3 / 4; margin-left: calc(var(--dw) / -2); padding: calc(var(--u) * 9); border: 1px solid var(--pui-rule); border-radius: calc(var(--u) * 8); background: var(--pui-white); box-shadow: var(--pui-shadow); transform: translateX(var(--fx, 0)) rotate(var(--fr, 0deg)); transform-origin: 50% 100%; transition: transform var(--motion-base, 600ms) var(--pui-ease), opacity var(--motion-base, 600ms) var(--pui-ease); }
.pui-doc:nth-child(1) { --fx: -55%; --fr: -6deg; }
.pui-doc:nth-child(3) { --fx: 55%; --fr: 6deg; }
.pui-doc:hover, .pui-doc.is-active { z-index: 2; transform: translateX(var(--fx, 0)) rotate(0deg) translateY(-8px); }
.pui-doc-cover { display: grid; align-content: space-between; gap: calc(var(--u) * 4); min-height: 62%; padding: calc(var(--u) * 7); border-radius: calc(var(--u) * 5); background: linear-gradient(135deg, var(--pui-blue), color-mix(in srgb, var(--brand-blue, #3264FF) 70%, var(--product-ui-ink, #0F1115))); color: var(--pui-white); }
.pui-doc-cover small { font: 600 calc(var(--u) * 6.5)/1 var(--brand-font-mono, ui-monospace, Menlo, monospace); letter-spacing: .08em; opacity: .8; }
/* A page's title wraps inside the part of the page the next page leaves uncovered. */
.pui-doc-cover b, .pui-doc h5 { max-width: calc(var(--u) * 34); }
.pui-doc-cover b { font-size: calc(var(--u) * 10.5); line-height: 1.1; }
.pui-doc .pui-line { height: calc(var(--u) * 5); margin-top: calc(var(--u) * 5); border-radius: calc(var(--u) * 3); }
.pui-doc h5 { margin: 0 0 calc(var(--u) * 3); font-size: calc(var(--u) * 9.5); font-weight: 650; color: var(--pui-ink); }
.pui-doc h6 { margin: calc(var(--u) * 6) 0 calc(var(--u) * 3); font-size: calc(var(--u) * 7); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pui-blue); }
.pui-doc-donut { width: 54%; aspect-ratio: 1; margin: calc(var(--u) * 6) auto calc(var(--u) * 4); border-radius: 50%; background: conic-gradient(var(--pui-blue) 0 46%, var(--pui-violet) 0 68%, var(--pui-green) 0 84%, var(--pui-stroke) 0); -webkit-mask: radial-gradient(circle, transparent 47%, var(--product-ui-black, #000000) 48%); mask: radial-gradient(circle, transparent 47%, var(--product-ui-black, #000000) 48%); }
/* Each caption is narrower than the spacing between pages, so neighbouring captions never meet; it wraps instead. */
.pui-doc-caption { position: absolute; left: 24%; right: 24%; top: calc(100% + 6px); text-align: center; font-size: 10px; line-height: 1.25; color: var(--pui-text); }
/* Narrow cards (phones): the pages stand side by side, upright, and the captions wrap under their own page. */
@container (max-width: 340px) {
  .pui-fan { aspect-ratio: 16 / 10; }
  .pui-doc { --dw: 30cqw; bottom: 26%; }
  .pui-doc:nth-child(1) { --fx: -110%; --fr: 0deg; }
  .pui-doc:nth-child(3) { --fx: 110%; --fr: 0deg; }
  .pui-doc-caption { left: 4%; right: 4%; }
}
.pui-doc-expert { position: absolute; left: 50%; top: -26px; transform: translate(-50%, 4px); padding: 3px 8px; border-radius: 6px; background: var(--pui-ink); color: var(--pui-white); font-size: 9.5px; white-space: nowrap; opacity: 0; transition: opacity var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); pointer-events: none; }
.pui-doc:hover .pui-doc-expert, .pui-doc.is-active .pui-doc-expert { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) {
  .pui-fan[data-pui-play="idle"] .pui-doc { transform: none; }
  /* Stacked, only the top page shows (the pages are not all the same height); the other two fade in as they spread. */
  .pui-fan[data-pui-play="idle"] .pui-doc:not(:last-child) { opacity: 0; }
  /* Stacked pages would stack their captions too: they appear once the pages have spread. */
  .pui-fan[data-pui-play="idle"] .pui-doc-caption { opacity: 0; }
  .pui-doc-caption { transition: opacity var(--motion-fast, 250ms) var(--motion-base, 600ms) var(--pui-ease); }
}
/* Browser card: three small browser windows with their outcome. */
/* ── R4-6 (#41) · The sample video in a phone frame ───────────────
   The scroll story plays it muted while it is in view and pauses it out of view (data-play-video); the speaker button
   follows the video's own muted state; where motion is reduced the poster shows with a play button. */
.pui-phone-player { display: grid; justify-items: center; gap: 8px; margin: 0; }
.pui-player-phone { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; box-sizing: border-box; border: 5px solid var(--pui-ink); border-radius: 26px; background: var(--pui-ink); box-shadow: var(--pui-shadow); }
.pui-player-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.pui-player-sound, .pui-player-play { display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.pui-player-sound { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; background: color-mix(in srgb, var(--pui-ink) 55%, transparent); color: var(--pui-white); }
.pui-player-sound svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pui-player-sound .is-on, .pui-player-sound[aria-pressed="true"] .is-off { display: none; }
.pui-player-sound[aria-pressed="true"] .is-on { display: block; }
.pui-player-play { position: absolute; inset: 0; width: 54px; height: 54px; margin: auto; background: color-mix(in srgb, var(--pui-white) 90%, transparent); color: var(--pui-ink); box-shadow: var(--pui-shadow); }
.pui-player-play[hidden] { display: none; }
.pui-player-play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.pui-player-sound:focus-visible, .pui-player-play:focus-visible { outline: 2px solid var(--pui-blue); outline-offset: 2px; }
.pui-phone-player figcaption { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--pui-muted); }

.pui-browsers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pui-browser { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid var(--pui-rule); border-radius: 9px; background: var(--pui-white); box-shadow: var(--pui-shadow); }
.pui-browser .pui-titlebar { height: 18px; padding: 0 6px; gap: 3px; }
.pui-browser .pui-titlebar i { width: 5px; height: 5px; }
.pui-browser .pui-url { height: 11px; font-size: 7.5px; line-height: 9px; }
.pui-browser-body { display: grid; align-content: start; gap: 4px; min-height: 84px; padding: 7px; font-size: 8.5px; color: var(--pui-text); }
.pui-fare { display: flex; justify-content: space-between; padding: 3px 5px; border-radius: 4px; background: var(--pui-surface); }
.pui-fare.is-best { background: var(--pui-blue-soft); color: var(--pui-blue); font-weight: 600; }
.pui-field { display: grid; gap: 1px; }
.pui-field small { font-size: 7px; color: var(--pui-muted); }
.pui-field span { padding: 2px 4px; border: 1px solid var(--pui-rule); border-radius: 3px; }
.pui-curve { height: 56px; }
.pui-curve svg { width: 100%; height: 100%; stroke: var(--pui-blue); stroke-width: 2; }
.pui-curve svg circle { fill: var(--pui-green); stroke: var(--pui-white); stroke-width: 1.5; }
.pui-outcome-chip { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 5px; border-top: 1px solid var(--pui-rule); font-size: 9.5px; font-weight: 600; color: var(--pui-green); transition: opacity var(--motion-fast, 250ms) var(--motion-base, 600ms) var(--pui-ease); }
.pui-outcome-chip svg { width: 11px; height: 11px; stroke-width: 2.4; }
@media (prefers-reduced-motion: no-preference) {
  .pui-browsers[data-pui-play="idle"] .pui-outcome-chip { opacity: 0; }
  .pui-browsers[data-pui-play="idle"] .pui-fare.is-best { background: var(--pui-surface); color: var(--pui-text); font-weight: 400; }
}
/* R4-5 (website-first-load-opening#40): hovering a window (the scroll story sets data-pui-play="click-run" on it) plays
   its errand once, about 1.8s: a small cursor does the clicking. At rest, and when the play ends, each window shows its
   finished state; the cursor, the Submit button and the old price only appear while it plays. */
.pui-browser, .pui-fare.is-best, .pui-outcome-chip { position: relative; }
.pui-chip-done { display: inline-flex; align-items: center; gap: 4px; }
.pui-click-cursor { left: 64%; top: 34%; opacity: 0; visibility: hidden; }
.pui-click-submit { position: absolute; inset: 3px 26%; display: grid; place-items: center; border-radius: 5px; background: var(--pui-blue); color: var(--pui-white); font-size: 8.5px; font-weight: 600; opacity: 0; visibility: hidden; }
.pui-click-submit .pui-click-cursor { left: 62%; top: 40%; }
.pui-field span i { display: inline-block; font-style: normal; }
.pui-price { display: flex; align-items: center; gap: 3px; }
.pui-was { white-space: pre; }
.pui-roll { display: inline-grid; }
.pui-roll i { grid-area: 1 / 1; font-style: normal; }
.pui-roll-old { visibility: hidden; }
.pui-bell { display: inline-grid; margin-left: auto; color: var(--pui-blue); }
.pui-bell svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; transform-origin: 50% 12%; }
.pui-curve path { stroke-dasharray: 1; }
.pui-curve circle { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  /* Trip booked: the cursor comes to the 1-stop fare and clicks it, the row lights up, the chip stamps in. */
  .pui-browser[data-pui-play="click-run"][data-click="trip"] .pui-click-cursor { animation: pui-click-trip-cursor calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="trip"] .pui-fare.is-best { animation: pui-click-pick calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  /* Refund filed: the three fields fill in one by one, the cursor clicks Submit, the chip stamps in. */
  .pui-browser[data-pui-play="click-run"][data-click="refund"] .pui-field span i { animation: pui-click-type var(--motion-fast, 250ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-base, 600ms) / 2 + var(--motion-stagger, 120ms)) both; }
  .pui-browser[data-pui-play="click-run"][data-click="refund"] .pui-click-submit { animation: pui-click-submit calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="refund"] .pui-click-cursor { animation: pui-click-submit-cursor calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  /* Price dropped: the line draws down, the price rolls from $249 to $179, the bell rings, the chip stamps in. */
  .pui-browser[data-pui-play="click-run"][data-click="price"] .pui-curve path { animation: pui-click-draw calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="price"] .pui-curve circle { animation: pui-click-dot calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="price"] .pui-roll-old { animation: pui-click-roll-out calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="price"] .pui-roll-new { animation: pui-click-roll-in calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="price"] .pui-was { animation: pui-click-was calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="price"] .pui-bell svg { animation: pui-click-ring calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"]:is([data-click="trip"], [data-click="price"]) .pui-chip-done { animation: pui-click-stamp calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
  .pui-browser[data-pui-play="click-run"][data-click="refund"] .pui-chip-done { animation: pui-click-stamp-late calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) both; }
}
@keyframes pui-click-trip-cursor { 0% { visibility: visible; opacity: 0; translate: 34px 28px; scale: 1; } 12% { opacity: 1; } 42% { translate: 0 0; scale: 1; } 48% { scale: .78; } 54% { scale: 1; } 86% { opacity: 1; } 100% { visibility: visible; opacity: 0; translate: 0 0; scale: 1; } }
@keyframes pui-click-pick { 0%, 46% { background: var(--pui-surface); color: var(--pui-text); font-weight: 400; } 54%, 100% { background: var(--pui-blue-soft); color: var(--pui-blue); font-weight: 600; } }
@keyframes pui-click-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes pui-click-submit { 0%, 40% { visibility: visible; opacity: 0; scale: .9; } 48% { opacity: 1; scale: 1; } 60% { scale: 1; } 63% { scale: .92; } 66% { opacity: 1; scale: 1; } 72%, 100% { visibility: visible; opacity: 0; scale: 1; } }
@keyframes pui-click-submit-cursor { 0%, 40% { visibility: visible; opacity: 0; translate: 30px 2px; scale: 1; } 46% { opacity: 1; } 58% { translate: 0 0; scale: 1; } 62% { scale: .78; } 66% { opacity: 1; scale: 1; } 72%, 100% { visibility: visible; opacity: 0; translate: 0 0; scale: 1; } }
@keyframes pui-click-draw { 0% { stroke-dashoffset: 1; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes pui-click-dot { 0%, 52% { scale: 0; } 60% { scale: 1.3; } 68%, 100% { scale: 1; } }
@keyframes pui-click-roll-out { 0%, 44% { visibility: visible; opacity: 1; translate: 0 0; } 52%, 100% { visibility: visible; opacity: 0; translate: 0 -70%; } }
@keyframes pui-click-roll-in { 0%, 52% { opacity: 0; translate: 0 70%; } 60%, 100% { opacity: 1; translate: 0 0; } }
@keyframes pui-click-was { 0%, 66% { opacity: 0; } 76%, 100% { opacity: 1; } }
@keyframes pui-click-ring { 0%, 60% { rotate: 0deg; } 65% { rotate: 16deg; } 70% { rotate: -14deg; } 75% { rotate: 9deg; } 80%, 100% { rotate: 0deg; } }
@keyframes pui-click-stamp { 0%, 64% { opacity: 0; scale: 1.5; } 76% { opacity: 1; scale: .92; } 84%, 100% { opacity: 1; scale: 1; } }
@keyframes pui-click-stamp-late { 0%, 72% { opacity: 0; scale: 1.5; } 82% { opacity: 1; scale: .92; } 90%, 100% { opacity: 1; scale: 1; } }

/* ── 07 · Two live panels: in control / gets to know you ─────────── */
.pui-panel { display: grid; grid-template-rows: auto 1fr; min-height: 260px; }
.pui-panel-body { position: relative; display: grid; align-content: start; gap: 6px; padding: 12px; }
.pui-panel .pui-steps { gap: 6px; font-size: 11px; }
.pui-panel .pui-steps li { transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); }
.pui-panel .pui-dialog { position: absolute; z-index: 3; left: 14%; right: 14%; top: 42%; transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); }
.pui-panel .pui-cursor { left: 66%; top: 70%; transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), left var(--motion-base, 600ms) var(--pui-ease), top var(--motion-base, 600ms) var(--pui-ease); }
/* The toast keeps to the room the bill card (46% wide, bottom left) leaves it; on a narrow panel its text wraps. */
.pui-toast { position: absolute; z-index: 4; right: 12px; bottom: 12px; max-width: calc(54% - 30px); line-height: 1.25; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 9px; background: var(--pui-ink); color: var(--pui-white); font-size: 10.5px; transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); }
.pui-toast .pui-btn { height: 20px; padding: 0 8px; background: var(--pui-white); color: var(--pui-ink); }
.pui-bill { position: absolute; z-index: 4; left: 12px; bottom: 12px; width: 46%; padding: 8px 10px; border: 1px solid var(--pui-rule); border-radius: 9px; background: var(--pui-white); box-shadow: var(--pui-shadow); font-size: 10px; color: var(--pui-text); transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
.pui-bill li { display: flex; justify-content: space-between; padding: 2px 0; }
.pui-bill li.is-total { margin-top: 3px; padding-top: 5px; border-top: 1px solid var(--pui-rule); font-weight: 650; color: var(--pui-ink); }
.pui-memory-list { display: grid; gap: 6px; }
.pui-memory-list li { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--pui-rule); border-radius: 9px; font-size: 11px; color: var(--pui-text); transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease), border-color var(--motion-fast, 250ms) var(--pui-ease), box-shadow var(--motion-fast, 250ms) var(--pui-ease); }
.pui-memory-list li > span:first-child { flex: 1; min-width: 0; }
.pui-memory-list li b { font-weight: 600; color: var(--pui-ink); }
.pui-memory-list li .pui-btn { height: 20px; padding: 0 7px; font-size: 10px; }
.pui-memory-list li.is-editing { border-color: var(--pui-blue); box-shadow: 0 0 0 3px var(--pui-blue-soft); }
.pui-memory-list li.is-forgotten span { color: var(--pui-muted); text-decoration: line-through; }
.pui-memory-list ins { text-decoration: none; padding: 0 3px; border-radius: 3px; background: var(--pui-blue-soft); color: var(--pui-blue); font-weight: 600; }
.pui-memory-list del { color: var(--pui-muted); }
.pui-notice { display: flex; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--pui-rule); background: var(--pui-white); box-shadow: var(--pui-shadow); font-size: 10.5px; color: var(--pui-text); transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
.pui-notice b { display: block; margin-bottom: 1px; font-size: 10px; color: var(--pui-ink); }
.pui-notice div { display: flex; gap: 6px; margin-top: 6px; }
.pui-lock { position: absolute; z-index: 2; right: 10px; top: -23px; display: flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: var(--pui-green-bg); color: var(--pui-green); font-size: 10px; font-weight: 600; transition: opacity var(--motion-fast, 250ms) var(--pui-ease), visibility var(--motion-fast, 250ms) var(--pui-ease), transform var(--motion-fast, 250ms) var(--pui-ease); }
.pui-lock svg { width: 12px; height: 12px; }

/* Cumulative steps (generated: a data-from="m" child is hidden while data-step < m;
   a data-until="m" child is hidden once data-step >= m). */
.pui-staged[data-step="0"] [data-from="1"],
.pui-staged[data-step="0"] [data-from="2"],
.pui-staged[data-step="0"] [data-from="3"],
.pui-staged[data-step="0"] [data-from="4"],
.pui-staged[data-step="0"] [data-from="5"],
.pui-staged[data-step="0"] [data-from="6"],
.pui-staged[data-step="0"] [data-from="7"],
.pui-staged[data-step="1"] [data-from="2"],
.pui-staged[data-step="1"] [data-from="3"],
.pui-staged[data-step="1"] [data-from="4"],
.pui-staged[data-step="1"] [data-from="5"],
.pui-staged[data-step="1"] [data-from="6"],
.pui-staged[data-step="1"] [data-from="7"],
.pui-staged[data-step="2"] [data-from="3"],
.pui-staged[data-step="2"] [data-from="4"],
.pui-staged[data-step="2"] [data-from="5"],
.pui-staged[data-step="2"] [data-from="6"],
.pui-staged[data-step="2"] [data-from="7"],
.pui-staged[data-step="3"] [data-from="4"],
.pui-staged[data-step="3"] [data-from="5"],
.pui-staged[data-step="3"] [data-from="6"],
.pui-staged[data-step="3"] [data-from="7"],
.pui-staged[data-step="4"] [data-from="5"],
.pui-staged[data-step="4"] [data-from="6"],
.pui-staged[data-step="4"] [data-from="7"],
.pui-staged[data-step="5"] [data-from="6"],
.pui-staged[data-step="5"] [data-from="7"],
.pui-staged[data-step="6"] [data-from="7"] { opacity: 0; visibility: hidden; transform: translateY(4px); }
.pui-staged[data-step="1"] [data-until="1"],
.pui-staged[data-step="2"] [data-until="1"],
.pui-staged[data-step="2"] [data-until="2"],
.pui-staged[data-step="3"] [data-until="1"],
.pui-staged[data-step="3"] [data-until="2"],
.pui-staged[data-step="3"] [data-until="3"],
.pui-staged[data-step="4"] [data-until="1"],
.pui-staged[data-step="4"] [data-until="2"],
.pui-staged[data-step="4"] [data-until="3"],
.pui-staged[data-step="4"] [data-until="4"],
.pui-staged[data-step="5"] [data-until="1"],
.pui-staged[data-step="5"] [data-until="2"],
.pui-staged[data-step="5"] [data-until="3"],
.pui-staged[data-step="5"] [data-until="4"],
.pui-staged[data-step="5"] [data-until="5"],
.pui-staged[data-step="6"] [data-until="1"],
.pui-staged[data-step="6"] [data-until="2"],
.pui-staged[data-step="6"] [data-until="3"],
.pui-staged[data-step="6"] [data-until="4"],
.pui-staged[data-step="6"] [data-until="5"],
.pui-staged[data-step="6"] [data-until="6"],
.pui-staged[data-step="7"] [data-until="1"],
.pui-staged[data-step="7"] [data-until="2"],
.pui-staged[data-step="7"] [data-until="3"],
.pui-staged[data-step="7"] [data-until="4"],
.pui-staged[data-step="7"] [data-until="5"],
.pui-staged[data-step="7"] [data-until="6"],
.pui-staged[data-step="7"] [data-until="7"] { opacity: 0; visibility: hidden; }
/* Without a data-step the whole story is shown at once; data-until parts belong only to the
   moving version, so the static frame drops them. */
.pui-staged:not([data-step]) [data-until] { display: none; }
/* Per-step looks that are not plain appear/disappear. */
.pui-control[data-step="3"] .pui-cursor { left: 60%; top: 58%; }
.pui-control[data-step="3"] .pui-dialog .pui-btn--blue { box-shadow: 0 0 0 3px var(--pui-blue-soft); }
.pui-memory[data-step="2"] .is-editing, .pui-memory[data-step="3"] .is-editing { border-color: var(--pui-blue); }
.pui-memory[data-step="1"] .is-editing ins, .pui-memory[data-step="0"] .is-editing ins { display: none; }
.pui-memory[data-step="1"] .is-editing del, .pui-memory[data-step="0"] .is-editing del { color: inherit; text-decoration: none; }
.pui-memory[data-step="1"] .is-editing, .pui-memory[data-step="0"] .is-editing { border-color: var(--pui-rule); box-shadow: none; }
.pui-memory[data-step="0"] .is-forgotten span, .pui-memory[data-step="1"] .is-forgotten span, .pui-memory[data-step="2"] .is-forgotten span { color: var(--pui-text); text-decoration: none; }

/* ── 08 · Device family: five screens running Orlino ─────────────── */
/* One row on one baseline, at one scale (A1, #35): a laptop screen is 16:10, a phone stands 4/5 as tall as a laptop
   screen, the web window is the size of a laptop screen. The laptop bases and the phones stand on the same line; the
   captions sit under it. A phone's column is never narrower than its caption (--pc). */
.pui-family { container-type: inline-size; }
.pui-family-row { --g: 4.4cqw; --pc: max(5.6cqw, 40px); --lw: calc((100cqw - 2 * var(--pc) - 4 * var(--g)) / 3);
  display: grid; grid-template-columns: var(--lw) var(--lw) var(--pc) var(--pc) var(--lw); column-gap: var(--g); align-items: end; }
.pui-device { position: relative; display: flex; flex-direction: column; min-width: 0; transition: opacity var(--motion-base, 600ms) var(--pui-ease), filter var(--motion-base, 600ms) var(--pui-ease), transform var(--motion-base, 600ms) var(--pui-ease); }
.pui-device-screen { position: relative; overflow: hidden; background: var(--pui-white); container-type: inline-size; }
/* Small screens (#34): text turns into grey bars of the same shape, so nothing is cut or crowded. */
@container (max-width: 180px) {
  .pui-device-screen :is(b, em, small, span:not(:has(*)), li, .pui-composer > span) { max-width: 100%; color: transparent; background-color: var(--pui-rule); border-radius: 3px; text-shadow: none; }
  .pui-device-screen .pui-side span:has(> em) { background: none; }
}
.pui-device--laptop .pui-device-screen { aspect-ratio: 16 / 10; border: 6px solid var(--pui-ink); border-bottom-width: 8px; border-radius: 10px 10px 0 0; }
.pui-device--laptop::after { content: ""; order: 1; display: block; height: 8px; margin: 0 -7%; border-radius: 0 0 8px 8px; background: linear-gradient(var(--pui-stroke), var(--pui-rule)); }
.pui-device--phone .pui-device-screen { align-self: center; width: calc(var(--lw) / 2 * 9 / 19); aspect-ratio: 9 / 19; border: 5px solid var(--pui-ink); border-radius: 18px; }
.pui-device--phone.is-iphone .pui-device-screen::before { content: ""; position: absolute; z-index: 2; top: 5px; left: 50%; width: 32%; height: 9px; transform: translateX(-50%); border-radius: 9px; background: var(--pui-ink); }
.pui-device--web .pui-device-screen { aspect-ratio: 16 / 10; border: 1px solid var(--pui-rule); border-radius: 10px; box-shadow: var(--pui-shadow); }
.pui-device-name { order: 2; align-self: center; width: max-content; margin-top: 8px; text-align: center; font-size: 11px; font-weight: 600; color: var(--pui-text); }
/* Narrow row (phones): thinner frames and smaller captions, same proportions. */
@container (max-width: 480px) {
  .pui-device--laptop .pui-device-screen { border-width: 3px 3px 4px; border-radius: 6px 6px 0 0; }
  .pui-device--laptop::after { height: 5px; border-radius: 0 0 5px 5px; }
  .pui-device--phone .pui-device-screen { border-width: 3px; border-radius: 8px; }
  .pui-device--phone.is-iphone .pui-device-screen::before { top: 3px; height: 4px; }
  .pui-device-name { margin-top: 6px; font-size: 10px; }
}
.pui-device-screen .pui-app { height: calc(100% - 26px); }
.pui-device-screen .pui-titlebar { height: 18px; }
/* A device screen is short: the sidebar keeps its first three rows. */
.pui-device-screen .pui-side small, .pui-device-screen .pui-side small ~ span { display: none; }
.pui-hello { display: grid; justify-items: center; align-content: center; gap: 7px; height: 100%; padding: 8px; text-align: center; }
.pui-hello b { font-size: 12px; font-weight: 650; color: var(--pui-ink); }
.pui-hello .pui-composer { width: 100%; }
.pui-mobile { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; height: 100%; padding: 18px 6px 8px; font-size: 8.5px; }
.pui-mobile b { font-size: 9.5px; font-weight: 650; }
.pui-mobile .pui-composer { height: 22px; font-size: 8.5px; }
.pui-mobile .pui-composer i { width: 14px; height: 14px; }
.pui-family[data-lit] .pui-device { opacity: .55; filter: saturate(.6); }
.pui-family[data-lit="mac"] [data-device="mac"], .pui-family[data-lit="windows"] [data-device="windows"], .pui-family[data-lit="android"] [data-device="android"], .pui-family[data-lit="iphone"] [data-device="iphone"], .pui-family[data-lit="web"] [data-device="web"], .pui-device.is-lit { opacity: 1; filter: none; transform: translateY(-4px); }
.pui-device.is-lit .pui-device-screen, .pui-family[data-lit="mac"] [data-device="mac"] .pui-device-screen, .pui-family[data-lit="windows"] [data-device="windows"] .pui-device-screen, .pui-family[data-lit="android"] [data-device="android"] .pui-device-screen, .pui-family[data-lit="iphone"] [data-device="iphone"] .pui-device-screen, .pui-family[data-lit="web"] [data-device="web"] .pui-device-screen { box-shadow: 0 0 0 4px var(--pui-blue-soft), var(--pui-shadow); }

/* ── Round 3 motion (#35). Durations and easing come only from the brand motion tokens (--pui-ease is --motion-ease);
   the value after the comma is the token's recorded value, used where brand.css is not loaded. Nothing loops except the online dot. Without
   data-pui-play (and under reduced motion) every picture shows its complete still frame. ── */
.pui-family-row > :nth-child(2) { --i: 1; } .pui-family-row > :nth-child(3) { --i: 2; } .pui-family-row > :nth-child(4) { --i: 3; } .pui-family-row > :nth-child(5) { --i: 4; }
.pui-steps li:nth-child(2) { --i: 1; } .pui-steps li:nth-child(3) { --i: 2; } .pui-steps li:nth-child(4) { --i: 3; } .pui-steps li:nth-child(5) { --i: 4; }
@media (prefers-reduced-motion: no-preference) {
  /* M3: the product window enters once: it rises a little, then one glass-white sheen sweeps across it, left to right.
     Desk: the computer window. Family: each device, one after another, so the sheen travels along the row. */
  .pui-desk[data-pui-play="idle"] .pui-desk-screen, .pui-family[data-pui-play="idle"] .pui-device { opacity: 0; translate: 0 14px; }
  .pui-desk[data-pui-play="run"] .pui-desk-screen, .pui-family[data-pui-play="run"] .pui-device {
    animation: pui-enter var(--motion-slow, 900ms) var(--pui-ease) calc(var(--i, 0) * var(--motion-stagger, 120ms)) backwards; }
  .pui-desk[data-pui-play="run"] .pui-desk-screen::after, .pui-family[data-pui-play="run"] .pui-device-screen::after {
    content: ""; position: absolute; z-index: 6; top: -20%; bottom: -20%; left: 0; width: 40%; pointer-events: none; translate: -150% 0; transform: skewX(-12deg);
    background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--pui-white) 75%, transparent) 50%, transparent 80%);
    animation: pui-sheen calc(var(--motion-slow, 900ms) * 1.5) var(--pui-ease) calc(var(--motion-fast, 250ms) + var(--i, 0) * var(--motion-stagger, 120ms)) both; }
  /* M5, desk: once the window is up, its steps and the phone's tick in one by one and the progress bars fill. */
  .pui-desk[data-pui-play="idle"] .pui-steps li { opacity: 0; }
  .pui-desk[data-pui-play="run"] .pui-steps li { animation: pui-tick var(--motion-base, 600ms) var(--pui-ease) calc(var(--motion-slow, 900ms) + var(--i, 0) * var(--motion-base, 600ms)) backwards; }
  .pui-desk[data-pui-play="run"] .pui-steps li svg { animation: pui-pop var(--motion-fast, 250ms) var(--pui-ease) calc(var(--motion-slow, 900ms) + var(--motion-fast, 250ms) + var(--i, 0) * var(--motion-base, 600ms)) backwards; }
  .pui-desk[data-pui-play="run"]:not([data-scene="2"]) .pui-progress b { animation: pui-advance calc(var(--motion-slow, 900ms) * 2) var(--pui-ease) var(--motion-slow, 900ms) backwards; }
  /* M5, control panel: when the steps arrive they tick in one by one, not all at once. */
  .pui-control .pui-steps li[data-from="1"] { transition-delay: calc(var(--i, 0) * var(--motion-base, 600ms)); }
  /* M5: the green online dot breathes slowly: the one loop, as the page spec allows. */
  .pui-cloud .pui-dot { position: relative; }
  .pui-cloud .pui-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pui-breath var(--motion-breath, 2400ms) var(--pui-ease) infinite; }
}
@keyframes pui-enter { from { opacity: 0; translate: 0 14px; } }
@keyframes pui-sheen { from { translate: -150% 0; } to { translate: 350% 0; } }
@keyframes pui-tick { from { opacity: 0; translate: 0 4px; } }
@keyframes pui-pop { from { scale: 0; } }
@keyframes pui-advance { from { width: 0; } }
@keyframes pui-breath { 0% { scale: 1; opacity: .5; } 80%, 100% { scale: 2.6; opacity: 0; } }

@keyframes pui-drop-in { 0% { transform: translate(-120%, -160%) rotate(-6deg); opacity: 0; } 25% { opacity: 1; } 70% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes pui-grow { from { width: 30%; } to { width: 85%; } }
@keyframes pui-click-path { 0% { left: 20%; top: 80%; } 35% { left: 62%; top: 44%; } 60% { left: 62%; top: 62%; } 100% { left: 62%; top: 80%; } }
/* The cell fills at once at 40% (a hard edge in the keyframes, so no stepped easing is needed). */
@keyframes pui-fill { 0%, 39.9% { background: transparent; color: transparent; } 40%, 100% { background: var(--pui-blue-soft); color: var(--pui-blue); } }
@keyframes pui-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pui-press { 0%, 100% { transform: none; } 50% { transform: scale(.94); } }

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