/* messages: bulk messaging and small polish. Uses the tokens in /app.css. */

/* Compose dialog */
.bm-compose { width: min(560px, calc(100vw - 32px)); }
.bm-compose form { gap: 12px; }
.bm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bm-head h2 { line-height: 1.25; }
.bm-to { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--tint); color: var(--deep); font-size: 13.5px; line-height: 1.4; }
.bm-to strong { font-weight: 700; }
.bm-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.bm-field textarea { width: 100%; min-height: 140px; max-height: 40vh; resize: vertical; font: 400 15px/1.55 Lato, sans-serif; }
.bm-count { margin-top: -6px; text-align: right; font-size: 12.5px; line-height: 1.3; color: var(--ink-4); }
.bm-count.near { color: var(--danger); }
.bm-preview { border-radius: var(--r-md); background: var(--sunken); padding: 12px 14px 14px; }
.bm-preview-label { margin-bottom: 10px; font-size: 11.5px; line-height: 1.3; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bm-msg { display: flex; gap: 10px; align-items: flex-start; }
.bm-msg-main { min-width: 0; flex: 1; }
.bm-msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; line-height: 1.4; color: var(--deep); }
.bm-msg-head span { font-size: 12.5px; color: var(--muted); }
.bm-msg-body { margin-top: 2px; max-height: 180px; overflow: auto; font-size: 14.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.bm-msg-body p { margin: 0 0 8px; }
.bm-msg-body p:last-child { margin-bottom: 0; }
.bm-msg-body .bm-empty { color: var(--ink-4); font-style: italic; }
.bm-send svg { flex: none; }

/* Sending progress and history, above the members table */
#bulk-msgs:empty { display: none; }
#bulk-msgs { display: grid; gap: 10px; margin: 0 0 14px; }
.bm-progress { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1); }
.bm-spin { width: 18px; height: 18px; margin-top: 2px; flex: none; border-radius: 50%; border: 2px solid var(--pale); border-top-color: var(--blue); animation: bm-spin 900ms linear infinite; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bm-spin { animation-duration: 3s; } }
.bm-progress-main { flex: 1; min-width: 0; }
.bm-progress-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; line-height: 1.4; color: var(--deep); }
.bm-progress-line .num { font-family: Lato, sans-serif; color: var(--ink-2); }
.bm-bar { height: 6px; margin: 8px 0 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bm-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width var(--dur-3) var(--ease-out); }
.bm-excerpt { font-size: 13px; line-height: 1.45; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-history { border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1); }
.bm-history summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; list-style: none; cursor: pointer; font-weight: 700; font-size: 14px; line-height: 1.4; color: var(--deep); }
.bm-history summary::-webkit-details-marker { display: none; }
.bm-history summary > svg:last-child { margin-left: auto; color: var(--muted); transition: transform var(--dur-1); }
.bm-history[open] summary > svg:last-child { transform: rotate(180deg); }
.bm-history summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
.bm-history-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--sunken); font-size: 12px; line-height: 1.5; text-align: center; color: var(--ink-2); font-family: Lato, sans-serif; }
.bm-history ul { list-style: none; margin: 0; padding: 0 16px 6px; max-height: 340px; overflow: auto; }
.bm-history li { padding: 12px 0; border-top: 1px solid var(--line); }
.bm-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; line-height: 1.4; }
.bm-sent { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ok); }
.bm-sent .num, .bm-skipped { font-family: Lato, sans-serif; }
.bm-skipped { color: var(--muted); }
.bm-meta { margin-left: auto; color: var(--muted); }
.bm-history li p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .bm-meta { margin-left: 0; flex-basis: 100%; }
  .bm-compose form { padding: 20px; }
}

