.tiptap-editor .ProseMirror {
  font-family: var(--writer-font-family, var(--writer-font-serif));
  font-size: var(--writer-font-size, 18px);
  line-height: var(--writer-line-height, 1.8);
  max-width: var(--writer-line-width, 65ch);
  margin: 0 auto;
  outline: none;
  min-height: 60vh;
  padding: 0 1rem;
  color: var(--writer-text);
}

.tiptap-editor .ProseMirror p {
  margin-bottom: 0.5em;
}

.tiptap-editor .ProseMirror h1 {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.2;
  margin: 1.5em 0 0.5em;
  color: var(--writer-heading-color, var(--writer-text));
}

.tiptap-editor .ProseMirror h2 {
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.2em 0 0.4em;
  color: var(--writer-heading-color, var(--writer-text));
}

.tiptap-editor .ProseMirror h3 {
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.4;
  margin: 1em 0 0.3em;
  color: var(--writer-heading-color, var(--writer-text));
}

.tiptap-editor .ProseMirror h4 {
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.8em 0 0.3em;
}

.tiptap-editor .ProseMirror h5 {
  font-size: 1em;
  font-weight: 600;
  line-height: 1.5;
  margin: 0.6em 0 0.2em;
}

.tiptap-editor .ProseMirror h6 {
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.5;
  margin: 0.6em 0 0.2em;
}

.tiptap-editor .ProseMirror blockquote {
  border-left: 3px solid var(--writer-blockquote-border);
  padding-left: 1em;
  margin: 0.8em 0;
  color: var(--writer-text-muted);
  font-style: italic;
}

.tiptap-editor .ProseMirror pre {
  background: var(--writer-code-bg);
  border-radius: 8px;
  padding: 0.8em 1em;
  font-family: var(--writer-font-mono);
  font-size: 0.9em;
  overflow-x: auto;
  margin: 0.8em 0;
}

.tiptap-editor .ProseMirror pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.tiptap-editor .ProseMirror code {
  background: var(--writer-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: var(--writer-font-mono);
  font-size: 0.9em;
}

.tiptap-editor .ProseMirror ul,
.tiptap-editor .ProseMirror ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.tiptap-editor .ProseMirror li {
  margin: 0.2em 0;
}

.tiptap-editor .ProseMirror ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
}

.tiptap-editor .ProseMirror ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
}

.tiptap-editor .ProseMirror ul[data-type="taskList"] li > label {
  flex-shrink: 0;
  margin-top: 0.25em;
}

.tiptap-editor .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"] {
  accent-color: var(--writer-accent);
}

.tiptap-editor .ProseMirror hr {
  border: none;
  border-top: 1px solid var(--writer-border);
  margin: 1.5em 0;
}

.tiptap-editor .ProseMirror a {
  color: var(--writer-accent);
  text-decoration: underline;
  cursor: pointer;
}

.tiptap-editor .ProseMirror a:hover {
  color: var(--writer-accent-hover);
}

.tiptap-editor .ProseMirror s {
  text-decoration: line-through;
  color: var(--writer-text-muted);
}

.tiptap-editor .ProseMirror strong {
  font-weight: 700;
}

.tiptap-editor .ProseMirror em {
  font-style: italic;
}

.tiptap-editor .ProseMirror u {
  text-decoration: underline;
}

.tiptap-editor .ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
}

.tiptap-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

.tiptap-editor .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p {
  color: var(--writer-text-muted);
  text-decoration: line-through;
}

/* Ghost text for AI completions */
.ghost-text-decoration {
  color: var(--writer-text-muted);
  opacity: 0.6;
}

.ghost-text-decoration::before {
  content: attr(data-ghost-text);
}

/* Slash command menu */
.slash-menu {
  min-width: 240px;
}

.slash-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.slash-menu-item:hover,
.slash-menu-item.is-selected {
  background: #1f2937;
}

/* Typewriter scroll container */
#editor-scroll-container {
  scroll-behavior: smooth;
}

/* Zen mode toolbar */
.zen-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 51;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.3s, transform 0.3s;
}

.zen-toolbar.visible {
  opacity: 1;
  transform: translateY(0);
}

.zen-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 8px 16px;
  opacity: 0.4;
  font-size: 12px;
  color: var(--writer-text-muted);
  transition: opacity 0.3s;
  z-index: 52;
}

.zen-footer:hover {
  opacity: 1;
}

/* Toolbar button active state */
.toolbar-btn {
  color: #9ca3af;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.toolbar-btn:hover {
  color: #f3f4f6;
  background: #1f2937;
}

.toolbar-btn.active {
  color: #e0e7ff;
  background: #374151;
}

.toolbar-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: #374151;
  margin: 0 4px;
}

/* Editor footer */
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-top: 1px solid var(--writer-border);
  font-size: 12px;
  color: var(--writer-text-muted);
  background: var(--writer-bg);
}
