#epOverlay[hidden],#epAux[hidden]{display:none!important}#epOverlay,#epAux{display:flex;position:fixed;inset:0;align-items:center;justify-content:center;background:#112a2466;backdrop-filter:blur(5px);z-index:11000;padding:14px}#epAux{z-index:12000}#epOverlay .ep-dialog{width:min(1480px,98vw);max-width:1480px;height:min(940px,96vh);max-height:96vh;display:flex;flex-direction:column;padding:0;overflow:hidden;background:var(--surface,#fafcf9);color:var(--text,#1a2e25);border:1px solid var(--line,#cbd8ce);border-radius:12px;box-shadow:0 18px 55px #091c2433}
.ep-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 20px;border-bottom:1px solid var(--line);background:var(--surface)}.ep-head h2{font:700 23px Georgia,serif;margin:0;color:var(--heading)}.ep-eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:1.2px;color:var(--dim);margin-bottom:4px}.ep-head-actions{display:flex;align-items:center;gap:8px}.ep-head-actions select{max-width:250px}.ep-mode-note{padding:7px 20px;background:var(--surface-alt);font-size:12px;display:flex;justify-content:space-between;gap:12px;color:var(--dim);border-bottom:1px solid var(--line)}
.ep-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(365px,1fr);gap:16px;padding:16px;min-height:0;flex:1;overflow:hidden}.ep-mail{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:8px;min-width:0;min-height:0;overflow:hidden}.ep-envelope{padding:14px 18px;border-bottom:1px solid var(--line);font-size:12px;line-height:1.7}.ep-address{display:grid;grid-template-columns:45px minmax(0,1fr);gap:5px}.ep-address span{overflow-wrap:anywhere}.ep-address b{color:var(--dim);font-weight:500}.ep-tools{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 0;font:11px system-ui;color:var(--dim)}.ep-tools button{padding:3px 8px!important;font-size:10px!important}.ep-subject{font:700 14px/1.6 system-ui;outline:none;padding:5px 0;min-height:30px;overflow-wrap:anywhere}.ep-subject:focus{outline:1px solid var(--accent);outline-offset:3px}.ep-scroll{overflow:auto;flex:1;padding:8px 22px 25px;min-height:0}.ep-body{font:15px/1.6 Georgia,'Times New Roman',serif;outline:none;min-height:250px}.ep-body p{margin:14px 0}.ep-body:focus{outline:1px dashed var(--accent);outline-offset:5px}.ep-body table{width:100%;border-collapse:collapse;font:12px/1.45 system-ui}.ep-body th,.ep-body td{padding:7px 5px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}.ep-body th{background:var(--surface-alt)}.ep-mail-foot{padding:8px 18px;border-top:1px solid var(--line);font-size:11px;color:var(--dim)}
.ep-form{overflow:auto;min-height:0;display:flex;flex-direction:column;gap:12px;padding-right:3px}.ep-section{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:13px}.ep-section h3{font:650 12px system-ui;color:var(--accent);margin:0 0 12px}.ep-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.ep-field{min-width:0}.ep-field.wide{grid-column:1/-1}.ep-field label{display:block;font-size:11px;color:var(--dim);margin-bottom:5px}.ep-field input,.ep-field select,.ep-field textarea,.ep-head select,.ep-search{width:100%;font:12px system-ui;min-height:34px;padding:7px 9px;border:1px solid var(--line);border-radius:4px;background:var(--surface-alt);color:var(--text)}.ep-field textarea{min-height:65px;resize:vertical}.ep-combo{display:flex;position:relative}.ep-combo input{padding-right:32px}.ep-combo>button{position:absolute;right:0;top:0;bottom:0;width:30px;padding:0!important;box-shadow:none!important;border:0;border-left:1px solid var(--line);background:transparent!important}.ep-options{position:fixed;z-index:12100;border:1px solid var(--line);background:var(--surface);box-shadow:0 10px 24px #0002;border-radius:5px;max-height:240px;overflow:auto}.ep-options button{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:8px 12px;box-shadow:none!important;font:12px system-ui;color:var(--text);background:var(--surface)}.ep-options button:hover,.ep-options button:focus{background:var(--surface-alt);color:var(--accent)}.ep-defendant{display:flex;align-items:center;gap:6px;margin-bottom:7px}.ep-defendant .ep-combo{flex:1}.ep-defendant>button{padding:4px 7px!important}
.ep-actions{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.ep-overlay button,.ep-dialog button,#epAux button{font:600 12px system-ui;padding:7px 11px;cursor:pointer}.ep-hint{font:11px/1.5 system-ui;color:var(--dim);margin-top:8px}.ep-chips{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:6px}.ep-chip{display:inline-flex;align-items:center;gap:7px;padding:3px 7px;border:1px solid var(--line);border-radius:20px;background:var(--surface-alt);font-size:11px;overflow-wrap:anywhere}.ep-chip button{padding:0 2px!important;border:0!important;background:none!important;box-shadow:none!important;font-size:12px!important}.ep-drop{border:1px dashed var(--accent);border-radius:5px;padding:15px;text-align:center;font:12px system-ui;color:var(--accent);cursor:pointer;background:var(--surface-alt)}.ep-drop.drag{outline:3px solid var(--accent)}.ep-file{display:flex;align-items:center;gap:7px;padding:9px 0;border-bottom:1px solid var(--line);font:12px system-ui}.ep-file .ep-file-name{flex:1;min-width:0;overflow-wrap:anywhere}.ep-file small{display:block;color:var(--dim);margin-top:3px}.ep-file button{padding:4px 8px!important}.ep-file a{color:var(--accent)}.ep-selected-row{display:flex;gap:8px;align-items:center;font:11px system-ui;padding:7px 0;border-bottom:1px solid var(--line)}.ep-selected-row span{flex:1}.ep-selected-row button{padding:3px 6px!important}
.ep-footer{padding:11px 18px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:14px;background:var(--surface);flex:none}.ep-footer [role=status]{font:12px/1.4 system-ui;color:var(--dim);max-width:65%}.ep-primary{background:var(--accent)!important;color:var(--on-accent,#fff)!important;border:1px solid var(--accent)!important}.ep-close{font-size:18px!important;padding:4px 10px!important}.ep-pill{font:600 10px system-ui;padding:4px 8px;background:var(--surface-alt);border:1px solid var(--line);border-radius:4px;color:var(--accent)}
#epAux>.modal{display:flex;flex-direction:column;max-height:88vh;width:680px;max-width:96vw;padding:0;background:var(--surface);color:var(--text);border-radius:9px;overflow:hidden}#epAux>.modal.ep-picker{width:1050px;max-width:96vw}.ep-aux-body{padding:16px 20px;overflow:auto;min-height:0;font:13px/1.5 system-ui}.ep-aux-body .ep-search{margin-bottom:10px}.ep-aux-body table{width:100%;border-collapse:collapse;font-size:12px}.ep-aux-body th{position:sticky;top:0;background:var(--surface-alt)}.ep-aux-body th,.ep-aux-body td{padding:9px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}.ep-aux-body input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent)}.ep-picker-rows{max-height:50vh;overflow:auto}.ep-picker-rows tr:has(input:checked){background:var(--surface-alt)}.ep-picker-rows td:last-child{max-width:230px}.ep-status{font-size:12px;color:var(--accent);padding:7px 0}.ep-aux-body pre{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface-alt);padding:12px;font:12px/1.5 system-ui}.ep-receipt-details{display:grid;grid-template-columns:90px 1fr;gap:10px;font-size:12px}.ep-receipt-details dd{margin:0;overflow-wrap:anywhere}.ep-receipt-details dt{color:var(--dim)}.ep-receipt-banner{padding:12px;background:var(--surface-alt);border-left:3px solid var(--accent);margin-bottom:16px}
@media(max-width:900px){.ep-layout{grid-template-columns:minmax(0,1fr) minmax(320px,1fr);gap:10px;padding:10px}.ep-head h2{font-size:19px}.ep-head-actions select{max-width:190px}.ep-fields{grid-template-columns:1fr}.ep-head{padding:12px}.ep-mode-note{padding:6px 12px}.ep-envelope{padding:10px}.ep-scroll{padding:8px 12px}.ep-body{font-size:14px}}
@media(max-width:650px){#epOverlay{padding:5px}#epOverlay .ep-dialog{height:98vh;max-height:98vh;width:99vw}.ep-head{flex-wrap:wrap;gap:8px}.ep-head-actions{width:100%;justify-content:space-between}.ep-head-actions select{max-width:none;flex:1}.ep-mode-note{font-size:10px}.ep-layout{display:flex;flex-direction:column;overflow:auto}.ep-mail{flex:none;height:52vh;min-height:300px}.ep-form{overflow:visible;flex:none}.ep-fields{grid-template-columns:1fr 1fr}.ep-footer{padding:8px;gap:6px}.ep-footer [role=status]{max-width:45%;font-size:10px}.ep-actions{gap:5px}.ep-footer button{padding:7px!important;font-size:11px!important}#epPreviewBanner{font-size:10px;gap:5px}#epPreviewBanner button{font-size:10px}.ep-picker-rows{overflow:auto}.ep-picker-rows table{min-width:750px}}
.ep-head-actions>button{white-space:nowrap}body:has(#epOverlay:not([hidden])),body:has(#epAux:not([hidden])){overflow:hidden}
.ep-tablewrap{overflow:auto;max-width:100%}.ep-body .ep-tablewrap table{min-width:580px;table-layout:auto}.ep-body th:nth-child(-n+3),.ep-body td:nth-child(-n+3){white-space:nowrap;word-break:normal}
@media(prefers-reduced-motion:reduce){#epOverlay *,#epAux *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Email navigation: the active row and its glider share one state and duration.
   Exclude the generic 120ms button hover/focus shadow from these 480ms menu rows. */
html:not([data-theme="dc-diaochan"]) :is(#previewEmailMenu,[id^="emails-flyout-"]) :is(a,button){
 background:transparent!important;box-shadow:none!important;filter:none!important;
 outline:none!important;transform:none!important;
 transition:color var(--gdur) cubic-bezier(.22,1,.36,1)!important;
}
html:not([data-theme="dc-diaochan"]) :is(#previewEmailMenu,[id^="emails-flyout-"]) :is(a,button):not(.gl-hover){color:var(--text)!important}
html:not([data-theme="dc-diaochan"]) :is(#previewEmailMenu,[id^="emails-flyout-"]) .menu-glider.keyboard{outline:2px solid var(--accent);outline-offset:-2px}
@media(prefers-reduced-motion:reduce){:is(#previewEmailMenu,[id^="emails-flyout-"]) :is(a,button){transition:none!important}}

/* Recipients are editable where they appear in the envelope, for every template. */
.ep-recipient-row{margin-top:6px;align-items:start}
.ep-recipient-row>label{color:var(--dim);padding-top:5px;font-weight:500}
.ep-recipient-editor{display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-width:0;border:1px solid var(--line);border-radius:5px;padding:4px;background:var(--surface)}
.ep-recipient-editor:focus-within{outline:1px solid var(--accent)}
.ep-recipient-editor .ep-chips{display:contents}
.ep-recipient-editor .ep-chip{border-radius:4px;font-size:12px;line-height:20px;max-width:100%;box-sizing:border-box}
.ep-recipient-editor .ep-chip button{flex:none;min-width:22px;min-height:22px}
.ep-recipient-editor>input{flex:1;min-width:135px;width:160px;padding:4px;border:0!important;box-shadow:none!important;background:transparent!important;color:var(--text);font:12px system-ui;outline:none}
.ep-recipient-editor>button{padding:2px 7px!important;min-height:26px}
.ep-recipient-hint{font:11px/1.5 system-ui;color:var(--dim);margin:6px 0 0 50px}
.ep-body{min-height:80px}
.ep-scroll{padding-bottom:12px}
