/* Lightweight rich text editor */
.rt-editor {
  border: 1px solid var(--line2, #e5e9ef);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line2, #e5e9ef);
  background: #fafbfc;
}
.rt-toolbar button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink, #1c2430);
  width: 32px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}
.rt-toolbar button:hover {
  background: #fff;
  border-color: var(--line2, #e5e9ef);
}
.rt-toolbar button:active,
.rt-toolbar button.is-on {
  background: #eef6f4;
  border-color: #b8d9d0;
  color: #0f766e;
}
.rt-toolbar .rt-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line2, #e5e9ef);
  margin: 2px 4px;
}
.rt-body {
  min-height: 220px;
  max-height: 520px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink, #1c2430);
  outline: none;
  word-break: break-word;
}
.rt-body:empty:before {
  content: attr(data-placeholder);
  color: #9aa5b1;
  pointer-events: none;
}
.rt-body p { margin: 0 0 0.75em; }
.rt-body h2 { font-size: 1.25rem; margin: 1em 0 0.5em; }
.rt-body h3 { font-size: 1.1rem; margin: 1em 0 0.45em; }
.rt-body ul, .rt-body ol { margin: 0 0 0.75em; padding-left: 1.4em; }
.rt-body blockquote {
  margin: 0.75em 0;
  padding: 8px 14px;
  border-left: 3px solid #0f766e;
  background: #f4faf8;
  color: #445;
}
.rt-body a { color: #0f766e; text-decoration: underline; }
.rt-body img { max-width: 100%; height: auto; border-radius: 6px; }
.rt-body img.rt-img-loading { opacity: 0.45; outline: 2px dashed #0f766e; }
.rt-editor { position: relative; }
.rt-drop-hint {
  display: none;
  position: absolute; inset: 0; z-index: 5;
  align-items: center; justify-content: center;
  background: rgba(15, 118, 110, 0.12);
  border: 2px dashed #0f766e; border-radius: 8px;
  color: #0f766e; font-weight: 700; font-size: 15px;
  pointer-events: none;
}
.rt-editor.is-dragover .rt-drop-hint { display: flex; }
.rt-editor.is-dragover .rt-body { filter: blur(1px); }
.rt-status {
  padding: 6px 12px; font-size: 12px; color: #0f766e;
  background: #f0faf7; border-top: 1px solid var(--line2, #e5e9ef);
}
.rt-status.is-err { color: #b42318; background: #fef3f2; }
.rt-editor.is-uploading { opacity: 0.92; }
.rt-editor.is-focus {
  border-color: #ffc299;
  box-shadow: 0 0 0 3px rgba(255, 194, 153, 0.25);
}
.admin-wrap .rt-editor.is-focus {
  border-color: #e8a838;
  box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.2);
}
.admin-wrap .rt-body { min-height: 280px; }
.rt-source {
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  border: 0;
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}
.rt-editor.is-source .rt-body { display: none; }
.rt-editor.is-source .rt-source { display: block; }

@media (max-width: 640px) {
  .rt-toolbar { padding: 6px; gap: 2px; }
  .rt-toolbar button { width: 36px; height: 34px; }
  .rt-body { min-height: 180px; padding: 12px; font-size: 16px; }
}
