/* Citadel editor component. Includes canvas adapter; all colors use theme tokens. */
/* rampart-theme.css editor rules, now maintained here. */
.rte{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--card);margin-top:5px}
.rte-toolbar{display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:6px 8px;
  background:var(--card-2);border-bottom:1px solid var(--line)}
.rte-btn{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:30px;
  padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--text);
  font-size:13px;cursor:pointer;line-height:1}
.rte-btn:hover{background:rgba(255,255,255,.08);border-color:var(--line)}
html[data-theme="light"] .rte-btn:hover{background:#eef1f5}
.rte-sep{width:1px;height:20px;background:var(--line);margin:0 4px}
.rte-surface{min-height:180px;max-height:520px;overflow:auto;padding:12px 14px;
  color:var(--text);font-size:14px;line-height:1.6;outline:none}
.rte-surface:focus{outline:none}
.rte-surface:empty::before{content:"Write notesâ€¦ use the toolbar to format.";color:var(--muted)}
.wp-mail-editor .rte-surface:empty::before{content:none}
.rte-surface h1{font-size:22px;margin:.4em 0 .3em}
.rte-surface h2{font-size:18px;margin:.4em 0 .3em}
.rte-surface h3{font-size:16px;margin:.4em 0 .3em}
.rte-surface p{margin:.4em 0}
.rte-surface ul,.rte-surface ol{margin:.4em 0;padding-left:22px}
.rte-surface blockquote{border-left:3px solid var(--blue);margin:.4em 0;padding:2px 12px;color:var(--muted)}
.rte-surface a{color:var(--blue);text-decoration:underline}
.rte-surface code{background:rgba(255,255,255,.08);padding:1px 5px;border-radius:5px;font-size:.92em}
.md-editor.rte-mode{display:block !important}
.md-editor.rte-mode textarea{display:none}
.md-editor.rte-mode,
.md-editor:has(.rte){
  display:block !important;
  grid-template-columns:none !important;
  gap:0 !important;
}
.md-editor .rte,
.task-form .rte,
.rte{
  display:block;
  width:100%;
}
.rte .rte-surface,
.task-form .rte .rte-surface{
  min-height:260px !important;   /* was collapsing to ~1 line */
  height:auto;
  max-height:70vh;
  overflow:auto;
  resize:vertical;               /* drag the bottom-right to grow/shrink */
  padding:12px 14px;
  line-height:1.6;
  box-sizing:border-box;
}
.md-editor.rte-mode textarea,
.md-editor.rte-mode #md-preview{
  display:none !important;
}
.rte .rte-toolbar{flex-wrap:wrap;row-gap:4px}
.nc-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:6px 10px;
  background:var(--card-2);border-bottom:1px solid var(--line)}
.nc-toolbar button{min-width:30px;height:30px;padding:0 8px;border:1px solid transparent;border-radius:7px;
  background:transparent;color:var(--text);font-size:13px;cursor:pointer;line-height:1}
.nc-toolbar button:hover{background:rgba(255,255,255,.08);border-color:var(--line)}
.nc-toolbar [data-add]{color:var(--link);border-color:var(--line)}
.nc-toolbar [data-add]:hover{background:rgba(var(--accent-rgb),.12)}
.nc-sep{width:1px;height:20px;background:var(--line);margin:0 4px}
.nc-hint{color:var(--muted);font-size:12px;margin-left:6px}
.bug-form .bug-rte-desc .rte .rte-surface{min-height:180px !important;max-height:60vh}
.bug-form .bug-rte-steps .rte .rte-surface{min-height:130px !important;max-height:50vh}
.rte-surface[data-placeholder]:empty::before{content:attr(data-placeholder);color:var(--muted)}
.rte-surface[hidden],.rte-source[hidden],.rte-tablebar[hidden],.rte-pop[hidden]{display:none !important}
.rte{position:relative}
.rte-toolbar{align-items:center}
.rte-select{height:30px;margin:0 !important;padding:0 6px !important;width:auto !important;max-width:150px;font-size:13px !important;
  background:var(--card);color:var(--text);border:1px solid var(--line);border-radius:7px}
