/* An animation on the canvas: the scene, its state, and its script. */
.widget.anim { display: flex; flex-direction: column; }
.anim-screen { aspect-ratio: 16 / 9; background: #111; border-radius: 0 0 var(--r2) var(--r2); overflow: hidden; }
.anim-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.widget.anim .chip[data-state="running"] { border-color: var(--agent); color: var(--agent-ink); background: var(--agent-tint); }
.widget.anim .chip[data-state="error"] { border-color: var(--bad); color: var(--bad); background: var(--bad-tint); }
.anim-error { margin: 0; padding: var(--s2) var(--s3); background: var(--bad-tint); color: var(--bad); font-family: var(--font-mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.anim-script { display: grid; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--line); }
.anim-script textarea { width: 100%; min-height: 180px; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--surface-2); color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.5; resize: vertical; tab-size: 2; }
.anim-note { font-size: var(--fs-xs); color: var(--muted); }

.anim-foot { display: flex; justify-content: flex-end; padding: 4px var(--s3) 6px; }
.anim-foot .term-link { margin: 0; font-size: var(--fs-xs); }
.anim-screen { border-radius: 0; }
