/* ============================================================
   ProseMirror Sandbox Styles
   Mirrors editorjs.css tokens so dark mode works automatically.
   ============================================================ */

/* ── Page layout ─────────────────────────────────────────── */

.prose-sandbox-page {
  position: relative;
  min-height: 100vh;
  padding-bottom: 4rem;
}

.prose-sandbox-badge {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
  z-index: 50;
  pointer-events: none;
}

/* ── Editor wrap ─────────────────────────────────────────── */

.prose-editor-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* ── Fixed toolbar ───────────────────────────────────────── */

.prose-toolbar--fixed {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  width: fit-content;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dark .prose-toolbar--fixed {
  background: #1f2937;
  border-color: #374151;
}

/* Table context bar — second row inside the fixed toolbar */
.prose-table-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.dark .prose-table-bar {
  border-top-color: #374151;
}

.prose-table-bar__label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.04em;
  margin-right: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.prose-table-bar__btn {
  font-size: 11px !important;
  font-weight: 500;
  width: auto !important;
  padding: 0 8px !important;
  height: 28px;
  white-space: nowrap;
}

.prose-toolbar__group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.prose-toolbar__group + .prose-toolbar__group {
  border-left: 1px solid #e5e7eb;
  margin-left: 4px;
  padding-left: 4px;
}

.dark .prose-toolbar__group + .prose-toolbar__group {
  border-color: #374151;
}

/* ── Toolbar buttons ─────────────────────────────────────── */

.prose-toolbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}

.prose-toolbar__btn:hover {
  background: #f3f4f6;
}

.dark .prose-toolbar__btn {
  color: #d1d5db;
}

.dark .prose-toolbar__btn:hover {
  background: #374151;
}

.prose-toolbar__btn.is-active {
  background: #eef2ff;
  color: #4f46e5;
}

.dark .prose-toolbar__btn.is-active {
  background: #312e81;
  color: #a5b4fc;
}

/* ── Floating toolbar ────────────────────────────────────── */

.prose-toolbar--floating {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 6px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  pointer-events: auto;
}

