.rich-editor { min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: white; margin-bottom: 1rem; }
.form-grid > .field-rich-text { grid-column: 1 / -1; }
.rich-editor:focus-within { border-color: var(--pf-red); box-shadow: 0 0 0 2px rgb(217 0 30 / 8%); }
.rich-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 7px 9px; border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; background: var(--surface-2); }
.rich-tool-group { display: inline-flex; align-items: center; gap: 2px; padding-right: 6px; border-right: 1px solid var(--border); }
.rich-tool-group:last-child { border: 0; padding-right: 0; }
.rich-tool { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); }
.rich-tool:hover { background: white; color: var(--ink); }
.rich-tool[aria-pressed="true"] { background: var(--pf-red-light, #ffedf0); color: var(--pf-red); }
.rich-tool:disabled { color: var(--muted); opacity: .4; cursor: default; }
.rich-toolbar .rich-block-style { width: 158px; min-height: 32px; padding: 4px 7px; border: 0; border-radius: 4px; background: transparent; font-size: 12px; }
.rich-tool:focus-visible, .rich-block-style:focus-visible { outline: 2px solid var(--pf-red); outline-offset: 1px; }
.rich-editable { min-height: 130px; padding: 14px 16px; font: inherit; color: var(--ink); line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; white-space: break-spaces; outline: none; }
.rich-editable p { color: inherit; }
.rich-editor-long .rich-editable { min-height: 210px; }
.rich-editable p, .rich-content p { margin: 0 0 .65em; }
.rich-editable > :first-child, .rich-content > :first-child { margin-top: 0; }
.rich-editable > :last-child, .rich-content > :last-child { margin-bottom: 0; }
.rich-editable h2, .rich-content h2 { font-family: inherit; font-size: 1.3em; margin: 1em 0 .5em; }
.rich-editable h3, .rich-content h3 { font-family: inherit; font-size: 1.12em; margin: 1em 0 .5em; }
.rich-editable ul, .rich-editable ol, .rich-content ul, .rich-content ol { padding-left: 1.5em; margin: .5em 0; }
.rich-editable li p, .rich-content li p { margin-bottom: .2em; }
.rich-content { min-width: 0; overflow-wrap: anywhere; line-height: 1.65; }
.rich-link-panel { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rich-link-panel[hidden], .rich-feedback[hidden] { display: none; }
.rich-link-panel input { flex: 1 1 160px; min-height: 34px !important; padding: 5px 8px !important; font-size: 13px; }
.rich-link-error { width: 100%; font-size: 12px; color: var(--danger); }
.rich-link-error:empty { display: none; }
.rich-feedback { padding: 8px 14px; margin: 0; border-top: 1px solid var(--danger); color: var(--danger); font-size: 13px; }
.rich-invalid, .field-error .rich-editor { border-color: var(--danger); }
@media (max-width: 540px) {
  .rich-toolbar { padding: 6px; gap: 3px; }
  .rich-toolbar .rich-block-style { flex-grow: 1; }
  .rich-tool { width: 36px; height: 36px; }
  .rich-editable { padding: 12px; }
}
