.mo-dialog{width:min(780px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #e1e6ee;border-radius:16px;color:#182334;background:#fff;box-shadow:0 24px 70px #18233430;font:14px/1.5 Inter,system-ui,sans-serif;overflow:auto}.mo-dialog::backdrop{background:#18233460;backdrop-filter:blur(3px)}.mo-header{display:flex;align-items:center;justify-content:space-between;padding:20px 26px;border-bottom:1px solid #e1e6ee;position:sticky;top:0;z-index:2;background:#fff}.mo-header h2{font-size:21px;letter-spacing:-.03em;margin:2px 0}.mo-eyebrow{font-size:10px;font-weight:700;letter-spacing:.12em;color:#637086}.mo-close{font-size:25px;width:36px;height:36px;border:0;background:#f5f7fa;border-radius:8px;color:#637086;cursor:pointer}.mo-content{padding:20px 26px}.mo-content button,.mo-content select,.mo-content input,.mo-content textarea{font:inherit;color:inherit}.mo-content button,.mo-primary{border:1px solid #dce2eb;border-radius:7px;padding:8px 12px;background:#fff;cursor:pointer;min-height:36px;white-space:nowrap}.mo-content button:hover{background:#f5f7fa}.mo-content button:disabled{opacity:.55;cursor:wait}.mo-content a[aria-disabled=true]{opacity:.45;cursor:not-allowed}.mo-content :focus-visible,.mo-close:focus-visible{outline:3px solid #82a9ff;outline-offset:3px}.mo-recipient-line{display:flex;align-items:center;gap:16px;justify-content:space-between;margin-bottom:18px}.mo-recipient-line>div{display:flex;gap:8px;flex-wrap:wrap}.mo-recipient-line span{color:#637086}.mo-recipient-line label{display:grid;gap:5px;flex:1;font-size:12px;color:#637086}.mo-content select{padding:8px;border:1px solid #dce2eb;border-radius:7px;background:#fff;max-width:100%;min-width:0}.mo-category{font-size:12px;padding:4px 8px;border:1px solid #e1e6ee;border-radius:5px}.mo-address{display:grid;gap:10px}.mo-address label{display:grid;grid-template-columns:58px 1fr;align-items:center;font-size:12px;color:#637086}.mo-content input,.mo-content textarea{width:100%;box-sizing:border-box;border:1px solid #dce2eb;border-radius:7px;padding:10px 12px;background:#fff}.mo-editor-bar{display:flex;align-items:center;justify-content:space-between;margin-top:20px;border-bottom:1px solid #e1e6ee;padding-bottom:8px;gap:8px}.mo-editor-bar [role=tablist]{display:flex;gap:4px}.mo-editor-bar button{font-size:12px;border-color:transparent}.mo-editor-bar [aria-selected=true]{color:#2459d3;background:#edf3ff}.mo-content .mo-text{color:#637086}.mo-preview{padding:22px 8px;line-height:1.65;min-height:250px;overflow-wrap:anywhere}.mo-preview p{margin:0 0 16px}.mo-preview p:last-child{margin:0}.mo-preview a{color:#2459d3;text-decoration:underline}.mo-preview strong{font-weight:650}.mo-source-label{display:block;font-size:12px;color:#637086;margin-top:14px}.mo-source-label span{float:right;font-size:11px}.mo-source{margin-top:8px;min-height:450px;resize:vertical;line-height:1.65}.mo-attachments{border-top:1px solid #e1e6ee;border-bottom:1px solid #e1e6ee;padding:14px 0}.mo-attachments>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:8px}.mo-attachments strong{font-size:12px}.mo-attachments button{font-size:12px}.mo-file-list{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.mo-file-list>span:not(.mo-muted){background:#f5f7fa;padding:3px 7px;border-radius:6px;display:inline-flex;align-items:center;gap:8px;font-size:12px;max-width:100%;overflow-wrap:anywhere}.mo-file-list button{border:0;background:transparent;font-size:20px;padding:0 6px}.mo-muted{color:#637086;font-size:12px}.mo-handoff-help{font-size:12px;color:#637086;margin-top:12px}.mo-handoff-help summary{cursor:pointer}.mo-handoff-help p{max-width:65ch;line-height:1.6}.mo-notice{font-size:12px;color:#2459d3;margin:12px 0;min-height:18px}.mo-error{color:#a32932}.mo-footer{display:flex;flex-direction:column;gap:12px;padding-top:8px}.mo-secondary-actions,.mo-primary-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.mo-secondary-actions button{font-size:12px;color:#637086}.mo-primary-actions{justify-content:flex-end}.mo-primary-actions .mo-client-label{margin-right:auto;display:flex;gap:8px;align-items:center;font-size:12px;color:#637086}.mo-content .mo-primary{display:inline-flex;align-items:center;background:#2459d3;color:#fff;border-color:#2459d3;text-decoration:none;font-weight:600}.mo-content .mo-primary:hover{background:#1e4bb2}.mo-footer>small{font-size:11px;color:#637086;text-align:right}.mo-template-field{display:grid;gap:6px;margin-bottom:14px;font-size:12px}.mo-template-field textarea{resize:vertical;line-height:1.6}@media(max-width:600px){.mo-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:12px}.mo-content,.mo-header{padding:16px}.mo-address label{grid-template-columns:1fr;gap:4px}.mo-recipient-line{align-items:flex-start;gap:8px}.mo-primary-actions .mo-client-label{width:100%}.mo-footer>small{text-align:left}.mo-source-label span{float:none;display:block}.mo-source{min-height:330px}.mo-editor-bar button{padding:7px 8px}.mo-preview{padding:16px 0}}
/* App-wide margin reset must not pin native dialogs to the top-left. */
.mo-dialog{margin:auto}.mo-dialog[open]{display:flex;flex-direction:column}.mo-header{flex:none}.mo-content{min-height:0;overflow:auto}.mo-footer{position:sticky;bottom:-20px;background:#fff;border-top:1px solid #e1e6ee;padding:14px 0 4px;z-index:1}.mo-handoff-help{margin-bottom:10px}@media(max-width:600px){.mo-footer{bottom:-16px}}
.crm-category-tools{display:grid;gap:8px;margin-bottom:16px}.crm-category-tools>[role=status]{font-size:12px;color:#637086;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mo-sender{margin:0 0 14px;font-size:12px;color:#61728a}.mo-sender>summary{cursor:pointer;list-style:none;display:inline-flex;gap:6px;align-items:center;max-width:100%;overflow-wrap:anywhere}.mo-sender>summary::after{content:'⌄';font-size:13px}.mo-sender[open]>summary::after{content:'⌃'}.mo-sender>summary::-webkit-details-marker{display:none}.mo-sender>div{margin-top:10px;padding:12px 14px;background:#f7f9fc;border:1px solid #e0e7f0;border-radius:9px;display:flex;flex-wrap:wrap;align-items:center;gap:12px}.mo-sender label{display:grid;gap:5px;color:#334b69;font-size:11px}.mo-sender select{font:inherit;font-size:12px;color:#23344d;background:#fff;border:1px solid #cbd6e4;border-radius:7px;padding:8px;min-height:36px;max-width:100%}.mo-sender p{font-size:11px;line-height:1.6;flex:1;min-width:160px;margin:0;max-width:380px}.mo-sender :focus-visible{outline:2px solid #0344c2;outline-offset:3px}

.mo-sender-warning{font-size:12px;line-height:1.6;padding:10px 12px;margin:0 0 14px;border:1px solid #efd3ad;background:#fff8ed;color:#87511d;border-radius:8px}.mo-sender-warning[hidden]{display:none}

.mo-handoff{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;margin:16px 0 4px;border:1px solid #dce3f3;border-radius:10px;background:#f6f8ff}.mo-handoff>div{display:grid;gap:4px;flex:1;min-width:190px}.mo-handoff strong{font-size:13px;color:#16213b}.mo-handoff span,.mo-handoff>small{font-size:12px;color:#65718a}.mo-handoff button{white-space:nowrap}.mo-handoff [disabled]{opacity:.5;cursor:not-allowed}@media(max-width:600px){.mo-handoff button{width:100%;justify-content:center}}
/* A single compose workflow; utilities and routing rules stay on demand. */
.mo-header .mo-eyebrow{display:none}.mo-header h2{font-size:20px}.mo-template-choice{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;margin:14px 0 20px;padding:13px 0;border-top:1px solid #edf0f4;border-bottom:1px solid #edf0f4}.mo-template-choice label{display:grid;gap:5px;font-size:11px;color:#67778c;min-width:190px;flex:1}.mo-template-choice select{font-size:12px;width:100%;max-width:280px}.mo-template-choice>small{order:4;width:100%;font-size:11px;color:#8190a2}.mo-template-choice button{font-size:12px;min-height:34px}.mo-more>summary{font-size:12px;cursor:pointer;padding:8px 0;color:#64758d}.mo-more>.mo-secondary-actions{padding:10px 0}.mo-footer{position:relative;gap:8px}.mo-primary-actions{border-top:1px solid #edf0f4;padding-top:12px}.mo-attachments>div>span{display:flex;gap:7px}.mo-template-library{display:flex;gap:12px;align-items:flex-end;margin-bottom:18px}.mo-template-library label{display:grid;gap:6px;flex:1;font-size:12px}.mo-template-rules,.mo-template-help{padding:12px 0;margin-bottom:15px;border-bottom:1px solid #edf0f4}.mo-template-rules>summary,.mo-template-help>summary{cursor:pointer;font-size:13px;color:#546b8e;margin-bottom:12px}.mo-size-rule{display:grid;grid-template-columns:1fr 1fr;gap:14px}.mo-size-rule label{display:grid;gap:7px;font-size:12px}.mo-content .mo-template-default{display:flex;gap:9px;align-items:center;font-size:12px}.mo-content .mo-template-default input{width:auto}.mo-template-decks{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:12px 0;border-top:1px solid #edf0f4}.mo-template-decks>strong{font-size:12px}.mo-template-decks>span{font-size:12px;color:#718197;flex:1;min-width:190px}.mo-template-decks button{font-size:12px}@media(max-width:600px){.mo-template-choice>label{min-width:100%;}.mo-template-choice select{max-width:none}.mo-template-library{flex-wrap:wrap}.mo-attachments>div:first-child{align-items:flex-start;flex-direction:column}}
/* The message stays readable; formatting appears only while editing. */
.mo-settings{margin:12px 0 8px;color:#637086;font-size:12px}.mo-settings>summary{display:inline-block;cursor:pointer;padding:5px 0;list-style:none}.mo-settings>summary::after{content:'⌄';margin-left:8px}.mo-settings[open]>summary::after{content:'⌃'}.mo-settings>summary::-webkit-details-marker{display:none}.mo-settings[open]{padding-bottom:14px;border-bottom:1px solid #e1e6ee}.mo-settings .mo-sender{margin:12px 0 0}.mo-settings .mo-template-choice{margin:10px 0;padding:10px 0}.mo-settings .mo-client-label{display:flex;gap:10px;align-items:center}.mo-settings .mo-client-label select{font-size:12px}.mo-editor-bar{margin-top:12px;padding:8px 0;border-bottom:0}.mo-editor-bar>span{font-size:12px;color:#637086}.mo-editor-bar>button{font-size:12px;color:#2443b7;border:1px solid #dce2eb;padding:6px 11px;background:#fff}.mo-preview{padding:12px 2px 24px}.mo-preview ul,.mo-preview ol,.mo-rich-text ul,.mo-rich-text ol{padding-left:24px;margin:12px 0 16px}.mo-preview li,.mo-rich-text li{margin:5px 0}.mo-rich-wrap{border:1px solid #cbd5e4;border-radius:9px;overflow:hidden;margin:0 0 20px}.mo-rich-wrap:focus-within{border-color:#7c98d7;box-shadow:0 0 0 2px #edf2ff}.mo-format-tools{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:8px;background:#f6f7fa;border-bottom:1px solid #e1e6ee}.mo-format-tools button{min-height:32px;padding:4px 9px;font-size:12px;background:transparent;border-color:transparent}.mo-format-tools button[aria-pressed=true]{background:#e7edff;color:#2443b7;border-color:#c8d4f4}.mo-format-tools button:first-child,.mo-format-tools button:nth-child(2){min-width:34px;font-size:14px}.mo-rich-text{padding:18px 16px;min-height:300px;outline:none;line-height:1.65;overflow-wrap:anywhere;white-space:normal;font-size:14px;color:#182334}.mo-rich-text:focus-visible{outline:none}.mo-rich-text p{margin:0 0 16px}.mo-rich-text p:last-child{margin-bottom:0}.mo-rich-text strong{font-weight:650}.mo-rich-text a{color:#2443b7;text-decoration:underline}.mo-rich-text[contenteditable=false]{opacity:.75}.mo-link-editor{display:flex;align-items:flex-end;gap:7px;padding:12px;background:#f6f7fa;border-bottom:1px solid #e1e6ee;flex-wrap:wrap}.mo-link-editor[hidden]{display:none}.mo-link-editor label{display:grid;gap:5px;flex:1;min-width:190px;font-size:12px}.mo-link-editor button{font-size:12px;padding:7px 9px}.mo-footer{display:grid;grid-template-columns:1fr auto;align-items:start;gap:6px 12px;border-top:0}.mo-footer>.mo-primary-actions{border:0;padding-top:0}.mo-footer>.mo-more{min-width:0}.mo-footer>.mo-more[open]{grid-column:1/-1}.mo-footer>.mo-more[open]+.mo-primary-actions{grid-column:2}.mo-footer>.mo-more .mo-handoff-help{max-width:65ch;margin:5px 0 10px}.mo-footer>small{grid-column:1/-1}.mo-notice:empty{margin:4px 0;min-height:0}.mo-handoff{margin-top:14px}.mo-template-field .mo-rich-wrap{margin-bottom:0}.mo-template-field .mo-rich-text{min-height:340px}.mo-template-field .mo-format-tools{color:#182334}@media(max-width:600px){.mo-format-tools{gap:2px;padding:6px}.mo-format-tools button{padding:5px 7px}.mo-rich-text{padding:14px 12px;min-height:260px}.mo-footer{grid-template-columns:1fr}.mo-footer>.mo-primary-actions,.mo-footer>.mo-more[open]+.mo-primary-actions{grid-column:1;justify-content:flex-end}.mo-footer>small{text-align:left}.mo-link-editor label{min-width:100%}}
.mo-footer{position:sticky;bottom:-20px;z-index:3;padding:14px 0 8px;border-top:1px solid #e1e6ee;background:#fff;box-shadow:0 -10px 18px #fff}.mo-footer>.mo-more[open]{max-height:min(280px,45dvh);overflow:auto}@media(max-width:600px){.mo-footer{bottom:-16px}}

/* Template targeting uses readable company groups; detailed ranges stay optional. */
.mo-size-presets{border:0;margin:12px 0;padding:0;display:flex;gap:12px;flex-wrap:wrap}.mo-size-presets legend{font-weight:600;margin-bottom:8px}.mo-size-presets label{display:inline-flex;align-items:center;gap:6px;font-weight:400}.mo-size-presets input{width:16px;height:16px;margin:0}.mo-size-presets small{width:100%;color:var(--muted,#64748b)}.mo-template-advanced{margin:10px 0}.mo-template-advanced summary{cursor:pointer;color:var(--muted,#64748b);font-size:13px}
