:root{--bg:var(--tg-theme-bg-color,#fff);--bg2:var(--tg-theme-secondary-bg-color,#f2f2f7);--text:var(--tg-theme-text-color,#111);--hint:var(--tg-theme-hint-color,#8a8a8e);--accent:var(--tg-theme-button-color,#2481cc);--accent-text:var(--tg-theme-button-text-color,#fff);--section:var(--tg-theme-section-bg-color,#fff);--danger:var(--tg-theme-destructive-text-color,#e53935);--radius:12px;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}}*{box-sizing:border-box}body{background:var(--bg2);color:var(--text);-webkit-tap-highlight-color:transparent;margin:0;font:15px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.app{max-width:560px;padding:12px 12px calc(24px + env(safe-area-inset-bottom,0px));margin:0 auto}.center{text-align:center}.header{justify-content:space-between;align-items:center;gap:8px;display:flex}.header h1{margin:4px 0 8px;font-size:20px}.pill{background:var(--section);color:var(--hint);white-space:nowrap;border-radius:999px;padding:4px 10px;font-size:12px}.stack{flex-direction:column;gap:12px;display:flex}.card{background:var(--section);border-radius:var(--radius);flex-direction:column;gap:10px;padding:14px;display:flex}.card h3{margin:0;font-size:16px}.field{flex-direction:column;gap:6px;display:flex}.field>span{color:var(--hint);font-size:13px}select,input,textarea{font:inherit;color:var(--text);background:var(--bg2);border:1px solid #0000;border-radius:10px;width:100%;padding:10px 12px}textarea{resize:vertical}select:focus,input:focus,textarea:focus{border-color:var(--accent);outline:none}button{font:inherit;background:var(--bg2);color:var(--text);cursor:pointer;border:0;border-radius:10px;padding:10px 14px}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--accent);color:var(--accent-text);padding:13px;font-weight:600}.link-button{color:var(--accent);text-align:left;background:0 0;padding:0}.hint{color:var(--hint);margin:0;font-size:13px}.pre{white-space:pre-line}.warn{color:var(--danger);font-size:13px}.segmented,.tabs{background:var(--bg2);border-radius:10px;gap:3px;padding:3px;display:flex}.segmented button,.tabs button{background:0 0;flex:1;padding:8px 6px;font-size:14px}.segmented button.active,.tabs button.active{background:var(--section);font-weight:600;box-shadow:0 1px 2px #0000001f}.nav{margin-bottom:12px}.row{gap:8px;display:flex}.row input{flex:1;min-width:0}.gallery{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;display:grid}.poster{text-align:left;border:2px solid #0000;flex-direction:column;padding:0;display:flex;overflow:hidden}.poster.selected{border-color:var(--accent)}.poster img,.poster-empty{aspect-ratio:16/9;object-fit:cover;background:var(--bg2);width:100%}.poster span{color:var(--hint);padding:4px 6px;font-size:12px}.selected-video{word-break:break-all;margin:0;font-size:14px}.progress{background:var(--bg2);border-radius:6px;height:22px;position:relative;overflow:hidden}.progress div{background:var(--accent);opacity:.35;position:absolute;inset:0 auto 0 0}.progress span{padding-left:8px;font-size:12px;line-height:22px;position:relative}.characters{flex-direction:column;gap:10px;display:flex}.character{background:var(--bg2);border-radius:10px;flex-direction:column;gap:8px;padding:10px;display:flex}.character.kept{opacity:.6}.character-head{align-items:center;gap:10px;display:flex}.thumb{object-fit:cover;background:var(--section);border-radius:10px;width:52px;height:52px}.character-title{flex-direction:column;flex:1;display:flex}.character-title small{color:var(--hint)}.icon{background:var(--section);padding:8px 10px}.photos{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.photo{position:relative}.photo img{object-fit:cover;border-radius:8px;width:56px;height:56px}.photo .remove{background:var(--danger);color:#fff;border-radius:50%;width:22px;height:22px;padding:0;font-size:14px;line-height:22px;position:absolute;top:-6px;right:-6px}.add-photo{border:1.5px dashed var(--accent);width:56px;height:56px;color:var(--accent);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;font-size:13px;display:flex}.estimate{flex-direction:column;gap:4px;font-size:13px;display:flex}.estimate-line{color:var(--hint);justify-content:space-between;gap:8px;display:flex}.estimate-line.total{color:var(--text);border-top:1px solid var(--bg2);padding-top:4px;font-weight:600}.steps{color:var(--hint);flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.steps li.done{color:var(--text)}.steps li.active{color:var(--accent);font-weight:600}video.result{background:#000;border-radius:10px;width:100%}.actions{flex-wrap:wrap;gap:8px;display:flex}.actions button{flex:1}.history{flex-direction:column;gap:8px;display:flex}.history-item{background:var(--section);text-align:left;align-items:center;gap:10px;padding:6px;display:flex}.history-item img,.history-item .poster-empty{object-fit:cover;border-radius:6px;width:64px;height:40px}.spinner{border:3px solid var(--bg2);border-top-color:var(--accent);border-radius:50%;width:28px;height:28px;margin:24px auto;animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.toast{left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom,0px));color:#fff;background:#222;border-radius:10px;padding:12px 14px;font-size:14px;position:fixed;box-shadow:0 4px 16px #00000040}
