/* Editor chrome follows the application theme; these classes never enter mail. */
:root {
  --editor-bg: var(--surface); --editor-fg: var(--text); --editor-border: var(--border);
  --editor-control-bg: var(--bg); --editor-focus: var(--accent); --editor-active: var(--accent-soft);
  --editor-font: Arial, Helvetica, sans-serif; --editor-font-size: 16px; --editor-line-height: 1.5;
}
.message-editor-shell { min-width: 0; border: 1px solid var(--editor-border); border-radius: 10px; overflow: hidden; background: var(--editor-bg); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--editor-border); background: var(--editor-control-bg); }
.editor-toolbar .editor-command, .editor-toolbar select { min-height: 34px; padding: 5px 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2); font: 12px/1.3 system-ui, sans-serif; }
.editor-toolbar .editor-command { width: 34px; padding: 6px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.editor-toolbar .editor-command svg { width: 18px; height: 18px; }
.editor-toolbar .editor-command:hover, .editor-toolbar select:hover { background: var(--surface); }
.editor-toolbar [aria-pressed="true"] { color: var(--accent-text); background: var(--editor-active); border-color: var(--editor-border); }
.message-editor { min-height: 230px; max-height: 48dvh; overflow: auto; padding: 16px; color: var(--editor-fg); background: var(--editor-bg); font: var(--editor-font-size)/var(--editor-line-height) var(--editor-font); overflow-wrap: anywhere; word-break: normal; outline: none; contain: layout style; isolation: isolate; }
.message-editor:focus-visible { box-shadow: inset 0 0 0 2px var(--editor-focus); }
.message-editor * { max-width: 100%; box-sizing: border-box; }
.message-editor p, .message-editor div { margin: 0; }
.message-editor ul, .message-editor ol { padding-inline-start: 28px; }
.message-editor blockquote { border-inline-start: 3px solid var(--editor-border); margin: 8px 0; padding-inline-start: 12px; }
.message-editor table { border-collapse: collapse; max-width: 100%; }
.message-editor td, .message-editor th { min-width: 20px; overflow-wrap: anywhere; }
.message-editor pre { white-space: pre-wrap; }
.message-editor a { cursor: text; }
.composer-status { font-size: 12px; line-height: 1.5; color: var(--text-2); padding: 10px 0 0; overflow-wrap: anywhere; }
.composer-recovery { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.composer-recovery .actions { flex-wrap: wrap; }
.composer-recovery .btn { min-height: 44px; max-width: 100%; white-space: normal; text-align: left; }
.composer-notice:empty { display: none; }
.composer-notice { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 8px 0; font-size: 13px; line-height: 1.5; }
.composer-notice .btn { margin-top: 10px; }
.composer-image-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.composer-image-row > span { flex: 1; overflow-wrap: anywhere; }
.composer-image-row small { flex-basis: 100%; color: var(--text-2); }
.html-composer .dialog-body { scroll-padding-block: 12px; }
.composer-attachments { min-width: 0; border: 1px solid var(--editor-border); border-radius: 10px; padding: 12px; margin-block: 12px; background: var(--editor-control-bg); color: var(--editor-fg); }
.composer-attachments[hidden] { display: none; }
.composer-attachments h3 { margin: 0 0 8px; font-size: 14px; }
.composer-attachments .form-help { margin: 0 0 8px; }
.composer-attachment-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; padding-block: 10px; border-top: 1px solid var(--editor-border); }
.composer-attachment-label { display: flex; align-items: center; gap: 8px; flex: 1 1 180px; min-width: 0; font-size: 13px; }
.composer-attachment-label > svg { width: 18px; height: 18px; flex-shrink: 0; }
.composer-attachment-label > span { overflow-wrap: anywhere; }
.composer-attachment-label small { color: var(--text-2); white-space: nowrap; }
.composer-attachment-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.composer-attachment-actions .btn, .composer-attachment-select { min-height: 44px; }
.composer-attachment-select { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.composer-attachment-select input[type="checkbox"] { appearance: auto; width: 20px; height: 20px; accent-color: var(--accent); }
.composer-attachment-state { flex-basis: 100%; margin: 0; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.composer-attachment-state:empty { display: none; }
.composer-attachment-row.is-pending .composer-attachment-label { color: var(--text-2); }
.composer-attachment-row.is-pending { border-inline-start: 3px solid var(--editor-focus); padding-inline-start: 10px; }
@media (max-width: 600px) {
  .html-composer .editor-toolbar { gap: 3px; padding: 6px; }
  .html-composer .editor-toolbar .editor-command, .html-composer .editor-toolbar select { min-height: 38px; font-size: 12px; padding: 5px 7px; width: auto; }
  .html-composer .editor-toolbar .editor-command { width: 44px; min-height: 44px; padding: 10px; }
  .message-editor { min-height: 200px; max-height: 45dvh; padding: 12px; }
}
