/* The engine's shell around the storyboard's own slides and cards: how a page holds them, the
   transitions, the rehearsal and no-receipts marks, and the admin. It never restyles a slide or a
   card. Built from the storyboard's tokens. */
html,body{margin:0;background:var(--ground);color:var(--text);font-family:var(--font-sans)}
.te [hidden]{display:none !important}
.te .slide .s-brow .fill{--p:0%}
.te .slide .s-brow .was{--w:0%}
.te .phone .timer i{--p:0%}

/* marks: on every screen and phone of a rehearsal, or of a run with no receipts */
.te-marks{position:fixed;top:8px;right:8px;z-index:10;display:flex;gap:6px;pointer-events:none}
.te-marks span{font:400 11px/14px var(--font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--on-primary);background:var(--accent);border-radius:var(--radius-sm);padding:3px 7px}

/* the screen: one slide, as large as the display allows at 16:9 */
.te-screen{overflow:hidden}
.te-stage{position:fixed;inset:0;display:grid;place-items:center;background:var(--ground)}
.te-stage .te-frame{position:relative;width:min(100vw,177.78vh);aspect-ratio:16/9}
.te-frame>.slide{position:absolute;inset:0;height:100%;transition:opacity .5s ease}
.te-stage .slide{border:0;border-radius:0}
.te-frame>.slide.te-out,.te-frame>.slide.te-pre{opacity:0}
.te .te-enter{opacity:0;transform:translateY(1.2cqw);animation:te-rise .55s ease forwards}
@keyframes te-rise{to{opacity:1;transform:none}}
.te .slide .s-brow .fill{transition:width 1.1s cubic-bezier(.3,0,.2,1)}
.te .te-flip{transition:transform .9s cubic-bezier(.5,0,.2,1)}
.te-phone-link{display:none}
@media (max-width:700px){.te-phone-link{display:block;position:fixed;bottom:12px;left:0;right:0;text-align:center;color:var(--secondary);font-size:14px}}
@media (prefers-reduced-motion:reduce){.te-frame>.slide,.te .te-flip,.te .slide .s-brow .fill{transition-duration:.01s}.te .te-enter{animation-duration:.01s;animation-delay:0s !important}}

/* a phone: the storyboard's card, scaled to the display's width */
.te-play{min-height:100vh}
.te-phone .phone{zoom:var(--z,1);max-width:236px;margin:0 auto;border-color:transparent;background:var(--ground);border-radius:0}
.te-phone .phone [role=button]{cursor:pointer;-webkit-tap-highlight-color:transparent}
.te-phone .phone [role=button]:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* the landing page */
.te-landing{max-width:560px;margin:0 auto;padding:24px 16px 48px;display:grid;gap:20px}
.te-landing .lockup{height:22px;width:89px}
.te-viewport{display:block;border-radius:var(--radius-md);overflow:hidden}
.te-viewport .te-frame{position:relative;width:100%;aspect-ratio:16/9}
.te-legal{font-size:13px;line-height:18px;color:var(--text-muted)}
.te-legal a,.te-admin a{color:var(--secondary)}
.te-button{display:block;text-align:center;font:500 16px/22px var(--font-sans);border-radius:var(--radius-sm);padding:12px 14px;border:var(--stroke-strong) solid var(--primary);background:var(--primary);color:var(--on-primary);text-decoration:none;cursor:pointer}

/* the admin, and controller mode */
.te-admin{max-width:760px;margin:0 auto;padding:24px 16px;display:grid;gap:14px;font-size:15px;line-height:21px}
.te-admin h1{font-size:24px;margin:0}
.te-runs{border-collapse:collapse;font:400 13px/18px var(--font-mono)}
.te-runs td,.te-runs th{text-align:left;padding:5px 8px;border-bottom:1px solid var(--rule)}
.te-admin button:not(.te-button),.te-drawer button{font:inherit;color:var(--text);background:none;border:1px solid var(--edge);border-radius:var(--radius-sm);padding:6px 10px;cursor:pointer}
.te-controller{max-width:420px;margin:0 auto;padding:12px;display:grid;gap:10px}
.te-controller .phone{max-width:none}
.te-controller .nav .btn{cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.te-controller .nav .btn.te-holding{background:linear-gradient(90deg,var(--accent) 0,var(--accent) 100%) no-repeat 0 0/0 100%;animation:te-hold 1s linear forwards}
@keyframes te-hold{to{background-size:100% 100%}}
.te-controller .more{cursor:pointer}
.te-drawer{display:grid;gap:10px;padding:10px;border:1px solid var(--edge);border-radius:var(--radius-md)}

/* the record: the receipts page's lines open on a tap; the admin's status, chains and emails */
.te-phone .phone .hist .e[role=button]{cursor:pointer}
.te-phone .phone .chk[role=button]{cursor:pointer}
.te-phone .phone input.field{width:100%;box-sizing:border-box;margin-top:6px;background:none}
.te-controller .aux[data-aux]{cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.te-controller .aux.te-holding,.te-drawer button.te-holding,.te-admin button.te-holding{background:linear-gradient(90deg,var(--accent) 0,var(--accent) 100%) no-repeat 0 0/0 100%;animation:te-hold 1s linear forwards}
.te-status{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:0}
.te-status dt{color:var(--text-muted)}
.te-status dd{margin:0;min-width:0;overflow-wrap:anywhere}
.te-checked{font-size:12px;color:var(--text-muted)}
.te-run-more button{margin:2px 6px 2px 0}
.te-runs tr:has(+ .te-run-more) td{border-bottom:0}
.te-run-more td{padding-top:0}
.te-record{display:grid;gap:10px}
.te-record caption{text-align:left;padding:4px 0;color:var(--text-muted)}
.te-chain,.te-mail{border:1px solid var(--edge);border-radius:var(--radius-md);padding:10px;display:grid;gap:6px;margin-bottom:10px}
.te-mail pre{white-space:pre-wrap;font:400 13px/18px var(--font-mono);margin:0}
.te-admin h2{font-size:18px;margin:8px 0}
