/* Playable pictures (scene.js). Under the newest message the scene is the reply: its sentences,
   then the picture, with no box of its own, so it reads as the tutor talking. */
.scene-live { margin: 0 0 14px; font-size: var(--rt-body, 15px); line-height: 1.6; color: var(--ink, #303030); }
/* While its frame draws, a scene takes no room and shows nothing (the status line says Drawing);
   it takes its place once drawn, at its own height. */
.scene-live.is-loading, .scene-past-body.is-loading { height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; visibility: hidden; }
/* The tutor's question waits: no room while the scene is drawn, its room kept while it plays. */
.scene-held { display: none !important; }
.scene-quiet { visibility: hidden; }
.scene-says { margin: 0 0 12px; }
.scene-line { opacity: 0; transition: opacity .5s, color .5s; }
.scene-line.on { opacity: 1; }
.scene-live .scene:not(.is-done) .scene-line.on:not(.now) { color: var(--secondary, #6b6b6b); }
.scene-frame { display: block; width: 100%; aspect-ratio: 1 / .6; border: 0; background: transparent; color-scheme: light; }
.scene-control { margin-top: 2px; padding: 4px 2px; border: 0; background: none; color: var(--secondary, #6b6b6b); font: inherit; font-size: var(--rt-small, 13px); cursor: pointer; }
.scene-control:hover, .scene-control:focus-visible { color: var(--ink, #303030); }
/* Replay keeps its room while the scene plays, so finishing moves nothing. */
.scene:not(.is-done) .scene-control { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .scene-line { transition: none; } }

/* "Drawing", the last stage of the tutor's status line (workspace.js): the dots that were writing
   give way to a pen line that draws itself in their place. */
body.student-view.workspace-view .wait-pen { position: absolute; left: 0; top: 50%; width: 22px; height: 18px; margin-top: -9px; overflow: visible; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .3s; }
body.student-view.workspace-view .wait-pen path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
body.student-view.workspace-view #workspace-presence[data-stage=drawing] .wait-pen { opacity: 1; }
body.student-view.workspace-view #workspace-presence[data-stage=drawing] .wait-mark i { opacity: 0; animation: none; }
body.student-view.workspace-view #workspace-presence[data-stage=drawing] .wait-pen path { animation: pen-line 2.6s .3s infinite; }
@keyframes pen-line { 0% { stroke-dashoffset: 1; animation-timing-function: cubic-bezier(.45,0,.3,1); } 46% { stroke-dashoffset: 0; } 60% { stroke-dashoffset: 0; animation-timing-function: cubic-bezier(.5,0,.3,1); } 96%, 100% { stroke-dashoffset: -1; } }
@media (prefers-reduced-motion: reduce) { body.student-view.workspace-view #workspace-presence[data-stage=drawing] .wait-pen path { animation: none; stroke-dashoffset: 0; } }

/* An earlier scene: a small chip under its message that opens and closes it. */
.scene-past { margin: 8px 0 2px; scroll-margin: 28px 0 32px; }
.scene-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 9px; border: 1px solid var(--line, #e5e5e5); border-radius: 999px; background: var(--surface, #fff); color: var(--secondary, #6b6b6b); font: inherit; font-size: var(--rt-small, 13px); cursor: pointer; }
.scene-chip:hover, .scene-chip:focus-visible, .scene-past.is-open .scene-chip { color: var(--ink, #303030); border-color: var(--border, #d6d6d6); }
.scene-chip-mark { width: 0; height: 0; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .2s; }
.scene-past.is-open .scene-chip-mark { transform: rotate(90deg); }
.scene-past-body { margin-top: 10px; padding: 14px; border: 1px solid var(--line, #e5e5e5); border-radius: 12px; background: var(--surface, #fff); }
::highlight(scene-you) { background-color: #fbeedd; color: #8a4f16; }
::highlight(scene-text) { background-color: #e6ecfb; color: #2c478f; }
::highlight(scene-focus) { background-color: #fbe0e0; color: #9c2f2f; }
:root[data-appearance=dark] ::highlight(scene-you) { background-color: #3a2c1d; color: #e0a56b; }
:root[data-appearance=dark] ::highlight(scene-text) { background-color: #252f43; color: #a7b9e8; }
:root[data-appearance=dark] ::highlight(scene-focus) { background-color: #3d2424; color: #e58a8a; }
