/*
 * Mailbox Reader styles — two-pane Gmail layout: a left rail plus a single main
 * pane that swaps between the conversation list and an opened conversation.
 * Vanilla CSS, no framework. @version 2.6
 */

.mbx-reader {
	display: flex;
	gap: 0;
	overflow: hidden;
	background: #fff;
	height: calc(100vh - 220px);
	min-height: 420px;
}

.mbx-reader * { box-sizing: border-box; }

/* ---- Left rail ---- */
.mbx-rail {
	flex: 0 0 220px;
	border-right: 1px solid #e4e7eb;
	background: #f7f9fb;
	overflow-y: auto;
	padding: 12px 0;
}
.mbx-rail-section { padding: 0 12px 16px; }
/* Scoped under .mbx-reader so the reader's own heading sizing wins over a host
 * theme's bare h1/h2 defaults (e.g. the kit's `body.jy-default h2`), which would
 * otherwise blow these labels up to a page-title size. */
.mbx-reader .mbx-rail-title {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #6b7280;
	margin: 0 0 8px;
	font-weight: 600;
}
.mbx-mailbox-list { list-style: none; margin: 0; padding: 0; }
.mbx-mailbox {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 7px 9px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 13px;
	color: #1f2933;
}
.mbx-mailbox:hover { background: #e9eef3; }
.mbx-mailbox.active { background: #d7e7fb; font-weight: 600; }
.mbx-mailbox-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Folder rail — the membership-driven folders under the active mailbox. */
.mbx-folders { list-style: none; margin: 0 0 4px 0; padding: 0; }
.mbx-folder {
	padding: 5px 9px 5px 22px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 12px;
	color: #3b4754;
}
.mbx-folder:hover { background: #eef2f6; }
.mbx-folder.active { background: #e3eefb; font-weight: 600; }
.mbx-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbx-badge {
	flex: 0 0 auto;
	min-width: 20px;
	text-align: center;
	background: #2563eb;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	border-radius: 10px;
	padding: 1px 6px;
}
.mbx-badge.zero { display: none; }
/* Protection-level badge (specs/mailbox_protection_ceremony.md). */
.mbx-level-badge {
	flex: 0 0 auto; font-size: 10px; font-weight: 600; border-radius: 8px;
	padding: 0 6px; margin-left: 4px;
}
.mbx-level-private { background: #d7e7fb; color: #1e40af; }
.mbx-level-fortress { background: #ede9fe; color: #5b21b6; }

.mbx-filters { display: flex; gap: 4px; margin-bottom: 10px; }
.mbx-filter {
	flex: 1;
	border: 1px solid #cfd6dd;
	background: #fff;
	color: #374151;
	font-size: 12px;
	padding: 5px 0;
	border-radius: 5px;
	cursor: pointer;
}
.mbx-filter.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.mbx-search {
	width: 100%;
	border: 1px solid #cfd6dd;
	border-radius: 5px;
	padding: 7px 9px;
	font-size: 13px;
}

/* ---- Main pane (swaps between list view and reading view) ---- */
.mbx-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.mbx-list-view {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}
.mbx-read-view {
	display: none;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}
/* When reading, the list is replaced by the conversation (Gmail-style). */
.mbx-reader.reading .mbx-list-view { display: none; }
.mbx-reader.reading .mbx-read-view { display: flex; flex-direction: column; }

.mbx-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-bottom: 1px solid #eef1f4;
}
.mbx-list-title { font-weight: 600; font-size: 14px; color: #111827; }
.mbx-list-header-actions { display: flex; align-items: center; gap: 6px; }
.mbx-new-btn {
	border: 1px solid #2563eb; background: #2563eb; color: #fff;
	border-radius: 16px; padding: 6px 14px; cursor: pointer;
	font-size: 12px; font-weight: 600;
}
.mbx-new-btn:hover { background: #1d4ed8; }
.mbx-new-btn[hidden] { display: none; }
.mbx-iconbtn {
	border: none; background: none; cursor: pointer;
	font-size: 16px; color: #6b7280; padding: 2px 6px; border-radius: 4px;
}
.mbx-iconbtn:hover { background: #eef1f4; color: #111827; }

.mbx-threads { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }

/* Gmail-style section bar (Unread / Starred / Everything else). */
.mbx-section {
	padding: 7px 14px;
	background: #f1f3f5;
	border-bottom: 1px solid #e4e7eb;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	position: sticky;
	top: 0;
	z-index: 1;
}

.mbx-thread-item {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 9px 14px;
	border-bottom: 1px solid #f1f3f5;
	cursor: pointer;
	font-size: 13px;
	background: #f6f8fb;          /* read rows sit on a faint grey, like Gmail */
}
.mbx-thread-item:hover {
	background: #fff;
	box-shadow: inset 1px 0 0 #d7e7fb, 0 1px 2px rgba(16,24,40,.08);
}
.mbx-thread-item.active { background: #eaf1fb; }
.mbx-thread-item.unread { background: #fff; }     /* unread rows pop on white */
.mbx-thread-star {
	flex: 0 0 auto;
	color: #c4c9d0;
	font-size: 15px;
	cursor: pointer;
	line-height: 1.2;
}
.mbx-thread-star.on { color: #f5b400; }

/* Sender — fixed left column so subjects line up across rows. */
.mbx-thread-from {
	flex: 0 0 168px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #1f2933;
}
/* Subject + snippet share one clipped line. */
.mbx-thread-mid {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mbx-thread-subject { color: #1f2933; }
.mbx-thread-snippet { color: #6b7280; }
.mbx-thread-ai { font-style: italic; }
.mbx-thread-item.unread .mbx-thread-from,
.mbx-thread-item.unread .mbx-thread-subject { font-weight: 700; }
.mbx-thread-time { flex: 0 0 auto; color: #9097a1; font-size: 11px; white-space: nowrap; }
.mbx-thread-count {
	display: inline-block;
	background: #e4e7eb;
	color: #4b5563;
	border-radius: 9px;
	font-size: 11px;
	padding: 0 6px;
	margin-left: 6px;
}
/* AI security scan badge (specs/joinery_ai_email_security_scan.md) — silent
   below score 3, since an unremarkable inbox is the common case. */
.mbx-danger-badge {
	display: inline-block;
	border-radius: 9px;
	font-size: 11px;
	font-weight: 700;
	padding: 0 6px;
	margin-left: 6px;
	white-space: nowrap;
}
.mbx-danger-badge.amber { background: #fef3c7; color: #92400e; }
.mbx-danger-badge.red   { background: #fee2e2; color: #991b1b; }

.mbx-list-footer { padding: 10px 14px; text-align: center; }
.mbx-more {
	border: 1px solid #cfd6dd; background: #fff; border-radius: 5px;
	padding: 6px 14px; cursor: pointer; font-size: 13px;
}

/* ---- Reading view ---- */
.mbx-thread { padding: 16px 20px; max-width: 900px; }
.mbx-thread-back {
	display: inline-flex; align-items: center; gap: 6px;
	border: none; background: none; cursor: pointer;
	color: #374151; font-size: 13px; padding: 4px 6px; border-radius: 4px;
	margin-bottom: 10px;
}
.mbx-thread-back:hover { background: #eef1f4; color: #111827; }
.mbx-thread-back .mbx-back-arrow { font-size: 17px; line-height: 1; }
.mbx-thread-header { margin-bottom: 14px; }
.mbx-reader .mbx-thread-header h1 { font-size: 18px; margin: 0 0 6px; color: #111827; }
.mbx-thread-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mbx-action {
	border: 1px solid #cfd6dd; background: #fff; color: #374151;
	border-radius: 5px; padding: 5px 11px; cursor: pointer; font-size: 12px;
	text-decoration: none;
}
.mbx-action:hover { background: #f1f3f5; }
.mbx-action.danger { color: #b42318; border-color: #f1c4bf; }
.mbx-action.danger:hover { background: #fef0ee; }

/* Move / Labels control (open-thread toolbar). */
.mbx-folder-ctl { position: relative; display: inline-block; }
.mbx-folder-panel {
	position: absolute; z-index: 20; top: calc(100% + 4px); left: 0;
	min-width: 180px; max-height: 260px; overflow-y: auto;
	background: #fff; border: 1px solid #cfd6dd; border-radius: 6px;
	box-shadow: 0 6px 18px rgba(16,24,40,.12); padding: 4px;
}
.mbx-folder-opt {
	display: flex; align-items: center; gap: 6px;
	padding: 6px 9px; border-radius: 5px; cursor: pointer; font-size: 12px; color: #374151;
}
.mbx-folder-opt:hover { background: #f1f3f5; }
.mbx-folder-opt.current { font-weight: 600; background: #e3eefb; }
.mbx-folder-newrow { display: flex; gap: 4px; padding: 6px; border-top: 1px solid #eef0f2; margin-top: 2px; }
.mbx-folder-newinput {
	flex: 1 1 auto; min-width: 0; border: 1px solid #cfd6dd; border-radius: 5px;
	padding: 5px 8px; font-size: 12px;
}
.mbx-folder-newbtn {
	flex: 0 0 auto; border: 1px solid #cfd6dd; background: #fff; border-radius: 5px;
	padding: 4px 10px; cursor: pointer; font-size: 14px; line-height: 1; color: #2563eb;
}
.mbx-folder-newbtn:hover { background: #f1f3f5; }
.mbx-folder-newbtn:disabled { opacity: .5; cursor: default; }

.mbx-message {
	border: 1px solid #e4e7eb;
	border-radius: 6px;
	margin-bottom: 12px;
	overflow: hidden;
}
.mbx-message-head {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	background: #f7f9fb;
	cursor: pointer;
	font-size: 13px;
}
.mbx-message-from { font-weight: 600; color: #1f2933; }
.mbx-message-meta { color: #6b7280; font-size: 12px; }
.mbx-message-time { color: #9097a1; font-size: 12px; white-space: nowrap; }
.mbx-message-right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

/* Per-message kebab (⋮) menu — Gmail-style "more" affordance. */
.mbx-kebab-wrap { position: relative; }
.mbx-kebab {
	border: none; background: none; cursor: pointer;
	font-size: 18px; line-height: 1; color: #6b7280;
	padding: 2px 6px; border-radius: 4px;
}
.mbx-kebab:hover { background: #e9eef3; color: #111827; }
.mbx-kebab-menu {
	position: absolute; right: 0; top: 100%; margin-top: 4px;
	background: #fff; border: 1px solid #d9dde2; border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
	min-width: 160px; padding: 4px 0; z-index: 10;
}
.mbx-kebab-menu[hidden] { display: none; }
.mbx-kebab-item {
	display: block; padding: 8px 14px; font-size: 13px;
	color: #1f2933; text-decoration: none; white-space: nowrap;
}
.mbx-kebab-item:hover { background: #f1f6fd; }
.mbx-message-body { padding: 12px; font-size: 14px; }
.mbx-message-body pre {
	white-space: pre-wrap; word-break: break-word; margin: 0;
	font-family: inherit;
}
.mbx-message-body iframe {
	width: 100%; min-height: 360px; border: 1px solid #e4e7eb; background: #fff;
}
.mbx-collapsed .mbx-message-body { display: none; }

/* AI security scan banner (specs/joinery_ai_email_security_scan.md). Sits
   between the head and the body as its own sibling, so a dangerous verdict
   stays visible even when the message is collapsed (mbx-collapsed only
   hides .mbx-message-body). */
.mbx-danger-banner {
	padding: 10px 12px;
	font-size: 13px;
	border-bottom: 1px solid #e4e7eb;
}
.mbx-danger-banner-head { font-weight: 700; margin-bottom: 4px; }
.mbx-danger-banner-flags { margin: 4px 0 0; padding-left: 18px; }
.mbx-danger-banner.safe {
	background: #f0fdf4; color: #166534; border-bottom-color: #dcfce7;
	font-size: 12px; padding: 6px 12px;
}
.mbx-danger-banner.suspicious { background: #fffbeb; color: #92400e; }
.mbx-danger-banner.dangerous  { background: #fef2f2; color: #991b1b; }

/* ---- Attachment chips (Gmail-style, below the content area) ---- */
.mbx-attachments {
	padding: 4px 12px 14px;
	border-top: 1px solid #f1f3f5;
}
.mbx-collapsed .mbx-attachments { display: none; }
.mbx-attachments-label {
	font-size: 12px; color: #6b7280; font-weight: 600;
	margin: 8px 0 6px;
}
.mbx-attachment-grid {
	display: flex; flex-wrap: wrap; gap: 8px;
}
.mbx-attachment {
	display: flex; align-items: center; gap: 10px;
	max-width: 260px;
	border: 1px solid #d7dee6; border-radius: 8px;
	padding: 8px 12px 8px 10px;
	background: #fbfcfd; text-decoration: none;
	color: #1f2933; transition: background .12s, border-color .12s, box-shadow .12s;
}
.mbx-attachment:hover {
	background: #eef4fd; border-color: #a9c6f2;
	box-shadow: 0 1px 3px rgba(16,24,40,.10);
}
.mbx-attachment-icon {
	flex: 0 0 auto; width: 30px; height: 30px;
	object-fit: contain;
	display: inline-flex; align-items: center; justify-content: center;
}
.mbx-attachment-icon--generic svg { width: 26px; height: 26px; }
.mbx-attachment-meta { min-width: 0; }
.mbx-attachment-name {
	font-size: 13px; font-weight: 600;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mbx-attachment-size { font-size: 11px; color: #6b7280; margin-top: 1px; }

/* Outbound (sent) messages read as the right-hand side of the dialog. */
.mbx-message.mbx-outbound { border-color: #cfe0fb; }
.mbx-message.mbx-outbound .mbx-message-head { background: #eef5ff; }
.mbx-sent-tag {
	display: inline-block; margin-left: 8px;
	background: #2563eb; color: #fff;
	font-size: 10px; font-weight: 700; letter-spacing: .03em;
	border-radius: 9px; padding: 1px 7px; vertical-align: middle;
}

.mbx-loading { color: #9097a1; font-size: 13px; padding: 14px; }

/* ---- Reply / Forward (Gmail-style: chips at the bottom of the conversation) ---- */
.mbx-reply-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 20px; }
.mbx-reply-btn {
	display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid #cfd6dd; background: #fff; color: #1f2933;
	border-radius: 18px; padding: 7px 16px; cursor: pointer; font-size: 13px;
}
.mbx-reply-btn:hover { background: #f1f6fd; border-color: #9fc2f5; }

/* ---- Compose box (rendered once, moved to the bottom of the open thread) ---- */
/* Inline card in the conversation flow — not an overlay. */
.mbx-compose {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #cfe0fb;
	border-radius: 8px;
	margin: 4px 0 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
/* An explicit display: above defeats the [hidden] attribute's display:none, so
   restore it for the hidden (default / discarded) state. */
.mbx-compose[hidden] { display: none; }
.mbx-compose-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 16px; border-bottom: 1px solid #eef1f4;
}
.mbx-compose-title { font-weight: 600; font-size: 15px; color: #111827; }
.mbx-compose-error {
	margin: 12px 16px 0;
	background: #fef0ee; border: 1px solid #f1c4bf; color: #b42318;
	border-radius: 5px; padding: 8px 11px; font-size: 13px;
}
/* The FormWriter form lives inside the panel. */
.mbx-compose form { padding: 14px 16px 20px; }
.mbx-compose .form-group { margin-bottom: 12px; }
.mbx-compose label.form-label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.mbx-compose input[type="text"],
.mbx-compose input[type="file"],
.mbx-compose select,
.mbx-compose textarea {
	width: 100%;
	border: 1px solid #cfd6dd;
	border-radius: 5px;
	padding: 8px 10px;
	font-size: 14px;
	font-family: inherit;
}
.mbx-compose textarea { resize: vertical; min-height: 160px; }
.mbx-compose button[type="submit"] {
	background: #2563eb; border: 1px solid #2563eb; color: #fff;
	border-radius: 5px; padding: 8px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.mbx-compose button[type="submit"]:hover { background: #1d4ed8; }
.mbx-compose button[type="submit"]:disabled { opacity: .6; cursor: default; }

/* ---- Compose attachments: pending chips + paperclip + drag-and-drop ---- */
.mbx-attach-strip {
	display: flex; flex-wrap: wrap; gap: 6px;
	padding: 0 16px 10px;
}
.mbx-attach-chip {
	display: inline-flex; align-items: center; gap: 6px;
	max-width: 220px;
	background: #eef1f4; border-radius: 14px;
	padding: 4px 6px 4px 10px; font-size: 12px; color: #1f2933;
}
.mbx-attach-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbx-attach-chip-size { color: #6b7280; flex: 0 0 auto; }
.mbx-attach-chip-remove {
	border: none; background: none; cursor: pointer; font-size: 13px;
	color: #6b7280; line-height: 1; padding: 2px 4px; border-radius: 50%;
}
.mbx-attach-chip-remove:hover { color: #b42318; background: #fff; }

.mbx-compose-actions {
	display: flex; align-items: center; gap: 8px;
	padding: 0 16px 16px;
}
.mbx-file-input { display: none; }
.mbx-attach-btn {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; color: #6b7280;
}
.mbx-attach-btn svg { width: 20px; height: 20px; display: block; }
.mbx-attach-btn:hover { background: #eef1f4; color: #111827; }
.mbx-compose-actions button[type="submit"] { margin-left: auto; }

/* Drag-and-drop affordance while a file is dragged over the open compose panel. */
.mbx-compose.mbx-compose-dragover {
	outline: 2px dashed #2563eb; outline-offset: -4px;
}

/* ---- Responsive: rail moves above the main pane on narrow screens ---- */
@media (max-width: 760px) {
	.mbx-reader { flex-direction: column; height: auto; min-height: 70vh; }
	.mbx-rail { flex-basis: auto; border-right: none; border-bottom: 1px solid #e4e7eb; }
	/* While reading on a small screen, hide the rail so the message gets full width. */
	.mbx-reader.reading .mbx-rail { display: none; }
}

/* Locked-state unlock affordances (specs/mailbox_security_levels.md § 4.1):
   a one-tap prompt shown when sealed content or search needs an open vault. */
.mbx-unlock-banner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.625rem 0.875rem;
	margin: 0.5rem 0;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 8px;
	font-size: 0.875rem;
}
.mbx-unlock-text { color: #7c2d12; }
.mbx-unlock-btn {
	margin-left: auto;
	padding: 0.35rem 0.85rem;
	border: none;
	border-radius: 6px;
	background: #2563eb;
	color: #fff;
	font-size: 0.8125rem;
	cursor: pointer;
}
.mbx-unlock-btn:disabled { opacity: 0.6; cursor: default; }

/* ── compose maturity: rich-text editor + Bcc toggle (§ Phase 1) ───────────── */
.mbx-bcc-toggle-row { margin: -0.25rem 0 0.35rem; }
.mbx-bcc-toggle {
	background: none;
	border: none;
	padding: 0;
	color: #2563eb;
	font-size: 0.8125rem;
	cursor: pointer;
}
.mbx-bcc-toggle:hover { text-decoration: underline; }

.mbx-richwrap { margin: 0.5rem 0; }
.mbx-rich-label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 0.25rem;
}
.mbx-toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	flex-wrap: wrap;
	padding: 4px 6px;
	border: 1px solid #cfd6dd;
	border-bottom: none;
	border-radius: 6px 6px 0 0;
	background: #f7f9fb;
}
.mbx-tb {
	min-width: 28px;
	height: 26px;
	padding: 0 7px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: none;
	color: #374151;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}
.mbx-tb:hover { background: #e9eef3; border-color: #cfd6dd; }
.mbx-tb:active { background: #d7e7fb; }
.mbx-tb-sep {
	width: 1px;
	height: 18px;
	margin: 0 4px;
	background: #d7dde3;
}
.mbx-rich {
	min-height: 160px;
	max-height: 420px;
	overflow-y: auto;
	padding: 0.6rem 0.7rem;
	border: 1px solid #cfd6dd;
	border-radius: 0 0 6px 6px;
	background: #fff;
	font-size: 0.9rem;
	line-height: 1.5;
	color: #1f2933;
}
.mbx-rich:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.mbx-rich img { max-width: 100%; height: auto; }
.mbx-rich blockquote {
	margin: 0 0 0 .8ex;
	padding-left: 1ex;
	border-left: 2px solid #cfd6dd;
	color: #52606d;
}
.mbx-rich.mbx-rich-empty::before {
	content: attr(data-placeholder);
	color: #9aa5b1;
	pointer-events: none;
}

/* ── compose maturity: drafts (§ Phase 2) ──────────────────────────────────── */
.mbx-drafts-entry .mbx-mailbox-addr { font-style: italic; }
.mbx-attach-chip.mbx-attach-saved {
	background: #eef2f6;
	border-color: #d7dde3;
	opacity: 0.85;
}
.mbx-attach-chip.mbx-attach-saved .mbx-attach-chip-name::before {
	content: "📎 ";
}

/* ── compose maturity: signatures (§ Phase 3) ──────────────────────────────── */
.mbx-mailbox { position: relative; }
.mbx-sig-gear {
	background: none;
	border: none;
	padding: 0 4px;
	margin-left: auto;
	font-size: 12px;
	line-height: 1;
	color: #9aa5b1;
	cursor: pointer;
	opacity: 0;
	transition: opacity .12s;
}
.mbx-mailbox:hover .mbx-sig-gear { opacity: 1; }
.mbx-sig-gear:hover { color: #2563eb; }
.mbx-sig-block { color: #52606d; }

.mbx-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(16, 24, 40, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.mbx-modal {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(16, 24, 40, .25);
	width: min(560px, 92vw);
	max-height: 88vh;
	overflow-y: auto;
	padding: 1.1rem 1.25rem 1rem;
}
.mbx-modal-title { margin: 0 0 .15rem; font-size: 1rem; color: #111827; }
.mbx-modal-help { margin: 0 0 .75rem; font-size: .8125rem; color: #6b7280; }
.mbx-sig-editor { min-height: 120px; max-height: 300px; }
.mbx-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: .5rem;
	margin-top: .9rem;
}
.mbx-action.mbx-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.mbx-action.mbx-primary:hover { background: #1d4ed8; }
.mbx-action.mbx-primary:disabled { opacity: .6; cursor: default; }

/* ── compose maturity: contacts autocomplete + manager (§ Phase 4) ─────────── */
.mbx-contacts-entry .mbx-mailbox-addr { font-style: italic; }
.mbx-ac-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 50;
	background: #fff;
	border: 1px solid #cfd6dd;
	border-radius: 0 0 6px 6px;
	box-shadow: 0 6px 18px rgba(16, 24, 40, .12);
	max-height: 240px;
	overflow-y: auto;
}
.mbx-ac-item {
	display: flex;
	flex-direction: column;
	padding: .35rem .6rem;
	cursor: pointer;
}
.mbx-ac-item.active, .mbx-ac-item:hover { background: #e3eefb; }
.mbx-ac-name { font-size: .85rem; color: #1f2933; }
.mbx-ac-addr { font-size: .75rem; color: #6b7280; }

.mbx-contacts-tools {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
	align-items: center;
	margin: .5rem 0 1rem;
}
.mbx-contacts-add {
	flex: 1 1 240px;
	padding: .45rem .6rem;
	border: 1px solid #cfd6dd;
	border-radius: 6px;
	font-size: .875rem;
}
.mbx-contacts-import { cursor: pointer; }
.mbx-contacts-list { display: flex; flex-direction: column; }
.mbx-contact-row {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .45rem .25rem;
	border-bottom: 1px solid #f1f3f5;
}
.mbx-contact-info { display: flex; flex-direction: column; flex: 1; }
.mbx-contact-name { font-size: .875rem; color: #1f2933; }
.mbx-contact-addr { font-size: .78rem; color: #6b7280; }
.mbx-contact-del {
	background: none;
	border: none;
	color: #9aa5b1;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 .4rem;
}
.mbx-contact-del:hover { color: #dc2626; }

/* ── compose maturity: member-context panel (§ Phase 5) ────────────────────── */
.mbx-context {
	flex: 0 0 260px;
	border-left: 1px solid #e4e7eb;
	background: #f7f9fb;
	padding: .75rem .85rem;
	overflow-y: auto;
	font-size: .85rem;
}
.mbx-context-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: .5rem;
}
.mbx-context-title { font-weight: 600; color: #111827; }
.mbx-context-card {
	background: #fff;
	border: 1px solid #e4e7eb;
	border-radius: 8px;
	padding: .6rem .7rem;
	margin-bottom: .75rem;
}
.mbx-context-name { font-weight: 600; color: #1f2933; }
.mbx-context-email { color: #52606d; font-size: .8rem; margin-top: .1rem; }
.mbx-context-since { color: #6b7280; font-size: .75rem; margin-top: .25rem; }
.mbx-context-link {
	display: inline-block;
	margin-top: .5rem;
	color: #2563eb;
	text-decoration: none;
	font-size: .8rem;
}
.mbx-context-link:hover { text-decoration: underline; }
.mbx-context-notmember { color: #6b7280; font-style: italic; }
.mbx-context-section {
	font-weight: 600;
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #9aa5b1;
	margin: .6rem 0 .3rem;
}
.mbx-context-row {
	display: flex;
	justify-content: space-between;
	gap: .5rem;
	padding: .2rem 0;
	color: #3b4754;
	border-bottom: 1px solid #eef1f4;
}
.mbx-context-muted { color: #6b7280; }
/* Hidden below a width breakpoint — the two panes take priority on narrow screens. */
@media (max-width: 1100px) {
	.mbx-context { display: none !important; }
}
