/* WYSH-style article editor */

.app--editor {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

.editor-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Header ── */
.editor-page-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #e8e8e6;
  position: sticky;
  top: 0;
  z-index: 50;
}

.editor-page-header-left,
.editor-page-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-page-header-left { justify-self: start; min-width: 0; }
.editor-page-header-right { justify-self: end; }

.editor-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  margin-right: 4px;
  border-radius: 8px;
  border: 1.5px solid #dc2626;
  background: #fef2f2;
  color: #dc2626;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.editor-back-btn:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.editor-page-logo {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-right: 12px;
  color: var(--text);
  max-width: min(360px, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-page-logo.is-empty {
  color: var(--text-3);
  font-weight: 500;
}

.editor-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-2);
}
.editor-icon-btn:hover:not(:disabled) { background: #f0f0ee; color: var(--text); }
.editor-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.editor-btn-draft {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #e0e0de;
  background: #fff;
  color: var(--text);
}
.editor-btn-draft:hover { background: #f8f8f6; }

.editor-btn-publish {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  background: #22a06b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.editor-btn-publish:hover { background: #1d8f5e; }
.editor-btn-publish:disabled { opacity: 0.6; }

/* ── Banner ── */
.editor-banner {
  padding: 10px 20px;
  background: #fef9e7;
  border-bottom: 1px solid #f5e6a3;
  font-size: 13px;
  color: #7a6520;
  text-align: center;
}

/* ── Body ── */
.editor-page-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  flex: 1;
  align-items: start;
}

.editor-canvas {
  padding: 32px 48px 80px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  overflow: visible;
}

.editor-page-title {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 28px;
  outline: none;
}
.editor-page-title::placeholder { color: #b5b0a0; }

/* ── Blocks ── */
.editor-blocks-wys { display: flex; flex-direction: column; gap: 4px; overflow: visible; }

.editor-block-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  border-radius: 8px;
  transition: background 0.1s;
}
.editor-block-row:hover { background: rgba(255,255,255,0.6); }
.editor-block-row.focused { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.editor-drag-handle {
  width: 24px;
  flex-shrink: 0;
  padding-top: 8px;
  color: #ccc;
  cursor: grab;
  opacity: 0;
  display: grid;
  place-items: start center;
  user-select: none;
  -webkit-user-drag: element;
}
.editor-drag-handle:active { cursor: grabbing; }
.editor-block-row:hover .editor-drag-handle,
.editor-block-row.focused .editor-drag-handle { opacity: 1; }

.editor-block-content { flex: 1; min-width: 0; user-select: text; }

.editor-block-row .editor-block {
  border: none;
  background: transparent;
  box-shadow: none;
}
.editor-block-row .editor-block-chrome { display: none; }
.editor-block-row .editor-block-body { padding: 0; }

.editor-block-delete {
  width: 24px;
  flex-shrink: 0;
  padding-top: 6px;
  color: #ccc;
  opacity: 0;
  display: grid;
  place-items: start center;
}
.editor-block-row:hover .editor-block-delete,
.editor-block-row.focused .editor-block-delete { opacity: 1; }
.editor-block-delete:hover { color: var(--coral, #e85d4c); }

.editor-block-row.dragging { opacity: 0.35; }

.editor-block-row.drop-hover {
  background: rgba(37, 99, 235, 0.04);
}

.editor-drop-line {
  position: relative;
  height: 3px;
  margin: 4px 0 4px 32px;
  border-radius: 2px;
  background: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  pointer-events: none;
}
.editor-drop-line::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px #fff;
}

.editor-blocks-wys.is-dragging .editor-block-row:not(.dragging) {
  transition: background 0.12s;
}

/* Block typography in canvas */
.editor-canvas .editor-block-h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.editor-canvas .editor-block-h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.editor-canvas .editor-block-h3 {
  font-size: 17px;
  font-weight: 600;
}
.editor-canvas .editor-block-p {
  font-size: 15px;
  line-height: 1.65;
  border: none;
  resize: none;
  width: 100%;
  background: transparent;
}
.editor-canvas .block-todo-editor,
.editor-canvas .block-list-editor,
.editor-canvas .code-block,
.editor-canvas .block-quote-editor,
.editor-canvas .block-callout-editor,
.editor-canvas .block-table-editor,
.editor-canvas .block-img-editor,
.editor-canvas .block-video-editor {
  margin: 4px 0;
}

.block-callout-variant-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  padding-left: 32px;
}

.block-callout-variant-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: #fff;
  cursor: pointer;
  color: #666;
  font-family: inherit;
}

.block-callout-variant-btn:hover {
  border-color: #ccc;
  color: #333;
}

.block-callout-variant-btn.active {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}

.editor-canvas .block-callout-editor {
  display: block;
}

.editor-canvas .block-callout-editor .callout {
  margin: 0;
  align-items: flex-start;
}

.editor-canvas .block-callout-editor .callout-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}

.editor-canvas .block-callout-editor .callout-label {
  flex-shrink: 0;
}

/* Add block */
.editor-add-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-left: 32px;
}

