#mail-section { min-width: 0; }
#mail-section .mail-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
#mail-section .mail-page-head p { margin-top: 4px; }
#mail-section .mail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 18px; }
#mail-section .mail-card { display: grid; gap: 14px; min-width: 0; padding: 20px; }
#mail-section h3 { margin: 0; font-size: 16px; line-height: 1.5; }
#mail-section .mail-card > header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#mail-section .mail-state { color: var(--muted); font-size: 12px; background: #f0f3f1; padding: 3px 7px; border-radius: 5px; }
#mail-section .mail-state.mail-ready { color: #20573e; background: #e8f2eb; }
#mail-section fieldset { display: grid; gap: 14px; min-width: 0; padding: 0; margin: 0; border: 0; }
#mail-section .mail-config-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#mail-section .mail-check { display: flex; align-items: center; gap: 9px; min-height: 32px; }
#mail-section .mail-check input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--green); }
#mail-section .mail-compose-fields { display: grid; gap: 12px; }
#mail-section .mail-card .primary { justify-self: start; }
#mail-section .mail-card textarea { min-height: 174px; line-height: 1.6; }
#mail-section .message:not(:empty) { margin-top: 2px; }
#mail-section .mail-history { margin-top: 26px; }
#mail-section .mail-history > .list-head { flex-wrap: wrap; }
#mail-section .mail-table-wrap { overflow-x: auto; }
#mail-section table { table-layout: fixed; }
#mail-section .mail-jobs-table { min-width: 760px; }
#mail-section .mail-jobs-table th:nth-child(1) { width: 24%; }
#mail-section .mail-jobs-table th:nth-child(2) { width: 20%; }
#mail-section .mail-jobs-table th:nth-child(3) { width: 12%; }
#mail-section .mail-jobs-table th:nth-child(4) { width: 32%; }
#mail-section .mail-jobs-table th:nth-child(5) { width: 12%; }
#mail-section .mail-deliveries-table { min-width: 580px; }
#mail-section .mail-deliveries-table th:nth-child(1) { width: 20%; }
#mail-section .mail-deliveries-table th:nth-child(2) { width: 30%; }
#mail-section .mail-deliveries-table th:nth-child(3) { width: 14%; }
#mail-section .mail-deliveries-table th:nth-child(4) { width: 36%; }
#mail-section .mail-detail { margin-top: 16px; }
#mail-preview-dialog { width: min(680px, calc(100% - 32px)); overflow: auto; }
#mail-preview-dialog .list-head { align-items: start; }
#mail-preview-dialog > .field-hint { margin-top: 12px; }
#mail-preview-dialog h3 { margin-top: 18px; }
#mail-preview-dialog .mail-preview-subject { font-weight: 600; margin-top: 6px; }
#mail-preview-dialog .mail-preview-content { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; padding: 12px; background: #f3f7f4; border: 1px solid var(--line); border-radius: 6px; max-height: 240px; overflow: auto; line-height: 1.7; }
#mail-preview-dialog .mail-preview-list { font-size: 14px; }
#mail-preview-dialog .mail-preview-list li { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#mail-preview-dialog .mail-preview-list strong { font-weight: 550; }
#mail-preview-dialog .dialog-actions { margin-top: 18px; }
#mail-preview-dialog .message:not(:empty) { margin-top: 14px; }
@media (max-width: 760px) {
  #mail-section .mail-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #mail-section .mail-card { padding: 16px; }
  #mail-section .mail-card .primary { min-height: 44px; }
}
@media (max-width: 660px) {
  #mail-section .mail-table-wrap { overflow: visible; }
}
@media (max-width: 400px) {
  #mail-section .mail-config-grid { grid-template-columns: minmax(0, 1fr); }
  #mail-section .mail-page-head { align-items: start; }
}
