.wrapper {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.8);
}

.toolbar button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.toolbar button:hover {
  background: rgba(var(--primary-rgb) / 0.1);
  color: var(--primary);
}

.divider {
  width: 1px;
  height: 20px;
  background: rgba(148, 163, 184, 0.3);
  margin: 0 4px;
}

.editorShell {
  position: relative;
}

.editor {
  min-height: 140px;
  padding: var(--field-padding-y) var(--field-padding-x);
  font-size: var(--field-font-size);
  line-height: 1.5;
  color: var(--text-primary);
  outline: none;
}

.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

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

.editor p {
  margin: 0 0 0.5em;
}

.editor p:last-child {
  margin-bottom: 0;
}

.editor img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 0.5em 0;
  cursor: pointer;
}

.editor img.richTextImageSelected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.resizeHandle {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  cursor: nwse-resize;
  z-index: 2;
  padding: 0;
}

.uploadError {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}
