/* App styles: the marketing site's tokens and its three type styles: heading (900 wide), paragraph (--m) and label
   (--s, 900 wide caps). One font. Three button looks: filled (default), .secondary (outline), .link. */
@font-face{font-family:Archivo;font-weight:100 900;font-stretch:62% 125%;font-display:swap;src:url(/app/archivo-latin.woff2) format("woff2")}
:root{--purple:#A015E0; --cyan:#00E0FF; --ink:#1E1E1E; --muted:#555555; --white:#FFFFFF; --grey:#F9F9F9; --grey-2:#EDEDED;
  --s:16px; --m:clamp(20px,2vw,24px); --l:clamp(36px,6vw,72px)}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100dvh;display:grid;place-items:center;padding:16px;background:var(--grey);color:var(--ink);font:400 var(--m)/1.45 Archivo,Arial,sans-serif}

/* type */
h1,h2,.big{font-weight:900;font-stretch:125%;line-height:1.05;margin:0 0 24px}
h1{font-size:clamp(32px,3.6vw,48px);text-align:center}
h1 .script{font:inherit;color:var(--purple)}
h2{font-size:var(--m);margin:32px 0 8px}
.big{font-size:var(--l);margin:0}
.script{font-weight:900;font-stretch:125%;color:var(--purple)} /* accent words: same type as headings, set apart by colour */
label,legend,button,a.button,.tag,aside h2{font-weight:900;font-stretch:125%;text-transform:uppercase;font-size:var(--s);line-height:1.2}
p{margin:16px 0 0}
/* prose is the site's paragraph: ink, paragraph size. Grey is only for UI chrome (icons, borders, idle tabs), never for
   sentences. The dense side panel and form hints use the label size, still ink. */
[role="alert"],label.check,.help,.note,aside .meta{font-size:var(--s)}
a,button.link{color:var(--purple);text-decoration:underline;text-underline-offset:3px}
p.switch{font-size:var(--s);margin-top:24px} /* "No account yet?" with its link on the line below, both one size */
.switch a{display:block;width:fit-content;margin:4px auto 0;padding:4px 0}
:focus-visible{outline:3px solid var(--purple);outline-offset:2px}

