/* Optional lyric-video opening thumbnail. Leaves the restored sidebar and source buttons untouched. */
#mmpThumbIntroControls{box-sizing:border-box;margin:10px 0 12px;padding:13px 16px;border:1px solid #ded9ed;border-radius:13px;background:linear-gradient(120deg,#fbfaff,#f4f7fb);color:#263047}
#mmpThumbIntroControls .mmp-thumb-intro-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 13px;margin-bottom:10px}
#mmpThumbIntroControls .mmp-thumb-intro-title strong{font-size:14px;font-weight:800}
#mmpThumbIntroControls .mmp-thumb-intro-title small{color:#647087;font-size:11px}
#mmpThumbIntroControls .mmp-thumb-intro-fields{display:flex;align-items:end;gap:9px;flex-wrap:wrap}
#mmpThumbIntroControls .mmp-thumb-intro-fields label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:700;min-width:125px;flex:0 1 auto}
#mmpThumbIntroControls .mmp-thumb-intro-upload{min-width:210px;flex:1 1 220px;max-width:310px}
#mmpThumbIntroControls .mmp-thumb-intro-fields input[type=file]{width:100%;max-width:100%;font-size:11px;box-sizing:border-box}
#mmpThumbIntroControls .mmp-thumb-intro-fields select{box-sizing:border-box;min-width:138px;max-width:205px;background:white;border:1px solid #cccbdc;border-radius:8px;padding:9px 8px;font-size:12px;color:#263047}
#mmpThumbIntroControls .mmp-thumb-intro-upload small{font-size:10px;color:#697386;overflow-wrap:anywhere;max-width:290px}
#mmpThumbIntroControls .mmp-thumb-intro-fields button{min-height:35px;padding:7px 11px;border:1px solid #a9a0cc;background:#f7f4ff;border-radius:8px;font-size:12px;font-weight:750;color:#473c79;cursor:pointer}
#mmpThumbIntroControls .mmp-thumb-intro-fields button:disabled{opacity:.45;cursor:not-allowed}
#mmpThumbIntroControls .mmp-thumb-intro-fields button:not(:disabled):hover{background:#eee9ff}
#mmpThumbIntroControls .mmp-thumb-intro-note{margin:9px 0 0;color:#647087;font-size:11px;line-height:1.5}

/* 2026-10-29 hotfix: the original video editor has four visible rows
   (sources / preview controls / stage / transport). The optional thumbnail
   panel introduces a fifth row. Without this definition the original
   minmax(0,1fr) row belongs to preview controls and the canvas stage is
   forced into an implicit zero-height track, producing an empty preview. */
@media (min-width:1025px) {
  html body.settings-mode-video #videoWorkspace.video-workspace:not(.mmp-lyric-active) > .video-main:has(> #mmpThumbIntroControls) {
    grid-template-rows:auto auto auto minmax(0,1fr) auto !important;
  }
}

