/* Theme-aware editor and public content use the same formatting contract. */
:root { --rt-surface:var(--surface); --rt-ink:var(--text); --rt-line:var(--line); --rt-focus:var(--red); }
.rt-editor { border:1px solid var(--rt-line); border-radius:8px; background:var(--rt-surface); color:var(--rt-ink); overflow:visible; min-width:0; }
.rt-editor:focus-within { border-color:var(--rt-focus); box-shadow:0 0 0 2px color-mix(in srgb,var(--rt-focus) 14%,transparent); }
.rt-editor .ql-toolbar.ql-snow { display:flex; flex-wrap:wrap; gap:4px; border:0; border-bottom:1px solid var(--rt-line); padding:8px; font-family:var(--font-system); }
.rt-editor .ql-toolbar .ql-formats { margin:0; display:flex; align-items:center; border-inline-end:1px solid var(--rt-line); padding-inline-end:6px; }
.rt-editor .ql-container.ql-snow { border:0; font-family:var(--font-system); font-size:14px; }
.rt-editor .ql-editor { min-height:210px; max-height:430px; overflow-y:auto; padding:16px; line-height:1.8; color:var(--rt-ink); }
.rt-editor .ql-editor[dir=rtl] { text-align:right; }
.rt-editor .ql-toolbar button,.rt-editor .rt-tool { width:30px; height:30px; border-radius:4px; color:var(--rt-ink); background:transparent; border:0; cursor:pointer; display:grid; place-items:center; font-family:var(--font-system); }
.rt-editor .rt-tool:last-child { width:48px; font-size:11px; margin-inline-start:auto; }
.rt-editor .ql-snow .ql-stroke { stroke:var(--rt-ink); }
.rt-editor .ql-snow .ql-fill { fill:var(--rt-ink); }
.rt-editor .ql-picker { color:var(--rt-ink); }
.rt-editor .ql-picker-options { background:var(--rt-surface); border-color:var(--rt-line); z-index:30; }
.rt-editor .ql-toolbar button:hover,.rt-editor .ql-toolbar button.ql-active,.rt-editor .rt-tool[aria-pressed=true] { color:var(--rt-focus); background:color-mix(in srgb,var(--rt-focus) 10%,transparent); }
.rt-editor .ql-toolbar button:hover .ql-stroke,.rt-editor .ql-toolbar button.ql-active .ql-stroke { stroke:var(--rt-focus); }
.rt-editor textarea.rt-source { display:block; width:100%; min-height:240px; resize:vertical; border:0; background:var(--rt-surface); color:var(--rt-ink); padding:16px; }
.rt-editor [hidden] { display:none!important; }
.rt-editor .ql-tooltip { background:var(--rt-surface); color:var(--rt-ink); border-color:var(--rt-line); z-index:40; }
.rt-content { overflow-wrap:anywhere; line-height:1.8; }
.rt-content p,.rt-content blockquote,.rt-content pre { margin:0 0 .75em; }
.rt-content h1,.rt-content h2,.rt-content h3 { margin:.7em 0 .4em; }
.rt-content ul,.rt-content ol { padding-inline-start:1.8em; margin:.5em 0; }
.rt-content blockquote { border-inline-start:3px solid var(--line); padding-inline-start:1em; }
.rt-content pre { background:var(--surface-2); padding:12px; overflow:auto; white-space:pre-wrap; }
.rt-content .ql-align-center { text-align:center; }.rt-content .ql-align-right { text-align:right; }.rt-content .ql-align-justify { text-align:justify; }.rt-content .ql-direction-rtl { direction:rtl; }
.rt-content .ql-indent-1 { padding-inline-start:2em; }.rt-content .ql-indent-2 { padding-inline-start:4em; }.rt-content .ql-indent-3 { padding-inline-start:6em; }.rt-content .ql-indent-4 { padding-inline-start:8em; }.rt-content .ql-indent-5 { padding-inline-start:10em; }.rt-content .ql-indent-6 { padding-inline-start:12em; }.rt-content .ql-indent-7 { padding-inline-start:14em; }.rt-content .ql-indent-8 { padding-inline-start:16em; }
@media(max-width:600px) { .rt-editor .ql-toolbar.ql-snow { gap:4px;padding:6px; }.rt-editor .ql-editor { padding:12px;min-height:180px; }.rt-editor .ql-toolbar .ql-formats { padding-inline-end:3px; }.rt-editor .ql-toolbar button { width:28px; } }
.rt-editor .ql-snow .ql-picker-label:hover,.rt-editor .ql-snow .ql-picker-item:hover,.rt-editor .ql-snow .ql-picker-item.ql-selected,.rt-editor .ql-snow .ql-picker-label.ql-active { color:var(--rt-focus); }
.rt-editor .ql-snow .ql-picker-label:hover .ql-stroke { stroke:var(--rt-focus); }
.rt-editor .ql-picker.ql-header { border:1px solid var(--rt-line);border-radius:4px; }
