
:is(#propModal,#styleAssetModal) .entity-detail-dialog{width:860px;max-width:calc(100vw - 32px);max-height:90dvh;padding:0;display:flex;flex-direction:column;overflow:hidden}:is(#propModal,#styleAssetModal) .entity-form-images{margin:0;min-width:0}.entity-detail-fields #propDesc{min-height:230px}@media(max-width:700px){:is(#propModal,#styleAssetModal) .entity-detail-dialog{max-width:calc(100vw - 20px);max-height:92dvh}.entity-detail-fields #propDesc{min-height:140px}.asset-library-tabs button{padding:6px 7px}}


.storyboard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;color:var(--brand);font-size:14px;}
.storyboard-add{border:1px solid #d4dae2;border-radius:6px;padding:6px 10px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer;white-space:nowrap;}
.storyboard-add:hover{background:var(--brand-soft);color:var(--brand);}
.shot-table td.storyboard-scene-group{vertical-align:top;background:#f7f8fa;border-right:1px solid #e5e7eb;padding:14px 12px;}
.storyboard-scene-title{line-height:1.6;margin:8px 0 12px;overflow-wrap:anywhere;}
html.dark-mode .shot-table td.storyboard-scene-group{background:#1d1d1d;border-right-color:#333;}
html.dark-mode .storyboard-add{border-color:#444;color:#ddd;}

/* 分镜表网格与行标色 */
.shot-table th,.shot-table td{border:1px solid #dce1e7!important;}
.shot-table tbody tr{background:var(--shot-row-color,transparent)!important;}
.shot-table tbody tr[style*="--shot-row-color:#"]{color:#253041;}
.shot-table tbody tr[style*="--shot-row-color:#"] td:not(.storyboard-scene-group){color:#253041!important;}
html.dark-mode .shot-table th,html.dark-mode .shot-table td{border-color:#3c414a!important;}
.shot-frame-box .entity-image-shell{display:block;width:100%;height:72px;}
.shot-frame-box .entity-image-shell img{width:100%;height:100%;object-fit:cover;}
.storyboard-image-overlay{position:fixed;inset:0;z-index:1500;background:rgba(0,0,0,.618);display:flex;align-items:center;justify-content:center;padding:20px;}
.storyboard-image-dialog{background:#fff;color:#253041;border-radius:12px;padding:20px;width:640px;max-width:100%;max-height:80dvh;overflow:auto;}
.storyboard-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;}
.storyboard-image-grid button{border:1px solid #dce1e7;border-radius:8px;overflow:hidden;background:transparent;color:inherit;padding:0;cursor:pointer;}
.storyboard-image-grid .entity-image-shell{display:block;height:120px;}
.storyboard-image-grid img{width:100%;height:100%;object-fit:cover;}
.storyboard-image-grid button>span:last-child{display:block;padding:7px;}
.storyboard-row-menu{position:fixed;z-index:1500;background:#fff;color:#253041;border:1px solid #dce1e7;border-radius:8px;padding:12px;box-shadow:0 8px 28px #0003;}
.storyboard-swatches{display:flex;gap:6px;}.storyboard-swatches button{width:23px;height:23px;border:1px solid #929baa;border-radius:50%;cursor:pointer;}
.storyboard-delete{display:block;margin-top:10px;background:transparent;border:0;color:#d34d54;cursor:pointer;padding:5px;}
html.dark-mode .storyboard-image-dialog,html.dark-mode .storyboard-row-menu{background:#222222;color:#eee;border-color:#454b56;}

.shot-table td.storyboard-scene-group{width:52px;min-width:36px;vertical-align:middle!important;text-align:center;padding:8px 6px;}
.shot-table tbody tr:hover td:not(.storyboard-scene-group){box-shadow:inset 0 0 0 9999px rgba(90,125,175,.10);}
.shot-table tbody tr:focus-within td:not(.storyboard-scene-group){box-shadow:inset 0 0 0 9999px rgba(90,125,175,.14);}
html.dark-mode .shot-table tbody tr:hover td:not(.storyboard-scene-group){box-shadow:inset 0 0 0 9999px rgba(155,180,220,.12);}
.storyboard-row-menu{min-width:210px;padding:10px;}
.storyboard-row-menu .storyboard-swatches{padding:5px 2px 11px;margin-bottom:4px;border-bottom:1px solid #dce1e7;}
.storyboard-row-menu .storyboard-insert,.storyboard-row-menu .storyboard-delete{display:block;width:100%;margin:0;padding:9px 10px;text-align:left;border:0;border-radius:5px;font-size:13px;line-height:1.5;background:transparent;}
.storyboard-row-menu .storyboard-insert:hover,.storyboard-row-menu .storyboard-delete:hover{background:rgba(130,145,165,.13);}
html.dark-mode .storyboard-row-menu .storyboard-swatches{border-color:#454b56;}

/* 画面入口填满单元格，表格文字垂直居中。 */
.shot-table th,.shot-table td{vertical-align:middle!important;}
.shot-table td.shot-frame{position:relative;padding:0!important;height:88px;min-width:92px;}
.shot-table .shot-frame-box{position:absolute;inset:0;width:100%;height:100%;min-height:0;border:0;border-radius:0;box-sizing:border-box;overflow:hidden;gap:6px;}
.shot-table .shot-frame-box .entity-image-shell{height:100%;padding:0;}
.shot-table .shot-frame-box .entity-image-shell img{width:100%;height:100%;object-fit:cover;}

/* 表格文字水平居中；已有图片以完整缩略图显示。 */
.shot-table th,.shot-table td,.shot-table .shot-edit{text-align:center!important;}
.shot-table .shot-frame-box:has(.entity-image-shell){position:static;inset:auto;width:100%;height:auto;min-height:88px;padding:8px;background:transparent;}
.shot-table .shot-frame-box .entity-image-shell{display:flex;align-items:center;justify-content:center;width:100%;height:72px;}
.shot-table .shot-frame-box .entity-image-shell img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;}
.shot-table .shot-frame-box .entity-image-shell img[hidden]{display:none;}

/* 景别与运镜按文字自然占宽，不再预留固定的大列宽。 */
.shot-table .shot-camera-heading,.shot-table .shot-movement-heading,
.shot-table td.shot-cam,.shot-table td.shot-movement{width:1%;white-space:nowrap;padding-left:10px;padding-right:10px;}
.shot-table td.shot-cam .shot-edit,.shot-table td.shot-movement .shot-edit{white-space:pre;word-break:normal;min-width:3em;}

.proj-status.pending{color:#8b8297!important;}
html.dark-mode .proj-status.pending{color:#b7adc5!important;}

.entity-form-image-preview[data-image-drop-kind]{outline:2px dashed transparent;outline-offset:-3px;transition:outline-color .15s,background .15s;}
.entity-form-image-preview.image-drop-active{outline-color:var(--brand);background:var(--brand-soft);}

/* 资产编辑：左侧缩略图与大图，提示词在图片工具旁展开。 */
.entity-detail-dialog{width:1100px;}
.entity-detail-dialog .entity-detail-body{grid-template-columns:minmax(0,1.65fr) minmax(250px,1fr);gap:24px;}
.entity-image-workspace{display:grid;grid-template-columns:58px minmax(0,1fr);gap:12px;align-items:start;}
.entity-main-image{min-width:0;}
.entity-detail-dialog .entity-form-image-preview{height:360px;min-height:360px;}
.entity-detail-dialog .entity-form-image-preview img{max-height:344px;max-width:100%;object-fit:contain;}
.entity-detail-dialog .entity-image-choices{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-x:hidden;overflow-y:auto;margin:0;padding:0;}
.entity-detail-dialog .entity-image-choices[hidden]{display:none!important;}
.entity-detail-dialog .entity-image-choices button:not(.entity-thumbnail-remove){flex:0 0 52px;width:52px;height:52px;}
.entity-image-remove{position:absolute;top:8px;right:8px;z-index:4;display:flex;align-items:center;justify-content:center;width:27px;height:27px;border:0;border-radius:50%;background:rgba(25,29,36,.68);color:#fff;font-size:22px;line-height:1;cursor:pointer;}
.entity-image-remove[hidden]{display:none!important;}
.entity-image-remove:hover{background:#b64d58;}
.entity-prompt-popover{position:relative;margin:10px 0;}
.entity-prompt-popover summary{display:flex;align-items:center;gap:8px;width:max-content;list-style:none;cursor:pointer;font-size:12px;color:inherit;padding:6px 0;}
.entity-prompt-popover summary::-webkit-details-marker{display:none;}
.entity-prompt-panel{position:absolute;bottom:calc(100% + 6px);left:0;z-index:40;box-sizing:border-box;width:min(470px,100%);padding:16px;border:1px solid #dce1e7;border-radius:10px;background:#fff;box-shadow:0 12px 40px #0003;max-height:55dvh;overflow:auto;}
.entity-prompt-panel .entity-form-prompt{min-height:160px;}
.entity-prompt-panel .entity-prompt-done{display:block;margin:10px 0 0 auto;}
html.dark-mode .entity-prompt-panel{background:#282828;border-color:#444b55;color:#eee;}
@media(max-width:820px){
 .entity-detail-dialog .entity-detail-body{grid-template-columns:1fr;gap:20px;}
 .entity-detail-dialog .entity-form-image-preview{height:280px;min-height:280px;}
 .entity-detail-dialog .entity-form-image-preview img{max-height:264px;}
 .entity-detail-dialog .entity-image-choices{max-height:280px;}
 .entity-image-workspace{grid-template-columns:48px minmax(0,1fr);gap:8px;}
 .entity-detail-dialog .entity-image-choices button:not(.entity-thumbnail-remove){width:44px;height:44px;flex-basis:44px;}
 .entity-prompt-panel{width:100%;}
}


.side-list-add{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:42px;margin:10px 0 2px;border:1px dashed #d5dae1;border-radius:7px;background:transparent;color:#8993a0;font:inherit;font-size:12px;cursor:pointer;}
.side-list-add>span:first-child{font-size:20px;line-height:1;}
.side-list-add:hover{color:var(--brand);border-color:var(--brand);background:var(--brand-soft);}
html.dark-mode .side-list-add{border-color:#414650;color:#a0a8b5;}

.image-style-setting{margin-bottom:16px;}
.image-style-setting>label{display:block;margin-bottom:8px;}
.image-style-setting>input{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid #dce1e7;border-radius:7px;background:transparent;color:inherit;font:inherit;font-size:13px;}
html.dark-mode .image-style-setting>input{border-color:#454b55;}
@media(max-width:820px){.image-style-setting>input{font-size:16px;}}

/* 与梗概/背景使用同样的自然排列，避免三个标签被均分拉开。 */
.side-panel .panel-tabs{justify-content:flex-start;gap:2px;}
.side-panel .panel-tabs .panel-tab{flex:0 0 auto;}
.image-options-trigger .image-style-summary{max-width:9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:middle;}

/* 角色编辑：形象与人物资料分区，工具集中，表单层级清晰。 */
#characterModal .entity-detail-dialog{width:1120px;max-width:calc(100vw - 40px);border-radius:16px;background:#fff;}
#characterModal .character-dialog-heading{display:flex;align-items:center;gap:10px;padding:20px 26px;border-bottom:1px solid #e8ebef;flex-shrink:0;}
#characterModal .character-heading-mark{width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#f0f2f5;color:#657184;border-radius:8px;}
#characterModal .character-heading-mark svg{width:21px;height:21px;}
#characterModal .character-dialog-heading .modal-title{margin:0;padding:0;border:0;font-size:17px;font-weight:650;}
#characterModal .entity-detail-body{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:0;padding:0;}
#characterModal .entity-form-images{padding:22px;background:#f7f8fa;}
#characterModal .entity-detail-fields{padding:22px 26px;border-left:1px solid #e8ebef;}
#characterModal .character-section-heading{margin:0 0 16px;font-size:12px;font-weight:600;color:#737e8d;}
#characterModal .entity-image-workspace{grid-template-columns:48px minmax(0,1fr);gap:10px;}
#characterModal .entity-form-image-preview{height:340px;min-height:340px;background:#fff;border:1px solid #e2e6ec;border-radius:10px;}
#characterModal .entity-form-image-preview img{max-height:324px;}
#characterModal .entity-image-choices{max-height:340px;}
#characterModal .entity-image-choices button:not(.entity-thumbnail-remove){width:44px;height:44px;flex-basis:44px;}
#characterModal .character-image-tools{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 12px;margin:14px 0 0 58px;}
#characterModal .character-image-tools .entity-form-image-actions,#characterModal .character-image-tools .entity-prompt-popover{margin:0;}
#characterModal .entity-image-upload-row .btn{padding:6px 0;border:0;background:transparent;font-size:12px;}
#characterModal .entity-prompt-popover{justify-self:end;}
#characterModal .entity-prompt-panel{left:auto;right:0;width:360px;max-width:calc(100vw - 70px);}
#characterModal .character-image-tools .image-options{grid-column:1/-1;margin:0;min-width:0;}
#characterModal .image-options-trigger{display:flex;width:100%;box-sizing:border-box;justify-content:flex-start;flex-wrap:wrap;padding:9px 10px;background:#fff;border:1px solid #e2e6ec;border-radius:7px;}
#characterModal .character-image-tools .entity-generate-row{grid-column:1/-1;}
#characterModal .entity-generate-row>.btn{height:38px;border-radius:7px;font-size:13px;}
#characterModal #characterFormImageStatus{margin:10px 0 0 58px;font-size:11px;line-height:1.6;}
#characterModal .char-form{display:flex;flex-direction:column;gap:14px;}
#characterModal .cf-row,#characterModal .cf-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0;}
#characterModal .cf-row{grid-template-columns:minmax(0,1fr) 80px;}
#characterModal .cf-field{min-width:0;margin:0;}
#characterModal .cf-narrow{width:auto;}
#characterModal .cf-field label{display:block;margin:0 0 6px;font-size:11px;font-weight:500;color:#7d8795;}
#characterModal .cf-field input,#characterModal .cf-field textarea{box-sizing:border-box;width:100%;border:1px solid #e3e7ec;border-radius:7px;background:#fafbfc;color:#303a48;padding:9px 10px;font:inherit;font-size:13px;line-height:1.5;outline:none;}
#characterModal .cf-field input:focus,#characterModal .cf-field textarea:focus{background:#fff;box-shadow:none;}
#characterModal #charName{font-weight:600;padding:6px 10px;}
#characterModal .character-narrative-heading{margin:4px 0 0;padding-top:16px;border-top:1px solid #e8ebef;font-size:12px;font-weight:600;color:#737e8d;}
#characterModal #charBio{min-height:110px;height:110px;resize:vertical;}
#characterModal #charRelations{min-height:76px;height:76px;resize:vertical;}
#characterModal .modal-actions{padding:14px 26px;border-top:1px solid #e8ebef;background:#fff;gap:10px;}
#characterModal .modal-actions .btn{min-width:80px;border-radius:7px;}
html.dark-mode #characterModal .entity-detail-dialog,html.dark-mode #characterModal .modal-actions{background:#1e1e1e;}
html.dark-mode #characterModal .entity-form-images{background:#191919;}
html.dark-mode #characterModal .entity-detail-fields,html.dark-mode #characterModal .character-dialog-heading,html.dark-mode #characterModal .modal-actions,html.dark-mode #characterModal .character-narrative-heading{border-color:#343942;}
html.dark-mode #characterModal .character-heading-mark{background:#2f2f2f;color:#b4becd;}
html.dark-mode #characterModal .entity-form-image-preview,html.dark-mode #characterModal .image-options-trigger,html.dark-mode #characterModal .cf-field input,html.dark-mode #characterModal .cf-field textarea{background:#262626;border-color:#3a414b;color:#e2e7ee;}
@media(max-width:820px){
 #characterModal .entity-detail-dialog{max-width:calc(100vw - 20px);}
 #characterModal .entity-detail-body{grid-template-columns:1fr;}
 #characterModal .entity-form-images,#characterModal .entity-detail-fields{padding:18px;}
 #characterModal .entity-detail-fields{border-left:0;border-top:1px solid #e8ebef;}
 #characterModal .entity-form-image-preview{height:260px;min-height:260px;}
 #characterModal .entity-form-image-preview img{max-height:244px;}
 #characterModal .entity-image-choices{max-height:260px;}
 #characterModal .cf-field input,#characterModal .cf-field textarea{font-size:16px!important;}
 #characterModal .character-dialog-heading{padding:16px 18px;}
 #characterModal .modal-actions{padding:12px 18px;}
}

/* 空白主图与缩略图加号为统一上传入口。 */
.entity-empty-upload{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:0;background:transparent;color:inherit;font:inherit;padding:24px;cursor:pointer;}
.entity-empty-upload>span{font-size:13px;color:#7f8a99;}
.entity-empty-upload>small{font-size:11px;color:#a2aab6;}
.entity-empty-upload:hover>span{color:var(--brand);}
.entity-detail-dialog .entity-image-choices .entity-thumbnail-add{display:flex;align-items:center;justify-content:center;border:1px dashed #bfc7d2;border-radius:6px;background:transparent;color:#8b96a5;font-size:25px;font-weight:300;line-height:1;}
.entity-detail-dialog .entity-image-choices .entity-thumbnail-add:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft);}
html.dark-mode .entity-detail-dialog .entity-image-choices .entity-thumbnail-add{border-color:#4c5563;color:#a7b0bf;}
#characterModal .character-image-tools .entity-prompt-popover{grid-column:1/-1;justify-self:start;}
#characterModal .entity-prompt-panel{left:0;right:auto;}

/* 图片区不再显示旧的顶部分隔线。 */
#characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{border-top:0;}
:is(#propModal,#styleAssetModal) .entity-form-images{margin-top:0;padding-top:0;}

.project-research-list{flex:1;min-height:0;overflow:auto;padding:12px;}
.project-research-list[hidden],#researchDeleteButton[hidden]{display:none!important;}
.research-note-item{display:flex;flex-direction:column;gap:6px;width:100%;padding:12px;text-align:left;border:1px solid #e6e9ee;border-radius:7px;background:transparent;color:inherit;margin-bottom:8px;font:inherit;cursor:pointer;}
.research-note-item strong{font-size:13px;font-weight:600;overflow-wrap:anywhere;}
.research-note-item>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:1.6;color:#8993a1;overflow-wrap:anywhere;}
.research-note-item:hover{background:var(--brand-soft);}
.research-dialog{width:640px;max-width:calc(100vw - 32px);max-height:90dvh;display:flex;flex-direction:column;}
.research-dialog>label{font-size:12px;color:#8993a1;margin:12px 0 7px;}
.research-dialog>input,.research-dialog>textarea{box-sizing:border-box;width:100%;border:1px solid #dce1e7;border-radius:7px;padding:10px 12px;background:transparent;color:inherit;font:inherit;font-size:14px;line-height:1.7;}
.research-dialog>textarea{height:300px;min-height:100px;resize:vertical;white-space:pre-wrap;}
.research-dialog .research-delete{margin-right:auto;color:#cf5660;}
html.dark-mode .research-note-item,html.dark-mode .research-dialog>input,html.dark-mode .research-dialog>textarea{border-color:#3b424c;}
@media(max-width:820px){.research-dialog>input,.research-dialog>textarea{font-size:16px;}.research-dialog>textarea{height:40dvh;}}

/* 资料即时保存，提示词直接出现在主图下方。 */
.entity-inline-prompt{margin:12px 0 10px;min-width:0;}
.entity-inline-prompt .entity-prompt-heading{padding-top:0;border-top:0;}
.entity-inline-prompt .entity-form-prompt{display:block;box-sizing:border-box;width:100%;min-height:100px;resize:vertical;}
#characterModal .character-image-tools .entity-inline-prompt{grid-column:1/-1;margin:0;}
#characterModal #charRelations[hidden]{display:none!important;}
#characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{padding-bottom:0;}

#characterModal .entity-detail-fields{border-left:0;}
#characterModal .cf-grid2:has(>#charPersonality){grid-template-columns:1fr;}
.character-form-setting{margin-bottom:16px;}
.character-form-setting label{display:block;margin-bottom:8px;}
.character-form-setting select,.character-form-setting textarea{box-sizing:border-box;width:100%;background:transparent;color:inherit;border:1px solid #dce1e7;border-radius:7px;padding:10px;font:inherit;font-size:13px;}
.character-form-setting textarea{margin-top:8px;min-height:74px;}
.character-form-setting textarea[hidden]{display:none!important;}
.character-audio small{display:block;margin:7px 0;color:#929ba8;font-size:11px;}
#characterVoicePreview{display:flex;flex-direction:column;gap:8px;margin-top:10px;min-width:0;}
#characterVoicePreview>span{font-size:12px;overflow-wrap:anywhere;}
#characterVoicePreview audio{width:100%;height:36px;}
#characterVoicePreview .btn{align-self:flex-start;font-size:12px;}
html.dark-mode .character-form-setting select,html.dark-mode .character-form-setting textarea{border-color:#454b55;}
@media(max-width:820px){.character-form-setting select,.character-form-setting textarea{font-size:16px;}}


/* 单页角色资料：左右留白与输入节奏统一。 */
#characterModal .entity-detail-dialog{width:1080px;}
#characterModal .entity-detail-body{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);align-items:start;}
#characterModal .entity-form-images{padding:24px;background:transparent;}
#characterModal .entity-detail-fields{padding:24px 24px 24px 8px;}
#characterModal .entity-form-image-preview{height:310px;min-height:310px;border-radius:9px;}
#characterModal .entity-form-image-preview img{max-height:294px;}
#characterModal .entity-image-choices{max-height:310px;}
#characterModal .character-image-tools{margin-top:12px;gap:10px;}
#characterModal .entity-inline-prompt .entity-form-prompt{min-height:100px;height:110px;}
#characterModal .entity-prompt-heading{padding:0;margin:0 0 7px;}
#characterModal .char-form{gap:16px;}
#characterModal .cf-row{align-items:end;}
#characterModal .cf-field input{min-height:39px;}
#characterModal #charName{font-size:17px;min-height:39px;}
#characterModal #charBio{height:125px;min-height:125px;}
#characterModal .character-audio{padding:12px;background:#f5f6f8;border-radius:8px;}
#characterModal .character-audio>label{margin-bottom:9px;}
#characterModal .character-audio>.btn{font-size:12px;padding:6px 10px;background:transparent;}
#characterModal .character-audio>small{display:inline;margin-left:9px;}
html.dark-mode #characterModal .character-audio{background:#292929;}
@media(max-width:820px){
 #characterModal .entity-detail-body{grid-template-columns:1fr;}
 #characterModal .entity-form-images,#characterModal .entity-detail-fields{padding:18px;}
 #characterModal .entity-form-image-preview{height:260px;min-height:260px;}
 #characterModal .entity-form-image-preview img{max-height:244px;}
 #characterModal .entity-image-choices{max-height:260px;}
 #characterModal .character-audio>small{display:block;margin:7px 0 0;}
}

.character-tone-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;}
#characterModal .character-tone-heading label{margin:0;}
.character-tone-tabs{display:flex;gap:2px;padding:2px;background:#f0f2f5;border-radius:5px;}
.character-tone-tabs button{font:inherit;font-size:11px;border:0;border-radius:4px;padding:4px 9px;background:transparent;color:#929ba8;cursor:pointer;}
.character-tone-tabs button[aria-pressed="true"]{background:#fff;color:#3b4655;}
#characterToneText[hidden],#characterToneAudio[hidden]{display:none!important;}
#characterModal .character-tone-field .character-audio{padding:0;background:transparent;}
#characterComposition .character-form-setting{display:grid;grid-template-columns:42px minmax(0,1fr);gap:8px;margin:0 0 10px;align-items:center;}
#characterComposition .character-form-setting label{margin:0;font-size:12px;}
#characterComposition .character-form-setting select{padding:7px 9px;}
#characterComposition .character-form-setting textarea{grid-column:1/-1;margin:0;}
.entity-inline-prompt textarea[readonly]{color:#8993a1;background:rgba(128,138,153,.05);}
html.dark-mode .character-tone-tabs{background:#2e2e2e;}
html.dark-mode .character-tone-tabs button[aria-pressed="true"]{background:#484848;color:#eee;}

/* 生成参数位于提示词输入框底部；构图仍在参数弹窗内。 */
.entity-prompt-input-box{border:1px solid #dce1e7;border-radius:8px;background:transparent;}
.entity-prompt-input-box:focus-within{border-color:var(--brand);}
.entity-detail-dialog .entity-prompt-input-box .entity-form-prompt{border:0!important;border-radius:8px 8px 0 0;box-shadow:none!important;outline:none;resize:vertical;}
.entity-detail-dialog .entity-prompt-input-box .image-options{margin:0;padding:7px 9px;border-top:1px solid rgba(128,138,153,.14);box-sizing:border-box;}
.entity-detail-dialog .entity-prompt-input-box .image-options-trigger,#characterModal .entity-prompt-input-box .image-options-trigger{width:100%;display:flex;flex-wrap:wrap;justify-content:flex-start;border:0;box-shadow:none;background:transparent;padding:3px 0;border-radius:0;font-size:11px;gap:6px;}
.character-form-setting .image-option-label{margin-bottom:8px;}
html.dark-mode .entity-prompt-input-box{border-color:#454b55;}

.entity-detail-dialog .entity-prompt-input-box .entity-form-prompt{resize:none!important;}
.entity-detail-dialog .entity-prompt-input-box .image-options{background:#eef0f4;border-radius:0 0 7px 7px;}
.entity-detail-dialog .entity-prompt-input-box .image-options-trigger,#characterModal .entity-prompt-input-box .image-options-trigger{justify-content:center;text-align:center;}
html.dark-mode .entity-detail-dialog .entity-prompt-input-box .image-options{background:#303030;}
.entity-blank-thumbnail{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;box-sizing:border-box;border:1px solid #98a4b6;border-radius:6px;background:rgba(128,138,153,.06);font-size:10px;color:#929cab;}

/* 一体式图片提示词：参数在左，生成工具在右。 */
.entity-detail-dialog .entity-detail-body,#characterModal .entity-detail-body{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);}
.entity-prompt-input-box{overflow:visible;border-radius:12px;background:#f5f6f8;}
.entity-detail-dialog .entity-prompt-input-box .entity-form-prompt{height:135px;min-height:135px;background:transparent;padding:13px 14px;font-size:13px;line-height:1.7;}
.entity-composer-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px;min-width:0;}
.entity-detail-dialog .entity-prompt-input-box .entity-composer-footer .image-options{padding:0;border:0;background:transparent;flex:1;min-width:0;}
.entity-detail-dialog .entity-prompt-input-box .entity-composer-footer .image-options-trigger,#characterModal .entity-prompt-input-box .entity-composer-footer .image-options-trigger{justify-content:flex-start;text-align:left;gap:5px;font-size:11px;padding:3px 0;}
.entity-composer-footer .image-style-summary{max-width:5em;}
.entity-detail-dialog .entity-composer-actions{display:flex;flex:0 0 auto;align-items:center;gap:6px;margin:0;padding:0;}
.entity-detail-dialog .entity-composer-actions .btn{width:auto;border-radius:7px;min-height:31px;padding:6px 9px!important;font-size:11px;white-space:nowrap;line-height:1.4;}
.entity-detail-dialog .entity-composer-actions .entity-text-action{background:#e6e9ee;color:#596575;border:0;}
.entity-detail-dialog .entity-composer-actions .btn:disabled{opacity:.45;cursor:not-allowed;}
html.dark-mode .entity-prompt-input-box{background:#262626;}
html.dark-mode .entity-detail-dialog .entity-prompt-input-box .entity-composer-footer .image-options{background:transparent;}
html.dark-mode .entity-detail-dialog .entity-composer-actions .entity-text-action{background:#3d3d3d;color:#d1d7e0;}
@media(max-width:820px){
 .entity-detail-dialog .entity-detail-body,#characterModal .entity-detail-body{grid-template-columns:1fr;}
 .entity-composer-footer{flex-wrap:wrap;}
 .entity-detail-dialog .entity-composer-actions{margin-left:auto;}
}

.entity-prompt-input-box{position:relative;}
.entity-prompt-input-box>.entity-generating-overlay{z-index:5;border-radius:11px;}
.entity-detail-dialog .entity-composer-actions .btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:6px!important;}
.entity-composer-actions .btn svg{width:19px;height:19px;flex-shrink:0;}

/* 自定义提示立即出现，避免原生 title 的等待时间。 */
.entity-composer-actions [data-instant-tip]{position:relative;}
.entity-composer-actions [data-instant-tip]::after{content:attr(data-instant-tip);position:absolute;bottom:calc(100% + 9px);right:0;z-index:50;padding:7px 10px;border-radius:6px;background:#303641;color:#fff;box-shadow:0 3px 12px #0002;font:normal 12px/1.4 system-ui,sans-serif;white-space:nowrap;pointer-events:none;visibility:hidden;opacity:0;transition:none;}
.entity-composer-actions [data-instant-tip]:hover::after,.entity-composer-actions [data-instant-tip]:focus-visible::after{visibility:visible;opacity:1;}
html.dark-mode .entity-composer-actions [data-instant-tip]::after{background:#e3e7ed;color:#242b35;}

/* 场景与道具沿用角色弹窗的比例、留白与资料样式。 */
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-dialog{width:1080px;max-width:calc(100vw - 40px);border-radius:16px;background:#fff;}
.entity-dialog-heading{display:flex;align-items:center;gap:10px;padding:20px 26px;border-bottom:1px solid #e8ebef;flex-shrink:0;}
.entity-heading-mark{width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#f0f2f5;color:#657184;border-radius:8px;}
.entity-heading-mark svg{width:21px;height:21px;}
.entity-dialog-heading .modal-title{margin:0;padding:0;border:0;font-size:17px;font-weight:650;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-body{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:0;padding:0;align-items:start;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-images{padding:24px;background:transparent;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-fields{padding:24px 24px 24px 8px;display:flex;flex-direction:column;gap:16px;border:0;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-workspace{grid-template-columns:48px minmax(0,1fr);gap:10px;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-image-preview{height:310px;min-height:310px;border-radius:9px;background:#fff;border:1px solid #e2e6ec;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-image-preview img{max-height:294px;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices{max-height:310px;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices button:not(.entity-thumbnail-remove){width:44px;height:44px;flex-basis:44px;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-inline-prompt{margin:12px 0 0 58px;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-prompt-heading{padding:0;margin:0 0 7px;border:0;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-image-status{margin:10px 0 0 58px;font-size:11px;line-height:1.6;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field{margin:0;min-width:0;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field label{display:block;margin:0 0 6px;font-size:11px;font-weight:500;color:#7d8795;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field input,:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field textarea{box-sizing:border-box;width:100%;border:1px solid #e3e7ec;border-radius:7px;background:#fafbfc;color:#303a48;padding:9px 10px;font:inherit;font-size:13px;line-height:1.5;outline:none;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field input{min-height:39px;font-size:17px;font-weight:600;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field textarea{min-height:260px;resize:vertical;}
:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field input:focus,:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field textarea:focus{background:#fff;box-shadow:none;}
html.dark-mode :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-dialog{background:#1e1e1e;}
html.dark-mode .entity-dialog-heading{border-color:#343942;}
html.dark-mode .entity-heading-mark{background:#2f2f2f;color:#b4becd;}
html.dark-mode :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-image-preview,html.dark-mode :is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field input,html.dark-mode :is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field textarea{background:#262626;border-color:#3a414b;color:#e2e7ee;}
@media(max-width:820px){
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-dialog{max-width:calc(100vw - 20px);}
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-body{grid-template-columns:1fr;}
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-images,:is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-fields{padding:18px;}
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-image-preview{height:260px;min-height:260px;}
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-form-image-preview img{max-height:244px;}
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices{max-height:260px;}
 :is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field input,:is(#locationModal,:is(#propModal,#styleAssetModal)) .cf-field textarea{font-size:16px;}
 .entity-dialog-heading{padding:16px 18px;}
}
#characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{align-items:start;}
#characterModal .entity-inline-prompt .entity-form-prompt,#locationModal .entity-inline-prompt .entity-form-prompt,:is(#propModal,#styleAssetModal) .entity-inline-prompt .entity-form-prompt{box-sizing:border-box;width:100%;height:110px;min-height:110px;max-height:110px;padding:13px 14px;resize:none!important;}
#characterModal .entity-inline-prompt,#locationModal .entity-inline-prompt,:is(#propModal,#styleAssetModal) .entity-inline-prompt{min-height:0;}

/* 缩略图独立删除按钮；右侧音色与动机并排。 */
.entity-detail-dialog .entity-image-choices{overflow-x:visible;}
.entity-thumbnail-item{position:relative;width:44px;height:44px;flex:0 0 44px;}
.entity-detail-dialog .entity-image-choices .entity-thumbnail-item>button:not(.entity-thumbnail-remove){width:44px;height:44px;}
.entity-detail-dialog .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove,#characterModal .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove{position:absolute;top:-3px;right:-3px;z-index:3;width:17px;height:17px;min-height:0;display:flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:50%;background:#555e6d;color:#fff;font-size:15px;line-height:1;flex:none;}
.entity-thumbnail-remove:hover{background:#be5661!important;}
#characterModal .cf-grid2:has(#charMotivation){grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;}
#characterModal .character-tone-tabs button{padding:3px 6px;}
#characterModal .character-tone-heading{min-height:17px;gap:4px;margin-bottom:6px;}
@media(max-width:440px){#characterModal .cf-grid2:has(#charMotivation){grid-template-columns:1fr;}}

/* 删除按钮留在缩略图内，避免滚动容器裁掉边角。 */
.entity-detail-dialog .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove,#characterModal .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove{top:2px;right:2px;width:16px;height:16px;background:rgba(38,46,59,.48);color:rgba(255,255,255,.9);font-size:14px;box-shadow:none;}
.entity-detail-dialog .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove:hover{background:rgba(157,59,72,.76)!important;}
/* 标题行高度一致，音色与动机输入框对齐。 */
#characterModal .cf-grid2:has(#charMotivation)>.cf-field>label,#characterModal .character-tone-heading{box-sizing:border-box;height:24px;min-height:24px;margin:0 0 6px;display:flex;align-items:center;}
#characterModal .character-tone-tabs button{line-height:14px;padding:2px 6px;}
#characterModal #charMotivation,#characterModal #charSpeech{box-sizing:border-box;height:39px;min-height:39px;}
/* 右侧资料填满对应列，小传吸收剩余空间并在内部滚动。 */
@media(min-width:821px){
 #characterModal .entity-detail-body{align-items:stretch;}
 #characterModal .entity-detail-fields{display:flex;flex-direction:column;min-height:0;}
 #characterModal .char-form{flex:1;min-height:0;}
 #characterModal .cf-field.cf-bio{display:flex;flex-direction:column;flex:1;min-height:140px;}
 #characterModal #charBio{flex:1;height:0;min-height:110px;max-height:none;resize:none!important;overflow-y:auto;}
}
#characterModal #charBio{resize:none!important;}
@media(max-width:820px){#characterModal #charBio{height:180px;min-height:180px;overflow-y:auto;}}

/* 缩略图禁止原生拖图，资料列略收窄。 */
.entity-image-choices img,.entity-image-choices .entity-thumbnail-item>button{-webkit-user-drag:none;user-select:none;}
.entity-detail-dialog .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove,#characterModal .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove{top:0;right:0;}
@media(min-width:821px){
 #characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);}
}

/* 三类图片展示框统一为 16:9 直角画幅，实际图片完整显示。 */
#characterModal .entity-form-image-preview,#locationModal .entity-form-image-preview,:is(#propModal,#styleAssetModal) .entity-form-image-preview{position:relative;box-sizing:border-box;width:100%;height:auto!important;min-height:0!important;aspect-ratio:16/9;border-radius:0!important;background:#f3f4f6;overflow:hidden;}
.entity-detail-dialog .entity-form-image-preview>.entity-image-shell{position:absolute;inset:0;width:100%;height:100%;min-height:0;border-radius:0;}
#characterModal .entity-form-image-preview img,#locationModal .entity-form-image-preview img,:is(#propModal,#styleAssetModal) .entity-form-image-preview img{width:100%;height:100%;max-width:100%;max-height:none!important;object-fit:contain;border-radius:0;}
.entity-detail-dialog .entity-form-image-preview>.entity-empty-upload{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;}
.entity-detail-dialog .entity-form-image-preview>.entity-generating-overlay{border-radius:0;}
html.dark-mode #characterModal .entity-form-image-preview,html.dark-mode #locationModal .entity-form-image-preview,html.dark-mode :is(#propModal,#styleAssetModal) .entity-form-image-preview{background:#262626;}
@media(min-width:821px){
 #locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{align-items:stretch;}
 #locationModal .entity-detail-fields,:is(#propModal,#styleAssetModal) .entity-detail-fields{min-height:0;}
 #locationModal .entity-detail-fields>.cf-field:last-child,:is(#propModal,#styleAssetModal) .entity-detail-fields>.cf-field:last-child{display:flex;flex-direction:column;flex:1;min-height:140px;}
 #locationModal #locDesc,:is(#propModal,#styleAssetModal) #propDesc{flex:1;height:0;min-height:140px;resize:none;overflow-y:auto;}
}
@media(max-width:820px){#locationModal #locDesc,:is(#propModal,#styleAssetModal) #propDesc{height:160px;min-height:160px;resize:none;}}

/* 删除按钮独立定尺寸，避免带弹窗 ID 的缩略图规则覆盖。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>.entity-thumbnail-remove{position:absolute;top:0;right:0;inset:0 0 auto auto;width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px;flex:0 0 16px;aspect-ratio:1;padding:0;border:0;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;line-height:1;background:rgba(38,46,59,.48);color:rgba(255,255,255,.9);z-index:3;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-thumbnail-item>button:not(.entity-thumbnail-remove){display:block;position:static;box-sizing:border-box;width:44px;height:44px;overflow:hidden;}

/* 统一两列的底边，剩余高度交给右侧长文本框。 */
.entity-form-image-status:empty{display:none!important;}
@media(min-width:821px){
 #characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{align-items:stretch;}
 #characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{margin-bottom:0;padding-bottom:24px;}
 #characterModal .entity-detail-fields,#locationModal .entity-detail-fields,:is(#propModal,#styleAssetModal) .entity-detail-fields{display:flex;flex-direction:column;align-self:stretch;min-height:0;padding-bottom:24px;}
 #characterModal .char-form{display:flex;flex-direction:column;flex:1;min-height:0;}
 #characterModal .cf-field.cf-bio{display:flex;flex-direction:column;flex:1;min-height:140px;}
 #characterModal #charBio{display:block;box-sizing:border-box;flex:1;height:0;min-height:110px;margin-bottom:0;}
 #locationModal .entity-detail-fields>.cf-field:last-child,:is(#propModal,#styleAssetModal) .entity-detail-fields>.cf-field:last-child{display:flex;flex-direction:column;flex:1;min-height:140px;}
 #locationModal #locDesc,:is(#propModal,#styleAssetModal) #propDesc{display:block;box-sizing:border-box;flex:1;height:0;min-height:110px;margin-bottom:0;}
}

.entity-image-lightbox{overflow:hidden;overscroll-behavior:contain;}
.entity-image-lightbox>img{border-radius:0!important;transform-origin:center;user-select:none;-webkit-user-drag:none;touch-action:none;flex-shrink:0;}
.entity-lightbox-close{z-index:3;}

.image-model-setting{margin-bottom:16px;}
.image-model-setting>label{display:block;margin-bottom:8px;}
.image-model-setting>select{box-sizing:border-box;width:100%;border:1px solid #dce1e7;border-radius:7px;padding:10px;background:transparent;color:inherit;font:inherit;font-size:13px;}
.image-options-trigger .image-model-summary{max-width:10em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
html.dark-mode .image-model-setting>select{border-color:#454b55;}
@media(max-width:820px){.image-model-setting>select{font-size:16px;}}

.asset-library-card[data-asset-editor]{cursor:pointer;}
.asset-library-card[data-asset-editor]:focus-visible{outline:2px solid var(--brand);outline-offset:3px;}

.entity-generating-overlay .entity-generation-note{display:block;max-width:90%;margin-top:9px;padding:0 14px;text-align:center;font-size:11px;line-height:1.6;opacity:.75;}

.entity-reference-strip{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 12px 0;}
.entity-reference-add{position:relative;}
.entity-reference-plus{width:42px;height:42px;border:1px solid #d8dde5;border-radius:7px;background:rgba(130,140,155,.08);color:inherit;font-size:27px;line-height:1;cursor:pointer;}
.entity-reference-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:20;min-width:128px;padding:5px;background:#fff;border:1px solid #dce1e7;border-radius:7px;box-shadow:0 6px 20px #0002;}
.entity-reference-menu[hidden]{display:none!important;}.entity-reference-menu>button{display:block;width:100%;padding:9px;border:0;background:transparent;color:inherit;text-align:left;font:inherit;font-size:12px;cursor:pointer;white-space:nowrap;}
.entity-reference-menu>button:hover{background:var(--brand-soft);}
.entity-reference-thumb{position:relative;width:42px;height:42px;}
.entity-reference-thumb img{width:100%;height:100%;object-fit:cover;border-radius:6px;}
.entity-reference-remove{position:absolute;top:0;right:0;width:16px;height:16px;border:0;border-radius:50%;padding:0;background:#3339;color:#fff;font-size:14px;cursor:pointer;}
.entity-reference-remove,.entity-thumbnail-remove{opacity:0;pointer-events:none;}
.entity-reference-thumb:hover>.entity-reference-remove,.entity-reference-thumb:focus-within>.entity-reference-remove,.entity-thumbnail-item:hover>.entity-thumbnail-remove,.entity-thumbnail-item:focus-within>.entity-thumbnail-remove{opacity:1;pointer-events:auto;}
.entity-reference-picker{position:fixed;inset:0;z-index:3500;background:#0009;display:flex;align-items:center;justify-content:center;padding:20px;}
.entity-reference-picker-dialog{width:720px;max-width:100%;max-height:80dvh;overflow:auto;padding:20px;border-radius:12px;background:#fff;color:#303a48;}
.entity-reference-picker-dialog>.btn{float:right;}.entity-reference-picker-dialog h3{font-size:16px;margin:5px 0 20px;}
.entity-reference-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;}
.entity-reference-picker-grid>button{border:1px solid #dce1e7;border-radius:7px;background:transparent;color:inherit;overflow:hidden;padding:0;cursor:pointer;}
.entity-reference-picker-grid .entity-image-shell{height:100px;}.entity-reference-picker-grid img{width:100%;height:100%;object-fit:contain;}.entity-reference-picker-grid button>span:last-child{display:block;font-size:12px;padding:7px;}
html.dark-mode .entity-reference-menu,html.dark-mode .entity-reference-picker-dialog{background:#2a2a2a;color:#eee;border-color:#444c59;}
@media(hover:none){.entity-reference-remove,.entity-thumbnail-remove{opacity:1;pointer-events:auto;}}

/* 移除顶栏后，用底色区分图片与资料，保留紧凑关闭入口。 */
#characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{background:#f3f5f7;padding:32px 24px 24px;}
#characterModal .entity-detail-fields,#locationModal .entity-detail-fields,:is(#propModal,#styleAssetModal) .entity-detail-fields{background:#fff;padding:32px 26px 24px;border:0;}
#characterModal .entity-detail-dialog>.modal-close-x,#locationModal .entity-detail-dialog>.modal-close-x,:is(#propModal,#styleAssetModal) .entity-detail-dialog>.modal-close-x{top:7px;right:8px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;padding:0;font-size:15px;line-height:1;border:0;border-radius:5px;background:transparent;color:#8e97a4;z-index:10;}
#characterModal .entity-detail-dialog>.modal-close-x:hover,#locationModal .entity-detail-dialog>.modal-close-x:hover,:is(#propModal,#styleAssetModal) .entity-detail-dialog>.modal-close-x:hover{background:#8793a41a;color:#465262;}
html.dark-mode #characterModal .entity-form-images,html.dark-mode #locationModal .entity-form-images,html.dark-mode :is(#propModal,#styleAssetModal) .entity-form-images{background:#1d1d1d;}
html.dark-mode #characterModal .entity-detail-fields,html.dark-mode #locationModal .entity-detail-fields,html.dark-mode :is(#propModal,#styleAssetModal) .entity-detail-fields{background:#272727;}
@media(max-width:820px){
 #characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{padding:32px 18px 20px;}
 #characterModal .entity-detail-fields,#locationModal .entity-detail-fields,:is(#propModal,#styleAssetModal) .entity-detail-fields{padding:20px 18px;}
}

/* 提示通过占位符呈现，参考入口更轻量；生成后锁定参考图。 */
.entity-reference-plus{width:30px;height:30px;font-size:22px;border-radius:6px;}
.entity-reference-add[hidden],.entity-reference-remove[hidden]{display:none!important;}
.entity-reference-strip:not(:has(.entity-reference-thumb)):has(.entity-reference-add[hidden]){display:none;}
.entity-inline-prompt>.entity-prompt-input-box{margin-top:0;}

/* 黑白主题原子切换，避免局部颜色过渡不同步；随后恢复交互过渡。 */
html.theme-colors-switching,html.theme-colors-switching *,html.theme-colors-switching *::before,html.theme-colors-switching *::after{transition:none!important;}


/* 恢复随内容适应的高度，整体宽度略微收紧。 */
#characterModal .entity-detail-dialog,#locationModal .entity-detail-dialog,:is(#propModal,#styleAssetModal) .entity-detail-dialog{width:1000px;max-width:calc(100vw - 40px);height:auto;max-height:90dvh;}
@media(max-width:820px){#characterModal .entity-detail-dialog,#locationModal .entity-detail-dialog,:is(#propModal,#styleAssetModal) .entity-detail-dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);height:auto;max-height:92dvh;}}
@media(min-width:821px){
 #characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{align-items:stretch;}
 #characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images,#characterModal .entity-detail-fields,#locationModal .entity-detail-fields,:is(#propModal,#styleAssetModal) .entity-detail-fields{align-self:stretch;}
}
/* 未上传与已上传音色占用同一个 39px 输入槽。 */
#characterModal #characterToneAudio{min-width:0;}
#characterModal #characterToneAudio>small{display:none;}
#characterModal #characterToneAudio>.btn{display:block;box-sizing:border-box;width:100%;height:39px;padding:6px 9px;border:1px solid #e3e7ec;border-radius:7px;background:#fafbfc;color:#7e8998;font:inherit;font-size:12px;line-height:1;white-space:nowrap;}
#characterModal #characterToneAudio.has-voice>.btn{display:none;}
#characterModal #characterVoicePreview{box-sizing:border-box;display:flex;flex-direction:row;align-items:center;gap:7px;height:39px;margin:0;padding:5px 8px;border:1px solid #e3e7ec;border-radius:7px;background:#fafbfc;min-width:0;}
#characterModal #characterVoicePreview:empty{display:none;}
#characterModal #characterVoicePreview .character-voice-name{flex:1;min-width:0;font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#characterVoicePreview .character-voice-play,#characterVoicePreview .character-voice-remove{display:flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:24px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;}
#characterVoicePreview .character-voice-play{font-size:12px;}
#characterVoicePreview .character-voice-remove{font-size:18px;opacity:.6;}
#characterVoicePreview audio[hidden]{display:none!important;}
html.dark-mode #characterModal #characterToneAudio>.btn,html.dark-mode #characterModal #characterVoicePreview{background:#262626;border-color:#3a414b;color:#dce2eb;}

/* 分栏背景覆盖整个内容容器，外层不再留下未着色的底部 padding。 */
#characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{padding:0!important;gap:0;background:#f3f5f7;}
#characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{margin:0!important;box-sizing:border-box;}
html.dark-mode #characterModal .entity-detail-body,html.dark-mode #locationModal .entity-detail-body,html.dark-mode :is(#propModal,#styleAssetModal) .entity-detail-body{background:#1d1d1d;}

/* 缩略图统一放在主图下方，生成工具跟主图同宽。 */
#characterModal .entity-image-workspace,#locationModal .entity-image-workspace,:is(#propModal,#styleAssetModal) .entity-image-workspace{gap:9px;min-width:0;}
#characterModal .entity-main-image,#locationModal .entity-main-image,:is(#propModal,#styleAssetModal) .entity-main-image{order:0;width:100%;}
#characterModal .entity-image-choices,#locationModal .entity-image-choices,:is(#propModal,#styleAssetModal) .entity-image-choices{order:1;align-items:center;height:50px;min-height:50px;max-height:50px;margin:0;}
#characterModal .character-image-tools{margin:12px 0 0;}
#locationModal .entity-inline-prompt,:is(#propModal,#styleAssetModal) .entity-inline-prompt{margin:12px 0 0;}
#characterModal #characterFormImageStatus,#locationModal #locationFormImageStatus,:is(#propModal,#styleAssetModal) #propFormImageStatus{margin-left:0;}


/* 夜间资产弹窗编辑区域透明，不再显示额外输入底色。 */
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) :is(.entity-detail-fields input,.entity-detail-fields textarea,.entity-form-prompt,.entity-prompt-input-box){background:transparent!important;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) :is(.entity-detail-fields input,.entity-detail-fields textarea,.entity-form-prompt):focus{background:transparent!important;}
html.dark-mode #researchModal :is(input,textarea){background:transparent!important;}

.entity-inline-prompt[hidden]{display:none!important;}
.entity-main-image{position:relative;}
.entity-image-hover-actions{position:absolute;right:9px;bottom:9px;z-index:4;display:flex;gap:6px;opacity:0;visibility:hidden;pointer-events:none;}
.entity-main-image:hover>.entity-image-hover-actions,.entity-main-image:focus-within>.entity-image-hover-actions{opacity:1;visibility:visible;pointer-events:auto;}
.entity-image-hover-actions button{font:inherit;font-size:11px;line-height:1.4;padding:6px 9px;border:1px solid #ffffff26;border-radius:5px;background:#202733bf;color:#fff;cursor:pointer;backdrop-filter:blur(8px);}
.entity-image-hover-actions button:hover{background:#202733ed;}
.entity-prompt-viewer{position:fixed;inset:0;z-index:3600;display:flex;align-items:center;justify-content:center;background:#0009;padding:20px;}
.entity-prompt-viewer-dialog{position:relative;box-sizing:border-box;width:540px;max-width:100%;max-height:80dvh;padding:22px;border-radius:12px;background:#fff;color:#344050;}
.entity-prompt-viewer-dialog>strong{display:block;margin-bottom:15px;font-size:15px;}
.entity-prompt-viewer-close{position:absolute;right:12px;top:10px;width:28px;height:28px;border:0;background:transparent;color:inherit;font-size:23px;cursor:pointer;}
.entity-prompt-viewer-dialog>textarea{box-sizing:border-box;width:100%;height:260px;max-height:55dvh;resize:none;overflow:auto;border:0;background:transparent;color:inherit;font:inherit;font-size:13px;line-height:1.8;outline:none;}
html.dark-mode .entity-prompt-viewer-dialog{background:#2a2a2a;color:#dce2eb;}
@media(hover:none){.entity-image-hover-actions{opacity:1;visibility:visible;pointer-events:auto;}}


/* 提示词与生成图片共用一个画幅，缩略图恢复在下方。 */
#characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{position:relative;box-sizing:border-box;width:100%;aspect-ratio:16/9;min-width:0;}
#characterModal .entity-shared-frame>.entity-form-image-preview,#locationModal .entity-shared-frame>.entity-form-image-preview,:is(#propModal,#styleAssetModal) .entity-shared-frame>.entity-form-image-preview{position:absolute;inset:0;width:100%;height:100%!important;aspect-ratio:auto;}
.entity-shared-frame>.entity-form-image-preview[hidden]{display:none!important;}
#characterModal .entity-shared-frame>.entity-inline-prompt,#locationModal .entity-shared-frame>.entity-inline-prompt,:is(#propModal,#styleAssetModal) .entity-shared-frame>.entity-inline-prompt{position:absolute;inset:0;margin:0;width:100%;height:100%;}
.entity-shared-frame .entity-prompt-input-box{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%;border-radius:0;}
#characterModal .entity-shared-frame .entity-form-prompt,#locationModal .entity-shared-frame .entity-form-prompt,:is(#propModal,#styleAssetModal) .entity-shared-frame .entity-form-prompt{flex:1;box-sizing:border-box;height:0;min-height:0;max-height:none;overflow-y:auto;}
.entity-shared-frame .entity-reference-strip,.entity-shared-frame .entity-composer-footer{flex-shrink:0;}
.entity-shared-frame .entity-reference-strip{padding-top:9px;}
.entity-shared-frame .entity-reference-plus{width:27px;height:27px;font-size:20px;}
.entity-shared-frame .entity-prompt-input-box>.entity-generating-overlay{border-radius:0;}


/* 上方大缩略图，主图与提示词区延伸至左栏底部。 */
@media(min-width:821px){
 #characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;}
}
#characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{display:flex;flex-direction:column;min-height:0;}
#characterModal .entity-image-workspace,#locationModal .entity-image-workspace,:is(#propModal,#styleAssetModal) .entity-image-workspace{display:flex;flex-direction:column;flex:1;gap:10px;min-height:0;}
#characterModal .entity-image-choices,#locationModal .entity-image-choices,:is(#propModal,#styleAssetModal) .entity-image-choices{order:0;height:64px;min-height:64px;max-height:64px;flex-shrink:0;padding:2px 0;}
.entity-thumbnail-item{width:56px;height:56px;flex-basis:56px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button:not(.entity-thumbnail-remove){width:56px;height:56px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices>.entity-thumbnail-add{width:56px;height:56px;flex:0 0 56px;}
.entity-image-choices .entity-blank-thumbnail{width:56px;height:56px;flex-basis:56px;}
#characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{order:1;flex:1;aspect-ratio:auto;min-height:240px;}
.entity-return-image{position:absolute;top:10px;right:10px;z-index:6;border:1px solid #a0a8b744;background:#f4f6f8;color:#657184;padding:6px 10px;border-radius:5px;font:inherit;font-size:12px;cursor:pointer;}
.entity-return-image[hidden]{display:none!important;}
.entity-shared-frame.is-prompt-view>.entity-image-hover-actions{display:none!important;}


html.dark-mode .entity-return-image{background:#353535;color:#d2d9e4;}
@media(max-width:820px){#characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{min-height:250px;}}

/* 查看提示词沿用生成前的完整输入框布局，仅正文只读。 */
.entity-shared-frame.is-prompt-view .entity-return-image{top:10px;right:10px;}
.entity-shared-frame.is-prompt-view .entity-reference-strip{padding-right:94px;}

/* 缩略图置于主图下方，56px 图片与滚动条分别占用空间。 */
#characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{order:0;}
#characterModal .entity-image-choices,#locationModal .entity-image-choices,:is(#propModal,#styleAssetModal) .entity-image-choices{order:1;box-sizing:border-box;display:flex;flex-direction:row;align-items:flex-start;gap:8px;width:100%;height:76px;min-height:76px;max-height:76px;flex:0 0 76px;padding:2px 0 12px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-gutter:stable;}
.entity-image-choices::-webkit-scrollbar{height:6px;}
.entity-image-choices::-webkit-scrollbar-track{background:transparent;}
.entity-image-choices::-webkit-scrollbar-thumb{background:rgba(125,138,155,.35);border-radius:3px;}
.entity-image-choices::-webkit-scrollbar-thumb:hover{background:rgba(125,138,155,.6);}

/* 主图框统一小圆角，不影响放大预览原图。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame{border-radius:10px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame>.entity-form-image-preview{border-radius:10px!important;overflow:hidden;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame .entity-prompt-input-box{border-radius:10px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame .entity-prompt-input-box>.entity-generating-overlay{border-radius:9px;}
/* 添加入口与 56px 缩略图完全等大，覆盖旧的按钮尺寸。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices>button.entity-thumbnail-add{box-sizing:border-box;width:56px;min-width:56px;max-width:56px;height:56px;min-height:56px;max-height:56px;flex:0 0 56px;padding:0;border-radius:6px;display:flex;align-items:center;justify-content:center;line-height:1;font-size:27px;}

/* 查看提示词为完整只读状态。 */
.entity-shared-frame.is-prompt-view .entity-reference-plus,.entity-shared-frame.is-prompt-view .entity-composer-footer button{cursor:default;opacity:.5;}
/* 弹窗略收窄加高，内部两列随内容等高。 */
#characterModal .entity-detail-dialog,#locationModal .entity-detail-dialog,:is(#propModal,#styleAssetModal) .entity-detail-dialog{width:920px;min-height:0;}
#characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{min-height:310px;}
@media(max-width:820px){
 #characterModal .entity-detail-dialog,#locationModal .entity-detail-dialog,:is(#propModal,#styleAssetModal) .entity-detail-dialog{width:calc(100vw - 20px);min-height:0;}
 #characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{min-height:280px;}
}

/* 外框与内容建立完整的高度链，新增空间分配给主图和长文本。 */
@media(min-width:821px){
 #characterModal .entity-detail-dialog,#locationModal .entity-detail-dialog,:is(#propModal,#styleAssetModal) .entity-detail-dialog{height:auto;min-height:0;}
 #characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{flex:1 1 0;min-height:0;display:grid;align-content:stretch;align-items:stretch;overflow-y:auto;}
 #characterModal .entity-form-images,#locationModal .entity-form-images,:is(#propModal,#styleAssetModal) .entity-form-images{display:flex;flex-direction:column;min-height:0;align-self:stretch;}
 #characterModal .entity-image-workspace,#locationModal .entity-image-workspace,:is(#propModal,#styleAssetModal) .entity-image-workspace{display:flex;flex-direction:column;flex:1 1 0;min-height:0;}
 #characterModal .entity-shared-frame,#locationModal .entity-shared-frame,:is(#propModal,#styleAssetModal) .entity-shared-frame{flex:1 1 0;min-height:220px;aspect-ratio:auto;}
 #characterModal .entity-detail-fields,#locationModal .entity-detail-fields,:is(#propModal,#styleAssetModal) .entity-detail-fields{display:flex;flex-direction:column;min-height:0;align-self:stretch;}
 #characterModal .char-form{display:flex;flex-direction:column;flex:1 1 0;min-height:0;}
 #characterModal .cf-bio{display:flex;flex-direction:column;flex:1 1 0;min-height:120px;}
 #characterModal #charBio{flex:1 1 0;height:0;min-height:90px;resize:none;overflow-y:auto;}
 #locationModal .entity-detail-fields>.cf-field:last-child,:is(#propModal,#styleAssetModal) .entity-detail-fields>.cf-field:last-child{display:flex;flex-direction:column;flex:1 1 0;min-height:120px;}
 #locationModal #locDesc,:is(#propModal,#styleAssetModal) #propDesc{flex:1 1 0;height:0;min-height:90px;resize:none;overflow-y:auto;}
}

/* 参考图加号与参考缩略图等大，避免旧画幅样式把按钮缩窄。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame .entity-reference-plus{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:42px;min-width:42px;max-width:42px;height:42px;min-height:42px;max-height:42px;padding:0;border:1px solid #d8dde5;border-radius:7px;font-size:25px;font-weight:300;line-height:1;}
.entity-shared-frame .entity-reference-add{flex:0 0 42px;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame .entity-reference-plus{border-color:#444c59;}



/* 恢复无图片时提示词填满、有图片后才显示底部缩略图的布局。 */
@media(min-width:821px){
 #characterModal .entity-detail-dialog,#locationModal .entity-detail-dialog,:is(#propModal,#styleAssetModal) .entity-detail-dialog{width:920px;height:min(540px,90dvh);min-height:0;}
 #characterModal .entity-detail-body,#locationModal .entity-detail-body,:is(#propModal,#styleAssetModal) .entity-detail-body{flex:1 1 0;min-height:0;}
}

/* 仅新图片显示选择入口，生成选项原位切换提示词。 */
.entity-image-entry-choices{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:14px;padding:16px;box-sizing:border-box;}
.entity-image-entry{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;width:116px;min-height:96px;padding:15px 12px;border:1px solid #dce1e7;border-radius:9px;background:#ffffff80;color:#727f91;font:inherit;cursor:pointer;}
.entity-image-entry>span{font-size:25px;line-height:1;}.entity-image-entry>strong{font-size:12px;font-weight:500;}
.entity-image-entry:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft);}
html.dark-mode .entity-image-entry{background:#2c2c2c80;border-color:#454d59;color:#b7c0ce;}
html.dark-mode .entity-image-entry:hover{border-color:var(--brand-accent);color:var(--brand-accent);}

.entity-image-choices .entity-draft-thumbnail{font:inherit;font-size:11px;color:#8e99aa;background:rgba(130,140,155,.07);}

/* 横向模式 Tab，与上传/提示词内容在同一画幅原位切换。 */
.entity-image-mode-tabs{position:absolute;top:0;left:0;right:0;z-index:7;display:flex;align-items:center;gap:18px;height:36px;box-sizing:border-box;padding:0 12px;}
.entity-image-mode-tabs[hidden]{display:none!important;}
.entity-image-mode-tabs button{align-self:stretch;border:0;border-bottom:2px solid transparent;padding:0 1px;background:transparent;color:#929ba8;font:inherit;font-size:12px;cursor:pointer;}
.entity-image-mode-tabs button[aria-selected="true"]{color:var(--brand);border-bottom-color:var(--brand);}
.entity-image-mode-tabs button:disabled{cursor:default;opacity:.5;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame.has-mode-tabs>.entity-inline-prompt,:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame.has-mode-tabs>.entity-form-image-preview{top:40px;bottom:0;height:calc(100% - 40px)!important;}
.entity-upload-mode-dropzone{position:absolute;inset:0;box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:0;background:transparent;color:#8591a2;font:inherit;cursor:pointer;}
.entity-upload-mode-dropzone>span{font-size:30px;font-weight:300;line-height:1;}
.entity-upload-mode-dropzone>strong{font-size:13px;font-weight:500;}
.entity-upload-mode-dropzone>small{font-size:11px;opacity:.7;}
.entity-upload-mode-dropzone:hover{color:var(--brand);}
html.dark-mode .entity-image-mode-tabs button[aria-selected="true"]{color:var(--brand-accent);border-bottom-color:var(--brand-accent);}

.entity-image-mode-tabs{justify-content:center;gap:24px;}
.entity-image-mode-tabs button,.entity-image-mode-tabs button[aria-selected="true"],html.dark-mode .entity-image-mode-tabs button[aria-selected="true"]{border-bottom:0;}

/* Square reference thumbnails in the entity sidebar. */
#sideList .side-card .side-avatar{width:40px;height:40px;flex:0 0 40px;border-radius:8px;}
#sideList .side-card .side-avatar .entity-image-shell{width:100%;height:100%;border-radius:inherit;overflow:hidden;}

/* Quiet sidebar placeholders and compact, centered loading states. */
#sideList .side-card .side-avatar{background:#f0f1f3;color:#818793;box-shadow:none;}
#sideList .side-card .entity-sidebar-placeholder{display:block;width:21px;height:21px;flex:none;}
#sideList .side-avatar .entity-image-load-state{box-sizing:border-box;flex-direction:column;gap:3px;padding:3px;font-size:8px!important;line-height:1.1;font-weight:400;white-space:nowrap;opacity:1;color:#818793;}
#sideList .side-avatar .entity-image-spinner{width:10px;height:10px;border-width:1.25px;}
#sideList .side-avatar .entity-image-retry{border:0;padding:0;background:transparent;color:inherit;font:inherit;line-height:1.1;}
html.dark-mode #sideList .side-card .side-avatar{background:#2c2c2c;color:#9a9fa9;}
html.dark-mode #sideList .side-avatar .entity-image-load-state{color:#9a9fa9;}

/* Entity menus and drag insertion markers. */
#sideList .side-card .side-info{min-width:0;flex:1;}
.entity-card-more{flex:0 0 26px;width:26px;height:28px;padding:5px;border:0;border-radius:5px;color:#969ba4;background:transparent;cursor:pointer;}
.entity-card-more svg{width:100%;height:100%;display:block;}
.entity-card-more:hover{background:#88888816;color:var(--text);}
.entity-card-menu{position:fixed;z-index:30000;width:120px;padding:5px;background:#fff;border:1px solid #88888826;border-radius:8px;box-shadow:0 8px 28px #0002;}
.entity-card-menu button{display:block;width:100%;padding:8px 12px;text-align:left;background:transparent;border:0;border-radius:4px;color:#333;font:inherit;font-size:13px;cursor:pointer;}
.entity-card-menu button:hover{background:#88888814;}.entity-card-menu button.danger{color:#cc5151;}
html.dark-mode .entity-card-menu{background:#262626;}html.dark-mode .entity-card-menu button:not(.danger){color:#ddd;}
#sideList .side-card[data-sort-entity-id],.entity-thumbnail-item[data-sort-image-ref]{position:relative;touch-action:none;}
.entity-sort-dragging{opacity:.45;}
#sideList .entity-sort-before:before,#sideList .entity-sort-after:after{content:'';position:absolute;left:0;right:0;height:2px;background:var(--brand);pointer-events:none;}
#sideList .entity-sort-before:before{top:-4px;}#sideList .entity-sort-after:after{bottom:-4px;}

.shot-scene-actions{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;}
.shot-scene-ai{border:1px solid #88888835;border-radius:5px;background:transparent;color:var(--brand);padding:4px 5px;min-width:28px;font-size:10px;font-weight:600;line-height:1.2;cursor:pointer;white-space:nowrap;}
.shot-scene-ai:hover{background:#88888812;}.shot-scene-ai:disabled{opacity:.55;cursor:wait;}

.auth-method-tabs{display:flex;gap:18px;margin:0 0 16px;}
.auth-method-tabs button{padding:6px 0;border:0;background:none;color:#9499a2;font:inherit;font-size:13px;cursor:pointer;}
.auth-method-tabs button[aria-selected="true"]{color:var(--brand);font-weight:600;}
html.dark-mode .auth-method-tabs button[aria-selected="true"]{color:var(--brand-accent,var(--brand));}

.new-work-card .new-work-card-top{display:flex;justify-content:space-between;align-items:center;}
.work-card-heading .project-book-title{width:100%;}

#userMenu .menu-language{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;font-size:12px;color:#8a909a;}
#userMenu .menu-language .lang-options{display:flex;gap:3px;}
#userMenu .menu-language .lang-options button{display:block;flex:0 0 auto;width:auto;margin:0;padding:5px 8px;border:0;border-radius:5px;font-size:12px;line-height:1.3;background:transparent;color:inherit;}
#userMenu .menu-language .lang-options button.active{background:#88888816;color:var(--brand);}
#projectAIButton.floating-ai-button{touch-action:none;user-select:none;-webkit-user-select:none;}
#projectAIButton.floating-ai-button.is-position-dragging{transform:none;cursor:grabbing;transition:none;}

#userMenu .user-theme-row{margin-top:0;}

#userMenu .menu-language{border-top:1px solid #eceef0;margin-top:5px;padding-top:10px;}
#userMenu .user-theme-row{border-top:0;}
#userMenu .menu-appearance-label{display:flex;align-items:center;gap:9px;}
html.dark-mode #userMenu .menu-language{border-top-color:#33373b;}

#userMenu #menuLanguageTrigger{display:inline-flex;justify-content:flex-end;gap:8px;width:auto;padding:5px 0 5px 8px;font-size:12px;}
.menu-language-popup{position:fixed;z-index:30001;display:flex;flex-direction:column;gap:3px;width:128px;padding:5px;border:1px solid #88888826;border-radius:8px;background:#fff;box-shadow:0 6px 24px #0002;}
.menu-language-popup button{width:100%;text-align:left;padding:8px 10px;border:0;border-radius:5px;background:transparent;color:#646a74;font:inherit;font-size:12px;cursor:pointer;}
.menu-language-popup button:hover,.menu-language-popup button:focus-visible{background:#88888812;}
.menu-language-popup button.active{color:var(--brand);background:var(--brand-soft);}
html.dark-mode .menu-language-popup{background:#2c2c2c;}
html.dark-mode .menu-language-popup button{color:#adb2bb;}
html.dark-mode .menu-language-popup button.active{color:var(--brand-accent,var(--brand));}

#userMenu .menu-language{display:block;padding:0;padding-top:4px;}
#userMenu #menuLanguageTrigger{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;padding:8px 12px;margin:0;border:0;border-radius:8px;background:transparent;font-size:13px;color:inherit;text-align:left;}
#userMenu #menuLanguageTrigger:hover{background:#88888812;}
#userMenu #menuLanguageValue{margin-left:auto;font-size:11px;color:#9298a2;}

/* User-selected green, matching runtime tokens. */
:root{--brand:#2454a6;--brand-2:#1b25aa;--brand-hover:#284579;--brand-hover-2:#1d247f;--brand-light:#206ed2;--brand-deep:#1c2f52;--brand-deep-border:#354154;--brand-accent:#a9c7f9;--brand-accent-2:#82adf7;--brand-tint:#c9dcfd;--brand-border:#e1ecfe;--brand-soft:#f0f6fe;--brand-soft-2:#f0f2fe;--brand-rgb:36,84,166;--brand-accent-rgb:130,173,247;}

/* Place the separator after the language menu, above appearance. */
#userMenu .menu-language{border-top:0;margin-top:0;padding-top:0;}
#userMenu .user-theme-row{border-top:1px solid #eceef0;margin-top:5px;}
html.dark-mode #userMenu .menu-language{border-top:0;}
html.dark-mode #userMenu .user-theme-row{border-top-color:#33373b;}
.menu-language-popup{width:170px;}

#userMenu #menuLanguageTrigger{color:#4b5563;}
#userMenu #menuLanguageValue{color:inherit;}
#userMenu #menuLanguageTrigger:hover{color:var(--brand);}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;color:#8b929d;background:transparent;border:1px dashed #b8bec8;cursor:pointer;font:inherit;font-size:14px;box-shadow:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-plus{font-size:36px;line-height:1;font-weight:300;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-card:hover{color:var(--brand);border-color:var(--brand);background:var(--brand-soft);}
html.dark-mode :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-card{color:#929aa5;border-color:#4d535d;background:transparent;}
html.dark-mode :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-card:hover{color:var(--brand-accent);border-color:var(--brand-accent);}
#canvasGrid.has-selected-outline .track-card-section-heading{display:none;}

/* The creation dialog uses the same title, synopsis and footer arrangement as project cards. */
#newScriptModal .new-work-card.project-book-card{position:relative;display:flex;flex-direction:column;box-sizing:border-box;width:280px;max-width:calc(100vw - 40px);height:350px;min-height:0;max-height:calc(100dvh - 48px);aspect-ratio:.8/1;padding:17px;border:1px solid #e1e5e1;border-radius:11px;background:#fff;box-shadow:0 6px 24px #18221b21;overflow:auto;transform:none;cursor:default;}
#newScriptModal .work-card-heading{flex:0 0 auto;margin:0 0 12px;padding:0 15px 0 0;}
#newScriptModal .new-work-card-title{display:block;width:100%;height:2.8em;min-height:2.8em;margin:0;padding:0;border:0;background:transparent;font-family:'Songti SC',SimSun,serif;font-size:19px;font-weight:600;line-height:1.4;letter-spacing:normal;color:#293441;resize:none;}
#newScriptModal .project-book-info{display:flex;flex-direction:column;flex:1;min-height:0;}
#newScriptModal .new-work-card-synopsis{display:block;flex:1;width:100%;min-height:55px;height:auto;margin:0 0 12px;padding:0;border:0;background:transparent;font-size:13px;line-height:1.7;color:#87918c;resize:none;}
#newScriptModal .new-project-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:9px;margin:0;padding-top:10px;border-top:1px solid #e5e9e5;}
#newScriptModal .new-work-card-option{display:flex;align-items:center;gap:6px;margin:0;}
#newScriptModal .new-work-card-option>span{font-size:10px;color:#929ba6;}
#newScriptModal .ns-chip{font-size:10px;padding:4px 6px;}
#newScriptModal .new-work-create{display:flex;align-items:center;gap:9px;padding:6px 9px;border:0;border-radius:5px;background:var(--brand);color:#fff;font:inherit;font-size:11px;cursor:pointer;}
#newScriptModal .new-project-close{position:absolute;top:6px;right:7px;width:24px;height:24px;padding:0;border:0;background:transparent;color:#929ba6;font-size:19px;line-height:1;cursor:pointer;}
html.dark-mode #newScriptModal .new-work-card.project-book-card{background:#1a1a1a;border-color:#343a35;}
html.dark-mode #newScriptModal .new-work-card-title{color:#e0e4e8;}
html.dark-mode #newScriptModal .new-work-card-synopsis{color:#929d96;}
html.dark-mode #newScriptModal .new-project-footer{border-top-color:#343a35;}
@media(max-width:820px){#newScriptModal .new-work-card-title,#newScriptModal .new-work-card-synopsis{font-size:16px;}}



#addTrackMenu .track-template-group{margin-top:7px;padding-top:3px;}
#addTrackMenu .track-template-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:5px 10px 7px;font-size:11px;color:#8a929e;}
#addTrackMenu .track-template-time{display:flex;align-items:center;gap:5px;white-space:nowrap;}
#addTrackMenu .track-template-time input{box-sizing:border-box;width:70px;min-width:0;padding:4px 6px;border:1px solid #8888882b;border-radius:4px;background:transparent;color:inherit;font:inherit;text-align:right;}
#addTrackMenu .track-template-time input:focus{outline:none;box-shadow:none;}
#addTrackMenu .track-template-time input::placeholder{color:#a1a7af;}
html.dark-mode #addTrackMenu .track-template-heading{color:#969da7;}

/* A quieter subscription page with aligned comparisons and separate credit purchases. */
#pricingView{--subscription-surface:#fff;--subscription-ink:#242b36;--subscription-muted:#8b929d;--subscription-line:#e8eaee;padding:8px 0 40px;}
#pricingView .subscription-content{width:100%;max-width:1160px;margin:0 auto;}
#pricingView .subscription-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:38px;}
#pricingView .page-title{font-size:28px;letter-spacing:-.5px;color:var(--subscription-ink);}
#pricingView .subscription-header p{font-size:13px;line-height:1.6;color:var(--subscription-muted);}
#pricingView .subscription-current{flex:none;padding:6px 11px;border:1px solid var(--subscription-line);border-radius:6px;font-size:11px;color:var(--subscription-muted);}
#pricingView .subscription-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 14px;}
#pricingView .subscription-section-heading h2{font-size:14px;font-weight:600;color:var(--subscription-ink);}
#pricingView .subscription-section-heading>span{font-size:11px;color:var(--subscription-muted);}
#pricingView .pricing-grid{display:grid;gap:14px;align-items:stretch;}
#pricingView .price-card{display:flex;flex-direction:column;padding:23px 20px 20px;border:1px solid var(--subscription-line);border-radius:10px;background:var(--subscription-surface);box-shadow:none;min-width:0;}
#pricingView .price-card.featured{border-color:var(--brand);box-shadow:inset 0 2px 0 var(--brand);}
#pricingView .price-card.featured:before{display:none;}
#pricingView .subscription-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;}
#pricingView .price-card h3{font-size:16px;color:var(--subscription-ink);margin:0;}
#pricingView .subscription-recommended{font-size:10px;padding:3px 6px;background:var(--brand-soft);border-radius:4px;color:var(--brand);}
#pricingView .subscription-plan-desc{font-size:11px;color:var(--subscription-muted);margin-top:7px;min-height:34px;line-height:1.5;}
#pricingView .price{display:flex;align-items:baseline;gap:4px;margin:23px 0 20px;color:var(--subscription-ink);font-variant-numeric:tabular-nums;}
#pricingView .price-currency{font-size:17px;font-weight:500;}
#pricingView .price strong{font-size:37px;font-weight:600;line-height:1.1;letter-spacing:-1px;}
#pricingView .price small{font-size:11px;color:var(--subscription-muted);font-weight:400;margin-left:3px;}
#pricingView .subscription-plan-action{width:100%;padding:8px 10px;border:1px solid var(--subscription-line);border-radius:6px;background:transparent;color:var(--subscription-ink);font-size:12px;font-weight:500;}
#pricingView .subscription-plan-action:disabled{color:var(--subscription-muted);background:#88888808;border-color:var(--subscription-line);}
#pricingView .price-card ul{margin:20px 0 0;padding:16px 0 0;border-top:1px solid var(--subscription-line);list-style:none;}
#pricingView .price-card li{position:relative;padding:5px 0 5px 13px;font-size:11px;line-height:1.65;color:var(--subscription-muted);overflow-wrap:anywhere;}
#pricingView .price-card li:before{position:absolute;left:0;content:'·';font-size:15px;line-height:1.2;color:var(--subscription-muted);}
#pricingView .subscription-credits{margin-top:37px;}
#pricingView .credit-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;}
#pricingView .credit-card{display:block;text-align:left;background:var(--subscription-surface);padding:18px 20px;border:1px solid var(--subscription-line);border-radius:9px;box-shadow:none;min-width:0;}
#pricingView .credit-card:before{display:none;}
#pricingView .credit-amount{font-size:20px;font-weight:600;color:var(--subscription-ink);}
#pricingView .credit-amount span{font-size:11px;font-weight:400;color:var(--subscription-muted);}
#pricingView .credit-note{font-size:10px;line-height:1.5;color:var(--subscription-muted);margin:6px 0 18px;}
#pricingView .credit-purchase-row{display:flex;justify-content:space-between;align-items:center;gap:8px;}
#pricingView .credit-price{font-size:16px;color:var(--subscription-ink);font-weight:500;margin:0;}
#pricingView .credit-purchase-row .btn{width:auto;margin:0;padding:5px 11px;border:1px solid var(--subscription-line);border-radius:5px;background:transparent;font-size:11px;color:var(--subscription-ink);}
#pricingView .subscription-credit-guide{margin-top:22px;border-top:1px solid var(--subscription-line);border-bottom:1px solid var(--subscription-line);color:var(--subscription-muted);}
#pricingView .subscription-credit-guide summary{display:flex;align-items:center;justify-content:space-between;padding:16px 1px;list-style:none;cursor:pointer;font-size:12px;}
#pricingView .subscription-credit-guide summary::-webkit-details-marker{display:none;}
#pricingView .subscription-disclosure{transition:transform .15s;}
#pricingView .subscription-credit-guide[open] .subscription-disclosure{transform:rotate(45deg);}
#pricingView .subscription-credit-guide ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 25px;list-style:none;padding:0 1px 18px;font-size:11px;line-height:1.7;}
html.dark-mode #pricingView{--subscription-surface:#1c1e21;--subscription-ink:#e2e5ea;--subscription-muted:#969da8;--subscription-line:#33373e;}
html.dark-mode #pricingView .subscription-recommended{background:#2864b426;}
@media(max-width:1100px){#pricingView .pricing-grid,#pricingView .credit-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:560px){#pricingView{padding:4px 0 25px;}#pricingView .subscription-header{margin-bottom:26px;}#pricingView .page-title{font-size:24px;}#pricingView .pricing-grid{grid-template-columns:1fr;}#pricingView .price-card{padding:20px;}#pricingView .subscription-credit-guide ul{grid-template-columns:1fr;}#pricingView .credit-card{padding:15px 12px;}#pricingView .subscription-section-heading{align-items:flex-start;flex-wrap:wrap;gap:5px;}#pricingView .price-card ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;}}

/* Screen-coordinate insertion marker stays in thumbnail gaps, outside the clipped scroller. */
#entityImageInsertLine{position:fixed;width:2px;transform:translateX(-1px);border-radius:1px;background:var(--brand);pointer-events:none;z-index:31000;}

/* Highlight the visible upload surface, below the image mode tabs. */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-file-drop-target{outline:none!important;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-file-drop-target::after{content:'';position:absolute;inset:2px;box-sizing:border-box;border:2px dashed var(--brand);border-radius:inherit;background:rgba(var(--brand-rgb),.045);pointer-events:none;z-index:60;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-file-drop-target::after{border-color:var(--brand-accent);background:rgba(var(--brand-accent-rgb),.06);}

/* Compact image settings, shared across characters, scenes and props. */
.image-options-panel{box-sizing:border-box;padding:12px!important;border-radius:8px!important;}
.image-options-panel .character-form-setting,.image-options-panel .image-model-setting,.image-options-panel .image-style-setting{display:grid;grid-template-columns:58px minmax(0,1fr);gap:7px;align-items:center;margin:0 0 9px;}
.image-options-panel .character-form-setting>label,.image-options-panel .image-model-setting>label,.image-options-panel .image-style-setting>label{margin:0;text-align:left;font-size:11px;}
.image-options-panel .character-form-setting select,.image-options-panel .image-model-setting select,.image-options-panel .image-style-setting input{width:100%;min-height:30px;height:30px;padding:4px 7px;border-radius:5px;font-size:12px;}
.image-options-panel .character-form-setting textarea{grid-column:1/-1;min-height:55px;margin:0;padding:7px;resize:vertical;font-size:12px;}
.image-options-panel>.image-option-label{text-align:left;margin:10px 0 6px;font-size:11px;}
.image-options-panel .image-ratio-grid{gap:2px;padding:3px;}
.image-options-panel .image-ratio-grid button{min-height:42px;padding:5px 1px;gap:4px;font-size:10px;}
.image-options-panel .image-ratio-grid .image-ratio-icon{max-width:17px;max-height:16px;}
.image-options-panel .image-resolution-grid{padding:3px;}
.image-options-panel .image-resolution-grid button{padding:5px 0;font-size:11px;}
.image-options-panel .image-size-fields{gap:5px;}
.image-options-panel .image-size-fields label{padding:6px 8px;border-radius:5px;font-size:11px;}
@media(max-width:820px){.image-options-panel .character-form-setting select,.image-options-panel .image-model-setting select,.image-options-panel .image-style-setting input,.image-options-panel .character-form-setting textarea,.image-options-panel .image-size-fields input{font-size:16px;}}

/* Large storyboard previews immediately after the scene column. */
#shotView .shot-table .shot-frame-heading,#shotView .shot-table td.shot-frame{width:320px;min-width:320px;}
#shotView .shot-table td.shot-frame{height:200px;}
#shotView .shot-table .shot-frame-box,#shotView .shot-table .shot-frame-box:has(.entity-image-shell){position:relative;inset:auto;display:flex;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box;width:100%;height:200px;min-height:200px;padding:10px;}
#shotView .shot-table .shot-frame-box .entity-image-shell{display:flex;align-items:center;justify-content:center;width:100%;height:180px;min-height:0;}
#shotView .shot-table .shot-frame-box .entity-image-shell img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;}
#shotView .shot-table .shot-frame-box>svg{width:25px;height:25px;}
@media(max-width:820px){#shotView .shot-table .shot-frame-heading,#shotView .shot-table td.shot-frame{width:260px;min-width:260px;}#shotView .shot-table td.shot-frame,#shotView .shot-table .shot-frame-box,#shotView .shot-table .shot-frame-box:has(.entity-image-shell){height:168px;min-height:168px;}#shotView .shot-table .shot-frame-box .entity-image-shell{height:148px;}}

/* Keep shot numbers on one line and give visual descriptions a tighter measure. */
#shotView .shot-table .shot-number-heading,#shotView .shot-table td.shot-no{width:96px;min-width:96px;white-space:nowrap;}
#shotView .shot-table td.shot-no .shot-edit{min-width:7ch;white-space:nowrap;word-break:normal;overflow-wrap:normal;}
#shotView .shot-table .shot-description-heading,#shotView .shot-table td.shot-desc{width:260px;min-width:240px;max-width:280px;}
#shotView .shot-table td.shot-desc .shot-edit{box-sizing:border-box;max-width:260px;margin:0 auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;}

/* Each scene has a compact disclosure row instead of a dedicated column. */
#shotView .shot-table tr[hidden]{display:none!important;}
#shotView .shot-table .storyboard-scene-heading>td{padding:0!important;background:#f5f6f8;text-align:left!important;}
#shotView .storyboard-scene-heading-inner{display:flex;align-items:center;gap:10px;padding:5px 10px;}
#shotView .storyboard-scene-toggle{display:flex;align-items:center;gap:8px;flex:1;min-width:0;min-height:27px;padding:0;border:0;background:transparent;color:#606b7b;font:inherit;font-size:11px;text-align:left;cursor:pointer;}
#shotView .storyboard-scene-toggle svg{width:11px;height:11px;flex:none;transition:transform .15s;}
#shotView .storyboard-scene-toggle[aria-expanded="true"] svg{transform:rotate(90deg);}
#shotView .storyboard-scene-toggle strong{font-weight:600;white-space:nowrap;}
#shotView .storyboard-heading-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:min(50vw,700px);}
#shotView .storyboard-heading-count{font-size:10px;color:#929aa5;}
#shotView .storyboard-scene-heading .shot-scene-ai{padding:3px 7px;font-size:10px;}
html.dark-mode #shotView .shot-table .storyboard-scene-heading>td{background:#262626;}
html.dark-mode #shotView .storyboard-scene-toggle{color:#aeb7c5;}

/* Model selection is independent of the composition/style/size settings. */
.entity-composer-footer .entity-model-control{flex:0 0 auto;max-width:140px;min-width:0;}
.entity-model-control select{box-sizing:border-box;width:100%;max-width:140px;height:28px;padding:3px 6px;border:1px solid #8888882b;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:10px;cursor:pointer;}
.entity-model-control select:disabled{opacity:.5;cursor:default;}
.entity-composer-footer .image-options{flex:1 1 140px!important;}
.entity-composer-footer .image-options-trigger{min-width:0;max-width:100%;overflow:hidden;}
html.dark-mode .entity-model-control select{background:#282828;color:#c3c9d3;border-color:#454b55;}
@media(max-width:820px){.entity-model-control select{font-size:16px;max-width:170px;height:32px;}.entity-composer-footer .entity-model-control{max-width:170px;}}

/* Quiet image composer controls: highlight only on hover or keyboard focus. */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer :is(.entity-model-control select,.image-options-trigger,.entity-composer-actions>.btn){border:0;box-shadow:none;background:transparent;color:#687383;transition:background-color .12s,color .12s;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer :is(.entity-model-control select,.image-options-trigger,.entity-composer-actions>.btn):hover:not(:disabled){background:#7f8da514;color:#35465d;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer :is(.entity-model-control select,.image-options-trigger,.entity-composer-actions>.btn):focus-visible{outline:2px solid var(--brand);outline-offset:2px;background:#7f8da514;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer :is(.entity-model-control select,.image-options-trigger,.entity-composer-actions>.btn){background:transparent;color:#b0b8c4;border:0;box-shadow:none;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer :is(.entity-model-control select,.image-options-trigger,.entity-composer-actions>.btn):hover:not(:disabled){background:#a5b3c51a;color:#e1e7ef;}

/* Align the model and settings hit areas; keep the primary generation action distinct. */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer :is(.entity-model-control select,.image-options-trigger){box-sizing:border-box;display:inline-flex;align-items:center;height:32px;min-height:32px;max-height:32px;line-height:20px;padding:6px 8px;border-radius:6px;vertical-align:middle;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-model-control select{appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-model-control select::-ms-expand{display:none;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn-primary,
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn-primary{background:var(--brand);color:#fff;border:0;box-shadow:none;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn-primary:hover:not(:disabled),
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn-primary:hover:not(:disabled){background:var(--brand-hover);color:#fff;}

/* Reference-style model and output controls, with a custom model popover. */
.entity-model-control select[hidden]{display:none!important;}
.entity-composer-footer .entity-model-control{max-width:185px;padding-right:9px;border-right:1px solid #88888845;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-trigger{display:flex;align-items:center;gap:6px;height:32px;max-width:175px;padding:5px 6px;border:0;border-radius:6px;box-shadow:none;background:transparent;color:inherit;font:inherit;font-size:11px;cursor:pointer;outline:none;}
.entity-model-trigger .entity-model-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.entity-model-trigger .entity-model-icon{width:18px;height:18px;flex:none;}
.entity-control-chevron{width:12px;height:12px;flex:none;opacity:.6;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-trigger:hover:not(:disabled){background:#7f8da514;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-trigger:focus-visible{outline:1px solid #88888880;outline-offset:1px;}
.entity-model-trigger:disabled{opacity:.5;cursor:default!important;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options-trigger{gap:6px;}
.entity-composer-footer .image-options-trigger>span:not(.image-ratio-icon){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.entity-image-model-menu{position:fixed;z-index:31000;box-sizing:border-box;width:215px;max-width:calc(100vw - 16px);padding:5px;border:1px solid #88888826;border-radius:9px;background:#fff;box-shadow:0 8px 28px #0002;}
.entity-image-model-menu button{display:block;width:100%;padding:9px 10px;border:0;border-radius:5px;background:transparent;text-align:left;color:#626c7b;font:inherit;font-size:12px;cursor:pointer;outline:none;}
.entity-image-model-menu button:hover,.entity-image-model-menu button:focus-visible{background:#88888812;}
.entity-image-model-menu button.active{background:var(--brand-soft);color:var(--brand);}
html.dark-mode .entity-image-model-menu{background:#2a2a2a;}
html.dark-mode .entity-image-model-menu button{color:#bdc4ce;}
html.dark-mode .entity-image-model-menu button.active{background:#ffffff0c;color:var(--brand-accent);}

/* Keep model, output settings and generation actions on one shared row. */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer{gap:5px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-control{flex:0 1 135px;min-width:54px;max-width:135px;padding-right:5px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-trigger{width:100%;min-width:0;max-width:100%;gap:4px;padding:5px 4px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-model-trigger .entity-model-name{display:block;flex:1;min-width:0;text-align:left;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options{flex:1 1 0!important;min-width:0;overflow:hidden;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options-trigger{width:100%;max-width:100%;padding:6px 4px;gap:4px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options-trigger>span:not(.image-ratio-icon){flex:1;min-width:0;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions{gap:4px;margin-left:0;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn{flex:0 0 32px;}


/* Keep all image controls on a single compact row, without text truncation. */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer{display:flex;flex-wrap:nowrap;align-items:center;gap:3px;padding:8px 5px;min-width:0;overflow-x:auto;scrollbar-width:none;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer::-webkit-scrollbar{display:none;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-control{order:0;flex:0 0 auto;min-width:0;max-width:none;padding-right:4px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-trigger{width:auto;max-width:none;padding:5px 2px;gap:3px;font-size:10px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-model-trigger .entity-model-name{flex:none;overflow:visible;text-overflow:clip;white-space:nowrap;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options{order:1;flex:1 0 auto!important;min-width:max-content;overflow:visible;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options-trigger{width:auto;max-width:none;min-width:0;padding:6px 2px;gap:3px;overflow:visible;font-size:10px;white-space:nowrap;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-options-trigger>span:not(.image-ratio-icon){flex:none;overflow:visible;text-overflow:clip;white-space:nowrap;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .image-ratio-icon{width:14px;max-height:14px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-control-chevron{width:10px;height:10px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions{order:2;flex:0 0 auto;margin-left:auto;gap:3px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn{width:28px;min-width:28px;flex:0 0 28px;padding:4px!important;}

/* Scene duration handles remain separate from dragging a whole scene to reorder it. */
#outlineInner .tl-seg .scene-duration-handle{position:absolute;top:0;bottom:0;width:7px;z-index:8;cursor:ew-resize;touch-action:none;}
#outlineInner .scene-duration-handle.left{left:0;}#outlineInner .scene-duration-handle.right{right:0;}
#outlineInner .scene-duration-handle:after{content:'';position:absolute;top:25%;bottom:25%;left:2px;right:2px;border-radius:2px;background:currentColor;opacity:0;}
#outlineInner .tl-seg:hover .scene-duration-handle:after{opacity:.35;}

:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-model-control{border-right:0;padding-right:2px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions{gap:8px;margin-left:5px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-composer-footer .entity-composer-actions>.btn{width:32px;min-width:32px;height:32px;flex:0 0 32px;padding:6px!important;}
.entity-composer-actions [data-instant-tip]::after{display:none!important;}
#entityComposerTooltip{position:fixed;z-index:40000;padding:7px 10px;max-width:calc(100vw - 16px);box-sizing:border-box;border-radius:6px;background:#303641;color:#fff;box-shadow:0 3px 12px #0002;font:12px/1.4 system-ui,sans-serif;white-space:normal;pointer-events:none;}
html.dark-mode #entityComposerTooltip{background:#e3e7ed;color:#242b35;}

/* Scene storyboard strips and image editor. */
#shotTableWrap:has(.shot-board-section){overflow:visible;}
.shot-board-section{margin-bottom:23px;min-width:0;}
.shot-board-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 0;margin-bottom:9px;}
.shot-board-heading>button:first-child{display:flex;align-items:center;gap:8px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;}
.shot-board-heading .no-i18n{max-width:60vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8b929d;}
.shot-board-strip{display:flex;gap:14px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:thin;}
.shot-board-strip[hidden]{display:none;}
.shot-board-card{flex:0 0 280px;min-width:0;}
.shot-board-image{position:relative;aspect-ratio:16/9;border:1px solid #8888882b;border-radius:7px;overflow:hidden;background:#88888809;cursor:pointer;display:flex;align-items:center;justify-content:center;}
.shot-board-image .entity-image-shell{width:100%;height:100%;position:absolute;inset:0;}.shot-board-image img{width:100%;height:100%;object-fit:contain;}
.shot-board-empty{color:#a4aab3;font-size:26px;}
.shot-board-caption{display:flex;align-items:center;gap:10px;padding:9px 2px;color:#929aa6;font-size:10px;}.shot-board-caption strong{color:var(--brand);font-size:11px;}
.shot-board-add{flex:0 0 130px;align-self:flex-start;min-height:157px;border:1px dashed #88888850;border-radius:7px;background:transparent;color:#949ca8;display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;font:inherit;cursor:pointer;}.shot-board-add>span{font-size:26px;}
.shot-board-image-actions{position:absolute;right:7px;bottom:7px;display:flex;gap:5px;visibility:hidden;}.shot-board-image:hover .shot-board-image-actions,.shot-board-image:focus-within .shot-board-image-actions,.shot-image-surface:hover .shot-board-image-actions,.shot-image-surface:focus-within .shot-board-image-actions{visibility:visible;}
.shot-board-image-actions button{padding:5px 7px;border:0;border-radius:4px;background:#252933b8;color:#fff;font-size:10px;cursor:pointer;}
.shot-board-generating{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(110deg,#8cc7e9aa,#c6a6e9bb,#a4d8c4bb);background-size:250% 100%;animation:entity-image-rainbow 8s linear infinite;color:#fff;font-size:12px;}
#shotImageEditor{z-index:2200;}.shot-image-dialog{position:relative;display:grid;grid-template-columns:1.1fr 1fr;gap:22px;width:900px;max-width:calc(100vw - 32px);height:560px;max-height:90dvh;padding:22px;border-radius:11px;background:#fff;overflow:hidden;}
.shot-image-close{position:absolute;right:7px;top:4px;border:0;background:transparent;color:#999;font-size:22px;cursor:pointer;z-index:2;}
.shot-image-left{min-width:0;min-height:0;display:flex;flex-direction:column;gap:10px;}.shot-image-modebar{display:flex;justify-content:center;gap:22px;align-items:center;padding:4px;font-size:12px;color:#88919f;}.shot-image-modebar button,.shot-image-modebar label{font:inherit;border:0;background:transparent;color:inherit;cursor:pointer;}
.shot-image-surface{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;border:1px solid #88888825;border-radius:9px;overflow:hidden;color:#9099a6;}.shot-image-surface[hidden],#shotImageComposer[hidden]{display:none!important;}.shot-image-surface .entity-image-shell{width:100%;height:100%;}.shot-image-surface img{width:100%;height:100%;object-fit:contain;}
#shotImageComposer{display:flex;flex:1;min-height:0;flex-direction:column;border:1px solid #88888825;border-radius:9px;padding:12px;gap:12px;}#shotImagePrompt{flex:1;min-height:90px;resize:none;border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:13px;line-height:1.7;}
.shot-image-controls,.shot-image-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}.shot-image-controls select{min-width:0;flex:1;padding:5px;border:0;border-radius:5px;font-size:11px;background:#88888809;color:inherit;}.shot-image-tools{justify-content:flex-end;}.shot-image-tools button,.shot-image-tools label{font:inherit;font-size:11px;border:0;border-radius:5px;padding:7px;background:transparent;color:inherit;cursor:pointer;}.shot-image-tools .btn-primary{background:var(--brand);color:#fff;}
.shot-image-fields{min-height:0;overflow:auto;padding:9px 0;display:flex;flex-direction:column;gap:12px;}.shot-image-fields label{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#929aa5;}.shot-image-fields textarea,.shot-image-fields input{box-sizing:border-box;width:100%;padding:8px;border:1px solid #88888825;border-radius:5px;font:inherit;font-size:12px;background:transparent;color:#596579;}.shot-image-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;}#shotImageStatus{font-size:10px;color:#929aa5;}.shot-image-tools label:has(input:disabled){opacity:.4;pointer-events:none;}
html.dark-mode .shot-image-dialog{background:#222222;color:#c6ccd5;}html.dark-mode .shot-image-fields textarea,html.dark-mode .shot-image-fields input{color:#c6ccd5;}
@media(max-width:650px){.shot-image-dialog{grid-template-columns:1fr;height:90dvh;overflow:auto;}.shot-image-left{min-height:330px;}.shot-image-fields{overflow:visible;}.shot-board-card{flex-basis:240px;}.shot-board-add{min-height:135px;}.shot-image-fields input,.shot-image-fields textarea,#shotImagePrompt{font-size:16px;}}
@media(hover:none){.shot-board-image-actions{visibility:visible;}}

/* Shot dialog: image on the left, prompt and generation settings on the right. */
#shotImageEditor .shot-image-dialog{grid-template-columns:1.05fr 1fr;gap:20px;height:520px;}
#shotImageEditor .shot-image-left{min-height:0;}
#shotImageEditor .shot-image-surface{flex:1;width:100%;background:#88888806;}
#shotImageEditor .shot-image-fields{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;padding:9px 0 0;gap:12px;}
#shotImageEditor .shot-image-fields>strong,#shotImageEditor .shot-image-meta{flex-shrink:0;}
#shotImageEditor #shotImageComposer{flex:1;min-height:0;width:100%;box-sizing:border-box;}
#shotImageEditor #shotImagePrompt{min-height:70px;overflow-y:auto;}
#shotImageEditor .shot-image-fields #shotImageStatus{flex:0 0 auto;min-height:14px;margin:0;font-size:10px;}
#shotImageEditor #shotImageComposer.readonly .shot-image-controls,#shotImageEditor #shotImageComposer.readonly .shot-image-tools{opacity:.45;pointer-events:none;}
@media(max-width:650px){#shotImageEditor .shot-image-dialog{grid-template-columns:1fr;height:90dvh;overflow-y:auto;align-content:start;}#shotImageEditor .shot-image-left{min-height:220px;height:240px;flex:none;}#shotImageEditor .shot-image-fields{min-height:330px;overflow:visible;}}

/* Clear scene groups, consistent image cards and a matching prompt composer. */
.shot-board-section{margin-bottom:28px;}.shot-board-heading{padding:10px 0;margin-bottom:10px;border-bottom:1px solid #88888820;}.shot-board-heading>button:first-child{font-size:12px;gap:9px;}.shot-board-heading b{font-weight:600;}.shot-board-strip{gap:18px;padding-bottom:14px;}.shot-board-card{flex-basis:270px;}.shot-board-image{border-radius:8px;background:#88888806;}.shot-board-caption{padding:10px 2px;gap:9px;font-size:11px;}.shot-board-caption strong{font-weight:500;}.shot-board-add{flex-basis:110px;min-height:152px;border-color:#88888835;font-size:11px;}.shot-board-add:hover{background:var(--brand-soft);color:var(--brand);border-color:var(--brand);}
#shotImageEditor .shot-image-left{gap:12px;}#shotImageEditor .shot-image-surface{min-height:0;}
.shot-image-gallery{display:flex;flex:0 0 62px;gap:8px;overflow-x:auto;padding:2px 0 6px;scrollbar-width:thin;}.shot-image-gallery button{position:relative;flex:0 0 52px;width:52px;height:52px;padding:0;border:2px solid transparent;border-radius:7px;overflow:hidden;background:#88888809;cursor:pointer;}.shot-image-gallery button.selected{border-color:var(--brand);}.shot-image-gallery img{width:100%;height:100%;object-fit:cover;}.shot-image-gallery .shot-gallery-add{border:1px dashed #88888840;color:#929aa5;font-size:24px;}
#shotImageEditor #shotImageComposer{position:relative;padding:12px 0 0;gap:0;overflow:visible;border-radius:10px;background:#88888805;}#shotImageEditor #shotImagePrompt{box-sizing:border-box;width:100%;padding:0 14px 12px;font-size:13px;line-height:1.8;background:transparent;}
.shot-composer-footer{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;padding:10px;min-width:0;}.shot-composer-footer .shot-composer-model{flex:0 1 auto;max-width:none;padding:0;border:0;}.shot-composer-model select[hidden]{display:none!important;}.shot-model-trigger{display:flex;gap:4px;align-items:center;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:10px;padding:6px 2px;white-space:nowrap;cursor:pointer;}.shot-model-trigger:hover{background:#88888812;}
.shot-composer-settings{position:relative;flex:1;min-width:0;font-size:10px;}.shot-composer-settings>summary{list-style:none;cursor:pointer;padding:7px 3px;line-height:1.4;}.shot-composer-settings>summary::-webkit-details-marker{display:none;}.shot-composer-settings-panel{position:absolute;bottom:calc(100% + 9px);right:0;z-index:20;box-sizing:border-box;width:240px;padding:12px;background:#fff;border:1px solid #88888826;border-radius:8px;box-shadow:0 8px 25px #0002;}.shot-composer-settings-panel>label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 0;font-size:11px;}.shot-composer-settings-panel select,.shot-composer-settings-panel input{box-sizing:border-box;width:130px;min-width:0;border:1px solid #88888830;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:12px;padding:5px;}
#shotImageEditor .entity-composer-actions{display:flex;flex:none;gap:7px;}#shotImageEditor .entity-composer-actions button{display:flex;align-items:center;justify-content:center;width:30px;height:32px;padding:6px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer;}#shotImageEditor .entity-composer-actions button.btn-primary{background:var(--brand);color:white;}#shotImageEditor .entity-composer-actions button:disabled{opacity:.4;}#shotImageEditor .entity-composer-actions svg{width:18px;height:18px;}
html.dark-mode .shot-composer-settings-panel{background:#2c2c2c;}@media(max-width:650px){#shotImageEditor .shot-image-left{height:270px;}#shotImageEditor #shotImagePrompt{font-size:16px;}.shot-board-card{flex-basis:240px;}.shot-board-add{min-height:135px;}}

#shotImageEditor #shotImageComposer.readonly .shot-composer-settings{opacity:.45;pointer-events:none;}

#shotReferenceStrip{position:relative;display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-height:42px;padding:0 12px 10px;flex-shrink:0;}
#shotReferenceStrip .shot-reference-thumb{position:relative;width:42px;height:42px;border-radius:7px;overflow:hidden;}
#shotReferenceStrip .shot-reference-thumb img{width:100%;height:100%;object-fit:cover;}
#shotReferenceStrip .shot-reference-thumb>button{position:absolute;top:1px;right:1px;padding:0;width:15px;height:15px;line-height:14px;border:0;border-radius:50%;background:#25293399;color:white;font-size:13px;cursor:pointer;visibility:hidden;}
#shotReferenceStrip .shot-reference-thumb:hover>button{visibility:visible;}
#shotReferenceStrip .shot-reference-add{width:42px;height:42px;padding:0;border:1px solid #88888840;border-radius:7px;background:transparent;color:#929aa5;font-size:25px;font-weight:300;cursor:pointer;}
#shotReferenceStrip .shot-reference-add:disabled{opacity:.4;cursor:default;}
#shotReferenceStrip .shot-reference-menu{position:absolute;top:44px;left:12px;z-index:100;padding:5px;width:135px;border:1px solid #88888830;border-radius:7px;background:#fff;box-shadow:0 6px 18px #0002;}
#shotReferenceStrip .shot-reference-menu[hidden]{display:none!important;}
#shotReferenceStrip .shot-reference-menu button{display:block;width:100%;padding:8px;border:0;border-radius:4px;text-align:left;font:inherit;font-size:11px;background:transparent;color:#677384;cursor:pointer;}
#shotReferenceStrip .shot-reference-menu button:hover{background:#88888812;}
#shotImageEditor .shot-settings-control{flex:1;padding:0;border:0;background:transparent;}
#shotImageEditor .shot-settings-control>select[hidden]{display:none!important;}
#shotImageEditor .shot-settings-control>.image-options-trigger{display:flex;min-height:32px;padding:5px 2px;width:100%;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:10px;cursor:pointer;white-space:nowrap;}
#shotImageEditor .shot-settings-control>.image-options-trigger:hover{background:#88888812;}
#shotImageEditor .shot-settings-control>.image-options-trigger .image-ratio-icon{flex:none;max-width:16px;max-height:14px;}
#shotImageEditor .shot-empty-upload{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;cursor:pointer;font-size:12px;}
#shotImageEditor .shot-empty-upload>b{font-size:30px;font-weight:300;}#shotImageEditor .shot-empty-upload small{font-size:10px;opacity:.65;}
html.dark-mode #shotReferenceStrip .shot-reference-menu{background:#2c2c2c;}
html.dark-mode #shotReferenceStrip .shot-reference-menu button{color:#b5bdc9;}
@media(hover:none){#shotReferenceStrip .shot-reference-thumb>button{visibility:visible;}}

/* Compact scene bars with AI immediately following the scene heading. */
.shot-board-heading{justify-content:flex-start;gap:10px;padding:6px 10px;margin-bottom:12px;border:0;border-radius:4px;background:#f4f5f7;}
.shot-board-heading>button:first-child{flex:0 1 auto;min-width:0;max-width:calc(100% - 45px);min-height:24px;gap:7px;color:#687384;font-size:11px;}
.shot-board-heading .no-i18n{max-width:none;color:#929aa6;}
.shot-board-heading>.shot-scene-ai{flex:none;padding:3px 6px;font-size:10px;border-color:#88888825;}
html.dark-mode .shot-board-heading{background:#2b2b2b;}
html.dark-mode .shot-board-heading>button:first-child{color:#b2bac7;}
#shotImageEditor .shot-settings-control{flex:0 1 auto;min-width:0;}
#shotImageEditor .shot-settings-control>.image-options-trigger{width:auto;gap:5px;align-items:center;justify-content:flex-start;}
#shotImageEditor .shot-settings-control .entity-control-chevron{display:block;flex:0 0 12px;width:12px;height:12px;margin:0;align-self:center;}
#shotImageEditor .shot-composer-footer .entity-composer-actions{margin-left:auto;}

/* Collapsed scene groups keep only their compact heading. */
#shotTableWrap .shot-board-strip[hidden]{display:none!important;height:0;min-height:0;margin:0;padding:0;}
#shotTableWrap .shot-board-section:has(.shot-board-strip[hidden]){margin-bottom:4px;}
#shotTableWrap .shot-board-section:has(.shot-board-strip[hidden])>.shot-board-heading{margin-bottom:0;}
/* Match the model and settings buttons to the shared image-generation toolbar. */
#shotImageEditor .shot-composer-footer{display:flex;align-items:center;flex-wrap:nowrap;gap:4px;min-height:48px;padding:8px 6px;box-sizing:border-box;}
#shotImageEditor .shot-composer-model{display:flex;align-items:center;flex:0 0 auto;}
#shotImageEditor .shot-model-trigger,#shotImageEditor .shot-settings-control>.image-options-trigger{display:inline-flex;align-items:center;justify-content:flex-start;gap:4px;height:32px;min-height:32px;max-height:32px;margin:0;padding:6px 3px;border:0;box-sizing:border-box;font-size:10px;line-height:20px;vertical-align:middle;}
#shotImageEditor .shot-composer-footer .entity-control-chevron{display:block;flex:0 0 12px;width:12px;height:12px;margin:0;align-self:center;}
#shotImageEditor .shot-composer-footer .entity-composer-actions{display:flex;align-items:center;gap:8px;}
#shotImageEditor .shot-image-fields{padding:0;gap:10px;}
#shotImageEditor .shot-image-fields #shotImageStatus:empty{display:none!important;min-height:0;margin:0;padding:0;}
#shotImageEditor .shot-image-fields #shotImageStatus{min-height:0;line-height:1.4;}
#shotImageEditor .shot-image-dialog{padding-bottom:14px;}
.entity-reference-thumb,.shot-reference-thumb{cursor:zoom-in;}
.entity-reference-thumb:focus-visible,.shot-reference-thumb:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}

#shotImageEditor .shot-empty-upload{color:var(--brand);font-weight:500;}
#shotImageEditor .shot-empty-upload small{color:#929aa5;font-weight:400;}
html.dark-mode #shotImageEditor .shot-empty-upload{color:var(--brand-accent);}
#shotImageEditor .shot-composer-footer .entity-composer-actions{flex:0 0 auto;gap:7px;}
#shotImageEditor .entity-video-action:hover:not(:disabled){background:#88888814;}

/* Square storyboard frames; gallery remove controls sit outside the thumbnail clipping. */
#shotTableWrap .shot-board-heading,#shotTableWrap .shot-board-card,#shotTableWrap .shot-board-image,#shotTableWrap .shot-board-add{border-radius:0;}
#shotImageEditor .shot-image-surface,#shotImageEditor .shot-image-gallery button:not(.shot-gallery-remove),#shotImageEditor .shot-image-gallery img{border-radius:0;}
#shotImageEditor .shot-image-gallery{padding-top:6px;padding-right:6px;}
#shotImageEditor .shot-gallery-item{position:relative;flex:0 0 52px;width:52px;height:52px;overflow:visible;}
#shotImageEditor .shot-gallery-item>.shot-gallery-remove{position:absolute;top:-3px;right:-3px;z-index:3;display:flex;align-items:center;justify-content:center;width:16px;height:16px;min-height:0;padding:0;border:0;border-radius:50%;background:#343d4ca3;color:#fff;font-size:14px;line-height:1;visibility:hidden;opacity:0;cursor:pointer;}
#shotImageEditor .shot-gallery-item:hover>.shot-gallery-remove,#shotImageEditor .shot-gallery-item:focus-within>.shot-gallery-remove{visibility:visible;opacity:1;}
#shotImageEditor .shot-gallery-item>.shot-gallery-remove:hover{background:#a64d5bcc;}
@media(hover:none){#shotImageEditor .shot-gallery-item>.shot-gallery-remove{visibility:visible;opacity:1;}}

/* Allow horizontal thumbnail scrolling without creating a vertical scrollbar. */
#shotImageEditor .shot-image-gallery{box-sizing:border-box;flex:0 0 78px;height:78px;min-height:78px;max-height:78px;align-items:flex-start;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:6px 6px 14px 0;}
#shotImageEditor .shot-image-gallery>.shot-gallery-add{flex-shrink:0;}

/* Size the board to its content; collapsed scene bars have no hidden row spacing. */
#shotView #shotTableWrap{flex:0 0 auto;align-self:stretch;height:auto;min-height:0;border-radius:0;padding:0;overflow:visible;}
#shotTableWrap .shot-board-section{margin:0;padding:0;min-height:0;border-bottom:1px solid #88888818;}
#shotTableWrap .shot-board-section:last-child{border-bottom:0;}
#shotTableWrap .shot-board-section>.shot-board-heading{margin:0;padding:5px 10px;border-radius:0;}
#shotTableWrap .shot-board-section.is-collapsed{margin:0;padding:0;}
#shotTableWrap .shot-board-section.is-collapsed>.shot-board-heading{margin:0;}
#shotTableWrap .shot-board-section.is-collapsed>.shot-board-strip{display:none!important;height:0;min-height:0;margin:0;padding:0;}
#shotTableWrap .shot-board-strip{align-items:flex-start;margin:0;padding:8px 8px 6px;min-height:0;overflow-y:hidden;}
#shotTableWrap .shot-board-card{margin:0;padding:0;align-self:flex-start;height:auto;min-height:0;border-radius:0;}
#shotTableWrap .shot-board-caption{margin:0;padding:5px 2px 0;min-height:0;line-height:16px;}
#shotTableWrap .shot-board-image,#shotTableWrap .shot-board-add,#shotTableWrap .shot-board-image img{border-radius:0;}

/* Extend the storyboard to the editor edges and right-align each scene's AI action. */
#editorView #shotView{padding-left:0;padding-right:0;min-width:0;}
#shotView #shotTableWrap{box-sizing:border-box;width:100%;max-width:none;margin-left:0;margin-right:0;border-left:0;border-right:0;}
#shotTableWrap .shot-board-section{width:100%;box-sizing:border-box;}
#shotTableWrap .shot-board-strip{padding-left:0;padding-right:0;gap:0;}
#shotTableWrap .shot-board-heading{justify-content:space-between;width:100%;box-sizing:border-box;}
#shotTableWrap .shot-board-heading>button:first-child{flex:1 1 auto;max-width:none;min-width:0;}
#shotTableWrap .shot-board-heading .no-i18n{min-width:0;}
#shotTableWrap .shot-board-heading>.shot-scene-ai{flex:0 0 auto;margin-left:auto;}
#shotView>.storyboard-toolbar{padding-left:10px;padding-right:10px;box-sizing:border-box;}

/* Shared, unobtrusive scrollbars across light and dark surfaces. */
:root{--app-scroll-thumb:rgba(112,120,132,.32);--app-scroll-thumb-hover:rgba(112,120,132,.52);}
html.dark-mode{--app-scroll-thumb:rgba(180,187,198,.28);--app-scroll-thumb-hover:rgba(180,187,198,.46);}
html,body,body *{scrollbar-width:thin;scrollbar-color:var(--app-scroll-thumb) transparent!important;}
html::-webkit-scrollbar,body::-webkit-scrollbar,body *::-webkit-scrollbar{width:4px!important;height:4px!important;background:transparent!important;border:0!important;box-shadow:none!important;}
html::-webkit-scrollbar-track,body::-webkit-scrollbar-track,body *::-webkit-scrollbar-track,
html::-webkit-scrollbar-track-piece,body::-webkit-scrollbar-track-piece,body *::-webkit-scrollbar-track-piece,
html::-webkit-scrollbar-corner,body::-webkit-scrollbar-corner,body *::-webkit-scrollbar-corner{background:transparent!important;border:0!important;box-shadow:none!important;}
html::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb,body *::-webkit-scrollbar-thumb{background:var(--app-scroll-thumb)!important;border:0!important;border-radius:8px!important;box-shadow:none!important;}
html::-webkit-scrollbar-thumb:hover,body::-webkit-scrollbar-thumb:hover,body *::-webkit-scrollbar-thumb:hover{background:var(--app-scroll-thumb-hover)!important;}
html::-webkit-scrollbar-button,body::-webkit-scrollbar-button,body *::-webkit-scrollbar-button{display:none!important;width:0!important;height:0!important;background:transparent!important;border:0!important;}

/* Match entity thumbnails; keep populated main image frames borderless. */
#shotImageEditor .shot-image-gallery button:not(.shot-gallery-remove){border-radius:6px;}
#shotImageEditor .shot-image-gallery img{border-radius:3px;}
#shotImageEditor .shot-image-surface:has(>.entity-image-shell),
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame>.entity-form-image-preview:has(>.entity-image-shell){border-color:transparent!important;box-shadow:none!important;outline:none!important;}

/* Scene headers form one uninterrupted list, including collapsed sections. */
#shotView #shotTableWrap{display:block;gap:0;}
#shotTableWrap>.shot-board-section,
#shotTableWrap>.shot-board-section:has(.shot-board-strip[hidden]){display:block;margin:0!important;padding:0!important;min-height:0;border:0;}
#shotTableWrap>.shot-board-section>.shot-board-heading{height:48px;min-height:48px;margin:0!important;padding:0 16px;border:0;border-bottom:1px solid #88888824;background:#f7f8f8;}
#shotTableWrap .shot-board-heading>button:first-child{height:100%;margin:0;padding:0;gap:8px;font-size:14px;color:#242a2d;}
#shotTableWrap .shot-board-heading b{flex:none;font-weight:500;}
#shotTableWrap .shot-board-heading .no-i18n{flex:0 1 auto;color:inherit;font-weight:500;}
#shotTableWrap .shot-scene-count{flex:none;color:#78817e;font-size:13px;}
#shotTableWrap .shot-scene-chevron{flex:0 0 18px;width:18px;height:18px;margin-right:5px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
#shotTableWrap [aria-expanded="true"] .shot-scene-chevron{transform:rotate(90deg);}
#shotTableWrap>.shot-board-section.is-collapsed>.shot-board-strip{display:none!important;margin:0!important;padding:0!important;height:0!important;}
html.dark-mode #shotTableWrap .shot-board-section>.shot-board-heading{background:#232323;border-bottom-color:#ffffff12;}
html.dark-mode #shotTableWrap .shot-board-heading>button:first-child{color:#e0e4e7;}
html.dark-mode #shotTableWrap .shot-scene-count{color:#959e9c;}

/* Keep the original scene labels in a smaller continuous header row. */
#shotTableWrap>.shot-board-section>.shot-board-heading{height:36px;min-height:36px;padding:0 10px;}
#shotTableWrap .shot-board-heading>button:first-child{font-size:12px;gap:6px;}
#shotTableWrap .shot-scene-chevron{flex-basis:14px;width:14px;height:14px;margin-right:2px;}

/* Compact project title row without changing its controls or fixed positioning. */
#editorView .editor-header{align-items:center;margin-bottom:8px;padding-top:0;padding-bottom:0;min-height:32px;}
#editorView .editor-title-input{box-sizing:border-box;height:30px;padding-top:0;padding-bottom:0;font-size:20px;line-height:30px;}
#editorView .editor-header>.btn{box-sizing:border-box;height:30px;min-height:30px;padding-top:0;padding-bottom:0;line-height:28px;}
@media(max-width:820px){
 .app.editor-active #editorView .editor-header{padding:4px 10px;min-height:40px;margin:0;}
 .app.editor-active #editorView .editor-title-input{height:30px;font-size:16px;line-height:30px;}
 .app.editor-active #editorView .mobile-editor-menu-toggle{box-sizing:border-box;height:30px;min-height:30px;padding-top:0;padding-bottom:0;}
}

/* Light gray workspace around the screenplay paper. */
@media screen{
 html:not(.dark-mode) #editorView .screenplay-scroll{background:#fafafa;}
}

/* The paper surround shares the footer gray; editor panels reach the bottom edge. */
#editorView{--editor-surround:#fafafa;}
html.dark-mode #editorView{--editor-surround:#141414;}
#editorView .screenplay-scroll,#editorView .screenplay-hint-row{background:var(--editor-surround);}
.app.editor-active>.content{padding-bottom:0;}
#editorView>.editor-layout{margin-bottom:0;padding-bottom:0;}
#editorView .editor-main,#editorView .editor-layout>.side-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:0;}
#editorView .screenplay-hint-row{border-bottom-left-radius:0;border-bottom-right-radius:0;}

/* Define the sidebar boundary in light mode without affecting its collapsed handle. */
html:not(.dark-mode) #editorView .editor-layout:not(.side-collapsed)>.side-panel{box-sizing:border-box;border:1px solid #e5e7eb;}

/* Keep AI beside the view selector and minimize the editor's outer margins. */
#editorView #projectAIButton{position:static;display:inline-flex;flex-direction:row;width:auto;height:30px;min-height:30px;padding:4px 10px;border-radius:6px;box-sizing:border-box;}
#editorView #projectAIButton .project-ai-spark{width:15px;height:15px;}
#editorView #projectAIButton.has-text-selection{background:linear-gradient(110deg,#e6d7fb,#cceafa,#d5f0df,#e6d7fb);background-size:250% 100%;animation:entity-image-rainbow 6s linear infinite;color:#51408d;}
html.dark-mode #editorView #projectAIButton.has-text-selection{color:#f3edff;background:linear-gradient(110deg,#4c4c4c,#4f4f4f,#555555,#4c4c4c);background-size:250% 100%;}
@media(min-width:821px){
 .app.editor-active>.content{padding:6px 8px 0;}
 #editorView .editor-header{margin-bottom:6px;}
 #editorView .editor-layout{gap:8px;}
}
@media(max-width:820px){
 .app.editor-active #editorView .editor-header{padding-left:6px;padding-right:6px;}
 #editorView .editor-actions-menu #projectAIButton{align-self:flex-start;}
}

/* Join both editor columns edge to edge, retaining the sidebar divider. */
.app.editor-active>.content{padding-left:0;padding-right:0;}
#editorView .editor-layout,#editorView .editor-layout:not(.side-collapsed){gap:0;margin-left:0;margin-right:0;}
#editorView .editor-main,#editorView .editor-layout>.side-panel{border-radius:0;}
@media(min-width:821px){
 #editorView .editor-header{padding-left:8px;padding-right:8px;}
 #editorView .editor-layout:not(.side-collapsed)>.editor-main{border-right:0;}
}

/* Use matching one-pixel outlines for both editor columns. */
html:not(.dark-mode) #editorView .editor-main,
html:not(.dark-mode) #editorView .editor-layout:not(.side-collapsed)>.side-panel{box-sizing:border-box;border:1px solid #e5e7eb;}
html.dark-mode #editorView .editor-main,
html.dark-mode #editorView .editor-layout:not(.side-collapsed)>.side-panel{box-sizing:border-box;border:1px solid #282828;}
@media(min-width:821px){
 html:not(.dark-mode) #editorView .editor-layout:not(.side-collapsed)>.editor-main,
 html.dark-mode #editorView .editor-layout:not(.side-collapsed)>.editor-main{border-right:0;}
}
.app.editor-focus-mode #editorView .editor-main{border:0;}

/* Align the format/style toolbar with the selected paper width and page zoom. */
#editorView .screenplay-toolbar{box-sizing:border-box;width:calc(var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1));max-width:100%;align-self:center;margin-left:auto;margin-right:auto;}
@media(max-width:820px){
 .app.editor-active #editorView .screenplay-toolbar{width:100%;max-width:100%;}
}

@media(min-width:821px){
 .app.editor-focus-mode #editorView .screenplay-toolbar{width:calc(var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1))!important;max-width:100%;}
}

/* Separate the paper-width toolbar from the surrounding workspace. */
#editorView .screenplay-toolbar{border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;}
html.dark-mode #editorView .screenplay-toolbar{border-left-color:#282828;border-right-color:#282828;}

/* Match both outer sides of the paper-width toolbar to the paper surround. */
#editorView .editor-main{background:var(--editor-surround,#fafafa);}


/* The toolbar and paper share the same scrollport and centering rules. */
#editorView .screenplay-toolbar-shell{position:sticky;top:0;z-index:10;box-sizing:border-box;width:calc(var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1));margin:0 auto;flex:none;}
#editorView .screenplay-toolbar-shell>.screenplay-toolbar,
.app.editor-focus-mode #editorView .screenplay-toolbar-shell>.screenplay-toolbar{position:static!important;box-sizing:border-box;width:100%!important;max-width:none;margin:0;transform:none;border-radius:0;border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;}
html.dark-mode #editorView .screenplay-toolbar-shell>.screenplay-toolbar{border-left-color:#282828;border-right-color:#282828;}
#editorView.hide-text-format-toolbar .screenplay-toolbar-shell{display:none;}
#editorSettingsMenu{max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain;}
#editorFormatSettings .format-toggle-group{display:flex;align-items:center;flex-wrap:wrap;gap:8px;}
#editorFormatSettings .format-toggle{display:inline-flex;flex-wrap:wrap;gap:3px;}
#editorFormatSettings .format-toggle button{font-size:12px;padding:5px 8px;}
@media(max-width:820px){
 .app.editor-active:not(.editor-focus-mode) .editor-main{padding-top:var(--mobile-outline-stack,170px);}
 #editorView .screenplay-toolbar{flex-wrap:nowrap;overflow-x:auto;}
}

/* One shared frame defines both edges; neither child centers independently. */
#editorView .screenplay-paper-stack{box-sizing:border-box;width:calc(var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1));margin:0 auto;padding:0;border:0;}
#editorView .screenplay-paper-stack>.screenplay-toolbar-shell{width:100%;margin:0;}
#editorView .screenplay-paper-stack>#screenplayPage{margin-left:0;margin-right:0;}
#editorView .screenplay-paper-stack>.screenplay-toolbar-shell>.screenplay-toolbar{width:100%!important;max-width:none;margin-left:0;margin-right:0;}

/* Remove the style toolbar's side borders. */
#editorView .screenplay-paper-stack>.screenplay-toolbar-shell>.screenplay-toolbar,
.app.editor-focus-mode #editorView .screenplay-paper-stack>.screenplay-toolbar-shell>.screenplay-toolbar{border-left:0;border-right:0;}

/* Keep format-specific controls beside their format selector. */
#editorSettingsMenu,#editorSettingsMenu.chinese-settings-visible{width:320px;padding:14px;}
#editorFormatSettings>#chineseFormatSettings{margin-top:12px;padding-top:10px;border-top:1px solid #e5e7eb;}
#editorFormatSettings>#chineseFormatSettings[hidden]{display:none!important;}
#editorSettingsMenu .editor-common-settings{margin-top:14px;padding-top:14px;border-top:1px solid #e5e7eb;}
#editorSettingsMenu .editor-common-settings>.editor-setting-section+.editor-setting-section{margin-top:14px;}
html.dark-mode #editorFormatSettings>#chineseFormatSettings,html.dark-mode #editorSettingsMenu .editor-common-settings{border-top-color:#363636;}

/* Place the width grip after the center scrollbar, inside the sidebar edge. */
@media(min-width:821px){
 #editorView .side-width-handle{right:calc(var(--side-pane-width,280px) - 8px);width:8px;}
 #editorView .side-width-handle::after{left:0;width:1px;border-radius:0;}
}


/* A restrained typographic label for the outline header. */
#editorView .outline-nav-title{font-size:12px;font-weight:600;line-height:20px;letter-spacing:0;text-transform:none;color:#4b5563;gap:0;}
#editorView .outline-nav-title::before{content:none;}
html.dark-mode #editorView .outline-nav-title{color:#b9c0ca;}


/* Extra slim horizontal outline scrollbar. */
#editorView .outline-scroll{scrollbar-width:thin;}
#editorView .outline-scroll::-webkit-scrollbar,
#editorView .outline-scroll::-webkit-scrollbar:horizontal{height:3px!important;}
#editorView .outline-scroll::-webkit-scrollbar-thumb:horizontal{border:0!important;border-radius:3px!important;background:var(--app-scroll-thumb)!important;}
#editorView .outline-scroll::-webkit-scrollbar-thumb:horizontal:hover{background:var(--app-scroll-thumb-hover)!important;}
#editorView .outline-footer{height:2px;min-height:2px;margin:0;padding:0;}
#editorView .outline-scroll::-webkit-scrollbar:horizontal{height:2px!important;}

/* A shorter outline title row; each view focuses on its own content. */
#editorView .outline-nav-header{box-sizing:border-box;height:28px;min-height:28px;padding:2px 10px;}
#editorView .outline-nav.collapsed-outline{height:28px!important;}
#editorView .outline-nav-right{gap:6px;}
#editorView .outline-nav-header .btn-add-track{padding:2px 8px;line-height:18px;}
.app.editor-focus-mode #editorView #outlineNav{display:none!important;}
.app.editor-focus-mode #editorView.hide-text-format-toolbar .screenplay-toolbar-shell{display:none!important;}
.app.editor-focus-mode #editorView #canvasView.active,
.app.editor-focus-mode #editorView #shotView.active{flex:1 1 0;min-height:0;max-height:none;overflow:auto;}
.app.editor-focus-mode #editorView.hide-text-format-toolbar .screenplay-hint,
.app.editor-focus-mode #editorView.hide-text-format-toolbar .editor-settings-button{display:none!important;}


/* Outline actions match the compact focus icon button. */
#editorView .outline-nav-header .outline-header-action,#editorView .outline-icon-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 22px;width:22px;height:22px;min-height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:#6b7280;cursor:pointer;}
#editorView .outline-nav-header .outline-header-action svg{width:16px;height:16px;}
#editorView .outline-nav-header .outline-header-action:hover,#editorView .outline-icon-button:hover,#editorView .outline-cards-button.active{background:var(--brand-soft);color:var(--brand);}
#editorView .outline-action-divider{height:14px;width:1px;margin:0 3px;background:#dfe3e8;flex:none;}
html.dark-mode #editorView .outline-nav-header .outline-header-action,html.dark-mode #editorView .outline-icon-button{color:#9ca3af;}
html.dark-mode #editorView .outline-nav-header .outline-header-action:hover,html.dark-mode #editorView .outline-icon-button:hover,html.dark-mode #editorView .outline-cards-button.active{background:#242424;color:var(--brand-accent);}
html.dark-mode #editorView .outline-action-divider{background:#383838;}
#editorView .outline-nav.collapsed-outline .btn-add-track,#editorView .outline-nav.collapsed-outline .outline-zoom-button,#editorView .outline-nav.collapsed-outline .outline-action-divider{display:none;}


/* Balance the two outline actions with the adjacent focus control. */
#editorView .outline-nav-right{gap:5px;}
#editorView .outline-nav-header .outline-header-action{width:22px;height:22px;flex-basis:22px;color:#6b7280;}
#editorView .outline-nav-header .outline-header-action svg{display:block;width:17px;height:17px;}
#editorView .outline-nav-header .outline-cards-button.active{color:var(--brand);}
html.dark-mode #editorView .outline-nav-header .outline-header-action{color:#9ca3af;}
html.dark-mode #editorView .outline-nav-header .outline-cards-button.active{color:var(--brand-accent);}

/* Space storyboard images and keep footer tools in a collision-free row. */
#shotTableWrap .shot-board-strip{gap:10px;}
#editorView .screenplay-hint-row{justify-content:flex-start;gap:12px;}
#editorView .screenplay-hint-row>.editor-settings-button{position:static;transform:none;order:0;flex:none;}
#editorView .screenplay-hint-row>.screenplay-hint{order:1;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView .screenplay-hint-row>.zoom-widget{position:static;transform:none;flex:none;}
#editorView .screenplay-hint-row>.editor-bottom-actions{position:static;transform:none;order:3;margin-left:auto;flex:none;gap:12px;}
#editorView .editor-bottom-tool{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:5px 0;border:0;background:transparent;color:#788392;font:inherit;font-size:11px;line-height:16px;white-space:nowrap;cursor:pointer;}
#editorView .editor-bottom-tool:hover,#editorView .editor-bottom-tool.active{color:var(--brand);}
html.dark-mode #editorView .editor-bottom-tool{color:#a7aeba;}
html.dark-mode #editorView .editor-bottom-tool:hover{color:var(--brand-accent);}
@media(max-width:820px){#editorView .screenplay-hint-row{gap:8px;}#editorView .screenplay-hint-row>.editor-bottom-actions{gap:10px;}}

/* Proofreading and analysis sit beside editor settings. */
#editorView .screenplay-hint-row>.editor-left-tools{display:flex;align-items:center;order:0;flex:none;gap:12px;}
#editorView .editor-left-tools .editor-bottom-tool{gap:4px;}
#editorView .editor-left-tools svg{display:block;flex:none;}
@media(max-width:820px){#editorView .screenplay-hint-row>.editor-left-tools{gap:10px;}}


/* Continuous writing removes page separators and their reserved page gaps. */
#editorView.continuous-writing #screenplayPage>.page-break{display:none!important;}
.app.editor-active #editorView .screenplay-hint-row>.screenplay-hint.has-status{display:block!important;color:#788392;}
.app.editor-active #editorView .screenplay-hint-row>.screenplay-hint.status-error{color:#c85a5a;}
html.dark-mode .app.editor-active #editorView .screenplay-hint-row>.screenplay-hint.has-status{color:#a7aeba;}
html.dark-mode .app.editor-active #editorView .screenplay-hint-row>.screenplay-hint.status-error{color:#ee8b8b;}

/* Footer controls retain their alignment when shortcut text is hidden. */
#editorView .screenplay-hint-row>.zoom-widget{margin-left:auto;}
#editorView .screenplay-hint-row>.editor-bottom-actions{margin-left:0;}
#editorView .screenplay-hint-row:has(>.zoom-widget[hidden])>.editor-bottom-actions{margin-left:auto;}
@media(max-width:820px){#editorView .screenplay-hint-row>.editor-bottom-actions{margin-left:auto;}}
.app.editor-focus-mode #editorView .screenplay-hint-row>.editor-bottom-actions{margin-left:auto;}

/* One full-height sidebar section at a time: details or assets. */
#editorView .side-primary-tabs{flex:none;gap:4px;padding:8px 10px;border-bottom:1px solid #e5e7eb;}
#editorView .side-primary-tab{flex:1;height:28px;padding:4px 10px;border:0;border-radius:5px;background:transparent;color:#88919e;font:inherit;font-size:12px;font-weight:500;cursor:pointer;}
#editorView .side-primary-tab.active{background:var(--brand-soft);color:var(--brand);}
#editorView .side-panel>.side-section{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden;}
#editorView .side-panel>.side-section[hidden]{display:none!important;}
#editorView .side-assets>#sideList{flex:1 1 0;min-height:0;overflow-y:auto;}
#editorView .side-section>.panel-tabs{flex:none;}
#editorView .project-notes .project-note-input{flex:1 1 0;min-height:0;resize:none;}
#editorView .editor-layout.side-collapsed .side-panel>.side-section{display:none!important;}
html.dark-mode #editorView .side-primary-tabs{border-bottom-color:#282828;}
html.dark-mode #editorView .side-primary-tab{color:#a0a7b2;}
html.dark-mode #editorView .side-primary-tab.active{color:var(--brand-accent);background:#242424;}
@media(max-width:820px){
 #editorView .editor-actions-menu .side-panel>.side-section{flex:0 0 auto;min-height:240px;max-height:55dvh;}
 #editorView .editor-actions-menu .project-notes .project-note-input{min-height:180px;}
 #editorView .editor-actions-menu .side-assets>#sideList{max-height:300px;overflow:auto;}
}

/* Compact footer with context-sensitive hints and document statistics. */
#editorView .screenplay-hint-row,.app.editor-focus-mode #editorView .screenplay-hint-row{box-sizing:border-box;min-height:28px;height:28px;padding:0 10px;gap:10px;}
#editorView .screenplay-hint-row button{min-height:22px;padding-top:3px;padding-bottom:3px;}
.app.editor-active #editorView .screenplay-hint-row>#screenplayHint{display:block!important;line-height:18px;}
@media(max-width:820px){
 #editorView .screenplay-hint-row,.app.editor-focus-mode #editorView .screenplay-hint-row{height:calc(28px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);gap:8px;}
}

/* Project actions follow the outline-card control in the outline toolbar. */
#editorView .outline-nav-header>.outline-nav-right{min-width:0;gap:5px;}
#editorView .outline-nav-header .editor-actions-wrap{position:relative;flex:none;min-width:0;margin-left:5px;}
@media(min-width:821px){
 #editorView .outline-nav-header .editor-actions-menu{display:flex;flex-wrap:nowrap;white-space:nowrap;gap:6px!important;}
 #editorView .outline-nav-header .view-tabs{box-sizing:border-box;height:24px;padding:2px;border-radius:5px;}
 #editorView .outline-nav-header .view-tabs button{height:20px;padding:0 8px;border-radius:3px;font-size:11px;}
 #editorView .outline-nav-header #projectAIButton{height:24px;min-height:24px;padding:2px 7px;font-size:11px;}
 #editorView .outline-nav-header .export-btn{height:24px;padding:0 8px;font-size:11px;}
 #editorView .outline-nav-header .view-tabs-label{font-size:11px;}
 #editorView .editor-header .editor-title-input{flex:1;}
}
@media(max-width:820px){
 .app.editor-active #editorView .editor-header{grid-template-columns:auto minmax(0,1fr);}
 #editorView .outline-nav-header .mobile-editor-menu-toggle{min-height:22px;height:22px;padding:2px 6px;border-radius:5px;font-size:11px;}
 #editorView .outline-nav-header .editor-actions-wrap{margin-left:2px;}
}

/* Project identity and outline tools share one compact header. */
#editorView .outline-nav-header{height:32px;min-height:32px;gap:5px;}
#editorView .outline-return-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:22px;padding:0;border:0;border-radius:5px;background:transparent;color:#788392;cursor:pointer;}
#editorView .outline-return-button:hover{background:var(--brand-soft);color:var(--brand);}
#editorView .outline-nav-header .editor-title-input{box-sizing:border-box;flex:1 1 140px;width:0;min-width:60px;max-width:200px;height:24px;padding:0 4px;font-size:14px;line-height:24px;text-overflow:ellipsis;}
#editorView .outline-nav-title{margin-left:8px;}
#editorView .outline-nav-header .export-btn{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:24px;min-height:24px;padding:0;border:0;border-radius:5px;background:transparent;color:#788392;}
#editorView .outline-nav-header .export-btn:hover{background:var(--brand-soft);color:var(--brand);}
#editorView .outline-nav.collapsed-outline{height:32px!important;}
html.dark-mode #editorView .outline-return-button,html.dark-mode #editorView .outline-nav-header .export-btn{color:#a7aeba;}
@media(max-width:820px){
 .app.editor-active{--mobile-editor-header-stack:0px;}
 #editorView .outline-nav-header .editor-title-input{flex:1 1 0;min-width:32px;max-width:none;padding:0;font-size:16px;}
 #editorView .outline-nav-title{margin-left:2px;}
 #editorView .outline-nav-header{gap:3px;padding-left:5px;padding-right:5px;}
}

/* Center style actions; keep track creation beside a dedicated scroll strip. */
#editorView .screenplay-toolbar-shell>.screenplay-toolbar{justify-content:center;}
#editorView .outline-visibility-switch{position:relative;flex:0 0 26px;width:26px;height:14px;padding:0;border:0;border-radius:20px;background:var(--brand);}
#editorView .outline-visibility-switch .outline-switch-knob{position:absolute;left:14px;top:2px;width:10px;height:10px;border-radius:50%;background:#fff;transition:left .15s;}
#editorView .outline-visibility-switch[aria-checked="false"]{background:#b9bfc8;}
#editorView .outline-visibility-switch[aria-checked="false"] .outline-switch-knob{left:2px;}
#editorView .outline-nav>.outline-scroll{scrollbar-width:none;}
#editorView .outline-nav>.outline-scroll::-webkit-scrollbar{display:none!important;}
#editorView .outline-scrollbar-row{display:flex;align-items:center;flex:0 0 22px;height:22px;background:#fafafa;border-top:1px solid #e5e7eb;box-sizing:border-box;}
#editorView .outline-scrollbar-label{display:flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 var(--outline-label-w,100px);height:100%;border-right:1px solid #e5e7eb;}
#editorView .outline-scrollbar-label .btn-add-track{display:flex;align-items:center;justify-content:center;width:22px;height:20px;padding:0;border:0;background:transparent;color:#6b7280;}
#editorView .outline-scrollbar-label .btn-add-track:hover{color:var(--brand);background:var(--brand-soft);}
#editorView .outline-scrollbar-proxy{flex:1;min-width:0;height:6px;overflow-x:scroll;overflow-y:hidden;scrollbar-width:thin;}
#editorView .outline-scrollbar-proxy::-webkit-scrollbar{height:3px!important;}
#outlineScrollbarContent{height:1px;}
#editorView .outline-nav.collapsed-outline>.outline-scrollbar-row{display:none;}
html.dark-mode #editorView .outline-scrollbar-row{background:#141414;border-top-color:#282828;}
html.dark-mode #editorView .outline-scrollbar-label{border-right-color:#282828;}
html.dark-mode #editorView .outline-scrollbar-label .btn-add-track{color:#a7aeba;}

/* Flush top edge and a full-height scrollbar with fixed zoom controls. */
.app.editor-active>.content{padding-top:0;}
.app.editor-active #editorView{padding-top:0;margin-top:0;}
#editorView .outline-scrollbar-proxy{height:14px;scrollbar-width:auto;}
#editorView .outline-scrollbar-proxy::-webkit-scrollbar,
#editorView .outline-scrollbar-proxy::-webkit-scrollbar:horizontal{height:14px!important;}
#editorView .outline-scrollbar-proxy::-webkit-scrollbar-thumb{border:3px solid transparent!important;background-clip:padding-box!important;border-radius:10px!important;}
#editorView .outline-bottom-zoom{display:flex;align-items:center;justify-content:flex-end;gap:2px;flex:0 0 auto;height:100%;padding:0 4px;border-left:1px solid #e5e7eb;}
#editorView .outline-bottom-zoom .outline-icon-button,#editorView .outline-bottom-zoom .btn-focus-outline{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:20px;min-height:20px;padding:0;}
html.dark-mode #editorView .outline-bottom-zoom{border-left-color:#282828;}

/* Give track creation a wider horizontal silhouette. */
#editorView .outline-scrollbar-label .btn-add-track{width:34px;}
#editorView .outline-scrollbar-label .btn-add-track svg{width:25px;height:16px;}

/* Fill the last pixel of the tracks and align creation with the time ruler. */
#editorView .outline-scroll{margin-bottom:0;padding-bottom:0;}
#editorView .outline-inner{padding-bottom:0;margin-bottom:0;}
#editorView .outline-scrollbar-row{margin-top:0;}
#editorView .ruler-spacer{display:flex;align-items:center;justify-content:center;}
#editorView .ruler-spacer>.btn-add-track{display:flex;align-items:center;justify-content:center;width:34px;height:18px;min-height:18px;padding:0;border:0;border-radius:4px;background:transparent;color:#6b7280;}
#editorView .ruler-spacer>.btn-add-track svg{width:25px;height:16px;}
#editorView .ruler-spacer>.btn-add-track:hover{background:var(--brand-soft);color:var(--brand);}
html.dark-mode #editorView .ruler-spacer>.btn-add-track{color:#a7aeba;}

/* Balanced header columns center view switching independently of action widths. */
#editorView .outline-nav-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:8px;}
#editorView .outline-header-identity{display:flex;align-items:center;gap:5px;}
#editorView .outline-header-identity .editor-title-input{min-width:28px;}
#editorView .outline-header-identity .outline-nav-title{flex:none;}
#editorView .outline-view-center{gap:6px;}
#editorView .outline-view-center .view-tabs{display:inline-flex;box-sizing:border-box;height:24px;padding:2px;border-radius:5px;}
#editorView .outline-view-center .view-tabs button{height:20px;padding:0 8px;font-size:11px;border-radius:3px;}
#editorView .outline-nav-header>.outline-nav-right{justify-self:end;margin-left:0;}
#editorView .outline-bottom-zoom .outline-cards-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:22px;height:20px;padding:0;border:0;background:transparent;color:#6b7280;border-radius:4px;cursor:pointer;}
#editorView .outline-bottom-zoom .outline-cards-button svg{width:17px;height:17px;}
#editorView .outline-bottom-zoom .outline-cards-button:hover,#editorView .outline-bottom-zoom .outline-cards-button.active{background:var(--brand-soft);color:var(--brand);}
html.dark-mode #editorView .outline-bottom-zoom .outline-cards-button{color:#a7aeba;}
#editorView .ruler-spacer>#outlineAddTrackButton{width:100%;border-radius:0;}
#editorView .ruler-spacer>#outlineAddTrackButton svg{width:calc(100% - 12px);max-width:88px;height:18px;}
@media(max-width:1200px){#editorView .outline-view-center .view-tabs-label{display:none;}}
@media(max-width:820px){#editorView .outline-nav-header{gap:4px;}#editorView .outline-header-identity{gap:2px;}#editorView .outline-header-identity .outline-nav-title{margin-left:0;font-size:11px;}}

/* De-emphasize track creation's frame and group the outline switch at the right. */
#editorView .ruler-spacer>#outlineAddTrackButton:hover{background:transparent;}
#editorView .outline-nav-right>.outline-visibility-switch{margin-left:6px;flex-shrink:0;}

/* Center the project title independently of the right-hand controls. */
#editorView .outline-nav-header{position:relative;display:flex;gap:6px;}
#editorView .outline-header-identity{flex:0 0 22px;}
#editorView .outline-header-title{position:absolute;left:50%;transform:translateX(-50%);width:clamp(24px,calc(100% - 2 * var(--outline-actions-width,240px) - 32px),240px);min-width:0;}
#editorView .outline-header-title .editor-title-input{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:none;text-align:center;padding:0;font-size:14px;}
#editorView .outline-nav-header>.outline-nav-right{margin-left:auto;flex:none;}
#editorView .outline-nav-right>.outline-nav-title{margin-left:8px;}
#editorView .outline-nav-right>.outline-visibility-switch{margin-left:0;}
@media(max-width:820px){#editorView .outline-header-title .editor-title-input{font-size:16px;}#editorView .outline-nav-right>.outline-nav-title{margin-left:2px;}}

/* Return title to the left and dock document AI as a sidebar section. */
#editorView .outline-header-identity{flex:1 1 0;min-width:0;}
#editorView .outline-header-identity .editor-title-input{position:static;transform:none;flex:1 1 0;width:0;min-width:30px;max-width:240px;text-align:left;font-size:14px;}
#editorView .side-primary-tabs>#projectAIButton{position:static;display:block;flex:1 1 0;width:auto;height:28px;min-height:28px;padding:4px 10px;border:0;border-radius:5px;background:transparent;color:#88919e;font:inherit;font-size:12px;}
#editorView .side-primary-tabs>#projectAIButton.active{background:var(--brand-soft);color:var(--brand);}
#editorView .side-panel>#projectAIChat{position:static;inset:auto;z-index:auto;display:flex;flex:1 1 0;width:100%;height:auto;min-height:0;max-height:none;border:0;border-radius:0;box-shadow:none;background:transparent;}
#editorView #projectAIChat .ai-work-heading{padding:8px 10px;cursor:default;touch-action:auto;user-select:auto;}
#editorView #projectAIChat .ai-work-heading>span{display:none;}
#editorView #projectAIChat .ai-chat{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden;}
#editorView #projectAIChat .ai-chat-msgs{flex:1 1 0;min-height:0;max-height:none;overflow:auto;}
#editorView #projectAIChat .ai-chat-input,#editorView #projectAIChat .ai-chat-chips{flex:none;}
html.dark-mode #editorView .side-primary-tabs>#projectAIButton{color:#a0a7b2;}
html.dark-mode #editorView .side-primary-tabs>#projectAIButton.active{background:#242424;color:var(--brand-accent);}
@media(max-width:820px){
 #editorView .outline-header-identity .editor-title-input{font-size:16px;}
 #editorView .editor-actions-menu .side-panel>#projectAIChat{flex:0 0 auto;height:55dvh;max-height:55dvh;min-height:240px;}
}

/* Display controls affect only editor presentation, preserving all document data. */
#editorView .editor-display-control{display:flex;align-items:center;flex:none;margin-left:5px;}
#editorView .editor-display-button{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:5px;background:transparent;color:#788392;cursor:pointer;}
#editorView .editor-display-button:hover,#editorView .editor-display-button[aria-expanded="true"]{background:var(--brand-soft);color:var(--brand);}
.editor-display-menu{position:fixed;z-index:2400;width:188px;box-sizing:border-box;padding:8px;background:#fff;color:#4b5563;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 28px #00000018;}
.editor-display-menu[hidden]{display:none!important;}
.editor-display-heading{padding:4px 8px 8px;font-size:11px;color:#929aa6;}
.editor-display-menu label{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 8px;font-size:12px;border-radius:4px;cursor:pointer;}
.editor-display-menu label:hover{background:#f5f6f8;}
.editor-display-menu input{margin:0;accent-color:var(--brand);}
#editorView.hide-editor-notes #screenplayPage .script-block[data-type="note"]{display:none!important;}
#editorView #screenplayPage [data-proofreading-hint]{text-decoration-line:underline;text-decoration-style:dotted;text-decoration-color:#d9a75b;text-underline-offset:4px;}
html.dark-mode .editor-display-menu{background:#202020;color:#c0c6cf;border-color:#383838;}
html.dark-mode .editor-display-menu label:hover{background:#2a2a2a;}
html.dark-mode #editorView .editor-display-button{color:#a7aeba;}

/* Export is the last control in the project header. */
#editorView .outline-nav-right>.outline-export-control{position:relative;flex:none;margin-left:4px;}
#editorView .outline-export-control>.export-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-height:24px;padding:0;}

/* Center view switching; use only a plus to create tracks. */
#editorView .outline-view-center{position:absolute;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;}
#editorView .outline-header-identity{flex:0 1 calc(50% - 64px);max-width:calc(50% - 64px);}
#editorView .ruler-spacer>#outlineAddTrackButton{width:24px;height:20px;min-height:20px;}
#editorView .ruler-spacer>#outlineAddTrackButton svg{width:16px;height:16px;}

/* Compact, single-line style controls in all editor modes. */
#editorView .screenplay-toolbar-shell>.screenplay-toolbar{box-sizing:border-box;height:28px;min-height:28px;max-height:28px;padding:3px 8px;gap:4px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;}
#editorView .screenplay-toolbar-shell>.screenplay-toolbar::-webkit-scrollbar{display:none!important;}
#editorView .screenplay-toolbar button{box-sizing:border-box;flex-shrink:0;height:20px;min-height:20px;padding:2px 7px;line-height:16px;font-size:11px;border-radius:4px;}
#editorView .screenplay-toolbar .toolbar-section-label{line-height:20px;}
#editorView .screenplay-toolbar .style-extra-group{align-items:center;gap:4px;}

/* Track titles are the direct entry to that track's outline cards. */
#editorView .outline-track-label[role="button"]:hover{color:var(--brand);background:var(--brand-soft);}
#editorView .outline-track-label[role="button"]:focus-visible{outline:1px solid var(--brand);outline-offset:-2px;}

/* A direct exit replaces outline selection within the card view. */
#editorView .outline-cards-exit{display:inline-flex;align-items:center;justify-content:center;gap:5px;margin-left:auto;padding:4px 8px;border:0;border-radius:5px;background:transparent;color:#788392;font:inherit;font-size:12px;cursor:pointer;white-space:nowrap;}
#editorView .outline-cards-exit:hover{background:var(--brand-soft);color:var(--brand);}
html.dark-mode #editorView .outline-cards-exit{color:#a7aeba;}

/* One persistent sidebar toggle follows export in the project header. */
#editorView .side-panel-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;margin-left:3px;padding:0;border:0;border-radius:5px;background:transparent;color:#788392;cursor:pointer;}
#editorView .side-panel-toggle:hover{background:var(--brand-soft);}
html.dark-mode #editorView .side-panel-toggle{color:#a7aeba;}

/* Restore the original uncluttered sidebar icon and understated hover. */
#editorView .side-panel-toggle{width:22px;height:22px;flex-basis:22px;border-radius:6px;color:#9ca3af;}
#editorView .side-panel-toggle svg{width:16px;height:16px;}
#editorView .side-panel-toggle:hover{background:#f3f4f6;color:var(--brand);}
html.dark-mode #editorView .side-panel-toggle{color:#9a9a9a;}
html.dark-mode #editorView .side-panel-toggle:hover{background:#242424;color:var(--brand-accent);}

/* Match the dark style toolbar to the screenplay paper. */
html.dark-mode #editorView .screenplay-toolbar-shell>.screenplay-toolbar{background:#181818;}

/* Neutral track names and a quiet indicator for the open card track. */
html:not(.dark-mode) #editorView .outline-track-label,
html:not(.dark-mode) #editorView .outline-track-label[role="button"]:hover{color:#171717;}
#editorView #canvasView .canvas-title{color:inherit;font-weight:500;}

/* Refined track labels with a subtle card-entry cue. */
#editorView .outline-track-label{position:sticky;box-sizing:border-box;padding:0 20px 0 10px;font-size:12px;font-weight:500;letter-spacing:0;line-height:1.3;background:#f7f8fa;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
#editorView .outline-track-label>span{min-width:0;}
#editorView .outline-track-label[role="button"]::after{content:'›';position:absolute;right:7px;top:50%;transform:translateY(-50%);font-family:Arial,sans-serif;font-size:15px;font-weight:400;line-height:1;color:#929aa5;opacity:0;pointer-events:none;transition:opacity .12s;}
#editorView .outline-track-label[role="button"]:hover{background:#eef0f3;}
#editorView .outline-track-label[role="button"]:hover::after,#editorView .outline-track-label[role="button"]:focus-visible::after{opacity:1;}
#editorView .cards-active-track>.outline-track-label{background:var(--brand-soft);}
#editorView .cards-active-track>.outline-track-label::after{content:'‹';opacity:1;color:var(--brand);}
html.dark-mode #editorView .outline-track-label{background:#1a1a1a;color:#c7cbd2;}
html.dark-mode #editorView .outline-track-label[role="button"]:hover{background:#252525;}
html.dark-mode #editorView .cards-active-track>.outline-track-label{background:#2a2a2a;}
@media(prefers-reduced-motion:reduce){#editorView .outline-track-label::after{transition:none;}}

/* A floating outline frame, with distinct primary and secondary sidebar navigation. */
#editorView #outlineNav{box-sizing:border-box;margin:8px 10px 10px;border:1px solid #e1e5eb;border-radius:12px;background:#fff;box-shadow:0 3px 12px #25344d0a,0 1px 3px #25344d06;}
#editorView #outlineNav>.outline-nav-header{border-radius:11px 11px 0 0;}
#editorView #outlineNav.collapsed-outline>.outline-nav-header{border-radius:11px;}
#editorView #outlineNav>.outline-scrollbar-row{border-radius:0 0 11px 11px;}
#editorView #outlineNav>.outline-scrollbar-row>.outline-scrollbar-label{border-bottom-left-radius:11px;}
#editorView #outlineNav>.outline-footer{border-radius:0 0 11px 11px;}
html.dark-mode #editorView #outlineNav{background:#141414;border-color:#303238;box-shadow:0 3px 14px #0003;}
#editorView .side-panel>.side-primary-tabs{display:flex;align-items:center;gap:3px;margin:8px 10px 6px;padding:3px;border:0;border-radius:8px;background:#f0f2f5;}
#editorView .side-primary-tabs>.side-primary-tab,#editorView .side-primary-tabs>#projectAIButton{height:28px;min-height:28px;flex:1 1 0;padding:3px 8px;border:0;border-radius:6px;background:transparent;color:#89919e;font-size:12px;font-weight:500;line-height:22px;box-shadow:none;}
#editorView .side-primary-tabs>.side-primary-tab:hover,#editorView .side-primary-tabs>#projectAIButton:hover{color:#3d4857;background:#ffffff60;}
#editorView .side-primary-tabs>.side-primary-tab.active,#editorView .side-primary-tabs>#projectAIButton.active{background:#fff;color:#263344;box-shadow:0 1px 4px #26334412;font-weight:600;}
#editorView .side-primary-tabs>.side-panel-toggle{margin-left:3px;margin-right:2px;}
#editorView .side-section>.panel-tabs{padding:0 14px;gap:16px;border-bottom:1px solid #eceef2;}
#editorView .side-section>.panel-tabs>.panel-tab{position:relative;flex:none;margin:0;padding:10px 0 9px;border:0;border-radius:0;background:transparent;color:#949ca8;font-size:12px;font-weight:400;}
#editorView .side-section>.panel-tabs>.panel-tab:hover{background:transparent;color:#4b5563;}
#editorView .side-section>.panel-tabs>.panel-tab.active{background:transparent;color:#263344;font-weight:500;}
#editorView .side-section>.panel-tabs>.panel-tab.active::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:2px;background:var(--brand);}
html.dark-mode #editorView .side-panel>.side-primary-tabs{background:#222222;}
html.dark-mode #editorView .side-primary-tabs>.side-primary-tab,html.dark-mode #editorView .side-primary-tabs>#projectAIButton{color:#8e96a3;background:transparent;}
html.dark-mode #editorView .side-primary-tabs>.side-primary-tab:hover,html.dark-mode #editorView .side-primary-tabs>#projectAIButton:hover{color:#d6dbe3;background:#2e2e2e;}
html.dark-mode #editorView .side-primary-tabs>.side-primary-tab.active,html.dark-mode #editorView .side-primary-tabs>#projectAIButton.active{background:#373737;color:#edf0f5;box-shadow:0 1px 4px #0002;}
html.dark-mode #editorView .side-section>.panel-tabs{border-bottom-color:#282b30;}
html.dark-mode #editorView .side-section>.panel-tabs>.panel-tab{color:#818a98;}
html.dark-mode #editorView .side-section>.panel-tabs>.panel-tab.active{color:#dce1e9;}
@media(max-width:820px){
 #editorView #outlineNav{margin:6px;}
 #editorView .editor-actions-menu .side-panel>.side-primary-tabs{margin:5px 0 6px;}
}

/* The project header sits outside the floating outline, with no bottom gap. */
#editorView .editor-main>.outline-nav-header{flex:0 0 32px;border-radius:0;}
#editorView #outlineNav{margin:0 10px;}
#editorView #outlineNav>.outline-scroll{border-radius:11px 11px 0 0;}
#editorView #outlineNav.collapsed-outline{display:none!important;margin:0;border:0;}
.app.editor-focus-mode #editorView .editor-main>.outline-nav-header{display:none!important;}
@media(max-width:820px){
 .app.editor-active:not(.editor-focus-mode) #editorView .editor-main>.outline-nav-header{position:fixed;top:0;left:0;right:0;z-index:81;width:100%;box-sizing:border-box;}
 #editorView #outlineNav{margin:0 6px;}
 .app.editor-active:not(.editor-focus-mode) #editorView .editor-main{padding-top:calc(var(--mobile-editor-header-stack,32px) + var(--mobile-outline-stack,170px));}
}

/* Keep the project header free of a bottom divider. */
#editorView .editor-main>.outline-nav-header{border-bottom:0;}

/* A slightly deeper shared gray around the white screenplay paper. */
html:not(.dark-mode) #editorView{--editor-surround:#f1f2f4;}
html:not(.dark-mode) #editorView .editor-main>.outline-nav-header,
html:not(.dark-mode) #editorView .screenplay-scroll,
html:not(.dark-mode) #editorView .screenplay-hint-row{background:var(--editor-surround);}

/* Reference-style time ruler: quiet numbers above graduated baseline ticks. */
#editorView .outline-ruler{--ruler-ink:#8d9198;--ruler-label:#858990;height:32px;background:#f2f2f3;border-bottom:1px solid #cfd2d7;}
#editorView .outline-ruler .ruler-spacer{background:inherit;}
#editorView .outline-ruler .ruler-tick,#editorView .outline-ruler .ruler-tick.major{position:relative;display:block;box-sizing:border-box;height:100%;padding:3px 0 0 5px;border-left:0;font-size:12px;font-weight:400;line-height:16px;color:var(--ruler-label);background-image:linear-gradient(to right,var(--ruler-ink) 1px,transparent 1px);background-size:calc(100% / 6) 4px;background-position:left bottom;background-repeat:repeat-x;}
#editorView .outline-ruler .ruler-tick::before{content:'';position:absolute;bottom:0;left:0;width:1px;height:9px;background:var(--ruler-ink);}
#editorView .outline-ruler .ruler-tick::after{content:'';position:absolute;bottom:0;left:50%;width:1px;height:6px;background:var(--ruler-ink);}
#editorView .screenplay-hint-row{border-top:1px solid #c5cbd3;}
#editorView .screenplay-toolbar-shell>.screenplay-toolbar{border-bottom:1px solid #c5cbd3;}
html.dark-mode #editorView .outline-ruler{--ruler-ink:#707680;--ruler-label:#a0a6af;background:#212121;border-bottom-color:#444950;}
html.dark-mode #editorView .screenplay-hint-row,html.dark-mode #editorView .screenplay-toolbar-shell>.screenplay-toolbar{border-color:#444950;}

/* Compact ruler with each number aligned to its own long tick. */
#editorView .outline-ruler{height:24px;}
#editorView .outline-ruler .ruler-tick,#editorView .outline-ruler .ruler-tick.major{padding:1px 0 0;font-size:11px;line-height:14px;}
#editorView .outline-ruler .ruler-tick::before{height:7px;}
#editorView .outline-ruler .ruler-tick::after{height:5px;}
#editorView .outline-ruler .ruler-tick{background-size:calc(100% / 6) 3px;}
#editorView .screenplay-hint-row,.app.editor-focus-mode #editorView .screenplay-hint-row{height:25px;min-height:25px;border-top:1px solid #e0e3e8;}
#editorView .screenplay-hint-row button{min-height:20px;padding-top:2px;padding-bottom:2px;}
html.dark-mode #editorView .screenplay-hint-row{border-top-color:#2c2f34;}
@media(max-width:820px){
 #editorView .screenplay-hint-row,.app.editor-focus-mode #editorView .screenplay-hint-row{height:calc(25px + env(safe-area-inset-bottom,0px));}
}

#editorView .outline-ruler .ruler-tick{overflow:visible;}
#editorView .ruler-tick-label{position:absolute;top:1px;left:0;transform:translateX(-50%);line-height:14px;}
#editorView .ruler-tick:first-child .ruler-tick-label{transform:none;}

/* White ruler and clearer grid divisions, with no outer top-edge border. */
html:not(.dark-mode) #editorView .outline-ruler{background:#fff;}
#editorView .outline-track-row{border-bottom:1px solid #d8dde4;}
#editorView .outline-track-label,#editorView .ruler-spacer{border-right-color:#cdd3dc;z-index:10;}
html.dark-mode #editorView .outline-track-row{border-bottom-color:#363b43;}
html.dark-mode #editorView .outline-track-label,html.dark-mode #editorView .ruler-spacer{border-right-color:#3b414a;}
.app.editor-active #editorView .editor-main,.app.editor-active #editorView .side-panel{border-top:0!important;}
#editorView .editor-main>.outline-nav-header{border-top:0;}

/* Script/storyboard mode keeps writing on the left and scene master images on the right. */
#editorView .script-storyboard-split{display:flex;flex:1 1 0;min-width:0;min-height:0;overflow:hidden;}
#editorView .script-storyboard-split>.screenplay-scroll{min-width:0;min-height:0;flex:1 1 0;}
#editorView .script-master-panel[hidden]{display:none!important;}
#editorView .script-master-panel{display:flex;flex-direction:column;flex:0 0 28%;width:28%;min-width:190px;max-width:320px;min-height:0;border-left:1px solid #dce1e7;background:#f7f8fa;}
#editorView .script-master-heading{flex:none;padding:9px 12px;font-size:12px;font-weight:500;color:#697586;border-bottom:1px solid #e5e8ec;}
#editorView .script-master-list{flex:1 1 0;min-height:0;overflow:auto;padding:12px;}
#editorView .script-master-card{margin-bottom:16px;}
#editorView .script-master-label{display:flex;align-items:center;gap:7px;min-width:0;margin-bottom:6px;font-size:11px;color:#929ba7;}
#editorView .script-master-label>span:first-child{flex:none;color:#687484;}
#editorView .script-master-label>.no-i18n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView .script-master-image{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;aspect-ratio:16/9;padding:0;overflow:hidden;border:1px solid #dce1e7;border-radius:4px;background:#fff;color:#929ca9;cursor:pointer;}
#editorView .script-master-image>.entity-image-shell{position:absolute;inset:0;width:100%;height:100%;}
#editorView .script-master-image img{width:100%;height:100%;object-fit:contain;}
#editorView .script-master-image:hover{border-color:var(--brand);}
#editorView .script-master-empty{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;font-size:11px;color:#9ba4b0;}
#editorView .script-master-empty>span{font-size:22px;line-height:1;}
html.dark-mode #editorView .script-master-panel{background:#181818;border-left-color:#34383f;}
html.dark-mode #editorView .script-master-heading{border-bottom-color:#2e3238;color:#adb5c1;}
html.dark-mode #editorView .script-master-image{background:#222222;border-color:#393e46;}
@media(max-width:820px){
 #editorView.script-storyboard-mode .script-storyboard-split{flex-direction:column;}
 #editorView .script-master-panel{flex:0 0 32%;width:100%;min-width:0;max-width:none;border-left:0;border-top:1px solid #dce1e7;}
 #editorView .script-master-list{display:flex;gap:12px;overflow:auto;padding:8px;}
 #editorView .script-master-card{flex:0 0 180px;margin:0;}
 #editorView .script-master-heading{padding:5px 10px;}
}

/* Scene master images share the script scrollport and follow actual heading positions. */
#editorView .script-storyboard-content{position:relative;min-height:100%;}
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-left:0;}
#editorView.script-storyboard-mode .script-master-panel{position:absolute;top:0;right:0;bottom:0;height:auto;max-height:none;min-width:150px;width:28%;max-width:280px;display:block;border:0;background:transparent;}
#editorView.script-storyboard-mode .script-master-heading{display:none;}
#editorView.script-storyboard-mode .script-master-list{position:relative;display:block;height:100%;padding:0 10px;overflow:visible;}
#editorView.script-storyboard-mode .script-master-card{position:absolute;left:10px;right:10px;margin:0;}
#editorView.script-storyboard-mode .script-master-card[hidden]{display:none;}
#editorView.script-storyboard-mode .script-master-image{aspect-ratio:auto;min-height:20px;}
@media(max-width:820px){
 #editorView.script-storyboard-mode .script-storyboard-split{flex-direction:row;}
 #editorView.script-storyboard-mode .script-master-panel{width:34%;min-width:110px;max-width:160px;}
 #editorView.script-storyboard-mode .script-master-list{padding:0 6px;}
 #editorView.script-storyboard-mode .script-master-card{left:6px;right:6px;}
 #editorView.script-storyboard-mode .script-master-label>.no-i18n{display:none;}
 #editorView.script-storyboard-mode .script-master-empty{font-size:10px;gap:2px;}
}

/* Attach scene master frames directly to the paper's right edge. */
#editorView.script-storyboard-mode .script-master-panel{left:calc(var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1) + 8px);right:auto;}
#editorView.script-storyboard-mode .script-master-list{padding-left:0;padding-right:0;}
#editorView.script-storyboard-mode .script-master-card{left:0;right:0;}

/* Center the script-and-image group as a unit, retaining the close image gap. */
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-left:var(--storyboard-group-offset,0px);margin-right:0;}
#editorView.script-storyboard-mode .script-master-panel{left:calc(var(--storyboard-group-offset,0px) + var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1) + 8px);}

/* Shot metadata and unobtrusive vertical frame actions. */
#editorView.script-storyboard-mode .script-master-card{right:24px;}
#editorView .script-master-meta{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:5px;}
#editorView .script-master-meta>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;}
#editorView .script-master-tools{position:absolute;right:-24px;top:20px;display:flex;flex-direction:column;gap:1px;width:22px;opacity:0;visibility:hidden;transition:opacity .12s;}
#editorView .script-master-card:hover .script-master-tools,#editorView .script-master-card:focus-within .script-master-tools{opacity:1;visibility:visible;}
#editorView .script-master-tools button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:22px;height:22px;padding:0;border:0;border-radius:4px;background:transparent;color:#8c96a4;cursor:pointer;}
#editorView .script-master-tools button:hover{background:var(--brand-soft);color:var(--brand);}
#editorView .script-master-tools button:disabled{opacity:.3;cursor:default;}
#editorView .script-master-image.has-image{background:transparent;border-color:transparent;}
#editorView .script-master-image.has-image>.entity-image-shell{background:transparent;}
html.dark-mode #editorView .script-master-image.has-image{background:transparent;border-color:transparent;}
@media(hover:none){#editorView .script-master-tools{opacity:1;visibility:visible;}}

#editorView .script-master-card:hover,#editorView .script-master-card:focus-within{z-index:3;}

/* Larger, tightly spaced storyboard images with an inset hover toolbar. */
#editorView.script-storyboard-mode .script-master-panel{width:42%;min-width:240px;max-width:460px;}
#editorView.script-storyboard-mode .script-master-card{right:0;}
#editorView .script-master-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;height:20px;margin-bottom:4px;color:#8a94a2;}
#editorView .script-master-meta>span{display:block;flex:0 1 auto;font-size:11px;line-height:16px;}
#editorView .script-master-meta>span:first-child{font-size:12px;font-weight:600;color:#465263;margin-right:auto;}
#editorView .script-master-meta>span:last-child{margin-left:8px;text-align:right;font-variant-numeric:tabular-nums;}
#editorView .script-master-visual{position:relative;}
#editorView .script-master-tools{right:7px;top:50%;transform:translateY(-50%);width:26px;padding:3px;box-sizing:content-box;gap:2px;border:1px solid #0000000a;border-radius:7px;background:#ffffffdb;backdrop-filter:blur(8px);z-index:5;}
#editorView .script-master-tools button{width:26px;height:24px;color:#667383;}
#editorView .script-master-tools button:hover{background:#e9eef5;}
html.dark-mode #editorView .script-master-meta>span:first-child{color:#c7ced8;}
html.dark-mode #editorView .script-master-tools{background:#262626e6;border-color:#ffffff0d;}
html.dark-mode #editorView .script-master-tools button{color:#c2cad6;}
html.dark-mode #editorView .script-master-tools button:hover{background:#3b3b3b;}
@media(max-width:820px){#editorView.script-storyboard-mode .script-master-panel{width:44%;min-width:130px;max-width:220px;}#editorView .script-master-meta{gap:4px;}#editorView .script-master-meta>span{font-size:9px;}#editorView .script-master-meta>span:first-child{font-size:10px;}#editorView .script-master-tools{right:4px;}}

/* Scene-based script-to-storyboard workspace, without altering document content. */

#editorView .script-master-scene{position:absolute;left:0;right:0;padding:0 0 8px;border-bottom:1px solid #dbe0e7;}
#editorView .script-master-scene-heading{display:flex;align-items:center;gap:7px;min-height:28px;margin:0 0 10px;color:#8993a1;font-size:11px;}
#editorView .script-master-scene-heading strong{flex:none;color:#536173;font-size:12px;font-weight:600;}
#editorView .script-master-scene-heading>.no-i18n{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView .script-master-scene-heading>button{flex:none;padding:3px 6px;border:0;border-radius:4px;background:#e9eef6;color:var(--brand);font:inherit;font-size:11px;cursor:pointer;white-space:nowrap;}
#editorView .script-master-scene-heading>button:disabled{opacity:.55;cursor:default;}
#editorView.script-storyboard-mode .script-master-scene .script-master-card{position:relative;left:auto;right:auto;top:auto!important;margin:0 0 16px;}
#editorView.script-storyboard-mode .script-master-scene .script-master-card:last-child{margin-bottom:0;}
#editorView.script-storyboard-mode .script-master-image{height:auto!important;min-height:0;aspect-ratio:16/9;}
#editorView .storyboard-scene-spacer{display:block!important;flex:none;box-sizing:border-box;min-height:0;padding:0;margin:0;border:0;background:transparent;pointer-events:none;user-select:none;font-size:0;line-height:0;}
html.dark-mode #editorView .script-master-scene{border-bottom-color:#333943;}
html.dark-mode #editorView .script-master-scene-heading strong{color:#c3ccd8;}
html.dark-mode #editorView .script-master-scene-heading>button{background:#323232;color:#a8c5ec;}
@media(max-width:820px){#editorView .script-master-scene-heading{flex-wrap:wrap;gap:4px;}#editorView .script-master-scene-heading>.no-i18n{display:none;}}

#editorView .storyboard-selected-card .script-master-image{outline:2px solid var(--brand);outline-offset:2px;}

/* Parallel writing workspace for shot-by-shot video generation scripts. */
#editorView .video-script-card{box-sizing:border-box;padding:12px;background:#fff;border:1px solid #dde3eb;border-radius:7px;}
#editorView .video-script-meta{display:grid;grid-template-columns:.7fr 1fr 1fr .8fr;gap:8px;margin-bottom:10px;}
#editorView .video-script-meta label{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:10px;color:#98a1ae;}
#editorView .video-script-meta input{box-sizing:border-box;width:100%;min-width:0;height:26px;padding:3px 5px;border:1px solid #e3e7ed;border-radius:4px;background:transparent;color:#556171;font:inherit;font-size:12px;}
#editorView .video-script-text{box-sizing:border-box;display:block;width:100%;min-height:168px;max-height:none;padding:8px 2px;resize:none;overflow:hidden;border:0;outline:none;background:transparent;color:#374355;font:inherit;font-size:13px;line-height:1.8;}
#editorView .video-script-text::placeholder{color:#b1b8c3;}
#editorView .video-script-card-footer{display:flex;align-items:center;gap:8px;margin-top:8px;border-top:1px solid #eef0f4;padding-top:6px;}
#editorView .video-script-card-footer>span{font-size:9px;color:#a9b1bd;}
#editorView .video-script-card .script-master-tools{position:static;display:flex;flex-direction:row;gap:1px;width:auto;transform:none;visibility:visible;opacity:1;margin-left:auto;padding:0;border:0;background:none;backdrop-filter:none;}
#editorView .video-script-card .script-master-tools button{width:22px;height:22px;}
#editorView .video-script-new{width:100%;padding:28px 10px;border:0;background:transparent;color:#8d99aa;font:inherit;font-size:12px;cursor:pointer;}
html.dark-mode #editorView .video-script-card{background:#202020;border-color:#343c48;}
html.dark-mode #editorView .video-script-meta input{border-color:#3a4453;color:#c6cdd7;}
html.dark-mode #editorView .video-script-text{color:#d0d6df;}
html.dark-mode #editorView .video-script-card-footer{border-top-color:#303743;}
@media(max-width:820px){#editorView .video-script-meta{grid-template-columns:1fr 1fr;gap:5px;}#editorView .video-script-card{padding:7px;}#editorView .video-script-text{font-size:12px;}#editorView .video-script-card-footer{flex-wrap:wrap;}#editorView .video-script-card .script-master-tools{margin-left:0;}}

/* A video prompt composer replaces the form-like script card. */
#editorView .video-prompt-composer{padding:0;background:#f9fafb;border:1px solid #dfe4eb;border-radius:10px;overflow:hidden;}
#editorView .video-prompt-composer:focus-within{border-color:#a9bdd8;box-shadow:0 0 0 2px #2864b408;}
#editorView .video-prompt-composer .video-script-text{min-height:180px;padding:14px 14px 8px;line-height:1.9;}
#editorView .video-prompt-settings{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;padding:4px 12px 10px;}
#editorView .video-prompt-composer .video-script-meta{display:flex;align-items:center;flex:1 1 auto;flex-wrap:wrap;gap:6px 12px;margin:0;}
#editorView .video-prompt-composer .video-script-meta label{display:inline-flex;flex-direction:row;align-items:center;gap:3px;font-size:10px;white-space:nowrap;}
#editorView .video-prompt-composer .video-script-meta input{width:44px;height:24px;padding:2px 3px;border:0;border-radius:3px;color:#657285;font-size:11px;}
#editorView .video-prompt-composer .video-script-meta input:focus{outline:1px solid #b8c9df;background:#fff;}
#editorView .video-prompt-composer .script-master-tools{flex:0 0 auto;margin-left:auto;}
html.dark-mode #editorView .video-prompt-composer{background:#232323;border-color:#373f4a;}
html.dark-mode #editorView .video-prompt-composer:focus-within{border-color:#607b9e;box-shadow:none;}
html.dark-mode #editorView .video-prompt-composer .video-script-meta input{color:#b7c2d1;}
html.dark-mode #editorView .video-prompt-composer .video-script-meta input:focus{background:#303030;outline-color:#607b9e;}

/* Script-mode cards use one surface in both preview and live-edit states. */
#editorView .native-video-script-card{
 --script-card-bg:#fff;--script-card-text:#374355;--script-card-muted:#8993a1;--script-card-line:#e6e9ee;
 box-sizing:border-box;padding:0;border:1px solid #dce1e8;border-radius:10px;
 background:var(--script-card-bg);color:var(--script-card-text);overflow:visible;box-shadow:0 2px 8px #25334705;
}
#editorView .native-video-script-card:focus-within{background:var(--script-card-bg);border-color:#b9c7d7;}
#editorView #shotImageEditor.inline-shot-composer{position:relative;inset:auto;z-index:auto;width:100%;height:auto;margin:0;padding:0;background:transparent;border:0;box-shadow:none;display:block;color:inherit;}
#editorView .native-video-script-card :is(.inline-shot-composer>.shot-image-fields,.video-native-preview){display:flex;flex-direction:column;gap:0;min-width:0;min-height:0;padding:0;overflow:visible;background:transparent;color:inherit;}
#editorView .native-video-script-card .shot-image-fields>strong{display:block;margin:0;padding:12px 14px 8px;font-size:13px;line-height:20px;font-weight:600;color:inherit;}
#editorView .native-video-script-card .shot-image-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0 14px 12px;}
#editorView .native-video-script-card .shot-image-meta label{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:10px;line-height:16px;color:var(--script-card-muted);}
#editorView .native-video-script-card .shot-image-meta input{box-sizing:border-box;width:100%;min-width:0;height:26px;margin:0;padding:3px 6px;border:1px solid var(--script-card-line);border-radius:4px;background:transparent;color:var(--script-card-text);font:inherit;font-size:12px;line-height:18px;}
#editorView .native-video-script-card :is(#shotImageComposer,.video-native-composer){display:flex;flex:initial;flex-direction:column;box-sizing:border-box;gap:0;width:100%;min-height:0;margin:0;padding:12px 0 0;border:0;border-top:1px solid var(--script-card-line);border-radius:0;background:transparent;overflow:visible;}
#editorView .native-video-script-card :is(#shotReferenceStrip,.shot-reference-strip-preview){position:relative;display:flex;flex:none;align-items:center;flex-wrap:wrap;gap:7px;box-sizing:border-box;min-height:44px;margin:0;padding:0 14px 8px;}
#editorView .native-video-script-card :is(#shotReferenceStrip,.shot-reference-strip-preview) .shot-reference-add{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:34px;height:34px;min-height:0;padding:0;border:1px dashed #b9c2ce;border-radius:6px;background:transparent;color:var(--script-card-muted);font-size:23px;font-weight:300;cursor:pointer;}
#editorView .native-video-script-card .shot-reference-thumb{position:relative;width:34px;height:34px;border-radius:5px;overflow:hidden;}
#editorView .native-video-script-card .shot-reference-thumb img{width:100%;height:100%;object-fit:cover;}
#editorView .native-video-script-card :is(#shotImagePrompt,.video-native-prompt){display:block;box-sizing:border-box;flex:initial;width:100%;height:180px;min-height:180px;max-height:none;margin:0;padding:4px 14px 12px;resize:none;overflow-y:auto;border:0;border-radius:0;outline:none;box-shadow:none;background:transparent;color:var(--script-card-text);font:inherit;font-size:13px;line-height:1.8;}
#editorView .native-video-script-card :is(#shotImagePrompt,.video-native-prompt)::placeholder{color:var(--script-card-muted);opacity:1;}
#editorView .native-video-script-card .shot-composer-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:2px 8px;box-sizing:border-box;min-height:72px;margin:0;padding:8px 12px;border-top:1px solid var(--script-card-line);background:transparent;}
#editorView .native-video-script-card .shot-composer-model{grid-column:1;grid-row:1;display:flex;align-items:center;min-width:0;max-width:100%;padding:0;border:0;}
#editorView .native-video-script-card :is(.shot-settings-control,.video-native-settings){grid-column:1;grid-row:2;box-sizing:border-box;min-width:0;max-width:100%;margin:0;padding:0;border:0;background:transparent;}
#editorView .native-video-script-card :is(.shot-model-trigger,.shot-settings-control>.image-options-trigger,.video-native-settings){display:inline-flex;align-items:center;justify-content:flex-start;gap:4px;box-sizing:border-box;width:auto;max-width:100%;height:26px;min-height:26px;max-height:26px;margin:0;padding:3px 2px;border:0;border-radius:4px;outline:none;box-shadow:none;background:transparent;color:inherit;font:inherit;font-size:11px;line-height:20px;white-space:nowrap;cursor:pointer;}
#editorView .native-video-script-card :is(.shot-model-trigger,.shot-settings-control>.image-options-trigger,.video-native-settings):hover{background:#8888880d;}
#editorView .native-video-script-card :is(.entity-model-name,.image-options-trigger>span:not(.image-ratio-icon)){min-width:0;overflow:hidden;text-overflow:ellipsis;}
#editorView .native-video-script-card .entity-control-chevron{display:block;flex:0 0 12px;width:12px;height:12px;margin:0;align-self:center;}
#editorView .native-video-script-card .entity-composer-actions{grid-column:2;grid-row:1/3;display:flex;align-items:center;gap:6px;margin:0;}
#editorView .native-video-script-card .entity-composer-actions button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:30px;height:32px;min-height:0;margin:0;padding:6px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer;}
#editorView .native-video-script-card .entity-composer-actions button.btn-primary{background:var(--brand);color:#fff;}
#editorView .native-video-script-card .entity-composer-actions button:disabled{opacity:.4;cursor:default;}
#editorView .native-video-script-card .entity-composer-actions svg{width:18px;height:18px;}
#editorView .native-video-script-card #shotImageStatus:empty{display:none;}
#editorView .native-video-script-card #shotImageStatus:not(:empty){margin:0;padding:0 14px 8px;color:var(--script-card-muted);}
#editorView .native-video-script-card>.video-script-card-footer{margin:0;padding:5px 10px;border-top:1px solid var(--script-card-line);}
html.dark-mode #editorView .native-video-script-card{--script-card-bg:#202329;--script-card-text:#d4dae3;--script-card-muted:#8c97a7;--script-card-line:#343a44;background:var(--script-card-bg);border-color:#3b424d;box-shadow:none;}
html.dark-mode #editorView .native-video-script-card:focus-within{background:var(--script-card-bg);border-color:#62738b;}
@media(max-width:820px){#editorView .native-video-script-card :is(#shotImagePrompt,.video-native-prompt){font-size:16px;}#editorView .native-video-script-card .shot-composer-footer{padding-inline:8px;gap:2px 4px;}}

/* Single-choice views; director composer stays outside the script scroll area. */
#editorView.script-storyboard-mode #scriptStoryboardSplit{flex-direction:row;padding:0 10px;}
#editorView.script-storyboard-mode #scriptStoryboardContent{height:auto;}
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-left:auto;margin-right:auto;}
#editorView.script-storyboard-mode #scriptMasterPanel{position:relative;display:flex;flex:0 0 38%;width:38%;min-width:280px;max-width:460px;height:100%;padding:10px 0;border:0;background:transparent;overflow:hidden;}
#editorView.script-storyboard-mode #scriptMasterList{flex:1;height:auto;padding:0 2px;overflow:auto;}
#editorView.script-storyboard-mode #scriptMasterList>.script-master-card{position:relative;inset:auto;margin:0;}
#editorView .director-shot-select{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid var(--script-card-line);}
#editorView .director-shot-select label{flex:none;font-size:12px;font-weight:600;}
#editorView .director-shot-select select{min-width:0;max-width:75%;padding:4px 6px;border:1px solid var(--script-card-line);border-radius:5px;background:var(--script-card-bg);color:inherit;font:inherit;font-size:12px;}
#editorView #canvasView .canvas-toolbar{gap:10px;}
@media(max-width:820px){#editorView.script-storyboard-mode #scriptStoryboardSplit{gap:6px;padding:0 6px;}#editorView.script-storyboard-mode #scriptMasterPanel{flex-basis:44%;width:44%;min-width:150px;max-width:none;}#editorView .director-shot-select{padding:8px;gap:4px;}#editorView .director-shot-select select{font-size:11px;}}

#editorView #canvasView .canvas-group-pick{margin-left:auto;}

/* Fast, shared icon hints with a speech-bubble pointer. */
#entityComposerTooltip,html.dark-mode #entityComposerTooltip{position:fixed;z-index:40000;box-sizing:border-box;max-width:min(320px,calc(100vw - 16px));padding:9px 13px;border:0;border-radius:12px;background:#191919;color:#fff;box-shadow:0 4px 16px #0003;font:500 13px/1.45 system-ui,sans-serif;white-space:normal;pointer-events:none;}
#entityComposerTooltip::before{content:'';position:absolute;left:var(--tip-arrow-x,50%);width:10px;height:10px;background:#191919;transform:translateX(-50%) rotate(45deg);}
#entityComposerTooltip[data-side="below"]::before{top:-5px;}
#entityComposerTooltip[data-side="above"]::before{bottom:-5px;}
.editor-feedback-button{flex:none;}

/* Header icons share one box and baseline. */
#editorView .outline-nav-right{align-items:center;gap:6px;}
#editorView .outline-nav-right :is(.editor-display-control,.outline-export-control){display:inline-flex;align-items:center;align-self:center;margin:0;padding:0;height:30px;}
#editorView .outline-nav-right :is(.editor-display-button,.export-btn){display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:none;width:30px;min-width:30px;height:30px;min-height:30px;margin:0;padding:6px;border:0;border-radius:6px;background:transparent;color:inherit;line-height:1;vertical-align:middle;}
#editorView .outline-nav-right :is(.editor-display-button,.export-btn) svg{display:block;width:17px;height:17px;flex:none;}
#editorView .outline-nav-right :is(.editor-display-button,.export-btn):hover{background:#88888814;}
/* Director tables and script share the same vertical scroll container. */
#editorView.script-storyboard-mode #scriptStoryboardSplit{padding:0;}
#editorView.script-storyboard-mode #scriptStoryboardContent{position:relative;min-height:100%;padding-right:calc(46% + 12px);box-sizing:border-box;}
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-left:8px;}
#editorView.script-storyboard-mode #scriptMasterPanel{position:absolute;top:0;right:8px;left:auto;bottom:0;display:block;width:46%;min-width:0;max-width:none;height:auto;padding:0;}
#editorView.script-storyboard-mode #scriptMasterList{display:block;height:100%;padding:0;overflow:visible;}
#editorView .director-table-scene{position:absolute;left:0;right:0;}
#editorView .director-table-heading{display:flex;gap:8px;min-height:30px;font-size:11px;color:#8893a3;}
#editorView .director-table-heading span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView .director-table-heading strong{flex:none;}
#editorView .director-table-scroll{overflow-x:auto;border:1px solid #88888830;border-radius:4px;background:#fff;}
#editorView .director-table{border-collapse:collapse;min-width:560px;font-size:12px;}
#editorView .director-table th{font-size:11px;font-weight:500;color:#8993a1;background:#f6f7f9;padding:7px 4px;}
#editorView .director-table td{border:1px solid #88888825;padding:4px;vertical-align:top;}
#editorView .director-table :is(th,td):nth-child(-n+4){width:48px;}
#editorView .director-table :is(th,td):nth-child(5){width:160px;}
#editorView .director-table textarea{display:block;box-sizing:border-box;width:100%;min-height:30px;margin:0;padding:4px;border:0;outline:none;resize:none;background:transparent;color:inherit;font:inherit;font-size:12px;line-height:1.6;overflow:hidden;}
html.dark-mode #editorView .director-table-scroll{background:#232323;}
html.dark-mode #editorView .director-table th{background:#2d2d2d;}

/* Restore the original muted header icon palette. */
#editorView .outline-nav-right :is(.editor-display-button,.export-btn){color:#788392;}
html.dark-mode #editorView .outline-nav-right :is(.editor-display-button,.export-btn){color:#a7aeba;}
#editorView .outline-nav-right :is(.editor-display-button,.export-btn):hover{color:var(--brand);}
#editorView .director-table{min-width:580px;}
#editorView .director-table :is(th,td):nth-child(1){width:44px;}
#editorView .director-table :is(th,td):nth-child(2){width:104px;}
#editorView .director-table :is(th,td):nth-child(3),#editorView .director-table :is(th,td):nth-child(4){width:54px;}
#editorView .director-table :is(th,td):nth-child(5){width:44px;}
#editorView .director-table :is(th,td):nth-child(6){width:200px;}
#editorView .director-image-button{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:16/9;box-sizing:border-box;padding:0;border:1px dashed #88888840;border-radius:3px;background:#88888808;color:#9aa4b2;cursor:pointer;overflow:hidden;}
#editorView .director-image-button>svg{width:24px;height:24px;}
#editorView .director-image-button:has(img){border:0;background:transparent;}
#editorView .director-image-button .entity-image-shell{width:100%;height:100%;}
#editorView .director-image-button img{display:block;width:100%;height:100%;object-fit:contain;}

/* Center the paper and storyboard table as one group with a fixed 12px gap. */
#editorView.script-storyboard-mode #scriptStoryboardContent{padding-right:0;}
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-left:var(--director-group-left,8px);margin-right:0;}
#editorView.script-storyboard-mode #scriptMasterPanel{left:calc(var(--director-group-left,8px) + var(--paper-width,8.5in) * var(--screenplay-ui-zoom,1) + 12px);right:auto;width:var(--director-table-width,46%);}

/* Fit all six columns to the panel rather than imposing a wide table. */
#editorView .director-table-scroll{width:100%;max-width:100%;min-width:0;box-sizing:border-box;overflow-x:clip;}
#editorView .director-table{width:100%;min-width:0;max-width:100%;table-layout:fixed;box-sizing:border-box;}
#editorView .director-table :is(th,td):nth-child(n){min-width:0;box-sizing:border-box;overflow-wrap:anywhere;}
#editorView .director-table th{padding:7px 2px;white-space:normal;}
#editorView .director-table td{padding:3px;}
#editorView .director-table textarea{min-width:0;padding:3px 1px;overflow-wrap:anywhere;}
#editorView .director-table textarea[data-director-field="directorContent"]{min-height:76px;}
#editorView .director-image-cell .director-image-button{position:absolute;inset:0;height:100%;aspect-ratio:auto;padding:0;border:0;border-radius:0;}
#editorView .director-image-cell .director-image-button:hover{background:#88888818;}

/* Center the four compact storyboard metadata columns on both axes. */
#editorView .director-table :is(th,td):is(:nth-child(1),:nth-child(3),:nth-child(4),:nth-child(5)){vertical-align:middle;text-align:center;}
#editorView .director-table :is(td:nth-child(1),td:nth-child(3),td:nth-child(4),td:nth-child(5)) textarea{min-height:30px;padding:5px 1px;line-height:20px;text-align:center;}

#editorView .director-table-heading{box-sizing:border-box;min-height:0;margin:0;padding:0;align-items:center;}
#editorView .director-table :is(th,td):nth-child(n){width:auto;}
#editorView .director-table td.director-actions-cell{vertical-align:middle;padding:4px;}
#editorView .director-row-controls{display:flex;flex-direction:column;gap:4px;min-width:0;}
#editorView .director-row-controls select{box-sizing:border-box;min-width:0;width:100%;max-width:100%;padding:3px 1px;border:1px solid #88888825;border-radius:4px;background:transparent;color:inherit;font-size:10px;}
#editorView .director-settings-trigger{padding:3px;border:0;border-radius:4px;background:#8888880c;color:inherit;font-size:10px;cursor:pointer;}
#editorView .director-row-generate{display:flex;flex-wrap:wrap;justify-content:center;gap:3px;}
#editorView .director-row-generate button{display:flex;align-items:center;justify-content:center;width:23px;max-width:100%;height:25px;padding:3px;border:0;border-radius:4px;background:#8888880e;color:var(--brand);cursor:pointer;}
#editorView .director-row-generate svg{width:17px;height:17px;}
#editorView .director-row-controls :disabled{opacity:.4;cursor:default;}
#editorView .director-row-controls small{text-align:center;font-size:9px;color:#8993a1;}
#directorRowSettings{position:fixed;z-index:25000;box-sizing:border-box;width:225px;padding:14px;border:1px solid #88888830;border-radius:9px;background:#fff;box-shadow:0 8px 30px #0002;font-size:12px;}
#directorRowSettings label{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;}
#directorRowSettings :is(select,input){box-sizing:border-box;min-width:0;width:135px;padding:5px;border:1px solid #88888830;border-radius:4px;background:transparent;color:inherit;font:inherit;}
html.dark-mode #directorRowSettings{background:#2a2a2a;color:#c6ccd5;}

#editorView .director-table-scroll{width:calc(100% - 30px);margin-right:30px;overflow:visible;}
#editorView .director-actions-cell{position:relative;}
#editorView .director-row-tools{position:absolute;top:50%;right:-29px;transform:translateY(-50%);display:flex;flex-direction:column;gap:2px;width:25px;opacity:0;visibility:hidden;border:1px solid #88888825;border-radius:5px;background:#fff;box-shadow:0 2px 8px #0001;z-index:5;}
#editorView .director-table tr.director-hover-tools .director-row-tools{opacity:1;visibility:visible;}
#editorView .director-row-tools button{display:flex;align-items:center;justify-content:center;width:25px;height:25px;padding:4px;border:0;border-radius:4px;background:transparent;color:#8993a1;cursor:pointer;}
#editorView .director-row-tools button[draggable]{cursor:grab;}
#editorView .director-row-tools button:hover{background:#88888813;color:var(--brand);}
#editorView .director-row-tools svg{width:16px;height:16px;}
#editorView .director-drop-before td{border-top:2px solid var(--brand);}
#editorView .director-drop-after td{border-bottom:2px solid var(--brand);}
html.dark-mode #editorView .director-row-tools{background:#2a2a2a;}
#editorView.storyboard-script-hidden .screenplay-paper-stack{display:none!important;}
#editorView.storyboard-script-hidden #scriptStoryboardContent{max-width:1100px;margin:auto;padding:8px 10px;min-height:0!important;}
#editorView.storyboard-script-hidden #scriptMasterPanel{position:relative;inset:auto;height:auto;}
#editorView.storyboard-script-hidden #scriptMasterList{height:auto;}
#editorView.storyboard-script-hidden .director-table-scene{position:relative;top:auto!important;margin-bottom:18px;}
#editorView.storyboard-script-hidden .director-table-heading{height:auto!important;min-height:28px;}
@media(hover:none){#editorView .director-row-tools{opacity:1;visibility:visible;}}

/* Keep the hover path continuous from the row to its floating actions. */
#editorView .director-row-tools::before{content:'';position:absolute;left:-8px;top:-3px;bottom:-3px;width:8px;background:transparent;}
#editorView .director-row-tools:hover{opacity:1;visibility:visible;}
#editorView .director-drop-before td{border-top-width:1px;box-shadow:inset 0 2px var(--brand);}
#editorView .director-drop-after td{border-bottom-width:1px;box-shadow:inset 0 -2px var(--brand);}
#editorView .director-drag-source{opacity:.4;}

/* Blue whole-row drag selection, with the grip kept on the right. */
#editorView .director-drag-source{opacity:1;outline:2px solid #286cf6;outline-offset:-2px;border-radius:5px;}
#editorView .director-drag-source td{background:#e7efff;}
#editorView .director-drag-source .director-row-tools{opacity:1;visibility:visible;box-shadow:none;border:0;background:transparent;}
#editorView .director-is-dragging .director-row-tools button:not([data-director-row-tool="drag"]){display:none;}
#editorView .director-drag-source [data-director-row-tool="drag"]{background:#286cf6;color:#fff;border-radius:0 7px 7px 0;height:40px;}
#editorView .director-is-dragging tr:not(.director-drag-source) .director-row-tools{visibility:hidden;opacity:0;}
#editorView .director-drag-insert-line{position:absolute;height:4px;border-radius:999px;background:#286cf6;transform:translateY(-2px);pointer-events:none;z-index:20;}
html.dark-mode #editorView .director-drag-source td{background:#373737;}

#editorView [data-director-row-tool="drag"]{touch-action:none;user-select:none;-webkit-user-drag:none;cursor:grab;}
#editorView .director-is-dragging [data-director-row-tool="drag"]{cursor:grabbing;}
#editorView .director-drag-insert-line[hidden]{display:none;}

/* The entire right gutter belongs to the row's hover region. */
#editorView .director-actions-cell::after{content:'';position:absolute;top:0;bottom:0;right:-34px;width:34px;background:transparent;z-index:1;}
#editorView .director-row-tools{z-index:6;}
#editorView .director-is-dragging .director-row-tools::before{pointer-events:none;}
#editorView .director-moving-grip{position:relative;z-index:30;will-change:transform;box-shadow:none;}
#editorView .director-is-dragging .director-drag-source .director-row-tools{z-index:30;}

/* A separate overlay keeps the drag border above images and controls. */
#editorView .director-drag-source{outline:none;border-radius:0;}
#editorView .director-drag-row-frame{position:absolute;box-sizing:border-box;border:3px solid #286cf6;border-radius:6px;z-index:25;pointer-events:none;}
#editorView .director-drag-insert-line{height:3px;transform:translateY(-1.5px);}

/* A single shared header sticks inside the common screenplay scroll area. */

#editorView .director-table td.director-auto-shot-number{text-align:center;vertical-align:middle;white-space:nowrap;font-size:12px;line-height:20px;}

/* Shot metadata sits in a compact row above its content. */
#editorView .director-table td.director-content-cell{padding:0;vertical-align:top;text-align:left;}
#editorView .director-content-meta{display:flex;gap:8px;padding:5px 7px;border-bottom:1px solid #88888820;}
#editorView .director-content-meta label{gap:4px;flex:1 1 0;font-size:11px;}
#editorView .director-content-meta label span{flex:none;white-space:nowrap;color:#8c97a6;}
#editorView .director-content-meta input{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:26px;height:26px;padding:3px;border:0;border-radius:3px;outline:0;background:transparent;color:inherit;font:inherit;font-size:12px;line-height:20px;text-align:center;}
#editorView .director-content-meta input:focus{background:#8888880a;}
#editorView .director-table .director-content-cell textarea[data-director-field="directorContent"]{min-height:76px;padding:7px 8px;line-height:1.7;text-align:left;}
@media(max-width:650px){#editorView .director-content-meta{gap:3px;padding:4px;}#editorView .director-content-meta label{gap:2px;font-size:10px;}}

/* Combine the content editor and its generation toolbar in one cell. */
#editorView .director-content-composer-footer{padding:7px 8px;border-top:1px solid #88888825;}
#editorView .director-content-composer-footer .director-row-controls{flex-wrap:wrap;}
#editorView .director-content-composer-footer .director-row-controls select{flex:0 1 155px;width:auto;max-width:50%;min-width:0;height:28px;border:0;background:transparent;font-size:11px;}
#editorView .director-content-composer-footer .director-settings-trigger{padding:4px 7px;white-space:nowrap;}
#editorView .director-content-composer-footer .director-settings-trigger:hover{background:#88888812;}
#editorView .director-content-composer-footer .director-row-generate{margin-left:auto;gap:5px;}
#editorView .director-content-composer-footer .director-row-generate button{width:28px;height:28px;}
#editorView .director-content-composer-footer [data-director-action="image"]{background:var(--brand);color:#fff;}
#editorView .director-table tbody tr+tr>td{border-top:2px solid #bac3cf;}
#editorView .director-table tbody tr:first-child>td{border-top:1px solid #bac3cf;}
html.dark-mode #editorView .director-table tbody tr+tr>td{border-top-color:#565f6d;}
html.dark-mode #editorView .director-table tbody tr:first-child>td{border-top-color:#565f6d;}

#editorView .director-content-composer-footer{border-top:0;}
#editorView .director-content-composer-footer .director-settings-trigger{gap:4px;padding:4px 5px;color:#8993a1;}
#editorView .director-content-composer-footer .director-row-generate button{background:transparent;color:#788392;border:0;box-shadow:none;padding:4px;}
#editorView .director-content-composer-footer .director-row-generate button:hover{background:transparent;color:var(--brand);}
#editorView .director-content-composer-footer .director-row-generate svg{width:19px;height:19px;}
html.dark-mode #editorView .director-content-composer-footer .director-row-generate button{color:#a7aeba;}
html.dark-mode #editorView .director-content-composer-footer .director-row-generate button:hover{color:var(--brand);}
.director-video-setting-note{display:block;margin-top:12px;color:#8993a1;font-size:10px;line-height:1.5;}

#editorView .director-content-composer-footer .director-settings-trigger{display:inline-flex;align-items:center;justify-content:flex-start;gap:5px;max-width:calc(50% - 8px);height:28px;padding:4px 3px;font-size:11px;color:#788392;}
#editorView .director-settings-trigger .image-ratio-icon{display:inline-block;box-sizing:border-box;flex:none;width:15px;max-width:15px;max-height:13px;border:1.5px solid currentColor;border-radius:2px;}
#editorView .director-settings-trigger .director-video-summary-icon{width:16px;height:16px;flex:none;}
#editorView .director-settings-trigger .director-setting-summary-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView .director-settings-trigger .entity-control-chevron{width:11px;height:11px;flex:none;}
html.dark-mode #editorView .director-content-composer-footer .director-settings-trigger{color:#b0b8c4;}

/* Both settings and the generation icons stay in one bottom toolbar. */
#editorView .director-content-composer-footer .director-row-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:5px;}
#editorView .director-content-composer-footer .director-settings-trigger{width:100%;max-width:none;flex-wrap:nowrap;}
#editorView .director-content-composer-footer .director-row-generate{flex-wrap:nowrap;gap:3px;margin-left:0;}
#editorView .director-content-composer-footer .director-row-generate button{flex:none;width:25px;}
#editorView .director-content-composer-footer .director-row-controls>small{grid-column:1/-1;}
/* Image/video cell opens a media-only dialog. */
#shotImageEditor.shot-image-only .shot-image-dialog{grid-template-columns:minmax(0,1fr);width:min(760px,calc(100vw - 32px));max-width:calc(100vw - 32px);height:min(650px,80dvh);gap:0;}
#shotImageEditor.shot-image-only .shot-image-fields{display:none!important;}
#shotImageEditor.shot-image-only .shot-image-left{min-height:0;height:100%;}
#shotImageEditor.shot-image-only .shot-board-image-actions{display:none;}

/* Keep row geometry stable when its operation toolbar is hidden. */
#editorView .director-content-composer-footer{opacity:0;visibility:hidden;pointer-events:none;}
#editorView .director-table tbody tr.director-hover-body .director-content-composer-footer,
#editorView .director-table tbody tr:focus-within .director-content-composer-footer,
#editorView .director-table tbody tr.director-settings-open .director-content-composer-footer{opacity:1;visibility:visible;pointer-events:auto;}

.style-asset-dialog{display:grid;grid-template-columns:1.1fr 1fr;gap:22px;width:min(820px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:85dvh;overflow:auto;}
.style-asset-picture,.style-asset-fields{display:flex;flex-direction:column;gap:10px;min-width:0;}
.style-asset-preview{display:flex;align-items:center;justify-content:center;aspect-ratio:16/9;width:100%;padding:0;border:1px solid #88888830;border-radius:7px;background:#88888808;color:#8d97a5;cursor:pointer;overflow:hidden;}
.style-asset-preview .entity-image-shell{width:100%;height:100%;}.style-asset-preview img{width:100%;height:100%;object-fit:contain;}
.style-asset-thumbnails{display:flex;gap:8px;overflow-x:auto;padding:4px 2px;}.style-reference-tile{position:relative;flex:0 0 54px;height:54px;}
.style-reference-tile>button:first-child{width:54px;height:54px;padding:0;border:1px solid #88888830;border-radius:6px;overflow:hidden;background:transparent;}.style-reference-tile img{width:100%;height:100%;object-fit:cover;}
.style-reference-remove{position:absolute;right:-2px;top:-2px;border:0;border-radius:50%;background:#333a;color:#fff;width:17px;height:17px;padding:0;cursor:pointer;}
.style-asset-fields input,.style-asset-fields textarea{box-sizing:border-box;width:100%;border:1px solid #88888830;border-radius:5px;background:transparent;color:inherit;padding:8px;font:inherit;}.style-asset-fields textarea{min-height:170px;flex:1;resize:none;}
html.dark-mode .style-asset-dialog{background:#262626;color:#cbd2dc;}
@media(max-width:650px){.style-asset-dialog{grid-template-columns:1fr;gap:14px;}.style-asset-fields textarea{min-height:120px;}}

/* Compact metadata, close-set settings, and true widescreen shot previews. */
#editorView .director-content-meta{justify-content:flex-start;gap:14px;padding:6px 8px 2px;border-bottom:0;}
#editorView .director-content-meta label{flex:0 1 auto;}
#editorView .director-content-meta input{width:6ch;max-width:100%;min-width:24px;text-align:left;padding:2px 0;}
#editorView .director-content-meta input[data-director-field="duration"]{width:4ch;}
#editorView .director-content-meta input:focus{background:transparent;}
#editorView .director-content-composer-footer .director-row-controls{display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;align-items:center;}
#editorView .director-content-composer-footer .director-settings-trigger{flex:0 1 auto;width:auto;max-width:calc((100% - 90px)/2);padding:3px 1px;background:transparent;box-shadow:none;border:0;}
#editorView .director-content-composer-footer .director-settings-trigger:hover,#editorView .director-content-composer-footer .director-settings-trigger:focus{background:transparent;box-shadow:none;}
#editorView .director-content-composer-footer .director-row-generate{flex:none;margin-left:auto;}
#editorView .director-settings-trigger .director-setting-summary-text{background:transparent;}
#editorView .director-settings-trigger::after{content:none;display:none;}
#editorView .director-settings-trigger svg{background:transparent;box-shadow:none;}
#editorView .director-table td.director-image-cell{vertical-align:middle;}
#editorView .director-image-cell .director-image-button{position:relative;inset:auto;display:flex;height:auto;aspect-ratio:16/9;}
#editorView .director-image-cell .director-image-button .entity-image-shell{position:absolute;inset:0;width:100%;height:100%;}
#editorView .director-image-cell .director-image-button img{width:100%;height:100%;}
@media(max-width:650px){#editorView .director-content-meta{gap:6px;padding:4px;}#editorView .director-content-meta label{gap:3px;}#editorView .director-content-meta input{min-width:16px;width:4ch;}#editorView .director-content-composer-footer .director-row-controls{gap:3px;}}

/* Longer camera movement values, understated hover states, consistent table grid. */
#editorView .director-content-meta input[data-director-field="movement"]{width:12ch;min-width:48px;}
#editorView .director-content-composer-footer .director-settings-trigger:hover,
#editorView .director-content-composer-footer .director-settings-trigger:focus-visible{background:#7f8da514;border-radius:4px;color:#35465d;}
html.dark-mode #editorView .director-content-composer-footer .director-settings-trigger:hover,
html.dark-mode #editorView .director-content-composer-footer .director-settings-trigger:focus-visible{background:#a5b3c51a;color:#e1e7ef;}
#editorView .director-table-scroll{--director-grid-line:#c6ced8;border:1px solid var(--director-grid-line);border-radius:9px;}
html.dark-mode #editorView .director-table-scroll{--director-grid-line:#4a5361;border-color:var(--director-grid-line);}
#editorView .director-table{border-collapse:separate;border-spacing:0;border:0;border-radius:8px;}
#editorView .director-table thead th{border:0;border-right:1px solid var(--director-grid-line);border-bottom:1px solid var(--director-grid-line);}
#editorView .director-table thead th:first-child{border-top-left-radius:8px;}
#editorView .director-table thead th:last-child{border-top-right-radius:8px;border-right:0;}
#editorView .director-table tbody tr:nth-child(n)>td{border:0;border-right:1px solid var(--director-grid-line);border-bottom:1px solid var(--director-grid-line);}
#editorView .director-table tbody tr:nth-child(n)>td:last-child{border-right:0;}
#editorView .director-table tbody tr:last-child>td{border-bottom:0;}
#editorView .director-table tbody tr:last-child>td:first-child{border-bottom-left-radius:8px;}
#editorView .director-table tbody tr:last-child>td:last-child{border-bottom-right-radius:8px;}
@media(max-width:650px){#editorView .director-content-meta input[data-director-field="movement"]{width:8ch;min-width:36px;}}

/* Three metadata fields share the row in a 2:3:1 ratio. */
#editorView .director-content-meta{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr) minmax(0,1fr);gap:10px;align-items:center;}
#editorView .director-content-meta label{display:flex;align-items:center;min-width:0;gap:5px;}
#editorView .director-content-meta input,
#editorView .director-content-meta input[data-director-field="movement"],
#editorView .director-content-meta input[data-director-field="duration"]{flex:1 1 0;width:100%;min-width:0;max-width:100%;}
/* Fill the media cell; preserve the original image proportions within it. */
#editorView .director-table td.director-image-cell{position:relative;padding:0;}
#editorView .director-image-cell .director-image-button{position:absolute;inset:0;width:100%;height:100%;min-height:0;aspect-ratio:auto;}
#editorView .director-image-cell .director-image-button img{object-fit:contain;}
/* Smaller dark tooltips for the three generation icons. */
#entityComposerTooltip[data-variant="director"],html.dark-mode #entityComposerTooltip[data-variant="director"]{padding:6px 9px;border:1px solid #414141;border-radius:9px;background:#292929;color:#f4f4f4;box-shadow:0 3px 10px #0003;font:400 11px/1.4 system-ui,sans-serif;animation:director-tip-fade-in .12s ease-out both;}
#entityComposerTooltip[data-variant="director"]::before{width:8px;height:8px;background:#292929;}
#entityComposerTooltip[data-variant="director"][data-side="above"]::before{bottom:-4px;}
#entityComposerTooltip[data-variant="director"][data-side="below"]::before{top:-4px;}
@keyframes director-tip-fade-in{from{opacity:0;}to{opacity:1;}}
@media(prefers-reduced-motion:reduce){#entityComposerTooltip[data-variant="director"]{animation:none;}}
@media(max-width:650px){#editorView .director-content-meta{gap:5px;}#editorView .director-content-meta label{gap:3px;}}

/* Move duration left while keeping the camera movement field spacious. */
#editorView .director-content-meta{grid-template-columns:minmax(0,2fr) minmax(0,2.6fr) minmax(0,1.4fr);}

#editorView .outline-view-center .view-tabs{gap:5px;}
#editorView .director-table tbody tr.director-hover-tools .director-content-composer-footer{opacity:0;visibility:hidden;pointer-events:none;}
#editorView .director-content-references{display:flex;align-items:center;gap:6px;min-height:34px;padding:3px 8px;}
#editorView .director-add-reference{display:flex;align-items:center;justify-content:center;width:29px;height:29px;padding:0;border:1px solid #88888830;border-radius:5px;background:transparent;color:#8993a1;font:22px/1 system-ui;cursor:pointer;}
#editorView .director-add-reference:hover{background:#88888812;}
#editorView .director-add-reference:disabled{opacity:.3;cursor:default;}
#editorView .director-reference-thumb{position:relative;display:block;width:29px;height:29px;border-radius:4px;overflow:hidden;cursor:zoom-in;}
#editorView .director-reference-thumb .entity-image-shell{width:100%;height:100%;}
#editorView .director-reference-thumb img{width:100%;height:100%;object-fit:cover;}
#editorView .director-reference-thumb>button{position:absolute;right:0;top:0;display:none;align-items:center;justify-content:center;width:13px;height:13px;padding:0;border:0;border-radius:50%;background:#333a;color:#fff;cursor:pointer;font-size:11px;}
#editorView .director-reference-thumb:hover>button{display:flex;}

/* Video is a playback area; reference-image uploads remain in the content editor. */
#editorView .director-table td.director-video-cell{position:relative;padding:0;vertical-align:middle;}
#editorView .director-video-preview{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#88888806;}
#editorView .director-video-preview video{width:100%;height:100%;object-fit:contain;}
#editorView .director-video-empty{display:flex;align-items:center;justify-content:center;color:#9ba5b3;pointer-events:none;}
#editorView .director-video-empty svg{width:27px;height:27px;}
#editorView .director-content-references{padding-top:7px;}
#editorView .director-content-composer-footer .director-settings-trigger{max-width:calc(100% - 62px);}

#editorView .director-content-meta{grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,2.6fr) minmax(0,1.4fr);}
#editorView .director-content-meta input[readonly]{cursor:default;}
#editorView .director-video-open{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:pointer;}
#editorView .director-video-open>img{width:100%;height:100%;object-fit:contain;}
#editorView .director-upload-video{position:absolute;bottom:7px;left:7px;padding:5px 8px;border:0;border-radius:5px;background:#20242bd9;color:#fff;font-size:11px;opacity:0;visibility:hidden;cursor:pointer;z-index:2;}
#editorView .director-video-preview:hover .director-upload-video,#editorView .director-video-preview:focus-within .director-upload-video{opacity:1;visibility:visible;}
.director-video-viewer-dialog{position:relative;box-sizing:border-box;width:min(1000px,calc(100vw - 32px));max-height:90dvh;padding:24px;background:#fff;border-radius:12px;overflow:auto;}
.director-video-viewer-main{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:16/9;max-height:65dvh;background:#15171a;border-radius:6px;overflow:hidden;}
.director-video-viewer-main video{width:100%;height:100%;object-fit:contain;}.director-video-viewer-main>span{position:absolute;color:#b5bdca;font-size:12px;pointer-events:none;}
.director-video-viewer-thumbs{display:flex;gap:10px;margin-top:12px;padding:3px;overflow-x:auto;}.director-video-viewer-thumbs button{flex:0 0 92px;aspect-ratio:16/9;padding:0;overflow:hidden;border:2px solid transparent;border-radius:5px;background:#88888815;color:inherit;cursor:pointer;}.director-video-viewer-thumbs button.selected{border-color:var(--brand);}.director-video-viewer-thumbs img{width:100%;height:100%;object-fit:cover;}
html.dark-mode .director-video-viewer-dialog{background:#262626;color:#d0d7e0;}
#directorRowSettings [hidden]{display:none!important;}
@media(hover:none){#editorView .director-upload-video{opacity:1;visibility:visible;}}

#editorView .director-upload-video{background:transparent;color:var(--brand);box-shadow:none;}
#editorView .director-upload-video:hover{background:transparent;text-decoration:underline;}
#editorView .director-content-composer-footer .director-video-model-select{width:auto;min-width:0;max-width:40%;flex:0 1 130px;margin:0;padding:4px 1px;border:0;background:transparent;color:inherit;font:11px/20px system-ui;}
#editorView .director-content-composer-footer [data-director-action="video"] svg{width:21px;height:21px;}
#directorReferenceMenu{position:fixed;z-index:26000;min-width:180px;padding:5px;border:1px solid #88888830;border-radius:7px;background:#fff;box-shadow:0 6px 24px #0002;}
#directorReferenceMenu button{display:block;width:100%;padding:9px 10px;border:0;border-radius:4px;background:transparent;color:inherit;text-align:left;font:12px system-ui;cursor:pointer;}
#directorReferenceMenu button:hover{background:#88888813;}
.director-picture-picker{width:min(680px,calc(100vw - 32px));max-height:85dvh;overflow:auto;}
.director-picture-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;margin-top:12px;}
.director-picture-grid>button{display:flex;flex-direction:column;gap:6px;min-width:0;padding:5px;border:1px solid #88888825;border-radius:6px;background:transparent;color:inherit;cursor:pointer;text-align:left;font-size:11px;}
.director-picture-grid .entity-image-shell{width:100%;aspect-ratio:16/9;}.director-picture-grid img{width:100%;height:100%;object-fit:cover;}
.director-reference-generator{width:min(560px,calc(100vw - 32px));}.director-reference-generator textarea{box-sizing:border-box;width:100%;min-height:170px;padding:12px;border:1px solid #88888830;border-radius:7px;background:transparent;color:inherit;resize:vertical;}
.director-reference-generator-options{display:flex;gap:8px;margin:12px 0;}.director-reference-generator-options select{min-width:0;flex:1;padding:6px;border:1px solid #88888830;border-radius:4px;background:transparent;color:inherit;}
#directorImageMentions{position:fixed;z-index:27000;box-sizing:border-box;max-height:240px;overflow:auto;border:1px solid #88888830;border-radius:8px;background:#fff;box-shadow:0 6px 24px #0002;}
#directorImageMentions button{display:flex;align-items:center;gap:9px;box-sizing:border-box;width:100%;min-height:45px;padding:5px 7px;border:0;border-radius:5px;background:transparent;color:inherit;text-align:left;cursor:pointer;}
#directorImageMentions button[aria-selected="true"],#directorImageMentions button:hover{background:#7f8da514;}
#directorImageMentions .entity-image-shell{flex:0 0 42px;width:42px;height:31px;border-radius:3px;overflow:hidden;}#directorImageMentions img{width:100%;height:100%;object-fit:cover;}
#directorImageMentions button>span{min-width:0;font-size:12px;}#directorImageMentions small{display:block;color:#929ba8;font-size:10px;}#directorImageMentions p{padding:8px;color:#929ba8;font-size:12px;}
html.dark-mode #directorReferenceMenu,html.dark-mode #directorImageMentions,html.dark-mode .director-picture-picker,html.dark-mode .director-reference-generator{background:#2a2a2a;color:#cbd2df;}

#editorView .director-content-editor{box-sizing:border-box;display:block;min-height:76px;max-height:none;padding:7px 8px;outline:none;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:12px;text-align:left;color:inherit;}
#editorView .director-image-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 2px;padding:1px 4px 1px 2px;border:1px solid #cbd5e1;border-radius:4px;background:#edf2f8;color:#52677d;vertical-align:middle;white-space:nowrap;user-select:all;line-height:18px;}
#editorView .director-image-chip>.entity-image-shell{display:inline-block;flex:0 0 22px;width:22px;height:18px;border-radius:2px;overflow:hidden;}
#editorView .director-image-chip img{width:100%;height:100%;object-fit:cover;}
#editorView .director-image-chip>span:last-child{overflow:hidden;text-overflow:ellipsis;font-size:10px;}
html.dark-mode #editorView .director-image-chip{background:#363636;border-color:#4b5a6c;color:#c1d0e3;}


#directorReferenceGenerator .director-reference-generator{width:min(570px,calc(100vw - 32px));max-height:88dvh;padding:22px;background:#fff;overflow:auto;}
#directorReferenceGenerator .entity-form-images{display:block;width:100%;min-width:0;}
#directorReferenceGenerator .entity-image-workspace{display:flex;flex-direction:column;gap:10px;}
#directorReferenceGenerator .entity-main-image{position:relative;box-sizing:border-box;width:100%;height:350px;border:1px solid #88888825;border-radius:9px;background:#88888806;overflow:visible;}
#directorReferenceGenerator .entity-form-image-preview{position:absolute;inset:0;display:none;border:0;background:transparent;}
#directorReferenceGenerator .entity-inline-prompt{position:absolute;inset:0;display:flex;}
#directorReferenceGenerator .entity-prompt-input-box{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;padding:10px;border:0;background:transparent;}
#directorReferenceGenerator .entity-reference-strip{display:flex;gap:6px;min-height:33px;}
#directorReferenceGenerator .entity-form-prompt{box-sizing:border-box;flex:1;width:100%;min-height:120px;margin:0;padding:10px 2px;border:0;outline:none;resize:none;background:transparent;color:inherit;font:13px/1.8 system-ui;}
#directorReferenceGenerator .entity-composer-footer{display:flex;align-items:center;gap:6px;min-height:38px;padding:0;background:transparent;}
#directorReferenceGenerator .entity-model-control{flex:0 1 40%;min-width:0;}
#directorReferenceGenerator .entity-model-control select{box-sizing:border-box;width:100%;min-width:0;border:0;background:transparent;color:inherit;font-size:11px;}
#directorReferenceGenerator .image-options-trigger{flex:1;min-width:0;width:auto;padding:5px 2px;gap:4px;border:0;background:transparent;color:inherit;font-size:11px;}
#directorReferenceGenerator .director-setting-summary-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#directorReferenceGenerator .entity-control-chevron{flex:none;width:11px;height:11px;}
#directorReferenceGenerator .entity-composer-actions{display:flex;gap:5px;flex:none;}
#directorReferenceGenerator .entity-composer-actions button{display:flex;align-items:center;justify-content:center;width:29px;height:29px;padding:5px;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;}
#directorReferenceGenerator .entity-composer-actions .btn-primary{background:var(--brand);color:#fff;}
#directorReferenceGenerator .entity-composer-actions svg{width:19px;height:19px;}
#directorReferenceGenerator .reference-showing-image .entity-form-image-preview{display:block;}
#directorReferenceGenerator .reference-showing-image .entity-inline-prompt{display:none;}
#directorReferenceGenerator .entity-form-image-preview .entity-image-shell{width:100%;height:100%;}
#directorReferenceGenerator .entity-form-image-preview img{width:100%;height:100%;object-fit:contain;}
#directorReferenceGenerator .shot-image-gallery{height:62px;min-height:62px;}
#directorReferenceGenerator .entity-form-image-status{margin:0;font-size:11px;color:#929aa5;}
html.dark-mode #directorReferenceGenerator .director-reference-generator{background:#262626;color:#cbd2df;}
#directorReferenceGenerator .director-reference-thumb{position:relative;display:block;flex:0 0 30px;width:30px;height:30px;border-radius:4px;overflow:hidden;}
#directorReferenceGenerator .director-reference-thumb .entity-image-shell{width:100%;height:100%;}
#directorReferenceGenerator .director-reference-thumb img{width:100%;height:100%;object-fit:cover;}
#directorReferenceGenerator .director-reference-thumb>button{position:absolute;right:0;top:0;width:13px;height:13px;padding:0;border:0;border-radius:50%;background:#333a;color:#fff;font-size:10px;}
#directorReferenceGenerator .director-add-reference{width:30px;height:30px;padding:0;border:1px solid #88888830;border-radius:5px;background:transparent;color:#8c97a6;font-size:22px;}
#directorReferenceGenerator .image-ratio-icon{flex:none;width:14px;max-height:12px;border:1px solid currentColor;border-radius:2px;}

/* One video card contains several independent shots and shared generation controls. */
#editorView .director-clip-shot{position:relative;padding:5px 0 1px;}
#editorView .director-clip-shot+.director-clip-shot{border-top:1px solid #88888825;}
#editorView .director-clip-heading{display:flex;align-items:center;justify-content:space-between;min-height:23px;padding:0 8px;}
#editorView .director-clip-heading strong{font-size:11px;font-weight:500;color:#8591a1;}
#editorView .director-clip-tools{opacity:0;visibility:hidden;}
#editorView .director-clip-hover-tools .director-clip-tools{opacity:1;visibility:visible;}
#editorView .director-clip-tools button{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;border-radius:3px;background:transparent;color:#8c97a6;cursor:pointer;}
#editorView .director-clip-tools button:hover{background:#88888812;color:var(--brand);}
#editorView .director-clip-tools button:disabled{opacity:.25;cursor:default;}
#editorView .director-clip-shot .director-content-meta{grid-template-columns:minmax(0,2fr) minmax(0,3fr) minmax(0,1.4fr);padding-top:2px;}
#editorView .director-clip-shot .director-content-editor{min-height:60px;padding-top:3px;}
#editorView .director-clip-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 8px;}
#editorView .director-clip-summary>button{padding:3px 0;border:0;background:transparent;color:var(--brand);font:11px system-ui;cursor:pointer;}
#editorView .director-clip-summary>span{font-size:10px;color:#929ba8;text-align:right;}

#editorView .director-clip-summary>button{opacity:0;visibility:hidden;pointer-events:none;}
#editorView .director-hover-body .director-clip-summary>button{opacity:1;visibility:visible;pointer-events:auto;}
#editorView .director-hover-tools .director-clip-summary>button{opacity:0;visibility:hidden;pointer-events:none;}
#editorView .director-table tbody tr:last-child>td:first-child .director-video-preview{border-bottom-left-radius:8px;overflow:hidden;}
@media(hover:none){#editorView .director-content-cell:focus-within .director-clip-summary>button{opacity:1;visibility:visible;pointer-events:auto;}}

/* Each video has one collapsible content panel, with tools on each inner shot. */
#editorView .director-table-scroll{border:0;border-radius:0;background:transparent;}
#editorView .director-video-card{position:relative;margin-bottom:10px;border:1px solid var(--director-grid-line);border-radius:9px;background:#fff;}
#editorView .director-video-card:last-child{margin-bottom:0;}
html.dark-mode #editorView .director-video-card{background:#232323;}
#editorView .director-video-card .director-table td.director-content-cell{border-top-right-radius:8px;border-bottom-right-radius:8px;}
#editorView .director-video-card .director-video-preview{border-radius:8px 0 0 8px;overflow:hidden;}
#editorView .director-clip-shots{position:relative;}
#editorView .director-clip-tools{position:absolute;right:-28px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:2px;width:25px;border:1px solid #88888825;border-radius:5px;background:#fff;z-index:8;}
#editorView .director-clip-tools::before{content:'';position:absolute;left:-8px;top:0;bottom:0;width:8px;}
#editorView .director-clip-tools button{width:25px;height:25px;padding:4px;}
#editorView .director-clip-tools svg{width:16px;height:16px;}
#editorView .director-clip-tools [data-clip-action="drag"]{touch-action:none;user-select:none;cursor:grab;}
html.dark-mode #editorView .director-clip-tools{background:#2a2a2a;}
#editorView .director-fold-content{position:absolute;top:6px;right:6px;z-index:3;padding:4px 6px;border:0;border-radius:4px;background:#ffffffce;color:#657386;font-size:10px;cursor:pointer;}
#editorView .director-content-collapsed .director-table,#editorView .director-content-collapsed tbody,#editorView .director-content-collapsed tr{display:block;width:100%;}
#editorView .director-content-collapsed colgroup{display:none;}
#editorView .director-content-collapsed td.director-content-cell{display:none;}
#editorView .director-content-collapsed td.director-video-cell{display:block;width:100%;height:auto;aspect-ratio:16/9;border:0;}
#editorView .director-content-collapsed .director-video-preview{border-radius:8px;}

#editorView .director-clip-dragging::after{content:'';position:absolute;inset:0;border:2px solid #286cf6;border-radius:4px;background:#286cf608;pointer-events:none;z-index:5;}
#editorView .director-clip-dragging .director-clip-tools{opacity:1;visibility:visible;z-index:10;}
#editorView .director-clip-drag-active .director-clip-tools button:not([data-clip-action="drag"]){display:none;}
#editorView .director-clip-dragging [data-clip-action="drag"]{background:#286cf6;color:#fff;cursor:grabbing;}
#editorView .director-clip-drag-active .director-clip-shot:not(.director-clip-dragging) .director-clip-tools{visibility:hidden;opacity:0;}

/* Compact video menu and a background-free playback panel. */
#editorView .director-video-menu{position:absolute;top:6px;left:6px;z-index:12;}
#editorView .director-video-menu>summary{display:flex;align-items:center;justify-content:center;width:24px;height:24px;list-style:none;border-radius:4px;background:#ffffffbb;color:#657386;cursor:pointer;}
#editorView .director-video-menu>summary::-webkit-details-marker{display:none;}
#editorView .director-video-menu>summary svg{width:16px;height:16px;}
#editorView .director-video-menu-items{position:absolute;top:29px;left:0;box-sizing:border-box;width:120px;padding:4px;border:1px solid #88888830;border-radius:6px;background:#fff;box-shadow:0 5px 18px #0002;}
#editorView .director-video-menu-items :is(.director-upload-video,.director-fold-content){position:static;display:block;width:100%;height:auto;opacity:1;visibility:visible;margin:0;padding:7px 8px;border:0;border-radius:4px;background:transparent;color:#657386;text-align:left;text-decoration:none;font-size:11px;}
#editorView .director-video-menu-items button:hover{background:#88888812;}
html.dark-mode #editorView .director-video-menu>summary{background:#2a2a2acc;color:#bdc6d4;}
html.dark-mode #editorView .director-video-menu-items{background:#2a2a2a;}
html.dark-mode #editorView .director-video-menu-items button{color:#bdc6d4;}
#directorVideoViewer .director-video-viewer-dialog,html.dark-mode #directorVideoViewer .director-video-viewer-dialog{padding:0;border:0;box-shadow:none;border-radius:0;background:transparent;overflow:visible;}
#directorVideoViewer .director-video-viewer-main{background:transparent;border-radius:0;}
#directorVideoViewer .modal-close-x{top:-28px;right:0;color:#fff;z-index:3;}
#directorVideoViewer .director-video-viewer-thumbs{background:transparent;}
#editorView .director-video-card .director-video-preview{overflow:visible;}
#editorView .director-video-open{border-radius:inherit;overflow:hidden;}

/* Card-level gutter tools, independent inner-shot tools and hover-only video controls. */
#editorView .director-video-card::after{content:'';position:absolute;top:0;bottom:0;right:-32px;width:32px;background:transparent;}
#editorView .director-video-card.director-card-tools-hover>.director-row-tools,#editorView .director-video-card.director-video-card-drag-source>.director-row-tools{visibility:visible;opacity:1;}
#editorView .director-video-card-drag-source{background:#e7efff;}
#editorView .director-video-card-drag-source>.director-row-tools{background:transparent;border:0;box-shadow:none;z-index:30;}
#editorView .director-video-card-drag-source>.director-row-tools button:not([data-director-row-tool="drag"]){display:none;}
#editorView .director-video-card-drag-source [data-director-row-tool="drag"]{position:relative;background:#286cf6;color:#fff;border-radius:0 6px 6px 0;height:40px;}
#editorView .director-card-tools-hover .director-content-composer-footer{opacity:0;visibility:hidden;pointer-events:none;}
#editorView .director-clip-tools{position:static;top:auto;right:auto;transform:none;flex-direction:row;width:auto;border:0;box-shadow:none;background:transparent;}
#editorView .director-clip-tools::before{display:none;}
#editorView .director-clip-tools button{width:20px;height:20px;padding:3px;}
#editorView .director-clip-tools svg{width:14px;height:14px;}
#editorView .director-clip-shot:hover .director-clip-tools,#editorView .director-clip-shot:focus-within .director-clip-tools{opacity:1;visibility:visible;}
#editorView .director-video-menu>summary,#editorView .director-video-preview>.director-fold-content{opacity:0;visibility:hidden;pointer-events:none;}
#editorView .director-video-preview:hover .director-video-menu>summary,#editorView .director-video-menu[open]>summary,#editorView .director-video-preview:hover>.director-fold-content,#editorView .director-video-preview:focus-within>.director-fold-content{opacity:1;visibility:visible;pointer-events:auto;}
#editorView .director-video-preview>.director-fold-content{position:absolute;top:6px;right:6px;left:auto;width:auto;padding:4px 6px;z-index:4;}

/* Fixed director sidebar: video strip above one independently scrolling content editor. */
#editorView.script-storyboard-mode #scriptStoryboardSplit{display:flex;align-items:stretch;gap:10px;padding:0 10px;}
#editorView.script-storyboard-mode #screenplayScroll{min-width:0;overflow:auto;}
#editorView.script-storyboard-mode #scriptStoryboardContent{padding:0;width:100%;max-width:none;margin:0;}
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-right:auto;}
#editorView.script-storyboard-mode #scriptMasterPanel{position:relative;inset:auto;display:flex;flex-direction:column;flex:0 0 48%;width:48%;min-width:300px;height:100%;box-sizing:border-box;overflow:visible;}
#editorView.script-storyboard-mode #scriptMasterList{position:relative;padding:8px 30px 8px 0;overflow-y:auto;overflow-x:hidden;}
#editorView .director-fixed-video-strip{display:flex;flex:none;align-items:start;gap:10px;max-width:100%;padding:2px 1px 10px;overflow-x:auto;overflow-y:visible;}
#editorView .director-fixed-video-item{flex:0 0 145px;min-width:0;border:1px solid #88888830;border-radius:7px;background:#88888806;}
#editorView .director-fixed-video-item.active{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
#editorView .director-fixed-video-preview{position:relative;inset:auto;aspect-ratio:16/9;width:100%;overflow:visible;border-radius:6px;}
#editorView .director-fixed-video-select{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0;border-radius:6px;background:transparent;color:#9aa5b4;cursor:pointer;overflow:hidden;}
#editorView .director-fixed-video-select img{width:100%;height:100%;object-fit:contain;}
#editorView .director-fixed-video-label{display:block;padding:5px;border:0;background:transparent;color:inherit;text-align:center;cursor:pointer;}
#editorView .director-fixed-video-preview>.director-video-open{position:absolute;inset:auto;top:5px;right:5px;width:22px;height:22px;border:0;border-radius:4px;background:#ffffffc9;color:#657386;font-size:15px;opacity:0;visibility:hidden;}
#editorView .director-fixed-video-preview:hover>.director-video-open{opacity:1;visibility:visible;}
#editorView .director-fixed-content-card table{width:100%;table-layout:fixed;}
#editorView .director-fixed-content-card td.director-content-cell{border:0;border-radius:8px;}
#editorView .director-fixed-content-card .director-content-references{padding:9px;}
#editorView.storyboard-script-hidden #screenplayScroll{display:none!important;}
#editorView.storyboard-script-hidden #scriptMasterPanel{flex:1 1 0;width:100%;max-width:none;min-width:0;}
@media(max-width:820px){#editorView.script-storyboard-mode #scriptMasterPanel{min-width:180px;flex-basis:48%;width:48%;}#editorView .director-fixed-video-item{flex-basis:110px;}#editorView.script-storyboard-mode #scriptStoryboardSplit{gap:6px;padding:0 6px;}}

#editorView .director-fixed-video-menu-button{position:absolute;top:5px;left:5px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:3px;border:0;border-radius:4px;color:#657386;opacity:0;visibility:hidden;cursor:pointer;}
#editorView .director-fixed-video-menu-button svg{width:16px;height:16px;}
#editorView .director-fixed-video-preview:hover .director-fixed-video-menu-button,#editorView .director-fixed-video-preview:focus-within .director-fixed-video-menu-button{opacity:1;visibility:visible;}
#directorFixedVideoMenu{position:fixed;z-index:28000;box-sizing:border-box;min-width:120px;border:1px solid #88888830;border-radius:6px;background:#fff;box-shadow:0 5px 18px #0002;}
#directorFixedVideoMenu button{width:100%;padding:7px 8px;border:0;border-radius:4px;background:transparent;color:#657386;text-align:left;font-size:11px;cursor:pointer;}
#directorFixedVideoMenu button:hover{background:#88888812;}
html.dark-mode #directorFixedVideoMenu{background:#2a2a2a;}html.dark-mode #directorFixedVideoMenu button{color:#bdc6d4;}

/* Main video player, small removable windows, then the shared prompt editor. */
#editorView .director-content-composer-footer{opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
#editorView .director-main-video{position:relative;height:clamp(140px,25vh,300px);display:flex;align-items:center;justify-content:center;margin-bottom:9px;border:1px solid #88888825;border-radius:8px;box-sizing:border-box;background:#88888806;overflow:hidden;}
#editorView .director-main-video>video{width:100%;height:100%;object-fit:contain;}
#editorView .director-main-video-status{position:absolute;color:#929cab;font-size:11px;text-align:center;pointer-events:none;padding:0 30px;}
#editorView .director-main-video .director-main-expand{position:absolute;inset:auto;top:7px;right:7px;width:25px;height:25px;border:0;border-radius:4px;background:#ffffffba;color:#687689;cursor:pointer;font-size:17px;}
#editorView .director-main-video:hover .director-main-expand{opacity:1;}
#editorView .director-fixed-video-strip{padding:2px 2px 8px;gap:9px;}
#editorView .director-fixed-video-item{position:relative;flex-basis:95px;}
#editorView .director-fixed-video-label{padding:4px 3px;font-size:10px;}
#editorView .director-delete-video-window{position:absolute;top:3px;right:3px;z-index:5;display:flex;align-items:center;justify-content:center;width:17px;height:17px;padding:0;border:0;border-radius:50%;background:#353c48aa;color:#fff;font-size:13px;cursor:pointer;opacity:0;visibility:hidden;}
#editorView .director-fixed-video-item:hover .director-delete-video-window,#editorView .director-fixed-video-item:focus-within .director-delete-video-window{opacity:1;visibility:visible;}
#editorView .director-fixed-video-preview>.director-video-open{display:none;}
#editorView .director-add-video-window{display:flex;align-items:center;justify-content:center;flex:0 0 55px;height:54px;border:1px dashed #8993a644;border-radius:6px;background:transparent;color:#929baa;font-size:24px;cursor:pointer;}
#editorView.script-storyboard-mode #scriptMasterList{padding-top:12px;}
@media(hover:none){#editorView .director-delete-video-window{opacity:1;visibility:visible;}}
#editorView.script-storyboard-mode #scriptMasterList{height:auto;max-height:none;width:100%;margin-top:0;padding:0;box-sizing:border-box;overflow:hidden;}
#editorView .director-main-video{width:100%;height:auto;aspect-ratio:16/9;flex:0 0 auto;min-height:0;}
#editorView .director-main-video>video{position:absolute;inset:0;}
#editorView .director-fixed-video-strip{min-height:0;flex:0 0 auto;overflow-y:hidden;}
#editorView .director-fixed-content-card{width:100%;height:100%;margin:0;box-sizing:border-box;overflow:hidden;}
#editorView .director-fixed-content-card .director-table,
#editorView .director-fixed-content-card .director-table>tbody,
#editorView .director-fixed-content-card .director-table>tbody>tr{display:block;width:100%;height:100%;min-width:0;box-sizing:border-box;}
#editorView .director-fixed-content-card .director-table td.director-content-cell{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;box-sizing:border-box;}
#editorView .director-fixed-content-card .director-content-references{flex:none;max-height:72px;overflow:auto;box-sizing:border-box;}
#editorView .director-fixed-content-card .director-clip-shots{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;}
#editorView .director-fixed-content-card .director-content-composer-footer{flex:none;}

/* Center the script and director as one compact pair. */
#editorView.script-storyboard-mode #scriptStoryboardSplit{max-width:calc(var(--paper-width,8.5in) + 740px + 18px);margin-inline:auto;justify-content:center;gap:6px;padding-inline:6px;}
#editorView.script-storyboard-mode #screenplayScroll{flex:1 1 0;max-width:calc(var(--paper-width,8.5in) + 4px);padding:0;}
#editorView.script-storyboard-mode .screenplay-paper-stack{margin-left:auto;margin-right:0;}
#editorView.script-storyboard-mode #scriptMasterPanel{flex:1 1 0;width:auto;min-width:180px;max-width:740px;}
#editorView.storyboard-script-hidden #scriptMasterPanel{max-width:740px;}

/* The scrollbar stays visible inside the paper whenever content overflows. */
#editorView #scriptStoryboardSplit{position:relative;}
#editorView #screenplayScroll{scrollbar-width:none;}
#editorView #screenplayScroll::-webkit-scrollbar{display:none!important;width:0!important;}
#editorView .script-scroll-overlay{position:absolute;z-index:25;width:5px;pointer-events:none;opacity:1;}
#editorView .script-scroll-overlay-thumb{position:absolute;inset:0 0 auto;height:30px;border-radius:4px;background:#7b849680;pointer-events:auto;cursor:grab;touch-action:none;}
#editorView .script-scroll-overlay-thumb:active{cursor:grabbing;}
html.dark-mode #editorView .script-scroll-overlay-thumb{background:#aab3c380;}
#editorView.script-storyboard-mode #scriptMasterPanel{overflow:hidden;min-height:0;}
#editorView.script-storyboard-mode .director-main-video{flex:0 1 auto;max-height:48%;}
#editorView.script-storyboard-mode .director-fixed-video-strip{flex:0 0 auto;max-height:90px;}
#editorView.script-storyboard-mode #scriptMasterList{flex:1 1 0;min-height:0;}

/* Thumbnail actions share one small menu; dragging reorders the original windows. */
#editorView .director-fixed-video-menu-button{right:4px;top:4px;background:#ffffffc9;}
#editorView .director-fixed-video-item{touch-action:pan-y;user-select:none;cursor:grab;}
#editorView .director-fixed-video-item img{pointer-events:none;-webkit-user-drag:none;}
#editorView .director-fixed-video-item.director-video-sorting{opacity:.5;cursor:grabbing;}
#editorView .director-video-drop-before::before,#editorView .director-video-drop-after::after{content:'';position:absolute;top:0;bottom:0;width:3px;background:var(--brand);border-radius:2px;pointer-events:none;}
#editorView .director-video-drop-before::before{left:-6px;}
#editorView .director-video-drop-after::after{right:-6px;}
#directorFixedVideoMenu .director-menu-delete{color:#cb5555;}
@media(hover:none){#editorView .director-fixed-video-menu-button{opacity:1;visibility:visible;}}

/* Match the add window to the thumbnail row and keep menu dots unfilled. */
#editorView .director-fixed-video-strip{align-items:stretch;}
#editorView .director-fixed-video-menu-button,
#editorView .director-fixed-video-menu-button:hover,
#editorView .director-fixed-video-menu-button:focus-visible{background:transparent;box-shadow:none;border:0;}
#editorView .director-add-video-window{flex:0 0 95px;width:95px;min-height:0;align-self:stretch;border-radius:7px;}
#directorFixedVideoMenu button:disabled{opacity:.4;cursor:default;}

/* Preview frames and captions are separate; the image fills the frame. */
#editorView .director-fixed-video-strip{align-items:flex-start;}
#editorView .director-fixed-video-item{border:0;background:transparent;box-shadow:none;border-radius:0;}
#editorView .director-fixed-video-item.active{border:0;box-shadow:none;}
#editorView .director-fixed-video-preview{border:1px solid #88888830;box-sizing:border-box;overflow:hidden;}
#editorView .director-fixed-video-item.active .director-fixed-video-preview{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
#editorView .director-fixed-video-select{position:absolute;inset:0;border-radius:inherit;}
#editorView .director-fixed-video-select img{object-fit:cover;}
#editorView .director-fixed-video-label{padding:5px 0 0;line-height:16px;white-space:nowrap;}
#editorView .director-add-video-window{aspect-ratio:16/9;height:auto;border-radius:6px;}
#directorFixedVideoMenu{max-width:calc(100vw - 16px);padding:4px;}
#directorFixedVideoMenu button{white-space:nowrap;}
#editorView .director-main-download{position:absolute;top:7px;right:7px;display:flex;align-items:center;justify-content:center;width:25px;height:25px;padding:4px;border:0;border-radius:4px;background:#ffffffba;color:#687689;cursor:pointer;z-index:2;}
#editorView .director-main-download svg{width:17px;height:17px;}
#editorView .director-main-video .director-main-expand{right:37px;}
#editorView .director-insert-video{position:absolute;top:26px;right:-12px;z-index:12;display:flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;transform:translateY(-50%);border:0;border-radius:50%;background:#37b879;color:#fff;font:16px/1 system-ui;cursor:pointer;opacity:0;transition:opacity .1s;}
#editorView .director-insert-video::before{content:'';position:absolute;inset:-5px;}
#editorView .director-insert-video:hover,#editorView .director-insert-video:focus-visible{opacity:1;}
@media(hover:none){#editorView .director-insert-video{opacity:1;}}

/* Keep the menu as one compact column rather than an intrinsic inline row. */
#directorFixedVideoMenu{display:grid;grid-template-columns:max-content;width:max-content;min-width:0;gap:0;padding:3px;}
#directorFixedVideoMenu button{display:block;width:auto;min-width:0;box-sizing:border-box;padding:6px 8px;}
#editorView .director-main-video .director-main-download{left:7px;right:auto;background:transparent;box-shadow:none;opacity:0;visibility:hidden;}
#editorView .director-main-video .director-main-expand{right:7px;left:auto;background:transparent;box-shadow:none;opacity:0;visibility:hidden;}
#editorView .director-main-video:hover .director-main-download,
#editorView .director-main-video:focus-within .director-main-download,
#editorView .director-main-video:hover .director-main-expand,
#editorView .director-main-video:focus-within .director-main-expand{opacity:1;visibility:visible;}
#editorView .director-add-video-window{flex:0 0 16px;width:16px;height:16px;min-height:16px;aspect-ratio:1;align-self:flex-start;margin-top:18px;padding:0;border:0;border-radius:50%;background:#37b879;color:#fff;font:16px/1 system-ui;box-sizing:border-box;}
@media(hover:none){#editorView .director-main-video .director-main-download,#editorView .director-main-video .director-main-expand{opacity:1;visibility:visible;}}

/* The last insertion point behaves like every gap between video windows. */
#editorView .director-fixed-video-strip{padding-right:16px;box-sizing:border-box;}
html.dark-mode #editorView .director-main-video,
html.dark-mode #editorView .director-fixed-video-preview{background:#1c1c1c;border-color:#393939;}
html.dark-mode #editorView .director-fixed-video-item.active .director-fixed-video-preview{border-color:var(--brand);}

/* Shot number and metadata share one compact heading row. */
#editorView .director-clip-heading{justify-content:flex-start;gap:8px;min-height:28px;}
#editorView .director-clip-heading>strong{flex:none;white-space:nowrap;}
#editorView .director-clip-heading>.director-content-meta{flex:1 1 0;min-width:0;padding:0;border:0;gap:6px;}
#editorView .director-clip-heading .director-content-meta label{min-width:0;gap:3px;}
#editorView .director-clip-heading .director-content-meta input{width:100%;min-width:0;}

/* Assistant replies use the full available chat width. */
#projectAIChat #aiChatMsgs .chat-msg.ai{min-width:0;align-items:stretch;}
#projectAIChat #aiChatMsgs .chat-msg.ai>.chat-bubble{width:100%;max-width:100%;min-width:0;box-sizing:border-box;align-self:stretch;}

/* Assistant answers are plain content; user messages retain their bubbles. */
#projectAIChat #aiChatMsgs .chat-msg.ai>.chat-bubble,
html.dark-mode #projectAIChat #aiChatMsgs .chat-msg.ai>.chat-bubble{background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;}

/* Round all four corners of the complete style bar, including its outer shell. */
#editorView #screenplayToolbarShell{border-radius:10px;overflow:hidden;background:var(--editor-surround);}
#editorView #screenplayToolbarShell>.screenplay-toolbar,
.app.editor-focus-mode #editorView #screenplayToolbarShell>.screenplay-toolbar{border-radius:10px!important;}

/* Float a content-sized style bar inside the paper instead of spanning its width. */
#editorView #screenplayToolbarShell{position:sticky;top:12px;width:max-content;max-width:calc(100% - 16px);height:28px;margin:0 auto -28px;flex:none;background:transparent;box-shadow:0 2px 10px #00000012;}
#editorView #screenplayToolbarShell>.screenplay-toolbar,
.app.editor-focus-mode #editorView #screenplayToolbarShell>.screenplay-toolbar{width:max-content!important;max-width:100%;height:28px;min-height:28px;margin:0;padding-inline:8px;justify-content:flex-start;border:1px solid #e3e3e3;}
html.dark-mode #editorView #screenplayToolbarShell>.screenplay-toolbar{border-color:#353535;}

/* The reorder marker follows only the preview, with captions aligned underneath. */
#editorView .director-video-drop-before::before,#editorView .director-video-drop-after::after{bottom:auto;height:var(--director-preview-height,54px);}
#editorView .director-fixed-video-label{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;text-align:left;}
#editorView .director-video-time{margin-left:auto;text-align:right;}
#editorView .director-video-select-box{position:absolute;top:5px;left:5px;z-index:5;display:flex;align-items:center;justify-content:center;width:15px;height:15px;padding:1px;border:1.5px solid #fff;border-radius:3px;background:#0002;box-shadow:0 0 2px #0006;color:#fff;cursor:pointer;opacity:0;visibility:hidden;}
#editorView .director-video-select-box svg{width:11px;height:11px;opacity:0;}
#editorView .director-fixed-video-item:hover .director-video-select-box,
#editorView .director-fixed-video-preview:focus-within .director-video-select-box,
#editorView .director-video-multi-select .director-video-select-box{opacity:1;visibility:visible;}
#editorView .director-video-select-box[aria-checked="true"]{background:var(--brand);}
#editorView .director-video-select-box[aria-checked="true"] svg{opacity:1;}
@media(hover:none){#editorView .director-video-select-box{opacity:1;visibility:visible;}}

/* Restore centered captions and make selection mode exclusive. */
#editorView .director-fixed-video-label{display:block;text-align:center;}
#editorView .director-fixed-video-menu-button{color:#fff;filter:drop-shadow(0 0 2px #0008);}
#editorView .director-fixed-video-item:focus-within .director-fixed-video-menu-button{color:#fff;}
#editorView .director-video-multi-select .director-fixed-video-menu-button,
#editorView .director-video-multi-select .director-insert-video,
#editorView .director-video-multi-select .director-video-open,
#editorView .director-video-multi-select .director-add-video-window{display:none!important;}
#editorView .director-video-multi-select .director-fixed-video-item,
#editorView .director-video-multi-select .director-fixed-video-select{cursor:pointer;}
#editorView .director-video-multi-select .director-fixed-video-select>span{visibility:hidden;}

/* One shared main frame switches between video and its prompt. */
#editorView.script-storyboard-mode #scriptMasterPanel>.director-main-video{flex:1 1 0;min-height:160px;margin-bottom:8px;}
#editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:36px 0 0;z-index:2;background:#fff;}
#editorView #directorMainVideo>#scriptMasterList[hidden]{display:none!important;}
#editorView .director-main-prompt-toggle{position:absolute;top:7px;right:8px;z-index:4;padding:4px 8px;border:0;border-radius:5px;background:#ffffffd9;color:#555;font:11px/18px system-ui;cursor:pointer;}
#editorView .show-director-prompt>video,#editorView .show-director-prompt>.director-main-video-status{visibility:hidden;}
#editorView #directorMainVideo .director-fixed-content-card{border:0;border-radius:0;}
html.dark-mode #editorView #directorMainVideo>#scriptMasterList{background:#232323;}
html.dark-mode #editorView .director-main-prompt-toggle{background:#303030dc;color:#ddd;}
#editorView.script-storyboard-mode #directorVideoStrip.director-video-grid{position:relative;display:grid;grid-template-columns:repeat(auto-fill,95px);grid-auto-rows:75px;align-content:start;justify-content:start;gap:10px;flex:0 1 auto;width:100%;min-height:0;max-height:341px;padding:3px 16px 8px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;}
#editorView .director-video-grid .director-fixed-video-item{width:95px;min-width:0;height:75px;}

/* A quiet preview header and a compact library establish the two levels. */
#editorView.script-storyboard-mode #scriptMasterPanel{padding:8px 0;gap:0;}
#editorView.script-storyboard-mode #scriptMasterPanel>.director-main-video{border:1px solid #dfdfdf;border-radius:10px;background:#f3f3f3;min-height:190px;margin-bottom:10px;}
#editorView .director-preview-heading{position:absolute;inset:0 0 auto;height:38px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px;background:#fff;border-bottom:1px solid #ededed;}
#editorView .director-preview-title{display:flex;align-items:baseline;gap:7px;min-width:0;white-space:nowrap;}
#editorView .director-preview-title strong{font:500 12px/1.4 system-ui;color:#444;}
#editorView .director-preview-title small{font:10px/1.4 system-ui;color:#999;}
#editorView .director-preview-tabs{display:flex;gap:2px;padding:2px;border-radius:6px;background:#f1f1f1;}
#editorView .director-preview-tabs button{padding:3px 9px;border:0;border-radius:4px;background:transparent;color:#999;font:11px/16px system-ui;cursor:pointer;}
#editorView .director-preview-tabs button[aria-pressed="true"]{background:#fff;color:#333;box-shadow:0 1px 2px #0000000c;}
#editorView .director-preview-tabs button:disabled{opacity:.4;cursor:default;}
#editorView #directorMainVideo>video{top:38px;height:calc(100% - 38px);}
#editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{padding-top:38px;}
#editorView .director-library-heading{display:flex;align-items:center;justify-content:space-between;flex:none;min-height:27px;padding:0 14px 5px;color:#999;font:11px/18px system-ui;}
#editorView .director-library-heading>div{display:flex;align-items:center;gap:8px;}
#editorView .director-library-heading button{display:flex;align-items:center;justify-content:center;min-height:21px;padding:2px 4px;border:0;border-radius:4px;background:transparent;color:#888;font:11px/16px system-ui;cursor:pointer;}
#editorView .director-library-heading button:hover{background:#88888812;color:#555;}
#editorView .director-library-heading button[hidden]{display:none!important;}
#editorView .director-library-heading svg{width:15px;height:15px;}
#editorView.script-storyboard-mode #directorVideoStrip.director-video-grid{grid-template-columns:repeat(var(--director-grid-columns,3),minmax(0,1fr));grid-auto-rows:var(--director-thumb-row,80px);gap:12px;max-height:calc(var(--director-thumb-row,80px)*4 + 48px);padding:4px 14px 8px;}
#editorView .director-video-grid .director-fixed-video-item{width:100%;height:var(--director-thumb-row,80px);}
#editorView .director-video-grid .director-fixed-video-label{font-size:10px;color:#888;padding-top:6px;}
#editorView .director-video-grid .active .director-fixed-video-label{color:#444;}
#editorView .director-video-grid .director-fixed-video-preview{border-radius:6px;}
#editorView .director-video-grid .director-insert-video{top:calc((var(--director-thumb-row,80px) - 25px)/2);right:-14px;}
html.dark-mode #editorView.script-storyboard-mode #scriptMasterPanel>.director-main-video{background:#181818;border-color:#363636;}
html.dark-mode #editorView .director-preview-heading{background:#232323;border-color:#333;}
html.dark-mode #editorView .director-preview-title strong{color:#ddd;}
html.dark-mode #editorView .director-preview-tabs{background:#1b1b1b;}
html.dark-mode #editorView .director-preview-tabs button[aria-pressed="true"]{background:#363636;color:#eee;box-shadow:none;}
html.dark-mode #editorView .director-video-grid .active .director-fixed-video-label{color:#ddd;}

/* The preview stays fixed at the top with a constant 16:9 outer frame. */
#editorView.script-storyboard-mode #scriptMasterPanel>.director-main-video{flex:0 0 auto;width:100%;height:auto;min-height:0;max-height:none;}
#editorView .director-preview-title{flex:1 1 0;}
#editorView #directorPreviewTitle{box-sizing:border-box;display:block;width:100%;min-width:0;height:26px;padding:3px 4px;border:0;border-radius:4px;background:transparent;color:#444;font:500 12px/20px system-ui;text-overflow:ellipsis;outline:none;}
#editorView #directorPreviewTitle:hover,#editorView #directorPreviewTitle:focus{background:#8888880d;}
#editorView .director-preview-tabs{flex:none;}
#editorView .director-library-heading{flex-wrap:wrap;gap:4px;}
#editorView .director-library-count{gap:7px;}
#editorView .director-library-heading>div{gap:5px;}
#editorView .director-library-count>button{font-size:10px;color:#888;}
#editorView #directorBatchDelete{color:#b96464;}
#editorView .director-library-heading button:disabled{opacity:.4;cursor:default;}
html.dark-mode #editorView #directorPreviewTitle{color:#ddd;}

/* The header sits outside the 16:9 video/prompt area. */
#editorView #scriptMasterPanel>.director-preview-heading{position:relative;inset:auto;flex:0 0 38px;width:100%;height:38px;border:1px solid #dfdfdf;border-bottom:0;border-radius:10px 10px 0 0;box-sizing:border-box;}
#editorView.script-storyboard-mode #scriptMasterPanel>.director-main-video{aspect-ratio:16/9;border-radius:0 0 10px 10px;}
#editorView #directorMainVideo>video{inset:0;width:100%;height:100%;}
#editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{padding-top:0;}
html.dark-mode #editorView #scriptMasterPanel>.director-preview-heading{border-color:#363636;}

/* Square preview frames, clipped captions, and a library filling the remaining height. */
#editorView #scriptMasterPanel>.director-preview-heading,
#editorView.script-storyboard-mode #scriptMasterPanel>.director-main-video,
#editorView .director-video-grid .director-fixed-video-preview,
#editorView .director-video-grid .director-fixed-video-select{border-radius:0;}
#editorView .director-video-grid .director-fixed-video-label{max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView.script-storyboard-mode #scriptMasterPanel{padding-bottom:0;}
#editorView.script-storyboard-mode #directorVideoStrip.director-video-grid{flex:1 1 0;max-height:none;height:auto;padding-bottom:0;}
#editorView .director-library-actions{flex-wrap:wrap;justify-content:flex-end;}
#editorView #directorSelectedCount{white-space:nowrap;color:#888;font-size:11px;}
#editorView #directorSelectedCount[hidden]{display:none!important;}

/* Compact icon actions and smaller selection squares. */
#editorView .director-library-heading .director-library-icon{width:23px;height:23px;padding:3px;}
#editorView .director-library-icon svg{width:16px;height:16px;}
#editorView .director-video-select-box{width:12px;height:12px;padding:0;border-width:1.2px;border-radius:2px;}
#editorView .director-video-select-box svg{width:9px;height:9px;}
#editorView .director-video-select-box::before{content:'';position:absolute;inset:-4px;}
#editorView.script-storyboard-mode{--director-panel-gap:6px;}
#editorView.script-storyboard-mode #scriptStoryboardSplit{gap:var(--director-panel-gap);}
#editorView.script-storyboard-mode #scriptMasterPanel{padding-top:var(--director-panel-gap);}
#directorConfirmDialog{position:fixed;inset:0;margin:auto;width:min(340px,calc(100vw - 32px));height:fit-content;max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;padding:20px;border:1px solid #e5e5e5;border-radius:10px;background:#fff;color:#333;box-shadow:0 12px 48px #0003;font:13px/1.6 system-ui;}
#directorConfirmDialog::backdrop{background:#0000009e;}
#directorConfirmDialog h3{margin:0 0 9px;font:600 15px/1.5 system-ui;}
#directorConfirmDialog p{margin:0 0 20px;color:#888;}
#directorConfirmDialog .director-confirm-actions{display:flex;justify-content:flex-end;gap:8px;}
#directorConfirmDialog button{padding:6px 15px;border:1px solid #e5e5e5;border-radius:5px;background:transparent;color:#777;font:12px/20px system-ui;cursor:pointer;}
#directorConfirmDialog button:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}
#directorConfirmDialog .director-confirm-delete{border-color:#c55151;background:#c55151;color:#fff;}
html.dark-mode #directorConfirmDialog{border-color:#393939;background:#232323;color:#ddd;}
html.dark-mode #directorConfirmDialog button:not(.director-confirm-delete){border-color:#444;color:#bbb;}

/* The add control outside a preview must not reveal its selection box. */
#editorView .director-fixed-video-item:has(>.director-insert-video:hover) .director-video-select-box{opacity:0;visibility:hidden;}

/* Show the calculated video cost next to its generation icon. */
#editorView .director-row-generate [data-director-action="video"]{width:auto;min-width:25px;gap:4px;white-space:nowrap;}
#editorView .director-video-credit-cost{font:10px/16px system-ui;color:inherit;font-variant-numeric:tabular-nums;}
#editorView .director-content-composer-footer .director-settings-trigger{flex:1 1 auto;min-width:0;max-width:none;}
#editorView .director-content-composer-footer .director-video-model-select{flex:0 1 105px;}

/* Let footer controls wrap instead of clipping the generation icon and cost. */
#editorView #directorMainVideo .director-content-composer-footer{box-sizing:border-box;width:100%;min-width:0;padding:7px 9px;overflow:visible;}
#editorView #directorMainVideo .director-content-composer-footer .director-row-controls{display:flex;flex-wrap:wrap;min-width:0;gap:5px;}
#editorView #directorMainVideo .director-content-composer-footer .director-video-model-select{flex:1 1 85px;max-width:none;min-width:0;}
#editorView #directorMainVideo .director-content-composer-footer .director-settings-trigger{flex:1 1 100px;min-width:0;}
#editorView #directorMainVideo .director-content-composer-footer .director-row-generate{flex:0 0 auto;margin-left:auto;min-width:max-content;gap:6px;}
#editorView #directorMainVideo .director-row-generate [data-director-action="video"]{display:inline-flex;align-items:center;justify-content:center;flex:none;width:auto;min-width:27px;padding:3px 5px;gap:4px;}
#editorView #directorMainVideo .director-video-credit-cost:empty{display:none;}
#editorView #directorMainVideo .director-clip-shots{padding-bottom:8px;scroll-padding-bottom:12px;}
#editorView .director-reviewing-optimization .director-clip-tools{display:none!important;}
#editorView .director-optimization-review{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;padding:6px 10px;border-top:1px solid #e7e7e7;background:#fafafa;color:#888;font:11px/18px system-ui;}
#editorView .director-optimization-review>div{display:flex;gap:6px;}
#editorView .director-optimization-review button{padding:3px 10px;border:0;border-radius:4px;background:transparent;color:#777;font:11px/18px system-ui;cursor:pointer;}
#editorView .director-optimization-review .director-optimization-save{background:var(--brand);color:#fff;}
html.dark-mode #editorView .director-optimization-review{border-color:#393939;background:#242424;color:#aaa;}
html.dark-mode #editorView .director-optimization-review button:not(.director-optimization-save){color:#ccc;}

#editorView .director-optimization-review [data-director-optimization="compare"][aria-pressed="true"]{background:#e8e8e8;color:#444;}
html.dark-mode #editorView .director-optimization-review [data-director-optimization="compare"][aria-pressed="true"]{background:#3a3a3a;color:#eee;}

/* Emphasize generation and keep project tiles square at every screen size. */
#editorView #directorMainVideo .director-content-composer-footer .director-row-generate [data-director-action="video"]{background:var(--brand);color:#fff;border:1px solid transparent;border-radius:6px;padding:4px 8px;min-height:28px;box-shadow:0 2px 5px #00000012;}
#editorView #directorMainVideo .director-content-composer-footer .director-row-generate [data-director-action="video"]:hover:not(:disabled){background:var(--brand);color:#fff;filter:brightness(1.08);}
#editorView #directorMainVideo .director-content-composer-footer .director-row-generate [data-director-action="video"]:disabled{opacity:.45;cursor:default;box-shadow:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-card{aspect-ratio:1/1;min-width:0;}

/* Keep account access beside editor settings even while navigation is hidden. */
#editorView #editorUserAvatar{display:inline-flex;align-items:center;justify-content:center;min-height:20px;margin:0;border:0;border-radius:50%;background:var(--brand);color:#fff;font:500 10px/1 system-ui;cursor:pointer;overflow:hidden;}
#editorView #editorUserAvatar.guest{background:#ddd;color:#777;}
#editorView #editorUserAvatar:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}
html.dark-mode #editorView #editorUserAvatar.guest{background:#3a3a3a;color:#bbb;}

/* Restore the original rectangular project ratio, while keeping square corners. */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-card{aspect-ratio:.8/1;}
#exportDropdown{width:280px;min-width:0;max-width:calc(100vw - 20px);padding:6px;}
#exportDropdown .export-category-tabs{display:flex;gap:3px;padding:3px;margin-bottom:5px;border-radius:7px;background:#f4f4f4;}
#exportDropdown .export-category-tabs>button{flex:1;justify-content:center;width:auto;min-width:0;padding:5px 6px;font-size:12px;border-radius:5px;}
#exportDropdown .export-category-tabs>button[aria-selected="true"]{background:#fff;color:#333;box-shadow:0 1px 3px #0001;}
#exportDropdown [data-export-panel][hidden]{display:none!important;}
#exportDropdown .em-label{white-space:normal;overflow-wrap:anywhere;line-height:1.45;}
html.dark-mode #exportDropdown .export-category-tabs{background:#222;}
html.dark-mode #exportDropdown .export-category-tabs>button[aria-selected="true"]{background:#363636;color:#ddd;}
html[lang="en"] #editorView .director-library-heading,html[lang="pt-BR"] #editorView .director-library-heading{font-size:10px;}
html[lang="en"] #editorView .director-optimization-review,html[lang="pt-BR"] #editorView .director-optimization-review{flex-wrap:wrap;}
html[lang="en"] #editorView .director-content-meta label>span,html[lang="pt-BR"] #editorView .director-content-meta label>span{font-size:9px;}
#editorView .director-clip-heading{flex-wrap:wrap;}
#editorView .director-clip-heading .director-content-meta{flex:1 1 160px;}

#editorView #editorUserAvatar{min-width:0;}
html[lang="en"] #editorView .director-content-meta label,
html[lang="pt-BR"] #editorView .director-content-meta label{flex-direction:column;align-items:stretch;gap:1px;}
html[lang="en"] #editorView .director-content-meta label>span,
html[lang="pt-BR"] #editorView .director-content-meta label>span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:13px;}

/* Accommodate French and Russian labels without clipping controls. */
#exportDropdown{width:320px;}
#exportDropdown .export-category-tabs>button{font-size:11px;padding-inline:4px;}
html[lang="fr"] #editorView .director-library-heading,html[lang="ru"] #editorView .director-library-heading{font-size:10px;}
html[lang="fr"] #editorView .director-optimization-review,html[lang="ru"] #editorView .director-optimization-review{flex-wrap:wrap;}
html[lang="fr"] #editorView .director-content-meta label,html[lang="ru"] #editorView .director-content-meta label{flex-direction:column;align-items:stretch;gap:1px;}
html[lang="fr"] #editorView .director-content-meta label>span,html[lang="ru"] #editorView .director-content-meta label>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;line-height:13px;}
#editorView .side-primary-tabs{min-width:0;}
#editorView .side-primary-tab{min-width:0;}

html[lang="fr"] #editorView .side-primary-tab,html[lang="ru"] #editorView .side-primary-tab{padding-inline:6px;font-size:11px;white-space:normal;line-height:1.25;}

/* Account identity, usage, and editable details have separate quiet sections. */
#accountCenterModal .account-modal-content{width:460px;max-width:calc(100vw - 28px);padding:26px;border-radius:12px;background:#fff;}
#accountCenterModal .account-dialog-heading h2{margin:0;font-size:20px;font-weight:600;color:#333;}
#accountCenterModal .account-dialog-heading p{margin:6px 0 23px;font-size:12px;color:#999;}
#accountCenterModal .account-hero{padding:0;border:0;border-radius:0;background:transparent;gap:12px;}
#accountCenterModal .account-large-avatar{width:46px;height:46px;flex:0 0 46px;border-radius:50%;box-shadow:none;font-size:21px;}
#accountCenterModal .account-identity{min-width:0;gap:4px;}
#accountCenterModal .account-identity strong{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#accountCenterModal .account-identity span{font-size:12px;color:#999;}
#accountCenterModal .account-plan-chip{margin-left:auto;padding:3px 8px;white-space:nowrap;border:1px solid #e7e7e7;background:transparent;color:#888;border-radius:4px;font-size:10px;}
#accountCenterModal .account-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:24px 0;padding:16px 0;border-top:1px solid #eee;border-bottom:1px solid #eee;}
#accountCenterModal .account-stat{padding:0 12px;border:0;border-left:1px solid #eee;border-radius:0;background:transparent;}
#accountCenterModal .account-stat:first-child{padding-left:0;border-left:0;}
#accountCenterModal .account-stat strong{margin-top:5px;font:600 22px/1.3 system-ui;color:#333;}
#accountCenterModal .account-stat span{font-size:11px;color:#999;}
#accountCenterModal .account-edit-grid{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin:0;}
#accountCenterModal .account-field>label{display:block;margin:0 0 6px;font-size:11px;color:#888;font-weight:400;}
#accountCenterModal .acc-edit-row{display:flex;gap:8px;}
#accountCenterModal .acc-edit-row input{flex:1;min-width:0;height:36px;padding:7px 10px;border:1px solid #e5e5e5;border-radius:5px;background:#fafafa;color:inherit;font-size:13px;}
#accountCenterModal .acc-edit-row button{width:auto;flex:none;padding:6px 13px;border:1px solid #e5e5e5;border-radius:5px;background:transparent;color:#777;}
#accountCenterModal .account-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:24px;padding-top:18px;border-top:1px solid #eee;}
#accountCenterModal .account-sync-row{margin:0;padding:0;gap:5px;min-width:0;font-size:10px;color:#999;}
#accountCenterModal .account-footer>.btn{flex:none;padding:7px 12px;font-size:11px;}
#accountCenterModal .account-support-link{display:block;margin-top:17px;text-align:left;font-size:10px;color:#aaa;}
html.dark-mode #accountCenterModal .account-modal-content{background:#202020;}
html.dark-mode #accountCenterModal .account-dialog-heading h2,html.dark-mode #accountCenterModal .account-stat strong{color:#ddd;}
html.dark-mode #accountCenterModal .account-hero,html.dark-mode #accountCenterModal .account-stat{background:transparent;}
html.dark-mode #accountCenterModal .account-stats,html.dark-mode #accountCenterModal .account-stat,html.dark-mode #accountCenterModal .account-footer{border-color:#353535;}
html.dark-mode #accountCenterModal .acc-edit-row input{background:#272727;border-color:#393939;}
html.dark-mode #accountCenterModal .acc-edit-row button,html.dark-mode #accountCenterModal .account-plan-chip{background:transparent;border-color:#3c3c3c;color:#bbb;}
/* Smaller asset tiles and outline cards. */
#assetsView .asset-library-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,150px),174px));gap:16px;}
#assetsView .asset-library-image{height:132px;}
#assetsView .asset-library-card-info{padding:10px;}
#assetsView .asset-library-card-title h2{font-size:13px;}
#assetsView .asset-library-card-info>p{font-size:11px;line-height:1.6;height:35px;margin:6px 0 9px;}
#canvasGrid .track-card-section-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr))!important;gap:16px!important;}
#canvasGrid .track-card-section-grid .canvas-card{padding:11px;}
#canvasGrid .track-card-section-grid .canvas-add-card{min-height:156px!important;}
#canvasGrid .canvas-card h4{font-size:12.5px;}
/* Duration slides between 4 and 30 seconds. */
#directorRowSettings .director-duration-slider{flex:1;min-width:100px;}
#directorRowSettings .director-duration-slider>div{display:flex;justify-content:space-between;align-items:center;gap:8px;font:10px/16px system-ui;color:#999;}
#directorRowSettings .director-duration-slider output{color:inherit;}
#directorRowSettings .director-duration-slider input[type="range"]{width:100%;height:16px;padding:0;border:0;background:transparent;accent-color:var(--brand);cursor:pointer;}
/* Reuse complete proofreading/analysis content in a centered dialog. */
.story-tool-dialog{position:fixed;inset:0;margin:auto;width:min(1040px,calc(100vw - 36px));max-height:calc(100dvh - 40px);height:fit-content;padding:24px;border:1px solid #e6e6e6;border-radius:12px;background:#fafafa;color:#333;box-shadow:0 18px 70px #0003;overflow:auto;}
.story-tool-dialog::backdrop{background:#0000009e;}
.story-tool-dialog>.view{padding:0;}
.story-tool-dialog .story-tool-back{display:none;}
.story-tool-dialog .page-title{font-size:21px;}
.story-tool-dialog .page-sub{font-size:12px;line-height:1.6;}
.story-tool-dialog .story-tool-close{position:sticky;top:0;z-index:12;display:block;margin:0 0 -26px auto;width:26px;height:26px;padding:0;border:0;border-radius:5px;background:#f0f0f0;color:#888;font-size:21px;cursor:pointer;}
.story-tool-dialog #analysisView>div:first-child,.story-tool-dialog .proofreading-header{padding-right:35px;}
html.dark-mode .story-tool-dialog{background:#1c1c1c;color:#ddd;border-color:#373737;}
html.dark-mode .story-tool-dialog .story-tool-close{background:#303030;color:#bbb;}
@media(max-width:700px){#assetsView .asset-library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}#canvasGrid .track-card-section-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;}.story-tool-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 20px);padding:16px;}.story-tool-dialog .structure-grid{grid-template-columns:1fr;}#accountCenterModal .account-modal-content{padding:22px;}#accountCenterModal .account-footer{align-items:flex-start;flex-wrap:wrap;}}

#directorRowSettings [data-video-manual-duration][hidden]{display:none!important;}
#accountCenterModal .account-modal-content{max-height:calc(100dvh - 32px);overflow:auto;}

#accountCenterModal .account-dialog-heading{margin-bottom:22px;}
#accountCenterModal .account-footer{justify-content:flex-end;}
#accountCenterModal .account-name-limit{margin-left:7px;color:#aaa;font-size:10px;font-weight:400;}
#assetsView .asset-library-kind{white-space:nowrap;color:#888;font-size:10px;}

/* Reference assets: one picker, explicit project scope and category filters. */
.reference-assets-dialog .reference-assets-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;}
.reference-assets-dialog .reference-assets-heading h3{margin:0;font-size:16px;}
.reference-assets-close{border:0;background:transparent;color:inherit;font-size:24px;cursor:pointer;padding:0 6px;}
.reference-assets-search{width:100%;box-sizing:border-box;border:1px solid #8884;border-radius:6px;background:transparent;color:inherit;padding:9px 10px;}
.reference-assets-filters{display:flex;flex-wrap:wrap;gap:5px;margin:12px 0 16px;}
.reference-assets-filters button{border:0;border-radius:5px;padding:6px 12px;background:transparent;color:inherit;cursor:pointer;}
.reference-assets-filters button:hover{background:#8881;}
.reference-assets-filters button[aria-pressed=true]{background:var(--brand);color:#fff;}
.reference-assets-dialog .entity-reference-picker-grid button>span{display:block;padding:7px 7px 2px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.reference-assets-dialog .entity-reference-picker-grid small{display:block;font-size:10px;opacity:.65;padding:0 7px 7px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal),#shotImageEditor,#directorReferenceGenerator) .entity-composer-footer .entity-composer-actions button.image-generate-with-credits{display:inline-flex;align-items:center;justify-content:center;gap:5px;width:auto;min-width:53px;flex:0 0 auto;padding:6px 8px!important;}
.image-credit-number{font-size:12px;font-weight:600;line-height:1;}

/* Outline card radius, including the add-card tile. */
#canvasGrid .canvas-card{border-radius:6px!important;}
/* Keep the reference-image surfaces and text in the same theme. */
html.dark-mode #directorReferenceGenerator .director-reference-generator{background:#2a2a2a;color:#ededed;}
html.dark-mode #entityReferencePicker .reference-assets-dialog{background:#2a2a2a;color:#ededed;border-color:#484848;}
html.dark-mode #entityReferencePicker :is(h3,.reference-assets-close,.reference-assets-search,.entity-reference-picker-grid>button,.reference-assets-filters button){color:#ededed;}
html.dark-mode #entityReferencePicker .reference-assets-search{background:#242424;border-color:#505050;caret-color:#ededed;}
html.dark-mode #entityReferencePicker .reference-assets-search::placeholder{color:#aaa;opacity:1;}
html.dark-mode #entityReferencePicker .entity-reference-picker-grid>button{border-color:#484848;}
html.dark-mode #entityReferencePicker .entity-reference-picker-grid small{color:#bdbdbd;opacity:1;}
html.dark-mode #entityReferencePicker .reference-assets-filters button[aria-pressed=true]{background:var(--brand);color:#fff;}
html.dark-mode #entityReferencePicker .reference-assets-filters button:hover{background:#ffffff14;}
html.dark-mode #entityReferencePicker .reference-assets-filters button[aria-pressed=true]:hover{background:var(--brand);}
html.dark-mode :is(.entity-reference-menu,#directorReferenceMenu,#shotReferenceStrip .shot-reference-menu){background:#2a2a2a;color:#ededed;border-color:#484848;}
html.dark-mode :is(.entity-reference-menu,#directorReferenceMenu,#shotReferenceStrip .shot-reference-menu)>button{color:#ededed;}
html.dark-mode :is(.entity-reference-menu,#directorReferenceMenu,#shotReferenceStrip .shot-reference-menu)>button:hover{background:#ffffff14;color:#fff;}
html.dark-mode #directorReferenceGenerator :is(textarea,select,.image-options-trigger){color:#ededed;}
html.dark-mode #directorReferenceGenerator textarea::placeholder{color:#aaa;opacity:1;}
html.dark-mode #directorReferenceGenerator select option{background:#2a2a2a;color:#ededed;}

/* Track titles stay labels; actions live in a separate hover menu. */
#editorView .outline-track-label{padding-right:3px;cursor:grab;}
#editorView .outline-track-label::after{display:none!important;}
#editorView .outline-track-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#editorView .outline-track-menu-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:20px;padding:2px;margin-left:3px;border:0;border-radius:4px;background:transparent;color:inherit;opacity:0;cursor:pointer;}
#editorView .outline-track-label:hover .outline-track-menu-button,
#editorView .outline-track-label:focus-within .outline-track-menu-button{opacity:1;}
#editorView .outline-track-menu-button:hover{background:#8882;}
#trackContextMenu button:disabled{opacity:.35;cursor:default;pointer-events:none;}
@media(hover:none){#editorView .outline-track-menu-button{opacity:1;}}

/* Overlay actions do not consume the title's text width. */
#editorView .outline-track-menu-button{position:absolute;right:3px;top:50%;transform:translateY(-50%);z-index:1;flex:none;margin:0;background:inherit;}
#editorView .outline-track-label.is-renaming .outline-track-menu-button{visibility:hidden;}
#editorView .outline-track-name-input{flex:1;width:0;min-width:0;height:22px;box-sizing:border-box;padding:1px 3px;margin:0;border:1px solid #88888835;border-radius:3px;background:transparent;color:inherit;font:inherit;outline:none;cursor:text;}

/* Shared dark popup colors: surface, normal text and selected state stay paired. */
html.dark-mode{--popup-surface:#262626;--popup-hover:#343434;--popup-text:#e3e3e3;--popup-muted:#b8b8b8;--popup-accent:#c7ddfa;--popup-border:#494949;}
html.dark-mode :is(#userMenu,.context-menu,.dropdown-content,.menu-language-popup,.entity-image-model-menu,.image-options-popover,#directorRowSettings){background:var(--popup-surface);color:var(--popup-text);border-color:var(--popup-border);}
html.dark-mode #menuLanguagePopup button,
html.dark-mode #entityImageModelMenu button{color:var(--popup-text);}
html.dark-mode #menuLanguagePopup button.active,
html.dark-mode #entityImageModelMenu button.active{background:var(--popup-hover);color:var(--popup-accent);}
html.dark-mode #menuLanguagePopup button:hover,
html.dark-mode #menuLanguagePopup button:focus-visible,
html.dark-mode #entityImageModelMenu button:hover,
html.dark-mode #entityImageModelMenu button:focus-visible{background:var(--popup-hover);color:#fff;}
html.dark-mode #userMenu #menuLanguageTrigger,
html.dark-mode #userMenu #menuLanguageValue{color:var(--popup-text);}
html.dark-mode #userMenu #menuLanguageTrigger:hover{background:var(--popup-hover);color:var(--popup-accent);}
html.dark-mode #userMenu .user-theme-switch{background:#202020;}
html.dark-mode #userMenu .user-theme-switch button.active{background:#3b3b3b;color:#fff;}
html.dark-mode :is(.context-menu,.dropdown-content) button:not(.danger):not(.ctx-swatch){color:var(--popup-text);}
html.dark-mode :is(.context-menu,.dropdown-content) button:not(.danger):not(.ctx-swatch):hover{background:var(--popup-hover);color:#fff;}
html.dark-mode :is(.context-menu,.dropdown-content) button.danger{color:#f1a3a3;}
html.dark-mode :is(.context-menu,.dropdown-content) :is(.ctx-title,.ctx-sub){color:var(--popup-muted);}
html.dark-mode .image-options-popover :is(.image-option-label,label){color:var(--popup-muted);}
html.dark-mode .image-options-popover button{color:var(--popup-text);}
html.dark-mode .image-options-popover button.selected,
html.dark-mode .entity-detail-dialog .image-options-panel button.selected{background:var(--popup-hover);color:var(--popup-accent);border-color:#666;}
html.dark-mode :is(.image-options-popover,#directorRowSettings) :is(input:not([type=range]),select,textarea){background:#222;color:var(--popup-text);border-color:var(--popup-border);}
html.dark-mode :is(.image-options-popover,#directorRowSettings) :is(input,textarea)::placeholder{color:#aaa;opacity:1;}
html.dark-mode :is(.modal,.image-options-popover,#directorRowSettings) select option{background:var(--popup-surface);color:var(--popup-text);}
html.dark-mode #userTutorialModal .tutorial-modal{background:#232323;color:var(--popup-text);}
html.dark-mode #userTutorialModal :is(.modal-title,.tutorial-group-head h3,.tutorial-step b){color:var(--popup-text);}
html.dark-mode #userTutorialModal :is(.modal-sub,.tutorial-step){color:#c4c4c4;}
html.dark-mode #userTutorialModal .tutorial-group{background:#292929;border-color:#424242;}
html.dark-mode #userTutorialModal .tutorial-step{border-color:#414141;}
html.dark-mode #userTutorialModal :is(.tg-icon,.ts-no){background:#353535;color:var(--popup-accent);}

/* The ruler belongs immediately above the scene row, wherever that row is ordered. */
#editorView .outline-ruler{position:relative;top:auto;}
#inspirationView .inspiration-workspace{margin-top:0;}
#assetsView .asset-library-heading .page-title{margin-bottom:0;}

/* The ruler uses the same dynamic row height as every outline track. */
#editorView .outline-ruler{height:var(--row-h,22px);min-height:var(--row-h,22px);box-sizing:border-box;}

/* Fixed ruler height; full visible width remains marked at every zoom level. */
#editorView .outline-ruler{height:22px;min-height:22px;max-height:22px;flex:0 0 22px;}
#editorView .ruler-ticks{overflow:hidden;}
#editorView #outlineNav{--outline-title-surface:#fff;box-shadow:0 5px 16px #25344d24,0 1px 4px #25344d14;}
#editorView #outlineNav :is(.ruler-spacer,.outline-track-label){background:var(--outline-title-surface);}
html.dark-mode #editorView #outlineNav{--outline-title-surface:#212121;box-shadow:0 5px 18px #0008,0 1px 5px #0005;}

/* Let the outline's bottom shadow paint above the following editor surface. */
#editorView #outlineNav{z-index:11;}
#editorView .editor-main>.outline-nav-header{z-index:12;}
@media(max-width:820px){#editorView #outlineNav{z-index:80;}.app.editor-active:not(.editor-focus-mode) #editorView .editor-main>.outline-nav-header{z-index:81;}}

#editorView #outlineInner{padding-top:0;}
html.dark-mode #editorView .director-video-model-select option{background:#262626;color:#e3e3e3;}

/* Compact model/settings controls, with matching hover surfaces. */
#editorView #directorMainVideo .director-content-composer-footer .director-video-model-select{flex:0 1 auto;width:auto;field-sizing:content;max-width:100%;padding:4px 5px;min-height:28px;border-radius:4px;cursor:pointer;}
#editorView #directorMainVideo .director-content-composer-footer .director-settings-trigger{flex:0 1 auto;width:max-content;max-width:100%;padding:4px 5px;}
#editorView .director-content-composer-footer .director-video-model-select:hover,
#editorView .director-content-composer-footer .director-video-model-select:focus-visible{background:#7f8da514;color:#35465d;}
html.dark-mode #editorView .director-content-composer-footer .director-video-model-select:hover,
html.dark-mode #editorView .director-content-composer-footer .director-video-model-select:focus-visible{background:#a5b3c51a;color:#e1e7ef;}

/* Match model text to the adjacent settings without a browser focus frame. */
#editorView #directorMainVideo .director-content-composer-footer .director-video-model-select{font-size:11px;font-weight:400;line-height:20px;font-family:inherit;color:#788392;outline:none!important;box-shadow:none!important;border:0!important;}
#editorView #directorMainVideo .director-content-composer-footer .director-video-model-select:focus{outline:none!important;box-shadow:none!important;border:0!important;}
html.dark-mode #editorView #directorMainVideo .director-content-composer-footer .director-video-model-select{color:#b0b8c4;}
#directorRowSettings .director-duration-slider output{display:inline-block;padding:2px 7px;border-radius:4px;background:#eaf1fb;color:#28578f;font-size:12px;font-weight:600;white-space:nowrap;}
html.dark-mode #directorRowSettings .director-duration-slider output{background:#383838;color:#e3e3e3;}
/* One vertical separator per scene end; no line at the time-zero origin. */
#outlineInner .tl-strip,#outlineInner .tl-seg{border-radius:0;}
#outlineInner .tl-seg::after{display:block;right:0;top:0;bottom:0;width:1px;background:rgba(75,85,99,.35);}
html.dark-mode #outlineInner .tl-seg::after{background:rgba(225,230,235,.3);}
#outlineInner .scene-duration-handle:after{display:none;}

/* Clearer sidebar labels and icons in both appearance modes. */
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.active):not(.btn-new-script){color:#414b59;}
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.active):not(.btn-new-script):hover{color:#263446;}
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav) .nav-icon{color:inherit;opacity:1;}
#sidebar .sidebar-section-label{color:#7b8490;}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.active):not(.btn-new-script){color:#c3c8d0;}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.active):not(.btn-new-script):hover{color:#f0f1f3;}
html.dark-mode #sidebar .sidebar-section-label{color:#9da5b0;}

#outlineInner .outline-bar.editing-beat-title{cursor:text;}
#outlineInner .outline-beat-title-input{display:block;flex:1;align-self:center;box-sizing:border-box;width:100%;min-width:0;min-height:0;height:1.2em;margin:0;padding:0 6px;border:0;border-radius:0;outline:none;box-shadow:none;background:transparent;color:inherit;-webkit-text-fill-color:currentColor;caret-color:currentColor;font:inherit;line-height:1.2;user-select:text;}


/* Normal-weight text inside timeline and outline beat blocks. */
#outlineInner .outline-bar,#outlineInner .outline-bar .bar-text,#outlineInner .outline-bar .outline-beat-title-input,
#outlineInner .tl-seg,#outlineInner .tl-seg-num{font-weight:400;}

/* Keep the outline card-view toggle visibly selected while the cards are open. */
#editorView .outline-bottom-zoom [data-outline-view][aria-pressed="true"]{background:var(--brand-soft);color:var(--brand);box-shadow:inset 0 0 0 1px rgba(var(--brand-rgb),.18);}
#editorView .outline-bottom-zoom [data-outline-view][aria-pressed="true"]:hover{background:var(--brand-border);}
html.dark-mode #editorView .outline-bottom-zoom [data-outline-view][aria-pressed="true"]{background:rgba(var(--brand-rgb),.3);color:var(--brand-accent);box-shadow:inset 0 0 0 1px rgba(var(--brand-accent-rgb),.25);}

#editorView .timeline-track>.outline-track-label{cursor:default;}

/* Soft neutral gray keeps the navigation quiet beside the white workspace. */
html:not(.dark-mode) #sidebar,
html:not(.dark-mode) #sidebar :is(.sidebar-header,.sidebar-nav,.sidebar-bottom,.sidebar-bottom-nav,.sidebar-footer){background:#f2f2f0;}

/* Neutral wordmark, independent of the accent color. */
#sidebar .logo{background:none;color:#171717;-webkit-text-fill-color:currentColor;}
html.dark-mode #sidebar .logo{color:#ededed;}

/* Neutral sidebar selection backgrounds, independent of the accent. */
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active{background:#e5e5e3;color:var(--brand);box-shadow:none;}
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active:hover{background:#dededc;}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active{background:#303030;color:var(--brand-accent);}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active:hover{background:#383838;}

/* Selection uses only its gray background; text and icons retain their normal color. */
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active,
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active:hover{color:#414b59;}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active,
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active:hover{color:#c3c8d0;}

/* A single script-page silhouette with a negative-space play symbol. */
#sidebar .logo-mark{color:#222526;}
html.dark-mode #sidebar .logo-mark{color:#e7e8e7;}

/* Subscription page: retain the new plan cards within normal navigation. */
#pricingView{box-sizing:border-box;width:100%;padding:46px 40px 38px;min-height:100%;}
#pricingView .subscription-content{max-width:1180px;}
#pricingView .subscription-header{display:block;text-align:center;margin:0 auto 25px;max-width:720px;}
#pricingView .subscription-eyebrow{font:12px/1.5 ui-monospace,SFMono-Regular,monospace;letter-spacing:3px;margin:0 0 9px;color:#778079;}
#pricingView .page-title{font-family:'Songti SC',SimSun,serif;font-size:32px;line-height:1.4;font-weight:500;letter-spacing:1px;margin:0 0 8px;}
#pricingView .subscription-header>p:last-child{font-size:12px;margin:0;}
#pricingView .subscription-switch{display:flex;justify-content:center;gap:3px;width:max-content;max-width:100%;margin:0 auto 32px;padding:4px;border:1px solid #dfe4df;border-radius:24px;background:#eff2ee;}
#pricingView .subscription-switch button{padding:7px 19px;border:0;border-radius:20px;background:transparent;color:#7d857f;font:12px/18px system-ui;cursor:pointer;}
#pricingView .subscription-switch button[aria-selected="true"]{background:#fff;color:#29362e;box-shadow:0 1px 4px #23332614;}
#pricingView [role="tabpanel"][hidden]{display:none!important;}
#pricingView .subscription-plans>.subscription-section-heading{display:none;}
#pricingView .pricing-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;}
#pricingView .price-card{min-height:460px;padding:25px 20px 18px;border:1px solid #dfe5e0;border-radius:11px;background:linear-gradient(180deg,#f0f3f0 0,#fff 40%);box-shadow:0 2px 5px #2434290c;}
#pricingView .price-card.featured{border-color:rgba(var(--brand-rgb),.4);background:linear-gradient(160deg,rgba(var(--brand-rgb),.13),#fff 64%);box-shadow:0 0 0 1px rgba(var(--brand-rgb),.12),0 3px 8px #2434290c;}
#pricingView .price-card h3{font-size:20px;font-weight:600;}
#pricingView .subscription-plan-desc{font-size:12px;min-height:24px;margin:9px 0 0;}
#pricingView .price{margin:24px 0 22px;}
#pricingView .price strong{font-size:36px;}
#pricingView .price-card ul{order:4;flex:1;display:block;margin:0;padding:0;border:0;}
#pricingView .price-card li{padding:6px 0 6px 19px;font-size:12px;line-height:1.6;color:#768179;}
#pricingView .price-card li::before{content:'✓';font:12px/1.6 system-ui;left:0;top:6px;color:#52665a;}
#pricingView .subscription-plan-action{order:5;margin-top:24px;min-height:36px;background:#fff;border-color:#cad4cd;color:#3c5145;}
#pricingView .subscription-plan-action.btn-primary{background:var(--brand);border-color:var(--brand);color:#fff;}
#pricingView .subscription-plan-action:disabled{background:#ebefeb;color:#839087;cursor:default;}
#pricingView .subscription-recommended{padding:4px 8px;background:#fff;border:1px solid #8882;border-radius:20px;}
#pricingView .subscription-credits{margin-top:0;min-height:460px;padding-top:35px;}
#pricingView .credit-card{padding:25px 22px;background:#ffffffc9;}
#pricingView .subscription-account-strip{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;margin:28px 0 22px;font-size:11px;color:#7e8781;}
#pricingView #subscriptionAccountName,#pricingView #subscriptionCreditBalance{color:#39473e;}
#pricingView .subscription-current{padding:2px 7px;border-color:#dfe4df;font-size:10px;}
#pricingView .subscription-account-strip>button{padding:3px 5px;border:0;background:transparent;color:var(--brand);font:inherit;cursor:pointer;}
#pricingView .subscription-credit-guide{max-width:840px;margin:0 auto;border-top:0;border-bottom-color:#e0e5e0;}
#pricingView .subscription-credit-guide summary{justify-content:center;gap:10px;font-size:11px;padding:10px;}
html.dark-mode #pricingView{--subscription-surface:#252925;--subscription-ink:#e3e6e3;--subscription-muted:#a7afa8;--subscription-line:#3c443c;}
html.dark-mode #pricingView .subscription-switch{background:#232823;border-color:#3d453d;}
html.dark-mode #pricingView .subscription-switch button{color:#a7b0a7;}
html.dark-mode #pricingView .subscription-switch button[aria-selected="true"]{background:#394139;color:#edf0ed;}
html.dark-mode #pricingView .price-card{background:linear-gradient(180deg,#2b312b,#242824 42%);border-color:#414b41;box-shadow:0 2px 6px #0003;}
html.dark-mode #pricingView .price-card.featured{background:linear-gradient(155deg,rgba(var(--brand-rgb),.25),#242824 65%);border-color:rgba(var(--brand-accent-rgb),.5);}
html.dark-mode #pricingView .price-card li{color:#b6beb7;}
html.dark-mode #pricingView .price-card li::before{color:#bacfbe;}
html.dark-mode #pricingView .subscription-recommended{background:#303a31;color:var(--brand-accent);}
html.dark-mode #pricingView .subscription-plan-action:not(.btn-primary){background:#2b332c;border-color:#4d5c4f;color:#dce5dd;}
html.dark-mode #pricingView .subscription-plan-action:disabled{background:#2a302a;color:#929f93;}
html.dark-mode #pricingView .credit-card{background:#252a25;}
html.dark-mode #pricingView :is(#subscriptionAccountName,#subscriptionCreditBalance){color:#d7e0d8;}
html.dark-mode #pricingView .subscription-account-strip>button{color:var(--brand-accent);}
html.dark-mode #pricingView .subscription-credit-guide{border-color:#3b443b;}
@media(min-width:1600px){#pricingView{padding-top:65px;}#pricingView .price-card{min-height:510px;}}
@media(max-width:1250px){#pricingView .pricing-grid{grid-template-columns:repeat(2,minmax(0,1fr));}#pricingView .price-card{min-height:420px;}}
@media(max-width:600px){#pricingView{padding:62px 18px 28px;}#pricingView .page-title{font-size:26px;}#pricingView .subscription-header{margin-bottom:20px;}#pricingView .subscription-switch{margin-bottom:22px;}#pricingView .pricing-grid{grid-template-columns:1fr;gap:15px;}#pricingView .price-card{min-height:360px;padding:22px;}#pricingView .price-card ul{display:block;}#pricingView .credit-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}#pricingView .credit-card{padding:20px 14px;}#pricingView .subscription-credits{min-height:0;padding-top:0;}#pricingView .subscription-account-strip{gap:8px;}}

#pricingView{min-height:0;background:transparent;}
#sidebar .sidebar-bottom{border-top:0;}

/* Fine dotted subscription background, with three billing periods. */
#pricingView{min-height:calc(100dvh - 64px);background-color:#fafbf9;background-image:radial-gradient(#6f7a7230 .7px,transparent .7px);background-size:8px 8px;}
html.dark-mode #pricingView{background-color:#1c1e1c;background-image:radial-gradient(#c3cbc326 .7px,transparent .7px);}
#pricingView .subscription-monthly-equivalent{font-size:11px;color:var(--subscription-muted);margin:-14px 0 18px;}
#pricingView .subscription-return-plans{margin-left:auto;border:0;background:transparent;color:var(--brand);font:inherit;font-size:12px;cursor:pointer;}
html.dark-mode #pricingView .subscription-return-plans{color:var(--brand-accent);}

/* The background belongs to the full content area, including the former page padding. */
.app>.content:has(#pricingView.active){padding:0;min-height:100dvh;background-color:#fafbf9;background-image:radial-gradient(#6f7a7230 .7px,transparent .7px);background-size:8px 8px;}
html.dark-mode .app>.content:has(#pricingView.active){background-color:#1c1e1c;background-image:radial-gradient(#c3cbc326 .7px,transparent .7px);}
#pricingView,html.dark-mode #pricingView{min-height:100%;background:transparent;}

/* Keep selected navigation labels at their regular weight. */
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active{font-weight:400;}
#pricingView .subscription-discount{font-weight:400;opacity:.75;margin-left:3px;white-space:nowrap;}

@media(max-width:600px){#pricingView .subscription-switch button{padding-left:10px;padding-right:10px;}}

/* Discount markers and checkout: prices use the currently selected billing cycle. */
#pricingView .subscription-switch button{position:relative;overflow:visible;}
#pricingView .subscription-discount{position:absolute;top:-8px;right:2px;margin:0;padding:0 3px;font-size:10px;line-height:15px;color:var(--brand);background:#fafbf9;opacity:1;pointer-events:none;}
#pricingView .subscription-monthly-equivalent{display:flex;align-items:baseline;gap:7px;min-height:17px;}
#pricingView .subscription-monthly-equivalent[hidden]{display:none;}
#pricingView .subscription-monthly-equivalent del{color:var(--subscription-muted);opacity:.7;}
#pricingView .subscription-monthly-equivalent span{color:var(--subscription-ink);}
html.dark-mode #pricingView .subscription-discount{background:#1c1e1c;color:var(--brand-accent);}
.subscription-checkout{width:min(1020px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);padding:0;border:0;border-radius:12px;color:#242627;background:#fff;box-shadow:0 22px 80px #0004;overflow:auto;overscroll-behavior:contain;}
.subscription-checkout::backdrop{background:rgba(0,0,0,.618);}
.subscription-checkout .checkout-layout{display:grid;grid-template-columns:1fr 1fr;min-height:610px;}
.subscription-checkout .checkout-summary{display:flex;flex-direction:column;background:#2e3033;color:#f5f5f4;padding:30px 38px;}
.subscription-checkout .checkout-back{display:flex;align-items:center;gap:12px;align-self:flex-start;border:0;padding:0;background:transparent;color:inherit;font:600 19px/24px system-ui;cursor:pointer;}
.subscription-checkout svg{width:22px;height:22px;flex-shrink:0;}
.subscription-checkout .checkout-back svg{color:#bbb;}
.subscription-checkout .checkout-order-heading{margin:48px 0 44px;}
.subscription-checkout .checkout-order-heading>p{font-size:13px;color:#b4b5b7;line-height:1.6;margin:0;}
.subscription-checkout .checkout-order-heading h2{display:flex;align-items:center;gap:12px;margin:7px 0 8px;font:600 clamp(30px,3vw,42px)/1.2 system-ui;letter-spacing:-1px;}
.subscription-checkout .checkout-order-heading small{font-size:13px;font-weight:400;letter-spacing:0;color:#babbbd;white-space:nowrap;}
.subscription-checkout .checkout-line-item{display:flex;align-items:center;gap:12px;font-size:13px;}
.subscription-checkout .checkout-plan-icon{width:42px;height:48px;display:grid;place-items:center;border-radius:7px;background:#ffffff14;color:#d5d8dd;}
.subscription-checkout .checkout-line-item>div{display:flex;flex:1;flex-direction:column;gap:7px;}
.subscription-checkout .checkout-line-item strong{font-weight:500;}
.subscription-checkout .checkout-line-item>div>span{font-size:12px;color:#a9aaad;}
.subscription-checkout .checkout-breakdown{border-top:1px solid #ffffff20;margin-top:24px;padding-top:20px;}
.subscription-checkout .checkout-breakdown>div{display:flex;justify-content:space-between;gap:12px;margin-bottom:16px;font-size:13px;color:#bfc0c2;}
.subscription-checkout .checkout-breakdown>[hidden]{display:none;}
.subscription-checkout .checkout-breakdown>.checkout-total{border-top:1px solid #ffffff20;margin-top:22px;padding-top:22px;color:#fff;font-size:16px;}
.subscription-checkout .checkout-total strong{font-weight:600;}
.subscription-checkout .checkout-summary-note{font-size:11px;line-height:1.7;color:#999c9f;margin-top:auto;padding-top:20px;}
.subscription-checkout .checkout-details{position:relative;padding:44px 38px 30px;background:#fff;color:#242627;}
.subscription-checkout .checkout-close{position:absolute;top:14px;right:14px;display:grid;place-items:center;width:30px;height:30px;border:0;border-radius:50%;color:#85898d;background:transparent;cursor:pointer;}
.subscription-checkout .checkout-close:hover{background:#f0f1f2;color:#222;}
.subscription-checkout h3,.subscription-checkout legend{font-size:17px;font-weight:600;margin:0 0 22px;}
.subscription-checkout .checkout-email-label{display:block;font-size:12px;color:#74787e;margin-bottom:8px;}
.subscription-checkout #checkoutEmail{width:100%;box-sizing:border-box;border:1px solid #dcdfe3;border-radius:7px;padding:12px 13px;background:transparent;color:inherit;font:14px system-ui;outline:none;box-shadow:0 1px 3px #00000008;}
.subscription-checkout #checkoutEmail:focus{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft);}
.subscription-checkout .checkout-methods{border:0;padding:0;margin:30px 0 20px;min-width:0;}
.subscription-checkout .checkout-methods legend{padding:0;margin-bottom:16px;}
.subscription-checkout .checkout-methods label{display:flex;align-items:center;gap:12px;min-height:58px;padding:0 16px;border:1px solid #dfe1e4;cursor:pointer;font-size:14px;}
.subscription-checkout .checkout-methods label+label{border-top:0;}
.subscription-checkout .checkout-methods label:first-of-type{border-radius:8px 8px 0 0;}
.subscription-checkout .checkout-methods label:last-of-type{border-radius:0 0 8px 8px;}
.subscription-checkout .checkout-methods label:has(input:checked){background:var(--brand-soft);}
.subscription-checkout .checkout-methods input{width:16px;height:16px;accent-color:var(--brand);margin:0;}
.subscription-checkout .checkout-method-icon{display:grid;place-items:center;width:25px;font-size:20px;font-weight:700;}
.subscription-checkout .alipay{color:#079bdb;}.subscription-checkout .wechat{color:#20a95d;}
.subscription-checkout .checkout-preview-note{font-size:11px;line-height:1.7;color:#878b90;margin:20px 0;}
.subscription-checkout #checkoutStatus{font-size:12px;line-height:1.6;color:var(--brand);}
.subscription-checkout .checkout-submit{width:100%;padding:13px;border:0;border-radius:7px;background:var(--brand);color:#fff;font:600 14px/22px system-ui;cursor:pointer;}
.subscription-checkout .checkout-submit:hover{filter:brightness(1.06);}
.subscription-checkout button:focus-visible{outline:2px solid var(--brand-accent);outline-offset:3px;}
.subscription-checkout .checkout-footer{text-align:center;font-size:11px;color:#9b9ea3;margin:18px 0 0;}
html.dark-mode .subscription-checkout{color:#e5e5e5;background:#242424;}
html.dark-mode .subscription-checkout .checkout-details{background:#242424;color:#e5e5e5;}
html.dark-mode .subscription-checkout .checkout-summary{background:#191919;}
html.dark-mode .subscription-checkout :is(#checkoutEmail,.checkout-methods label){border-color:#454545;}
html.dark-mode .subscription-checkout .checkout-methods label:has(input:checked){background:#303030;}
html.dark-mode .subscription-checkout .checkout-close:hover{background:#363636;color:#eee;}
@media(max-width:700px){.subscription-checkout{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:10px;}.subscription-checkout .checkout-layout{grid-template-columns:1fr;min-height:0;}.subscription-checkout .checkout-summary{padding:24px;}.subscription-checkout .checkout-order-heading{margin:26px 0;}.subscription-checkout .checkout-order-heading h2{font-size:34px;}.subscription-checkout .checkout-summary-note{padding-top:0;margin-bottom:0;}.subscription-checkout .checkout-details{padding:32px 24px 24px;}.subscription-checkout .checkout-close{top:8px;right:8px;}.subscription-checkout .checkout-methods{margin-top:24px;}}

/* Full-screen subscription page and centered checkout. */
#pricingView[open]{display:flex;position:fixed;inset:0;z-index:500;width:100%;height:100dvh;max-width:none;max-height:none;margin:0;border:0;border-radius:0;min-height:0;overflow:auto;overscroll-behavior:contain;background-color:#fafbf9;background-image:radial-gradient(#6f7a7230 .7px,transparent .7px);background-size:8px 8px;}
html.dark-mode #pricingView[open]{background-color:#1c1e1c;background-image:radial-gradient(#c3cbc326 .7px,transparent .7px);}
#pricingView .subscription-page-close{position:fixed;top:20px;right:24px;z-index:1;display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid #dfe4df;border-radius:50%;background:transparent;color:#68716b;cursor:pointer;}
#pricingView .subscription-page-close:hover{background:#00000006;color:#242b26;}
html.dark-mode #pricingView .subscription-page-close{color:#b9c1bb;border-color:#414741;}
html.dark-mode #pricingView .subscription-page-close:hover{background:#ffffff0b;color:#eee;}
#pricingView .subscription-discount,html.dark-mode #pricingView .subscription-discount{right:-7px;background:transparent;}
#subscriptionCheckout{position:fixed;inset:0;margin:auto;height:fit-content;box-sizing:border-box;}
@media(max-width:600px){#pricingView .subscription-page-close{top:12px;right:12px;width:32px;height:32px;}}

#pricingView:not([open]){display:none;}
#pricingView::backdrop{background:transparent;}
.subscription-checkout .checkout-order-heading{margin-top:26px;}
.subscription-checkout .checkout-details{display:flex;align-items:center;}
.subscription-checkout #subscriptionCheckoutForm{width:100%;}
.subscription-checkout .checkout-methods{margin-top:0;}
@media(max-width:700px){.subscription-checkout .checkout-order-heading{margin-top:22px;}}

#pricingView .subscription-access-notice{max-width:500px;margin:0 auto 22px;text-align:center;font-size:12px;line-height:1.7;color:var(--brand);}
#pricingView .subscription-access-notice[hidden]{display:none;}
#pricingView .price-card.is-required-plan{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
html.dark-mode #pricingView .subscription-access-notice{color:var(--brand-accent);}

/* Project card base sizing, including the create card; the current ratio is set below. */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-card{box-sizing:border-box;aspect-ratio:2/3;height:auto;min-height:0;border-radius:0;}

/* Give poster rows a definite size so tall cards cannot overlap the next row. */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid){grid-auto-rows:var(--project-poster-height,auto);gap:24px;align-items:start;align-content:start;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-card{width:100%;height:var(--project-poster-height,auto);align-self:start;margin:0;}
@media(max-width:820px){:is(#projectBookGrid,#classicWorksGrid .project-book-grid){gap:14px;}}

/* Landscape project cards: sizing and inline grid rows both use 16:9. */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid){grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),280px));}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-card{aspect-ratio:16/9;}
@media(max-width:820px){
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid){grid-template-columns:repeat(2,minmax(0,1fr));}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-card{padding:8px;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .work-card-heading{margin-bottom:5px;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-title{height:1.4em;min-height:1.4em;max-height:1.4em;line-height:1.4;-webkit-line-clamp:1;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .book-bottom-row{padding-top:5px;gap:4px;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-card{gap:5px;font-size:12px;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-plus{font-size:24px;}
}
.image-options-panel .image-count-grid{grid-template-columns:repeat(9,minmax(0,1fr));}
.image-options-panel .image-count-grid button{min-width:0;padding:5px 0;}

/* A single title line, synopsis in the middle, and a quiet footer. */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-title{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:1.4em;min-height:1.4em;max-height:1.4em;line-height:1.4;-webkit-line-clamp:unset;margin:0;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .work-card-heading{margin-bottom:5px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-book-info{flex:1 1 0;min-height:0;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .book-synopsis{display:block;flex:1 1 0;min-height:0;margin:4px 0;line-height:1.5;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .book-bottom-row{border:0;box-shadow:none;padding-top:3px;}
@media(max-width:820px){
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .work-card-heading{margin-bottom:3px;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .book-synopsis{font-size:10px;line-height:1.45;margin:3px 0;}
 :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .book-bottom-row{padding-top:0;line-height:1.4;}
}

/* Neutral view labels and stable horizontal positioning during scene resize. */
#editorView #viewTabs button{color:#171717;}
#editorView #viewTabs button:is(.active,[aria-pressed="true"],:hover){color:#171717;}
html.dark-mode #editorView #viewTabs button,html.dark-mode #editorView #viewTabs button:is(.active,[aria-pressed="true"],:hover){color:#e5e5e5;}
#editorView #outlineScroll,#editorView #outlineInner{overflow-anchor:none;}

/* Tick widths are time distances, never flexible fractions of the ruler width. */
#editorView .outline-ruler .ruler-tick{flex-shrink:0;flex-grow:0;}

/* Scene bodies navigate to text; only the edge handles resize duration. */
#editorView .timeline-track .tl-seg{cursor:pointer;-webkit-user-drag:none;}

/* Neutral navigation hover; language entry follows the other account-menu rows. */
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.btn-new-script):hover{background:#e5e5e3;color:#414b59;}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.btn-new-script):hover{background:#303030;color:#c3c8d0;}
html.dark-mode #userMenu #menuLanguageTrigger{color:#9a9a9a;background:transparent;font-size:13px;font-weight:400;}
html.dark-mode #userMenu #menuLanguageTrigger:hover{background:#242424;color:var(--brand-accent);}
html.dark-mode #userMenu #menuLanguageValue{color:inherit;}
#menuLanguagePopup button{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:400;}
#menuLanguagePopup button.active::after{content:'✓';margin-left:auto;font-size:12px;}
html.dark-mode #menuLanguagePopup button{background:transparent;color:#9a9a9a;}
html.dark-mode #menuLanguagePopup button.active{background:#343434;color:#e3e3e3;}
html.dark-mode #menuLanguagePopup button:hover,html.dark-mode #menuLanguagePopup button:focus-visible{background:#343434;color:#e3e3e3;}

#editorView .director-clip-shots{user-select:text;}
#editorView .director-all-selected input{background:Highlight;color:HighlightText;}

#editorView .director-content-meta .director-meta-value{display:inline-block;flex:1 1 0;min-width:0;max-width:100%;min-height:16px;padding:0;background:transparent;border:0;outline:none;white-space:nowrap;overflow:hidden;font:inherit;line-height:16px;color:inherit;user-select:text;}
#editorView .director-content-meta .director-meta-value:focus{background:#8888880a;border-radius:3px;}
#editorView .director-clip-heading .director-content-meta{grid-template-columns:minmax(0,2fr) minmax(0,3fr) minmax(0,1.4fr);}

#editorView .director-all-selected .director-meta-value{background:Highlight;color:HighlightText;}

#editorView #scriptMasterList .director-meta-value{font-size:11px;}

/* Center the movement label and its editable value as one compact group. */
#editorView #scriptMasterList .director-clip-heading .director-content-meta label:nth-child(2){justify-content:center;align-items:center;}
#editorView #scriptMasterList .director-clip-heading .director-content-meta label:nth-child(2) .director-meta-value{flex:0 1 auto;width:auto;min-width:4ch;max-width:calc(100% - 32px);text-align:left;}

#assetsView .asset-new-prompt{align-self:flex-start;margin:0 0 14px;font-size:12px;}
#assetsView .prompt-asset-preview{height:130px;box-sizing:border-box;padding:14px;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7;color:#7c8590;background:#f5f6f7;}
#assetsView .prompt-asset-card .asset-library-card-footer{margin-top:10px;}
#promptAssetDialog{box-sizing:border-box;width:min(580px,calc(100vw - 28px));max-height:calc(100dvh - 40px);margin:auto;padding:22px;border:1px solid #dfe3e7;border-radius:10px;background:#fff;color:#333;box-shadow:0 16px 60px #0003;overflow:auto;}
#promptAssetDialog::backdrop{background:#0009;}
#promptAssetDialog .prompt-asset-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;}
#promptAssetDialog h2{font-size:17px;margin:0;}
#promptAssetDialog .prompt-asset-header button{border:0;background:transparent;color:inherit;font-size:23px;cursor:pointer;}
#promptAssetDialog label{display:block;font-size:12px;color:#9399a1;margin:12px 0 7px;}
#promptAssetDialog input,#promptAssetDialog textarea{box-sizing:border-box;width:100%;padding:10px;border:1px solid #e0e3e7;border-radius:6px;background:transparent;color:inherit;font:14px/1.7 system-ui;}
#promptAssetDialog textarea{height:280px;max-height:45dvh;resize:none;overflow-y:auto;overscroll-behavior:contain;}
#promptAssetDialog .prompt-asset-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:14px;}
#promptAssetDialog small{margin-left:auto;font-size:11px;color:#999;}
#promptAssetDialog .prompt-asset-delete{color:#bc6464;}
html.dark-mode #promptAssetDialog{background:#252525;color:#ddd;border-color:#454545;}
html.dark-mode #promptAssetDialog input,html.dark-mode #promptAssetDialog textarea{border-color:#444;}
html.dark-mode #assetsView .prompt-asset-preview{background:#2c2c2c;color:#b0b5bc;}

#sideAssetsSection .panel-tabs{flex-wrap:wrap;gap:3px;}
#sideAssetsSection .prompt-sidebar-card{width:100%;text-align:left;font:inherit;cursor:pointer;}
#sideAssetsSection .prompt-sidebar-card .side-info{min-width:0;}
#sideAssetsSection .prompt-sidebar-card p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* Small breathing room within the video prompt frame. */
#editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{padding-left:8px;padding-right:8px;}

#editorView #directorMainVideo.has-generation-error>.director-main-video-status{visibility:visible;z-index:6;bottom:12px;left:12px;right:12px;padding:10px 12px;border-radius:6px;background:#fff0f0;color:#ad5656;white-space:pre-wrap;overflow-wrap:anywhere;max-height:70%;overflow:auto;pointer-events:auto;}
html.dark-mode #editorView #directorMainVideo.has-generation-error>.director-main-video-status{background:#3b2929;color:#e6aaaa;}
#sideAssetsSection .prompt-sidebar-card{display:flex;align-items:center;gap:7px;}
#sideAssetsSection .prompt-sidebar-edit{display:block;flex:1;min-width:0;padding:0;border:0;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer;}
#sideAssetsSection .prompt-sidebar-copy{flex:none;display:grid;place-items:center;width:28px;height:28px;padding:5px;border:0;border-radius:5px;background:transparent;color:#8b929b;cursor:pointer;}
#sideAssetsSection .prompt-sidebar-copy:hover{background:#8882;}
#sideAssetsSection .prompt-sidebar-copy svg{width:16px;height:16px;}

.asset-main-nav-frame{position:relative;min-width:0;}
.asset-main-nav-frame>.style-asset-preview{width:100%;}
.asset-image-step{position:absolute;top:50%;z-index:5;transform:translateY(-50%);display:grid;place-items:center;width:30px;height:38px;padding:5px;border:1px solid #ffffff30;border-radius:7px;background:#252a327a;color:#fff;opacity:0;pointer-events:none;cursor:pointer;transition:opacity .15s,background .15s;}
.asset-image-step svg{width:19px;height:19px;}
.asset-image-previous{left:10px;}.asset-image-next{right:10px;}
.entity-main-image:hover>.asset-image-step,.entity-main-image:focus-within>.asset-image-step,.asset-main-nav-frame:hover>.asset-image-step,.asset-main-nav-frame:focus-within>.asset-image-step{opacity:1;pointer-events:auto;}
.asset-image-step:hover{background:#252a32b3;}.asset-image-step:disabled{opacity:.3;cursor:default;}
.asset-image-step:focus-visible{outline:2px solid #fff;outline-offset:2px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button.selected:not(.entity-thumbnail-remove),#styleAssetModal .style-reference-tile>button.selected:not(.style-reference-remove){box-sizing:border-box;border:2px solid var(--brand);border-radius:7px;padding:0;background:var(--brand-soft);box-shadow:none;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button.selected img,#styleAssetModal .style-reference-tile>button.selected img{border-radius:3px;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button.selected:not(.entity-thumbnail-remove),html.dark-mode #styleAssetModal .style-reference-tile>button.selected:not(.style-reference-remove){border-color:var(--brand-accent);background:#ffffff12;box-shadow:none;}
@media(hover:none){.asset-image-step{opacity:1;pointer-events:auto;}}

#sideList .side-card[data-sort-entity-id],.entity-thumbnail-item[data-sort-image-ref]{user-select:none;-webkit-user-select:none;}
html.entity-sorting-active body,html.entity-sorting-active body *{user-select:none!important;-webkit-user-select:none!important;}
.entity-image-hover-actions .asset-main-icon{display:grid;place-items:center;width:28px;height:28px;padding:5px;border-radius:5px;}
.entity-image-hover-actions .asset-main-icon svg{width:17px;height:17px;}
.entity-image-hover-actions .asset-main-delete:hover{background:#9f4959aa;color:#fff;}
.asset-main-nav-frame:hover>.style-main-image-actions,.asset-main-nav-frame:focus-within>.style-main-image-actions{opacity:1;visibility:visible;pointer-events:auto;}
@media(hover:none){.entity-main-image>.entity-image-hover-actions,.asset-main-nav-frame>.style-main-image-actions{opacity:1;visibility:visible;pointer-events:auto;}}

/* 资产图片库：主图下方统一显示数量及操作，替代顶部方式切换。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-toolbar{order:1;display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 26px;min-width:0;color:#888;font:11px/18px system-ui;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions{display:flex;align-items:center;gap:5px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button{display:flex;align-items:center;justify-content:center;width:23px;min-width:23px;height:23px;min-height:23px;padding:3px;border:0;border-radius:4px;background:transparent;color:#777;box-shadow:none;cursor:pointer;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button svg{width:15px;height:15px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button:hover{background:#88888816;color:#333;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions .asset-main-delete:hover{color:#c34e4e;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button:disabled{opacity:.3;cursor:default;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices{order:2;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices[hidden]{display:none!important;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-workspace{row-gap:6px;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-toolbar{color:#999;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button{color:#aaa;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button:hover{color:#eee;background:#ffffff12;}

/* 图片操作集中在底部操作行。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-toolbar{width:100%;box-sizing:border-box;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions{margin-left:auto;justify-content:flex-end;gap:4px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions .entity-library-text-action{width:auto;min-width:0;padding:2px 4px;white-space:nowrap;font:11px/16px system-ui;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions .asset-main-delete{color:#b96464;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-count{flex-shrink:0;}
@media(max-width:420px){:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions{gap:1px;}}

/* 与视频库一致的文字尺寸及无缝选中边框。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions button{font:11px/16px system-ui;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button.selected img,#styleAssetModal .style-reference-tile>button.selected img{border-radius:5px;}
html[lang="en"] .entity-image-library-toolbar,html[lang="pt-BR"] .entity-image-library-toolbar,html[lang="fr"] .entity-image-library-toolbar,html[lang="ru"] .entity-image-library-toolbar{font-size:10px;}

/* 数量与内容切换同组；文件操作继续靠右。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary{display:flex;align-items:center;gap:7px;min-width:0;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button{display:flex;align-items:center;justify-content:center;min-height:23px;padding:2px 5px;border:0;border-radius:4px;background:transparent;color:#888;font:11px/16px system-ui;white-space:nowrap;cursor:pointer;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button:hover{background:#88888816;color:#333;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button[aria-pressed="true"]{background:#88888816;color:#333;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button:disabled{opacity:.3;cursor:default;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button{color:#aaa;}
html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button:hover,html.dark-mode :is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-summary button[aria-pressed="true"]{background:#ffffff12;color:#eee;}
.entity-shared-frame.is-prompt-view .entity-reference-strip{padding-right:0;}
#editorView .director-library-count .director-preview-tabs{gap:0;padding:0;background:transparent;}
#editorView .director-library-count .director-preview-tabs button{padding:2px 5px;}
#editorView .director-library-count .director-preview-tabs button[aria-pressed="true"]{background:#88888812;box-shadow:none;}

/* 资产缩略图保持正方形，去除容器及图片圆角。 */
#sideList .side-card .side-avatar,#sideList .side-card .side-avatar .entity-image-shell,#sideList .side-card .side-avatar img{border-radius:0;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item,
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button:not(.entity-thumbnail-remove),
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button.selected:not(.entity-thumbnail-remove),
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item .entity-image-shell,
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item img,
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>button.selected img,
#styleAssetModal .style-reference-tile>button:first-child,#styleAssetModal .style-reference-tile>button.selected,#styleAssetModal .style-reference-tile img,#styleAssetModal .style-reference-tile>button.selected img{border-radius:0;}
#editorView .director-library-actions #directorPromptToggle[aria-pressed="true"]{background:#88888812;}

#assetSidebarToolbar{display:flex;align-items:center;justify-content:space-between;gap:6px;flex:none;padding:5px 12px;color:#888;font:11px/18px system-ui;}
#assetSidebarToolbar[hidden]{display:none;}#assetSidebarToolbar>div{display:flex;align-items:center;gap:6px;}
#assetSidebarToolbar button{display:flex;align-items:center;justify-content:center;border:0;border-radius:4px;background:transparent;color:inherit;padding:3px;min-height:23px;font:inherit;cursor:pointer;}
#assetSidebarToolbar button svg{width:16px;height:16px;}#assetSidebarToolbar button:hover{background:#88888818;color:var(--text);}
#assetSidebarToolbar button:disabled{opacity:.3;cursor:default;}#assetSidebarToolbar button:focus-visible{outline:2px solid var(--brand);}
#sideList .side-list-add{display:none!important;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame:not(.is-image),
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame .entity-prompt-input-box,
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-shared-frame .entity-prompt-input-box>.entity-generating-overlay{border-radius:0;}


/* 卡片右侧的单项复制与删除操作。 */
#sideList .side-card[data-sort-entity-id]{position:relative;padding-right:66px;}
#sideList .asset-card-actions{position:absolute;right:8px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:2px;opacity:0;pointer-events:none;}
#sideList .side-card:hover .asset-card-actions,#sideList .side-card:focus-within .asset-card-actions{opacity:1;pointer-events:auto;}
#sideList .asset-card-actions button{display:flex;align-items:center;justify-content:center;width:23px;height:23px;min-height:23px;padding:3px;border:0;border-radius:4px;background:transparent;color:#888;cursor:pointer;}
#sideList .asset-card-actions svg{width:16px;height:16px;}
#sideList .asset-card-actions button:hover{background:#88888818;color:inherit;}
#sideList .asset-card-actions button[data-asset-action="delete"]:hover{color:#c15a5a;}
#sideList .asset-card-actions button:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}
@media(hover:none){#sideList .asset-card-actions{opacity:1;pointer-events:auto;}}

/* 所有草稿使用与图片一致的 56px 方形缩略图。 */
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item{box-sizing:border-box;flex:0 0 56px;width:56px;min-width:56px;height:56px;min-height:56px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-choices .entity-thumbnail-item>.entity-draft-thumbnail{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:56px;min-width:56px;max-width:56px;height:56px;min-height:56px;max-height:56px;padding:0;border-radius:0;font:11px/16px system-ui;white-space:nowrap;}

/* 模型与视频设置从镜头内容相同的左侧基线开始。 */
#editorView #directorMainVideo .director-content-composer-footer{padding-left:8px;padding-right:8px;}
#editorView #directorMainVideo .director-content-composer-footer .director-video-model-select,
#editorView #directorMainVideo .director-content-composer-footer .director-settings-trigger{padding-left:0;padding-right:0;text-align:left;}

#sidebarAssetImporter .sidebar-import-empty{grid-column:1/-1;padding:24px 10px;text-align:center;color:#888;font-size:12px;}
#editorView #directorPreviewTitle{height:24px;padding-top:2px;padding-bottom:2px;}
/* 收起后保留开关与样式标签，随时展开。 */
#sideList .side-card[data-sort-entity-id]{padding-right:35px;}

#editorView #scriptMasterPanel>.director-preview-heading{height:24px;min-height:24px;flex-basis:24px;}
#editorView #directorPreviewTitle{height:22px;padding:1px 4px;font-size:11px;line-height:18px;}
#sideAssetsSection .prompt-sidebar-copy{display:flex;align-items:center;justify-content:center;align-self:stretch;width:34px;min-width:34px;height:auto;min-height:30px;padding:5px 7px;border-left:1px solid #88888825;border-radius:0;}
#sideAssetsSection .prompt-sidebar-copy:hover{background:#8888880d;}
#sideAssetsSection .prompt-sidebar-copy:focus-visible{outline:2px solid var(--brand);outline-offset:-2px;}

/* 提示词仅保留右侧复制区，删除在弹窗中操作。 */
#sideList .side-card.prompt-sidebar-card[data-sort-entity-id]{padding-right:8px;}

#sideAssetsSection .prompt-sidebar-copy.is-copied{color:var(--brand);}

#editorView #scriptMasterPanel>.director-preview-heading{height:28px;min-height:28px;flex-basis:28px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-detail-dialog,#styleAssetModal .style-asset-dialog,#promptAssetDialog{border-radius:6px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions .media-prompt-icon,#editorView .director-library-actions #directorPromptToggle{width:23px;min-width:23px;height:23px;padding:3px;}

:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions .media-prompt-icon,#editorView .director-library-actions #directorPromptToggle{width:40px;min-width:40px;padding:3px 4px;}
:is(#characterModal,#locationModal,:is(#propModal,#styleAssetModal)) .entity-image-library-actions .media-prompt-icon svg,#editorView .director-library-actions #directorPromptToggle svg{width:32px;height:16px;}
.entity-image-library-actions .media-prompt-icon[hidden]{display:none!important;}

#editorView .director-thumbnail-progress{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:8px;background:#191919ba;color:#fff;font:10px/14px system-ui;pointer-events:none;}
#editorView .director-thumbnail-progress>i{display:block;width:70%;height:3px;border-radius:2px;overflow:hidden;background:#ffffff30;}
#editorView .director-thumbnail-progress b{display:block;height:100%;background:#fff;transition:width 1s linear;}

#editorView .director-thumbnail-progress{background:transparent;color:#666;}
#editorView .director-thumbnail-progress>i{background:#88888830;}
#editorView .director-thumbnail-progress b{background:var(--brand);}
html.dark-mode #editorView .director-thumbnail-progress{color:#ccc;}
#editorView .director-reference-thumb button:disabled,#editorView .director-add-reference:disabled{opacity:.35;cursor:default;}

#editorView .video-is-generating .director-fixed-video-select>span{display:none!important;}
#editorView .director-generation-locked .director-clip-tools{display:none!important;}

#styleAssetModal .style-asset-dialog{display:flex;flex-direction:column;gap:0;padding:0;overflow:hidden;}
#styleAssetModal .entity-detail-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0;align-items:stretch;}
#styleAssetModal .style-asset-fields{min-width:0;gap:0;}
#styleAssetModal #styleAssetDescription{flex:1 1 0;height:0;min-height:100px;resize:none;overflow-y:auto;}
@media(max-width:820px){#styleAssetModal .entity-detail-body{grid-template-columns:1fr;}#styleAssetModal #styleAssetDescription{height:140px;flex:none;}}

/* 文字切换使用与操作栏一致的字号。 */
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-image-library-actions .media-prompt-icon,#editorView .director-library-actions #directorPromptToggle{min-width:36px;font:11px/16px system-ui;white-space:nowrap;}
/* 风格分栏底色铺满外框，移除旧布局留下的外边距。 */
#styleAssetModal .style-asset-dialog{background:#f3f5f7;}
#styleAssetModal .entity-form-images{background:#f3f5f7;}
#styleAssetModal .style-asset-fields{background:#fff;}
html.dark-mode #styleAssetModal .style-asset-dialog,html.dark-mode #styleAssetModal .entity-detail-body,html.dark-mode #styleAssetModal .entity-form-images{background:#1d1d1d;}
html.dark-mode #styleAssetModal .style-asset-fields{background:#272727;}

:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-image-library-actions .media-prompt-icon,#editorView .director-library-actions #directorPromptToggle{display:inline-flex;align-items:center;gap:4px;width:auto;min-width:0;padding:2px 5px;}
.media-switch-label{opacity:.55;font-weight:400;}
.media-switch-label.is-current{opacity:1;}
.media-switch-slash{opacity:.4;}

/* 图片区略加宽，资料区收窄；生成按钮始终占据固定位置。 */
@media(min-width:821px){
 :is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-detail-body{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);}
}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.35fr) auto;align-items:center;gap:6px;box-sizing:border-box;width:100%;min-width:0;overflow:visible;padding:8px 5px;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .entity-model-control{min-width:0;max-width:100%;width:100%;padding-right:0;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .entity-model-trigger{width:100%;min-width:0;max-width:100%;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .entity-model-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .image-options{width:100%;min-width:0!important;max-width:100%;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .image-options-trigger{width:100%;max-width:100%;min-width:0;overflow:hidden;flex-wrap:nowrap;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .image-options-trigger>span:not(.image-ratio-icon){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-composer-footer .entity-composer-actions{display:flex;flex-wrap:nowrap;min-width:max-content;margin:0;gap:6px;justify-self:end;}

/* 固定视频容器比例，图片固有尺寸与旧的最大高度不参与撑开。 */
#editorView.script-storyboard-mode #scriptMasterPanel>#directorMainVideo{box-sizing:border-box;aspect-ratio:16/9;width:100%;height:auto;min-height:0;max-height:none;flex:0 0 auto;}
#editorView #directorVideoStrip .director-fixed-video-preview{box-sizing:border-box;aspect-ratio:16/9;width:100%;height:auto;min-height:0;max-height:none;flex:0 0 auto;}
#editorView #directorVideoStrip .director-fixed-video-select{position:absolute;inset:0;width:100%;height:100%;min-height:0;}
#editorView #directorVideoStrip .director-fixed-video-select img,#editorView #directorMainVideo>video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;}
#directorVideoViewer .director-video-viewer-main{width:min(100%,calc(65dvh * 16 / 9));margin-inline:auto;aspect-ratio:16/9;height:auto;min-height:0;max-height:none;}
#directorVideoViewer .director-video-viewer-main>video{position:absolute;inset:0;width:100%;height:100%;}

#editorView .director-row-controls .director-video-model-select{display:none!important;}
#editorView #directorMainVideo .director-model-trigger{display:inline-flex;align-items:center;gap:4px;padding:4px 0;min-width:0;max-width:100%;min-height:28px;border:0;border-radius:4px;background:transparent;color:#788392;font:inherit;font-size:11px;line-height:20px;white-space:nowrap;cursor:pointer;}
#editorView #directorMainVideo .director-model-trigger:hover{background:#88888814;}
#editorView .director-model-trigger:disabled{opacity:.4;cursor:default;}
html.dark-mode #editorView #directorMainVideo .director-model-trigger{color:#b0b8c4;}
#editorView .director-model-trigger:focus-visible{outline:2px solid var(--brand);}

/* 完整显示素材：保持比例，不裁剪、不拉伸。 */
#editorView #directorMainVideo{padding:0;}
#editorView #directorMainVideo>video{display:block;margin:0;padding:0;border:0;object-fit:contain;object-position:center;}
#editorView #directorVideoStrip .director-fixed-video-select{margin:0;padding:0;border:0;}
#editorView #directorVideoStrip .director-fixed-video-select img{display:block;margin:0;padding:0;border:0;object-fit:contain;object-position:center;}
#directorVideoViewer .director-video-viewer-main>video{margin:0;padding:0;border:0;object-fit:contain;object-position:center;}

#editorView .director-preview-heading>#directorPromptToggle{display:inline-flex;align-items:center;gap:4px;flex:none;height:23px;padding:2px 5px;border:0;border-radius:4px;background:transparent;color:#888;font:11px/16px system-ui;white-space:nowrap;cursor:pointer;}
#editorView .director-preview-heading>#directorPromptToggle:hover{background:#88888812;}
#editorView .director-preview-heading>#directorPromptToggle:disabled{opacity:.4;cursor:default;}
#editorView .director-preview-heading>#directorPromptToggle[hidden]{display:none!important;}
#editorView .director-fixed-video-menu-button{left:auto;right:0;top:0;z-index:6;background:transparent;}
#directorFixedVideoMenu button.danger{color:#c06060;}

#editorView .director-preview-heading #directorModeTabs{display:flex;align-items:center;gap:2px;flex:none;padding:2px;border-radius:6px;background:#eee;}
#editorView .director-preview-heading #directorModeTabs[hidden]{display:none!important;}
#editorView #directorModeTabs button{display:block;min-width:0;height:20px;padding:2px 7px;border:0;border-radius:4px;background:transparent;color:#999;font:11px/16px system-ui;cursor:pointer;white-space:nowrap;}
#editorView #directorModeTabs button[aria-pressed="true"]{background:#fff;color:#333;box-shadow:0 1px 2px #0001;}
#editorView #directorModeTabs button:disabled{opacity:.4;cursor:default;}
html.dark-mode #editorView .director-preview-heading #directorModeTabs{background:#1b1b1b;}
html.dark-mode #editorView #directorModeTabs button[aria-pressed="true"]{background:#363636;color:#eee;}
#editorView .director-fixed-video-caption{display:flex;align-items:center;gap:3px;min-width:0;padding-top:4px;}
#editorView .director-fixed-video-caption .director-fixed-video-label{flex:1 1 0;width:auto;min-width:0;max-width:100%;padding:0;}
#editorView .director-fixed-video-caption>.director-fixed-video-menu-button{position:static;inset:auto;flex:0 0 20px;width:20px;height:20px;padding:2px;margin:0;background:transparent;color:#888;filter:none;}
#editorView .director-fixed-video-item:hover .director-fixed-video-caption>.director-fixed-video-menu-button,#editorView .director-fixed-video-item:focus-within .director-fixed-video-caption>.director-fixed-video-menu-button,#editorView .director-fixed-video-caption>.director-fixed-video-menu-button[aria-expanded="true"]{opacity:1;visibility:visible;}
html.dark-mode #editorView .director-fixed-video-caption>.director-fixed-video-menu-button{color:#aaa;}
@media(hover:none){#editorView .director-fixed-video-caption>.director-fixed-video-menu-button{opacity:1;visibility:visible;}}

#editorView #scriptMasterPanel>.director-preview-heading{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:6px;}
#editorView .director-preview-heading .director-preview-title{grid-column:1;min-width:0;max-width:100%;}
#editorView .director-preview-heading #directorModeTabs{grid-column:2;justify-self:center;}
#editorView .director-header-actions{grid-column:3;justify-self:end;display:flex;align-items:center;gap:3px;}
#editorView .director-header-icon{display:flex;align-items:center;justify-content:center;width:23px;height:23px;padding:3px;border:0;border-radius:4px;background:transparent;color:#888;cursor:pointer;}
#editorView .director-header-icon svg{width:15px;height:15px;}
#editorView .director-header-icon:hover{background:#88888812;}
#editorView .director-header-icon:disabled{opacity:.35;cursor:default;}
#editorView #directorHeaderDelete:hover{color:#b96464;}

#editorView .director-fixed-video-caption{display:grid;grid-template-columns:20px minmax(0,1fr) 20px;gap:0;}
#editorView .director-fixed-video-caption .director-fixed-video-label{grid-column:2;width:100%;text-align:center;}
#editorView .director-fixed-video-caption>.director-fixed-video-menu-button{grid-column:3;}
#editorView .director-thumbnail-duration{position:absolute;bottom:5px;left:5px;z-index:3;padding:1px 4px;border-radius:3px;background:#0008;color:#fff;font:10px/14px system-ui;opacity:0;pointer-events:none;}
#editorView .director-fixed-video-preview:hover .director-thumbnail-duration,#editorView .director-fixed-video-preview:focus-within .director-thumbnail-duration{opacity:1;}
#editorView .director-video-multi-select .director-thumbnail-duration{display:none;}
#editorView .director-thumbnail-rename{grid-column:2;box-sizing:border-box;width:100%;min-width:0;height:20px;padding:1px 2px;border:1px solid var(--brand);border-radius:3px;background:transparent;color:inherit;text-align:center;font:10px/16px system-ui;}
@media(hover:none){#editorView .director-thumbnail-duration{opacity:1;}}


#editorView .director-thumbnail-duration{background:transparent;padding:0;text-shadow:0 1px 3px #000b;}

/* 复选框仅在多选模式显示，普通悬浮也不显示。 */
#editorView #directorVideoStrip:not(.director-video-multi-select) .director-video-select-box{display:none!important;}
#editorView #directorVideoStrip.director-video-multi-select .director-video-select-box{display:flex!important;opacity:1!important;visibility:visible!important;pointer-events:auto;}

/* 深色外观保留删除等危险操作的红色语义。 */
html.dark-mode :is(#directorFixedVideoMenu,#entityCardMenu,.context-menu,.dropdown-content) button.danger,
html.dark-mode #directorFixedVideoMenu .director-menu-delete,
html.dark-mode #editorView :is(#directorBatchDelete,#directorHeaderDelete),
html.dark-mode .entity-image-library-actions .asset-main-delete,
html.dark-mode #promptAssetDialog .prompt-asset-delete{color:#ee8b8b;}
html.dark-mode :is(#directorFixedVideoMenu,#entityCardMenu,.context-menu,.dropdown-content) button.danger:hover{color:#ffb1b1;background:#d45b5b14;}

/* 资产主图上方：居中切换，右侧图像操作。 */
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-media-header{order:-1;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:3px;flex:0 0 28px;min-height:28px;min-width:0;}
.entity-media-tabs{display:flex;align-items:center;gap:2px;padding:2px;border-radius:6px;background:#eee;}
.entity-media-tabs button{height:20px;padding:2px 7px;border:0;border-radius:4px;background:transparent;color:#999;font:11px/16px system-ui;white-space:nowrap;cursor:pointer;}
.entity-media-tabs button[aria-pressed="true"]{background:#fff;color:#333;box-shadow:0 1px 2px #0001;}
.entity-media-tabs button:disabled{opacity:.4;cursor:default;}
.entity-media-main-actions{display:flex;align-items:center;justify-self:end;gap:3px;min-width:0;}
.entity-media-main-actions button{display:flex;align-items:center;justify-content:center;flex:none;width:auto;min-width:23px;height:23px;padding:3px;border:0;border-radius:4px;background:transparent;color:#888;font:11px/16px system-ui;white-space:nowrap;cursor:pointer;}
.entity-media-main-actions button svg{width:15px;height:15px;}
.entity-media-main-actions button:hover{background:#88888812;}.entity-media-main-actions button:disabled{opacity:.35;cursor:default;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-image-library-actions .entity-library-upload-text{width:auto;min-width:0;padding:2px 5px;font:11px/16px system-ui;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-detail-body,:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-form-images{background:#fff;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-detail-fields{background:#f3f5f7;}
html.dark-mode :is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-detail-body,html.dark-mode :is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-form-images{background:#272727;}
html.dark-mode :is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-detail-fields{background:#1d1d1d;}
html.dark-mode .entity-media-tabs{background:#1b1b1b;}html.dark-mode .entity-media-tabs button[aria-pressed="true"]{background:#363636;color:#eee;box-shadow:none;}
html.dark-mode .entity-media-main-actions button{color:#aaa;}
.entity-media-main-actions .asset-main-delete,html.dark-mode .entity-media-main-actions .asset-main-delete{color:#c06060;}

/* 输入时不新增聚焦边框；保持原有静态边界。 */
:is(#characterModal,#locationModal,#propModal,#styleAssetModal,#promptAssetDialog){--asset-input-border:#e3e7ec;}
html.dark-mode :is(#characterModal,#locationModal,#propModal,#styleAssetModal,#promptAssetDialog){--asset-input-border:#444;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal,#promptAssetDialog) :is(input,textarea){border-color:var(--asset-input-border)!important;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal,#promptAssetDialog) :is(input,textarea,[contenteditable]):focus{outline:none!important;box-shadow:none!important;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-prompt-input-box,:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-prompt-input-box:focus-within{border-color:var(--asset-input-border)!important;box-shadow:none!important;outline:none!important;}
/* 图片显示区透明，不影响提示词框与生成进度。 */
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-shared-frame.is-image,
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-form-image-preview,
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-form-image-preview .entity-image-shell{background:transparent!important;box-shadow:none;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-shared-frame.is-image .entity-form-image-preview{border:0;}
/* 指定列与行，切换始终在主图上方居中，操作始终居右。 */
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-media-header{width:100%;box-sizing:border-box;}
.entity-media-header>.entity-media-tabs{grid-column:2;grid-row:1;justify-self:center;}
.entity-media-header>.entity-media-main-actions{grid-column:3;grid-row:1;justify-self:end;}
.entity-media-header>div:first-child{grid-column:1;grid-row:1;}

.entity-media-header[data-selecting="true"] .entity-media-tabs{visibility:hidden;}
.entity-images-selecting .entity-thumbnail-item>button{position:relative!important;cursor:pointer;}
.entity-image-select-mark{position:absolute;top:3px;left:3px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:12px;height:12px;border:1px solid #fff;border-radius:2px;background:#0003;color:#fff;font:10px/10px system-ui;box-shadow:0 0 2px #0006;pointer-events:none;}
.entity-images-selecting [aria-checked="true"] .entity-image-select-mark{background:var(--brand);}

:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-main-image.is-prompt-view>.asset-image-step{display:none!important;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-image-library-actions .asset-main-delete{color:#b96464;}
html.dark-mode :is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-image-library-actions .asset-main-delete{color:#ee8b8b;}

/* 数量旁新建，视频内容切换靠右；批量操作仅在多选时显示。 */
#editorView .director-preview-heading #directorModeTabs{grid-column:3;justify-self:end;}
#editorView .director-library-count{display:flex;align-items:center;gap:5px;}
#editorView .director-library-count #directorNewVideoButton{display:inline-flex;align-items:center;justify-content:center;width:23px;height:23px;padding:3px;border:0;border-radius:4px;background:transparent;color:#888;cursor:pointer;}
#editorView .director-library-count #directorNewVideoButton svg{width:17px;height:17px;}
#editorView .director-library-count #directorNewVideoButton:hover{background:#88888812;}
#editorView :is(#directorNewVideoButton,#directorBatchDownload,#directorBatchDelete)[hidden]{display:none!important;}
.entity-image-library-summary{display:flex;align-items:center;gap:5px;}
.entity-image-library-summary button svg{width:17px;height:17px;}

/* 视频库在上，当前视频与提示词在下；时长始终可见。 */
#editorView #directorVideoStrip .director-thumbnail-duration{display:block;opacity:1;visibility:visible;}
#editorView .director-library-actions #directorNewVideoButton{display:inline-flex;align-items:center;justify-content:center;width:23px;height:23px;padding:3px;}
#editorView #directorNewVideoButton[hidden]{display:none!important;}

/* 提示词始终独立编辑，视频双击后在上方展开播放。 */
#editorView #directorModeTabs{display:none!important;}
#editorView #directorMainVideo>video{display:none!important;}


/* 展开视频预览时收起小窗区，关闭预览后自动恢复。 */
/* 导演模式保留底栏右侧的缩放条。 */
#editorView.script-storyboard-mode .screenplay-hint-row>.zoom-widget{display:flex!important;}
#editorView.script-storyboard-mode .screenplay-hint-row>.editor-bottom-actions{display:none!important;}

/* 底栏按缩放、校对、分析、设置排列。 */
#editorView .screenplay-hint-row>.zoom-widget{order:2;}
#editorView .screenplay-hint-row>.editor-left-tools{order:3;}
#editorView .screenplay-hint-row>.editor-settings-button{order:4;}
/* 视频提示词编辑框采用更柔和的圆角。 */
#editorView.script-storyboard-mode #scriptMasterPanel>#directorMainVideo{border-radius:12px;overflow:hidden;}
#editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{border-radius:inherit;}

/* 自由提示词：取消标题行与固定镜头字段。 */
#editorView #scriptMasterPanel>.director-preview-heading{display:none!important;}
#editorView.script-storyboard-mode #scriptMasterPanel>#directorMainVideo{border-radius:20px;}
#editorView #scriptMasterList .director-freeform-shot{margin:0;padding:0;border:0;background:transparent;}
#editorView #scriptMasterList .director-freeform-shot .director-content-editor{min-height:130px;padding:12px 8px;line-height:1.65;}

/* 仅借鉴参考图的外框与留白，保留现有控件位置。 */
#editorView.script-storyboard-mode #scriptMasterPanel{padding-bottom:10px;}
#editorView.script-storyboard-mode #scriptMasterPanel>#directorMainVideo{margin-top:8px;margin-bottom:0;flex-shrink:0;border-radius:24px;border:1px solid #dedede;box-shadow:none;}
#editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{padding:16px 16px 10px;box-sizing:border-box;}
#editorView #directorMainVideo .director-fixed-content-card .director-content-references{padding:0 0 10px;}
#editorView #directorMainVideo .director-clip-shots{padding:0 0 12px;scroll-padding-bottom:16px;}
#editorView #directorMainVideo .director-freeform-shot .director-content-editor{padding:6px 0 14px;}
#editorView #directorMainVideo .director-content-composer-footer{padding:10px 0 2px;}
html.dark-mode #editorView.script-storyboard-mode #scriptMasterPanel>#directorMainVideo{border-color:#414141;}
@media(max-width:820px){
 #editorView.script-storyboard-mode #scriptMasterPanel{padding-bottom:8px;}
 #editorView.script-storyboard-mode #directorMainVideo>#scriptMasterList{padding:12px 12px 8px;}
}

/* 参考图稍放大，缩略图和新增入口保持同一尺寸。 */
#editorView #directorMainVideo .director-content-references{gap:8px;}
#editorView #directorMainVideo :is(.director-reference-thumb,.director-add-reference){flex:0 0 44px;width:44px;height:44px;box-sizing:border-box;border-radius:6px;}
#editorView #directorMainVideo .director-fixed-content-card .director-content-references{max-height:110px;}

/* 根据两栏实际可用宽度增加间距，窄屏仍为 6px。 */
#editorView.script-storyboard-mode #scriptStoryboardSplit{max-width:calc(var(--paper-width,8.5in) + 740px + 12px + var(--director-column-gap,6px));}

/* 全选只在多选时出现，紧跟视频总数。 */
#editorView .director-library-count .director-select-all{appearance:auto;flex:none;width:12px;height:12px;margin:0 0 0 3px;padding:0;accent-color:var(--brand);cursor:pointer;}
#editorView .director-select-all[hidden]{display:none!important;}
#editorView #directorVideoStrip{user-select:none;-webkit-user-select:none;}
#editorView .director-marquee-active,#editorView .director-marquee-active *{cursor:crosshair!important;}
.director-marquee-box{position:fixed;z-index:10000;border:1px solid var(--brand);background:color-mix(in srgb,var(--brand) 12%,transparent);pointer-events:none;box-sizing:border-box;}

/* 引用块后不人为增加视觉空隙。 */
#editorView .director-image-chip{margin-left:0;margin-right:0;}

/* 光标旁的引用选择器：类型栏固定，结果单独滚动。 */
#directorImageMentions{display:flex;flex-direction:column;overflow:hidden;padding:5px;}
#directorImageMentions .director-mention-filters{display:flex;flex-wrap:wrap;flex:none;gap:3px;padding:2px 2px 6px;border-bottom:1px solid #8882;}
#directorImageMentions .director-mention-filters button{width:auto;min-height:24px;padding:3px 7px;font:11px/18px system-ui;text-align:center;justify-content:center;}
#directorImageMentions .director-mention-filters button[aria-pressed="true"]{background:#8882;}
#directorImageMentions .director-mention-results{min-height:0;overflow:auto;overscroll-behavior:contain;}

/* 视频提示词正文提升可读性，不放大工具按钮。 */
#editorView #directorMainVideo .director-freeform-shot .director-content-editor{font-size:14px;line-height:1.7;}

/* 仅导演视图：左侧主视频铺满可用高度，右侧保留视频管理和提示词。 */
#editorView .director-standalone-preview[hidden]{display:none!important;}
#editorView .director-standalone-preview{position:relative;display:none;box-sizing:border-box;overflow:hidden;background:#111;}
#editorView.script-storyboard-mode.storyboard-script-hidden #scriptStoryboardSplit{max-width:none;height:100%;align-items:stretch;}
#editorView.script-storyboard-mode.storyboard-script-hidden #directorStandalonePreview:not([hidden]){display:flex;align-items:center;justify-content:center;flex:1 1 0;min-width:0;height:100%;}
#editorView #directorStandalonePreview video{display:block;width:100%;height:100%;object-fit:contain;}
#editorView #directorStandalonePreview>span{position:absolute;top:50%;left:16px;right:16px;text-align:center;color:#bbb;font-size:13px;pointer-events:none;}
#editorView #directorStandalonePreview>span[hidden]{display:none;}
#editorView.script-storyboard-mode.storyboard-script-hidden #scriptMasterPanel{flex:0 0 42%;width:42%;max-width:620px;min-width:260px;height:100%;}
@media(max-width:820px){#editorView.script-storyboard-mode.storyboard-script-hidden #scriptMasterPanel{flex-basis:48%;width:48%;min-width:0;}}

/* 将视图按钮明确表现为可组合的显示选项。 */
#editorView #viewTabs{display:flex;align-items:center;gap:3px;padding:3px;border:1px solid #0000000c;border-radius:8px;background:#e8e8e880;}
#editorView #viewTabs .editor-view-label{padding:0 5px;color:#909090;font:11px/20px system-ui;white-space:nowrap;}
#editorView #viewTabs [data-editor-pane]{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:26px;padding:3px 9px;border:0;border-radius:5px;background:transparent;color:#666!important;font-size:12px;font-weight:400;box-shadow:none;white-space:nowrap;transition:background .15s,color .15s;}
#editorView #viewTabs [data-editor-pane]:hover{background:#ffffff80;}
#editorView #viewTabs [data-editor-pane][aria-checked="true"]{background:#fff;color:#252525!important;box-shadow:0 1px 2px #0000000c;}
#editorView #viewTabs .editor-view-check{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:12px;height:12px;border:1px solid #9998;border-radius:3px;flex:none;color:#fff;background:transparent;}
#editorView #viewTabs .editor-view-check svg{width:10px;height:10px;visibility:hidden;}
#editorView #viewTabs [aria-checked="true"] .editor-view-check{background:#555;border-color:#555;}
#editorView #viewTabs [aria-checked="true"] .editor-view-check svg{visibility:visible;}
#editorView #viewTabs [data-editor-pane]:focus-visible{outline:2px solid #888;outline-offset:2px;}
html.dark-mode #editorView #viewTabs{background:#1c1c1c;border-color:#ffffff12;}
html.dark-mode #editorView #viewTabs [data-editor-pane]{color:#aaa!important;}
html.dark-mode #editorView #viewTabs [data-editor-pane]:hover{background:#ffffff0c;}
html.dark-mode #editorView #viewTabs [data-editor-pane][aria-checked="true"]{background:#383838;color:#eee!important;box-shadow:none;}
html.dark-mode #editorView #viewTabs [aria-checked="true"] .editor-view-check{background:#ddd;border-color:#ddd;color:#222;}
@media(max-width:820px){#editorView #viewTabs .editor-view-label{display:none;}#editorView #viewTabs [data-editor-pane]{padding-inline:6px;gap:4px;}}

#directorFixedVideoMenu .director-batch-menu-heading{padding:5px 10px 7px;font:11px/18px system-ui;color:#999;border-bottom:1px solid #8882;margin-bottom:3px;}

/* 中间间距和右侧留白共用同一值，右侧边界随资料栏伸缩。 */
#editorView.script-storyboard-mode #scriptStoryboardSplit{box-sizing:border-box;width:100%;max-width:none;padding-inline:var(--director-column-gap,6px);gap:var(--director-column-gap,6px);}
#editorView.script-storyboard-mode:not(.storyboard-script-hidden) #screenplayScroll{max-width:none;}
/* 大纲保留原有范围，下面的工作区以大纲为边界。 */
#editorView.script-storyboard-mode.workspace-bounded #scriptStoryboardSplit{align-self:flex-start;width:var(--workspace-content-width);max-width:var(--workspace-content-width);margin-left:var(--workspace-content-left,10px);margin-right:0;padding-left:0;padding-right:var(--workspace-right-padding,0px);gap:var(--workspace-column-gap,6px);}

/* 剧本和导演作为一个整体居中，宽度仍不超过大纲。 */
#editorView.script-storyboard-mode.workspace-bounded:not(.storyboard-script-hidden) #screenplayScroll{max-width:calc(var(--paper-width,8.5in) + 4px);}
/* 项目使用视频封面，名称独立放在下方；经典与其他页面不变。 */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile{display:flex;flex-direction:column;gap:0;box-sizing:border-box;padding:0;aspect-ratio:auto;background:transparent!important;border:0;box-shadow:none!important;overflow:visible;transform:none!important;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;aspect-ratio:16/9;flex:0 0 auto;overflow:hidden;background:#eceef0;border:1px solid #e0e2e5;border-radius:0;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover>.entity-image-shell{width:100%;height:100%;border-radius:0;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover img{width:100%;height:100%;object-fit:cover;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-placeholder{display:flex;color:#a9afb5;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-placeholder svg{width:42px;height:32px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-caption{display:block;box-sizing:border-box;width:100%;min-height:32px;max-height:32px;margin:0;padding:7px 1px 3px;line-height:22px;font-size:14px;font-weight:400;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#333;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover .pm-more{position:absolute;right:5px;top:5px;width:24px;height:24px;display:grid;place-items:center;background:#ffffffdf;color:#555;border:0;border-radius:4px;opacity:0;pointer-events:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile:hover .pm-more,:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile:focus-within .pm-more{opacity:1;pointer-events:auto;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-cover{background:#f4f5f6;border-style:dashed;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-plus{font-size:30px;color:#999;}
html.dark-mode :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover{background:#262626;border-color:#3b3b3b;}
html.dark-mode :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-caption{color:#ddd;}
html.dark-mode :is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover .pm-more{background:#252525df;color:#ddd;}
@media(hover:none){:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover .pm-more{opacity:1;pointer-events:auto;}}

/* 可用空间较小时减少大纲两侧留白；提示词按剩余高度缩小。 */
#editorView.workspace-compact #outlineNav:not(.collapsed-outline){margin-left:4px;margin-right:4px;}
#editorView.script-storyboard-mode.workspace-bounded #scriptMasterPanel{min-width:0;}
#editorView.script-storyboard-mode.workspace-bounded #scriptMasterPanel>#directorMainVideo{height:var(--director-prompt-height,auto);flex:0 1 auto;min-height:0;}
#editorView #directorMainVideo .director-freeform-shot .director-content-editor{min-height:0;}

/* 更紧凑的项目封面，标题和状态在同一行。 */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid){grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),240px));gap:20px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-caption{display:flex;align-items:center;gap:8px;padding:5px 1px;height:32px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-caption .project-book-title{flex:1;min-width:0;font-size:13px;height:22px;min-height:22px;max-height:22px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status{flex:none;padding:0;border:0;background:transparent;font:10px/20px system-ui;color:#999;cursor:pointer;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status[data-status="active"]{color:#478b66;}:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status[data-status="done"]{color:#367bc0;}:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status[data-status="pending"]{color:#a17f51;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-script-preview{position:relative;flex:none;overflow:hidden;background:#fff;pointer-events:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-script-page{position:absolute;top:0;left:0;width:var(--preview-page-width)!important;height:var(--preview-page-height)!important;min-height:var(--preview-page-height)!important;box-sizing:border-box;margin:0;padding:96px 96px 96px 144px;border:0;box-shadow:none;zoom:1!important;transform:scale(var(--project-page-scale,.12));transform-origin:top left;overflow:hidden;background:#fff!important;color:#222!important;font:16px/16px 'Courier Prime','Courier New',SimSun,serif;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-script-page .script-block{color:#222!important;pointer-events:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-script-empty{text-align:center;color:#999;padding-top:180px;}
#projectsView .project-toolbar-actions{display:flex;align-items:center;gap:6px;margin-left:8px;padding-left:8px;border-left:1px solid #8883;}
#projectsView .project-toolbar-actions button{height:28px;border:0;border-radius:5px;padding:3px 8px;white-space:nowrap;}
#projectsView .project-toolbar-actions .project-new-button{background:var(--brand);color:#fff;}
#projectsView .project-toolbar-actions svg{width:15px;height:15px;display:block;}
#projectsView #projectBatchDelete{color:#bf6060;}#projectsView #projectSelectedCount{font:11px/18px system-ui;color:#888;white-space:nowrap;}
#projectsView .project-toolbar-actions [hidden]{display:none!important;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-selection-mark{display:none;position:absolute;top:7px;left:7px;width:16px;height:16px;align-items:center;justify-content:center;border:1px solid #999;border-radius:3px;background:#fff;color:transparent;font:12px/16px system-ui;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid).project-selecting .project-selection-mark{display:flex;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid).project-selecting .project-card-status{pointer-events:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-is-selected .project-selection-mark{color:#fff;background:var(--brand);border-color:var(--brand);}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-is-selected .project-video-cover{outline:2px solid var(--brand);outline-offset:-2px;}
@media(max-width:820px){:is(#projectBookGrid,#classicWorksGrid .project-book-grid){grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}#projectsView .proj-filter{flex-wrap:wrap;}#projectsView .project-toolbar-actions{margin-left:4px;padding-left:4px;gap:3px;}}

/* 卡片悬停轻微抬起；状态保留前置圆点，剧本预览铺满封面宽度。 */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile{transition:transform .15s ease;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-cover{transition:box-shadow .15s ease,border-color .15s ease;}
@media(hover:hover){:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile:hover{transform:translateY(-2px)!important;}:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile:hover .project-video-cover{box-shadow:0 5px 14px #1821301c;border-color:#c5cbd2;}}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status{display:inline-flex;align-items:center;gap:4px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status::before{content:'';display:block;width:4px;height:4px;border-radius:50%;background:currentColor;flex:none;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-script-preview{width:100%;height:100%;aspect-ratio:auto!important;}
@media(prefers-reduced-motion:reduce){:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile{transition:none;}:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-tile:hover{transform:none!important;}}

/* 项目筛选与操作分组，避免按钮挤在状态胶囊里。 */
#projectsView .proj-toolbar{gap:10px;flex-wrap:wrap;}
#projectsView .proj-toolbar>.project-toolbar-actions{margin-left:auto;border:0;padding-left:0;gap:8px;}
#projectsView .project-toolbar-actions #projectSelectButton{background:transparent;color:inherit;border:1px solid #8883;}
#projectsView .project-toolbar-actions .project-new-button{padding-inline:12px;}
@media(max-width:820px){#projectsView .proj-toolbar{gap:7px;}#projectsView .proj-toolbar>.project-toolbar-actions{gap:6px;}#projectsView .project-toolbar-actions button{font-size:11px;}}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-image-choices{order:1;flex:0 0 auto;max-height:80px;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-main-image{flex:1 1 0;min-height:180px;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-inline-prompt{height:100%;min-height:0;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-form-image-preview{display:none!important;}
:is(#characterModal,#locationModal,#propModal,#styleAssetModal) .entity-main-image>.asset-image-step{display:none!important;}
#projectsView .proj-toolbar .proj-search input{box-sizing:border-box;}
#projectsView .proj-toolbar .proj-filter{min-height:32px;box-sizing:border-box;align-items:center;}
#projectsView .proj-toolbar>.project-toolbar-actions>button{height:32px;font:12px/18px system-ui;}

/* 样式工具栏用轻量竖线区分“无”、正文样式与笔记批注。 */
#editorView .screenplay-toolbar .style-group-divider{display:inline-block;align-self:center;flex:0 0 1px;width:1px;height:13px;margin:0 5px;background:#d7dadd;border-radius:0;}
html.dark-mode #editorView .screenplay-toolbar .style-group-divider{background:#444;}

/* 搜索与状态筛选保持一致的外部高度。 */
#projectsView .proj-toolbar .proj-search input{height:32px;min-height:32px;border-radius:5px;}
#projectsView .proj-toolbar #projFilter{height:32px;min-height:32px;padding:2px;box-sizing:border-box;display:flex;align-items:center;flex-wrap:nowrap;}
#projectsView .proj-toolbar #projFilter>button[data-filter]{height:28px;min-height:0;padding:3px 9px;box-sizing:border-box;line-height:20px;}
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-card-status[data-status="pending"]{color:#969ba1;}

/* 项目视图切换与标题右侧的批量操作。 */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid)[hidden],#projectTableView[hidden],.project-selection-title-actions button[hidden]{display:none!important;}
#projectsView .project-selection-title-actions{display:flex;align-items:center;gap:8px;margin-left:12px;}
#projectsView .project-selection-title-actions button{padding:3px 5px;border:0;background:transparent;color:#777;font:12px/20px system-ui;cursor:pointer;}
#projectsView .project-selection-title-actions #projectBatchDelete{color:#bd6262;}
#projectsView .project-selection-title-actions button:disabled{opacity:.4;cursor:default;}
#projectsView .project-view-switch{display:flex;align-items:center;padding:2px;gap:2px;background:#eceeef;border-radius:6px;height:32px;box-sizing:border-box;}
#projectsView .project-view-switch button{display:flex;align-items:center;gap:5px;height:28px;padding:3px 8px;border:0;border-radius:4px;background:transparent;color:#888;font:12px/18px system-ui;cursor:pointer;}
#projectsView .project-view-switch button[aria-pressed="true"]{background:#fff;color:#333;box-shadow:0 1px 2px #0001;}
#projectsView .project-view-switch svg{width:14px;height:14px;}
#projectTableView{width:100%;border:1px solid #e2e5e8;border-radius:6px;overflow:hidden;}
.project-management-table{width:100%;table-layout:fixed;border-collapse:collapse;font:12px/20px system-ui;}
.project-management-table th{background:#f7f8f9;color:#8a929c;text-align:left;font-weight:400;}
.project-management-table th,.project-management-table td{padding:10px 14px;border-bottom:1px solid #e9ebed;}
.project-management-table tbody tr{cursor:pointer;}
.project-management-table tbody tr:last-child td{border-bottom:0;}
.project-management-table tbody tr:hover{background:#f7f8fa;}
.project-management-table .project-table-title{display:inline-block;vertical-align:middle;max-width:calc(100% - 24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;margin:0;}
.project-management-table .project-table-stat{width:65px;}
.project-management-table th:nth-child(3){width:75px;}.project-management-table .project-table-date{width:110px;}.project-management-table .project-table-menu{width:28px;}
.project-management-table .pm-more{position:static;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:3px;border:0;border-radius:4px;background:transparent;color:#888;opacity:0;cursor:pointer;}
.project-management-table .pm-more svg{width:17px;height:17px;}
.project-management-table tr:hover .pm-more,.project-management-table tr:focus-within .pm-more{opacity:1;}
#projectTableView .project-card-status{display:inline-flex;align-items:center;gap:4px;color:#969ba1;font-size:11px;}
#projectTableView .project-card-status::before{content:'';width:4px;height:4px;border-radius:50%;background:currentColor;}
#projectTableView [data-status="active"]{color:#478b66;}#projectTableView [data-status="done"]{color:#367bc0;}
.project-table-check{display:none;width:14px;height:14px;margin-left:6px;border:1px solid #aaa;border-radius:3px;color:transparent;align-items:center;justify-content:center;font:10px/14px system-ui;}
#projectTableView.project-selecting .project-table-check{display:inline-flex;}
#projectTableView .project-is-selected .project-table-check{background:var(--brand);color:#fff;border-color:var(--brand);}
#projectTableView .project-is-selected{background:#88888810;}
html.dark-mode #projectsView .project-view-switch{background:#202020;}html.dark-mode #projectsView .project-view-switch [aria-pressed="true"]{background:#393939;color:#eee;}
html.dark-mode #projectTableView{border-color:#393939;}html.dark-mode .project-management-table th{background:#232323;}html.dark-mode .project-management-table td,html.dark-mode .project-management-table th{border-color:#343434;}html.dark-mode .project-management-table tr:hover{background:#292929;}
@media(max-width:820px){.project-management-table .project-table-date{display:none;}.project-management-table th,.project-management-table td{padding:8px;}.project-management-table .project-table-stat{width:40px;}.project-management-table th:nth-child(3){width:60px;}}
@media(hover:none){.project-management-table .pm-more{opacity:1;}}
/* 为表格末列预留完整点击区域，避免三点被裁切。 */
#projectTableView{overflow:visible;}
.project-management-table th.project-table-menu{width:52px;box-sizing:border-box;}
.project-management-table th:last-child,.project-management-table td:last-child{width:52px;min-width:52px;padding:6px 10px;box-sizing:border-box;overflow:visible;}
.project-management-table td:last-child .pm-more{position:relative;inset:auto;box-sizing:border-box;width:26px;height:26px;min-width:26px;margin:0;padding:4px;overflow:visible;}

/* 大纲关闭时，用与底栏一致的细线分隔项目顶栏。 */
#editorView .editor-main:has(>#outlineNav.collapsed-outline)>.outline-nav-header{border-bottom:1px solid #e0e3e8;}
html.dark-mode #editorView .editor-main:has(>#outlineNav.collapsed-outline)>.outline-nav-header{border-bottom-color:#2c2f34;}

/* The editor footer uses the account avatar at the existing compact footer height. */
#editorView #editorUserAvatar{box-sizing:border-box;flex:0 0 20px;width:20px;max-width:20px;height:20px;max-height:20px;padding:0;align-self:center;}
#editorView #editorUserAvatarText{display:flex;align-items:center;justify-content:center;width:100%;height:100%;line-height:1;}
#editorView #editorUserAvatar:hover{filter:brightness(1.08);}

.editor-account-summary{display:inline-flex;align-items:center;gap:6px;flex:none;min-width:0;height:20px;}
#editorView #editorUserCredits{font:11px/18px system-ui;white-space:nowrap;color:#747d89;}
html.dark-mode #editorView #editorUserCredits{color:#a0a5ad;}

/* Project names follow the same typography as the create-project caption. */
:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-caption .project-book-title{font-family:inherit;font-size:14px;font-weight:400;letter-spacing:normal;line-height:22px;color:inherit;}
@media(max-width:820px){:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-video-caption .project-book-title,:is(#projectBookGrid,#classicWorksGrid .project-book-grid) .project-create-card .project-video-caption{font-size:12px;}}

.editor-footer-review-tools{display:inline-flex;align-items:center;gap:3px;flex:none;height:20px;}
#editorView .editor-footer-review-tools button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:20px;min-height:20px;padding:2px;border:0;border-radius:4px;background:transparent;color:#7b8491;cursor:pointer;}
#editorView .editor-footer-review-tools button svg{width:14px;height:14px;}
#editorView .editor-footer-review-tools button:hover{background:#8882;color:#424b57;}
html.dark-mode #editorView .editor-footer-review-tools button{color:#a5abb4;}
html.dark-mode #editorView .editor-footer-review-tools button:hover{color:#ddd;}

#editorView .editor-footer-review-tools button{width:auto;gap:4px;padding:2px 5px;font:11px/16px system-ui;white-space:nowrap;}
#editorView .editor-footer-review-tools button span{font:inherit;}