.dark .prose-toolbar--floating {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.prose-toolbar--floating .prose-toolbar__btn {
  color: #374151;
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.dark .prose-toolbar--floating .prose-toolbar__btn {
  color: #d1d5db;
}

.prose-toolbar--floating .prose-toolbar__btn:hover {
  background: #f3f4f6;
}

.dark .prose-toolbar--floating .prose-toolbar__btn:hover {
  background: #374151;
}

.prose-toolbar--floating .prose-toolbar__btn.is-active {
  background: #eef2ff;
  color: #4f46e5;
}

.dark .prose-toolbar--floating .prose-toolbar__btn.is-active {
  background: #312e81;
  color: #a5b4fc;
}

/* floating toolbar sub-panels */
.prose-floating-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Link input mode — replaces buttons inside the floating toolbar */
.prose-floating-link-panel {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.prose-floating-link-panel__icon {
  color: #9ca3af;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.prose-floating-link-panel__input {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #111827;
  padding: 3px 8px;
  font-size: 13px;
  width: 200px;
  outline: none;
}

.dark .prose-floating-link-panel__input {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #f9fafb;
}

.prose-floating-link-panel__input::placeholder { color: #9ca3af; }
.dark .prose-floating-link-panel__input::placeholder { color: #6b7280; }
.prose-floating-link-panel__input:focus { border-color: #6366f1; }
.dark .prose-floating-link-panel__input:focus { border-color: rgba(99,102,241,0.7); }

.prose-floating-link-panel__save {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.prose-floating-link-panel__save:hover { background: #4338ca; }

.prose-floating-link-panel__unlink {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 11px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.prose-floating-link-panel__unlink:hover { color: #ef4444; }
.dark .prose-floating-link-panel__unlink {
  color: rgba(255,255,255,0.4);
}
.dark .prose-floating-link-panel__unlink:hover { color: #f87171; }

/* ── Link card pending (input) state ─────────────────────── */

.prose-link-card-pending {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0;
  margin: 0.75rem 0;
  overflow: hidden;
}

.dark .prose-link-card-pending {
  border-color: #374151;
}

.prose-link-card-pending__inner {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}

.prose-link-card-pending__icon {
  color: #9ca3af;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.prose-link-card-pending__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  background: transparent;
  color: #374151;
}

.dark .prose-link-card-pending__input {
  color: #d1d5db;
}

.prose-link-card-pending__input::placeholder {
  color: #9ca3af;
}

.prose-link-card-pending__cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.prose-link-card-pending__cancel:hover {
  background: #fee2e2;
  color: #ef4444;
}

.dark .prose-link-card-pending__cancel:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.prose-link-card-pending__hint {
  display: block;
  font-size: 0.72rem;
  color: #9ca3af;
  padding: 0 1rem 0.5rem;
  border-top: 1px solid #f3f4f6;
}

.dark .prose-link-card-pending__hint {
  border-color: #1f2937;
}

/* ── Color picker ────────────────────────────────────────── */

.prose-toolbar__color-wrap {
  position: relative;
}

.prose-align-picker {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  display: flex;
  gap: 2px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px;
  z-index: 40;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dark .prose-align-picker {
  background: #1f2937;
  border-color: #374151;
}

.prose-color-picker {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(8, 20px);
  gap: 3px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  z-index: 40;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  width: 200px;
}

.dark .prose-color-picker {
  background: #1f2937;
  border-color: #374151;
}

.prose-color-picker__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}

.prose-color-picker__dot:hover {
  transform: scale(1.2);
  border-color: rgba(0,0,0,0.2);
}

/* ── Title field ─────────────────────────────────────────── */

.prose-title {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  outline: none;
  margin: 2rem 0 1rem;
  line-height: 1.2;
  border: none;
}

.dark .prose-title {
  color: #f9fafb;
}

.prose-title:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* ── Save status ─────────────────────────────────────────── */

.prose-save-status {
  font-size: 12px;
  color: #9ca3af;
  text-align: right;
  min-height: 1.2em;
  margin-bottom: 0.5rem;
}

.dark .prose-save-status {
  color: #6b7280;
}

/* ── Editor content area ─────────────────────────────────── */

.prose-editor-mount {
  outline: none;
  min-height: 200px;
  color: #111827;
  font-size: 1rem;
  line-height: 1.75;
}

.dark .prose-editor-mount {
  color: #f3f4f6;
}

/* ProseMirror resets */
.ProseMirror {
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ProseMirror > * + * {
  margin-top: 0.5rem;
}

.ProseMirror p { margin: 0; }

/* Placeholder — shows on the first empty paragraph when editor has focus */
.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #9ca3af;
  pointer-events: none;
  height: 0;
}

.dark .ProseMirror p.is-editor-empty:first-child::before {
  color: #4b5563;
}

.ProseMirror h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin: 1.25rem 0 0.25rem; }
.ProseMirror h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; margin: 1rem 0 0.25rem; }
.ProseMirror h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; margin: 0.875rem 0 0.25rem; }
.ProseMirror ul  { list-style: disc;    padding-left: 1.5rem; }
.ProseMirror ol  { list-style: decimal; padding-left: 1.5rem; }
.ProseMirror li  { margin: 0.125rem 0; }
.ProseMirror hr  { border: none; border-top: 2px solid #e5e7eb; margin: 1.5rem 0; }
.dark .ProseMirror hr { border-color: #374151; }
.ProseMirror a   { color: #4f46e5; text-decoration: underline; }
.dark .ProseMirror a { color: #818cf8; }

/* ── Images ──────────────────────────────────────────────── */

.ProseMirror img {
  max-width: 100%;
  border-radius: 6px;
  display: block;
  margin: 0.5rem 0;
}

/* Selected image node ring */
.ProseMirror .prose-image-block.ProseMirror-selectednode,
.ProseMirror figure.ProseMirror-selectednode {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Attachment node ─────────────────────────────────────── */

.prose-attachment {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin: 0.5rem 0;
}

.dark .prose-attachment {
  border-color: #374151;
}

.prose-attachment__inner,
.prose-attachment a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  text-decoration: none;
  color: inherit;
}

.prose-attachment__icon {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #374151;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.dark .prose-attachment__icon {
  background: #374151;
  color: #d1d5db;
}

.prose-attachment__name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prose-attachment__size {
  font-size: 0.75rem;
  color: #9ca3af;
  flex-shrink: 0;
}

/* ── Link card node ──────────────────────────────────────── */

.prose-link-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75rem 0;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.prose-link-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

.dark .prose-link-card {
  border-color: #374151;
}

.dark .prose-link-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.3); }

.prose-link-card__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none !important;
  color: inherit;
  padding: 1rem 1.25rem;
}

.prose-link-card__text {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.prose-link-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.dark .prose-link-card__title { color: #f9fafb; }

.prose-link-card__desc {
  font-size: 0.82rem;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  margin-bottom: 6px;
}

.dark .prose-link-card__desc { color: #9ca3af; }

.prose-link-card__site {
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Image is on the RIGHT — matches Editor.js style */
.prose-link-card__image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  order: 1;
}

/* ── Image block node ────────────────────────────────────── */

.prose-image-block {
  margin: 0.75rem 0;
  display: block;
  position: relative;
}

.prose-image-block img {
  display: block;
  max-width: 100%;
  border-radius: 4px;
  height: auto;
}

.prose-image-block--auto img  { width: auto;  max-width: 100%; }
.prose-image-block--wide img  { width: 100%; }
.prose-image-block--full img  { width: 100%; border-radius: 0; }

.prose-image-caption {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #9ca3af;
  text-align: center;
  font-style: italic;
}

/* Image toolbar — shown when image node is selected */
.prose-image-toolbar {
  position: fixed;
  display: none;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 6px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dark .prose-image-toolbar {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.prose-image-toolbar.is-visible { display: flex; }

.prose-image-toolbar__btns {
  display: flex;
  align-items: center;
  gap: 2px;
}

.prose-image-toolbar__label {
  color: #6b7280;
  font-size: 11px;
  padding: 0 4px;
}

.dark .prose-image-toolbar__label {
  color: #9ca3af;
}

/* Caption input panel */
.prose-image-toolbar__caption-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.prose-image-toolbar__caption-input {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #111827;
  padding: 3px 8px;
  font-size: 13px;
  width: 200px;
  outline: none;
}

.dark .prose-image-toolbar__caption-input {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #f9fafb;
}

.prose-image-toolbar__caption-input::placeholder { color: #9ca3af; }
.dark .prose-image-toolbar__caption-input::placeholder { color: #6b7280; }
.prose-image-toolbar__caption-input:focus { border-color: #6366f1; }
.dark .prose-image-toolbar__caption-input:focus { border-color: rgba(99,102,241,0.7); }

.prose-image-toolbar__btn {
  background: none;
  border: none;
  color: #374151;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.1s;
}

.dark .prose-image-toolbar__btn {
  color: #d1d5db;
}

.prose-image-toolbar__btn--apply {
  background: #4f46e5;
  color: #fff;
}
.prose-image-toolbar__btn--apply:hover { background: #4338ca !important; }

.prose-image-toolbar__btn:hover {
  background: #f3f4f6;
}

.dark .prose-image-toolbar__btn:hover {
  background: rgba(255,255,255,0.1);
}

.prose-image-toolbar__btn.is-active {
  background: #eef2ff;
  color: #4f46e5;
}

.dark .prose-image-toolbar__btn.is-active {
  background: #312e81;
  color: #a5b4fc;
}

.prose-image-toolbar__divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.15);
  margin: 0 2px;
}

/* ── Link tooltip popup ──────────────────────────────────── */

.prose-link-popup {
  position: fixed;
  display: none;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 280px;
}

.dark .prose-link-popup {
  background: #1f2937;
  border-color: #374151;
}

.prose-link-popup.is-visible { display: flex; }

.prose-link-popup__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #111827;
  padding: 2px 0;
}

.dark .prose-link-popup__input { color: #f9fafb; }

.prose-link-popup__input::placeholder { color: #9ca3af; }

.prose-link-popup__apply {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.prose-link-popup__apply:hover { background: #1d4ed8; }

.prose-link-popup__remove {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 3px 6px;
  font-size: 12px;
  border-radius: 4px;
}

.prose-link-popup__remove:hover { color: #ef4444; background: #fee2e2; }

/* ── Tables ──────────────────────────────────────────────── */

.ProseMirror table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.ProseMirror th,
.ProseMirror td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

.dark .ProseMirror th,
.dark .ProseMirror td {
  border-color: #374151;
}

.ProseMirror th {
  background: #f9fafb;
  font-weight: 600;
}

.dark .ProseMirror th {
  background: #1f2937;
}

.ProseMirror .selectedCell:after {
  background: rgba(99, 102, 241, 0.15);
  content: "";
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

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

/* ── Drop cursor ─────────────────────────────────────────── */

.ProseMirror-dropcursor {
  background: #4f46e5;
  pointer-events: none;
  position: absolute;
}

/* ── Gap cursor ──────────────────────────────────────────── */

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

/* ── Slash menu ──────────────────────────────────────────── */

.prose-slash-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 220px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  padding: 4px;
}

.dark .prose-slash-menu {
  background: #1f2937;
  border-color: #374151;
}

.prose-slash-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  transition: background 0.1s;
}

.dark .prose-slash-menu__item {
  color: #d1d5db;
}

.prose-slash-menu__item:hover,
.prose-slash-menu__item.is-active {
  background: #f3f4f6;
}

.dark .prose-slash-menu__item:hover,
.dark .prose-slash-menu__item.is-active {
  background: #374151;
}

.prose-slash-menu__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.dark .prose-slash-menu__icon {
  background: #374151;
}

.prose-slash-menu__label {
  font-weight: 500;
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .prose-toolbar--fixed {
    top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .prose-editor-wrap {
    padding: 0 1rem 4rem;
  }

  .prose-title {
    font-size: 1.5rem;
  }

  .prose-color-picker {
    grid-template-columns: repeat(6, 20px);
    width: 160px;
  }
}

/* ── Rendered ProseMirror content (read-only views: public site, emails, etc.)
   Use .prose-content as the wrapper class wherever server-rendered
   ProseMirror HTML is displayed. Replaces .editorjs-content once fully migrated.
   ──────────────────────────────────────────────────────────────────────────── */
.prose-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #111827;
}

.dark .prose-content {
  color: #f3f4f6;
}

.prose-content h1,
.prose-content h2,
.prose-content h3,
.prose-content h4,
.prose-content h5,
.prose-content h6 {
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.25em;
  margin-bottom: 0.25em;
}

.prose-content h1 { font-size: 1.75em; }
.prose-content h2 { font-size: 1.375em; }
.prose-content h3 { font-size: 1.125em; font-weight: 600; }
.prose-content h4 { font-size: 1em; }

.prose-content p {
  margin-top: 0;
  margin-bottom: 0.6em;
}

.prose-content ul,
.prose-content ol {
  margin-top: 0;
  margin-bottom: 1em;
  padding-left: 1.5rem;
}

.prose-content ul { list-style-type: disc; }
.prose-content ol { list-style-type: decimal; }

.prose-content li {
  margin-bottom: 0.25em;
}

.prose-content a {
  color: #4f46e5;
  text-decoration: underline;
}

.dark .prose-content a {
  color: #818cf8;
}

.prose-content strong { font-weight: 700; }
.prose-content em     { font-style: italic; }
.prose-content u      { text-decoration: underline; }

.prose-content mark {
  border-radius: 2px;
  padding: 0 2px;
}

.prose-content hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 1.5rem 0;
}

.dark .prose-content hr {
  border-color: #374151;
}

.prose-content figure {
  margin: 1.25em 0;
}

.prose-content img {
  max-width: 100%;
  border-radius: 0.375rem;
}

.prose-content figcaption {
  font-size: 0.875em;
  color: #6b7280;
  margin-top: 0.5em;
  text-align: center;
}

.dark .prose-content figcaption {
  color: #9ca3af;
}

.prose-content > *:first-child { margin-top: 0; }
.prose-content > *:last-child  { margin-bottom: 0; }

.dark .prose-content table { border-color: #374151; }
.prose-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose-content th,
.prose-content td {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.dark .prose-content th,
.dark .prose-content td { border-color: #374151; }
.prose-content th { font-weight: 600; background: #f9fafb; }
.dark .prose-content th { background: #1f2937; }
