/* Email owns the page. Compose, exact preview and result share one paper. */
.workspace-shell { max-width:1440px; margin:auto; padding:24px 28px 14px; }
.workspace-shell.is-list { max-width:1680px; }
.email-workspace { max-width:1080px; margin:auto; }
.email-surface { min-width:0; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-soft); }
.email-surface > section, .email-surface > div { min-width:0; }
.email-surface [tabindex="-1"] { outline:none; }
.connection-notice { display:flex; align-items:center; gap:10px; min-height:20px; margin:0 0 12px; font-size:13px; color:var(--muted); }
.connection-notice strong { font-weight:500; }
.foundation-notice-mark { width:5px; height:5px; background:var(--accent); border-radius:50%; flex-shrink:0; }
.envelope-label, .sender-copy small, .email-preview-meta span { font-size:13px; color:var(--muted); font-weight:400; }
.sender-card { display:flex; gap:16px; align-items:center; padding:16px 26px; border-bottom:1px solid var(--line); }
.sender-copy { flex:1; display:flex; gap:14px; align-items:baseline; flex-wrap:wrap; min-width:0; }
.sender-copy small { min-width:58px; }
#senderName { font-weight:400; font-size:15px; overflow-wrap:anywhere; }
#senderEmail { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.sender-copy #senderEmail:empty { display:none; }
.to-editor { border-bottom:1px solid var(--line); }
.to-editor > summary { display:flex; align-items:center; gap:14px; list-style:none; cursor:pointer; min-height:56px; padding:12px 26px; }
.to-editor summary::-webkit-details-marker { display:none; }
.to-editor .envelope-label { min-width:58px; }
.to-editor > summary strong { font-size:15px; font-weight:400; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.to-edit-label { margin-left:auto; color:var(--accent-strong); font-size:12px; white-space:nowrap; }
.audience-editor { padding:0 26px 16px 98px; min-width:0; }
.audience-inspection-tools { display:flex; gap:20px; padding:0 26px 14px 98px; align-items:center; }
#closeAudienceButton { margin-left:auto; }
.audience-source-line { color:var(--muted); font-size:12px; margin-bottom:8px; overflow-wrap:anywhere; }
.audience-summary-row { display:flex; justify-content:flex-end; margin-bottom:8px; }
.recipient-mapping-summary { display:flex; justify-content:space-between; gap:12px; font-size:12px; color:var(--muted); margin:8px 0; }
.mapping-grid { display:grid; gap:8px; margin:8px 0 14px; }
.quick-field { display:flex; align-items:center; gap:12px; font-size:13px; }
.quick-field select { flex:1; min-width:0; }
.audience-table-shell { max-height:300px; overflow:auto; border:1px solid var(--line); }
.audience-table { border-collapse:collapse; min-width:100%; font-size:13px; }
.audience-table th { font-weight:450; background:var(--surface-soft); text-align:left; padding:9px 10px; white-space:nowrap; position:sticky; top:0; }
.audience-table td { border-top:1px solid var(--line); padding:0; }
.audience-table td:first-child { padding:0 8px; color:var(--muted-secondary); font-size:12px; }
.audience-cell-input { border:0; background:transparent; border-radius:0; display:block; min-width:130px; min-height:38px; max-height:90px; resize:none; white-space:pre; line-height:1.5; font-size:14px; padding:8px 10px; }
.recipient-person-label { display:none; }
.audience-table-shell.is-people { border:0; max-height:280px; }
.is-people .audience-table { width:100%; table-layout:fixed; }
.is-people .audience-table thead, .is-people .audience-table td:first-child { display:none; }
.is-people .audience-table tbody { display:grid; gap:12px; }
.is-people .audience-table tr { display:grid; grid-template-columns:minmax(85px,.7fr) minmax(150px,1.3fr) 36px; gap:12px; align-items:start; }
.is-people .audience-table td { border:0; min-width:0; padding:0; }
.is-people .recipient-person-label { display:block; color:var(--muted); font-size:12px; margin-bottom:6px; }
.is-people .audience-cell-input { width:100%; min-width:0; border:1px solid var(--line); border-radius:5px; min-height:40px; }
.is-people .recipient-remove { padding-top:23px; }
.audience-table-footer { display:flex; align-items:center; gap:10px; justify-content:space-between; font-size:12px; margin-top:10px; color:var(--muted); }
.recipient-tools, .recipient-pager, .recipient-undo { display:flex; align-items:center; gap:10px; }
.recipient-tools { margin-bottom:12px; flex-wrap:wrap; }
.recipient-tools input { flex:1; min-width:120px; width:0; min-height:36px; font-size:13px; }
.recipient-attention { border:1px solid var(--line); padding:8px 12px; color:var(--danger); font-size:13px; border-radius:5px; }
.recipient-attention[aria-pressed="true"] { border-color:var(--danger); background:var(--danger-soft); }
.audience-table .recipient-remove { position:sticky; right:0; min-width:36px; background:var(--surface); padding-inline:3px; }
.recipient-remove .icon-button { border:0; width:30px; height:34px; }
.recipient-cell-issue { display:block; padding:0 10px 6px; font-size:12px; line-height:1.4; color:var(--danger); max-width:260px; }
.audience-cell-input.is-email { min-width:200px; }
.audience-cell-input[aria-invalid="true"] { box-shadow:inset 2px 0 var(--danger); }
.recipient-pager { flex-wrap:wrap; font-size:12px; gap:7px; }
.recipient-no-matches { padding:12px; }
.recipient-undo { padding-top:12px; font-size:13px; color:var(--muted); }
.message-subject { display:flex; gap:14px; align-items:center; padding:6px 26px; border-bottom:1px solid var(--line); }
.message-subject .envelope-label { min-width:58px; }
.message-subject input { min-width:0; border:0; border-radius:0; padding-inline:0; font-size:17px; font-weight:400; }
.message-tools { display:flex; align-items:center; padding:10px 26px 0; }
.message-editor { display:block; width:100%; min-height:200px; height:clamp(200px,28vh,440px); border:0; padding:20px 26px 28px; border-radius:0; background:transparent; font-size:17px; font-weight:350; line-height:1.65; resize:vertical; }
.message-editor:focus { box-shadow:inset 3px 0 0 var(--accent-soft); }
.field-stack { display:flex; flex-direction:column; gap:7px; margin-bottom:16px; }
.field-stack > span { font-size:13px; color:var(--muted); }
.field-description, .action-note { color:var(--muted); font-size:13px; line-height:1.5; }
.action-note:empty { display:none; }
.email-action-bar { border-top:1px solid var(--line); padding:16px 26px; background:var(--surface-softer); }
.email-actions { display:flex; gap:18px; align-items:center; justify-content:space-between; }
.email-actions > .button { margin-left:auto; }
.compose-actions, .result-actions { display:flex; gap:10px; align-items:center; margin-left:auto; flex-shrink:0; }
.email-actions .action-note { max-width:60%; }
.preview-toolbar { display:flex; align-items:center; gap:16px; padding:12px 26px; border-bottom:1px solid var(--line); font-size:13px; color:var(--muted); }
.preview-toolbar > span { margin-left:auto; white-space:nowrap; }
.preview-navigation { display:flex; align-items:center; gap:6px; min-width:0; }
.preview-navigation select { width:min(230px,28vw); min-height:36px; font-size:13px; padding-block:5px; }
.email-preview-card { min-width:0; }
.email-preview-meta { padding:8px 26px; border-bottom:1px solid var(--line); }
.email-preview-meta > div { display:grid; grid-template-columns:58px minmax(0,1fr); gap:14px; padding:10px 0; align-items:baseline; }
.email-preview-meta strong { font-size:15px; font-weight:400; overflow-wrap:anywhere; }
.email-preview-meta > div:last-child strong { font-size:17px; }
.email-preview-body { min-height:300px; padding:24px 26px 32px; line-height:1.65; font-size:17px; font-weight:350; white-space:pre-wrap; overflow-wrap:anywhere; }
.issue-list { padding:14px 26px; border-bottom:1px solid var(--line); background:var(--danger-soft); }
.issue-item { font-size:13px; color:var(--danger); padding:7px 0; line-height:1.5; }
.issue-item:has(button) { display:flex; gap:12px; align-items:flex-start; }
.issue-item .text-action { margin-left:auto; flex-shrink:0; align-self:center; }
.recipient-issue-note { padding:12px 26px; color:var(--danger); background:var(--danger-soft); font-size:13px; line-height:1.5; }
.send-result { display:grid; gap:4px; min-width:0; }
.send-result strong { font-size:16px; font-weight:450; }
.send-result span { font-size:13px; color:var(--muted); }
.delivery-progress-track { height:3px; border-radius:2px; overflow:hidden; background:var(--line); margin:14px 0; }
.delivery-progress-track span { height:100%; display:block; width:0; background:var(--accent); transition:width .2s ease; }
.result-details { margin-top:10px; font-size:12px; color:var(--muted); }
.result-details > summary { cursor:pointer; width:max-content; }
.result-details p { line-height:1.5; margin-top:12px; }
.delivery-counts { display:flex; gap:20px; flex-wrap:wrap; margin:14px 0; }
.delivery-counts div { display:flex; gap:6px; flex-direction:row-reverse; }
.delivery-counts dd { margin:0; color:var(--ink); font-weight:450; }
.app-footer { display:flex; justify-content:center; padding:24px 0 6px; }
.app-footer img { width:28px; height:28px; object-fit:contain; opacity:1; }
.paste-panel { margin-bottom:16px; }
.panel-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:10px; }
.dialog-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px
}

