.tiptap-editor-wrap {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tiptap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.tiptap-toolbar__btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  color: #374151;
}

.tiptap-toolbar__btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.tiptap-toolbar__sep {
  width: 1px;
  background: #d1d5db;
  margin: 0 0.25rem;
  align-self: stretch;
}

.tiptap-editor-content {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
}

.tiptap-editor-content .ProseMirror {
  outline: none;
  min-height: 100%;
}

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

.tiptap-editor-content .ProseMirror h1 { font-size: 1.875rem; font-weight: 700; margin: 1rem 0 0.5rem; }
.tiptap-editor-content .ProseMirror h2 { font-size: 1.5rem; font-weight: 700; margin: 1rem 0 0.5rem; }
.tiptap-editor-content .ProseMirror h3 { font-size: 1.25rem; font-weight: 600; margin: 0.75rem 0 0.5rem; }
.tiptap-editor-content .ProseMirror h4 { font-size: 1.125rem; font-weight: 600; margin: 0.75rem 0 0.5rem; }

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

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

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

.tiptap-editor-content .ProseMirror pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
}

.tiptap-editor-content .ProseMirror table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
}

.tiptap-editor-content .ProseMirror th,
.tiptap-editor-content .ProseMirror td {
  border: 1px solid #d1d5db;
  padding: 0.375rem 0.5rem;
  vertical-align: top;
}

.tiptap-editor-content .ProseMirror th {
  background: #f3f4f6;
  font-weight: 600;
}

.tiptap-callout {
  border-left: 4px solid #3b82f6;
  background: #eff6ff;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  border-radius: 0 0.375rem 0.375rem 0;
}

.tiptap-callout--warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

.tiptap-callout--success {
  border-color: #10b981;
  background: #ecfdf5;
}

.tiptap-callout--danger {
  border-color: #ef4444;
  background: #fef2f2;
}

.tiptap-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #000;
}

.tiptap-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tiptap-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.tiptap-gallery__item {
  margin: 0;
}

.tiptap-gallery__item img {
  width: 100%;
  height: auto;
  border-radius: 0.375rem;
  display: block;
}

.tiptap-gallery__item figcaption {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.tiptap-figure-image {
  margin: 1rem 0;
  text-align: center;
}

.tiptap-figure-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.tiptap-figure-image figcaption {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

.tiptap-cta {
  border: 1px solid #dbeafe;
  background: #f0f9ff;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.tiptap-cta__button {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.tiptap-cta__body {
  text-align: left;
}

.tiptap-spoiler {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}

.tiptap-spoiler summary {
  cursor: pointer;
  font-weight: 600;
  color: #374151;
}

.tiptap-spoiler__body {
  margin-top: 0.5rem;
}

.tiptap-editor-content .ProseMirror a {
  color: #2563eb;
  text-decoration: underline;
}

/* Dark mode (escala zinc, estilo Dokploy) */
.dark .tiptap-editor-wrap {
  background: #18181b;
  border-color: #27272a;
}

.dark .tiptap-toolbar {
  background: #18181b;
  border-bottom-color: #27272a;
}

.dark .tiptap-toolbar__btn {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

.dark .tiptap-toolbar__btn:hover {
  background: #3f3f46;
  border-color: #52525b;
}

.dark .tiptap-toolbar__sep {
  background: #3f3f46;
}

.dark .tiptap-editor-content .ProseMirror {
  color: #f4f4f5;
}

.dark .tiptap-editor-content .ProseMirror p.is-editor-empty:first-child::before {
  color: #71717a;
}

.dark .tiptap-editor-content .ProseMirror pre {
  background: #09090b;
  color: #e4e4e7;
}

.dark .tiptap-editor-content .ProseMirror th,
.dark .tiptap-editor-content .ProseMirror td {
  border-color: #3f3f46;
}

.dark .tiptap-editor-content .ProseMirror th {
  background: #27272a;
}

.dark .tiptap-callout {
  border-left-color: #60a5fa;
  background: #172554;
}

.dark .tiptap-callout--warning {
  border-color: #fbbf24;
  background: #451a03;
}

.dark .tiptap-callout--success {
  border-color: #34d399;
  background: #064e3b;
}

.dark .tiptap-callout--danger {
  border-color: #f87171;
  background: #450a0a;
}

.dark .tiptap-cta {
  border-color: #1e40af;
  background: #0f2557;
}

.dark .tiptap-cta__button {
  background: #60a5fa;
  color: #09090b;
}

.dark .tiptap-spoiler {
  border-color: #3f3f46;
}

.dark .tiptap-spoiler summary {
  color: #e4e4e7;
}

.dark .tiptap-gallery__item figcaption,
.dark .tiptap-figure-image figcaption {
  color: #a1a1aa;
}

.dark .tiptap-editor-content .ProseMirror a {
  color: #60a5fa;
}