/* card: login, signup, reset, account, and every dialog */
.card,dialog{width:100%;min-width:0;max-width:520px;padding:40px clamp(20px,6vw,48px);border:0;background:var(--white);color:inherit;border-radius:28px;box-shadow:0 18px 40px -20px rgba(30,30,30,.3)}
dialog{max-width:min(520px,calc(100% - 32px))}
dialog::backdrop{background:rgba(30,30,30,.5)}
/* every popup closes with an X in its top right corner (and Esc) */
.x{position:absolute;top:12px;right:12px;z-index:3;margin:0} /* above the stickers */
:is(#close,.x>button){display:grid;place-items:center;width:40px;height:40px;min-height:0;margin:0;padding:0;border:0;border-radius:50%;background:none;color:var(--muted)}
:is(#close,.x>button):is(:hover,:focus-visible){background:var(--grey);color:var(--ink)}
:is(#close,.x>button) svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.card>img,.card>a>img,[data-card]>img{display:block;margin:0 auto 24px}
.card>p,dialog p{text-align:center}

/* forms */
label{display:block;margin-bottom:16px}
legend{margin-bottom:12px;padding:0}
input,select,textarea{display:block;width:100%;margin-top:8px;padding:12px 16px;border:2px solid var(--muted);border-radius:14px;background:var(--white);color:inherit;font:400 var(--m) Archivo,Arial,sans-serif}
input[type=range]{padding:0;border:0;accent-color:var(--ink)}
input[type=file]{font-size:var(--s)}
label.check{display:flex;gap:12px;align-items:center;margin-bottom:12px;font-weight:600;font-stretch:100%;text-transform:none;cursor:pointer}
label.check input{width:22px;height:22px;margin:0;flex:none;accent-color:var(--ink)}

/* settings rows: a label (with the slider's live value), the control, one help line that is always visible */
.row{margin:0 0 24px}
.row>label:not(.check){display:flex;justify-content:space-between;margin-bottom:0}
.row output{font-weight:600;font-stretch:100%;text-transform:none;color:var(--muted)}
.row select{font-size:var(--s)}
.row>button:not(.link,.info){width:100%;margin:0;padding:0 16px}
/* (i) shows a row's tip: to the right of the row's first line */
.row{position:relative}
div.row:has(>.info){display:flex;flex-wrap:wrap;align-items:center;gap:0 12px}
div.row:has(>.info)>:not(.info){flex:1 0 100%}
div.row:has(>.info)>:first-child{flex:1 1 0;margin-block:0}
legend:has(>.info){display:flex;justify-content:space-between;align-items:center;width:100%}
.info{flex:none;width:24px;height:24px;min-height:0;margin:0;padding:0;justify-content:center;border:2px solid var(--grey-2);border-radius:50%;background:none;color:var(--muted);font-size:13px;font-stretch:100%;text-transform:none}
.info[aria-expanded=true]{border-color:var(--ink);color:var(--ink)}
.help{margin:6px 0 0}
.help+.help{margin-top:12px}
.ends{display:flex;justify-content:space-between;margin:0;font-size:13px;color:var(--muted)}
.note{margin:0 0 24px;padding:12px 16px;border-radius:14px;background:var(--grey);font-weight:600}
.reset:disabled{display:none}
/* the studio's one message: bottom of the sidebar (bottom of the screen on phones), green when something worked */
#toast{position:fixed;z-index:20;right:24px;bottom:24px;width:312px;display:flex;align-items:center;gap:12px;padding:12px 12px 12px 16px;border:2px solid #12A150;border-radius:14px;background:#E8F7EE;color:var(--ink);font-weight:600;font-size:var(--s);line-height:1.35;box-shadow:0 18px 40px -20px rgba(30,30,30,.45);animation:toastIn .2s ease-out}
#toast[hidden]{display:none}
#toast::before{content:"✓";flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#12A150;color:var(--white);font-weight:900}
#toast.err{border-color:var(--ink);background:var(--white)}
#toast.err::before{content:"!";background:var(--ink)}
#toast>span{flex:1;min-width:0;overflow-wrap:anywhere}
#toast button.link{flex:none;font-weight:900;color:var(--ink)}
#toast button.x{position:static;display:grid;place-items:center;width:32px;height:32px;margin:-6px -4px -6px 0;font-size:22px;line-height:1;text-decoration:none;color:var(--muted)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}}
@media (prefers-reduced-motion:reduce){#toast{animation:none}}
@media (max-width:800px){#toast{left:16px;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));width:auto}}
h3{margin:0 0 12px;font-weight:900;font-stretch:125%;text-transform:uppercase;font-size:var(--s)}
.keylist div{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;font-size:var(--s);font-weight:600}
.keylist button{width:auto;min-width:120px;min-height:44px;margin:0;padding:0 12px;text-transform:none;font-stretch:100%}
.keylist [data-lost] span::before{content:"! ";color:var(--ink)}
.keylist [data-lost] button{outline:3px solid var(--ink)}
fieldset{margin:0 0 24px;padding:0;border:0;min-width:0}
fieldset p{margin:0 0 16px}
[role="alert"]{padding:12px 16px;border-radius:14px;background:var(--grey);font-weight:600}

/* buttons: the marketing site's pill shape */
button,a.button{display:inline-flex;gap:12px;align-items:center;justify-content:center;min-height:60px;padding:0 40px;border:2px solid var(--purple);border-radius:14px;background:var(--purple);color:var(--white);font-family:inherit;text-decoration:none;cursor:pointer}
button:disabled{opacity:.6;cursor:default}
button:not(:disabled):active{transform:scale(.97)} button{transition:transform .08s} /* every press gives way a little */
button.link{display:inline;min-height:0;padding:0;border:0;background:none;font:inherit;font-size:var(--s);text-transform:none}
/* in every card and dialog, buttons are full width and stacked: one look on every page */
form button,#oauth button,:is(.card,dialog) :is(button,a.button):not(.link){display:flex;width:100%;margin-top:12px;padding:0 24px}
form button.link{display:inline;width:auto;margin:0;padding:0} /* a text link inside a form stays inline */
button.link.quiet{color:var(--muted)}
#oauth button,.secondary{background:var(--white);border-color:var(--ink);color:var(--ink)}
/* "Continue with Google": Google's own button, CSS and markup as published (developers.google.com/identity/branding-guidelines,
   light), with Roboto 500 from Google Fonts. Scaled in proportion to sit with our other form buttons (same height, width
   and corner radius as Continue), as Clerk / Auth0 / Supabase Auth UI do: Google's 40px/14px/20px becomes 60px/16px/24px. */
#oauth .gsi-material-button{-webkit-appearance:none;appearance:none;display:block;width:100%;height:60px;min-height:60px;margin:12px 0 0;padding:0 18px;position:relative;overflow:hidden;box-sizing:border-box;border:1px solid #747775;border-radius:14px;background-color:#fff;background-image:none;color:#1f1f1f;font-family:Roboto,arial,sans-serif;font-size:16px;font-weight:500;font-stretch:100%;letter-spacing:.25px;text-align:center;text-transform:none;white-space:nowrap;vertical-align:middle;cursor:pointer;outline:none;transition:background-color .218s,border-color .218s,box-shadow .218s;user-select:none}
#oauth .gsi-material-button .gsi-material-button-icon{height:24px;min-width:24px;width:24px;margin-right:18px}
#oauth .gsi-material-button .gsi-material-button-icon img{display:block;width:24px;height:24px}
#oauth .gsi-material-button .gsi-material-button-content-wrapper{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;height:100%;width:100%;position:relative}
#oauth .gsi-material-button .gsi-material-button-contents{flex-grow:1;overflow:hidden;text-overflow:ellipsis;font-family:Roboto,arial,sans-serif;font-weight:500;vertical-align:top}
#oauth .gsi-material-button .gsi-material-button-state{position:absolute;inset:0;opacity:0;transition:opacity .218s}
#oauth .gsi-material-button:disabled{cursor:default;background-color:#ffffff61;border-color:#1f1f1f1f}
#oauth .gsi-material-button:disabled .gsi-material-button-contents,#oauth .gsi-material-button:disabled .gsi-material-button-icon{opacity:38%}
#oauth .gsi-material-button:not(:disabled):active .gsi-material-button-state,#oauth .gsi-material-button:not(:disabled):focus .gsi-material-button-state{background-color:#303030;opacity:12%}
#oauth .gsi-material-button:not(:disabled):hover{box-shadow:0 1px 2px 0 rgba(60,64,67,.30),0 1px 3px 1px rgba(60,64,67,.15)}
#oauth .gsi-material-button:not(:disabled):hover .gsi-material-button-state{background-color:#303030;opacity:8%}
#oauth p{display:flex;align-items:center;gap:12px;margin:16px 0;color:var(--muted);font-size:var(--s)}
#oauth p::before,#oauth p::after{content:"";flex:1;border-top:2px solid var(--grey-2)}

/* the "Up to 30 minutes" note on the upload and progress cards */
.eta{margin:16px 0 0;padding:14px 16px;border-radius:14px;background:var(--grey);font-size:var(--s);color:var(--muted)}
.eta strong{display:block;font-size:var(--m);font-weight:900;color:var(--ink)}
.eta strong::before{content:"◷ ";color:var(--purple)}

/* locked features: the tag says what unlocks it and disappears once it's unlocked (body data-tier, set by the studio) */
.tag{margin-left:auto;padding:4px 10px;border-radius:99px;background:var(--ink);color:var(--white);font-size:12px;white-space:nowrap}
[data-tier=pro] .tag,[data-tier=free] .tag[data-for=account]{display:none}

/* a row of choices: radio buttons as chips (the feedback card's topic) */
.choices{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.choices label{position:relative;display:inline-flex;margin:0;cursor:pointer}
.choices input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.choices span{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border:2px solid var(--ink);border-radius:14px;transition:background .15s,color .15s}
.choices input:checked+span{background:var(--ink);border-color:var(--ink);color:var(--white)}
.choices input:focus-visible+span{outline:3px solid var(--purple);outline-offset:2px}
.choices+textarea{margin-top:0}

/* progress: signup steps (main.step2, set by emailStep in app.js) */
.steps{display:flex;gap:4px;margin-bottom:24px}
.steps i{flex:1;height:8px;border-radius:8px;background:var(--grey-2);transition:background .3s}
.steps i:first-child,.step2 .steps i:last-child{background:var(--ink)}

/* an avatar being made: its steps (done = tick, now = spinner) and a rotating quirky line */
/* "Alpha" pill with its explainer on hover or focus (data-tip): next to the logo on every page, and on new features */
.eyebrow{margin:0 0 12px}
.alpha{position:relative;display:inline-block;padding:3px 10px;border-radius:99px;background:var(--ink);color:var(--white);font-size:12px;font-weight:900;font-stretch:125%;line-height:1.4;text-transform:uppercase;letter-spacing:.04em;vertical-align:1px;cursor:help}
.alpha::after{content:attr(data-tip);position:absolute;z-index:5;top:calc(100% + 8px);left:50%;width:max-content;max-width:260px;padding:10px 12px;border-radius:12px;background:var(--ink);color:var(--white);font:400 14px/1.4 Archivo,Arial,sans-serif;letter-spacing:0;text-align:left;text-transform:none;transform:translateX(-50%);opacity:0;pointer-events:none;transition:opacity .15s}
.alpha:is(:hover,:focus-visible)::after{opacity:1}
.artcheck{position:relative}
/* the upload card's art picker: a drop zone that is the file input itself (it covers the zone, invisible) */
.drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;padding:28px 16px;border:2px dashed var(--purple);border-radius:22px;background:var(--white);text-align:center;cursor:pointer}
.drop input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.drop:hover{background:color-mix(in srgb,var(--purple) 6%,var(--white))}
.drop:has(input:focus-visible){outline:3px solid var(--purple);outline-offset:3px}
.drop .plus{font-size:36px;font-weight:900;line-height:1;color:var(--purple)}
.drop strong{text-transform:none;font-stretch:100%;color:var(--ink)}
.drop span{font-size:var(--s);font-weight:400;font-stretch:100%;text-transform:none;color:var(--muted)}
.drop.picked{width:max-content;margin:0 auto;padding:4px 8px;border:0;background:none}
.drop.picked strong{font-weight:600;color:var(--purple);text-decoration:underline;text-underline-offset:3px}
.drop.picked :is(.plus,span){display:none}
#upload>input{margin-top:16px;padding:16px;font-size:var(--s)}
#upload>.meta{margin-top:12px}
/* the look at the art in the upload card: one line (verdict: good / poor) */
.artcheck{--c:var(--muted);--bg:var(--grey);margin:12px 0 16px;padding:12px 16px;border-radius:14px;background:var(--bg);font-size:var(--s);color:var(--c)}
.artcheck strong::before{display:inline-grid;place-items:center;width:20px;height:20px;margin-right:8px;border-radius:50%;background:var(--c);color:var(--white);font-size:12px;vertical-align:1px}
.artcheck[data-verdict=good]{--c:#1E7A46;--bg:#E8F6EE}
.artcheck[data-verdict=good] strong::before{content:"✓"}
.artcheck[data-verdict=tip]{--c:#8A5A00;--bg:#FFF4D6}
.artcheck[data-verdict=tip] strong::before{content:"!"}
.artcheck[data-verdict=poor]{--c:#B42318;--bg:#FDECEA}
.artcheck[data-verdict=poor] strong::before{content:"✕"}
.jobsteps{max-width:300px;margin:0 auto;padding:0;list-style:none;font-size:var(--s);font-weight:600;color:var(--muted)}
.jobsteps li{display:flex;align-items:center;gap:12px;padding:6px 0}
.jobsteps li::before{content:"";flex:none;display:grid;place-items:center;width:22px;height:22px;border:2px solid var(--grey-2);border-radius:50%;font-size:13px}
.jobsteps [data-state=done],.jobsteps [data-state=now]{color:var(--ink)}
.jobsteps [data-state=done]::before{content:"✓";border-color:var(--ink);background:var(--ink);color:var(--white)}
.jobsteps [data-state=now]::before{border-color:var(--purple);border-top-color:transparent;animation:spin 1s linear infinite}
@keyframes spin{to{rotate:360deg}}
.quirk{min-height:2.6em;margin:-8px 0 20px;font-size:var(--s);font-weight:600;line-height:1.3;animation:quirk .5s ease-out}
@keyframes quirk{from{opacity:0;translate:0 6px}}
@media (prefers-reduced-motion:reduce){.quirk{animation:none}}
.tile.making{position:relative}
.tile.making img{opacity:.55}
.tile.making::after{content:attr(data-band);position:absolute;inset:auto 0 0;padding:3px 0;background:var(--purple);color:var(--white);font-size:11px;text-transform:uppercase}
textarea{resize:vertical;font-size:var(--s);line-height:1.45}
/* confetti for a finished avatar: pieces fall over the whole screen, then the box is emptied */
.confetti{position:fixed;inset:0;z-index:1;overflow:hidden;pointer-events:none}
.confetti i{position:absolute;top:-16px;width:8px;height:14px;border-radius:2px;animation:fall 2.6s cubic-bezier(.25,.6,.4,1) forwards}
@keyframes fall{to{translate:var(--x) calc(100vh + 32px);rotate:var(--r)}}
@media (prefers-reduced-motion:reduce){.jobsteps [data-state=now]::before{animation:none}}

/* stickers and the "your art -> live" pair, as on the marketing site */
.sticker{position:absolute;z-index:2;display:grid;place-items:center;width:5.6em;height:5.6em;white-space:nowrap;border-radius:50%;background:var(--white);color:var(--ink);border:2px solid var(--ink);font-weight:900;font-stretch:125%;text-transform:uppercase;font-size:var(--s);line-height:1.1;text-align:center;transform:rotate(-12deg);pointer-events:none}
.duo{display:grid;grid-template-columns:2fr 3fr;align-items:center;gap:36px;max-width:340px;margin:16px auto 32px}
.duo:not(.solo) .art::after{content:"";position:absolute;top:50%;right:-30px;width:14px;height:14px;border:solid var(--purple);border-width:3px 3px 0 0;transform:translateY(-50%) rotate(45deg)} /* art -> live */
.duo.solo{grid-template-columns:1fr;max-width:150px}
.duo figure{position:relative;margin:0;aspect-ratio:3/4;border-radius:22px;box-shadow:0 18px 40px -20px rgba(30,30,30,.45)}
.duo img{display:block;width:100%;height:100%;border-radius:22px;object-fit:cover} /* block: no baseline gap under it */
.duo .art{background:var(--white);transform:rotate(-5deg)}
.duo .live{background:var(--grey-2);transform:rotate(5deg)}
.duo.solo .art .sticker{bottom:-24px;left:-20px;font-size:12px;white-space:normal;padding:0 8px;width:min-content;min-width:5.6em;height:auto;aspect-ratio:1} /* grows to its longest word (REMAKING…), never spills */
.duo .live img{object-fit:contain;padding-top:12%}
.sticker.hot{background:var(--purple);color:var(--white);border-color:var(--white)} /* a finished avatar's "Ready!" */
.price{display:flex;align-items:baseline;justify-content:center;gap:12px;margin:0}
.plan{max-width:max-content;margin:16px auto 0;padding:0 0 0 20px;font-size:var(--s);line-height:1.6}
.price .script{font-size:var(--m)}
.price:has(.per){gap:2px} /* $19/mo reads as one price */

/* a canned idle motion for the "Live!" picture in the Go Pro card (the stage has the real engine) */
.duo .live img{transform-origin:50% 100%;animation:idle 5s ease-in-out infinite}
@keyframes idle{0%,100%{translate:0 0;rotate:0deg}25%{translate:0 -6px;rotate:.8deg}50%{translate:0 -2px;rotate:0deg}75%{translate:0 -7px;rotate:-.8deg}}
@media (prefers-reduced-motion:reduce){.duo .live img{animation:none}}

/* header: studio and account */
header{display:flex;gap:16px 24px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.brand{position:relative;display:flex;gap:12px;align-items:center}
.card>.brand{justify-content:center;margin:0 0 24px}
.brand .alpha{position:static;font-size:14px;padding:4px 12px}
.brand .alpha::after{left:0;max-width:min(320px,calc(100vw - 32px));transform:none} /* under the logo, never off screen */
header img{display:block;width:clamp(110px,14vw,150px);height:auto}
header nav{display:flex;gap:16px 24px;align-items:center;flex-wrap:wrap;font-size:var(--s)}
header a:not(.button),header button.link{display:inline-flex;align-items:center;min-height:44px;font-weight:900;font-stretch:125%;text-transform:uppercase;font-size:var(--s);color:var(--ink);text-decoration:none}
.m-feedback{display:none} /* phones: Feedback lives in the Avatars panel, not the header (see the phone block) */
.links{display:flex;justify-content:center;gap:24px;margin-top:32px;font-size:var(--s)}
.links.quiet-links{margin-top:12px}

/* a summary box: label left, value right (account page) */
.stats{margin:24px 0 0;padding:4px 20px;border-radius:20px;background:var(--grey)}
.stats div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0}
.stats div+div{border-top:1px solid var(--grey-2)}
.stats dt{font-weight:900;font-stretch:125%;text-transform:uppercase;font-size:var(--s)}
.stats dd{display:flex;align-items:center;gap:8px;margin:0;font-weight:600}
.stats label{display:inline;margin:0;font:inherit}
.stats select{width:auto;margin:0;padding:8px 12px;font-size:var(--s)}
header a.button,.toolbar button{min-height:48px;padding:0 24px}
section>button{margin:16px 12px 0 0}

/* studio: a full-page app. Stage left with a floating toolbar, characters right; stacked on phones. */
body.app{display:flex;flex-direction:column;align-items:stretch;height:100dvh;padding:0}
.app>header{min-height:76px;padding:12px clamp(16px,3vw,32px);background:var(--white);border-bottom:1px solid var(--grey-2)}
.app main{flex:1;min-height:0;display:grid;grid-template-columns:1fr 360px}
.view{position:relative;display:flex;flex-direction:column;min-height:0}
.stage{position:relative;flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:24px 24px 112px;background:var(--grey);transition:background-color .3s}
.stage.transparent{background:repeating-conic-gradient(var(--grey-2) 0 25%,var(--white) 0 50%) 0 0/24px 24px} /* the usual "transparent" checkerboard */
.stage canvas{position:absolute;inset:0 0 96px;width:100%;height:calc(100% - 96px);touch-action:none;cursor:grab}
#loading{position:absolute;inset:24px 24px 112px;margin:auto;width:40px;height:40px;border-radius:50%;border:4px solid var(--grey-2);border-top-color:var(--ink);animation:spin .8s linear infinite} /* while an avatar loads */
#loading[hidden]{display:none}
@keyframes spin{to{transform:rotate(1turn)}}
@media (prefers-reduced-motion:reduce){#loading{animation-duration:2.4s}}
#gl{transition:opacity .25s}#gl.off{opacity:0;transition:none} /* the live avatar fades in over the poster */
.recording #gl{object-fit:cover;object-position:bottom} /* recording: the canvas is the video's size, cropped back to the stage's box on screen (it stands on the bottom edge, engine/gl.mjs _box) */
#overlay{position:absolute;inset:0;display:grid;place-content:center;gap:8px;text-align:center;background:rgba(255,255,255,.7)}
#overlay b{font-weight:900;font-stretch:125%;font-size:var(--l);line-height:1}
#stageMsg{position:absolute;bottom:104px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 352px);margin:0;padding:8px 16px;border:2px solid var(--white);border-radius:14px;background:var(--white);font-size:var(--s);font-weight:600;text-align:center;box-shadow:0 18px 40px -20px rgba(30,30,30,.45)}
#stageMsg.err{border-color:var(--ink)}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#customName{margin:0;font-weight:900;font-stretch:125%;font-size:clamp(28px,3vw,40px);text-align:center;white-space:pre-line}
.toolbar{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);display:flex;gap:8px;padding:8px;border-radius:20px;background:var(--white);box-shadow:0 18px 40px -20px rgba(30,30,30,.45)}
.toolbar button{white-space:nowrap}
.toolbar .step{align-self:center;width:8px;height:8px;border:solid var(--muted);border-width:2px 2px 0 0;transform:rotate(45deg);margin:0 4px 0 0}
aside{min-height:0;overflow-y:auto;padding:32px 24px;background:var(--white);border-left:1px solid var(--grey-2)}
aside h2{margin:0 0 16px}
#freeSection{margin-top:40px}
aside .meta{margin-top:12px}

/* tabs: the panel's (underlined) and the settings' sub-tabs (pills) */
[role=tablist]{display:flex;gap:0;margin:0 0 24px;border-bottom:1px solid var(--grey-2)}
[role=tab]{flex:1 1 0;min-width:0;min-height:52px;padding:0 2px;border:0;border-bottom:3px solid transparent;border-radius:0;background:none;color:var(--muted);font-stretch:100%;font-weight:800;font-size:clamp(12px,3.6vw,14px)}
[role=tab][aria-selected=true]{border-bottom-color:var(--ink);color:var(--ink)}
[role=tab] svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
aside>[role=tablist] [role=tab]{flex-direction:column;gap:3px;padding:6px 2px 8px;font-size:11px;letter-spacing:.02em;text-transform:uppercase}
aside>[role=tablist]{position:sticky;top:-32px;z-index:1;margin-top:-8px;background:var(--white)}
/* settings: one list, a heading per section (bigger than the row labels, which are caps) */
fieldset+fieldset{margin-top:32px;padding-top:24px;border-top:1px solid var(--grey-2)}
fieldset>h3{margin:0 0 16px;font-size:var(--m);text-transform:none}

/* expressions and keys */
.expr{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}
.expr button{min-height:52px;padding:0 12px;text-transform:none;font-stretch:100%;font-weight:600}
.expr button[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:var(--white)} /* the one that's on: filled, like a picked choice */
kbd{min-width:1.8em;padding:2px 6px;border:2px solid currentColor;border-radius:6px;font:700 13px/1.2 Archivo,Arial,sans-serif;text-align:center}
#preview{display:block;width:100%;margin:8px 0 0;border-radius:14px;transform:scaleX(-1);background:var(--ink)}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:12px;margin:0;padding:0;list-style:none}
.tile{width:100%;height:auto;aspect-ratio:1;min-height:0;padding:0;overflow:hidden;border-color:var(--grey-2);background:var(--grey);color:var(--ink);font-size:var(--m)}
.tile img{width:100%;height:100%;object-fit:cover;object-position:top}
.tile[aria-pressed="true"]{border:3px solid var(--ink)}
.tile.make{border:2px dashed var(--purple);background:var(--white);color:var(--purple);font-size:32px}
.tile{position:relative}
.posters{display:flex;justify-content:center;gap:12px;margin:8px 0 16px}
.posters img{width:96px;height:96px;object-fit:cover;border-radius:18px;background:var(--grey);filter:grayscale(1);opacity:.7}
.tile[data-lock="pro"] img{filter:grayscale(1);opacity:.55} /* a custom avatar on a lapsed plan */
.tile[data-lock]::after{content:"";position:absolute;right:6px;bottom:6px;width:22px;height:22px;border-radius:50%;background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E1E1E' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/12px no-repeat;box-shadow:0 2px 8px rgba(30,30,30,.2)}
/* the pencil on your own characters: shows on hover or keyboard focus, always on touch screens */
.tiles li{position:relative}
.tile-edit{position:absolute;top:6px;right:6px;width:32px;min-height:32px;height:32px;padding:0;border:0;border-radius:50%;background:var(--white);color:var(--ink);box-shadow:0 4px 12px rgba(30,30,30,.25);opacity:0;transition:opacity .15s}
.tile-edit svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.tiles li:hover .tile-edit,.tile-edit:focus-visible{opacity:1}
.tile-edit.hint{opacity:1} /* the first finished make: its pencil stays visible */
#coach{position:fixed;z-index:20;width:240px;padding:14px 16px;border:2px solid var(--ink);border-radius:14px;background:var(--white);color:var(--ink);font-weight:600;font-size:var(--s);line-height:1.35;box-shadow:0 18px 40px -20px rgba(30,30,30,.45)}
#coach::before{content:"";position:absolute;top:-9px;left:calc(var(--arrow) - 8px);width:14px;height:14px;border-left:2px solid var(--ink);border-top:2px solid var(--ink);background:var(--white);transform:rotate(45deg)}
#coach p{margin:0 0 12px}
#coach button{width:100%;min-height:40px;margin:0}
@media (hover:none){.tile-edit{opacity:1}}

/* live mode: only the avatar, filling the window, for an OBS window capture */
.live>header,.live aside,.live .toolbar{display:none}
.live main{grid-template-columns:1fr}
.live .stage{padding:24px}
.live #loading{inset:24px}
.live .stage canvas{inset:0;height:100%}
.live #stageMsg{bottom:80px;max-width:calc(100% - 32px)}
.live .stage::before{content:"Stream view. Press Esc to leave.";position:absolute;bottom:80px;padding:8px 16px;border-radius:14px;background:var(--white);font-size:var(--s);font-weight:600;animation:fade 3s forwards}
@keyframes fade{80%{opacity:1}to{opacity:0}}
#liveBar{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);display:flex;gap:8px;opacity:0;transition:opacity .3s}
#liveBar button{min-height:44px;margin:0;padding:0 16px}
.live.moving #liveBar,#liveBar:has(:focus-visible){opacity:1}
.live:not(.moving) .stage canvas{cursor:none}
#stageRec{position:absolute;top:16px;right:16px;min-height:44px;padding:0 16px}
.live #stageRec{display:none}
body:not(.live) #liveBar{display:none}
/* Record: a red dot, pulsing while recording */
.rec::before{content:"";flex:none;width:10px;height:10px;border-radius:50%;background:#E5484D}
.recording .rec::before{animation:pulse 1s ease-in-out infinite alternate}
@keyframes pulse{to{opacity:.25}}


@media (max-width:800px){
  body.app{height:auto}
  .app main{grid-template-columns:minmax(0,1fr)} /* minmax(0): the row can never be wider than the phone */
  .view,.stage,aside{min-width:0}
  .stage{height:60vh;flex:none;padding-bottom:24px}
  .stage canvas{inset:0;height:100%}
  .live .stage{height:100dvh}
  #stageMsg{bottom:16px;max-width:calc(100% - 32px)}
  .toolbar .step{display:none} /* three buttons on one row; the purple one still marks the next step */
  .toolbar{position:static;transform:none;justify-content:center;flex-wrap:wrap;border-radius:0;box-shadow:none}
  aside{border-left:0;border-top:1px solid var(--grey-2)}
  /* the header on one row: a smaller logo and buttons, so the avatar starts higher */
  .app>header{flex-wrap:nowrap;gap:12px;padding:10px 16px}
  .app>header img{width:96px}
  .brand{gap:8px}
  .brand .alpha{font-size:10px;padding:2px 6px}
  header nav{flex-wrap:nowrap;gap:10px}
  header a:not(.button),header button.link{font-size:12px;white-space:nowrap}
  header a.button{min-height:40px;padding:0 10px;font-size:12px;white-space:nowrap}
  .app>header img{width:84px}
  header button.feedback{display:none}
  .m-feedback{display:block;margin:32px 0 0;text-align:center}
  .toolbar{flex-wrap:nowrap;gap:6px;padding:8px 12px}
  .toolbar button{flex:1 1 0;min-width:0;min-height:44px;padding:0 4px;font-size:11px;white-space:normal;line-height:1.1}
  #stageRec{right:12px;padding:0 12px;font-size:12px}
  #camera{flex-grow:1.25}
}

#feedbackEmail{display:block;margin-top:16px}
