:root {
  --tiptap-page-color: #fff;
  --tiptap-page-bg-color: #f9fafb;
  --tiptap-page-border: 1px solid #d7dfea;
  --tiptap-page-margin-top: 25px;
  --tiptap-page-height: 297mm;
  --tiptap-page-width: 210mm;
  --tiptap-page-break-height: 10px;
}

.editor-wrapper {
  position: absolute;
  top: 152px;
  width: 100%;
  bottom: 0;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--tiptap-page-bg-color);
}

.tiptap * {
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

.tiptap br {
  height: 1.25rem;
}

.tiptap p {
  min-height: 1.25rem;
}

.tiptap ul,
.tiptap ol {
  padding: 0 1rem;
  margin: 1.25rem 1rem 1.25rem 0.4rem;
}

.tiptap ul li p,
.tiptap ol li p {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.tiptap ul {
  list-style: initial;
}

.tiptap ol {
  list-style: decimal;
}

.tiptap h1,
.tiptap h2,
.tiptap h3,
.tiptap h4,
.tiptap h5,
.tiptap h6 {
  line-height: 1.1;
  margin-top: 2.5rem;
  text-wrap: pretty;
}

.tiptap h1,
.tiptap h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
}

.tiptap h1 {
  font-size: 1.4rem;
}

.tiptap h2 {
  font-size: 1.2rem;
}

.tiptap h3 {
  font-size: 1.1rem;
}

.tiptap h4,
.tiptap h5,
.tiptap h6 {
  font-size: 1rem;
}

.tiptap code {
  background-color: var(--purple-light);
  border-radius: 0.4rem;
  color: var(--black);
  font-size: 0.85rem;
  padding: 0.25em 0.3em;
}

.tiptap pre {
  background: var(--black);
  border-radius: 0.5rem;
  color: var(--white);
  font-family: JetBrainsMono, monospace;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
}

.tiptap pre code {
  background: none;
  color: inherit;
  font-size: 0.8rem;
  padding: 0;
}

.tiptap blockquote {
  border-left: 3px solid var(--gray-3);
  margin: 1.5rem 0;
  padding-left: 1rem;
}

.tiptap hr {
  border: none;
  border-top: 1px solid var(--gray-2);
  margin: 2rem 0;
}

.ProseMirror {
  position: relative;
  width: var(--tiptap-page-width);
  margin-top: var(--tiptap-page-margin-top);
  padding: 0 30mm;
  border: var(--tiptap-page-border);
  background-color: var(--tiptap-page-color);
  overflow: hidden;
  min-height: var(--tiptap-page-height);
}

.ProseMirror blockquote {
  padding-left: 1rem;
  border-left: 2px solid rgba(13, 13, 13, 0.1);
}

.ProseMirror table {
  border-collapse: collapse;
  margin: 0;
  overflow: hidden;
  table-layout: fixed;
  width: 100%;
}

.ProseMirror table th,
.ProseMirror table td {
  border: 1pt solid rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  min-width: 1em;
  padding: 3px 5px;
  position: relative;
  vertical-align: top;
}

.ProseMirror table th {
  background-color: #f1f3f5;
  font-weight: bold;
  text-align: left;
}

.ProseMirror table td.selectedCell:after {
  background: rgba(200, 200, 255, 0.4);
  content: '';
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.ProseMirror table td.column-resize-handle {
  background-color: #adf;
  bottom: -2px;
  position: absolute;
  right: -2px;
  pointer-events: none;
  top: 0;
  width: 4px;
}

.ProseMirror table p {
  margin: 0;
}

.ProseMirror .template {
  background-color: #e0e0e0;
  padding: 1px 6px;
  border-radius: 16px;
}

.tableWrapper {
  padding: 1rem 0;
  overflow-x: auto;
}

.resize-cursor {
  cursor: ew-resize;
  cursor: col-resize;
}

.ProseMirror-focused:focus {
  outline: none;
}

.page-break {
  position: absolute;
  width: var(--tiptap-page-width);
  height: var(--tiptap-page-break-height);
  background-color: var(--tiptap-page-bg-color);
  border-top: var(--tiptap-page-border);
  border-bottom: var(--tiptap-page-border);
}
