.page-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
}

.email-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 780px) {
    .email-layout { grid-template-columns: 1fr; }
}

/* ── Recipients ── */
.recipients-section h2,
.compose-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.quick-select {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.selected-count {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.recipient-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 520px;
    overflow-y: auto;
    background: var(--bg-card);
}

.recipient-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 10px 12px 4px;
}

.recipient-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    border-radius: 4px;
}

/* Hover: a subtle blend that's darker than the card in light mode and
   lighter than the card in dark mode. Direction-correct in both. */
.recipient-row:hover { background: color-mix(in srgb, var(--text) 6%, var(--bg-card)); }

.recipient-name {
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 120px;
}

.recipient-email {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Compose ── */
.compose-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.compose-section label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-text {
    font-size: 13px;
    font-weight: 600;
}

.compose-section input[type="text"],
.compose-section textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}

.compose-section textarea { resize: vertical; }

.compose-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.email-actions { display: flex; justify-content: flex-end; }

.error {
    color: var(--danger);
    font-size: 13px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
    border-radius: 6px;
}

.send-ok   { color: var(--success); font-weight: 600; margin: 0 0 4px; }
.send-fail { color: var(--danger);  font-weight: 600; margin: 0; }

/* ── Buttons (match site style) ── */
button {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: var(--accent);
    color: white;
}

button:hover { background: var(--accent-hover); }
button:disabled { opacity: .6; cursor: default; }

button.secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

button.small { padding: 5px 12px; font-size: 13px; }

/* Small muted-text helper used inside .recipient-list for loading +
   empty-state messages. */
.recipient-list p.muted { color: var(--text-muted); padding: 10px 12px; margin: 0; }
