/* MailServer built-in rich mail editor.
   Based on the user-provided ComposePro Plus editor concept, ported to framework-free
   JavaScript so WebMail has no paid/cloud editor dependency. */
.ms-editor{--me-border:#d8dee9;--me-bg:#fff;--me-soft:#f7f9fc;--me-text:#172033;--me-primary:var(--tenant-primary,#2563eb);border:1px solid var(--me-border);border-radius:10px;background:var(--me-bg);color:var(--me-text);overflow:hidden;box-shadow:0 1px 2px rgba(15,23,42,.05);font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}
.ms-editor *{box-sizing:border-box}.ms-editor-toolbar{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:7px;border-bottom:1px solid var(--me-border);background:var(--me-soft);position:sticky;top:0;z-index:4}.ms-editor-group{display:flex;align-items:center;gap:4px;padding-right:5px;margin-right:1px;border-right:1px solid var(--me-border)}.ms-editor-group:last-child{border-right:0}.ms-editor button,.ms-editor select,.ms-editor input[type=color]{height:30px;border:1px solid #c9d2df;background:#fff;border-radius:6px;color:#1f2937;cursor:pointer}.ms-editor button{min-width:30px;padding:0 8px;font-weight:600}.ms-editor button:hover{background:#edf3fb}.ms-editor button.is-active{background:#dbeafe;border-color:#93c5fd}.ms-editor select{padding:0 6px;max-width:135px}.ms-editor input[type=color]{width:32px;padding:2px}.ms-editor-surface-wrap{display:grid;grid-template-columns:minmax(0,1fr);min-height:180px}.ms-editor.is-split .ms-editor-surface-wrap{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.ms-editor-surface,.ms-editor-source,.ms-editor-preview{width:100%;min-height:var(--me-height,260px);max-height:70vh;overflow:auto;border:0;padding:14px;outline:none;background:#fff;color:#111827;font-family:Arial,sans-serif;line-height:1.5}.ms-editor-surface:empty:before{content:attr(data-placeholder);color:#94a3b8;pointer-events:none}.ms-editor-source{display:none;resize:vertical;font-family:Consolas,"Courier New",monospace;font-size:13px;border:0}.ms-editor.is-source .ms-editor-surface{display:none}.ms-editor.is-source .ms-editor-source{display:block}.ms-editor-preview{display:none;border-left:1px solid var(--me-border);background:#fbfdff}.ms-editor.is-split .ms-editor-preview{display:block}.ms-editor.is-source.is-split .ms-editor-source{display:block}.ms-editor img{max-width:100%;height:auto}.ms-editor table{border-collapse:collapse;max-width:100%}.ms-editor td,.ms-editor th{border:1px solid #cbd5e1;padding:6px}.ms-editor-status{display:flex;gap:12px;align-items:center;min-height:30px;padding:5px 9px;border-top:1px solid var(--me-border);font-size:11px;color:#64748b;background:#fafcff}.ms-editor-status .grow{flex:1}.ms-editor-popover{position:absolute;z-index:50;display:none;width:min(420px,calc(100vw - 32px));padding:10px;border:1px solid var(--me-border);border-radius:10px;background:#fff;box-shadow:0 14px 40px rgba(15,23,42,.18)}.ms-editor-popover.is-open{display:block}.ms-editor-emoji-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:4px}.ms-editor-emoji-grid button{font-size:20px;padding:0}.ms-editor-shapes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.ms-editor-shapes button{height:auto;min-height:36px}.ms-editor-versions{max-height:260px;overflow:auto}.ms-editor-version{display:block;width:100%;height:auto!important;text-align:left;padding:7px!important;margin-bottom:4px;font-weight:400!important}.ms-editor-version small{display:block;color:#64748b}.ms-editor-hidden{display:none!important}.ms-editor-fullscreen{position:fixed!important;inset:8px!important;z-index:99999!important;border-radius:10px!important}.ms-editor-fullscreen .ms-editor-surface,.ms-editor-fullscreen .ms-editor-source,.ms-editor-fullscreen .ms-editor-preview{max-height:calc(100vh - 110px);min-height:calc(100vh - 110px)}.ms-editor-long .ms-editor-surface,.ms-editor-long .ms-editor-source,.ms-editor-long .ms-editor-preview{max-height:none;min-height:max(var(--me-height,360px),70vh)}.ms-editor-textarea-source{display:none!important}.ms-editor .me-divider{width:1px;height:24px;background:var(--me-border);margin:0 2px}.ms-editor-file{display:none}.ms-editor-compact .me-versions,.ms-editor-compact .me-long{display:none}.ms-editor[data-disabled=true]{opacity:.65;pointer-events:none}
@media(max-width:760px){.ms-editor-toolbar{gap:4px}.ms-editor-group{border-right:0;padding-right:0}.ms-editor select{max-width:105px}.ms-editor.is-split .ms-editor-surface-wrap{grid-template-columns:1fr}.ms-editor-preview{border-left:0;border-top:1px solid var(--me-border)}.ms-editor-fullscreen{inset:0!important;border-radius:0!important}.ms-editor-emoji-grid{grid-template-columns:repeat(8,1fr)}}


/* Phase 33.9.23: protect editor controls from the global primary-button rule. */
.ms-editor .ms-editor-toolbar button {
    min-height: 30px !important;
    height: 30px !important;
    border-color: #c9d2df !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    box-shadow: none !important;
    filter: none !important;
    line-height: 1 !important;
    opacity: 1 !important;
}
.ms-editor .ms-editor-toolbar button > * { color: inherit !important; }
.ms-editor .ms-editor-toolbar button:hover {
    background: #edf3fb !important;
    color: #0f172a !important;
}
.ms-editor .ms-editor-toolbar button.is-active {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}
.ms-editor .ms-editor-toolbar select {
    min-height: 30px !important;
    height: 30px !important;
    background: #fff !important;
    color: #1f2937 !important;
}
