#stage5:not([hidden]){display:flex;flex-direction:column;max-width:none;width:100%;min-height:0}
#stage5 .vs-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:14px}
#stage5 .vs-kicker{color:#a096ff;font-size:10px;letter-spacing:2px;font-weight:800}
#stage5 .vs-head h1{margin:6px 0 3px;font-size:30px;letter-spacing:-1px}
#stage5 .vs-head p{margin:0;color:var(--d-text-2,#aab4ca);font-size:12px}
#stage5 .vs-layout{display:grid;grid-template-columns:200px minmax(0,1fr) 156px 280px;gap:14px;align-items:stretch;min-height:0;flex:1}
#stage5 .vs-panel{background:var(--d-surface,#121725);border:1px solid var(--d-border,#2c3446);border-radius:15px;min-width:0;min-height:0}
#stage5 .vs-shots{padding:17px 11px 13px;display:flex;flex-direction:column}
#stage5 .vs-top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 7px 12px}
#stage5 .vs-top h2,#stage5 .vs-settings h2{margin:0;font-size:13px}
#stage5 .vs-count{color:var(--d-text-3,#8492ad);font-size:10px}
#stage5 .vs-list{overflow:auto;flex:1;min-height:0;padding:1px 3px 4px}
#stage5 .vs-shot{width:100%;border:1px solid transparent;background:transparent;color:inherit;border-radius:10px;text-align:left;padding:6px 7px;display:flex;gap:10px;align-items:center;min-height:47px;margin:1px 0}
#stage5 .vs-shot:hover{background:var(--d-surface-2,#1d2230)}
#stage5 .vs-shot.active{background:var(--d-border,#2c3446);border-color:#506487}
#stage5 .vs-num{width:34px;height:34px;border-radius:7px;background:var(--d-border,#2c3446);display:grid;place-items:center;flex:none;color:var(--c-primary-tint,#dbe4ff);font-size:11px;font-weight:800}
#stage5 .vs-num.vs-num-thumb{overflow:hidden;padding:0}
#stage5 .vs-num.vs-num-thumb img{width:100%;height:100%;object-fit:cover;display:block}
#stage5 .vs-shot.active .vs-num{background:#5d58bd;color:#fff}
#stage5 .vs-shot.active .vs-num.vs-num-thumb{background:var(--d-border,#2c3446)}
#stage5 .vs-shottext{min-width:0}
#stage5 .vs-shottext strong{font-size:11px;display:block}
#stage5 .vs-shottext small{display:block;color:var(--d-text-3,#8492ad);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;margin-top:3px}
#stage5 .vs-add{border:1px dashed var(--c-text-2,#4e5968);border-radius:9px;background:var(--d-surface-2,#1d2230);color:var(--c-primary-tint,#dbe4ff);width:calc(100% - 9px);margin:8px 4px 0;padding:10px;font-weight:700;font-size:11px}
#stage5 .vs-help{font-size:10px;line-height:1.6;color:var(--d-text-3,#8492ad);margin:8px 8px 0}
#stage5 .vs-work{padding:16px 18px;display:flex;flex-direction:column;min-height:0;overflow:auto}
#stage5 .vs-worktop{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
#stage5 .vs-worktop h2{margin:4px 0 0;font-size:19px;letter-spacing:-.4px}
#stage5 .vs-iconrow{display:flex;gap:7px}
#stage5 .vs-btn{background:var(--d-surface-2,#1d2230);color:var(--c-primary-tint,#dbe4ff);border:1px solid #38465d;border-radius:8px;padding:8px 10px;font-size:11px;font-weight:700}
#stage5 .vs-btn:hover{background:var(--d-border,#2c3446)}
#stage5 .vs-preview{background:var(--d-bg,#0b101b);border:1px solid var(--d-border,#2c3446);border-radius:12px;overflow:hidden;position:relative;display:grid;place-items:center;aspect-ratio:16/9;width:100%;height:auto;min-height:0;flex:0 0 auto;align-self:stretch;margin:0;isolation:isolate}
#stage5 .vs-preview img,#stage5 .vs-preview video{width:100%;height:100%;object-fit:cover;display:block;grid-area:1/1;position:relative;z-index:1}
#stage5 .vs-preview img[hidden],#stage5 .vs-preview.empty img{display:none!important}
#stage5 .vs-preview.empty{background:radial-gradient(ellipse at 48% 42%,var(--d-border,#2c3446),var(--d-surface,#121725) 65%)}
#stage5 .vs-empty{grid-area:1/1;text-align:center;color:var(--d-text-2,#aab4ca);padding:40px 26px 36px;position:relative;z-index:1;pointer-events:none}
#stage5 .vs-empty strong{display:block;color:var(--d-text,#e8edf7);font-size:13px}
#stage5 .vs-empty p{font-size:11px;line-height:1.5;margin:8px 0}
#stage5 .vs-label{position:absolute;left:13px;top:13px;z-index:3;background:#0a101dba;border:1px solid #ffffff30;padding:6px 9px;border-radius:7px;font-size:10px;font-weight:750;max-width:calc(100% - 26px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#stage5 .vs-badges{position:absolute;left:13px;bottom:13px;z-index:3;display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;pointer-events:none}
#stage5 .vs-badges span{background:#0a101dc9;border:1px solid #ffffff2b;border-radius:6px;padding:5px 8px;font-size:10px;font-weight:700;flex:none;white-space:nowrap}
#stage5 #videoResult{position:absolute;inset:0;margin:0;background:#000;display:grid}
#stage5 #videoResult[hidden]{display:none!important}
#stage5 #videoResult video{width:100%;height:100%;object-fit:contain;background:#000}
#stage5 #videoResultNote,#stage5 #videoResultOpen{position:absolute;right:10px;bottom:10px;font-size:11px}
#stage5 .vs-actions{display:flex;align-items:center;gap:7px;margin:9px 0 12px;flex-wrap:wrap}
#stage5 .vs-hint{color:var(--d-text-3,#8492ad);font-size:10px;line-height:1.5;margin-left:auto}
#stage5 .vs-file{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
#stage5 .vs-divider{border:0;border-top:1px solid var(--d-border,#2c3446);margin:0 0 11px}
#stage5 .vs-labelrow{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
#stage5 .vs-labelrow label{font-weight:760;font-size:11px}
#stage5 .vs-labelrow span{font-size:10px;color:var(--d-text-3,#8492ad)}
#stage5 .vs-prompt{background:var(--d-surface,#121725);border:1px solid var(--d-border,#2c3446);border-radius:9px;padding:12px 13px;color:var(--d-text,#e8edf7);resize:vertical;min-height:78px;width:100%;line-height:1.65;font-size:12px}
#stage5 .vs-promptrow{display:flex;align-items:center;gap:7px;margin-top:8px;flex-wrap:wrap}
#stage5 .vs-foot{margin-top:auto;display:flex;justify-content:space-between;align-items:center;padding-top:10px;gap:10px}
#stage5 .vs-nav{display:flex;gap:8px}
#stage5 .vs-primary{border:0;background:linear-gradient(105deg,var(--c-violet,#6a4cf0),var(--c-primary,#1b64da));border-radius:9px;color:#fff;font-weight:800;padding:11px 15px;min-height:39px;font-size:11px}
#stage5 .vs-chars{padding:14px 10px;display:flex;flex-direction:column;gap:8px;min-height:0;align-self:start}
#stage5 .vs-settings{padding:14px 12px 16px;display:flex;flex-direction:column;min-height:0;overflow:auto}
#stage5 .vs-chars h2{margin:0;font-size:12px}
#stage5 .vs-kind-adds{display:grid;gap:8px;margin:10px 0 4px}
#stage5 .vs-kind-adds .vs-btn{width:100%}
#stage5 .vs-char-grid{display:grid;gap:8px;overflow:auto;flex:1;min-height:0}
#stage5 .vs-char-hint{margin:0 0 6px;color:var(--d-text-3,#8492ad);font-size:10px;line-height:1.45}
#stage5 .vs-charrow{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px;align-items:start}
#stage5 .vs-charrow.active .vs-charpick{border-color:#8e7dff;background:var(--c-navy,#172140)}
#stage5 .vs-charcheck{display:flex;align-items:flex-start;padding-top:8px}
#stage5 .vs-charcheck input{width:14px;height:14px;margin:0;accent-color:#8e7dff;cursor:pointer}
#stage5 .vs-charpick{display:grid;gap:6px;width:100%;text-align:left;background:var(--d-surface-2,#1d2230);border:1px solid var(--d-border,#2c3446);border-radius:10px;color:var(--c-primary-tint,#dbe4ff);padding:8px}
#stage5 .vs-charpick.active{border-color:#8e7dff;background:var(--c-navy,#172140)}
#stage5 .vs-charpick img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;background:var(--d-surface,#121725);display:block}
#stage5 .vs-charpick img[hidden]{display:none!important}
#stage5 .vs-charpick span{font-size:10px;line-height:1.35}
#stage5 .vs-char-empty{margin:0;color:var(--d-text-3,#8492ad);font-size:10px;line-height:1.5}
#stage5 .vs-mode{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px;flex-wrap:wrap}
#stage5 .vs-mode-label{font-size:11px;font-weight:740;color:var(--c-gray-300,#c5cbe0)}
#stage5 .vs-mode-btns{display:flex;gap:6px;flex-wrap:wrap}
#stage5 .vs-mode-btn.active{border-color:#8e7dff;background:var(--c-navy,#172140);color:#fff}
#stage5 .vs-startend{margin:0 0 12px}
#stage5 .vs-startend-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#stage5 .vs-se-slot{display:grid;gap:6px}
#stage5 .vs-se-label{font-size:12px;font-weight:800;color:var(--d-text,#e8edf7)}
#stage5 .vs-se-frame{aspect-ratio:16/9;border:1px solid var(--d-border,#2c3446);border-radius:10px;overflow:hidden;background:var(--d-bg,#0b101b);display:grid;place-items:center;position:relative;cursor:pointer}#stage5 .vs-se-frame.armed{outline:2px solid var(--d-link,#8ea8ff);outline-offset:2px}
#stage5 .vs-se-frame.empty{background:radial-gradient(ellipse at 48% 42%,var(--d-border,#2c3446),var(--d-surface,#121725) 65%)}
#stage5 .vs-se-frame img{width:100%;height:100%;object-fit:cover;display:block;grid-area:1/1}
#stage5 .vs-se-frame img[hidden],#stage5 .vs-se-frame.empty img{display:none!important}
#stage5 .vs-se-empty{grid-area:1/1;text-align:center;color:var(--d-text-3,#8492ad);font-size:10px;padding:10px}
#stage5 .vs-se-actions{display:flex;gap:6px;flex-wrap:wrap}
#stage5 .vs-se-actions .vs-btn{flex:1;min-width:0;padding:7px 8px}
#stage5 .vs-intro{display:none!important}
#stage5 .vs-field{margin-bottom:12px}
#stage5 .vs-field label{display:block;font-size:11px;font-weight:740;margin-bottom:8px}
#stage5 .vs-field small,#stage5 #videoModelMeta,#stage5 #videoDurationHint,#stage5 #videoStatus{color:var(--d-text-3,#8492ad);font-size:10px;display:block;margin-top:6px}
#stage5 .vs-field select{height:39px;width:100%;color:var(--c-primary-soft,#eef4ff);background:var(--d-surface,#121725);border:1px solid #39465e;border-radius:8px;padding:0 10px}
#stage5 .vs-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#stage5 .vs-estimate{border-radius:10px;background:var(--d-surface-2,#1d2230);border:1px solid #36395b;padding:10px;margin-top:auto}
#stage5 .vs-estimate span{color:#a9afd5;font-size:10px}
#stage5 #videoEstimate{display:block;color:#ddd3ff;font-size:12px;margin:5px 0 2px;font-weight:700}
#stage5 .vs-generate{width:100%;margin:10px 0 7px;font-size:12px}
#stage5 .vs-fine{color:var(--d-text-3,#8492ad);font-size:10px;line-height:1.55;margin:0}
#stage5 #videoSummary,#stage5 #videoCongestionLegend,#stage5 #videoEngineList{display:none}
#stage5 #videoErrorCard:not([hidden]){margin-top:8px}
#stage5 #videoDownload:not([hidden]){display:inline-block;margin-top:8px;text-align:center}
@media(min-width:1101px){
  #scroll:has(#stage5:not([hidden])){display:flex;flex-direction:column;overflow:hidden}
  #stage5:not([hidden]){flex:1;overflow:hidden}
  #stage5 .vs-layout{height:100%}
}
@media(max-width:1100px){
  #scroll:has(#stage5:not([hidden])){overflow:auto}
  #stage5:not([hidden]){overflow:visible;height:auto}
  #stage5 .vs-layout{grid-template-columns:180px minmax(0,1fr);height:auto}
  #stage5 .vs-chars,#stage5 .vs-settings{grid-column:1/-1}
}
@media(max-width:620px){
  #stage5 .vs-layout{display:flex;flex-direction:column}
  #stage5 .vs-work{order:1}
  #stage5 .vs-chars{order:2}
  #stage5 .vs-shots{order:3}
  #stage5 .vs-settings{order:4}
  #stage5 .vs-preview{width:100%}
}