/* Thumbnail controls: compact aligned toolbar. No changes to the editor stage. */
#mmpThumbIntroControls{padding:16px 18px;background:#faf9ff;border-color:#e1dcef}
#mmpThumbIntroControls .mmp-thumb-intro-title{align-items:center;margin-bottom:13px;gap:8px 14px}
#mmpThumbIntroControls .mmp-thumb-intro-title strong{font-size:14px}
#mmpThumbIntroControls .mmp-thumb-intro-title small{font-size:11px;font-weight:400}
#mmpThumbIntroControls .mmp-thumb-intro-fields{display:grid;grid-template-columns:minmax(245px,1.9fr) minmax(100px,.65fr) minmax(180px,1fr) auto auto;gap:10px;align-items:end}
#mmpThumbIntroControls .mmp-thumb-intro-fields label{min-width:0;width:100%;gap:7px;font-size:11px}
#mmpThumbIntroControls .mmp-thumb-intro-upload{min-width:0;max-width:none;flex:auto}
#mmpThumbIntroControls .mmp-thumb-intro-fields label>span{font-size:11px;font-weight:750;color:#4a4966}
#mmpThumbIntroControls .mmp-thumb-intro-fields input[type=file],#mmpThumbIntroControls .mmp-thumb-intro-fields select{display:block;min-width:0;max-width:none;width:100%;height:38px;border:1px solid #dcd6eb;border-radius:9px;background:#fff;padding:7px 10px;font:inherit;font-size:12px;color:#35334b}
#mmpThumbIntroControls .mmp-thumb-intro-fields input[type=file]{padding:5px;font-size:11px}
#mmpThumbIntroControls .mmp-thumb-intro-fields input[type=file]::file-selector-button{border:0;border-radius:6px;background:#f0edfc;color:#5845aa;padding:7px 9px;margin-right:8px;cursor:pointer;font-weight:700}
#mmpThumbIntroControls .mmp-thumb-intro-fields button{height:38px;white-space:nowrap;padding:7px 12px;background:#fff;border-color:#d8cdef}
#mmpThumbIntroControls #videoIntroPreviewBtn:not(:disabled){background:#6550c7;color:#fff;border-color:#6550c7}
#mmpThumbIntroControls #videoIntroPreviewBtn:not(:disabled):hover{background:#5944b5}
#mmpThumbIntroControls .mmp-thumb-intro-upload small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-weight:400}
#mmpThumbIntroControls .mmp-thumb-intro-note{margin-top:12px;padding-top:10px;border-top:1px solid #e9e5f2}
@media(max-width:1250px){#mmpThumbIntroControls .mmp-thumb-intro-fields{grid-template-columns:minmax(200px,2fr) minmax(90px,.7fr) minmax(150px,1.2fr) auto auto;gap:7px}}
@media(max-width:900px){#mmpThumbIntroControls .mmp-thumb-intro-fields{display:flex;flex-wrap:wrap}#mmpThumbIntroControls .mmp-thumb-intro-upload{flex:1 1 260px}#mmpThumbIntroControls .mmp-thumb-intro-fields label{flex:1 1 130px}}

/* Consistent thumbnail toolbar controls — visual-only, existing renderer unchanged. */
#mmpThumbIntroControls .mmp-thumb-intro-fields{grid-template-columns:minmax(245px,2fr) minmax(110px,.7fr) minmax(185px,1.15fr) minmax(135px,auto) minmax(60px,auto);column-gap:10px;align-items:end}
#mmpThumbIntroControls .mmp-thumb-intro-fields>label,#mmpThumbIntroControls .mmp-thumb-action{display:flex;flex-direction:column;gap:7px;min-width:0;margin:0}
#mmpThumbIntroControls .mmp-thumb-action>span{font-size:11px;font-weight:750;color:#4a4966;line-height:16px}
#mmpThumbIntroControls .mmp-thumb-intro-fields label>span:first-child{line-height:16px}
#mmpThumbIntroControls .mmp-thumb-file-control{height:40px;min-width:0;width:100%;border:1px solid #dcd6eb;border-radius:9px;background:#fff;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:5px 8px;position:relative;overflow:hidden}
#mmpThumbIntroControls .mmp-thumb-file-pick{flex:none;display:inline-flex;align-items:center;justify-content:center;height:28px;box-sizing:border-box;padding:0 11px;border-radius:6px;background:#f0edfc;color:#5845aa;font-size:12px;font-weight:750}
#mmpThumbIntroControls .mmp-thumb-file-control small{min-width:0;flex:1;margin:0;font-size:12px;color:#35334b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:18px}
#mmpThumbIntroControls .mmp-thumb-intro-upload{position:relative;cursor:pointer}
#mmpThumbIntroControls .mmp-thumb-intro-upload input[type=file]{position:absolute;left:0;right:0;bottom:0;width:100%;height:40px;opacity:0;cursor:pointer;z-index:1;padding:0}
#mmpThumbIntroControls .mmp-thumb-intro-upload:focus-within .mmp-thumb-file-control{outline:2px solid #8370d6;outline-offset:2px}
#mmpThumbIntroControls .mmp-thumb-intro-fields select,#mmpThumbIntroControls .mmp-thumb-action button{height:40px;min-height:40px;max-width:none;width:100%;box-sizing:border-box;border-radius:9px}
#mmpThumbIntroControls .mmp-thumb-intro-fields select{padding:0 12px}
#mmpThumbIntroControls .mmp-thumb-action button{padding:0 12px;font-size:12px}
#mmpThumbIntroControls #videoIntroPreviewBtn{min-width:132px}
#mmpThumbIntroControls #videoIntroClearBtn{min-width:58px}
@media(max-width:1250px){#mmpThumbIntroControls .mmp-thumb-intro-fields{grid-template-columns:minmax(210px,2fr) minmax(100px,.7fr) minmax(170px,1.2fr) minmax(132px,auto) minmax(58px,auto);column-gap:8px}}
@media(max-width:900px){#mmpThumbIntroControls .mmp-thumb-intro-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#mmpThumbIntroControls .mmp-thumb-intro-upload{grid-column:1/-1}}

/* Independent scene editing strip; the restored preview stage sizing is unchanged. */
#mmpSceneEditor{background:#faf9ff;border:1px solid #ded9ed;border-radius:12px;padding:12px;margin:10px 0;color:#34334c;font-size:12px}
#mmpSceneEditor .mmp-scene-title{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:10px}
#mmpSceneEditor .mmp-scene-title strong{font-size:13px;margin-right:auto}
#mmpSceneEditor select,#mmpSceneEditor button,#mmpSceneEditor .mmp-scene-upload{border:1px solid #d9d1ed;border-radius:7px;background:#fff;min-height:30px;padding:4px 8px;color:#473c79;font-size:12px;font-weight:650}
#mmpSceneEditor button{cursor:pointer}#mmpSceneEditor button:hover{background:#efeafd}
#mmpSceneEditor .mmp-scene-timeline{display:flex;min-height:62px;width:100%;align-items:stretch;overflow:hidden;border-radius:7px;background:#ece8f4;position:relative;touch-action:pan-y}
#mmpSceneEditor .mmp-scene-cut{min-width:0;box-sizing:border-box;border:1px solid #e8e2f6;position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;overflow:visible;user-select:none;gap:3px}
#mmpSceneEditor .mmp-scene-cut:nth-child(odd){background:#ded8f4}#mmpSceneEditor .mmp-scene-cut:nth-child(even){background:#d5e9f2}
#mmpSceneEditor .mmp-scene-cut.is-selected{outline:2px solid #7658d2;outline-offset:-2px;z-index:2}
#mmpSceneEditor .mmp-scene-cut b{font-size:11px}#mmpSceneEditor .mmp-scene-cut small{font-size:10px;white-space:nowrap;color:#605b73}
#mmpSceneEditor .mmp-scene-handle{position:absolute;top:0;bottom:0;right:-6px;width:12px;background:#7159c3;border:2px solid #fff;box-sizing:border-box;border-radius:6px;z-index:5;cursor:ew-resize;touch-action:none;box-shadow:0 0 0 1px #8a74d8}
#mmpSceneEditor .mmp-scene-selected{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin-top:10px}#mmpSceneEditor .mmp-scene-selected[hidden]{display:none}
#mmpSceneEditor .mmp-scene-upload{position:relative;cursor:pointer;background:#eee8ff}#mmpSceneEditor .mmp-scene-upload input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}
#mmpSceneEditor #mmpSceneImageName{max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#646078}
#mmpSceneEditor .mmp-scene-help{font-size:11px;color:#747187;margin:10px 0 0}
#mmpSceneEditor .mmp-scene-title span{font-size:11px;color:#68627f}

/* 2026-10-29: scene timeline / progress alignment and full-size preview.
   All changes are scoped to video workspace presentation only. */
@media (min-width:1025px){
  html body.settings-mode-video #videoWorkspace.video-workspace:not(.mmp-lyric-active){
    height:calc(100dvh - 145px) !important;max-height:none !important;
    overflow:hidden !important;align-items:stretch !important;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active)> .video-main:has(#mmpSceneEditor){
    display:flex !important;flex-direction:column !important;
    grid-template-rows:none !important;gap:14px !important;
    height:100% !important;max-height:none !important;min-height:0 !important;
    overflow-x:hidden !important;overflow-y:auto !important;
    scrollbar-width:thin;scrollbar-color:#b8a8dc transparent;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage-slot{
    display:block !important;flex:none !important;container-type:normal !important;
    width:100% !important;height:auto !important;min-height:0 !important;
    overflow:visible !important;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage-slot>.video-preview-stage:not(:fullscreen):not(.is-shorts){
    display:block !important;width:100% !important;height:auto !important;
    max-width:100% !important;max-height:none !important;aspect-ratio:16 / 9 !important;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage-slot>.video-preview-stage.is-shorts:not(:fullscreen){
    width:min(100%,400px) !important;height:auto !important;
    max-height:none !important;aspect-ratio:9 / 16 !important;
  }
}
/* Match the cut regions to the seek slider itself, excluding the two time labels. */
#videoWorkspace .video-preview-seek-row{display:grid !important;grid-template-columns:48px minmax(0,1fr) 48px !important;align-items:center;gap:8px !important;}
#videoWorkspace .video-preview-seek-row>#videoPreviewSeek{min-width:0;width:100% !important;margin:0 !important;}
#videoWorkspace #mmpSceneEditor .mmp-scene-timeline{width:calc(100% - 88px) !important;margin-left:44px !important;margin-right:44px !important;}
/* Make the thumbnail file selection feel like the four source upload controls. */
#videoWorkspace #mmpThumbIntroControls .mmp-thumb-file-control{background:#f0eafe;border:1px solid rgba(122,94,195,.25);border-radius:10px;height:40px;}
#videoWorkspace #mmpThumbIntroControls .mmp-thumb-file-pick{background:#e7ddfb;color:#5438aa;font-weight:850;}
#videoWorkspace #mmpThumbIntroControls .mmp-thumb-intro-upload:hover .mmp-thumb-file-control,#videoWorkspace #mmpThumbIntroControls .mmp-thumb-intro-upload:focus-within .mmp-thumb-file-control{background:#eae0fc;border-color:#7a58de;}
#videoWorkspace #mmpThumbIntroControls .mmp-thumb-file-control small{color:#5540a8;}

/* Scene editor compact single-line controls: scene count + even distribution. */
#videoWorkspace #mmpSceneEditor .mmp-scene-title{
  display:flex !important; flex-flow:row nowrap !important; gap:10px !important;
  align-items:center !important; min-width:0 !important;
}
#videoWorkspace #mmpSceneEditor .mmp-scene-title strong{margin-right:auto !important;white-space:nowrap !important;flex:0 0 auto !important;}
#videoWorkspace #mmpSceneEditor .mmp-scene-title label{white-space:nowrap !important;flex:0 0 auto !important;}
#videoWorkspace #mmpSceneEditor #mmpSceneCount{width:96px !important;max-width:96px !important;min-width:96px !important;flex:0 0 96px !important;}
#videoWorkspace #mmpSceneEditor #mmpSceneAutofill{white-space:nowrap !important;flex:0 0 auto !important;}
#videoWorkspace #mmpSceneEditor #mmpSceneSummary{min-width:0 !important;flex:1 1 auto !important;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}
/* The preview progress and the scene track share fixed inner gutters.
   Keep the editor inside its own container: never size it using page coordinates. */
#videoWorkspace .video-preview-transport,
#videoWorkspace .video-preview-seek-row,
#videoWorkspace #mmpSceneEditor {box-sizing:border-box;min-width:0;max-width:100%;}
#videoWorkspace #mmpSceneEditor {width:100%;overflow:hidden;}
#videoWorkspace #mmpSceneEditor .mmp-scene-timeline {
  box-sizing:border-box !important;
  width:calc(100% - 88px) !important;
  max-width:calc(100% - 88px) !important;
  min-width:0 !important;
  margin-left:44px !important;
  margin-right:44px !important;
}
#videoWorkspace #mmpSceneEditor .mmp-scene-title {min-width:0 !important;max-width:100%;}

/* Scene track geometry is controlled by the measured preview seek rail. */
#videoWorkspace #mmpSceneEditor .mmp-scene-timeline {
  position:relative !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

/* 2026-10-29: zero-time seek thumb and scene time axis use the same endpoints.
   Native range thumbs sit half their diameter inside the input box.
   Expand only the seek input within its grid cell by the 7px thumb radius. */
#videoWorkspace .video-preview-seek-row > #videoPreviewSeek {
  box-sizing:border-box !important;
  width:calc(100% + 14px) !important;
  max-width:none !important;
  margin-left:-7px !important;
  margin-right:-7px !important;
  -webkit-appearance:none;appearance:none;
  height:16px;
  background:transparent;
}
#videoWorkspace .video-preview-seek-row > #videoPreviewSeek::-webkit-slider-runnable-track {
  height:6px;border:1px solid #bcbcc4;border-radius:999px;background:#e8e8ec;
}
#videoWorkspace .video-preview-seek-row > #videoPreviewSeek::-webkit-slider-thumb {
  -webkit-appearance:none;appearance:none;box-sizing:border-box;
  width:14px;height:14px;margin-top:-5px;border:0;border-radius:50%;
  background:#7452da;box-shadow:0 0 0 1px rgba(92,61,173,.1);cursor:pointer;
}
#videoWorkspace .video-preview-seek-row > #videoPreviewSeek::-moz-range-track {
  height:6px;border:1px solid #bcbcc4;border-radius:999px;background:#e8e8ec;
}
#videoWorkspace .video-preview-seek-row > #videoPreviewSeek::-moz-range-thumb {
  box-sizing:border-box;width:14px;height:14px;border:0;border-radius:50%;background:#7452da;cursor:pointer;
}

/* Preview/output parity: square video must not inherit the desktop 16:9 stage. */
@media (min-width:1025px){
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage-slot > .video-preview-stage.is-square:not(:fullscreen){
    width:min(100%, 68dvh) !important;
    height:auto !important;
    aspect-ratio:1 / 1 !important;
    max-height:none !important;
    margin-inline:auto !important;
  }
}