.editor-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px dashed #ccc;
  background: #fff;
  color: var(--text-3);
  display: grid;
  place-items: center;
}
.editor-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.editor-block-menu {
  position: absolute;
  left: 32px;
  background: #fff;
  border: 1px solid #e8e8e6;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 8px;
  min-width: 220px;
  max-height: min(360px, calc(100vh - 100px));
  overflow-y: auto;
  z-index: 200;
  display: grid;
  gap: 2px;
}

.editor-block-menu--up {
  bottom: calc(100% + 8px);
  top: auto;
}

.editor-block-menu--down {
  top: calc(100% + 8px);
  bottom: auto;
}

.editor-more-menu {
  left: auto;
  right: 0;
  min-width: 200px;
  max-height: 320px;
}

.editor-block-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  text-align: left;
  width: 100%;
  color: var(--text);
}
.editor-block-menu-item:hover { background: #f5f5f3; }
.editor-block-menu-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #f0f0ee;
  display: grid; place-items: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.editor-block-menu-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

/* ── Sidebar ── */
.editor-sidebar {
  position: sticky;
  top: 53px;
  height: calc(100vh - 53px);
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #e8e8e6;
  padding: 0;
}

.editor-page-header-center {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f0f0ee;
  border-radius: 10px;
}

.editor-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
}
.editor-mode-tab:hover { color: var(--text); }
.editor-mode-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.editor-page-body--preview {
  display: block;
}

.editor-preview-full {
  flex: 1;
  overflow-y: auto;
  background: var(--paper, #fafaf8);
}

.editor-preview-full .article-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 36px 80px;
}

.editor-preview-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 36px;
  background: #eef4ff;
  border-bottom: 1px solid #d4e2ff;
  font-size: 13px;
  color: #3a5080;
  width: 100%;
}

.editor-preview-strip-btn {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #c8d8f8;
  font-size: 12.5px;
  font-weight: 500;
  color: #3a5080;
}
.editor-preview-strip-btn:hover { background: #f8faff; }

.editor-sidebar-head {
  padding: 16px 20px;
  border-bottom: 1px solid #e8e8e6;
}

.editor-sidebar-head-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.article-detail-cover {
  margin-bottom: 28px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 320px;
}
.article-detail-cover img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
.article-detail-cover-label {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface-2);
  text-align: center;
}

@media (max-width: 960px) {
  .editor-page-header-center { display: none; }
  .editor-preview-full .article-detail { padding: 0 20px 40px; }
  .editor-preview-strip { padding: 10px 20px; flex-wrap: wrap; }
}

.editor-sidebar-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.editor-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  display: block;
}

.editor-field-select,
.editor-field-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0de;
  border-radius: 8px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.editor-field-select:focus,
.editor-field-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.editor-field-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* Section picker — дерево папок */
.section-picker {
  position: relative;
}

.section-picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0de;
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.section-picker-trigger:hover {
  border-color: #ccc;
}

.section-picker.is-open .section-picker-trigger,
.section-picker-trigger:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.section-picker-trigger.is-empty .section-picker-trigger-text {
  color: var(--text-3);
}

.section-picker-trigger-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f3f4f6;
  color: var(--text-3);
}

.section-picker-trigger-icon.folder-blue { color: #3B82F6; background: #EFF6FF; }
.section-picker-trigger-icon.folder-amber { color: #D97706; background: #FFFBEB; }
.section-picker-trigger-icon.folder-violet { color: #7C3AED; background: #F5F3FF; }
.section-picker-trigger-icon.folder-green { color: #059669; background: #ECFDF5; }

.section-picker-trigger-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  font-weight: 500;
}

.section-picker-trigger-sep {
  margin: 0 5px;
  color: var(--text-3);
  font-weight: 400;
}

.section-picker-trigger-chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform 0.15s ease;
}

.section-picker.is-open .section-picker-trigger-chevron {
  transform: rotate(180deg);
}

.section-picker-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 19, 24, 0.12);
}

.section-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px 6px calc(8px + var(--sp-depth, 0) * 18px);
  border: none;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
}

.section-picker-item:hover {
  background: #f3f4f6;
}