.rte-select-block{min-width:104px}
.rte-btn[aria-pressed="true"]{background:var(--accent-wash);border-color:var(--blue);color:var(--link)}
.rte-tablebar{border-top:1px solid var(--line);background:var(--card);gap:6px}
.rte-tablebar-label{font-size:12px;font-weight:700;color:var(--muted);padding:0 4px}
.rte-source{display:block;width:100%;min-height:260px;box-sizing:border-box;padding:12px 14px;border:0;border-radius:0;outline:none;resize:vertical;
  background:var(--card);color:var(--text);font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.rte-source-on .rte-surface{display:none}
.rte-snip{position:relative;display:inline-flex}
.rte-pop{position:absolute;z-index:30;min-width:210px;max-width:320px;max-height:260px;overflow:auto;padding:6px;border:1px solid var(--line);border-radius:10px;
  background:var(--card);box-shadow:0 10px 28px rgba(0,0,0,.35)}
.rte-snip > .rte-pop{top:34px;left:0}
.rte-pop-row{display:flex;align-items:center;gap:4px}
.rte-pop-item,.rte-pop-save{display:block;flex:1;width:100%;text-align:left;padding:7px 10px;border:0;border-radius:7px;background:none;color:var(--text);font-size:13px;cursor:pointer}
.rte-pop-item:hover,.rte-pop-item.is-on,.rte-pop-save:hover{background:rgba(var(--accent-rgb),.14);color:var(--link)}
.rte-pop-save{margin-top:4px;border-top:1px solid var(--line);border-radius:0 0 7px 7px;color:var(--link);font-weight:600}
.rte-pop-del{border:0;background:none;color:var(--muted);cursor:pointer;padding:4px 7px;border-radius:6px}
.rte-pop-del:hover{color:var(--danger-fg)}
.rte-pop-empty{padding:8px 10px;color:var(--muted);font-size:12px}
.rte-surface table,.markdown-body table,.rich-body table{border-collapse:collapse;margin:.6em 0;max-width:100%}
.rte-surface th,.rte-surface td,.markdown-body th,.markdown-body td,.rich-body th,.rich-body td{border:1px solid var(--line);padding:6px 10px;vertical-align:top;min-width:48px}
.rte-surface th,.markdown-body th,.rich-body th{background:var(--card-2);font-weight:700;text-align:left}
.rte-surface img,.markdown-body img,.rich-body img{max-width:100%;height:auto;border-radius:6px}
.rte-surface img:hover{outline:2px solid var(--blue);outline-offset:2px;cursor:zoom-in}
.rte-surface hr,.markdown-body hr,.rich-body hr{border:0;border-top:1px solid var(--line);margin:1em 0}
.rte-surface h4,.markdown-body h4,.rich-body h4{font-size:15px;margin:.5em 0 .3em}
.rte-surface h5,.markdown-body h5,.rich-body h5{font-size:14px;margin:.5em 0 .3em}
.rte-surface h6,.markdown-body h6,.rich-body h6{font-size:13px;margin:.5em 0 .3em;color:var(--muted)}
.rte-surface pre,.markdown-body pre,.rich-body pre{background:var(--card-2);border:1px solid var(--line);border-radius:8px;padding:10px 12px;overflow:auto;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.rte-surface sub,.rte-surface sup,.markdown-body sub,.markdown-body sup,.rich-body sub,.rich-body sup{font-size:.75em;line-height:0}
@media  (pointer:coarse),(max-width:640px){.rte-btn,.rte-select{min-height:38px;min-width:38px}
.rte-select{font-size:14px !important}
.rte-pop{max-width:90vw}}
.bug-note-form .rte{margin-bottom:10px}
.wp-mail-editor.rte-mode{background:#fff;border-color:#cbd5e1}
.wp-mail-editor .rte-surface{background:#fff;color:#172033;color-scheme:light}
.wp-mail-editor .rte-surface *{background-color:transparent !important}
.wp-mail-editor .rte-surface a{color:#0b57d0 !important}
.wp-mail-editor .rte-surface blockquote{color:#4b5563 !important;border-left-color:#94a3b8}
.wp-mail-editor .rte-surface:empty::before{color:#64748b}
.ox-msg-body.gh-msg-body-paper *,
.wp-mail-editor .rte-surface .gh-quoted-thread,
.wp-mail-editor .rte-surface .gh-quoted-thread *{
  color:#172033 !important;background-color:transparent !important;
}
.ox-msg-body.gh-msg-body-paper a,
.ox-msg-body.gh-msg-body-paper a *,
.wp-mail-editor .rte-surface .gh-quoted-thread a,
.wp-mail-editor .rte-surface .gh-quoted-thread a *{color:#0b57d0 !important}
.wp-mail-editor .rte-surface .gh-quoted-thread{
  border-left:3px solid #94a3b8;margin:16px 0 0;padding:4px 12px;
}
.wp-mail-editor .rte .rte-surface{
  background:#fff !important;
  color:#172033 !important;
  color-scheme:light;
  caret-color:#172033;
}
body .rte,body .notes-editor,body .notes-editor .md-editor{min-width:0;max-width:100%;box-sizing:border-box}
body .rte>.rte-toolbar,body .wp-mail-editor .rte>.rte-toolbar,body .notes-editor .nc-toolbar{display:flex;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;max-width:100%;min-width:0;box-sizing:border-box;flex-shrink:0}
body .rte>.rte-toolbar>*,body .notes-editor .nc-toolbar>*{flex:0 0 auto;white-space:nowrap}
body .rte>.rte-toolbar[hidden]{display:none!important}
@media (max-width:820px){body .rte-toolbar .rte-btn,body .rte-toolbar select,body .notes-editor .nc-toolbar button{min-height:44px}
body .rte-toolbar .rte-btn,body .notes-editor .nc-toolbar button{min-width:44px}}
/* fields.css editor rules, now maintained here. */
.rte{background:var(--field-bg);border-color:var(--field-line);border-radius:16px}
.rte .rte-surface,.task-form .rte .rte-surface{background:var(--field-bg);color:var(--text)}
.rte-toolbar{background:var(--card-2);border-bottom-color:var(--field-line)}
.rte-toolbar select,.rte-toolbar .rte-select{background-color:var(--field-bg);border-color:var(--field-line)}
.rte:focus-within{border-color:var(--blue);box-shadow:0 0 0 3px var(--accent-wash)}
.rte-sep{background:var(--field-line)}
.rte-surface:empty::before{color:var(--muted)}
.rte-surface code{background:var(--btn-bg)}
html[data-theme="light"] .rte-toolbar{background:var(--card-2)}
/* mobile.css editor rules, now maintained here. */
@media(max-width:820px){@media  (max-width: 760px) {.rte .rte-toolbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rte .rte-toolbar > * { flex: none; }
.rte .rte-toolbar::-webkit-scrollbar { display: none; }
.nc-toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 6px 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nc-toolbar::-webkit-scrollbar { display: none; }
.nc-toolbar > * { flex: none; }
.nc-toolbar button { min-width: 42px; height: 42px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
.nc-toolbar [data-add] { order: -2; background: var(--accent-wash); color: var(--link); }
.nc-hint { display: none; }
.nc-sep { height: 24px; margin: 0 2px; }}}
/* warden-polish.css editor rules, now maintained here. */
@media (max-width:820px){body .rte>.rte-toolbar,body .wp-mail-editor .rte>.rte-toolbar{display:flex;flex-wrap:nowrap!important;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;max-width:100%;scrollbar-width:thin}
body .rte>.rte-toolbar>*{flex:0 0 auto}
body .rte-toolbar .rte-btn,body .rte-toolbar select{min-height:40px}
body .rte-toolbar .rte-btn{min-width:40px}
.rte{min-width:0;max-width:100%}}
/* warden-modern.css editor rules, now maintained here. */
.md-editor.wp-mail-editor.rte-mode{background:var(--field-bg);border-color:var(--field-line);border-radius:14px;padding:0}
.wp-mail-editor .rte{border:1px solid var(--field-line);border-radius:14px;overflow:hidden;background:var(--field-bg)}
.wp-mail-editor .rte-toolbar{background:var(--card-2)!important;color:var(--text);display:flex;flex-wrap:wrap;gap:4px;padding:8px;border-bottom:1px solid var(--line)}
.wp-mail-editor .rte-toolbar button,.wp-mail-editor .rte-toolbar select{background:var(--btn-bg);color:var(--text);border-color:var(--btn-line);border-radius:9px;max-width:150px}
.wp-mail-editor .rte .rte-surface{background:var(--field-bg)!important;color:var(--text)!important;color-scheme:normal;padding:16px;min-height:220px;line-height:1.6}
.wp-mail-editor .rte .rte-surface .gh-quoted-thread,.wp-mail-editor .rte .rte-surface .gh-quoted-thread *{color:var(--text)!important;background-color:transparent!important}
.wp-mail-editor .rte .rte-surface a,.wp-mail-editor .rte .rte-surface .gh-quoted-thread a,.wp-mail-editor .rte .rte-surface .gh-quoted-thread a *{color:var(--link)!important}
.wp-mail-editor .rte .rte-surface blockquote{color:var(--text-soft)!important;border-left-color:var(--line)}
.warden-compose-embedded .wp-mail-editor .rte .rte-surface{min-height:200px}