.dialog-heading h2 {
  margin:0
}

.account-dialog fieldset {
  padding:0;
  border:0;
  margin:20px 0 0
}

.account-summary { display:grid; gap:5px; margin-top:22px; overflow-wrap:anywhere }
.account-summary .status-pill { justify-self:start; margin-bottom:10px }
.account-summary>strong { font-size:20px; font-weight:400 }
.account-summary .account-server { margin:12px 0 0; font-size:13px }
.account-tools { display:flex; flex-wrap:wrap; gap:12px 18px; padding:18px 0; margin-top:10px; border-block:1px solid var(--line) }
.account-summary .field-description { margin:10px 0 0 }
.account-dialog [aria-busy="true"] { cursor:progress }
.account-status:empty { display:none }

.account-grid {
  display:grid;
  grid-template-columns:1fr 1.2fr;
  gap:14px
}

.account-server-grid {
  display:grid;
  grid-template-columns:1.5fr 1fr;
  gap:14px
}

.account-dialog small {
  font-size:12px;
  color:var(--muted)
}

.account-status,.test-email-dialog [role="status"] {
  font-size:13px;
  line-height:1.5;
  margin:14px 0;
  color:var(--muted)
}

.account-status.is-error {
  color:var(--danger)
}

.account-status.is-success {
  color:var(--success)
}

.account-dialog p,.test-email-dialog p {
  font-size:14px;
  line-height:1.5;
  color:var(--muted)
}

.test-email-dialog { max-width:460px }
.test-email-from { display:flex; gap:12px; margin-top:16px; font-size:13px; overflow-wrap:anywhere }
.test-email-from span { color:var(--muted) }
.test-email-from strong { font-weight:400; min-width:0 }

.test-email-dialog h3 { font-size:18px; font-weight:500; margin:20px 0 8px }
.result-connection { display:flex; align-items:baseline; flex-wrap:wrap; gap:12px; margin-top:16px; font-size:13px; color:var(--muted) }
.result-connection p { margin:0 }
.result-connection p:empty { display:none }
.result-connection:has(p:empty):has(button[hidden]) { display:none }

