:root{color-scheme:dark;--bg:#0b0d12;--panel:#14171f;--line:#ffffff12;--muted:#9499aa;--ink:#f3f4fa;--accent:#c4b4ff;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:14px}button,input,select{font:inherit}button,a,input,select{outline-offset:4px}button{border:1px solid var(--line);background:#ffffff06;color:inherit;border-radius:11px;padding:11px 15px;cursor:pointer;transition:background .15s}button:hover{background:#ffffff10}button:disabled{opacity:.45;cursor:wait}.primary{background:var(--accent);color:#171127;border-color:transparent;font-weight:650}.primary:hover{background:#d6caff}a{color:inherit;text-decoration:none}header{height:80px;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 28px;gap:32px}.brand{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:700}.brand img{object-fit:contain}.brand small{display:block;font-size:9px;letter-spacing:3px;color:var(--muted);margin-top:2px}#project-label{color:var(--muted);font-size:12px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header-actions{display:flex;align-items:center;gap:10px}.header-actions a{margin-left:12px;font-size:12px;color:var(--muted)}main{display:grid;grid-template-columns:minmax(0,1fr) 354px;min-height:calc(100dvh - 80px)}.stage{padding:24px 28px;min-width:0;display:flex;flex-direction:column;justify-content:center}.stage-top,.stage-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px}.stage-top{margin-bottom:16px;font-size:13px}.stage-top>div{display:flex;gap:8px}.stage-top button{padding:8px 10px;font-size:12px}#look-name{font-weight:600}#preview{position:relative;background:#020204;border:1px solid var(--line);border-radius:20px;overflow:hidden;aspect-ratio:16/9;max-height:calc(100dvh - 300px)}#screen{display:block;width:100%;height:100%;object-fit:contain}#still-label{position:absolute;bottom:16px;left:18px;padding:6px 9px;background:#0009;border:1px solid #fff2;border-radius:6px;color:#fff9;font-size:9px;letter-spacing:1.5px;pointer-events:none}.transport{display:flex;align-items:center;gap:10px;margin-top:20px}.transport #play{min-width:80px}.tempo{display:flex;align-items:center;margin-left:10px;gap:8px}.tempo label{font-size:10px;letter-spacing:1px;color:var(--muted)}.tempo input{width:65px;text-align:center;padding:10px 4px}.tempo button{font-size:12px;padding:10px}#beats{display:flex;gap:6px;margin-left:auto}#beats i{font-style:normal;font-size:10px;width:23px;height:23px;display:grid;place-items:center;border-radius:50%;color:#666;background:#ffffff06}#beats i.active{color:#191224;background:var(--accent)}.stage-bottom{margin-top:18px;color:var(--muted);font-size:11px}#status{max-width:75%}aside{background:var(--panel);border-left:1px solid var(--line);padding:24px 22px;max-height:calc(100dvh - 80px);overflow:auto}.style-switch{display:flex;padding:4px;background:#090b10;border-radius:13px}.style-switch button{flex:1;font-size:12px;padding:10px 5px;border:0;color:var(--muted)}.style-switch button[aria-pressed=true]{background:#2e293e;color:#eee5ff;box-shadow:0 1px 5px #0005}.tabs{display:flex;border-bottom:1px solid var(--line);margin-top:24px;margin-bottom:25px}.tabs button{flex:1;border:0;border-radius:0;font-size:12px;color:var(--muted);padding:12px 2px;border-bottom:2px solid transparent}.tabs button[aria-selected=true]{color:var(--ink);border-bottom-color:var(--accent)}h2{font-size:22px;letter-spacing:-.6px;margin:5px 0 18px}h3{font-size:13px;margin:24px 0 14px}p{line-height:1.65;color:var(--muted)}small,.hint{font-size:11px;color:var(--muted);line-height:1.6}label{display:flex;flex-direction:column;gap:8px;font-size:12px;margin:18px 0;color:#b4b7c5}input,select{border:1px solid #ffffff14;background:#090c12;color:var(--ink);border-radius:9px;padding:12px;width:100%;min-width:0}input[type=range]{accent-color:var(--accent);padding:0;cursor:pointer}input[type=color]{height:42px;padding:4px}.wide{width:100%;margin:6px 0}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.two label{margin:12px 0}.look-card{display:block;width:100%;padding:0;text-align:left;overflow:hidden;border-radius:15px}.look-card img{width:100%;height:110px;object-fit:cover;background:#090b11;display:block}.look-card span{display:block;padding:16px;font-weight:600}.look-card small{display:block;margin-top:4px}.divider{border:0;border-top:1px solid var(--line);margin:22px 0}details{margin-top:22px}summary{font-size:12px;color:var(--muted);cursor:pointer}dialog{background:#181b24;color:var(--ink);border:1px solid #ffffff20;border-radius:24px;padding:28px;width:min(500px,calc(100vw - 24px));max-height:90dvh;box-shadow:0 25px 120px #0009}dialog::backdrop{background:#050609bc;backdrop-filter:blur(9px)}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:15px}.dialog-head h2{margin:3px 0}.dialog-head button{padding:6px 10px}.dialog-head p{margin:7px 0}.dialog-head small{letter-spacing:1.5px;font-size:9px}fieldset{border:0;padding:0;margin:0}#video-access,#video-flash{padding:14px;background:#ffffff08;border-radius:10px;font-size:12px}progress{width:100%;accent-color:var(--accent);margin-top:20px}#library{width:min(850px,calc(100vw - 24px))}#library-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:22px}#library-grid button{padding:0;overflow:hidden;text-align:left}#library-grid img{display:block;width:100%;aspect-ratio:1.45;object-fit:cover;background:#090b10}#library-grid span{display:block;padding:11px;font-size:12px}.output-only header,.output-only aside,.output-only .stage-top,.output-only .stage-bottom,.output-only .transport{display:none}.output-only main{display:block}.output-only .stage{padding:0}.output-only #preview{width:100vw;height:100dvh;max-height:none;border:0;border-radius:0;aspect-ratio:auto}#preview:fullscreen{border-radius:0;max-height:none;background:black;width:100vw;height:100dvh}body.output-only #still-label{cursor:pointer;pointer-events:auto}.error{color:#ffb5b5!important}[hidden]{display:none!important}
@media(min-width:1500px){main{grid-template-columns:minmax(0,1fr) 390px}.stage{padding:35px 48px}aside{padding:28px}}
@media(max-width:1000px){main{grid-template-columns:minmax(0,1fr) 315px}.stage{padding:20px 18px}.transport{flex-wrap:wrap}#beats{margin-left:0}#output{margin-left:auto}.tempo{margin-left:0}aside{padding:20px 16px}header{padding:0 20px}}
@media(max-width:720px){header{height:66px;padding:0 16px;gap:10px}.brand{font-size:17px}.brand img{width:42px}.brand small{font-size:8px}#project-label{display:none}.header-actions{margin-left:auto;gap:7px}.header-actions button{font-size:12px;padding:9px 11px}.header-actions a{font-size:0;margin:0}.header-actions a:after{content:'◉';font-size:20px}main{display:flex;flex-direction:column}.stage{padding:16px;justify-content:flex-start}.stage-top{margin-bottom:10px}.stage-top #motion{font-size:10px}#preview{border-radius:14px;max-height:none}.transport{gap:7px;margin-top:14px}.transport button{padding:10px 12px}#beats{margin-left:auto;gap:4px}#beats i{width:19px;height:19px}#resync{display:none}#output{font-size:11px;margin-left:auto}aside{max-height:none;border-left:0;border-top:1px solid var(--line);padding:18px 20px 30px}.tabs{margin-top:12px;margin-bottom:20px}.look-card img{height:140px}.stage-bottom{margin-top:10px;font-size:10px}#library-grid{grid-template-columns:repeat(2,1fr)}dialog{padding:22px}h2{font-size:21px}}

textarea{font:inherit;resize:vertical;width:100%;min-height:128px;max-height:260px;line-height:1.7;border:1px solid #ffffff20;border-radius:12px;padding:14px;background:#090c12;color:var(--ink);outline-offset:4px}textarea:focus{border-color:var(--accent)}.words-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.words-heading h2{font-size:20px;margin:5px 0}.word-switch{display:flex;flex-direction:row;align-items:center;gap:7px;white-space:nowrap;font-size:11px}.word-switch input{appearance:none;width:34px;height:20px;border:0;border-radius:20px;background:#454755;position:relative;padding:0;cursor:pointer;flex-shrink:0}.word-switch input:before{content:"";position:absolute;width:14px;height:14px;border-radius:50%;background:white;top:3px;left:3px;transition:transform .15s}.word-switch input:checked{background:#9681d5}.word-switch input:checked:before{transform:translateX(14px)}.word-check{flex-direction:row;align-items:center}.word-check input{width:18px;height:18px;accent-color:var(--accent)}#word-count{display:block;margin-top:8px}#word-library .two{margin:10px 0}

/* The preview is the export frame, fitted inside the available stage. */
#preview{--preview-ratio:1.7777777778;width:min(100%,calc(clamp(220px,100dvh - 330px,720px) * var(--preview-ratio)));aspect-ratio:var(--preview-ratio);max-height:none;align-self:center;flex-shrink:0}
#preview-format{width:auto;font-size:12px;padding:8px 10px;max-width:180px}
.stage-top{flex-wrap:wrap}.preview-actions{margin-left:auto;flex-wrap:wrap;justify-content:flex-end}
#preview:fullscreen,body.output-only #preview{width:100vw;height:100dvh;aspect-ratio:auto;max-height:none}
@media(max-width:720px){#preview{width:min(100%,calc(55dvh * var(--preview-ratio)))}#preview-format{font-size:11px;max-width:156px}.stage-top{gap:8px}.stage-top>div{gap:5px}}

#mix-library{margin-top:28px;border-top:1px solid var(--line);padding-top:22px}.library-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.library-toolbar button{font-size:11px}.hint a{color:var(--accent)}

.studio-export-action{position:relative;display:flex;align-items:center}#studio-export-access{position:absolute;top:calc(100% + 3px);left:0;right:0;text-align:center;font-size:9px;line-height:1.2;color:var(--accent);white-space:nowrap}#video-entitlement{color:var(--accent);font-size:13px;font-weight:600}

/* Keep the instrument usable at every preview shape and screen size. */
button{min-height:44px;touch-action:manipulation}
button:disabled{cursor:default}
:where(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
input:not([type=range]):not([type=checkbox]),select{min-height:44px}
input[type=range]{height:28px;margin:0}
.brand,.header-actions,.preview-actions{flex-shrink:0}
.brand{white-space:nowrap}
.header-actions a{display:grid;place-items:center;min-width:44px;min-height:44px;border-radius:11px}
.header-actions a:hover{background:#ffffff08;color:var(--ink)}
.stage-top #look-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage-top #fullscreen{min-width:44px;padding:8px}
.transport #stop,.transport #resync{min-width:44px;padding-inline:10px}
.tempo label{margin:0;flex-shrink:0}
.tempo input{height:44px;min-width:0}
#loop-label{flex-shrink:0;white-space:nowrap;font-variant-numeric:tabular-nums}
.stage-bottom{align-items:flex-start;line-height:1.5}
#status{min-width:0;overflow-wrap:anywhere}
aside{display:flex;flex-direction:column;height:calc(100dvh - 80px);overflow:hidden}
.style-switch,.tabs{flex-shrink:0}
.tabs{margin-top:16px;margin-bottom:20px}
#controls{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ffffff30 transparent;padding:3px 4px 12px 0}
#controls>h2:first-child{margin-top:2px}
.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.two>*{min-width:0}
fieldset{min-width:0}
summary{min-height:44px;padding:13px 0;color:#b4b7c5;line-height:1.5}
details[open]>summary{color:var(--ink)}
.word-switch{min-height:44px;margin-block:8px}
.word-check{min-height:44px}
.words-heading{flex-wrap:wrap}
.words-heading h2{letter-spacing:-.4px}
dialog{max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ffffff30 transparent}
.dialog-head>div{min-width:0}
.dialog-head>button,.dialog-head>form>button{flex-shrink:0;min-width:44px;min-height:44px;padding:8px}
#video-summary,#video-status,#video-result,#video-access{overflow-wrap:anywhere}
#video-result a,#video-access a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
#library-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#library-grid span{overflow-wrap:anywhere;line-height:1.5}

@media(max-width:1000px) and (min-width:721px){
  .transport{gap:8px}.transport #play{min-width:72px}
  .tempo{gap:6px}.tempo input{width:60px}
  .stage-top #look-name{flex-basis:100%}
  .preview-actions{width:100%;justify-content:flex-start}
  #preview{width:min(100%,calc(clamp(160px,100dvh - 390px,720px) * var(--preview-ratio)))}
}
@media(max-width:720px){
  header{height:76px;padding-inline:16px}
  .header-actions{gap:6px}
  .header-actions button{min-height:44px;padding:10px 11px}
  .header-actions a{width:44px;height:44px;border:1px solid var(--line);background:#ffffff06}
  .header-actions a:after{content:'';width:20px;height:20px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2'/%3E%3C/svg%3E") center/contain no-repeat}
  main{min-height:calc(100dvh - 76px)}
  .stage{padding:14px 16px 16px}
  .stage-top{gap:9px;margin-bottom:12px}
  .stage-top #look-name{flex-basis:100%}
  .stage-top .preview-actions{width:100%;gap:6px;flex-wrap:nowrap}
  #preview-format{width:0;min-width:0;max-width:none;flex:1;font-size:12px;padding:10px}
  .stage-top #motion{font-size:11px;white-space:nowrap;padding-inline:10px}
  .stage-top #fullscreen{width:44px;flex-shrink:0}
  #preview{width:min(100%,calc(min(45svh,360px) * var(--preview-ratio)))}
  .transport{display:grid;grid-template-columns:80px 44px minmax(0,1fr) 44px;gap:8px;margin-top:14px}
  .transport #play{grid-column:1;grid-row:1}
  .transport #stop{grid-column:2;grid-row:1}
  .transport .tempo{grid-column:3/5;grid-row:1;gap:6px;justify-content:flex-end;margin:0}
  .tempo input{width:60px;flex:1;max-width:80px;font-size:16px;padding-inline:2px}
  .tempo button{min-width:44px;padding-inline:8px}
  #beats{grid-column:1/3;grid-row:2;margin:0;gap:6px}
  #beats i{width:24px;height:24px;font-size:11px}
  .transport #resync{display:block;grid-column:4;grid-row:2}
  .transport #output{grid-column:3;grid-row:2;justify-self:end;margin:0;white-space:nowrap;font-size:12px;padding-inline:10px}
  aside{height:auto;max-height:none;overflow:visible;padding:18px 20px 28px;scroll-margin-top:12px}
  #controls{overflow:visible;padding-right:0;padding-bottom:0}
  .tabs{margin-top:12px;margin-bottom:18px}
  #controls input:not([type=range]):not([type=checkbox]):not([type=color]),#controls select,#controls textarea{font-size:16px}
  dialog{padding:20px;border-radius:20px;max-height:calc(100dvh - 24px)}
  dialog input:not([type=range]):not([type=checkbox]),dialog select{font-size:16px}
  #video-settings .video-quality-row{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
  .dialog-head{gap:10px}
  .dialog-head h2{font-size:22px;line-height:1.25}
  #library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}
@media(max-width:360px){
  header{padding-inline:12px}.brand img{width:40px}.brand>span{display:none}
  .stage{padding-inline:12px}aside{padding-inline:16px}
  .header-actions{gap:8px}.header-actions button{padding-inline:12px}
  .transport{grid-template-columns:76px 44px minmax(0,1fr) 44px;gap:6px}
  .transport #play{min-width:0}.transport .tempo{gap:4px}
  .tempo label{font-size:9px}.tempo input{width:50px;max-width:64px}.tempo button{padding-inline:6px}
  dialog{padding:18px}.dialog-head h2{font-size:20px}
  #video-settings .two{grid-template-columns:1fr;gap:0}
}
@media(prefers-reduced-motion:reduce){button,.word-switch input:before{transition:none}}
/* Short landscape screens need space for the transport as well as the preview. */
@media(min-width:560px) and (max-width:1000px) and (max-height:500px){
  header{height:64px;padding-inline:16px;gap:14px}.brand{font-size:17px}.brand img{width:42px}#project-label{display:none}.header-actions{margin-left:auto}
  main{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,40%);min-height:calc(100svh - 64px);align-items:start}
  .stage{padding:10px 12px;justify-content:flex-start}.stage-top{margin-bottom:8px;gap:6px}
  .stage-top #look-name{flex-basis:auto;font-size:12px}.stage-top .preview-actions{width:auto;flex:1;flex-wrap:nowrap;justify-content:flex-end}
  #preview-format{width:128px;max-width:140px;flex:1;font-size:12px;padding-inline:6px}.stage-top #motion{font-size:11px;padding-inline:8px}
  #preview{width:min(100%,calc(max(70px,100svh - 280px) * var(--preview-ratio)))}
  .transport{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.transport #play{min-width:64px}.transport button{padding-inline:10px}.tempo{margin:0;gap:5px}.tempo input{width:56px;font-size:16px}.tempo label{font-size:10px}
  #beats{margin-left:0;gap:4px}#beats i{width:20px;height:20px}#output{margin-left:auto}.stage-bottom{margin-top:8px;font-size:10px}
  aside{height:calc(100svh - 64px);max-height:none;overflow:hidden;border-top:0;border-left:1px solid var(--line);padding:10px 12px}
  #controls{overflow:auto;min-height:0;padding-bottom:16px}.tabs{margin-top:8px;margin-bottom:10px}.style-switch button{font-size:12px}.look-card img{height:80px}
}
@media(max-width:1000px){input:not([type=range]):not([type=checkbox]):not([type=color]),select,textarea{font-size:16px}#preview-format{font-size:12px}}
html{scroll-padding-block:24px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
input,textarea,select{scroll-margin-block:24px}#controls{scroll-padding-block:24px}
dialog{padding-bottom:max(20px,env(safe-area-inset-bottom));scroll-padding-block:24px}
dialog .dialog-head{position:sticky;top:0;background:#181b24;box-shadow:0 -32px 0 #181b24;z-index:2;padding-bottom:8px}
html[data-keyboard-open] dialog[open]{position:fixed;inset:auto 0 auto;top:calc(var(--visible-top) + 8px);margin:0 auto;max-height:calc(var(--visible-height) - 16px);overscroll-behavior:contain}
html[data-keyboard-open] aside{height:auto;max-height:none;overflow:visible}
html[data-keyboard-open] #controls{overflow:visible}

/* Compact editing groups keep the current task in view. */
#controls h2{font-size:20px;margin-bottom:14px}
#controls>p.hint{margin:0 0 14px}
#controls details{margin-top:10px;border-top:1px solid var(--line)}
#controls details>summary{font-size:13px;font-weight:500}
.look-card{display:flex;align-items:center}
.look-card img{width:84px;height:76px;flex-shrink:0;object-fit:cover}
.look-card span{min-width:0;padding:12px;line-height:1.4}
.look-card small{font-weight:400}
#mix-library{margin-top:20px;padding-top:18px}
#mix-library .hint{margin-block:8px}
#video-settings .video-quality-row{grid-template-columns:repeat(2,minmax(0,1fr))}
#video-settings details{margin-top:4px;border-top:1px solid var(--line)}
#video-settings details>summary{padding-block:10px}
#video-status:empty{display:none}
#video-access a{display:inline-flex;align-items:center;min-height:44px;margin-right:12px}
.mobile-control-link{display:none}
@media(max-width:720px) and (min-height:501px){
  .mobile-control-link{display:block;align-self:center;min-height:44px;padding:14px 18px 8px;color:var(--accent);font-size:13px}
  aside .tabs{position:sticky;top:0;z-index:3;background:var(--panel);padding-top:4px}
}
body.output-only .mobile-control-link{display:none}
