:root {
  color-scheme:light; --bg:#f6f6f4; --surface:#fff; --soft:#f7f7f5; --ink:#20211e; --muted:#656860;
  --line:#dedfd9; --strong:#bbbeb5; --action:#292c26; --on-action:#fff; --focus:#537542; --ok:#47753e;
  font-family:"Inter","Segoe UI",Arial,sans-serif; color:var(--ink); background:var(--bg);
}
:root[data-theme=dark] {
  color-scheme:dark; --bg:#151615; --surface:#1e201e; --soft:#282a27; --ink:#f2f2eb; --muted:#b1b5aa;
  --line:#393d37; --strong:#555c50; --action:#e7eadf; --on-action:#1a1d18; --focus:#a5c496; --ok:#a5c496;
}
*{box-sizing:border-box} body{margin:0;font-size:14px;line-height:1.46} [hidden]{display:none!important}
button,textarea,select,input{font:inherit;color:inherit} button,summary,.drop,.file-button,.asset label{cursor:pointer}
button{border:0} button:disabled,select:disabled{opacity:.5;cursor:default} a{color:inherit}
button:focus-visible,summary:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,label:has(input[type=file]:focus-visible){outline:2px solid var(--focus);outline-offset:3px}
.bar{background:var(--surface);border-bottom:1px solid var(--line)} .bar-inner,main{max-width:1328px;margin:auto;padding:0 clamp(16px,4vw,68px)}
.bar-inner,.brand,.tools,.row,.uploads,.section-title,.project-head,.check{display:flex;align-items:center}
.bar-inner,.section-title,.project-head{justify-content:space-between;gap:12px}.bar-inner{min-height:68px}
.brand{font-size:21px;letter-spacing:-1px;font-weight:720;gap:11px;text-decoration:none}.mark{display:flex;gap:2px;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:var(--action);overflow:hidden}
.mark i{width:4px;height:13px;background:var(--on-action);transform:skew(-18deg)}.mark i:nth-child(2){height:21px}
.tools{gap:9px}.tools button,.secondary,.file-button,.history button{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:9px 13px;color:var(--ink);font-weight:550;text-decoration:none}
.tools button{font-size:12px;white-space:nowrap}.tools button:hover,.secondary:hover,.file-button:hover,.history button:hover{background:var(--soft);border-color:var(--strong)}
.lamp{display:inline-block;width:7px;height:7px;background:var(--strong);border-radius:50%;margin-right:7px}.connected .lamp{background:var(--ok)}
main{padding-bottom:55px}.project-head{margin:32px 0 25px}.projects-menu{position:relative;border:0;padding:0;margin:0;display:inline-block}
.projects-menu summary{font-size:12px;color:var(--muted)}nav{position:absolute;z-index:4;top:26px;left:0;min-width:245px;max-height:45vh;overflow:auto;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:6px;box-shadow:0 10px 35px #0002}
nav button{display:block;width:100%;background:none;padding:10px;text-align:left;border-radius:6px;color:var(--ink)}nav button:hover,nav .active{background:var(--soft)}
h1,h2,h3,p{margin:0}h1{font-size:clamp(25px,3vw,39px);letter-spacing:-.055em;line-height:1.15;margin-top:8px;font-weight:650}h2{font-size:20px;letter-spacing:-.04em;font-weight:650}h3{font-size:14px;margin:20px 0 6px}
.workspace{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(290px,.85fr);gap:20px;align-items:start}.editor{display:grid;gap:14px}.panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:clamp(18px,2.1vw,30px)}
.section-title{margin-bottom:16px}.section-title span,.hint,small{font-size:12px;color:var(--muted)}.hint,small{line-height:1.55}
.drop{position:relative;display:grid;justify-items:center;gap:5px;border:1px dashed var(--strong);border-radius:10px;background:var(--soft);padding:20px;text-align:center}.drop svg{margin:2px 0 5px}.drop strong{font-weight:600}.drop.over,.drop:hover{border-color:var(--focus)}
input[type=file]{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}.row{gap:14px;align-items:stretch}.uploads{align-items:center;flex-wrap:wrap;margin-top:14px}.uploads .check,.uploads .file-button{margin:0}
.field{display:flex;flex:1;min-width:0;flex-direction:column;gap:7px;margin-top:17px;font-size:13px;font-weight:550}
.narrow{flex:0 1 115px}select,input[type=number],input[type=password],input[type=color],input[type=text],#model,textarea{border:1px solid var(--line);border-radius:8px;padding:10px 12px;background:var(--surface);width:100%;min-height:41px;font-weight:400}
input[type=color]{padding:5px;cursor:pointer}textarea{resize:vertical;line-height:1.5}textarea::placeholder,input::placeholder{color:var(--muted)}
input[type=checkbox],input[type=range],progress{accent-color:var(--focus)}.check{gap:8px;font-size:13px;margin:15px 0 0}.check input{margin:0;width:16px;height:16px}
.file-button{display:inline-block;font-size:12px;margin-top:10px}#narrationBox small{margin-left:10px}
details{margin:16px 0 0;border-top:1px solid var(--line);padding-top:14px}summary{font-weight:550;font-size:13px;list-style:none}summary::-webkit-details-marker{display:none}summary::after{content:'⌄';display:inline-block;margin-left:7px;color:var(--muted)}details[open]>summary::after{transform:rotate(180deg)}details>textarea{margin-top:10px}
.projects-menu{border:0;margin:0;padding:0}.asset{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}.asset:last-child{border:0}.asset strong{font-size:13px;overflow-wrap:anywhere}.asset .meta,.asset label{font-size:11px;color:var(--muted)}
.primary{display:inline-flex;align-items:center;justify-content:center;background:var(--action);color:var(--on-action);border-radius:9px;padding:12px 17px;font-weight:650;text-decoration:none}.primary:hover{filter:opacity(.86)}.large{width:100%;justify-content:space-between;padding:15px 18px}
.preview{position:sticky;top:16px}.preview video,#liveFrame,#placeholder{display:block;width:100%;border-radius:10px;max-height:min(55vh,520px);background:#191b18}.preview video,#liveFrame{object-fit:contain}
#placeholder{min-height:220px;aspect-ratio:5/4;display:grid;place-content:center;justify-items:center;gap:13px;color:var(--muted);background:var(--soft);border:1px solid var(--line);font-size:13px}.screen-icon{border:1.5px solid var(--strong);padding:6px 14px;border-radius:7px}
pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:170px;overflow:auto;font-size:11px}.status{overflow-wrap:anywhere;font-size:12px;color:var(--muted);margin:14px 0}.status:last-child{margin-bottom:0}progress,#download{width:100%}#description{line-height:1.65;font-size:13px}#revisionBox{margin-top:18px;border-top:1px solid var(--line)}#revise{margin-top:10px}#plan{font-size:13px}.history button{display:block;width:100%;margin-top:7px;text-align:left;font-size:12px}
.sample{position:relative;display:grid;place-items:center;min-height:94px;margin-top:12px;padding:16px 45px;color:#fff;background:linear-gradient(110deg,#575c60,#292d31 72%);border-radius:9px}.sample button{position:absolute;right:10px;bottom:9px;color:white;background:#ffffff16;font-size:18px;border-radius:6px}
#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:9;background:var(--action);color:var(--on-action);padding:12px 18px;border-radius:9px;max-width:90vw}
dialog{width:min(410px,90vw);border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);padding:24px}dialog::backdrop{background:#10131072}.close{float:right;background:none;font-size:23px}.hint{margin:5px 0}dialog .hint{margin:14px 0}
@media(max-width:820px){.workspace{grid-template-columns:1fr}.preview{position:static}.project-head{margin-top:22px}.tools{gap:5px}}
@media(max-width:520px){.bar-inner{min-height:58px;gap:5px}.brand{font-size:16px;gap:5px}.mark{width:23px;height:23px}.tools button{font-size:11px;padding:7px}.tools .lamp{display:none}.project-head{align-items:flex-end}.secondary{font-size:12px}.project-head .secondary{flex-shrink:0}.row{gap:8px}select{padding-left:6px}.panel{padding:16px}.uploads{gap:14px}.preview{margin-top:0}}


.auth{min-height:calc(100vh - 69px);display:grid;place-items:center;padding:30px 16px}.auth-card{width:min(430px,100%)}.auth-card h1{margin:0 0 6px}.auth-card form{margin-top:6px}.auth-card .large{margin-top:20px}
input[type=email]{border:1px solid var(--line);border-radius:8px;padding:10px 12px;background:var(--surface);width:100%;min-height:41px}
.link{background:none;padding:0;text-decoration:underline;color:var(--ink);font-size:12px}#accountTools{display:flex;gap:9px}
.wallet-sum{display:flex;align-items:baseline;gap:12px;margin:14px 0 0}.wallet-sum b{font-size:30px;letter-spacing:-.04em}.presets{margin-top:10px}.presets button{flex:1}#topup{margin-top:14px}
.ledger,.table{display:grid;gap:2px;font-size:12px;max-height:40vh;overflow:auto}.ledger div,.table div{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px solid var(--line)}.ledger .plus{color:var(--ok)}
dialog.wide{width:min(760px,94vw)}.table span{flex:1;min-width:0;overflow-wrap:anywhere}.table span:last-child{text-align:right}

.title-wrap{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap}.title-wrap h1{margin:0;overflow-wrap:anywhere}
.icon-button{background:var(--surface);border:1px solid var(--line);border-radius:8px;width:36px;height:36px;font-size:16px;color:var(--muted)}.icon-button:hover{color:var(--ink);border-color:var(--strong)}
.rename{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.rename input{min-width:min(420px,70vw);font-size:18px;font-weight:600}.rename .primary,.rename .secondary{padding:10px 14px}
.head-actions{display:flex;gap:9px;align-items:center;flex-shrink:0}.head-actions .projects-menu summary{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:9px 13px;color:var(--ink);font-weight:550;font-size:14px}
.head-actions .projects-menu summary:hover{background:var(--soft);border-color:var(--strong)}.head-actions nav{left:auto;right:0;top:46px}
.media-columns{display:grid;grid-template-columns:1fr 1fr;gap:16px}.media-col{min-width:0}.col-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:8px}.col-head h3{margin:0}
.media-col .drop{padding:14px 10px}.clips{display:grid;gap:8px;margin-top:10px}
.clip{display:grid;grid-template-columns:auto 64px minmax(0,1fr);gap:10px;align-items:center;padding:7px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.clip .num{font-size:11px;color:var(--muted);width:16px;text-align:center}.clip .thumb{position:relative;width:64px;height:84px;border-radius:7px;overflow:hidden;background:#191b18}
.clip .thumb img{width:100%;height:100%;object-fit:cover;display:block}.clip .thumb b{position:absolute;right:3px;bottom:3px;font-size:10px;font-weight:600;color:#fff;background:#000a;border-radius:4px;padding:1px 4px}
.clip strong{display:block;font-size:13px;overflow-wrap:anywhere}.clip .meta{font-size:11px;color:var(--muted);margin-top:3px}.clip label{font-size:11px;color:var(--muted);margin-top:5px;display:inline-block}
.clip.pending{opacity:.6}.clip.pending .thumb{display:grid;place-items:center;color:#fff;font-size:11px}
.audio-list{display:grid;gap:4px;margin-top:10px}.audio-list .asset{padding:8px 0}
@media(max-width:980px){.media-columns{grid-template-columns:1fr}}
@media(max-width:620px){.project-head{flex-direction:column;align-items:flex-start}.head-actions{width:100%}.head-actions .projects-menu{flex:1}.head-actions nav{left:0;right:auto}}

.working{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:4/5;max-height:min(62vh,560px);border-radius:10px;overflow:hidden;background:#191b18;color:#fff}
.working #liveFrame{position:absolute;inset:0;width:100%;height:100%;max-height:none;border-radius:0;object-fit:cover;opacity:.32;filter:blur(2px)}
.working-card{position:relative;z-index:1;width:min(330px,86%);display:grid;gap:10px}.working-card strong{font-size:16px;line-height:1.35}.working-card small{color:#ffffffb3}
.spinner{width:22px;height:22px;border:2px solid #ffffff40;border-top-color:#fff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.work-bar{height:6px;background:#ffffff26;border-radius:4px;overflow:hidden}.work-bar i{display:block;height:100%;width:4%;background:#fff;transition:width .6s ease}
.work-steps{list-style:none;padding:0;margin:4px 0 0;display:grid;gap:6px;font-size:12px;color:#ffffff80}.work-steps li::before{content:'○';display:inline-block;width:18px}
.work-steps li.done{color:#ffffffc0}.work-steps li.done::before{content:'✓'}.work-steps li.now{color:#fff;font-weight:600}.work-steps li.now::before{content:'●'}
@media(prefers-reduced-motion:reduce){.spinner{animation:none}}
.head-actions .projects-menu summary{background:var(--action);color:var(--on-action);border-color:var(--action)}.head-actions .projects-menu summary::after{color:inherit;opacity:.7}
.head-actions .projects-menu summary:hover{background:var(--action);border-color:var(--action);filter:opacity(.86)}

.clip{grid-template-columns:64px minmax(0,1fr)}.clip .thumb i,.tile .thumb i{position:absolute;left:4px;top:4px;font-style:normal;font-size:10px;font-weight:700;color:#fff;background:#000a;border-radius:4px;padding:1px 5px}
.thumb.loading{display:grid;place-items:center;color:#fff;font-size:11px}
.clips.size-m{grid-template-columns:repeat(2,minmax(0,1fr))}.clips.size-s{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.tile{display:grid;gap:4px;min-width:0}.tile .thumb{position:relative;aspect-ratio:3/4;border-radius:8px;overflow:hidden;background:#191b18}
.tile .thumb img{width:100%;height:100%;object-fit:cover;display:block}.tile .thumb b{position:absolute;right:4px;bottom:4px;font-size:10px;font-weight:600;color:#fff;background:#000a;border-radius:4px;padding:1px 4px}
.tile .name{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tile.pending{opacity:.6}
.tile .srt{position:absolute;right:4px;top:4px;margin:0;font-size:10px;font-weight:600;color:#fff;background:#000a;border-radius:4px;padding:1px 5px;cursor:pointer}
.size-m .tile .name{font-size:12px}
.more{display:grid;place-content:center;justify-items:center;gap:2px;aspect-ratio:3/4;border-radius:8px;background:var(--action);color:var(--on-action);align-self:start}.more b{font-size:22px;line-height:1}.more span{font-size:11px;opacity:.8}
.size-l .more{aspect-ratio:auto;padding:10px}

.font-row{align-items:center;flex-wrap:wrap;gap:12px;margin-top:4px}.font-row .file-button{margin-top:10px}.font-row small{margin-top:10px}
.sample{grid-template-rows:auto auto;gap:6px}#sampleTitle{color:#fff2d4;font-weight:900;font-size:24px;letter-spacing:-.04em;text-transform:uppercase;line-height:1;text-align:center}

#revisionBox h3{margin-top:18px}#openEditor{margin-top:10px}.ai-edit{margin-top:12px}
.ed-list{display:grid;gap:6px;max-height:34vh;overflow:auto;padding-right:4px}.ed-sub{display:grid;grid-template-columns:52px minmax(0,1fr);gap:8px;align-items:center}.ed-sub span{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.ed-card{display:grid;grid-template-columns:78px minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) auto 36px;gap:6px;align-items:center;padding:6px 0;border-bottom:1px solid var(--line)}
.ed-type{font-size:11px;color:var(--muted)}.ed-times{display:flex;gap:4px;align-items:center}.ed-times input{width:64px;padding:8px 6px}.ed-times select{width:auto;padding:8px 6px}
.ed-list input,.ed-card select{min-height:36px;padding:7px 9px}#edAdd{margin-top:8px}#edApply{margin-top:16px}dialog#editor{width:min(980px,96vw)}
@media(max-width:820px){.ed-card{grid-template-columns:1fr 1fr}.ed-type{grid-column:1/-1}}

dialog.editor{width:min(1000px,96vw);max-height:92vh;display:none;flex-direction:column;padding-bottom:16px}dialog.editor[open]{display:flex}
.editor>section.tab{overflow:auto;padding-right:6px;flex:1;min-height:0}.tabs{display:flex;gap:6px;margin:14px 0 4px;border-bottom:1px solid var(--line)}
.tabs button{background:none;padding:9px 12px;border-bottom:2px solid transparent;color:var(--muted);font-weight:600;border-radius:0}.tabs button.on{color:var(--ink);border-bottom-color:var(--ink)}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.chips button{background:var(--soft);border:1px solid var(--line);border-radius:999px;padding:6px 11px;font-size:12px;color:var(--ink)}.chips button:hover{border-color:var(--strong)}
#edImages{margin:8px 0}.ed-footer{border-top:1px solid var(--line);margin-top:12px;padding-top:10px}.ed-footer .large{margin-top:6px}
.tile .thumb b.photo{background:#000a}

.ref-block{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}.ref-block .hint{margin:0 0 8px}.drop.slim{padding:12px;grid-auto-flow:row}
.refs{display:grid;gap:8px;margin-top:10px}.ref{display:grid;grid-template-columns:64px minmax(0,1fr) 32px;gap:10px;align-items:start;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.ref .thumb{position:relative;width:64px;height:84px;border-radius:7px;overflow:hidden;background:#191b18}.ref .thumb img{width:100%;height:100%;object-fit:cover}
.ref strong{font-size:13px;overflow-wrap:anywhere}.ref ul{margin:6px 0 0;padding-left:16px;font-size:12px;color:var(--muted);display:grid;gap:3px}.ref .state{font-size:12px;color:var(--muted);margin-top:4px}
.ref .icon-button{width:30px;height:30px}

.step{display:inline-grid;place-items:center;width:24px;height:24px;margin-right:10px;border-radius:50%;background:var(--soft);border:1px solid var(--line);font-size:12px;font-weight:700;vertical-align:3px;letter-spacing:0}
.panel.brief{border:1.5px solid var(--action);box-shadow:0 10px 34px #00000012;background:linear-gradient(180deg,var(--surface),var(--soft))}
.panel.brief .step{background:var(--action);color:var(--on-action);border-color:var(--action)}
.brief-lead{margin:8px 0 12px;color:var(--muted);font-size:13px}
#prompt{font-size:15px;line-height:1.55;min-height:118px;border:1.5px solid var(--strong);background:var(--surface);padding:12px 14px}#prompt:focus{border-color:var(--ink)}
#promptChips{margin-top:10px}.link-button{background:none;padding:0;margin-top:12px;font-weight:600;font-size:13px;color:var(--ink);text-decoration:underline;text-underline-offset:3px}
#scriptBox textarea{margin-top:8px}.ref-block{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}.ref-block>#refBody,.ref-block>#refList{flex-basis:100%}.ref-block .link-button{margin-top:0}.muted{color:var(--muted)}
.example-check{margin:0 0 6px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.clip,.tile{position:relative}.del{position:absolute;top:4px;right:4px;z-index:2;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#000b;color:#fff;font-size:14px;line-height:1;padding:0;opacity:.85}
.del:hover{opacity:1;background:#c0392b}.clip .del{top:6px;right:6px}.asset{position:relative}.asset .del{position:static;background:var(--soft);color:var(--muted);border:1px solid var(--line)}
.tile .srt{right:auto;left:26px}

.chips.one-line{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}.chips.one-line::-webkit-scrollbar{display:none}.chips.one-line button{flex:0 0 auto;white-space:nowrap}
.script-toggle{display:flex;align-items:center;gap:12px;width:100%;margin-top:14px;padding:12px 14px;border:1.5px dashed var(--strong);border-radius:10px;background:var(--surface);color:var(--ink);text-align:left}
.script-toggle:hover{border-color:var(--ink)}.script-toggle .plus{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:50%;background:var(--action);color:var(--on-action);font-size:16px;font-weight:700}
.script-toggle span:last-child{display:grid;gap:1px}.script-toggle strong{font-size:14px}.script-toggle small{font-size:12px;color:var(--muted)}
.script-toggle.open{border-style:solid;border-bottom-left-radius:0;border-bottom-right-radius:0}#scriptBox textarea{margin-top:0;border-top-left-radius:0;border-top-right-radius:0;border:1.5px solid var(--strong);border-top:0;min-height:110px}

.color-row{align-items:flex-end;flex-wrap:wrap}.color-row .narrow{flex:0 1 150px}.color-row .link-button{margin:0 0 12px}

#promptChips{gap:5px}#promptChips button{padding:6px 9px}
#promptChips button{flex:1 1 auto;text-align:center}

/* Оформление: preview first, then groups with air between them */
#designFields .sample{margin-top:6px;min-height:110px}
.d-group{margin-top:26px;padding-top:20px;border-top:1px solid var(--line)}
.d-title{margin:0;font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
.d-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px}.d-grid .field{margin-top:14px}
.d-colors{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-self:end}
.color-field{display:flex;align-items:center;gap:10px;margin-top:14px;min-height:41px;padding:5px 12px 5px 5px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:13px;font-weight:550;cursor:pointer;align-self:end}
.color-field:hover{border-color:var(--strong)}.color-field input[type=color]{width:32px;height:29px;min-height:0;padding:0;border:0;border-radius:6px;background:none;flex:0 0 auto}
.color-field input[type=color]::-webkit-color-swatch-wrapper{padding:0}.color-field input[type=color]::-webkit-color-swatch{border:1px solid #0002;border-radius:6px}
.d-links{display:flex;flex-wrap:wrap;gap:8px 22px;margin-top:14px}.d-links .link-button{margin:0;font-size:12px;cursor:pointer}
.d-group .check{margin-top:16px}
@media(max-width:520px){.d-grid{grid-template-columns:1fr}}

.field.quality{flex:0 1 160px}
.library{display:grid;gap:8px;margin:10px 0}.lib-row{display:grid;grid-template-columns:1fr minmax(160px,240px) 36px;gap:12px;align-items:center;padding:8px 10px;border:1px solid var(--line);border-radius:10px}
.lib-row span{display:grid;min-width:0}.lib-row b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.lib-row small{color:var(--muted)}.lib-row audio{width:100%;height:32px}
/* Long rows (chips, drop hints) must not push the left column under the result panel. */
.editor{grid-template-columns:minmax(0,1fr)}.editor>*{min-width:0}.media-columns{grid-template-columns:repeat(2,minmax(0,1fr))}
#promptChips{gap:5px}#promptChips button{flex:1 0 auto;padding:6px 9px}
@media(max-width:1280px){#promptChips{gap:4px}#promptChips button{padding:5px 6px;font-size:11.5px}}

/* Finished videos */
nav .nav-videos{font-weight:600}.nav-label{display:block;padding:8px 10px 4px;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;border-top:1px solid var(--line);margin-top:4px}
dialog.videos-dialog{width:min(980px,96vw);max-height:92vh}
.video-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px;margin-top:14px}
.video-card{display:grid;gap:4px;align-content:start;text-align:left;background:none;padding:0;color:var(--ink)}
.video-card img{width:100%;aspect-ratio:9/16;object-fit:cover;border-radius:10px;background:var(--soft);border:1px solid var(--line)}.video-card.wide img{aspect-ratio:16/9}
.video-card:hover img{border-color:var(--strong)}.video-card strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.video-card small{font-size:11px;color:var(--muted);line-height:1.35}
.video-player{display:grid;grid-template-columns:minmax(0,260px) 1fr;gap:18px;align-items:start;margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}
.video-player video{width:100%;max-height:60vh;border-radius:10px;background:#000}.video-player strong{display:block;font-size:16px}.video-player small{display:block;color:var(--muted);margin:4px 0 12px}
.video-actions{display:flex;gap:8px;flex-wrap:wrap}.video-actions a{text-decoration:none;display:inline-flex;align-items:center}
@media(max-width:620px){.video-player{grid-template-columns:1fr}}

/* One scroll for the whole page: the result column moves with the materials, without its own scrollbar. */
.preview{position:static;max-height:none;overflow:visible}
@media(max-width:820px){.preview{max-height:none;overflow:visible}}
.history{margin-top:18px;border-top:1px solid var(--line);padding-top:4px}.history h3{margin:14px 0 4px}
.history button.active{background:var(--action);color:var(--on-action);border-color:var(--action)}
.history button.v-error{color:#b3412f}.history button.v-error.active{color:#fff;background:#b3412f;border-color:#b3412f}
.history button.v-running::before,.history button.v-queued::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:#d29b2c;margin-right:7px;vertical-align:middle}
#historyMore{display:inline-block;width:auto;margin-top:10px;padding:2px 0;background:none;border:0;border-bottom:1px solid currentColor;border-radius:0;font-size:12px;font-weight:600;color:var(--ink)}

/* Sign-in through VK ID, Yandex ID, Google, Telegram */
.providers{display:grid;gap:9px;margin:18px 0 12px}.provider{display:flex;align-items:center;justify-content:center;gap:10px;border-radius:10px;padding:13px 16px;font-weight:650;font-size:15px;border:1px solid transparent;color:#fff}
.provider-vk{background:#0077ff}.provider-yandex{background:#fc3f1d}.provider-google{background:#fff;color:#1f1f1f;border-color:#dadce0}.provider-telegram{background:#27a7e7}.provider:hover{filter:brightness(1.06)}
.auth-error{color:#b3412f;font-size:13px;margin:8px 0}#emailBox{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}#emailBox summary{font-size:13px;color:var(--muted)}
.free-chip{background:#e9f6df!important;border-color:#bfe0a8!important;color:#2d5b16!important}

/* PRO: a stronger model thinks the montage over — a clear choice right above «Собрать ролик». */
.pro-option{display:flex;gap:12px;align-items:flex-start;margin:0 0 10px;padding:14px 16px;border:1.5px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer;transition:border-color .15s,background .15s}
.pro-option:hover{border-color:var(--strong)}
.pro-option input{position:absolute;opacity:0;pointer-events:none}
.pro-check{flex:none;width:20px;height:20px;margin-top:1px;border:1.5px solid var(--strong);border-radius:6px;display:grid;place-items:center;background:var(--surface)}
.pro-option input:checked+.pro-check{background:var(--action);border-color:var(--action)}
.pro-option input:checked+.pro-check::after{content:'';width:10px;height:5px;border-left:2px solid var(--on-action);border-bottom:2px solid var(--on-action);transform:translateY(-1px) rotate(-45deg)}
.pro-option input:focus-visible+.pro-check{outline:2px solid var(--focus);outline-offset:2px}
.pro-option:has(input:checked){border-color:var(--action);background:var(--soft)}
.pro-body{display:grid;gap:4px;min-width:0}
.pro-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pro-badge{font-size:11px;letter-spacing:.06em;padding:3px 7px;border-radius:6px;background:linear-gradient(135deg,#c9a45c,#e8cf8f);color:#20211e}
.pro-title{font-weight:650}
.pro-price{margin-left:auto;font-weight:650;font-variant-numeric:tabular-nums}
.pro-desc{font-size:13px;line-height:1.45;color:var(--muted)}

.option-card{display:flex;align-items:center;gap:14px;margin:18px 0 4px;padding:14px 16px;border:2px solid var(--line);border-radius:14px;background:var(--soft);cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}
.option-card:hover{border-color:var(--strong)}
.option-card input{width:22px;height:22px;margin:0;flex:none}
.option-icon{font-size:30px;line-height:1;flex:none}
.option-text{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}.option-text b{font-size:15px}.option-text small{font-size:12.5px;color:var(--muted);line-height:1.35}
.option-price{flex:none;font-weight:700;font-size:14px;padding:6px 12px;border-radius:999px;background:var(--action);color:var(--on-action)}
.option-card:has(input:checked){border-color:var(--focus);background:color-mix(in srgb,var(--focus) 10%,var(--surface));box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 18%,transparent)}
.option-card:has(input:checked) .option-price{background:var(--focus)}
