:root {
  --rbe-font: Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rbe-bg: #f6f8fb;
  --rbe-surface: #ffffff;
  --rbe-surface-soft: #f1f5f9;
  --rbe-text: #172033;
  --rbe-muted: #667085;
  --rbe-border: #d7dee8;
  --rbe-border-strong: #afbac9;
  --rbe-accent: #2563eb;
  --rbe-accent-soft: #e7efff;
  --rbe-success: #07845f;
  --rbe-warning: #b76b00;
  --rbe-danger: #cf2f2f;
  --rbe-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  --rbe-radius: 8px;
  --rbe-min-height: 320px;
}

.rbe-svg-icon,
.rbe-color-icon,
.rbe-menu-icon,
.rbe-upload-icon,
.rbe-link-preview-icon,
.rbe-attachment-icon,
.rbe-attachment-card-icon,
.rbe-premium-modal-icon,
.rbe-mermaid-modal .rbe-svg-icon {
  color: currentColor;
  -webkit-text-fill-color: currentColor;
}

.rbe:not(.rbe-theme-dark) .rbe-svg-icon {
  color: #334155;
}

.rbe:not(.rbe-theme-dark) .rbe-theme-toggle-btn,
.rbe:not(.rbe-theme-dark) .rbe-media-gear,
.rbe:not(.rbe-theme-dark) .rbe-drag-handle { color: #475569; }
.rbe:not(.rbe-theme-dark) .rbe-save-btn,
.rbe:not(.rbe-theme-dark) .rbe-check-toggle.is-checked,
.rbe:not(.rbe-theme-dark) .rbe-list-add,
.rbe:not(.rbe-theme-dark) .rbe-checklist-add,
.rbe:not(.rbe-theme-dark) .rbe-table-action[data-action="add-row"],
.rbe:not(.rbe-theme-dark) .rbe-table-action[data-action="add-col"] { color: #047857; }
.rbe:not(.rbe-theme-dark) .rbe-export-btn,
.rbe:not(.rbe-theme-dark) .rbe-export-html-btn,
.rbe:not(.rbe-theme-dark) .rbe-sheet-dashboard-btn,
.rbe:not(.rbe-theme-dark) .rbe-upload-icon,
.rbe:not(.rbe-theme-dark) .rbe-link-preview-icon,
.rbe:not(.rbe-theme-dark) .rbe-code-format,
.rbe:not(.rbe-theme-dark) .rbe-raw-format,
.rbe:not(.rbe-theme-dark) .rbe-drawing-text-apply,
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="createLink"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="justifyLeft"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="justifyCenter"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="justifyRight"] { color: #1d4ed8; }
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="bold"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="formatBlock"],
.rbe:not(.rbe-theme-dark) .rbe-table-heading-toggle,
.rbe:not(.rbe-theme-dark) .rbe-image-crop-toggle { color: #b45309; }
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="italic"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="underline"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="strikeThrough"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="insertComment"],
.rbe:not(.rbe-theme-dark) .rbe-toggle-arrow { color: #7c3aed; }
.rbe:not(.rbe-theme-dark) .rbe-clear-editor-btn,
.rbe:not(.rbe-theme-dark) .rbe-block-action[data-action="delete"],
.rbe:not(.rbe-theme-dark) .rbe-media-delete,
.rbe:not(.rbe-theme-dark) .rbe-row-remove,
.rbe:not(.rbe-theme-dark) .rbe-check-remove,
.rbe:not(.rbe-theme-dark) .rbe-drawing-clear,
.rbe:not(.rbe-theme-dark) .rbe-table-action[data-action="remove-row"],
.rbe:not(.rbe-theme-dark) .rbe-table-action[data-action="remove-col"],
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="removeComment"] { color: #dc2626; }
.rbe:not(.rbe-theme-dark) .rbe-block-add,
.rbe:not(.rbe-theme-dark) .rbe-inline-btn[data-command="removeFormat"],
.rbe:not(.rbe-theme-dark) .rbe-list-action,
.rbe:not(.rbe-theme-dark) .rbe-checklist-action,
.rbe:not(.rbe-theme-dark) .rbe-table-action,
.rbe:not(.rbe-theme-dark) .rbe-menu-icon,
.rbe:not(.rbe-theme-dark) .rbe-attachment-icon,
.rbe:not(.rbe-theme-dark) .rbe-attachment-card-icon { color: #0f766e; }
.rbe:not(.rbe-theme-dark) .rbe-premium-badge,
.rbe:not(.rbe-theme-dark) .rbe-premium-modal-icon,
.rbe:not(.rbe-theme-dark) .rbe-svg-icon[data-rbe-icon="wand-magic-sparkles"],
.rbe:not(.rbe-theme-dark) .rbe-svg-icon[data-rbe-icon="sparkles"] { color: #0f766e; }
.rbe:not(.rbe-theme-dark) .rbe-mermaid-tool,
.rbe:not(.rbe-theme-dark) .rbe-mermaid-icon-btn,
.rbe:not(.rbe-theme-dark) .rbe-mermaid-menu-btn,
.rbe:not(.rbe-theme-dark) .rbe-mermaid-style-btn,
.rbe:not(.rbe-theme-dark) .rbe-mermaid-icon-control,
body:not(:has(.rbe.rbe-theme-dark)):not(:has(.rbe-shell.rbe-theme-dark)) .rbe-mermaid-modal .rbe-mermaid-tool,
body:not(:has(.rbe.rbe-theme-dark)):not(:has(.rbe-shell.rbe-theme-dark)) .rbe-mermaid-modal .rbe-mermaid-icon-btn,
body:not(:has(.rbe.rbe-theme-dark)):not(:has(.rbe-shell.rbe-theme-dark)) .rbe-mermaid-modal .rbe-mermaid-menu-btn,
body:not(:has(.rbe.rbe-theme-dark)):not(:has(.rbe-shell.rbe-theme-dark)) .rbe-mermaid-modal .rbe-mermaid-style-btn,
body:not(:has(.rbe.rbe-theme-dark)):not(:has(.rbe-shell.rbe-theme-dark)) .rbe-mermaid-modal .rbe-mermaid-icon-control { color: #1e40af; }

.rbe.rbe-theme-dark,
.rbe-shell.rbe-theme-dark {
  color-scheme: dark;
  --rbe-bg: #0f172a;
  --rbe-surface: #111827;
  --rbe-surface-soft: #1f2937;
  --rbe-text: #e5e7eb;
  --rbe-muted: #9ca3af;
  --rbe-border: #374151;
  --rbe-border-strong: #4b5563;
  --rbe-accent: #60a5fa;
  --rbe-accent-soft: rgba(96, 165, 250, 0.16);
  --rbe-success: #34d399;
  --rbe-warning: #fbbf24;
  --rbe-danger: #f87171;
  --rbe-shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
}

.rbe-shell.rbe-theme-dark,
.rbe.rbe-theme-dark {
  color: var(--rbe-text);
}

.rbe-shell.rbe-theme-dark .rbe-shell-title,
.rbe-shell.rbe-theme-dark .rbe-shell-heading,
.rbe.rbe-theme-dark .rbe-editable,
.rbe.rbe-theme-dark .rbe-heading,
.rbe.rbe-theme-dark .rbe-list-marker {
  color: var(--rbe-text);
}

.rbe-shell.rbe-theme-dark .rbe-shell-panel,
.rbe.rbe-theme-dark .rbe-canvas,
.rbe.rbe-theme-dark .rbe-toolbar-btn,
.rbe.rbe-theme-dark .rbe-save-btn,
.rbe.rbe-theme-dark .rbe-export-menu,
.rbe.rbe-theme-dark .rbe-export-option,
.rbe.rbe-theme-dark .rbe-comment-content,
.rbe.rbe-theme-dark .rbe-comment-close,
.rbe.rbe-theme-dark .rbe-menu,
.rbe.rbe-theme-dark .rbe-menu-item,
.rbe.rbe-theme-dark .rbe-inline-toolbar,
.rbe.rbe-theme-dark .rbe-inline-btn,
.rbe.rbe-theme-dark .rbe-icon-btn,
.rbe.rbe-theme-dark .rbe-control-btn,
.rbe.rbe-theme-dark .rbe-small-btn,
.rbe.rbe-theme-dark input,
.rbe.rbe-theme-dark select,
.rbe.rbe-theme-dark textarea {
  border-color: var(--rbe-border);
  background: var(--rbe-surface);
  color: var(--rbe-text);
}

.rbe.rbe-theme-dark .rbe-toolbar-btn:hover:not(:disabled),
.rbe.rbe-theme-dark .rbe-save-btn:hover:not(:disabled),
.rbe.rbe-theme-dark .rbe-export-option:hover,
.rbe.rbe-theme-dark .rbe-export-option:focus-visible,
.rbe.rbe-theme-dark .rbe-inline-btn:hover,
.rbe.rbe-theme-dark .rbe-icon-btn:hover,
.rbe.rbe-theme-dark .rbe-control-btn:hover,
.rbe.rbe-theme-dark .rbe-small-btn:hover,
.rbe.rbe-theme-dark .rbe-menu-item:hover,
.rbe.rbe-theme-dark .rbe-menu-item.is-active {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
  color: #dbeafe;
}

.rbe.rbe-theme-dark select option,
.rbe.rbe-theme-dark select optgroup,
.rbe-shell.rbe-theme-dark select option,
.rbe-shell.rbe-theme-dark select optgroup,
body:has(.rbe.rbe-theme-dark) select option,
body:has(.rbe.rbe-theme-dark) select optgroup,
body:has(.rbe-shell.rbe-theme-dark) select option,
body:has(.rbe-shell.rbe-theme-dark) select optgroup {
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark select option:checked,
.rbe-shell.rbe-theme-dark select option:checked,
body:has(.rbe.rbe-theme-dark) select option:checked,
body:has(.rbe-shell.rbe-theme-dark) select option:checked {
  background: #1d4ed8;
  color: #ffffff;
}

.rbe.rbe-theme-dark .rbe-theme-toggle-btn {
  color: #fbbf24;
}

.rbe.rbe-theme-dark .rbe-clear-editor-btn {
  color: var(--rbe-danger);
}

.rbe.rbe-theme-dark .rbe-clear-editor-btn:hover:not(:disabled) {
  border-color: var(--rbe-danger);
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.rbe.rbe-theme-dark .rbe-save-btn {
  color: #34d399;
}

.rbe.rbe-theme-dark .rbe-export-btn {
  color: #22d3ee;
}

.rbe.rbe-theme-dark .rbe-export-html-btn {
  color: #818cf8;
}

.rbe.rbe-theme-dark .rbe-sheet-dashboard-btn {
  color: #38bdf8;
}

.rbe.rbe-theme-dark .rbe-export-option[data-rbe-export="json"] {
  color: #38bdf8;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="bold"] {
  color: #f59e0b;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="italic"] {
  color: #a78bfa;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="underline"] {
  color: #60a5fa;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="strikeThrough"] {
  color: #fb7185;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="formatBlock"] {
  color: #fb923c;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="createLink"] {
  color: #2dd4bf;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="justifyLeft"] {
  color: #4ade80;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="justifyCenter"] {
  color: #bef264;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="justifyRight"] {
  color: #e879f9;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="insertComment"] {
  color: #10b981;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="removeComment"] {
  color: #f472b6;
}

.rbe.rbe-theme-dark .rbe-inline-btn[data-command="removeFormat"] {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-color-control[title="Text color"] .rbe-color-icon {
  color: #3b82f6;
}

.rbe.rbe-theme-dark .rbe-color-control[title="Highlight"] .rbe-color-icon {
  color: #fde047;
}

.rbe.rbe-theme-dark .rbe-color-reset[data-command="foreColorReset"] {
  color: #c084fc;
}

.rbe.rbe-theme-dark .rbe-color-reset[data-command="hiliteColorReset"] {
  color: #facc15;
}

.rbe.rbe-theme-dark .rbe-block-add {
  color: #5eead4;
}

.rbe.rbe-theme-dark .rbe-drag-handle {
  color: #c4b5fd;
}

.rbe.rbe-theme-dark .rbe-block-action[data-action="move-up"] {
  color: #7dd3fc;
}

.rbe.rbe-theme-dark .rbe-block-action[data-action="move-down"] {
  color: #67e8f9;
}

.rbe.rbe-theme-dark .rbe-block-action[data-action="duplicate"] {
  color: #86efac;
}

.rbe.rbe-theme-dark .rbe-block-action[data-action="delete"],
.rbe.rbe-theme-dark .rbe-media-delete,
.rbe.rbe-theme-dark .rbe-row-remove,
.rbe.rbe-theme-dark .rbe-check-remove {
  color: #f87171;
}

.rbe.rbe-theme-dark .rbe-list-action[data-action="indent-list"] {
  color: #93c5fd;
}

.rbe.rbe-theme-dark .rbe-list-action[data-action="outdent-list"] {
  color: #a5b4fc;
}

.rbe.rbe-theme-dark .rbe-list-action[data-action="toggle-list-style"] {
  color: #f9a8d4;
}

.rbe.rbe-theme-dark .rbe-checklist-action[data-action="indent-checklist"] {
  color: #6ee7b7;
}

.rbe.rbe-theme-dark .rbe-checklist-action[data-action="outdent-checklist"] {
  color: #99f6e4;
}

.rbe.rbe-theme-dark .rbe-list-add {
  color: #22c55e;
}

.rbe.rbe-theme-dark .rbe-checklist-add {
  color: #84cc16;
}

.rbe.rbe-theme-dark .rbe-check-toggle {
  color: #64748b;
}

.rbe.rbe-theme-dark .rbe-check-toggle.is-checked {
  color: #4ade80;
}

.rbe.rbe-theme-dark .rbe-code-format,
.rbe.rbe-theme-dark .rbe-raw-format,
.rbe.rbe-theme-dark .rbe-drawing-text-apply {
  color: #38bdf8;
}

.rbe.rbe-theme-dark .rbe-drawing-clear {
  color: #fb7185;
}

.rbe.rbe-theme-dark .rbe-code-copy,
.rbe.rbe-theme-dark .rbe-raw-copy {
  color: #a3e635;
}

.rbe.rbe-theme-dark .rbe-media-gear {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-media-action-left {
  color: #60a5fa;
}

.rbe.rbe-theme-dark .rbe-media-action-top {
  color: #34d399;
}

.rbe.rbe-theme-dark .rbe-media-action-right {
  color: #c084fc;
}

.rbe.rbe-theme-dark .rbe-image-crop-toggle {
  color: #fbbf24;
}

.rbe.rbe-theme-dark .rbe-upload-icon {
  color: #38bdf8;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="add-row"] {
  color: #10b981;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="add-col"] {
  color: #14b8a6;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="remove-row"] {
  color: #fb7185;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="remove-col"] {
  color: #f43f5e;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="cell-align-left"] {
  color: #0ea5e9;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="cell-align-center"] {
  color: #8b5cf6;
}

.rbe.rbe-theme-dark .rbe-table-action[data-action="cell-align-right"] {
  color: #d946ef;
}

.rbe.rbe-theme-dark .rbe-table-heading-toggle {
  color: #f59e0b;
}

.rbe.rbe-theme-dark .rbe-divider-style-btn[data-style="line"] {
  color: #e2e8f0;
}

.rbe.rbe-theme-dark .rbe-divider-style-btn[data-style="dashed"] {
  color: #93c5fd;
}

.rbe.rbe-theme-dark .rbe-divider-style-btn[data-style="dotted"] {
  color: #f0abfc;
}

.rbe.rbe-theme-dark .rbe-divider-style-btn[data-style="thick"] {
  color: #fdba74;
}

.rbe.rbe-theme-dark .rbe-toggle-arrow {
  color: #818cf8;
}

.rbe.rbe-theme-dark .rbe-link-preview-icon {
  color: #22d3ee;
}

.rbe.rbe-theme-dark .rbe-attachment-icon,
.rbe.rbe-theme-dark .rbe-attachment-card-icon {
  color: #93c5fd;
}

.rbe.rbe-theme-dark .rbe-attachment-card[data-kind="pdf"] .rbe-attachment-card-icon {
  color: #f87171;
}

.rbe.rbe-theme-dark .rbe-attachment-card[data-kind="word"] .rbe-attachment-card-icon {
  color: #60a5fa;
}

.rbe.rbe-theme-dark .rbe-attachment-card[data-kind="excel"] .rbe-attachment-card-icon {
  color: #34d399;
}

.rbe.rbe-theme-dark .rbe-attachment-card[data-kind="powerpoint"] .rbe-attachment-card-icon {
  color: #fb923c;
}

.rbe.rbe-theme-dark .rbe-attachment-card[data-kind="video"] .rbe-attachment-card-icon {
  color: #a78bfa;
}

.rbe.rbe-theme-dark .rbe-attachment-card[data-kind="text"] .rbe-attachment-card-icon {
  color: #cbd5e1;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="paragraph"] .rbe-menu-icon {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="heading"] .rbe-menu-icon {
  color: #fbbf24;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="quote"] .rbe-menu-icon {
  color: #fb923c;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="list"] .rbe-menu-icon {
  color: #38bdf8;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="checklist"] .rbe-menu-icon {
  color: #4ade80;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="code"] .rbe-menu-icon {
  color: #a3e635;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="image"] .rbe-menu-icon {
  color: #2dd4bf;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="table"] .rbe-menu-icon {
  color: #c084fc;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="embed"] .rbe-menu-icon {
  color: #60a5fa;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="callout"] .rbe-menu-icon {
  color: #facc15;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="delimiter"] .rbe-menu-icon {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="button"] .rbe-menu-icon {
  color: #f472b6;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="toggle"] .rbe-menu-icon {
  color: #818cf8;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="linkPreview"] .rbe-menu-icon {
  color: #22d3ee;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="raw"] .rbe-menu-icon {
  color: #fb7185;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="attaches"] .rbe-menu-icon,
.rbe.rbe-theme-dark .rbe-menu-item[data-type="attachment"] .rbe-menu-icon {
  color: #93c5fd;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="audio"] .rbe-menu-icon {
  color: #f0abfc;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="drawing"] .rbe-menu-icon {
  color: #fdba74;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="mermaid"] .rbe-menu-icon {
  color: #67e8f9;
}

.rbe.rbe-theme-dark .rbe-menu-item[data-type="signature"] .rbe-menu-icon,
.rbe.rbe-theme-dark .rbe-menu-item[data-type="signatureFlow"] .rbe-menu-icon {
  color: #34d399;
}

.rbe.rbe-theme-dark .rbe-premium-badge,
.rbe.rbe-theme-dark .rbe-premium-badge .rbe-svg-icon {
  color: #f59e0b;
}

.rbe.rbe-theme-dark .rbe-premium-modal-icon {
  color: #34d399;
}

.rbe.rbe-theme-dark .rbe-svg-icon[data-rbe-icon="wand-magic-sparkles"],
.rbe-shell.rbe-theme-dark .rbe-svg-icon[data-rbe-icon="wand-magic-sparkles"] {
  color: #38bdf8;
  filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.38));
}

.rbe.rbe-theme-dark .rbe-comment-close,
.rbe.rbe-theme-dark .rbe-link-close,
.rbe.rbe-theme-dark .rbe-html-preview-close {
  color: #f87171;
}

.rbe.rbe-theme-dark .rbe-toast.is-success .rbe-svg-icon {
  color: #22c55e;
}

.rbe.rbe-theme-dark .rbe-toast.is-warning .rbe-svg-icon {
  color: #f59e0b;
}

.rbe.rbe-theme-dark .rbe-toast.is-error .rbe-svg-icon {
  color: #ef4444;
}

.rbe.rbe-theme-dark .rbe-output-check {
  color: #4ade80;
}

.rbe.rbe-theme-dark .rbe-output-annotation-actions button:first-child {
  color: #22c55e;
}

.rbe.rbe-theme-dark .rbe-output-annotation-actions button:last-child {
  color: #ef4444;
}

.rbe.rbe-theme-dark .rbe-comment-mark,
.rbe.rbe-theme-dark .rbe-output-annotation {
  background: rgba(250, 204, 21, 0.24);
  border-bottom-color: #facc15;
  color: #f8fafc;
}

.rbe.rbe-theme-dark .rbe-block:focus-within,
.rbe.rbe-theme-dark .rbe-block:hover,
.rbe.rbe-theme-dark .rbe-block-actions,
.rbe.rbe-theme-dark .rbe-block-action,
.rbe.rbe-theme-dark .rbe-quote,
.rbe.rbe-theme-dark .rbe-callout,
.rbe.rbe-theme-dark .rbe-table-wrap,
.rbe.rbe-theme-dark .rbe-code-wrap,
.rbe.rbe-theme-dark .rbe-link-preview-card,
.rbe.rbe-theme-dark .rbe-attachment-card,
.rbe.rbe-theme-dark .rbe-image {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: var(--rbe-text);
}

.rbe.rbe-theme-dark .rbe-editable:empty::before,
.rbe.rbe-theme-dark .rbe-menu-item small,
.rbe.rbe-theme-dark .rbe-shell-status,
.rbe-shell.rbe-theme-dark .rbe-shell-status,
.rbe-shell.rbe-theme-dark .rbe-shell-subtitle,
.rbe-shell.rbe-theme-dark .rbe-shell-progress-text {
  color: var(--rbe-muted);
}

.rbe.rbe-theme-dark .rbe-editable a {
  color: #93c5fd;
}

.rbe.rbe-theme-dark .rbe-html-preview-shell,
.rbe.rbe-theme-dark .rbe-html-preview-frame,
.rbe.rbe-theme-dark .rbe-html-preview-body,
.rbe.rbe-theme-dark .rbe-premium-modal-card,
.rbe.rbe-theme-dark .rbe-premium-modal-info {
  border-color: var(--rbe-border);
  background: var(--rbe-surface);
  color: var(--rbe-text);
}

.rbe.rbe-theme-dark .rbe-premium-modal-card h2,
.rbe.rbe-theme-dark .rbe-premium-modal-info h3,
.rbe.rbe-theme-dark .rbe-premium-modal-card p,
.rbe.rbe-theme-dark .rbe-premium-modal-info p,
.rbe.rbe-theme-dark .rbe-premium-modal-info ol {
  color: var(--rbe-text);
}

.rbe.rbe-theme-dark .rbe-color-control {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-code-color-label {
  border-color: var(--rbe-border);
  background: rgba(31, 41, 55, 0.82);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-dropzone,
.rbe.rbe-theme-dark .rbe-upload-dropzone {
  border-color: var(--rbe-border);
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-dropzone strong,
.rbe.rbe-theme-dark .rbe-upload-dropzone strong,
.rbe.rbe-theme-dark .rbe-upload-main {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-dropzone small,
.rbe.rbe-theme-dark .rbe-upload-dropzone small {
  color: #cbd5e1;
}

.rbe.rbe-theme-dark .rbe-dropzone:hover,
.rbe.rbe-theme-dark .rbe-dropzone:focus-within,
.rbe.rbe-theme-dark .rbe-upload-dropzone:hover,
.rbe.rbe-theme-dark .rbe-upload-dropzone:focus-within {
  border-color: #60a5fa;
  background: #1e1b4b;
}

.rbe.rbe-theme-dark .rbe-table-layout {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-table-width-label,
.rbe.rbe-theme-dark .rbe-table-align-label,
.rbe.rbe-theme-dark .rbe-table-border-style-label,
.rbe.rbe-theme-dark .rbe-table-border-width-label,
.rbe.rbe-theme-dark .rbe-table-width-value,
.rbe.rbe-theme-dark .rbe-table-border-width-value {
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-table th {
  background: #273449;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-table th.rbe-table-cell-selected,
.rbe.rbe-theme-dark .rbe-table td.rbe-table-cell-selected {
  background: rgba(96, 165, 250, 0.18);
  box-shadow: inset 0 0 0 2px #60a5fa;
}

.rbe.rbe-theme-dark .rbe-color-input {
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: var(--rbe-surface-soft);
}

.rbe.rbe-theme-dark .rbe-embed {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-embed .rbe-embed-url,
.rbe.rbe-theme-dark .rbe-embed .rbe-embed-caption,
.rbe.rbe-theme-dark .rbe-embed .rbe-embed-apply {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-embed .rbe-embed-url::placeholder,
.rbe.rbe-theme-dark .rbe-embed .rbe-embed-caption::placeholder {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-embed .rbe-embed-apply:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #172554;
  color: #dbeafe;
}

.rbe.rbe-theme-dark .rbe-embed-preview,
.rbe.rbe-theme-dark .rbe-embed-empty,
.rbe.rbe-theme-dark .rbe-embed-placeholder {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-callout[data-tone="info"] {
  border-left-color: #60a5fa;
  background: rgba(37, 99, 235, 0.18);
}

.rbe.rbe-theme-dark .rbe-callout[data-tone="success"] {
  border-left-color: #34d399;
  background: rgba(16, 185, 129, 0.16);
}

.rbe.rbe-theme-dark .rbe-callout[data-tone="warning"] {
  border-left-color: #fbbf24;
  background: rgba(245, 158, 11, 0.17);
}

.rbe.rbe-theme-dark .rbe-callout[data-tone="danger"] {
  border-left-color: #f87171;
  background: rgba(239, 68, 68, 0.16);
}

.rbe.rbe-theme-dark .rbe-callout .rbe-callout-tone {
  border-color: var(--rbe-border);
  background: var(--rbe-surface);
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-button-block,
.rbe.rbe-theme-dark .rbe-toggle {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-button-controls,
.rbe.rbe-theme-dark .rbe-toggle-summary,
.rbe.rbe-theme-dark .rbe-toggle-tools,
.rbe.rbe-theme-dark .rbe-toggle-content {
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-button-color-label {
  border-color: var(--rbe-border);
  background: var(--rbe-surface);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-button-color-label input[type="color"] {
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: var(--rbe-surface-soft);
}

.rbe.rbe-theme-dark .rbe-button-block input,
.rbe.rbe-theme-dark .rbe-button-block select,
.rbe.rbe-theme-dark .rbe-toggle input,
.rbe.rbe-theme-dark .rbe-toggle select {
  border-color: var(--rbe-border);
  background: var(--rbe-surface);
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-button-block input::placeholder,
.rbe.rbe-theme-dark .rbe-toggle input::placeholder {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-toggle-content {
  border-color: var(--rbe-border);
  background: #111827;
}

.rbe.rbe-theme-dark .rbe-toggle-nested-canvas > .rbe-block {
  background: transparent;
}

.rbe.rbe-theme-dark .rbe-link-preview {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-link-preview-card,
.rbe.rbe-theme-dark .rbe-output-link-preview {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-link-preview-card-description,
.rbe.rbe-theme-dark .rbe-output-link-preview span:last-child {
  color: #cbd5e1;
}

.rbe.rbe-theme-dark .rbe-link-preview input,
.rbe.rbe-theme-dark .rbe-link-preview select,
.rbe.rbe-theme-dark .rbe-link-preview textarea {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-link-preview input::placeholder,
.rbe.rbe-theme-dark .rbe-link-preview textarea::placeholder {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-plugin-card {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-plugin-toolbar {
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-plugin-toolbar label,
.rbe.rbe-theme-dark .rbe-chart-slice-label {
  color: #d1d5db;
}

.rbe.rbe-theme-dark .rbe-plugin-toolbar input,
.rbe.rbe-theme-dark .rbe-plugin-toolbar select,
.rbe.rbe-theme-dark .rbe-plugin-card textarea,
.rbe.rbe-theme-dark .rbe-chart-caption {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-plugin-toolbar input::placeholder,
.rbe.rbe-theme-dark .rbe-plugin-card textarea::placeholder,
.rbe.rbe-theme-dark .rbe-chart-caption:empty:before {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-chart-preview-wrap,
.rbe.rbe-theme-dark .rbe-plugin-preview,
.rbe.rbe-theme-dark .rbe-chart-preview {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-chart-type-bar {
  border-color: var(--rbe-border);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

.rbe.rbe-theme-dark .rbe-chart-type-btn {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-chart-type-btn:hover,
.rbe.rbe-theme-dark .rbe-chart-type-btn.is-active {
  border-color: #60a5fa;
  background: #172554;
  color: #bfdbfe;
}

.rbe.rbe-theme-dark .rbe-chart-slice-chip {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-drawing-block,
.rbe.rbe-theme-dark .rbe-drawing-shell,
.rbe.rbe-theme-dark .rbe-signature-editor,
.rbe.rbe-theme-dark .rbe-output-signature,
.rbe.rbe-theme-dark .rbe-signature-flow-editor,
.rbe.rbe-theme-dark .rbe-output-signature-flow,
.rbe.rbe-theme-dark .rbe-mermaid-card,
.rbe.rbe-theme-dark .rbe-mermaid-block {
  border-color: var(--rbe-border);
  background: var(--rbe-surface-soft);
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-drawing-canvas,
.rbe.rbe-theme-dark .rbe-signature-preview,
.rbe.rbe-theme-dark .rbe-signature-flow-step,
.rbe.rbe-theme-dark .rbe-mermaid-card-preview {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-preview {
  border-color: #334155;
  background: transparent;
}

.rbe.rbe-theme-dark .rbe-signature-watermark,
.rbe.rbe-theme-dark .rbe-flow-signature-watermark {
  content: url("blockwriteai-logo-dark.svg");
  opacity: 0.22;
}

.rbe.rbe-theme-dark .rbe-signature-static-label,
.rbe.rbe-theme-dark .rbe-signature-preview-name,
.rbe.rbe-theme-dark .rbe-signature-preview-copy,
.rbe.rbe-theme-dark .rbe-signature-preview-copy strong,
.rbe.rbe-theme-dark .rbe-output-signature-label,
.rbe.rbe-theme-dark .rbe-signature-name,
.rbe.rbe-theme-dark .rbe-signature-meta,
.rbe.rbe-theme-dark .rbe-signature-flow-top strong,
.rbe.rbe-theme-dark .rbe-output-signature-flow-title,
.rbe.rbe-theme-dark .rbe-mermaid-card-title,
.rbe.rbe-theme-dark .rbe-mermaid-card-empty {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-preview-name,
.rbe.rbe-theme-dark .rbe-signature-preview-copy,
.rbe.rbe-theme-dark .rbe-signature-preview-copy strong {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.rbe.rbe-theme-dark .rbe-drawing-text-input,
.rbe.rbe-theme-dark .rbe-drawing-size,
.rbe.rbe-theme-dark .rbe-signature-input,
.rbe.rbe-theme-dark .rbe-signature-flow-step input {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-drawing-text-input::placeholder,
.rbe.rbe-theme-dark .rbe-signature-input::placeholder,
.rbe.rbe-theme-dark .rbe-signature-flow-step input::placeholder {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-signature-align-btn,
.rbe.rbe-theme-dark .rbe-signature-flow-add,
.rbe.rbe-theme-dark .rbe-signature-flow-remove,
.rbe.rbe-theme-dark .rbe-flow-signature-apply,
.rbe.rbe-theme-dark .rbe-mermaid-edit-btn,
.rbe.rbe-theme-dark .rbe-mermaid-tool,
.rbe.rbe-theme-dark .rbe-mermaid-icon-btn,
.rbe.rbe-theme-dark .rbe-mermaid-menu-btn,
.rbe.rbe-theme-dark .rbe-mermaid-line-choice,
.rbe.rbe-theme-dark .rbe-mermaid-choice {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-align-btn {
  color: #a78bfa;
}

.rbe.rbe-theme-dark .rbe-signature-flow-add {
  color: #22c55e;
}

.rbe.rbe-theme-dark .rbe-signature-flow-remove {
  color: #fb7185;
}

.rbe.rbe-theme-dark .rbe-flow-signature-apply {
  border-color: #22c55e;
  background: #14532d;
  color: #bbf7d0;
}

.rbe.rbe-theme-dark .rbe-mermaid-edit-btn,
.rbe.rbe-theme-dark .rbe-mermaid-tool,
.rbe.rbe-theme-dark .rbe-mermaid-icon-btn,
.rbe.rbe-theme-dark .rbe-mermaid-menu-btn {
  color: #38bdf8;
}

.rbe.rbe-theme-dark .rbe-signature-align-btn:hover,
.rbe.rbe-theme-dark .rbe-signature-align-btn.is-active,
.rbe.rbe-theme-dark .rbe-signature-flow-add:hover,
.rbe.rbe-theme-dark .rbe-mermaid-edit-btn:hover,
.rbe.rbe-theme-dark .rbe-mermaid-edit-btn:focus-visible,
.rbe.rbe-theme-dark .rbe-mermaid-tool:hover,
.rbe.rbe-theme-dark .rbe-mermaid-tool.is-active,
.rbe.rbe-theme-dark .rbe-mermaid-icon-btn:hover,
.rbe.rbe-theme-dark .rbe-mermaid-icon-btn.is-active,
.rbe.rbe-theme-dark .rbe-mermaid-menu-btn:hover,
.rbe.rbe-theme-dark .rbe-mermaid-menu:focus-within > .rbe-mermaid-menu-btn,
.rbe.rbe-theme-dark .rbe-mermaid-line-choice:hover,
.rbe.rbe-theme-dark .rbe-mermaid-choice:hover,
.rbe.rbe-theme-dark .rbe-mermaid-choice.is-active {
  border-color: #60a5fa;
  background: #172554;
  color: #bfdbfe;
}

.rbe.rbe-theme-dark .rbe-signature-flow-remove:hover {
  border-color: #fb7185;
  background: rgba(127, 29, 29, 0.72);
  color: #fecdd3;
}

.rbe.rbe-theme-dark .rbe-signature-flow-index {
  background: #172554;
  color: #bfdbfe;
}

.rbe.rbe-theme-dark .rbe-flow-signature-card {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-flow-signature-card.is-signed {
  border-color: #22c55e;
  background: #052e16;
}

.rbe.rbe-theme-dark .rbe-flow-signature-head,
.rbe.rbe-theme-dark .rbe-flow-signature-name,
.rbe.rbe-theme-dark .rbe-flow-signature-meta,
.rbe.rbe-theme-dark .rbe-flow-signature-meta strong {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-flow-signature-input {
  border-color: var(--rbe-border);
  background: #0f172a;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-flow-signature-input::placeholder {
  color: #94a3b8;
}

.rbe.rbe-theme-dark .rbe-mermaid-dialog,
.rbe.rbe-theme-dark .rbe-mermaid-modal-head,
.rbe.rbe-theme-dark .rbe-mermaid-modal-foot,
.rbe.rbe-theme-dark .rbe-mermaid-modal-body,
.rbe.rbe-theme-dark .rbe-mermaid-toolbar,
.rbe.rbe-theme-dark .rbe-mermaid-popover,
.rbe.rbe-theme-dark .rbe-mermaid-submenu {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-mermaid-modal-title,
.rbe.rbe-theme-dark .rbe-mermaid-menu-row,
.rbe.rbe-theme-dark .rbe-mermaid-menu-row-icon {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-mermaid-menu-row:hover {
  background: #172554;
}

.rbe.rbe-theme-dark .rbe-mermaid-modal-save {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.rbe.rbe-theme-dark .rbe-mermaid-modal-cancel,
.rbe.rbe-theme-dark .rbe-mermaid-close {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal {
  background: rgba(2, 6, 23, 0.78);
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-dialog,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-dialog,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal-head,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal-head,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal-foot,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal-foot,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal-body,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal-body {
  border-color: #334155;
  background: #0f172a;
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal-title,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal-title,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-hint,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-hint,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar label,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar label,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-workspace label,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-workspace label,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu-row,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu-row,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu-row-icon,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu-row-icon,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-line-choice,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-line-choice,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-choice,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-choice {
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-toolbar,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-toolbar,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-workspace,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-workspace,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-popover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-popover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-submenu,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-submenu,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-options,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-options {
  border-color: #334155;
  background: #111827;
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-tool,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-tool,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-icon-btn,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-icon-btn,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu-btn,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu-btn,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar label,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar label,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-style-btn,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-style-btn,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-close,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-close,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal-cancel,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal-cancel {
  border-color: #334155;
  background: #0f172a;
  color: #93c5fd;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-tool[data-tool="select"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-tool[data-tool="select"] {
  color: #38bdf8;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-tool[data-tool="arrow"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-tool[data-tool="arrow"],
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-line-menu .rbe-mermaid-menu-btn,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-line-menu .rbe-mermaid-menu-btn {
  color: #22d3ee;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-tool[data-tool="text"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-tool[data-tool="text"] {
  color: #fbbf24;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-icon-btn[data-diagram-action="undo"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-icon-btn[data-diagram-action="undo"] {
  color: #a78bfa;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-icon-btn[data-diagram-action="redo"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-icon-btn[data-diagram-action="redo"] {
  color: #818cf8;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-icon-btn[data-diagram-action="image"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-icon-btn[data-diagram-action="image"] {
  color: #34d399;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu-btn[title="Shapes"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu-btn[title="Shapes"] {
  color: #f472b6;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-fill-control,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-fill-control {
  color: #60a5fa;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control[title="Border color"],
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control[title="Border color"] {
  color: #fb923c;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-text-control,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-text-control {
  color: #fbbf24;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-tool:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-tool:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-tool.is-active,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-tool.is-active,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-icon-btn:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-icon-btn:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-icon-btn.is-active,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-icon-btn.is-active,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu-btn:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu-btn:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu:focus-within > .rbe-mermaid-menu-btn,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu:focus-within > .rbe-mermaid-menu-btn,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar label:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar label:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control.is-active,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-icon-control.is-active,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-style-btn:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-style-btn:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-style-btn.is-active,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar .rbe-mermaid-style-btn.is-active,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-line-choice:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-line-choice:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-choice:hover,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-choice:hover,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-choice.is-active,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-choice.is-active {
  border-color: #60a5fa;
  background: #172554;
  color: #bfdbfe;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-modal-save,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-modal-save {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-menu-select,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-menu-select,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-action-select,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-action-select,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stylebar select,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stylebar select,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-workspace input,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-workspace input,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-options input,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-options input,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-options select,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-options select {
  border-color: #475569;
  background: #0f172a;
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-toolbar-sep,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-toolbar-sep,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-choice-grid:has(+ .rbe-mermaid-choice-grid),
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-choice-grid:has(+ .rbe-mermaid-choice-grid) {
  border-color: #334155;
  background-color: #334155;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stage-shell,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stage-shell {
  background: #0b1220;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-ruler-corner,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-ruler-corner,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-top-ruler,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-top-ruler,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-side-ruler,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-side-ruler {
  border-color: #334155;
  background-color: #111827;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-top-ruler span,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-top-ruler span,
body:has(.rbe.rbe-theme-dark) .rbe-mermaid-side-ruler span,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-side-ruler span {
  color: #cbd5e1;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-stage,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-stage {
  border-color: #334155;
  background-color: #0f172a;
  background-image:
    linear-gradient(45deg, rgba(148, 163, 184, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.08) 75%);
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-canvas,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-canvas {
  background: rgba(15, 23, 42, 0.92);
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-text-editor,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-text-editor {
  color: #f8fafc;
  caret-color: #93c5fd;
}

body:has(.rbe.rbe-theme-dark) .rbe-mermaid-text-editor::placeholder,
body:has(.rbe-shell.rbe-theme-dark) .rbe-mermaid-text-editor::placeholder {
  color: #94a3b8;
}

.rbe-chart-block input[type="color"],
.rbe-chart-slice-chip input[type="color"] {
  border-radius: 50px;
  overflow: hidden;
}

.rbe.rbe-theme-dark .rbe-raw-wrap,
.rbe.rbe-theme-dark .rbe-raw-header,
.rbe.rbe-theme-dark .rbe-raw-editor {
  border-color: var(--rbe-border);
  background: var(--rbe-code-bg, #30363d);
  color: var(--rbe-code-text, #f8fafc);
}

.rbe.rbe-theme-dark .rbe-code-editor,
.rbe.rbe-theme-dark .rbe-raw-editor {
  --rbe-code-bg: #30363d;
  --rbe-code-text: #f8fafc;
  background: var(--rbe-code-bg, #30363d);
}

.rbe.rbe-theme-dark .rbe-raw-header strong,
.rbe.rbe-theme-dark .rbe-raw-header span {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-raw-input,
.rbe.rbe-theme-dark .rbe-code-input {
  background: var(--rbe-code-bg, #30363d) !important;
  color: var(--rbe-code-text, #f8fafc);
  caret-color: var(--rbe-code-text, #f8fafc);
  -webkit-text-fill-color: var(--rbe-code-text, #f8fafc);
}

.rbe.rbe-theme-dark .rbe-code-input::selection,
.rbe.rbe-theme-dark .rbe-raw-input::selection {
  background: #6fa0e9;
  color: #0c1016;
  -webkit-text-fill-color: #0c1016;
}

.rbe.rbe-theme-dark .rbe-raw-preview {
  border: 1px solid var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-raw-frame {
  border: 1px solid #334155;
  background: #ffffff;
}

.rbe.rbe-theme-dark .rbe-attachment,
.rbe.rbe-theme-dark .rbe-audio-block,
.rbe.rbe-theme-dark .rbe-audio-card {
  border-color: var(--rbe-border) !important;
  background: var(--rbe-surface-soft) !important;
  color: #d1d5db !important;
}

.rbe.rbe-theme-dark .rbe-attachment-card,
.rbe.rbe-theme-dark .rbe-attachment-card-link {
  border-color: var(--rbe-border);
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-attachment-card-name,
.rbe.rbe-theme-dark .rbe-attachment-replace-hint,
.rbe.rbe-theme-dark .rbe-audio-card small {
  color: #cbd5e1;
}

.rbe.rbe-theme-dark .rbe-audio-error {
  border-color: rgba(248, 113, 113, 0.45) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fecaca !important;
}

.rbe.rbe-theme-dark .rbe-columns-block,
.rbe.rbe-theme-dark .rbe-column-field,
.rbe.rbe-theme-dark .rbe-output-column {
  border-color: var(--rbe-border) !important;
  background: var(--rbe-surface-soft) !important;
  color: #d1d5db !important;
}

.rbe.rbe-theme-dark .rbe-plugin-toolbar,
.rbe.rbe-theme-dark .rbe-columns-block .rbe-plugin-toolbar label {
  color: #d1d5db !important;
}

.rbe.rbe-theme-dark .rbe-columns-count,
.rbe.rbe-theme-dark .rbe-columns-block select {
  border-color: var(--rbe-border) !important;
  background: var(--rbe-surface) !important;
  color: #e5e7eb !important;
}

.rbe.rbe-theme-dark .rbe-column-header,
.rbe.rbe-theme-dark .rbe-output-column-header {
  border-color: var(--rbe-border) !important;
  background: #273449 !important;
  color: #e5e7eb !important;
}

.rbe.rbe-theme-dark .rbe-column-editor,
.rbe.rbe-theme-dark .rbe-output-column-body {
  border-color: var(--rbe-border) !important;
  background: #111827 !important;
  color: #e5e7eb !important;
}

.rbe.rbe-theme-dark .rbe-column-header:empty::before,
.rbe.rbe-theme-dark .rbe-column-editor:empty::before {
  color: #94a3b8 !important;
}

.rbe,
.rbe * {
  box-sizing: border-box;
}

.rbe button,
.rbe input,
.rbe select,
.rbe textarea,
.rbe-shell button,
.rbe-shell input,
.rbe-shell select,
.rbe-shell textarea {
  box-sizing: border-box;
  font: inherit;
}

.rbe button,
.rbe-shell button {
  appearance: none;
  margin: 0;
  text-transform: none;
}

.rbe svg,
.rbe-shell svg {
  display: block;
}

.rbe-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rbe-shell,
.rbe-shell * {
  box-sizing: border-box;
}

.rbe-shell {
  width: 100%;
  max-width: var(--rbe-shell-max-width, none);
  margin: 0 auto;
  min-width: 0;
  color: var(--rbe-text);
  font-family: var(--rbe-font);
}

.rbe-shell-brand {
  display: grid;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}

.rbe-shell-logo {
  width: min(252px, 100%);
  height: 42px;
  max-height: 52px;
  display: block;
  object-fit: contain;
  object-position: left center;
  image-rendering: auto;
  flex: 0 0 auto;
}

.rbe-shell-title {
  display: inline-flex;
  align-items: center;
  color: #102033;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.1;
}

.rbe-shell-subtitle {
  margin: 4px 0 0;
  color: var(--rbe-muted);
  font-size: 16px;
  line-height: 1.5;
}

.rbe-shell-panel {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: var(--rbe-surface);
}

.rbe-shell-panel-title {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(180px, 420px) minmax(160px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--rbe-border);
  color: var(--rbe-text);
  font-weight: 760;
}

.rbe-shell-heading {
  grid-column: 1;
  justify-self: start;
}

.rbe-shell-status {
  grid-column: 3;
  justify-self: end;
  color: var(--rbe-muted);
  font-size: 13px;
  font-weight: 520;
  text-align: right;
  white-space: nowrap;
}

.rbe-shell-progress {
  grid-column: 2;
  display: grid;
  gap: 5px;
  justify-self: center;
  width: min(100%, 390px);
  min-width: 0;
}

.rbe-shell-progress[hidden] {
  display: none !important;
}

.rbe-shell-progress-text {
  overflow: hidden;
  color: #475467;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rbe-shell-progress-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.rbe-shell-progress-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(245, 158, 11, 0.18), rgba(34, 197, 94, 0.18));
}

.rbe-shell-progress-track span {
  position: relative;
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
  animation: rbe-shell-progress-sweep 1.1s ease-in-out infinite;
}

@keyframes rbe-shell-progress-sweep {
  0% {
    transform: translateX(-115%);
  }

  55% {
    width: 64%;
  }

  100% {
    transform: translateX(245%);
  }
}

.rbe-shell-editor-wrap {
  min-width: 0;
  padding: 12px;
}

.rbe {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--rbe-min-height);
  color: var(--rbe-text);
  font-family: var(--rbe-font);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.rbe-editor-toolbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.rbe-toolbar-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--rbe-text);
  padding: 4px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
}

.rbe-svg-icon {
  display: inline-grid;
  place-items: center;
  width: 1em;
  min-width: 1em;
  line-height: 1;
}

svg.rbe-svg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  min-width: 1em;
  background: none !important;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
  vertical-align: -0.125em;
}

.rbe-toolbar-btn:hover:not(:disabled) {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
}

.rbe-save-btn {
  border-color: var(--rbe-border);
  background: #ffffff;
  color: #111827;
}

.rbe-save-btn:hover:not(:disabled) {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
  color: #111827;
}

.rbe-export-menu-wrap {
  position: relative;
  display: inline-flex;
}

.rbe-export-btn {
  width: 34px;
  min-width: 34px;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.rbe-export-html-btn {
  width: 34px;
  min-width: 34px;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.rbe-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 45;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--rbe-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--rbe-shadow);
}

.rbe-export-menu[hidden] {
  display: none !important;
}

.rbe-export-option {
  appearance: none;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.rbe-export-option:hover,
.rbe-export-option:focus-visible {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.rbe-html-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.58);
}

.rbe-html-preview-shell {
  width: min(1180px, 100%);
  height: min(860px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--rbe-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.rbe-html-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rbe-border);
  color: var(--rbe-ink);
}

.rbe-html-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.rbe-html-preview-export {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
}

.rbe-html-preview-export:hover,
.rbe-html-preview-export:focus-visible {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.rbe-html-preview-close {
  appearance: none;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--rbe-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--rbe-ink);
  cursor: pointer;
}

.rbe-html-preview-close:hover,
.rbe-html-preview-close:focus-visible {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.rbe-html-preview-body {
  min-height: 0;
  background: #eef3f8;
}

.rbe-html-preview-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #eef3f8;
}

.rbe-clear-editor-btn {
  width: 30px;
  min-width: 30px;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  color: var(--rbe-danger);
}

.rbe-clear-editor-btn:hover:not(:disabled) {
  border-color: var(--rbe-danger);
  background: #fff1f1;
  color: #b42318;
}

.rbe-toolbar-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rbe-comment-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483004;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.36);
  padding: 18px;
}

.rbe-comment-modal[hidden] {
  display: none;
}

.rbe-comment-dialog {
  width: min(460px, 100%);
}

.rbe-comment-content {
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--rbe-shadow);
  overflow: hidden;
}

.rbe-comment-header,
.rbe-comment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--rbe-border);
}

.rbe-comment-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--rbe-border);
  border-bottom: 0;
}

.rbe-comment-body {
  padding: 12px;
}

.rbe-comment-input {
  min-height: 96px;
}

.rbe-link-modal-label {
  display: block;
  margin-bottom: 6px;
  color: var(--rbe-muted);
  font-size: 12px;
  font-weight: 740;
}

.rbe-link-input.is-invalid {
  border-color: var(--rbe-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.rbe-comment-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--rbe-text);
  cursor: pointer;
}

.rbe-canvas {
  min-height: var(--rbe-min-height);
  max-height: var(--rbe-max-height, 680px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 12px 36px;
  background: var(--rbe-surface);
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
}

.rbe-block {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px 4px 0;
  border-radius: var(--rbe-radius);
}

.rbe-block + .rbe-block {
  margin-top: 15px;
}

.rbe-block-actions {
  position: absolute;
  top: -25px;
  right: 12px;
  z-index: 8;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.rbe-block:hover .rbe-block-actions,
.rbe-block:focus-within .rbe-block-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.rbe-block-action {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 26px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #f8fafc;
  color: #344054;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.rbe-block-action:hover {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
  color: #143f91;
}

.rbe-block-action[data-action="delete"] {
  border-color: rgba(220, 38, 38, 0.5);
  background: rgba(254, 226, 226, 0.92);
  color: #991b1b;
  font-size: 12px;
  font-weight: 900;
}

.rbe-block-action[data-action="delete"]:hover {
  border-color: #991b1b;
  background: #991b1b;
  color: #ffffff;
}

.rbe-block:hover,
.rbe-block:focus-within {
  background: #fbfdff;
}

.rbe-is-dragging {
  opacity: 0.38;
}

.rbe-block-controls {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 5px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.rbe-block:hover .rbe-block-controls,
.rbe-block:focus-within .rbe-block-controls {
  opacity: 1;
}

.rbe-control-btn,
.rbe-icon-btn,
.rbe-small-btn,
.rbe-inline-btn,
.rbe-menu-item {
  appearance: none;
  border: 1px solid var(--rbe-border);
  background: var(--rbe-surface);
  color: var(--rbe-text);
  font: inherit;
}

.rbe-control-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rbe-muted);
  cursor: pointer;
  line-height: 1;
}

.rbe-control-btn:hover,
.rbe-small-btn:hover,
.rbe-inline-btn:hover,
.rbe-icon-btn:hover,
.rbe-menu-item:hover,
.rbe-menu-item.is-active {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
  color: #143f91;
}

.rbe-menu-item.is-premium-locked,
.rbe-menu-item.is-premium-locked:hover,
.rbe-menu-item.is-premium-locked:focus-visible {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.rbe-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.rbe-premium-badge i {
  font-size: 9px;
}

.rbe-ai-toolbar-btn.is-premium-locked,
.rbe-ai-inline-btn.is-premium-locked {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  color: #92400e !important;
}

.rbe-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.rbe-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #ffffff;
  color: #172033;
  padding: 12px 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: auto;
}

.rbe-toast.is-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rbe-toast.is-hiding {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.rbe-toast i {
  margin-top: 2px;
}

.rbe-toast strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.rbe-toast span {
  display: block;
  margin-top: 2px;
  color: #475467;
  font-size: 12px;
  line-height: 1.4;
}

.rbe-toast.is-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.rbe-toast.is-error i,
.rbe-toast.is-error strong {
  color: #b42318;
}

.rbe-toast.is-warning {
  border-color: #fedf89;
  background: #fffbeb;
}

.rbe-toast.is-warning i,
.rbe-toast.is-warning strong {
  color: #b54708;
}

.rbe-toast.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.rbe-toast.is-success i,
.rbe-toast.is-success strong {
  color: #087443;
}

.rbe-premium-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.rbe-premium-modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.rbe-premium-modal-backdrop.is-closing {
  opacity: 0;
}

.rbe-premium-modal-card {
  position: relative;
  width: min(430px, 100%);
  border: 1px solid #d7dee8;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.18s ease;
}

.rbe-premium-modal-backdrop.is-visible .rbe-premium-modal-card {
  transform: translateY(0) scale(1);
}

.rbe-premium-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #ffffff;
  color: #475467;
  cursor: pointer;
}

.rbe-premium-modal-close:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}

.rbe-premium-modal-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #0f9f6e;
  font-size: 20px;
}

.rbe-premium-modal-card h2 {
  margin: 0 42px 8px 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.rbe-premium-modal-card p {
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.55;
}

.rbe-premium-modal-info {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.rbe-premium-modal-info section {
  display: grid;
  gap: 6px;
}

.rbe-premium-modal-info h3 {
  margin: 0;
  color: #172033;
  font-size: 13px;
  line-height: 1.25;
}

.rbe-premium-modal-info ol {
  margin: 0;
  padding-left: 18px;
  color: #475467;
  font-size: 12px;
  line-height: 1.45;
}

.rbe-premium-modal-info p {
  font-size: 12px;
  line-height: 1.45;
}

.rbe-premium-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.rbe-premium-primary,
.rbe-premium-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}

.rbe-premium-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.rbe-premium-primary:hover {
  background: #1d4ed8;
}

.rbe-premium-secondary {
  background: #ffffff;
  color: #172033;
}

.rbe-premium-secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.rbe-drag-handle {
  cursor: grab;
  font-weight: 700;
  letter-spacing: 0;
}

.rbe-block-body {
  min-width: 0;
  max-width: 100%;
}

.rbe-plugin-loader {
  display: grid;
  gap: 8px;
  max-width: 100%;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: var(--rbe-surface-soft);
  color: var(--rbe-text);
  padding: 14px;
}

.rbe-plugin-loader__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.rbe-plugin-loader__message {
  margin: 0;
  color: var(--rbe-muted);
  font-size: 13px;
}

.rbe-editable {
  min-height: 28px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  outline: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: Arial, sans-serif;
  font-size: 16px;
}

.rbe-editable:empty::before {
  content: attr(data-placeholder);
  color: #9aa5b1;
  pointer-events: none;
}

.rbe-editable a {
  color: var(--rbe-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rbe-paragraph {
  padding: 5px 0;
  font-size: 16px;
  max-width: 100%;
  min-width: 0;
}

.rbe-heading-wrap,
.rbe-list-wrap,
.rbe-checklist-wrap {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.rbe-heading-wrap {
  grid-template-columns: 84px minmax(0, 1fr);
}

.rbe-heading-level,
.rbe-list-style,
.rbe-callout-tone,
.rbe-code-language,
.rbe input[type="text"],
.rbe input[type="url"],
.rbe textarea,
.rbe select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: var(--rbe-surface);
  color: var(--rbe-text);
  font: inherit;
  padding: 7px 9px;
  outline: 0;
}

.rbe-heading-level {
  min-width: 76px;
}

.rbe-list-style {
  min-width: 124px;
}

.rbe-callout-tone {
  min-width: 118px;
}

.rbe input:focus,
.rbe textarea:focus,
.rbe select:focus,
.rbe [contenteditable="true"]:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.rbe-heading {
  padding: 0;
  font-weight: 760;
  line-height: 1.2;
  max-width: 100%;
  min-width: 0;
}

.rbe-h1 {
  font-size: 34px;
}

.rbe-h2 {
  font-size: 28px;
}

.rbe-h3 {
  font-size: 23px;
}

.rbe-h4 {
  font-size: 19px;
}

.rbe-quote {
  border-left: 4px solid var(--rbe-accent);
  background: #f8fbff;
  padding: 12px 14px;
  border-radius: 0 var(--rbe-radius) var(--rbe-radius) 0;
}

.rbe-quote-text {
  font-size: 18px;
  font-style: italic;
}

.rbe-quote-caption,
.rbe-image-caption,
.rbe-embed-caption {
  margin-top: 10px;
}

.rbe-list,
.rbe-checklist {
  grid-column: 2;
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 7px;
}

.rbe-list-tools,
.rbe-checklist-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
}

.rbe-list-style {
  grid-column: 1 / -1;
  min-width: 0;
}

.rbe-list-tools > .select2-container {
  grid-column: 1 / -1;
  width: 100% !important;
}

.rbe-list-nest-action {
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 0;
}

.rbe-list-item,
.rbe-check-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.rbe-list-item {
  grid-template-columns: 52px minmax(0, 1fr) 28px;
}

.rbe-list-item[data-level="1"],
.rbe-check-item[data-level="1"] {
  margin-left: 28px;
}

.rbe-list-item[data-level="2"],
.rbe-check-item[data-level="2"] {
  margin-left: 56px;
}

.rbe-list-item[data-level="3"],
.rbe-check-item[data-level="3"] {
  margin-left: 84px;
}

.rbe-list-item[data-level="4"],
.rbe-check-item[data-level="4"] {
  margin-left: 112px;
}

.rbe-list-marker {
  min-width: 52px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--rbe-text);
  font-weight: 740;
  white-space: nowrap;
}

.rbe-list-text {
  padding: 4px 0;
}

.rbe-row-add {
  justify-self: end;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #16a34a;
  font-size: 22px;
  box-shadow: none;
}

.rbe-list-add {
  grid-column: 2;
}

.rbe-row-add:hover {
  background: transparent;
  color: #15803d;
}

.rbe-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-color: rgba(220, 38, 38, 0.52);
  border-radius: 50%;
  background: rgba(254, 226, 226, 0.94);
  color: #991b1b;
  font-size: 12px;
  line-height: 1;
}

.rbe-row-remove:hover {
  border-color: #991b1b;
  background: #991b1b;
  color: #ffffff;
}

.rbe-list li {
  min-height: 26px;
  padding: 2px 0;
}

.rbe-check-input {
  width: 17px;
  height: 17px;
  margin-top: 7px;
  accent-color: var(--rbe-accent);
}

.rbe-check-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.rbe-check-toggle .rbe-svg-icon {
  font-size: 19px;
}

.rbe-check-toggle.is-checked {
  color: #16a34a;
}

.rbe-check-toggle.is-nested {
  border-radius: 50%;
}

.rbe-check-toggle:hover {
  background: #eef5ff;
  color: #2563eb;
}

.rbe-check-toggle:disabled {
  cursor: default;
}

.rbe-check-toggle:disabled:hover {
  background: transparent;
}

.rbe-check-text {
  padding: 4px 0;
}

.rbe-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
}

.rbe-check-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  text-align: center;
}

.rbe-check-remove .rbe-svg-icon {
  font-size: 12px;
}

.rbe-check-remove:hover {
  border-color: #991b1b;
  background: #991b1b;
  color: #ffffff;
}

.rbe-small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  min-width: 36px;
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.rbe-combo-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rbe-combo-icon .rbe-svg-icon {
  font-size: 11px;
}

.rbe-mini-btn {
  appearance: none;
  min-height: 28px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--rbe-text);
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.rbe-mini-btn:hover {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
}

.rbe-checklist-add {
  justify-self: end;
}

.rbe-code-wrap {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: var(--rbe-code-bg, #d7dee8);
}

.rbe-code-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--rbe-code-header-bg, #e5e7eb);
  color: var(--rbe-code-header-text, var(--rbe-text));
}

.rbe-code-header .rbe-code-language {
  max-width: 240px;
  min-width: 176px;
  min-height: 30px;
}

.rbe-code-header .select2-container {
  width: 176px !important;
  min-width: 176px;
}

.rbe-code-color-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.64);
  padding: 4px 7px;
  color: inherit;
  font-size: 12px;
  font-weight: 740;
}

.rbe-code-color-label input {
  width: 26px;
  height: 26px;
  border: 1px solid var(--rbe-border);
  border-radius: 50px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.rbe-code-copy,
.rbe-code-format,
.rbe-raw-copy,
.rbe-raw-format {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.rbe-code-editor,
.rbe-raw-editor {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: var(--rbe-code-bg, #d7dee8);
}

.rbe-code-input,
.rbe-raw-input {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 12px;
  overflow: auto;
  resize: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 2;
  white-space: pre;
}

.rbe-code-input,
.rbe-raw-input {
  z-index: 1;
  background: var(--rbe-code-bg, #d7dee8) !important;
  color: var(--rbe-code-text, #172033);
  caret-color: var(--rbe-code-text, #172033);
  -webkit-text-fill-color: var(--rbe-code-text, #172033);
  pointer-events: auto;
  user-select: text;
}

.rbe-raw-input {
  color: var(--rbe-code-text, #172033);
}

.rbe-code-input::selection,
.rbe-raw-input::selection {
  background: #6fa0e9;
  color: #0c1016;
  -webkit-text-fill-color: #0c1016;
}

.rbe-raw-input::selection {
  color: #0c1016;
  -webkit-text-fill-color: #0c1016;
}

.rbe-image,
.rbe-embed,
.rbe-attachment,
.rbe-table-wrap,
.rbe-callout,
.rbe-raw-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: #ffffff;
  padding: 12px;
}

.rbe-image {
  margin: 0;
}

.rbe-raw-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--rbe-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #e5e7eb;
}

.rbe-raw-header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 13px;
}

.rbe-raw-editor {
  border: 1px solid var(--rbe-border);
  border-radius: 0 0 8px 8px;
  background: #d7dee8;
  --rbe-code-bg: #d7dee8;
  --rbe-code-text: #172033;
}

.rbe-image-preview {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 7px;
  background: var(--rbe-surface-soft);
}

.rbe-image-gallery {
  position: relative;
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
}

.rbe-image-stage {
  position: relative;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--rbe-surface-soft);
  touch-action: none;
}

.rbe-image-stage .rbe-image-preview {
  margin: 0 auto;
  transform: scale(var(--rbe-image-zoom, 1));
  transition: filter 0.18s ease, transform 0.18s ease;
}

.rbe-image-stage.is-custom-crop .rbe-image-preview {
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.rbe-image-stage.is-editable::after,
.rbe-attachment-card.is-editable::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.rbe-image-stage.is-editable:hover::after,
.rbe-attachment-card.is-editable:hover::after,
.rbe-image-stage.is-media-menu-open::after,
.rbe-attachment-card.is-media-menu-open::after {
  opacity: 1;
}

.rbe-image-stage.is-editable:hover .rbe-image-preview,
.rbe-attachment-card.is-editable:hover .rbe-attachment-card-link,
.rbe-image-stage.is-media-menu-open .rbe-image-preview,
.rbe-attachment-card.is-media-menu-open .rbe-attachment-card-link {
  filter: blur(4px);
  transform: scale(calc(var(--rbe-image-zoom, 1) * 1.02));
}

.rbe-image-stage.is-image-crop-mode::after {
  opacity: 0 !important;
}

.rbe-image-stage.is-image-crop-mode .rbe-image-preview {
  cursor: grab;
  filter: none !important;
  transform: scale(var(--rbe-image-zoom, 1)) !important;
}

.rbe-image-stage.is-image-crop-mode:active .rbe-image-preview {
  cursor: grabbing;
}

.rbe-image-stage.is-image-crop-mode {
  outline: 2px dashed rgba(37, 99, 235, 0.72);
  outline-offset: 3px;
}

.rbe-media-gear-menu {
  position: absolute;
  left: 50%;
  top: 60%;
  z-index: 3;
  width: 132px;
  height: 132px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.rbe-media-gear,
.rbe-media-action {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #172033;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  transform: translate(-50%, -50%);
  transition: background 0.18s ease, color 0.18s ease, transform 0.24s ease, opacity 0.18s ease;
}

.rbe-media-gear {
  z-index: 2;
  font-size: 16px;
}

.rbe-media-action {
  opacity: 0;
  pointer-events: none;
}

.rbe-media-action-bottom {
  background: rgba(220, 38, 38, 0.96);
  color: #ffffff;
}

.rbe-media-gear:hover,
.rbe-media-gear:focus-visible,
.rbe-media-action:hover,
.rbe-media-action:focus-visible {
  background: #ffffff;
  color: var(--rbe-accent);
}

.rbe-media-action-bottom:hover,
.rbe-media-action-bottom:focus-visible {
  background: #b91c1c;
  color: #ffffff;
}

.rbe-image-crop-toggle.is-active {
  background: #2563eb;
  color: #ffffff;
}

.rbe-image-resize-handle {
  position: absolute;
  z-index: 5;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #172033;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
}

.rbe-image-resize-handle::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: inherit;
}

.rbe-image-resize-w,
.rbe-image-resize-e {
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.rbe-image-resize-w {
  left: 5px;
}

.rbe-image-resize-e {
  right: 5px;
}

.rbe-image-resize-nw,
.rbe-image-resize-ne {
  top: 5px;
}

.rbe-image-resize-sw,
.rbe-image-resize-se {
  bottom: 5px;
}

.rbe-image-resize-nw,
.rbe-image-resize-sw {
  left: 5px;
}

.rbe-image-resize-ne,
.rbe-image-resize-se {
  right: 5px;
}

.rbe-image-resize-nw,
.rbe-image-resize-se {
  cursor: nwse-resize;
}

.rbe-image-resize-ne,
.rbe-image-resize-sw {
  cursor: nesw-resize;
}

.rbe-image-stage.is-editable:hover .rbe-image-resize-handle,
.rbe-image-stage.is-media-menu-open .rbe-image-resize-handle,
.rbe-image-stage.is-image-crop-mode .rbe-image-resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.rbe-image-crop-handle {
  position: absolute;
  z-index: 6;
  display: none;
  background: #ffffff;
  border: 2px solid #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.rbe-image-stage.is-image-crop-mode .rbe-image-crop-handle {
  display: block;
}

.rbe-image-crop-e {
  top: 50%;
  right: 4px;
  width: 10px;
  height: 34px;
  border-radius: 999px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.rbe-image-crop-s {
  left: 50%;
  bottom: 4px;
  width: 34px;
  height: 10px;
  border-radius: 999px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.rbe-image-crop-se {
  right: 4px;
  bottom: 4px;
  width: 15px;
  height: 15px;
  border-radius: 5px;
  cursor: nwse-resize;
}

.rbe-image-stage.is-editable:hover .rbe-media-gear-menu,
.rbe-attachment-card.is-editable:hover .rbe-media-gear-menu,
.rbe-media-gear-menu:focus-within,
.rbe-image-stage.is-media-menu-open .rbe-media-gear-menu,
.rbe-attachment-card.is-media-menu-open .rbe-media-gear-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.rbe-image-stage.is-media-menu-open .rbe-media-gear,
.rbe-attachment-card.is-media-menu-open .rbe-media-gear {
  opacity: 0;
  pointer-events: none;
}

.rbe-image-stage.is-media-menu-open .rbe-media-action,
.rbe-attachment-card.is-media-menu-open .rbe-media-action,
.rbe-media-gear-menu:focus-within .rbe-media-action {
  opacity: 1;
  pointer-events: auto;
}

.rbe-media-row-has-space.is-media-menu-open .rbe-media-action-left,
.rbe-media-row-has-space .rbe-media-gear-menu:focus-within .rbe-media-action-left {
  transform: translate(calc(-50% - 48px), -50%);
}

.rbe-media-row-has-space.is-media-menu-open .rbe-media-action-top,
.rbe-media-row-has-space .rbe-media-gear-menu:focus-within .rbe-media-action-top {
  transform: translate(-50%, calc(-50% - 48px));
}

.rbe-media-row-has-space.is-media-menu-open .rbe-media-action-right,
.rbe-media-row-has-space .rbe-media-gear-menu:focus-within .rbe-media-action-right {
  transform: translate(calc(-50% + 48px), -50%);
}

.rbe-image-stage.is-media-menu-open .rbe-media-action-bottom,
.rbe-attachment-card.is-media-menu-open .rbe-media-action-bottom,
.rbe-media-gear-menu:focus-within .rbe-media-action-bottom {
  transform: translate(-50%, calc(-50% + 48px));
}

.rbe-media-row-full .rbe-media-align {
  display: none;
}

.rbe-media-align-left {
  justify-self: start;
}

.rbe-media-align-center {
  justify-self: center;
}

.rbe-media-align-right {
  justify-self: end;
}

.rbe-image-replace-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 720;
  transition: opacity 0.18s ease;
}

.rbe-image-gallery:hover .rbe-image-replace-hint {
  opacity: 1;
}

.rbe-dropzone,
.rbe-upload-dropzone {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: #4b5563;
  border: 2px dashed #c8d2df;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f7fc 100%);
  padding: 26px 20px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.rbe-upload-dropzone:hover,
.rbe-upload-dropzone:focus-within,
.rbe-upload-dropzone.is-dragging,
.rbe-image-gallery.is-dragging,
.rbe-attachment-grid.is-dragging {
  border-color: #7c3aed;
  background: #fbf9ff;
  box-shadow: 0 18px 38px rgba(124, 58, 237, 0.14);
  transform: translateY(-1px);
}

.rbe-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rbe-upload-icon {
  width: 68px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d3df5;
  font-size: 52px;
  line-height: 1;
}

.rbe-upload-dropzone strong {
  color: #374151;
  font-size: 16px;
  font-weight: 760;
}

.rbe-upload-main {
  color: #374151;
  font-size: 16px;
}

.rbe-upload-dropzone small {
  margin-top: 6px;
  color: #8a94a6;
  font-size: 13px;
}

.rbe-attachment-dropzone {
  min-height: 170px;
}

.rbe-media-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.rbe-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rbe-table-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #fbfdff;
}

.rbe-table-width-label,
.rbe-table-align-label,
.rbe-table-border-style-label,
.rbe-table-border-width-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  color: var(--rbe-muted);
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.rbe-table-width-label > span:first-child,
.rbe-table-align-label > span:first-child,
.rbe-table-border-style-label > span:first-child,
.rbe-table-border-width-label > span:first-child {
  white-space: nowrap;
}

.rbe-table-width {
  width: 150px;
  accent-color: var(--rbe-accent);
}

.rbe-table-border-width {
  width: 112px;
  accent-color: var(--rbe-accent);
}

.rbe-table-width-value,
.rbe-table-border-width-value {
  min-width: 42px;
  color: var(--rbe-text);
  font-weight: 760;
}

.rbe-table-align,
.rbe-table-border-style {
  min-width: 104px;
}

.rbe-table-layout .select2-container {
  width: auto !important;
  min-width: 104px;
  flex: 0 0 auto;
}

.rbe-table-stage {
  width: 100%;
  overflow: auto;
}

.rbe-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  --rbe-table-border-width: 1px;
  --rbe-table-border-style: solid;
}

.rbe-table-wrap[data-align="left"] .rbe-table {
  margin-left: 0;
  margin-right: auto;
}

.rbe-table-wrap[data-align="center"] .rbe-table {
  margin-left: auto;
  margin-right: auto;
}

.rbe-table-wrap[data-align="right"] .rbe-table {
  margin-left: auto;
  margin-right: 0;
}

.rbe-table th,
.rbe-table td {
  position: relative;
  min-width: 88px;
  min-height: 38px;
  border: var(--rbe-table-border-width) var(--rbe-table-border-style) var(--rbe-border);
  padding: 8px;
  vertical-align: top;
  outline: 0;
  word-break: break-word;
}

.rbe-table th.rbe-table-cell-selected,
.rbe-table td.rbe-table-cell-selected {
  background: var(--rbe-accent-soft);
  box-shadow: inset 0 0 0 2px var(--rbe-accent);
}

.rbe-table th {
  background: #eef5ff;
  font-weight: 720;
}

.rbe-table th.rbe-table-cell-selected {
  background: #dbeafe;
}

.rbe-table-heading-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--rbe-muted);
  font-size: 14px;
}

.rbe-embed-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 7px;
  background: #111827;
}

.rbe-callout {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-left-width: 5px;
}

.rbe-callout[data-tone="info"] {
  border-left-color: var(--rbe-accent);
  background: #f6faff;
}

.rbe-callout[data-tone="success"] {
  border-left-color: var(--rbe-success);
  background: #f2fbf7;
}

.rbe-callout[data-tone="warning"] {
  border-left-color: var(--rbe-warning);
  background: #fff9ef;
}

.rbe-callout[data-tone="danger"] {
  border-left-color: var(--rbe-danger);
  background: #fff5f5;
}

.rbe-delimiter-wrap {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
}

.rbe-divider-toolbar {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--rbe-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.rbe-delimiter-wrap:hover .rbe-divider-toolbar,
.rbe-divider-toolbar:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.rbe-delimiter-wrap.rbe-divider-toolbar-dismissed .rbe-divider-toolbar {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
}

.rbe-divider-style-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
}

.rbe-divider-style-btn:hover,
.rbe-divider-style-btn.is-active {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
  color: #143f91;
}

.rbe-delimiter {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--rbe-border-strong);
  margin: 20px 0;
}

.rbe-delimiter-wrap[data-style="dashed"] .rbe-delimiter {
  height: 0;
  border-top: 2px dashed var(--rbe-border-strong);
  background: transparent;
}

.rbe-delimiter-wrap[data-style="dotted"] .rbe-delimiter {
  height: 0;
  border-top: 3px dotted var(--rbe-border-strong);
  background: transparent;
}

.rbe-delimiter-wrap[data-style="thick"] .rbe-delimiter {
  height: 4px;
  border-radius: 999px;
}

.rbe-button-block,
.rbe-toggle,
.rbe-link-preview {
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: #ffffff;
  padding: 12px;
}

.rbe-button-controls,
.rbe-link-preview-fields {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) minmax(74px, 0.35fr) minmax(74px, 0.35fr) minmax(120px, 0.55fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.rbe-link-preview-fields {
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(180px, 1.4fr);
}

.rbe-button-preview {
  min-height: 42px;
}

.rbe-button-color-label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--rbe-muted);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 740;
}

.rbe-button-color-label input[type="color"] {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--rbe-border);
  border-radius: 50px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.rbe-button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 760;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.rbe-button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.rbe-button-link-primary {
  background: var(--rbe-accent);
  color: #ffffff;
}

.rbe-button-link-secondary {
  border: 1px solid var(--rbe-border);
  background: #ffffff;
  color: var(--rbe-text);
}

.rbe-button-link-success {
  background: var(--rbe-success);
  color: #ffffff;
}

.rbe-button-link-dark {
  background: #111827;
  color: #ffffff;
}

.rbe-toggle {
  background: #fbfdff;
}

.rbe-toggle-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  list-style: none;
  cursor: pointer;
  font-weight: 760;
}

.rbe-toggle-summary::-webkit-details-marker {
  display: none;
}

.rbe-toggle-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rbe-text);
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.rbe-toggle-arrow:hover {
  background: var(--rbe-accent-soft);
}

.rbe-toggle[open] .rbe-toggle-arrow {
  transform: rotate(90deg);
}

.rbe-toggle-title {
  width: min(520px, 100%);
  margin-left: 0;
}

.rbe-toggle-content {
  margin-top: 5px;
  padding: 10px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #ffffff;
}

.rbe-toggle-nested-canvas {
  display: grid;
  gap: 12px;
}

.rbe-toggle-nested-canvas > .rbe-block {
  margin-top: 0;
  padding-right: 0;
}

.rbe-signature-row-editor,
.rbe-multi-row-editor {
  display: grid;
  gap: 12px;
  border: 1px dashed #9bb2cf;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  box-sizing: border-box;
}

.rbe-signature-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.rbe-signature-row-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #344054;
  font: 800 14px/1.3 var(--rbe-font);
}

.rbe-signature-row-canvas {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 154px;
  padding: 10px;
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
  overflow-x: auto;
}

.rbe-signature-row-canvas > .rbe-block {
  flex: 1 1 240px;
  min-width: 220px;
  margin-top: 0;
  padding-right: 0;
}

.rbe-signature-row-canvas > .rbe-block .rbe-block-actions {
  right: 4px;
}

.rbe.rbe-theme-dark .rbe-signature-row-editor,
.rbe.rbe-theme-dark .rbe-multi-row-editor {
  border-color: #475569;
  background: #111827;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-row-title {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-row-canvas {
  border-color: #334155;
  background: #0f172a;
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-row-canvas > .rbe-block {
  color: #e5e7eb;
}

.rbe.rbe-theme-dark .rbe-signature-row-canvas .rbe-editable::before {
  color: #94a3b8;
}

.rbe-output-signature-row,
.rbe-output-multi-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin: 0 0 15px;
  width: 100%;
  box-sizing: border-box;
}

.rbe-output-signature-row > .rbe-output-signature-row-item {
  flex: 1 1 0;
  min-width: 0;
}

.rbe-link-preview-card,
.rbe-output-link-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--rbe-text);
  padding: 12px;
  text-decoration: none;
}

.rbe-link-preview-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eaf1ff;
  color: var(--rbe-accent);
}

.rbe-link-preview-card-title,
.rbe-output-link-preview strong {
  font-weight: 780;
}

.rbe-link-preview-card-description,
.rbe-output-link-preview span:last-child {
  color: var(--rbe-muted);
  font-size: 13px;
}

.rbe-output-delimiter {
  border: 0;
  height: 1px;
  background: var(--rbe-border-strong);
  margin: 20px 0;
}

.rbe-output-delimiter-dashed {
  height: 0;
  border-top: 2px dashed var(--rbe-border-strong);
  background: transparent;
}

.rbe-output-delimiter-dotted {
  height: 0;
  border-top: 3px dotted var(--rbe-border-strong);
  background: transparent;
}

.rbe-output-delimiter-thick {
  height: 4px;
  border-radius: 999px;
}

.rbe-output-quote,
.preview blockquote.rbe-output-quote {
  border-left: 5px solid #a3aab8;
  border-radius: 8px;
  background: #f3f4f6;
  color: #263244;
  margin: 0 0 15px;
  padding: 14px 16px;
  font-style: italic;
}

.rbe-output-quote footer {
  margin-top: 8px;
  color: var(--rbe-muted);
  font-size: 13px;
}

.rbe-output-code {
  overflow: hidden;
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: var(--rbe-code-bg, #d7dee8);
  color: var(--rbe-code-text, #172033);
  margin: 0 0 15px;
}

.rbe-output-code-title {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--rbe-code-header-bg, #e5e7eb);
  color: var(--rbe-code-header-text, #172033);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

.rbe-output-code pre {
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
}

.rbe-output-code code {
  font: 13px/1.5 "Cascadia Code", Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.rbe-output-toggle {
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
  margin: 0 0 15px;
}

.rbe-output-toggle summary {
  cursor: pointer;
  font-weight: 760;
}

.rbe-raw-preview {
  margin-top: 10px;
  background: #fbfdff;
  overflow: hidden;
}

.rbe-raw-frame {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: calc(var(--rbe-radius) - 2px);
  background: #ffffff;
}

.rbe-output-raw-frame,
.rbe-output-raw-container {
  display: block;
  width: min(960px, 100%);
  min-height: 420px;
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: #ffffff;
  margin: 0 auto 15px;
  overflow: auto;
}

.rbe-output-raw-container {
  min-height: 0;
  padding: 16px;
}

.rbe-output-raw-html {
  display: block;
  width: max-content;
  min-width: 100%;
  margin: 0;
}

.rbe-output-raw-html > *:first-child {
  margin-top: 0;
}

.rbe-output-raw-html > *:last-child {
  margin-bottom: 0;
}

.rbe-attachment {
  display: block;
}

.rbe-attachment-grid {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: start;
  margin-bottom: 15px;
}

.rbe-attachment-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e9f7f1;
  color: var(--rbe-success);
  font-weight: 780;
  font-size: 22px;
}

.rbe-attachment-fields {
  display: grid;
  gap: 8px;
}

.rbe-attachment-link {
  color: var(--rbe-accent);
  font-weight: 650;
}

.rbe-attachment-label {
  display: none;
  color: var(--rbe-text);
  font-weight: 720;
}

.rbe-attachment-card {
  position: relative;
  width: 112px;
  min-height: 112px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--rbe-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--rbe-text);
  text-align: center;
  text-decoration: none;
  padding: 10px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rbe-attachment-card-link {
  width: 100%;
  min-height: 90px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: inherit;
  text-align: center;
  text-decoration: none;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.rbe-attachment-card:hover {
  border-color: var(--rbe-accent);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.rbe-attachment-card-icon {
  color: var(--rbe-success);
  font-size: 28px;
  line-height: 1;
}

.rbe-attachment-card[data-kind="pdf"] .rbe-attachment-card-icon,
.rbe-attachment-card[data-kind="pdf"] .rbe-attachment-card-type {
  color: #dc2626;
}

.rbe-attachment-card[data-kind="word"] .rbe-attachment-card-icon,
.rbe-attachment-card[data-kind="word"] .rbe-attachment-card-type {
  color: #2563eb;
}

.rbe-attachment-card[data-kind="excel"] .rbe-attachment-card-icon,
.rbe-attachment-card[data-kind="excel"] .rbe-attachment-card-type {
  color: #16a34a;
}

.rbe-attachment-card[data-kind="powerpoint"] .rbe-attachment-card-icon,
.rbe-attachment-card[data-kind="powerpoint"] .rbe-attachment-card-type {
  color: #ea580c;
}

.rbe-attachment-card[data-kind="video"] .rbe-attachment-card-icon,
.rbe-attachment-card[data-kind="video"] .rbe-attachment-card-type {
  color: #7c3aed;
}

.rbe-attachment-card[data-kind="text"] .rbe-attachment-card-icon,
.rbe-attachment-card[data-kind="text"] .rbe-attachment-card-type {
  color: #475569;
}

.rbe-attachment-card-type {
  color: #0f172a;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.04em;
}

.rbe-attachment-card-name {
  max-width: 100%;
  color: #475467;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rbe-attachment-card small {
  color: #8a94a6;
  font-size: 10px;
  line-height: 1.2;
}

.rbe-attachment-replace-hint {
  flex: 0 0 100%;
  color: #8a94a6;
  font-size: 11px;
  font-weight: 650;
}

.rbe-attachment-delete-menu {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.rbe-attachment-card.is-editable:hover .rbe-attachment-delete-menu,
.rbe-attachment-delete-menu:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.rbe-attachment-delete-menu .rbe-media-delete {
  position: static;
  width: 34px;
  height: 34px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.rbe-inline-toolbar {
  position: fixed;
  z-index: 2147483001;
  transform: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: #ffffff;
  box-shadow: var(--rbe-shadow);
}

.rbe-inline-select {
  min-height: 30px;
  border-radius: 7px;
  font-size: 13px;
}

.rbe-inline-toolbar[hidden],
.rbe-menu[hidden] {
  display: none;
}

.rbe-inline-btn {
  min-width: 30px;
  height: 30px;
  border-radius: 7px;
  padding: 0 8px;
  cursor: pointer;
  font-weight: 700;
}

.rbe-inline-btn.is-active {
  border-color: var(--rbe-accent);
  background: var(--rbe-accent-soft);
  color: #143f91;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.rbe-color-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: #ffffff;
  padding: 2px 4px;
  cursor: pointer;
}

.rbe-color-icon {
  min-width: 14px;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.rbe-color-input {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--rbe-border);
  border-radius: 50px;
  background: var(--rbe-surface);
  cursor: pointer;
  overflow: hidden;
}

.rbe input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.rbe input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 50px;
}

.rbe input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 50px;
}

.rbe-color-reset {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rbe-muted);
  padding: 0;
  cursor: pointer;
  font-size: 11px;
}

.rbe-color-reset:hover {
  background: var(--rbe-surface-soft);
  color: var(--rbe-danger);
}

.rbe .select2-container {
  font-family: var(--rbe-font);
  font-size: 14px;
}

.rbe .select2-container--default .select2-selection--single {
  min-height: 34px;
  border: 1px solid var(--rbe-border);
  border-radius: 7px;
  background: var(--rbe-surface);
}

.rbe .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 32px;
  color: var(--rbe-text);
  padding-left: 9px;
}

.rbe .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 32px;
}

.rbe-inline-toolbar .select2-container--default .select2-selection--single {
  min-height: 30px;
}

.rbe-inline-toolbar .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 28px;
}

.select2-container--open {
  z-index: 2147483003;
}

.select2-search--dropdown {
  display: none;
}

body:has(.rbe.rbe-theme-dark) .select2-dropdown,
body:has(.rbe-shell.rbe-theme-dark) .select2-dropdown {
  border-color: #334155;
  background: #111827;
  color: #e5e7eb;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.45);
}

body:has(.rbe.rbe-theme-dark) .select2-container--default .select2-results__option,
body:has(.rbe-shell.rbe-theme-dark) .select2-container--default .select2-results__option {
  background: #111827;
  color: #e5e7eb;
}

body:has(.rbe.rbe-theme-dark) .select2-container--default .select2-results__option--highlighted[aria-selected],
body:has(.rbe-shell.rbe-theme-dark) .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #1d4ed8;
  color: #ffffff;
}

body:has(.rbe.rbe-theme-dark) .select2-container--default .select2-results__option[aria-selected="true"],
body:has(.rbe-shell.rbe-theme-dark) .select2-container--default .select2-results__option[aria-selected="true"] {
  background: #1e293b;
  color: #dbeafe;
}

body:has(.rbe.rbe-theme-dark) .select2-container--default .select2-results__option[aria-disabled="true"],
body:has(.rbe-shell.rbe-theme-dark) .select2-container--default .select2-results__option[aria-disabled="true"] {
  color: #64748b;
}

.rbe-menu {
  position: fixed;
  z-index: 2147483000;
  width: min(340px, calc(100% - 24px));
  max-height: min(440px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: #ffffff;
  box-shadow: var(--rbe-shadow);
  padding: 8px;
}

.rbe-menu-section + .rbe-menu-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rbe-border);
}

.rbe-menu-title {
  padding: 6px 8px;
  color: var(--rbe-muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.rbe-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 50px;
  margin: 2px 0;
  padding: 7px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.rbe-menu-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--rbe-surface-soft);
  color: var(--rbe-text);
  font-size: 12px;
  font-weight: 800;
}

.rbe-menu-icon .rbe-svg-icon {
  font-size: 15px;
}

.rbe-menu-item strong,
.rbe-menu-item small {
  display: block;
}

.rbe-menu-item strong {
  font-size: 14px;
}

.rbe-menu-item small,
.rbe-empty-menu {
  color: var(--rbe-muted);
  font-size: 12px;
}

.rbe-empty-menu {
  padding: 12px;
}

.rbe[data-readonly="true"] .rbe-block-controls,
.rbe[data-readonly="true"] .rbe-block-actions,
.rbe[data-readonly="true"] .rbe-editor-toolbar,
.rbe[data-readonly="true"] .rbe-inline-toolbar {
  display: none;
}

.rbe-output-checklist {
  display: grid;
  gap: 8px;
  margin: 0 0 15px;
  padding: 0;
  list-style: none;
}

.rbe-output-checklist-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.rbe-output-checklist-nested {
  grid-column: 2;
  margin: 6px 0 0;
  padding-left: 0;
}

.rbe-output-check {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: #64748b;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.rbe-output-check.is-checked {
  color: #16a34a;
}

.rbe-output-check.is-nested {
  font-size: 17px;
}

.rbe-output-check-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rbe-output-check.is-checked .rbe-output-check-icon {
  fill: rgba(22, 163, 74, 0.12);
}

.rbe-output-image-figure {
  margin: 0 0 15px;
}

.rbe-output-image,
.preview .rbe-output-image,
.preview img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.rbe-output-image-figure figcaption {
  margin-top: 6px;
  color: var(--rbe-muted);
  font-size: 13px;
}

.rbe-output-image-figure > figcaption,
.rbe-output-audio > figcaption {
  display: none;
}

.rbe-output-embed-figure {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 0 15px;
}

.rbe-output-embed,
.preview .rbe-output-embed,
.preview iframe {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 15px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 7px;
  background: #111827;
}

.rbe-output-embed-figure figcaption {
  text-align: center;
  color: var(--rbe-muted);
  font-size: 13px;
  font-weight: 650;
}

.rbe-output-embed-link {
  text-align: center;
}

.rbe-output-table-wrap {
  width: 100%;
  overflow: auto;
  margin: 0 0 15px;
}

.rbe-output-table-filter-wrap {
  overflow: visible;
}

.rbe-output-table-wrap table {
  border-collapse: collapse;
  table-layout: fixed;
}

.rbe-output-table-wrap th,
.rbe-output-table-wrap td {
  border: 1px solid var(--rbe-border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.rbe-output-table-wrap th {
  background: #eef5ff;
}

.rbe-output-filterable-table th {
  position: relative;
  padding-right: 34px !important;
}

.rbe-output-table-filter {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  font: 13px/1.2 Arial, system-ui, sans-serif;
  color: #172033;
}

.rbe-output-table-filter-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
}

.rbe-output-table-filter-button:hover,
.rbe-output-table-filter-button.is-filtered {
  border-color: #2563eb;
  background: #e7efff;
  color: #1d4ed8;
}

.rbe-output-table-filter-panel {
  position: absolute;
  z-index: 40;
  top: 26px;
  right: 0;
  display: none;
  width: 236px;
  max-width: min(236px, 80vw);
  padding: 8px;
  border: 1px solid #b8c3d2;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
  text-align: left;
}

.rbe-output-table-filter-panel.is-open {
  display: grid;
  gap: 7px;
}

.rbe-output-table-filter-search {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 3px 7px;
  border: 1px solid #b8c3d2;
  border-radius: 2px;
  font: 13px/1.2 Arial, system-ui, sans-serif;
}

.rbe-output-table-filter-all,
.rbe-output-table-filter-option {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: #172033;
  font-weight: 400;
  line-height: 1.25;
}

.rbe-output-table-filter-list {
  display: grid;
  gap: 2px;
  max-height: 176px;
  overflow: auto;
  padding: 2px 0;
}

.rbe-output-table-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rbe-output-table-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 5px;
}

.rbe-output-table-filter-actions button {
  min-width: 72px;
  min-height: 28px;
  border: 1px solid #b8c3d2;
  border-radius: 4px;
  background: #ffffff;
  color: #172033;
  font: 13px/1.2 Arial, system-ui, sans-serif;
  cursor: pointer;
}

.rbe-output-table-filter-actions button[data-action="apply"] {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.rbe-output-columns {
  display: grid;
  grid-template-columns: repeat(var(--rbe-columns, 2), minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 15px;
  overflow-x: auto;
}

.rbe-output-column {
  border: 1px solid var(--rbe-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-width: 0;
}

.rbe-output-column-header {
  margin: -12px -12px 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rbe-border);
  border-radius: 8px 8px 0 0;
  background: #eef5ff;
  font-weight: 760;
  text-align: left;
}

.rbe-output-column-body {
  min-width: 0;
}

@media (max-width: 760px) {
  .rbe-output-columns {
    grid-template-columns: 1fr;
  }
}

.rbe-output-outline-list {
  display: grid;
  gap: 6px;
  margin: 0 0 15px;
  padding-left: 0;
  list-style: none;
}

.rbe-output-outline-list .rbe-output-outline-list {
  margin: 6px 0 0 24px;
}

.rbe-output-outline-list li {
  display: block;
}

.rbe-output-list-marker {
  display: inline-block;
  min-width: 34px;
  margin-right: 6px;
  color: var(--rbe-muted);
  font-variant-numeric: tabular-nums;
}

.rbe-output-callout,
.preview .rbe-output-callout {
  display: block;
  padding: 12px 14px;
  margin: 0 0 15px;
  border-radius: 8px;
  color: var(--rbe-text);
}

.rbe-output-callout-info {
  border-left: 5px solid var(--rbe-accent);
  background: #f6faff;
}

.rbe-output-callout-success {
  border-left: 5px solid var(--rbe-success);
  background: #f2fbf7;
}

.rbe-output-callout-warning {
  border-left: 5px solid var(--rbe-warning);
  background: #fff9ef;
}

.rbe-output-callout-danger {
  border-left: 5px solid var(--rbe-danger);
  background: #fff5f5;
}

.rbe-output-toggle > summary {
  margin-bottom: 5px;
  font-weight: 760;
  cursor: pointer;
}

.rbe-comment-mark {
  position: relative;
  display: inline-block;
  background: #fff2a8;
  border-bottom: 2px dotted #b76b00;
  border-radius: 8px;
  padding: 0 3px;
  cursor: text;
}

.rbe-comment-mark[data-rbe-comment-status="resolved"]::after {
  content: "\2713";
  position: absolute;
  top: -9px;
  right: -10px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}

.rbe-comment-mark[data-rbe-comment-status="declined"]::after {
  content: "\2715";
  position: absolute;
  top: -9px;
  right: -10px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
}

.rbe-output-annotation {
  position: relative;
  display: inline-block;
  background: #fff2a8;
  border-bottom: 2px dotted #b76b00;
  border-radius: 8px;
  padding: 0 3px;
}

.rbe-output-annotation::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  display: none;
  width: 18px;
  height: 16px;
  transform: translateX(-50%);
}

.rbe-output-annotation-card {
  position: absolute;
  left: var(--rbe-annotation-card-left, 50%);
  top: calc(100% + 12px);
  z-index: 40;
  display: none;
  width: min(540px, calc(100vw - 40px));
  padding: 22px 24px 24px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.985));
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.18);
  color: #172033;
  text-align: left;
  transform: var(--rbe-annotation-card-transform, translateX(-50%));
  backdrop-filter: blur(20px);
}

.rbe-output-annotation.is-card-above .rbe-output-annotation-card {
  top: auto;
  bottom: calc(100% + 12px);
}

.rbe-output-annotation.is-card-above::after {
  top: auto;
  bottom: 100%;
}

.rbe-output-annotation:hover::after,
.rbe-output-annotation.is-open::after {
  display: block;
}

.rbe-output-annotation:hover .rbe-output-annotation-card,
.rbe-output-annotation:focus-within .rbe-output-annotation-card,
.rbe-output-annotation.is-open .rbe-output-annotation-card {
  display: grid;
  gap: 16px;
}

.rbe-output-annotation-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.rbe-output-annotation-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3f4bbf, #253186);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rbe-output-annotation-head-meta,
.rbe-output-annotation-head-side,
.rbe-output-annotation-heading {
  display: grid;
}

.rbe-output-annotation-head-meta {
  gap: 6px;
  min-width: 0;
}

.rbe-output-annotation-head-side {
  justify-items: end;
  gap: 10px;
  align-self: center;
}

.rbe-output-annotation-heading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 34px;
}

.rbe-output-annotation-heading strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
}

.blockwriteai-preview .rbe-output-annotation-head {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin-bottom: 5px !important;
}

.blockwriteai-preview .rbe-output-annotation-head-meta {
  grid-column: 2;
  grid-row: 1;
}

.blockwriteai-preview .rbe-output-annotation-head-side {
  grid-column: 2;
  grid-row: 1;
  justify-items: end;
  align-self: center;
}

.blockwriteai-preview .rbe-output-annotation-head .rbe-output-annotation-edit {
  display: none !important;
}

.blockwriteai-preview .rbe-output-annotation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 96px;
}

.rbe-output-annotation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: fit-content;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.rbe-output-annotation-badge-pending {
  background: linear-gradient(180deg, #ffd978, #f5c85b);
  color: #172033;
}

.rbe-output-annotation-badge-resolved {
  background: linear-gradient(180deg, #b9f7cd, #84e1a7);
  color: #0f5132;
}

.rbe-output-annotation-badge-declined {
  background: linear-gradient(180deg, #ffb8c1, #ff8ea0);
  color: #7f1d1d;
}

.rbe-output-annotation-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.rbe-output-annotation-edit,
.rbe-output-annotation-reply-toggle {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  color: #2563eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.rbe-output-annotation-edit-glyph {
  font-size: 14px;
}

.rbe-output-annotation-edit:hover,
.rbe-output-annotation-reply-toggle:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(219, 234, 254, 0.95);
}

.blockwriteai-preview .rbe-output-annotation-card .rbe-output-annotation-head {
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  margin-bottom: 5px !important;
}

.blockwriteai-preview .rbe-output-annotation-card .rbe-output-annotation-head-meta {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0;
}

.blockwriteai-preview .rbe-output-annotation-card .rbe-output-annotation-heading {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 34px;
  padding-right: 96px;
}

.blockwriteai-preview .rbe-output-annotation-card .rbe-output-annotation-head-side {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-items: end !important;
  align-self: center !important;
  height: 100%;
}

.blockwriteai-preview .rbe-output-annotation-card .rbe-output-annotation-head .rbe-output-annotation-edit,
.blockwriteai-preview .rbe-output-annotation-card .rbe-output-annotation-head .rbe-output-annotation-edit[hidden] {
  display: none !important;
}

.rbe-output-annotation-note {
  color: #172033;
  font-size: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rbe-output-annotation-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.rbe-output-annotation-body-meta {
  display: flex;
  justify-content: flex-end;
}

.rbe-output-annotation-date {
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  text-align: right;
}

.rbe-output-annotation-state-line {
  display: inline-flex;
  justify-content: flex-end;
  align-self: center;
}

.rbe-output-annotation-state-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #172033;
  background: linear-gradient(180deg, #ffd978, #f5c85b);
}

.rbe-output-annotation.is-resolved .rbe-output-annotation-state-text {
  background: linear-gradient(180deg, #b9f7cd, #84e1a7);
  color: #0f5132;
}

.rbe-output-annotation-card.is-resolved .rbe-output-annotation-state-text {
  background: linear-gradient(180deg, #b9f7cd, #84e1a7);
  color: #0f5132;
}

.rbe-output-annotation.is-declined .rbe-output-annotation-state-text {
  background: linear-gradient(180deg, #ffb8c1, #ff8ea0);
  color: #7f1d1d;
}

.rbe-output-annotation-card.is-declined .rbe-output-annotation-state-text {
  background: linear-gradient(180deg, #ffb8c1, #ff8ea0);
  color: #7f1d1d;
}

.rbe-output-annotation-reject-block {
  display: grid;
  gap: 10px;
}

.rbe-output-annotation-divider {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: rgba(148, 163, 184, 0.3);
}

.rbe-output-annotation-reject-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rbe-output-annotation-reject-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.rbe-output-annotation-reject-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.rbe-output-annotation-reject-row[hidden] {
  display: none !important;
}

.rbe-output-annotation-reject-label {
  display: inline-block;
  color: #9f1239;
  font-size: 13px;
  font-weight: 800;
  text-decoration-line: underline;
  text-decoration-style: double;
  text-underline-offset: 3px;
}

.rbe-output-annotation-reject-text {
  color: #172033;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.rbe-output-annotation-reject-date,
.rbe-output-annotation-thread-date {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.rbe-output-annotation-reply-save,
.rbe-output-annotation-reply-cancel {
  min-height: 30px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.95);
  padding: 0 14px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.rbe-output-annotation-reply-cancel {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
}

.rbe-output-annotation-reply-toggle--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.9);
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.rbe-output-annotation-reply-toggle--icon .rbe-svg-icon {
  font-size: 10px;
  line-height: 1;
  color: #2563eb !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}

.rbe-output-annotation-reply-form[hidden],
.rbe-output-annotation-thread[hidden] {
  display: none !important;
}

.rbe-output-annotation-reply-form {
  display: grid;
  gap: 8px;
}

.rbe-output-annotation-reply-input {
  width: 100%;
  min-height: 64px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.96);
  color: #172033;
  font: inherit;
  resize: vertical;
}

.rbe-output-annotation-thread-label {
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
}

.rbe-output-annotation-thread-text {
  color: #172033;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.rbe-output-annotation-thread-block {
  display: grid;
  gap: 12px;
}

.rbe-output-annotation-thread-list {
  display: grid;
  gap: 12px;
  max-height: 292px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: rgba(148, 163, 184, 0.65) rgba(226, 232, 240, 0.75);
  scrollbar-width: thin;
}

.rbe-output-annotation-thread-list::-webkit-scrollbar {
  width: 8px;
}

.rbe-output-annotation-thread-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.75);
}

.rbe-output-annotation-thread-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.65);
}

.rbe-output-annotation-thread-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.9);
}

.rbe-output-annotation-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rbe-output-annotation-thread-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.rbe-output-annotation-date-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.rbe-output-annotation-date-icon {
  color: #475569;
  font-size: 18px;
  line-height: 1;
}

.rbe-output-annotation-date-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 5;
  display: none;
  min-width: max-content;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: #172033;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-line;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.34);
}

.rbe-output-annotation-date-tooltip span {
  display: block;
}

.rbe-output-annotation-date-tooltip span + span {
  margin-top: 3px;
}

.rbe-output-annotation-date-chip:hover .rbe-output-annotation-date-tooltip,
.rbe-output-annotation-date-chip:focus-within .rbe-output-annotation-date-tooltip {
  display: block;
}

.rbe-output-annotation-reply {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.96);
  color: #172033;
  font: inherit;
  resize: vertical;
}

.rbe-output-annotation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.rbe-output-annotation-actions[hidden] {
  display: none !important;
}

.rbe-output-annotation-actions button {
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  padding: 0 14px;
  color: #172033;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.rbe-output-annotation-cancel-edit {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
}

.rbe-output-annotation-cancel-edit:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(239, 246, 255, 0.95);
}

.rbe-output-annotation-resolve:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.18);
  color: #86efac;
}

.rbe-output-annotation-decline:hover {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
}

.rbe-output-annotation-decline-form[hidden] {
  display: none !important;
}

.rbe-output-annotation-decline-form {
  display: grid;
  gap: 8px;
}

.rbe-output-annotation-save-decline {
  min-height: 34px;
  border: 1px solid rgba(244, 63, 94, 0.32);
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.rbe-output-annotation-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.rbe-output-annotation-form-actions .rbe-output-annotation-cancel-edit {
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.rbe-output-annotation-save-decline:hover {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.22);
}

.rbe-output-annotation-history {
  display: none;
}

.rbe-output-annotation-history-item {
  display: block;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  padding: 7px 9px;
  font-size: 12px;
}

.rbe.rbe-theme-dark .rbe-output-annotation-card,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-card,
.blockwriteai-preview-dark .rbe-output-annotation-card {
  border-color: rgba(255, 255, 255, 0.06);
  background: linear-gradient(145deg, rgba(11, 20, 38, 0.985), rgba(21, 30, 50, 0.975));
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.34);
  color: #f8fafc;
}

.rbe.rbe-theme-dark .rbe-output-annotation-heading strong,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-heading strong,
.blockwriteai-preview-dark .rbe-output-annotation-heading strong,
.rbe.rbe-theme-dark .rbe-output-annotation-note,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-note,
.blockwriteai-preview-dark .rbe-output-annotation-note,
.rbe.rbe-theme-dark .rbe-output-annotation-reject-text,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reject-text,
.blockwriteai-preview-dark .rbe-output-annotation-reject-text,
.rbe.rbe-theme-dark .rbe-output-annotation-thread-text,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-text,
.blockwriteai-preview-dark .rbe-output-annotation-thread-text {
  color: #f8fafc;
}

.rbe.rbe-theme-dark .rbe-output-annotation-date,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-date,
.blockwriteai-preview-dark .rbe-output-annotation-date,
.rbe.rbe-theme-dark .rbe-output-annotation-date-icon,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-date-icon,
.blockwriteai-preview-dark .rbe-output-annotation-date-icon {
  color: #dbe4f3;
}

.rbe.rbe-theme-dark .rbe-output-annotation-divider,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-divider,
.blockwriteai-preview-dark .rbe-output-annotation-divider {
  background: rgba(148, 163, 184, 0.16);
}

.rbe.rbe-theme-dark .rbe-output-annotation-reject-label,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reject-label,
.blockwriteai-preview-dark .rbe-output-annotation-reject-label {
  color: #ffd6df;
}

.rbe.rbe-theme-dark .rbe-output-annotation-reject-date,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reject-date,
.blockwriteai-preview-dark .rbe-output-annotation-reject-date,
.rbe.rbe-theme-dark .rbe-output-annotation-thread-date,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-date,
.blockwriteai-preview-dark .rbe-output-annotation-thread-date {
  color: #b8c2d4;
}

.rbe.rbe-theme-dark .rbe-output-annotation-edit,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-edit,
.blockwriteai-preview-dark .rbe-output-annotation-edit,
.rbe.rbe-theme-dark .rbe-output-annotation-reply-toggle,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-toggle,
.blockwriteai-preview-dark .rbe-output-annotation-reply-toggle {
  background: rgba(17, 24, 39, 0.52);
  color: #cbd5e1;
}

.rbe.rbe-theme-dark .rbe-output-annotation-edit:hover,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-edit:hover,
.blockwriteai-preview-dark .rbe-output-annotation-edit:hover,
.rbe.rbe-theme-dark .rbe-output-annotation-reply-toggle:hover,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-toggle:hover,
.blockwriteai-preview-dark .rbe-output-annotation-reply-toggle:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.8);
}

.rbe.rbe-theme-dark .rbe-output-annotation-reply-save,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-save,
.blockwriteai-preview-dark .rbe-output-annotation-reply-save,
.rbe.rbe-theme-dark .rbe-output-annotation-reply-cancel,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-cancel,
.blockwriteai-preview-dark .rbe-output-annotation-reply-cancel,
.rbe.rbe-theme-dark .rbe-output-annotation-reply-toggle--icon,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-toggle--icon,
.blockwriteai-preview-dark .rbe-output-annotation-reply-toggle--icon {
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

.rbe.rbe-theme-dark .rbe-output-annotation-reply-cancel,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-cancel,
.blockwriteai-preview-dark .rbe-output-annotation-reply-cancel,
.rbe.rbe-theme-dark .rbe-output-annotation-cancel-edit,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-cancel-edit,
.blockwriteai-preview-dark .rbe-output-annotation-cancel-edit,
.rbe.rbe-theme-dark .rbe-output-annotation-form-actions .rbe-output-annotation-cancel-edit,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-form-actions .rbe-output-annotation-cancel-edit,
.blockwriteai-preview-dark .rbe-output-annotation-form-actions .rbe-output-annotation-cancel-edit {
  background: rgba(30, 41, 59, 0.72);
  color: #dbe4f3;
}

.rbe.rbe-theme-dark .rbe-output-annotation-reply-toggle--icon .rbe-svg-icon,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-toggle--icon .rbe-svg-icon,
.blockwriteai-preview-dark .rbe-output-annotation-reply-toggle--icon .rbe-svg-icon {
  color: rgb(222, 232, 228) !important;
}

.rbe.rbe-theme-dark .rbe-output-annotation-reply-input,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply-input,
.blockwriteai-preview-dark .rbe-output-annotation-reply-input,
.rbe.rbe-theme-dark .rbe-output-annotation-reply,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-reply,
.blockwriteai-preview-dark .rbe-output-annotation-reply {
  background: rgba(15, 23, 42, 0.38);
  color: #f8fafc;
}

.rbe.rbe-theme-dark .rbe-output-annotation-thread-label,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-label,
.blockwriteai-preview-dark .rbe-output-annotation-thread-label {
  color: #93c5fd;
}

.rbe.rbe-theme-dark .rbe-output-annotation-thread-list,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-list,
.blockwriteai-preview-dark .rbe-output-annotation-thread-list {
  scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.28);
}

.rbe.rbe-theme-dark .rbe-output-annotation-thread-list::-webkit-scrollbar-track,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-list::-webkit-scrollbar-track,
.blockwriteai-preview-dark .rbe-output-annotation-thread-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.28);
}

.rbe.rbe-theme-dark .rbe-output-annotation-thread-list::-webkit-scrollbar-thumb,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-list::-webkit-scrollbar-thumb,
.blockwriteai-preview-dark .rbe-output-annotation-thread-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
}

.rbe.rbe-theme-dark .rbe-output-annotation-thread-item,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-thread-item,
.blockwriteai-preview-dark .rbe-output-annotation-thread-item {
  background: rgba(96, 165, 250, 0.1);
}

.rbe.rbe-theme-dark .rbe-output-annotation-date-tooltip,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-date-tooltip,
.blockwriteai-preview-dark .rbe-output-annotation-date-tooltip {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(9, 15, 28, 0.96);
  color: #dbe4f3;
}

.rbe.rbe-theme-dark .rbe-output-annotation-actions button,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-actions button,
.blockwriteai-preview-dark .rbe-output-annotation-actions button {
  background: rgba(15, 23, 42, 0.42);
  color: #f8fafc;
}

.rbe.rbe-theme-dark .rbe-output-annotation-history-item,
.rbe-shell.rbe-theme-dark .rbe-output-annotation-history-item,
.blockwriteai-preview-dark .rbe-output-annotation-history-item {
  color: #cbd5e1;
}

.rbe-output-annotation.is-resolved {
  background: rgba(16, 185, 129, 0.12);
  border-bottom-color: #10b981;
}

.rbe-output-annotation.is-declined {
  background: rgba(244, 63, 94, 0.12);
  border-bottom-color: #f43f5e;
}

.rbe-comment-popover {
  position: fixed;
  z-index: 2000;
  width: min(320px, calc(100vw - 24px));
}

.rbe-comment-popover[hidden] {
  display: none;
}

.rbe-output-annotation-reject-block[hidden] {
  display: none !important;
}

.rbe-comment-popover .rbe-output-annotation-card {
  position: relative;
  left: 0;
  top: 0;
  display: grid;
  /* width: 100%; */
  transform: none;
}

.rbe-comment-popover .rbe-output-annotation-head {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin-bottom: 5px !important;
}

.rbe-comment-popover .rbe-output-annotation-head-meta {
  grid-column: 2;
  grid-row: 1;
}

.rbe-comment-popover .rbe-output-annotation-head-side {
  grid-column: 2;
  grid-row: 1;
  justify-items: end;
  align-self: center;
}

.rbe-comment-popover .rbe-output-annotation-tools,
.rbe-comment-popover .rbe-output-annotation-edit {
  display: none !important;
}

.rbe-comment-popover .rbe-output-annotation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 96px;
}

.rbe-comment-popover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 14px;
  height: 14px;
  border-right: 1px solid rgba(203, 213, 225, 0.9);
  border-bottom: 1px solid rgba(203, 213, 225, 0.9);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.985));
  transform: translateX(-50%) rotate(45deg);
}

.rbe.rbe-theme-dark .rbe-comment-popover::after,
.rbe-shell.rbe-theme-dark .rbe-comment-popover::after,
.blockwriteai-preview-dark .rbe-comment-popover::after,
.rbe-comment-popover.blockwriteai-preview-dark::after {
  border-right-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(31, 41, 55, 0.96));
}

.preview ul,
.preview ol {
  padding-left: 22px;
}

.preview li > ul,
.preview li > ol {
  margin-top: 6px;
  padding-left: 22px;
}

.preview > * {
  margin-bottom: 15px;
}

.preview .rbe-output-outline-list {
  padding-left: 0;
}

.preview .rbe-output-outline-list .rbe-output-outline-list {
  padding-left: 0;
}

.rbe[data-readonly="true"] .rbe-canvas {
  overflow-y: auto;
}

.rbe[data-readonly="true"] .rbe-block {
  display: block;
  padding: 6px 10px;
}

.rbe[data-readonly="true"] .rbe-block + .rbe-block {
  margin-top: 15px;
}

.rbe[data-readonly="true"] .rbe-heading-wrap,
.rbe[data-readonly="true"] .rbe-list-wrap,
.rbe[data-readonly="true"] .rbe-checklist-wrap,
.rbe[data-readonly="true"] .rbe-callout {
  display: block;
}

.rbe[data-readonly="true"] .rbe-raw-input {
  display: none;
}

.rbe[data-readonly="true"] .rbe-raw-preview {
  margin-top: 0;
}

.rbe[data-readonly="true"] .rbe-upload-dropzone {
  display: none;
}

.rbe[data-readonly="true"] .rbe-heading-level,
.rbe[data-readonly="true"] .rbe-list-tools,
.rbe[data-readonly="true"] .rbe-checklist-tools,
.rbe[data-readonly="true"] .rbe-table-toolbar,
.rbe[data-readonly="true"] .rbe-table-layout,
.rbe[data-readonly="true"] .rbe-media-tools,
.rbe[data-readonly="true"] .rbe-button-controls,
.rbe[data-readonly="true"] .rbe-link-preview-fields,
.rbe[data-readonly="true"] .rbe-toggle-tools,
.rbe[data-readonly="true"] .rbe-divider-toolbar,
.rbe[data-readonly="true"] .rbe-image-caption,
.rbe[data-readonly="true"] .rbe-embed-caption,
.rbe[data-readonly="true"] .rbe-quote-caption,
.rbe[data-readonly="true"] .rbe-code-header,
.rbe[data-readonly="true"] .rbe-table-heading-toggle,
.rbe[data-readonly="true"] .rbe-attachment-name,
.rbe[data-readonly="true"] .rbe-attachment-url,
.rbe[data-readonly="true"] .rbe-attachment-file,
.rbe[data-readonly="true"] .rbe-list-add,
.rbe[data-readonly="true"] .rbe-list-remove,
.rbe[data-readonly="true"] .rbe-checklist-add,
.rbe[data-readonly="true"] .rbe-check-remove,
.rbe[data-readonly="true"] .rbe-callout-tone {
  display: none;
}

.rbe[data-readonly="true"] .rbe-list-item {
  grid-template-columns: 52px minmax(0, 1fr);
}

.rbe[data-readonly="true"] .rbe-check-item {
  grid-template-columns: 28px minmax(0, 1fr);
}

.rbe[data-readonly="true"] .rbe-attachment {
  padding: 10px;
  border: 1px solid var(--rbe-border);
  border-radius: var(--rbe-radius);
  background: #fbfdff;
}

.rbe[data-readonly="true"] .rbe-attachment-fields {
  align-content: center;
}

.rbe[data-readonly="true"] .rbe-attachment-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.rbe[data-readonly="true"] .rbe-attachment-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.rbe[data-readonly="true"] .rbe-editable {
  box-shadow: none;
}

@media (max-width: 720px) {
  .rbe-shell-brand {
    margin-bottom: 10px;
  }

  .rbe-shell-subtitle {
    font-size: 14px;
    line-height: 1.45;
  }

  .rbe-shell-panel-title {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 7px;
  }

  .rbe-shell-heading,
  .rbe-shell-status,
  .rbe-shell-progress {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    text-align: left;
  }

  .rbe-shell-progress-text {
    text-align: left;
  }

  .rbe-shell-editor-wrap {
    padding: 8px;
  }

  .rbe-canvas {
    padding: 12px 8px 28px;
    min-height: min(var(--rbe-min-height), calc(100dvh - 172px));
    max-height: min(var(--rbe-max-height, 680px), calc(100dvh - 150px));
  }

  .rbe-block {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 5px;
  }

  .rbe-block-controls {
    opacity: 1;
  }

  .rbe-control-btn {
    width: 25px;
    height: 25px;
  }

  .rbe-heading-wrap,
  .rbe-list-wrap,
  .rbe-callout,
  .rbe-button-controls,
  .rbe-link-preview-fields {
    grid-template-columns: 1fr;
  }

  .rbe-h1 {
    font-size: 30px;
  }

  .rbe-h2 {
    font-size: 25px;
  }

  .rbe-h3 {
    font-size: 21px;
  }

  .rbe-media-tools {
    grid-template-columns: 1fr;
  }

  .rbe-inline-toolbar {
    left: 8px !important;
    right: 8px !important;
    max-width: none;
    max-height: min(50dvh, 360px);
    overflow: auto;
    justify-content: flex-start;
  }

  .rbe-output-signature-row,
  .rbe-output-multi-row {
    flex-direction: column;
  }
}

@media (min-width: 561px) and (max-width: 721px) {
  .rbe-block {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 6px;
    padding-left: 14px;
  }

  .rbe-block-controls {
    opacity: 1;
  }

  .rbe-block-add {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .rbe-canvas {
    padding-left: 6px;
    padding-right: 6px;
  }

  .rbe-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .rbe-block-controls {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    padding-top: 0;
  }

  .rbe-block-body {
    grid-column: 1;
    grid-row: 2;
    overflow-x: clip;
  }

  .rbe-table-toolbar {
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .rbe-table-toolbar .rbe-small-btn {
    flex: 0 0 auto;
    min-width: 32px;
    height: 32px;
    padding: 4px 7px;
  }

  .rbe-table-layout {
    max-width: 100%;
    overflow: hidden;
  }

  .rbe-table-wrap,
  .rbe-plugin-card {
    width: calc(100% - 8px);
    max-width: calc(100% - 8px);
    overflow: hidden;
  }

  .rbe-table-width,
  .rbe-table-border-width {
    width: calc(100% - 8px);
    justify-self: start;
  }

  .rbe-table-width-label,
  .rbe-table-border-width-label {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .rbe-table-align-label,
  .rbe-table-border-style-label {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .rbe-table-width-value,
  .rbe-table-border-width-value {
    display: none;
  }
}

@media (max-width: 1024px) {
  .rbe-editor-toolbar {
    justify-content: flex-start;
  }

  .rbe-html-preview-modal {
    padding: 12px;
  }

  .rbe-html-preview-shell {
    height: calc(100dvh - 24px);
  }

  .rbe-html-preview-header {
    flex-wrap: wrap;
  }

  .rbe-html-preview-actions {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }

  .rbe-code-header,
  .rbe-raw-header,
  .rbe-table-toolbar,
  .rbe-table-layout,
  .rbe-button-controls,
  .rbe-link-preview-fields {
    min-width: 0;
  }

  .rbe-button-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rbe-link-preview-fields {
    grid-template-columns: 1fr;
  }

  .rbe-table-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .rbe-table-width-label,
  .rbe-table-border-width-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
  }

  .rbe-table-align-label,
  .rbe-table-border-style-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-width: 0;
  }

  .rbe-table-width,
  .rbe-table-border-width {
    width: 100%;
    min-width: 0;
  }

  .rbe-output-table-wrap,
  .rbe-table-stage,
  .rbe-raw-preview,
  .rbe-output-raw-frame {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .rbe {
    --rbe-radius: 7px;
  }

  .rbe-editor-toolbar {
    gap: 5px;
  }

  .rbe-toolbar-btn {
    min-height: 34px;
    padding: 5px 8px;
  }

  .rbe-toolbar-btn .rbe-button-text {
    display: none;
  }

  .rbe-save-btn .rbe-button-text {
    display: inline;
  }

  .rbe-export-menu {
    right: auto;
    left: 0;
  }

  .rbe-canvas {
    padding: 10px 6px 24px;
  }

  .rbe-block {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px 6px;
  }

  .rbe-block-controls {
    grid-row: 1;
    justify-content: flex-start;
    align-items: center;
    padding-top: 0;
    opacity: 1;
  }

  .rbe-block-body {
    grid-row: 2;
    width: 100%;
    max-width: calc(100vw - 76px);
    overflow-x: hidden;
  }

  .rbe-block-actions {
    position: static;
    grid-row: 3;
    justify-self: flex-start;
    max-width: 100%;
    overflow-x: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .rbe-image,
  .rbe-embed,
  .rbe-attachment,
  .rbe-table-wrap,
  .rbe-callout,
  .rbe-raw-wrap,
  .rbe-button-block,
  .rbe-toggle,
  .rbe-link-preview {
    padding: 10px;
  }

  .rbe-heading-wrap,
  .rbe-list-wrap,
  .rbe-checklist-wrap,
  .rbe-callout {
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 100%;
  }

  .rbe-heading-level,
  .rbe-list-style,
  .rbe-callout-tone,
  .rbe-code-language,
  .rbe input[type="text"],
  .rbe input[type="url"],
  .rbe textarea,
  .rbe select {
    min-width: 0;
  }

  .rbe-h1 {
    font-size: 27px;
  }

  .rbe-h2 {
    font-size: 23px;
  }

  .rbe-h3 {
    font-size: 20px;
  }

  .rbe-paragraph,
  .rbe-callout .rbe-editable {
    width: calc(100vw - 96px) !important;
    max-width: 100% !important;
  }

  .rbe-list,
  .rbe-checklist,
  .rbe-list-add {
    grid-column: 1;
  }

  .rbe-list-tools,
  .rbe-checklist-tools {
    grid-template-columns: 1fr;
  }

  .rbe-list,
  .rbe-checklist {
    padding-right: 10px;
  }

  .rbe-list-item,
  .rbe-check-item {
    grid-template-columns: 38px 24px minmax(0, 1fr);
    gap: 5px;
    max-width: 100%;
  }

  .rbe-list-item {
    grid-template-columns: 52px 24px minmax(0, 1fr);
  }

  .rbe-list-marker,
  .rbe-check-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .rbe-list-marker {
    min-width: 52px;
    white-space: nowrap;
  }

  .rbe-list-text,
  .rbe-check-text {
    grid-column: 3;
    grid-row: 1;
  }

  .rbe-list-item .rbe-row-remove,
  .rbe-check-item .rbe-check-remove {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .rbe-row-add {
    justify-self: start;
  }

  .rbe-list-item .rbe-row-remove,
  .rbe-check-item .rbe-check-remove {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  .rbe-check-toggle {
    width: 22px;
    height: 22px;
  }

  .rbe-list-item[data-level="1"],
  .rbe-check-item[data-level="1"] {
    margin-left: 18px;
  }

  .rbe-list-item[data-level="2"],
  .rbe-check-item[data-level="2"] {
    margin-left: 34px;
  }

  .rbe-list-item[data-level="3"],
  .rbe-check-item[data-level="3"] {
    margin-left: 50px;
  }

  .rbe-list-item[data-level="4"],
  .rbe-check-item[data-level="4"] {
    margin-left: 66px;
  }

  .rbe-code-header .rbe-code-language,
  .rbe-code-header .select2-container,
  .rbe-inline-toolbar .select2-container {
    width: min(176px, 100%) !important;
    min-width: 0;
  }

  .rbe-code-editor,
  .rbe-raw-editor {
    height: min(260px, 45dvh);
  }

  .rbe-raw-frame {
    min-height: 260px;
  }

  .rbe-dropzone,
  .rbe-upload-dropzone {
    min-height: 170px;
    padding: 20px 12px;
  }

  .rbe-upload-icon {
    width: 54px;
    height: 44px;
    font-size: 42px;
  }

  .rbe-table-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rbe-table-width,
  .rbe-table-border-width {
    width: 100%;
    min-width: 0;
  }

  .rbe-table-width-label,
  .rbe-table-border-width-label,
  .rbe-table-align-label,
  .rbe-table-border-style-label {
    width: 100%;
  }

  .rbe-table-width-value,
  .rbe-table-border-width-value {
    min-width: 34px;
    text-align: right;
    white-space: nowrap;
  }

  .rbe-table-layout .select2-container,
  .rbe-table-align,
  .rbe-table-border-style {
    width: 100% !important;
  }

  .rbe-button-controls {
    grid-template-columns: 1fr;
  }

  .rbe-output-embed,
  .preview .rbe-output-embed,
  .preview iframe {
    max-width: 100%;
  }

  .rbe-output-columns {
    grid-template-columns: 1fr !important;
  }

  .rbe-output-code pre,
  .rbe-output-table-wrap,
  .rbe-output-raw-frame {
    max-height: 52dvh;
  }

  .rbe-output-annotation-card {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 380px) {
  .rbe-toolbar-btn {
    min-width: 34px;
    justify-content: center;
    padding-left: 7px;
    padding-right: 7px;
  }

  .rbe-save-btn .rbe-button-text {
    display: none;
  }

  .rbe-inline-btn {
    min-width: 28px;
    padding: 0 6px;
  }

  .rbe-color-input {
    width: 22px;
    height: 22px;
  }

  .rbe-list-tools,
  .rbe-checklist-tools {
    grid-template-columns: 1fr;
  }
}