.section-picker-item.is-selected {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.section-picker-item--empty {
  color: var(--text-3);
  margin-bottom: 4px;
  border-bottom: 1px solid #f0f0ee;
  border-radius: 7px 7px 0 0;
}

.section-picker-item-indent {
  width: 12px;
  flex-shrink: 0;
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.section-picker-item-branch {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-left: 1.5px solid #d1d5db;
  border-bottom: 1.5px solid #d1d5db;
  border-radius: 0 0 0 3px;
  transform: translateY(-70%);
}

.section-picker-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f3f4f6;
  color: var(--text-2);
}

.section-picker-item-icon.folder-blue { color: #3B82F6; background: #EFF6FF; }
.section-picker-item-icon.folder-amber { color: #D97706; background: #FFFBEB; }
.section-picker-item-icon.folder-violet { color: #7C3AED; background: #F5F3FF; }
.section-picker-item-icon.folder-green { color: #059669; background: #ECFDF5; }
.section-picker-item-icon--muted { color: var(--text-3); background: #f3f4f6; }

.section-picker-item-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  line-height: 1.3;
}

.section-picker-menu--overlay {
  z-index: 1100;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
}

.section-picker--overlay .section-picker-trigger {
  box-sizing: border-box;
}

.section-picker-item--header {
  cursor: default;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
  min-height: 30px;
  padding-top: 10px;
  padding-bottom: 4px;
}

.section-picker-item--header:hover {
  background: transparent;
}

.section-picker-item-icon--role {
  color: #6366f1;
  background: #eef2ff;
}

.section-picker-item-icon--head {
  color: #7c3aed;
  background: #f5f3ff;
}

.section-picker-item-icon--title {
  color: #64748b;
  background: #f1f5f9;
}

.section-picker-item-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.section-picker-item-meta {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  line-height: 1.3;
}

.section-picker-item--head .section-picker-item-name {
  font-weight: 600;
}

.section-picker-item-check {
  flex-shrink: 0;
  color: var(--accent);
}

.editor-tags-field {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e0e0de;
  border-radius: 8px;
  min-height: 42px;
  align-items: center;
}

.editor-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 10px;
  background: #f0f0ee;
  border-radius: 6px;
  font-size: 12.5px;
}
.editor-tag-chip button {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-3);
}
.editor-tag-chip button:hover { background: rgba(0,0,0,0.08); color: var(--text); }

.editor-tag-add {
  font-size: 12.5px;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 6px;
}
.editor-tag-add:hover { background: #f0f0ee; color: var(--text); }

.editor-person-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0de;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.editor-person-select:hover { border-color: #ccc; }

.editor-cover-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  border: 2px dashed #e0e0de;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-3);
  font-size: 13px;
  background: #fafaf8;
  min-height: 120px;
}
.editor-cover-upload:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.editor-cover-upload img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 6px; }

.editor-sidebar-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.editor-sidebar-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.editor-status-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-status-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0de;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

.editor-status-option:hover {
  border-color: #ccc;
  background: #fafaf8;
}

.editor-status-option.active {
  border-color: var(--text);
  background: #f5f5f3;
}

.editor-status-option-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.editor-status-option-hint {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.35;
}

/* ── Footer ── */
.editor-page-footer {
  padding: 8px 20px;
  background: #fff;
  border-top: 1px solid #e8e8e6;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  bottom: 0;
}
.editor-page-footer.saved { color: #22a06b; }

/* Tag dropdown in sidebar */
.editor-tags-dropdown {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e0e0de;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 30;
  padding: 4px;
}
.editor-tags-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.editor-tags-dropdown-item:hover { background: #f5f5f3; }
.editor-tags-dropdown-item.selected { background: var(--accent-soft); color: var(--accent-text); }

.editor-tags-wrap { position: relative; }

@media (max-width: 960px) {
  .editor-page-body { grid-template-columns: 1fr; }
  .editor-sidebar {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid #e8e8e6;
  }
  .editor-canvas { padding: 24px 20px 40px; }
}

/* ── Rich text (Word-like) ── */
.rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 53px;
  z-index: 45;
}

.rt-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rt-toolbar-sep {
  width: 1px;
  height: 24px;
  background: #e5e7eb;
  margin: 0 6px;
}

.rt-toolbar-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
}
.rt-toolbar-btn:hover { background: #f3f4f6; color: var(--text); }
.rt-toolbar-btn .rt-u { text-decoration: underline; }
.rt-toolbar-btn .rt-s { text-decoration: line-through; }

.rt-toolbar-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12.5px;
  color: var(--text);
  min-width: 96px;
}
.rt-toolbar-select--sm { min-width: 52px; justify-content: space-between; }
.rt-toolbar-select:hover { border-color: #d1d5db; background: #f9fafb; }

.rt-toolbar-dropdown { position: relative; }

.rt-toolbar-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 4px;
  z-index: 100;
}
.rt-toolbar-menu--sm { min-width: 72px; }
.rt-toolbar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
}
.rt-toolbar-menu-item:hover { background: #f3f4f6; }

.rt-toolbar-color {
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.rt-color-a { font-weight: 700; font-size: 14px; }
.rt-color-bar { width: 14px; height: 3px; border-radius: 2px; }

.rt-toolbar-palette {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, 24px);
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
}
.rt-toolbar-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}
.rt-toolbar-swatch:hover { transform: scale(1.08); }

.rt-editor {
  outline: none;
  width: 100%;
  min-height: 1.5em;
  word-break: break-word;
}
.rt-editor:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}
.rt-editor p { margin: 0 0 0.5em; }
.rt-editor p:last-child { margin-bottom: 0; }
.rt-editor ul, .rt-editor ol { margin: 0.4em 0; padding-left: 1.4em; }
.rt-editor a { color: var(--accent); text-decoration: underline; }

.rt-editor--heading { font-weight: 600; }
.rt-editor--quote { font-style: italic; }

.editor-canvas .block-quote-input.rt-editor,
.editor-canvas .block-callout-input.rt-editor {
  border: none;
  background: transparent;
  resize: none;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 960px) {
  .rt-toolbar { top: 53px; overflow-x: auto; flex-wrap: nowrap; }
}

