.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

.ProseMirror li {
  position: relative;
}

.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection *::-moz-selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }

.ProseMirror-selectednode {
  outline: 2px solid #8cf;
}

/* Make sure li selections wrap around markers */

li.ProseMirror-selectednode {
  outline: none;
}

li.ProseMirror-selectednode:after {
  content: "";
  position: absolute;
  left: -32px;
  right: -2px; top: -2px; bottom: -2px;
  border: 2px solid #8cf;
  pointer-events: none;
}
.ProseMirror-textblock-dropdown {
  min-width: 3em;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}

.ProseMirror-prompt {
  background: white;
  padding: 5px 10px 5px 15px;
  border: 1px solid silver;
  position: fixed;
  border-radius: 3px;
  z-index: 11;
  box-shadow: -.5px 2px 5px rgba(0, 0, 0, .2);
}

.ProseMirror-prompt h5 {
  margin: 0;
  font-weight: normal;
  font-size: 100%;
  color: #444;
}

.ProseMirror-prompt input[type="text"],
.ProseMirror-prompt textarea {
  background: #eee;
  border: none;
  outline: none;
}

.ProseMirror-prompt input[type="text"] {
  padding: 0 4px;
}

.ProseMirror-invalid {
  background: #ffc;
  border: 1px solid #cc7;
  border-radius: 4px;
  padding: 5px 10px;
  position: absolute;
  min-width: 10em;
}

.ProseMirror-prompt-buttons {
  margin-top: 5px;
  display: none;
}

.ProseMirror {
  padding: 4px 8px 4px 14px;
  line-height: 1.2;
  outline: none;
}

.ProseMirror p { margin-bottom: 1em }

.placeholder::before {
  content: var(--placeholder-text);
  color: #aaa;
  position: absolute;
}

/* Ref: https://github.com/yjs/y-prosemirror#remote-cursors

this is a rough fix for the first cursor position when the first paragraph is empty */
.ProseMirror > .ProseMirror-yjs-cursor:first-child {
  margin-top: 16px;
}
.ProseMirror p:first-child, .ProseMirror h1:first-child, .ProseMirror h2:first-child, .ProseMirror h3:first-child, .ProseMirror h4:first-child, .ProseMirror h5:first-child, .ProseMirror h6:first-child {
  margin-top: 16px
}
/* This gives the remote user caret. The colors are automatically overwritten*/
.ProseMirror-yjs-cursor {
  position: relative;
  margin-left: -1px;
  margin-right: -1px;
  border-left: 1px solid black;
  border-right: 1px solid black;
  border-color: orange;
  word-break: normal;
  pointer-events: none;
}
/* This renders the username above the caret */
.ProseMirror-yjs-cursor > div {
  position: absolute;
  top: -1.05em;
  left: -1px;
  font-size: 13px;
  background-color: rgb(250, 129, 0);
  font-family: serif;
  font-style: normal;
  font-weight: normal;
  line-height: normal;
  user-select: none;
  color: white;
  padding-left: 2px;
  padding-right: 2px;
  white-space: nowrap;
}

#y-version {
  position: relative;
}

.version-modal[hidden] {
  display: none;
}

.version-modal:not([hidden]) {
  position: absolute;
  top: 30px;
  right: 0;
  width: 300px;
  min-height: 300px;
  height: fit-content;
  z-index: 20;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 11px;
  border-top-right-radius: 0;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
}

.version-modal > button {
  position: absolute;
  right: 0;
  top: 0;
}

.version-list {
  line-height: 30px;
  padding: 0 8px;
  cursor: pointer;
}

.version-list:hover {
  background-color: #eee;
}

[ychange_type] {
  position: relative;
}
.ychange-hover {
  display: none;
}
*:hover > .ychange-hover {
  display: inline;
  position: absolute;
  width: max-content;
  top: -14px;
  left: 0;
  font-size: 12px;
  padding: 0 2px;
  border-radius: 3px 3px 0 0;
  color: #fdfdfe;
  user-select: none;
  word-break: normal;
}

ychange[ychange_type='removed'], p[ychange_type='removed'] {
  text-decoration: line-through;
}
/*
p[ychange_type='removed'] > span > br {
  display: none;
}
*/
*:not(ychange)[ychange_type='removed'] {
  background-color: #ff5a56;
  color: inherit !important;
}
img[ychange_type='removed'] {
  padding: 2px;
}
