/* The Emails sub-tab of a firm's page (public/staff-pairing-emails.js):
   the choice of email and of who to preview it for, then the chosen
   email's panel, laid out as Sign-ups' Emails view is (.su-email-pick,
   .ae-templates, .attendance-email-actions, .ae-preview-box in
   styles.css). Only the staff site's own tokens and components: this file
   lays them out. */

.pe-intro { margin-bottom: 16px; }
.pe-panel .pe-pick { margin-bottom: 6px; }
.pe-email { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.pe-email-title { margin: 0 0 8px; }
.pe-email .hint { line-height: 1.45; }
.pe-email .field { margin-top: 12px; }
.pe-email .field small { display: block; margin-top: 6px; line-height: 1.45; }
.pe-email .field small code, .pe-placeholders code { color: var(--ink); }
.pe-email input, .pe-email textarea { width: 100%; }
.pe-email textarea { line-height: 1.5; resize: vertical; font-size: 0.95rem; }
.pe-email input[readonly], .pe-email textarea[readonly] { background: var(--blue-wash); color: var(--muted); }
.pe-readonly { color: var(--muted); }
.pe-placeholders { margin: 10px 0 0; }
.pe-placeholders summary { cursor: pointer; font-weight: 700; color: var(--blue); font-size: 0.9rem; }
.pe-placeholders ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; color: var(--muted); font-size: 0.9rem; }
.pe-actions { margin-top: 14px; }
.pe-said.error { color: var(--danger); }
.pe-standing { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; }
.pe-not-configured { margin: 0 0 8px; color: var(--danger); }

/* Sending: who to, the count, Send and Schedule send, then the row the
   latter opens; and the firm's scheduled sends under the panel. */
.pe-send { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pe-send .contract-sub { margin: 0 0 6px; }
.pe-send .hint { line-height: 1.45; }
.pe-send-pick { margin-top: 8px; }
.pe-send-pick .pe-expires { flex: 0 0 auto; }
.pe-send-pick .pe-expires input { width: auto; }
.pe-skip { margin: 8px 0 4px; }
.pe-count { margin: 6px 0 0; }
.pe-send-actions { margin-top: 10px; }
.pe-schedule { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 12px 0 0; background: var(--blue-wash); }
.pe-schedule .field { margin: 0 0 6px; }
.pe-schedule input { width: auto; }
/* Who a send goes from, how it looks, and the signature it ends with. */
.pe-sender { margin: 10px 0 12px; }
.pe-sender .field { margin: 0; }
.pe-from-pick { width: 100%; max-width: 520px; }
.pe-sender .hint { margin: 6px 0 0; line-height: 1.45; }
.pe-look { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 10px; margin: 0 0 12px; }
.pe-look legend { padding: 0 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pe-look-choice { display: flex; align-items: center; gap: 8px; margin: 4px 0; cursor: pointer; }
.pe-look input[type="radio"] { width: auto; margin: 0; }
.pe-look .hint { margin: 6px 0 0; line-height: 1.45; }
.pe-signature { margin: 0 0 12px; }
.pe-signature-why { background: var(--blue-wash); border: 1px solid var(--blue-pale); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; line-height: 1.45; }
.pe-signature-why .btn { margin-left: 6px; }
.pe-schedule .hint { margin: 0 0 10px; }
.pe-send-said { margin: 10px 0 0; }
.pe-send-said.error { color: var(--danger); }
.pe-scheduled { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pe-jobs { list-style: none; margin: 0; padding: 0; }
.pe-job { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pe-job:last-child { border-bottom: 0; }
.pe-job-when { color: var(--muted); font-size: 0.88rem; }
.pe-job-failed .pe-job-when { color: var(--danger); }
.pe-job-cancelled, .pe-job-sent { color: var(--muted); }
.pe-job .btn { margin-left: auto; }

@media (max-width: 760px) {
  .pe-email textarea, .pe-email input, .pe-schedule input { font-size: 16px; }
}

/* Attachments: the boxes under the panel, and the library at the foot. */
.pe-attachments { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pe-attachments .contract-sub { margin: 0 0 6px; }
.pe-attachment-list { margin: 8px 0 0; }
.pe-attachment { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
.pe-attachment .pm-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; }
.pe-attachment small { color: var(--muted); }
.pe-attachment-link { font-size: 0.88rem; }
.pe-attachment-actions { margin-top: 10px; }
.pe-attachments-said.error, .pe-upload-said.error { color: var(--danger); }
.pe-library { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pe-files { list-style: none; margin: 0; padding: 0; }
.pe-file { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pe-file:last-child { border-bottom: 0; }
.pe-file small, .pe-file-standard { color: var(--muted); font-size: 0.88rem; }
.pe-file .btn { margin-left: auto; }
.pe-file .btn + .btn { margin-left: 0; }
.pe-upload { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 12px; }
.pe-upload .field { margin: 0; }
.pe-upload input[type="file"] { width: auto; }

/* The email, part by part (3 November 2026): the wording boxes as part
   one, then what the site adds around them, read-only, in the look chosen
   under Send it; and, for the engagement emails, the answer page's two
   buttons. */
.pe-parts-title { margin: 14px 0 4px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pe-parts-note { margin: 0 0 8px; }
.pe-parts { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pe-part { padding: 10px 14px 12px; border-top: 1px solid var(--line); background: white; }
.pe-part:first-child { border-top: 0; }
.pe-part-wording { background: var(--blue-wash); }
.pe-part-wording .field:first-of-type { margin-top: 6px; }
.pe-part-head { margin: 0 0 4px; line-height: 1.45; }
.pe-part-source { color: var(--muted); font-size: 0.85rem; }
.pe-part-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; font: inherit; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.pe-answers { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 12px; margin: 14px 0 0; }
.pe-answers legend { padding: 0 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pe-answers .hint { margin: 0 0 6px; }
.pe-answer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 0 14px; align-items: end; padding: 6px 0 2px; }
.pe-answer .field { margin: 0; }
.pe-answer small { grid-column: 1 / -1; margin-top: 4px; }
.pe-answer + .pe-answer { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
/* Add email: the button beside Preview for, and the row it opens. */
.pe-add-holder { display: flex; flex-direction: column; justify-content: flex-end; }
.pe-add-form { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 10px; background: var(--blue-wash); }
.pe-add-form .hint { margin: 0 0 8px; line-height: 1.45; }
.pe-add-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.pe-add-row .field { margin: 0; flex: 1 1 220px; }
.pe-add-row .field input, .pe-add-row .field select { width: 100%; }
.pe-add-said { display: block; margin-top: 6px; }
.pe-add-said.error { color: var(--danger); }
/* A custom email's name and recipient, above its wording. */
.pe-custom-tag { font-size: 0.8rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
.pe-custom-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin: 10px 0 4px; }
.pe-custom-meta .field { margin: 0; }
.pe-custom-name { flex: 1 1 240px; }
.pe-custom-to { flex: 0 1 280px; }
.pe-custom-meta .pe-custom-added { flex: 1 1 100%; margin: 0; }
.pe-custom-said.error { color: var(--danger); }
@media (max-width: 760px) {
  .pe-answer { grid-template-columns: 1fr; }
}
