/* Video & subtitles only: original video editor, preset and rendering logic unchanged. */
@media (min-width:1025px) {
  html body.settings-mode-video #videoWorkspace.video-workspace:not(.mmp-lyric-active) {
    box-sizing:border-box !important;
    height:calc(100dvh - 145px) !important;
    max-height:calc(100dvh - 145px) !important;
    min-height:0 !important;
    overflow:hidden !important;
    align-items:stretch !important;
    grid-template-rows:minmax(0,1fr) !important;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) > .video-sidebar {
    box-sizing:border-box !important;
    height:100% !important;
    min-height:0 !important;
    max-height:100% !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior-y:contain;
    scrollbar-width:thin;
    scrollbar-color:#b8a8dc transparent;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) > .video-main {
    box-sizing:border-box !important;
    height:100% !important;
    min-height:0 !important;
    max-height:100% !important;
    overflow:hidden !important;
    display:grid !important;
    align-items:stretch !important;
    align-self:stretch !important;
    grid-template-rows:auto auto minmax(0,1fr) auto !important;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage {
    min-height:0 !important;
    height:100% !important;
    max-height:100% !important;
    max-width:100% !important;
    width:auto !important;
    place-self:center !important;
    align-self:center !important;
    justify-self:center !important;
    flex:none !important;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage.is-youtube,
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage.is-shorts {
    width:auto !important;
    max-width:100% !important;
    margin-inline:auto !important;
  }
  html body.settings-mode-video #videoWorkspace .video-preview-transport {
    gap:6px;
    padding:8px 12px;
  }
  html body.settings-mode-video #videoWorkspace .video-trim-panel {
    margin-top:3px;
    padding:7px 10px;
  }
  html body.settings-mode-video #videoWorkspace .video-trim-head {
    margin-bottom:3px;
  }
}
/* Prevent the outer page from sliding when scrolling over the preview. */
html:has(body.settings-mode-video),
html body.settings-mode-video {
  overflow-y:hidden !important;
}
@media (min-width:1025px) {
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage-slot {
    box-sizing:border-box;
    display:grid;
    place-items:center;
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    overflow:hidden;
    container-type:size;
  }
  html body.settings-mode-video #videoWorkspace:not(.mmp-lyric-active) .video-preview-stage-slot > .video-preview-stage:not(:fullscreen) {
    box-sizing:border-box;
    display:block;
    position:relative;
    min-width:0 !important;
    min-height:0 !important;
    width:min(100cqw,calc(100cqh * 16 / 9)) !important;
    height:min(100cqh,calc(100cqw * 9 / 16)) !important;
    max-width:100cqw !important;
    max-height:100cqh !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(100cqw,calc(100cqh * 9 / 16)) !important;
    height:min(100cqh,calc(100cqw * 16 / 9)) !important;
    aspect-ratio:9 / 16 !important;
  }
}
/* Four upload sources occupy the row above the unchanged play/export controls. */
html body.settings-mode-video #videoWorkspace .video-quick-sources {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  min-width:0;
}
html body.settings-mode-video #videoWorkspace .video-quick-source {
  box-sizing:border-box;
  position:relative;
  min-width:0;
  min-height:60px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:3px;
  padding:8px 6px;
  border:1px solid rgba(122,94,195,.18);
  border-radius:10px;
  background:#f0eafe;
  color:#302849;
  cursor:pointer;
  text-align:center;
}
html body.settings-mode-video #videoWorkspace .video-quick-source:hover,
html body.settings-mode-video #videoWorkspace .video-quick-source:focus-within {
  border-color:#7a58de;
  background:#eae0fc;
  outline:2px solid rgba(120,88,220,.10);
}
html body.settings-mode-video #videoWorkspace .video-quick-source-title {
  display:block;
  font-size:12px;
  font-weight:850;
  white-space:nowrap;
}
html body.settings-mode-video #videoWorkspace .video-quick-source small {
  box-sizing:border-box;
  width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
  color:#71688b;
  line-height:1.35;
}
html body.settings-mode-video #videoWorkspace .video-quick-source.has-file small {
  color:#5540a8;
  font-weight:750;
}
html body.settings-mode-video #videoWorkspace .video-quick-source input[type=file] {
  position:absolute;
  inset:0;
  height:100%;
  width:100%;
  padding:0;
  margin:0;
  opacity:0;
  cursor:pointer;
  z-index:1;
}
/* Keep dark theme usable without changing the chosen app theme. */
html body.settings-mode-video:not(.light-theme) #videoWorkspace .video-quick-source {
  background:#292335;
  border-color:#504064;
  color:#f5f0ff;
}
html body.settings-mode-video:not(.light-theme) #videoWorkspace .video-quick-source small {
  color:#b8afd2;
}
@media (max-width:1024px) {
  html body.settings-mode-video #videoWorkspace .video-quick-sources {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* Individual upload removal: upload surface and delete control are independent. */
html body.settings-mode-video #videoWorkspace .video-quick-source-wrap{position:relative;min-width:0;}
html body.settings-mode-video #videoWorkspace .video-quick-source-wrap>.video-quick-source{width:100%;height:100%;padding-right:27px;}
html body.settings-mode-video #videoWorkspace .video-source-clear{position:absolute;z-index:4;top:7px;right:7px;width:23px;height:23px;border:1px solid #b8a5e9;border-radius:7px;background:#fff;color:#6840b8;font-weight:800;font-size:18px;line-height:19px;cursor:pointer;padding:0;}
html body.settings-mode-video #videoWorkspace .video-source-clear:hover{background:#f7dce7;color:#a02040;border-color:#d598ac;}
html body.settings-mode-video #videoWorkspace .video-source-clear[hidden]{display:none!important;}
html body.settings-mode-video #videoWorkspace .video-source-clear:focus-visible{outline:2px solid #7a58de;outline-offset:2px;}

/* Preserve four-column upload grid with independent remove buttons. */
html body.settings-mode-video #videoWorkspace .video-quick-sources > .video-quick-source-wrap{position:relative;min-width:0;min-height:60px;display:block;}
html body.settings-mode-video #videoWorkspace .video-quick-source-wrap > .video-quick-source{display:flex;width:100%;height:100%;box-sizing:border-box;}
