/* Invoice email composer: scoped so invoice documents keep their own styling. */
.drawer.email-composer { width:min(840px,100vw); --email-muted:#596273; }
html[data-theme="dark"] .email-composer { --email-muted:#b4bbc8; }
.email-composer .drawer-head { padding:24px; }
.email-composer .drawer-head h2 { font-size:22px; line-height:1.25; }
.email-composer .drawer-body { padding:24px; }
.email-composer .drawer-foot { padding:16px 24px; gap:10px; flex-wrap:wrap; }
.email-composer .drawer-foot .button { min-height:44px; font-size:14px; }
.email-composer .email-send-feedback { flex:1 0 100%; box-sizing:border-box; margin:0; padding:12px 14px; border:1px solid var(--blue); border-radius:8px; background:var(--paper); color:var(--ink); font-size:14px; line-height:1.5; white-space:pre-line; overflow-wrap:anywhere; max-height:160px; overflow:auto; }
.email-composer .email-send-feedback[data-kind="success"] { border-inline-start:4px solid var(--green); }
.email-composer .email-send-feedback[data-kind="warning"] { border-inline-start:4px solid var(--amber); }
.email-composer .email-send-feedback[hidden] { display:none; }
#email-template-form .email-template-note { margin:0 0 24px; padding:14px 16px; background:var(--paper); border:1px solid var(--line); color:var(--email-muted); border-radius:10px; font-size:13px; line-height:1.6; }
#email-template-form .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 24px; }
#email-template-form .field label { margin:0 0 8px; color:var(--ink); font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; line-height:1.4; }
#email-template-form .field :is(input,select,textarea) { min-height:44px; padding:10px 12px; border-radius:8px; font-size:14px; line-height:1.5; }
#email-template-form .field :is(input,textarea)::placeholder { color:var(--email-muted); }
#email-template-form .field textarea { min-height:190px; line-height:1.65; }
.email-other-options { margin-top:20px; font-size:14px; }
.email-other-options summary { cursor:pointer; }
.email-option-buttons { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
#email-template-form :is(.email-link-ready,.email-link-missing) { margin-top:24px; padding:16px; background:var(--paper); color:var(--ink); border:1px solid var(--line); border-radius:10px; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
#email-template-form .email-link-missing { border-inline-start:3px solid var(--amber); }
#email-template-form .email-link-ready { border-inline-start:3px solid var(--green); }
#email-template-form :is(.email-link-ready,.email-link-missing) strong { display:block; font-size:14px; font-weight:600; }
#email-template-form :is(.email-link-missing p,.email-link-ready span) { margin:6px 0 0; color:var(--email-muted); font-size:13px; line-height:1.6; }
#email-template-form .email-link-missing .button { margin-top:14px; min-height:44px; font-size:13px; }
#email-template-form .email-pdf-attachment { margin-top:20px; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); font-size:14px; }
#email-template-form .email-pdf-attachment strong { display:block; margin-bottom:8px; }
#email-template-form .email-pdf-attachment a { color:var(--blue); text-decoration:underline; overflow-wrap:anywhere; }
#email-template-form .email-pdf-attachment p,#email-template-form .email-draft-status { color:var(--email-muted); font-size:13px; line-height:1.6; margin:10px 0 0; }
/* Portal invoice paper remains light even when the staff theme is dark. */
.customer-invoice-toolbar { display:flex; align-items:center; gap:16px; flex-wrap:wrap; justify-content:flex-end; }
.customer-invoice-toolbar p { font-size:13px; line-height:1.5; color:#596273; }
html .customer-invoice-portal #public-print { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 16px; border:1px solid #0066cc; border-radius:10px; background:#0066cc; color:#fff; font-size:14px; font-weight:600; box-shadow:none; }
html .customer-invoice-portal #public-print:hover { background:#0054a8; border-color:#0054a8; color:#fff; }
html .customer-invoice-portal #public-print:focus-visible { outline:3px solid #0066cc; outline-offset:3px; }
html .customer-invoice-portal #public-print svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
html .customer-invoice-portal #public-print:disabled { opacity:.7; cursor:wait; }
@media(max-width:600px) {
  .customer-invoice-portal .public-bar { gap:16px; align-items:flex-start; }
  .customer-invoice-toolbar { gap:8px; }
  .email-composer .drawer-head,.email-composer .drawer-body { padding:20px 16px; }
  .email-composer .drawer-foot { padding:12px 16px; gap:8px; }
  .email-composer .drawer-foot .button { flex:1 1 auto; }
  .email-composer .drawer-foot .button.primary { flex-basis:100%; }
  #email-template-form .form-grid { grid-template-columns:minmax(0,1fr); }
  #email-template-form .field :is(input,select,textarea) { font-size:16px; }
}
