.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.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; }

/* See https://code.haverbeke.berlin/prosemirror/prosemirror/issues/1421#issuecomment-1759320191 */
.ProseMirror [draggable][contenteditable=false] { user-select: text }

.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;
}

/* Protect against generic img rules */

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
}

.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 .tableWrapper {
  overflow-x: auto;
}
.ProseMirror table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  overflow: hidden;
}
.ProseMirror td,
.ProseMirror th {
  vertical-align: top;
  box-sizing: border-box;
  position: relative;
}

.ProseMirror td:not([data-colwidth]):not(.column-resize-dragging),
.ProseMirror th:not([data-colwidth]):not(.column-resize-dragging) {
  /* if there's no explicit width set and the column is not being resized, set a default width */
  min-width: var(--default-cell-min-width);
}

.ProseMirror .column-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  z-index: 20;
  background-color: #adf;
  pointer-events: none;
}
.ProseMirror.resize-cursor {
  cursor: ew-resize;
  cursor: col-resize;
}
/* Give selected cells a blue overlay */
.ProseMirror .selectedCell:after {
  z-index: 2;
  position: absolute;
  content: '';
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(200, 200, 255, 0.4);
  pointer-events: none;
}

/* The passage editor's own look (after the ProseMirror base styles). It follows the textbook-style view of the Content tab. */
.pe-host { border: 1px solid var(--line, #d9e0ea); border-radius: .375rem; background: var(--bg, #fff); }
.pe-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .375rem .5rem; border-bottom: 1px solid var(--line, #d9e0ea); background: var(--note, #f6f8fb); border-radius: .375rem .375rem 0 0; }
.pe-btn { padding: .2rem .6rem; font: inherit; font-size: .8125rem; color: inherit; background: transparent; border: 1px solid transparent; border-radius: .25rem; cursor: pointer; }
.pe-btn:hover:not(:disabled) { background: #fff; border-color: var(--line, #d9e0ea); }
.pe-btn:disabled { opacity: .4; cursor: default; }
.pe-sep { width: 1px; height: 1.25rem; background: var(--line, #d9e0ea); margin: 0 .25rem; }
.pe-doc { padding: .5rem .75rem; max-height: 22rem; overflow: auto; }
.pe-content { outline: none; min-height: 6rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pe-content p { margin: .35rem 0; }
.pe-content ul, .pe-content ol { margin: .35rem 0; padding-left: 1.5rem; }
.pe-content li > p { margin: .15rem 0; }
.pe-content table { border-collapse: collapse; margin: .5rem 0; font-size: .8125rem; min-width: 60%; table-layout: fixed; }
.pe-content th, .pe-content td { border: 1px solid var(--line, #d9e0ea); padding: .3rem .5rem; text-align: left; vertical-align: top; min-width: 3rem; position: relative; }
.pe-content th { background: var(--note, #f4f6fa); font-weight: 600; }
.pe-content td p, .pe-content th p { margin: 0; }
.pe-content .selectedCell:after { content: ""; position: absolute; inset: 0; background: rgba(47, 95, 196, .15); pointer-events: none; z-index: 2; }
