/*
 * Web mail client: stock stylesheet.
 *
 * Every color comes from the seven --wm-* tokens below; other shades are
 * mixed from them.  To recolor the app, create css/custom.css (it is
 * loaded after this file when it exists, and is never shipped) and
 * redefine the tokens there, for example:
 *
 *   :root { --wm-accent: #6a3d9a; }
 *   @media (prefers-color-scheme: dark) {
 *     :root:not([data-theme="light"]) { --wm-accent: #c7a6ea; }
 *   }
 *   :root[data-theme="dark"] { --wm-accent: #c7a6ea; }
 *
 * The dark set applies when the device prefers dark and the user has not
 * picked Light, or when the user picked Dark (data-theme on <html>).
 * Keep text and background tokens at a contrast ratio of 4.5:1 or more.
 * Class names are kept stable for deeper restyling.
 */

/* ---- Tokens ---- */
:root {
	--wm-accent: #1d6a87;
	--wm-bg: #eef2f3;
	--wm-surface: #fbfcfc;
	--wm-text: #1a2327;
	--wm-muted: #5a6a71;
	--wm-border: #d3dcdf;
	--wm-danger: #b3261e;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--wm-accent: #7cc0d8;
		--wm-bg: #101618;
		--wm-surface: #172024;
		--wm-text: #e2eaec;
		--wm-muted: #95a6ac;
		--wm-border: #2a373c;
		--wm-danger: #f2938a;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--wm-accent: #7cc0d8;
	--wm-bg: #101618;
	--wm-surface: #172024;
	--wm-text: #e2eaec;
	--wm-muted: #95a6ac;
	--wm-border: #2a373c;
	--wm-danger: #f2938a;
	color-scheme: dark;
}
:root[data-theme="light"] {
	color-scheme: light;
}

/* ---- Derived shades: plain tokens first, mixed where supported ---- */
:root {
	--wm-hover: var(--wm-bg);
	--wm-sel: var(--wm-bg);
	--wm-checked: var(--wm-bg);
	--wm-accent-soft: var(--wm-bg);
	--wm-danger-soft: var(--wm-bg);
	--wm-field: var(--wm-bg);
	--wm-skel: var(--wm-border);
	--wm-danger-line: var(--wm-danger);
	--wm-shadow-c: var(--wm-border);
	--wm-scrim: transparent;
	--wm-on-accent: var(--wm-surface);
	--wm-shadow: 0 10px 30px var(--wm-shadow-c), 0 1px 3px var(--wm-shadow-c);
	--wm-gut-l: env(safe-area-inset-left, 0px);
	--wm-gut-r: env(safe-area-inset-right, 0px);
	--wm-gut-t: env(safe-area-inset-top, 0px);
	--wm-gut-b: env(safe-area-inset-bottom, 0px);
}
@supports (color: color-mix(in srgb, currentColor 50%, transparent)) {
	:root {
		--wm-hover: color-mix(in srgb, var(--wm-text) 6%, var(--wm-surface));
		--wm-sel: color-mix(in srgb, var(--wm-accent) 14%, var(--wm-surface));
		--wm-checked: color-mix(in srgb, var(--wm-accent) 7%, var(--wm-surface));
		--wm-accent-soft: color-mix(in srgb, var(--wm-accent) 16%, var(--wm-surface));
		--wm-danger-soft: color-mix(in srgb, var(--wm-danger) 11%, var(--wm-surface));
		--wm-field: color-mix(in srgb, var(--wm-text) 5%, var(--wm-surface));
		--wm-skel: color-mix(in srgb, var(--wm-text) 10%, var(--wm-surface));
		--wm-danger-line: color-mix(in srgb, var(--wm-danger) 30%, var(--wm-surface));
		--wm-shadow-c: color-mix(in srgb, var(--wm-text) 20%, transparent);
		--wm-scrim: color-mix(in srgb, var(--wm-text) 38%, transparent);
	}
	@media (prefers-color-scheme: dark) {
		:root:not([data-theme="light"]) {
			--wm-shadow-c: color-mix(in srgb, var(--wm-bg) 85%, transparent);
			--wm-scrim: color-mix(in srgb, var(--wm-bg) 72%, transparent);
		}
	}
	:root[data-theme="dark"] {
		--wm-shadow-c: color-mix(in srgb, var(--wm-bg) 85%, transparent);
		--wm-scrim: color-mix(in srgb, var(--wm-bg) 72%, transparent);
	}
}

/* ---- Base ---- */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
	background: var(--wm-bg);
	color: var(--wm-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	overflow: hidden;
}
*, *::before, *::after { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--wm-accent); }
:focus { outline: 2px solid var(--wm-accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--wm-accent); outline-offset: 2px; }
.vh {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}
.i {
	width: 20px; height: 20px; flex: none;
	fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.i.sm { width: 16px; height: 16px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* The unsupported-browser block: shown when the app does not start.  It
   stays invisible while the modules load (app.js removes it as its first
   act); js/check.js, which runs after app.js, adds wm-failed to show it at
   once when the app did not start.  The delay below only covers check.js
   itself failing.  css/base.css styles the block without this file. */
#wm-unsupported { animation: wm-reveal 10s; }
#wm-unsupported.wm-failed { animation: none; }
@keyframes wm-reveal { from, to { visibility: hidden; } }

/* ---- Buttons ---- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 16px; border-radius: 8px;
	border: 1px solid var(--wm-border); background: var(--wm-surface); color: var(--wm-text);
	font-weight: 600; white-space: nowrap;
}
.btn.primary { background: var(--wm-accent); border-color: var(--wm-accent); color: var(--wm-on-accent); }
.btn.ghost { border-width: 0; background: none; }
.btn[disabled] { cursor: default; opacity: 0.7; }
.ib {
	display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
	border: 0; border-radius: 10px; background: none; color: var(--wm-muted); padding: 0;
}
.linkbtn {
	min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; background: none;
	color: var(--wm-accent); font-weight: 600;
}
@media (hover: hover) {
	.ib:hover, .tbtn:not([disabled]):hover { background: var(--wm-hover); color: var(--wm-text); }
	.btn:not(.primary):hover { background: var(--wm-hover); }
	.linkbtn:hover { text-decoration: underline; }
}

/* ---- App frame ---- */
#app {
	height: 100vh;
	height: 100dvh;
	display: flex; flex-direction: column;
}
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.banner {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none;
	padding: calc(4px + var(--wm-gut-t)) max(16px, var(--wm-gut-r)) 4px max(16px, var(--wm-gut-l));
	background: var(--wm-danger-soft); border-bottom: 1px solid var(--wm-border); font-size: 14px;
}
.banner .i { color: var(--wm-danger); }
/* The bar, when shown, sits above the view and takes the top safe area
   itself; the view below it then needs none */
#offline:not([hidden]) ~ .view { --wm-gut-t: 0px; }
.banner .grow { flex: 1 1 200px; min-width: 0; }

#shell {
	--wm-folders-def: 236px;
	--wm-list-def: 380px;
}
@media (max-width: 1100px) {
	#shell { --wm-folders-def: 208px; --wm-list-def: 320px; }
}

.topbar {
	display: grid; align-items: center; gap: 12px; flex: none;
	grid-template-columns: var(--wm-folders-w, var(--wm-folders-def)) minmax(0, 1fr) auto;
	min-height: 60px; background: var(--wm-surface); border-bottom: 1px solid var(--wm-border);
	padding: var(--wm-gut-t) max(12px, var(--wm-gut-r)) 0 max(12px, var(--wm-gut-l));
}
.brand { display: flex; align-items: center; min-width: 0; min-height: 44px; padding: 0 6px; }
.brand-name {
	font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--wm-text);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.brand-name img { max-height: 36px; vertical-align: middle; }
.acct { justify-self: end; grid-column: 3; }

/* Search, in the top bar */
.search { position: relative; display: flex; align-items: center; min-width: 0; max-width: 640px; grid-column: 2; }
.search input {
	width: 100%; height: 44px; border-radius: 22px; border: 1px solid var(--wm-field); background: var(--wm-field);
	padding: 0 92px 0 18px; font-size: 16px; min-width: 0;
}
.search input:focus { background: var(--wm-surface); border-color: var(--wm-border); }
.search input::-webkit-search-cancel-button { display: none; }
.search-btns { position: absolute; right: 0; top: 0; display: flex; }
.avatar-btn {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; border: 0; padding: 0;
	border-radius: 10px; background: none; color: var(--wm-on-accent); font-weight: 700; font-size: 16px;
}
.avatar-btn .face {
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	background: var(--wm-accent);
}
/* A Synchronet avatar (80 x 96 px of block art): a rounded rectangle as
   tall as the badge, its pixels kept sharp */
.face.art, .avatar.art { display: block; width: auto; background: none; border-radius: 6px; overflow: hidden; }
.face.art canvas, .avatar.art canvas {
	display: block; height: 100%; width: auto; image-rendering: pixelated;
}

.panes {
	flex: 1; min-height: 0; position: relative; display: grid;
	grid-template-columns:
		var(--wm-folders-w, var(--wm-folders-def))
		var(--wm-list-w, var(--wm-list-def))
		minmax(320px, 1fr);
}
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-bar {
	display: flex; align-items: center; gap: 4px; height: 56px; flex: none; min-width: 0;
	padding-left: max(8px, var(--wm-gut-l)); padding-right: max(8px, var(--wm-gut-r));
	border-bottom: 1px solid var(--wm-border); background: var(--wm-surface);
}
.pane-title {
	font-size: 17px; font-weight: 650; flex: 1; min-width: 0; margin: 0; padding: 0 6px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pane-title:focus { outline-offset: -2px; }
.ph-only { display: none !important; }

/* ---- Dividers (wide screens only) ---- */
.divider {
	position: absolute; top: 0; bottom: 0; z-index: 5; width: 12px; margin-left: -6px;
	cursor: col-resize; touch-action: none; background: none; border: 0; padding: 0;
}
.divider::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px;
}
.divider[data-pane="folders"] { left: var(--wm-folders-w, var(--wm-folders-def)); }
.divider[data-pane="list"] {
	left: calc(var(--wm-folders-w, var(--wm-folders-def)) + var(--wm-list-w, var(--wm-list-def)));
}
/* Without :focus-visible (Safari before 15.4) the plain :focus ring stays */
@supports selector(:focus-visible) {
	.divider:focus { outline: none; }
}
.divider:focus-visible::after, .divider.active::after { background: var(--wm-accent); }
@media (hover: hover) {
	.divider:hover::after { background: var(--wm-accent-soft); }
}
@media (pointer: coarse) {
	.divider { width: 24px; margin-left: -12px; }
	.divider::after { left: 11px; }
}
.drag-cover { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; cursor: col-resize; }
#shell.dragging { -webkit-user-select: none; user-select: none; }

/* ---- Folders ---- */
#folders { background: var(--wm-bg); overflow: auto; padding-bottom: 24px; }
#folders .pane-bar { display: none; }
.fnav { list-style: none; margin: 8px 0 0; padding: 0 8px 0 0; }
.fbtn {
	display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 0 12px 0 20px;
	border: 0; background: none; border-radius: 0 22px 22px 0; color: var(--wm-text); text-align: left;
}
.fbtn .name { flex: 1; min-width: 0; }
.fbtn .count { font-size: 13px; font-weight: 700; }
.fhead {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px;
	margin: 8px 0 0; padding: 0 8px 0 20px;
}
.fhead h3 { margin: 0; font-size: 13px; font-weight: 650; color: var(--wm-muted); }
.flimit { margin: 2px 12px 6px 20px; font-size: 12px; line-height: 1.4; color: var(--wm-muted); }
.flimit.warn { color: var(--wm-danger); font-weight: 600; }
.meter { display: grid; gap: 6px; margin: 18px 12px 0 20px; font-size: 13px; color: var(--wm-muted); }
.meter-bar { display: block; height: 6px; border-radius: 3px; background: var(--wm-skel); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--wm-accent); }
.meter-full { font-size: 12px; line-height: 1.4; color: var(--wm-danger); font-weight: 600; }
.powered { margin: 14px 12px 0 20px; font-size: 12px; line-height: 1.4; color: var(--wm-muted); }
.card .powered { margin: 0; text-align: center; }
.powered a { color: inherit; }
.fbtn .i { color: var(--wm-muted); }
.fbtn[aria-current="true"] { background: var(--wm-accent-soft); color: var(--wm-accent); font-weight: 650; }
.fbtn[aria-current="true"] .i { color: var(--wm-accent); }
@media (hover: hover) {
	.fbtn:not([aria-current="true"]):hover { background: var(--wm-hover); }
}

/* ---- List and reader ---- */
#list-pane {
	container-type: inline-size;
	background: var(--wm-surface);
	border-left: 1px solid var(--wm-border); border-right: 1px solid var(--wm-border);
}
.pane-title small { font-size: 13px; color: var(--wm-muted); font-weight: 500; margin-left: 8px; }

/* Bars above the list */
.folder-note, .searchinfo {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; min-width: 0;
	padding: 4px max(8px, var(--wm-gut-r)) 4px max(16px, var(--wm-gut-l));
	border-bottom: 1px solid var(--wm-border); font-size: 14px; color: var(--wm-muted);
}
.folder-note { padding-top: 8px; padding-bottom: 8px; background: var(--wm-field); }
.folder-note .grow { flex: 1 1 200px; min-width: 0; }
.folder-note .linkbtn { margin: -8px 0; }
.searchinfo { display: grid; gap: 2px; padding-bottom: 8px; }
.si-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.si-top .grow { flex: 1 1 auto; }
.si-top .linkbtn { flex: none; margin-right: -8px; }
.seg.scope { padding: 0; grid-template-columns: repeat(2, auto); justify-content: start; }
.seg.scope button { padding: 0 12px; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The list: rows placed by the script in a spacer as tall as all of them */
.list-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.list-scroll {
	flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain;
	scrollbar-color: var(--wm-border) var(--wm-surface);
}
/* focus shows on the focused control of a row; with none in the page, on
   the grid */
@supports selector(:focus-visible) {
	.list-scroll:focus { outline: none; }
	.list-body:focus, .list-state:focus { outline: none; }
}
.list-scroll:focus-visible { outline: 2px solid var(--wm-accent); outline-offset: -2px; }
.list-body:focus-visible, .list-state:focus-visible { outline: 2px solid var(--wm-accent); outline-offset: -2px; }
.list-spacer { position: relative; }
/* A row: checkbox, the message (a button), a delivery report button on
   some Sent rows, the star */
.row {
	position: absolute; top: 0; left: 0; right: 0;
	display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center;
	padding: 0 max(4px, var(--wm-gut-r)) 0 max(4px, var(--wm-gut-l));
	border-bottom: 1px solid var(--wm-border); background: var(--wm-surface);
}
.row.static { position: relative; }
.row.unread::before {
	content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
	border-radius: 0 3px 3px 0; background: var(--wm-accent);
}
.cell { display: flex; align-items: center; min-width: 0; }
.c-chk { justify-content: center; height: 44px; cursor: pointer; }
.c-star { justify-content: center; }
.c-note { padding: 0 2px; }
.chk { width: 20px; height: 20px; margin: 0; accent-color: var(--wm-accent); cursor: pointer; flex: none; }
.row-main {
	display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; width: 100%; padding: 10px 6px; margin: 0;
	border: 0; border-radius: 6px; background: none; color: inherit; text-align: left; cursor: pointer;
}
.row-main:focus-visible, .row .ib:focus-visible, .notice-btn:focus-visible {
	outline: 2px solid var(--wm-accent); outline-offset: -2px;
}
.row.checked { background: var(--wm-checked); }
.row.cur { background: var(--wm-sel); }
/* muted text falls just short of 4.5:1 on the selection's shade */
.row.cur .date, .row.cur .marks, .row.cur .tag:not(.danger):not(.high),
.row.checked .date, .row.checked .marks,
.row.checked .tag:not(.danger):not(.high) { color: var(--wm-text); }
@media (hover: hover) {
	.row:not(.cur):not(.skel):hover { background: var(--wm-hover); }
}
.ib.star[aria-pressed="true"] { color: var(--wm-accent); }
.ib.star[aria-pressed="true"] .i { fill: currentColor; }
.notice-btn { min-height: 44px; min-width: 44px; font-size: 13px; padding: 0 6px; }
.selall { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; }
.pane-bar.bulk { background: var(--wm-accent-soft); }
.bulk .pane-title { font-size: 15px; }
/* the count is never cut short: the bar's buttons move into More as the
   list pane narrows (mail.js bulkMore); without container queries all of
   them are in More */
.bulk .bulk-count { flex: 1 0 auto; overflow: visible; white-space: nowrap; }
.bulk-wide, .bulk-mid, .bulk-x { display: none !important; }
@container (min-width: 320px) {
	.bulk-x:not([hidden]) { display: inline-grid !important; }
}
@container (min-width: 360px) {
	.bulk-mid:not([hidden]) { display: inline-grid !important; }
}
@container (min-width: 470px) {
	.bulk-wide:not([hidden]) { display: inline-grid !important; }
}
.selall .chk:disabled { cursor: default; opacity: 0.4; }
.r1 { display: flex; align-items: center; gap: 6px; min-width: 0; height: 22px; overflow: hidden; }
/* the sender (or recipient) keeps at least 5em; the marks give way first */
.from { flex: 1 1 0; min-width: 5em; font-size: 15px; line-height: 22px; }
.date { flex: none; font-size: 12.5px; color: var(--wm-muted); }
.subj { font-size: 14px; line-height: 20px; height: 20px; }
.row.unread .from, .row.unread .subj { font-weight: 700; }
.row.unread .date { color: var(--wm-text); font-weight: 650; }
.marks {
	display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; overflow: hidden;
	color: var(--wm-muted);
}
.marks .tag { flex: 0 1 auto; min-width: 3em; }
.marks .mark { flex: none; }
.mark { display: inline-flex; }
.tag {
	display: inline-block; vertical-align: middle; font-size: 11.5px; font-weight: 650; line-height: 16px;
	padding: 0 6px; border-radius: 4px; border: 1px solid var(--wm-border); color: var(--wm-muted);
	white-space: nowrap; max-width: 10em; overflow: hidden; text-overflow: ellipsis;
}
.tag.danger { color: var(--wm-danger); background: var(--wm-danger-soft); border-color: var(--wm-danger-line); }
.tag.prio.high { color: var(--wm-danger); border-color: var(--wm-danger-line); }
.row .sk-lines { display: none; }
.row.skel .row-main { cursor: default; }
.row.skel .r1, .row.skel .subj { display: none; }
.row.skel .sk-lines { display: grid; gap: 10px; padding: 5px 0 4px; }
.list-skel .row { grid-template-columns: 44px minmax(0, 1fr); padding-top: 14px; padding-bottom: 14px; }
.list-skel .row .sk-lines { display: grid; gap: 10px; padding: 5px 6px 4px; }
.sk-box { width: 20px; height: 20px; border-radius: 4px; margin: auto; background: var(--wm-skel); }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--wm-skel); animation: wm-pulse 1.4s ease-in-out infinite; }
.sk:first-child { width: 45%; }
.sk:last-child { width: 80%; }
@keyframes wm-pulse { 50% { opacity: 0.45; } }
.list-state { flex: 1; min-height: 0; overflow: auto; }
.empty {
	display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px;
	color: var(--wm-muted);
}
.empty .badge {
	width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
	background: var(--wm-accent-soft); color: var(--wm-accent);
}
.empty .badge .i { width: 28px; height: 28px; }
.empty p { margin: 0; max-width: 34ch; line-height: 1.5; overflow-wrap: anywhere; }
.empty p.lead { font-size: 18px; font-weight: 650; color: var(--wm-text); }
.empty.failed .badge { background: var(--wm-danger-soft); color: var(--wm-danger); }
.busy { padding: 24px; color: var(--wm-muted); }

#reader { background: var(--wm-surface); container-type: inline-size; }
#reader .pane-bar { display: none; }
#reader.has-msg .pane-bar { display: flex; }
/* The reader's toolbar: icons, with their labels when the reader is wide */
.rtb { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.rtb .sep { width: 1px; height: 24px; background: var(--wm-border); margin: 0 4px; flex: none; }
.rtb .spacer { flex: 1; }
.tbtn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px;
	padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--wm-muted); flex: none;
	white-space: nowrap;
}
.tbtn[disabled] { cursor: default; opacity: 0.55; }
.tbtn[aria-pressed="true"] { color: var(--wm-accent); }
.tbtn[aria-pressed="true"] .i { fill: currentColor; }
.tbtn.danger { color: var(--wm-danger); }
.tb-label { display: none; }
@container (min-width: 760px) {
	.tb-label { display: inline; }
}
/* narrow: Reply all, Forward, Mark unread and spam move to More */
.tb-wide, .rtb .sep { display: none !important; }
@container (min-width: 520px) {
	.tb-wide:not([hidden]) { display: inline-flex !important; }
	.rtb .sep { display: block !important; }
}
.msg-expiry {
	margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--wm-field);
	color: var(--wm-text); font-size: 13.5px; line-height: 1.45;
}
/* Show original */
.orig-box { display: grid; gap: 8px; min-width: 0; }
.orig-head { margin: 0; font-size: 13px; font-weight: 650; color: var(--wm-muted); }
.orig {
	margin: 0; padding: 10px 12px; border: 1px solid var(--wm-border); border-radius: 8px; background: var(--wm-field);
	font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
	font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.dlg-text.muted { color: var(--wm-muted); font-size: 13.5px; }
/* Previous and next message, under the message on a phone */
.reader-nav {
	display: none; align-items: center; gap: 8px; flex: none; min-width: 0;
	padding: 6px max(8px, var(--wm-gut-r)) calc(6px + var(--wm-gut-b)) max(8px, var(--wm-gut-l));
	border-top: 1px solid var(--wm-border); background: var(--wm-surface);
}
.reader-nav .nav-btn { min-height: 44px; flex: none; }
.reader-nav .nav-pos {
	flex: 1; min-width: 0; text-align: center; color: var(--wm-muted); font-size: 14px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-btn.off, .tbtn.off { opacity: 0.4; cursor: default; }
.no-flex-gap .reader-nav > * + * { margin-left: 8px; }
.reader-empty {
	flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px;
	color: var(--wm-muted); text-align: center; padding: 24px;
}
.reader-empty .i { width: 40px; height: 40px; stroke-width: 1.3; }

/* The message */
.reader-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.msg { max-width: 840px; padding: 20px max(28px, var(--wm-gut-r)) 48px max(28px, var(--wm-gut-l)); }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 16px; }
.msg-subject {
	font-size: 22px; line-height: 1.3; font-weight: 650; margin: 0; min-width: 0; overflow-wrap: anywhere;
}
.msg-subject:focus { outline-offset: 4px; }
.msg-subject:focus:not(:focus-visible) { outline: none; }
.sender { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.avatar {
	width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
	background: var(--wm-accent-soft); color: var(--wm-accent); font-weight: 700;
}
.sender .who { min-width: 0; }
.sender .nm { font-weight: 650; overflow-wrap: anywhere; }
.sender .ad { color: var(--wm-muted); font-size: 13.5px; overflow-wrap: anywhere; }
.sender .when { color: var(--wm-muted); font-size: 13px; padding-top: 2px; text-align: right; }
.tome {
	display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px 0 0; margin-left: 52px;
	border: 0; background: none; color: var(--wm-muted); font-size: 13.5px; max-width: calc(100% - 52px);
	text-align: left;
}
.tome .i { flex: none; }
.tome[aria-expanded="true"] .i { transform: rotate(180deg); }
.details {
	display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 13.5px;
	padding: 10px 12px; margin: 0 0 6px; border: 1px solid var(--wm-border); border-radius: 8px;
}
.details dt { color: var(--wm-muted); }
.details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.failbox {
	display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 12px;
	border-radius: 8px; background: var(--wm-danger-soft);
}
.failbox .i { color: var(--wm-danger); margin-top: 1px; }
.failbox p { margin: 0; flex: 1 1 240px; min-width: 0; line-height: 1.45; }
.queuebox { background: var(--wm-field); }
.queuebox .i { color: var(--wm-muted); }
.msg-comment {
	margin: 14px 0 4px; padding: 10px 12px; border-left: 3px solid var(--wm-border);
	background: var(--wm-field); color: var(--wm-text); font-size: 13.5px; white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.msg-main { margin-top: 18px; }
.msg-note { color: var(--wm-muted); line-height: 1.5; display: grid; gap: 12px; justify-items: start; }
.msg-note p { margin: 0; }
.imgbar {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px;
	padding: 4px 4px 4px 12px; border-radius: 8px; background: var(--wm-field);
	font-size: 13.5px; color: var(--wm-muted);
}
.imgbar .grow { flex: 1 1 200px; min-width: 0; }
.imgbar .btn { white-space: normal; text-align: left; }
.seg.viewas { grid-template-columns: repeat(2, auto); justify-content: start; padding: 0; margin: 0 0 12px; }
.seg.viewas button { padding: 0 14px; }
.body { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.body.plain { white-space: pre-wrap; }
.body.mono {
	font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
	font-size: 14px; line-height: 1.2;
}
.body .q { color: var(--wm-muted); }
.quote-toggle { margin: 6px 0 0 -8px; }
.frame-slot { margin: 0 calc(-1 * max(28px, var(--wm-gut-r))) 0 calc(-1 * max(28px, var(--wm-gut-l))); }
.msg-frame { display: block; width: 100%; border: 0; border-top: 1px solid var(--wm-border); border-bottom: 1px solid var(--wm-border); }
.atts { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.att {
	display: flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0;
	border: 1px solid var(--wm-border); border-radius: 10px; padding: 4px 4px 4px 12px;
}
.att.gone { padding-right: 12px; }
.att .meta { display: grid; min-width: 0; padding-right: 6px; }
.att .meta span { font-size: 13.5px; font-weight: 600; }
.att .meta small { font-size: 12px; color: var(--wm-muted); }
.att .i.lead { color: var(--wm-accent); }
.att.gone .i.lead { color: var(--wm-muted); }

/* The image preview */
.preview-wrap {
	position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; place-items: center;
	background: var(--wm-scrim); padding: max(16px, var(--wm-gut-t)) max(16px, var(--wm-gut-r))
		max(16px, var(--wm-gut-b)) max(16px, var(--wm-gut-l));
}
.preview {
	display: flex; flex-direction: column; max-width: 100%; max-height: 100%; min-width: min(320px, 100%);
	background: var(--wm-surface); border: 1px solid var(--wm-border); border-radius: 12px;
	box-shadow: var(--wm-shadow); overflow: hidden;
}
.preview-bar {
	display: flex; align-items: center; gap: 4px; flex: none; min-height: 52px; padding: 0 4px 0 16px;
	border-bottom: 1px solid var(--wm-border);
}
.preview-bar h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 650; }
.preview-body { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 12px; }
.preview-body img { display: block; max-width: 100%; max-height: calc(100vh - 140px); height: auto; }
.preview-failed { margin: 24px; color: var(--wm-muted); }

/* ---- Popovers and notices ---- */
.scrim { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 45; background: none; }
.pop {
	position: fixed; z-index: 50; min-width: 240px; max-width: calc(100% - 16px);
	max-height: calc(100% - 80px); overflow: auto; padding: 6px;
	background: var(--wm-surface); border: 1px solid var(--wm-border); border-radius: 12px;
	box-shadow: var(--wm-shadow);
}
.pop hr { border: 0; border-top: 1px solid var(--wm-border); margin: 6px 0; }
.pop-head { padding: 8px 12px; min-width: 0; }
.pop-head b { display: block; overflow-wrap: anywhere; }
.pop-head small { color: var(--wm-muted); overflow-wrap: anywhere; }
.pop-label { font-size: 13px; color: var(--wm-muted); padding: 6px 12px 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 8px 4px; }
.seg button {
	min-height: 44px; border: 1px solid var(--wm-border); border-radius: 8px;
	background: var(--wm-surface); font-size: 14px; padding: 0 6px;
}
.seg button[aria-pressed="true"] {
	background: var(--wm-accent-soft); border-color: var(--wm-accent); color: var(--wm-accent); font-weight: 650;
}
.mi {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
	border: 0; border-radius: 8px; background: none; text-align: left; color: var(--wm-text);
}
.mi .i { color: var(--wm-muted); }
.mi:focus-visible { background: var(--wm-hover); }
@media (hover: hover) {
	.mi:hover { background: var(--wm-hover); }
}

/* Menus (a list of buttons, with a filter field for the folders) */
.menu { min-width: 220px; max-width: min(360px, calc(100% - 16px)); }
.menu-items { display: grid; }
.menu-filter {
	width: 100%; min-height: 44px; font-size: 16px; border: 1px solid var(--wm-border); border-radius: 8px;
	padding: 0 10px; margin: 0 0 4px; background: var(--wm-field); min-width: 0;
}
.pop .none { margin: 0; padding: 10px 12px; color: var(--wm-muted); font-size: 14px; overflow-wrap: anywhere; }
.mi.danger, .mi.danger .i { color: var(--wm-danger); }
.ib.danger { color: var(--wm-danger); }

/* Dialogs */
.dlg-wrap {
	position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 80; display: grid; place-items: center;
	background: var(--wm-scrim); padding: max(16px, var(--wm-gut-t)) max(16px, var(--wm-gut-r))
		max(16px, var(--wm-gut-b)) max(16px, var(--wm-gut-l));
}
.dlg {
	display: flex; flex-direction: column; width: 100%; max-width: 440px; max-height: 100%; min-height: 0;
	background: var(--wm-surface); border: 1px solid var(--wm-border); border-radius: 12px;
	box-shadow: var(--wm-shadow); overflow: hidden;
}
.dlg.wide { max-width: 760px; }
.dlg-head {
	display: flex; align-items: center; gap: 8px; flex: none; min-height: 52px; padding: 0 4px 0 18px;
	border-bottom: 1px solid var(--wm-border);
}
.dlg-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 650; min-width: 0; }
.dlg-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; display: grid; gap: 12px; }
.dlg-text { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.dlg-err { margin: 0; color: var(--wm-danger); font-size: 14px; font-weight: 600; }
.dlg-foot {
	display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: none;
	padding: 10px 18px 14px;
}
.btn.danger { background: var(--wm-danger); border-color: var(--wm-danger); color: var(--wm-on-accent); }
a.btn { text-decoration: none; }
a.btn:not(.primary):not(.danger) { color: var(--wm-text); }

.toast-region {
	position: fixed; z-index: 70; left: 0; right: 0; bottom: calc(24px + var(--wm-gut-b));
	display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.toast {
	display: flex; align-items: center; gap: 8px; max-width: 100%; min-height: 48px; padding: 2px 16px;
	background: var(--wm-text); color: var(--wm-surface); border-radius: 10px; box-shadow: var(--wm-shadow);
	pointer-events: auto;
}
.toast span { min-width: 0; }
.toast button {
	margin-right: -12px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; background: none;
	color: inherit; font-weight: 750; text-decoration: underline; text-underline-offset: 3px;
}
.toast button:focus-visible { outline-color: var(--wm-surface); }

/* ---- Sign-in ---- */
#login {
	overflow: auto; display: grid; place-items: center;
	padding: max(24px, var(--wm-gut-t)) max(16px, var(--wm-gut-r)) max(24px, var(--wm-gut-b)) max(16px, var(--wm-gut-l));
}
.card {
	width: 100%; max-width: 400px; background: var(--wm-surface); border: 1px solid var(--wm-border);
	border-radius: 14px; padding: 28px 24px; display: grid; gap: 18px;
}
.card .brand { padding: 0; }
.card .brand-name { white-space: normal; overflow-wrap: anywhere; }
.card h1 { font-size: 20px; margin: 0; }
@supports selector(:focus-visible) {
	.card h1:focus { outline: none; }
}
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input {
	width: 100%; min-height: 44px; font-size: 16px; border: 1px solid var(--wm-border); border-radius: 8px;
	padding: 8px 10px; background: var(--wm-surface); min-width: 0;
}
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--wm-accent); flex: none; }
.hint { margin: -12px 0 0; font-size: 13px; color: var(--wm-muted); line-height: 1.45; }
.msgbox {
	display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px;
	font-size: 14px; line-height: 1.45;
}
.msgbox p { margin: 0; min-width: 0; }
.msgbox.err { background: var(--wm-danger-soft); color: var(--wm-danger); font-weight: 600; }
.msgbox.warn { background: var(--wm-danger-soft); color: var(--wm-text); }
.msgbox.warn .i { color: var(--wm-danger); }
.msgbox.info { background: var(--wm-field); color: var(--wm-text); }
.msgbox.info .i { color: var(--wm-accent); }
.card .btn.primary { width: 100%; min-height: 48px; font-size: 16px; }
.sysop { margin: 0; font-size: 14px; color: var(--wm-muted); line-height: 1.5; overflow-wrap: anywhere; }
.sysop:empty { display: none; }

/* ---- Contacts and settings: one view in place of the list and the
   reader (the aux pane; on a phone a pane of its own) ---- */
#aux { display: none; background: var(--wm-surface); border-left: 1px solid var(--wm-border); }
#shell[data-pane="aux"] #list-pane, #shell[data-pane="aux"] #reader,
#shell[data-pane="aux"] .divider[data-pane="list"] { display: none; }
#shell[data-pane="aux"] #aux { display: flex; grid-column: 2 / -1; }
.aux-nav { margin-top: 12px; }
.aux-host, .aux-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.aux-tools {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none;
	padding: 10px max(16px, var(--wm-gut-r)) 10px max(16px, var(--wm-gut-l)); border-bottom: 1px solid var(--wm-border);
}
.aux-search {
	flex: 1 1 200px; min-width: 0; height: 44px; border-radius: 22px; border: 1px solid var(--wm-field);
	background: var(--wm-field); padding: 0 16px; font-size: 16px;
}
.aux-search:focus { background: var(--wm-surface); border-color: var(--wm-border); }
.aux-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: var(--wm-gut-b); }
.clist { list-style: none; margin: 0; padding: 0; }
.crow {
	display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
	padding: 12px max(8px, var(--wm-gut-r)) 12px max(16px, var(--wm-gut-l)); border-bottom: 1px solid var(--wm-border);
}
.cinfo { display: grid; gap: 2px; min-width: 0; }
.cname { margin: 0; font-size: 15px; font-weight: 650; line-height: 22px; }
.caddrs { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 20px; color: var(--wm-muted); }
.cnote { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cacts { display: flex; align-items: center; gap: 2px; }
.cwrite { padding: 0 12px; }
.form.settings {
	max-width: 660px; padding: 4px max(24px, var(--wm-gut-r)) 48px max(24px, var(--wm-gut-l));
	display: grid; gap: 0;
}
.set-sec { display: grid; gap: 12px; min-width: 0; padding: 20px 0; border-bottom: 1px solid var(--wm-border); }
.set-sec:last-child { border-bottom: 0; }
.set-head { margin: 0; font-size: 18px; font-weight: 650; }
.set-body { display: grid; gap: 12px; min-width: 0; }
.set-body > p, .set-sec .powered { margin: 0; line-height: 1.45; }
.field select, .field textarea {
	width: 100%; min-height: 44px; font-size: 16px; border: 1px solid var(--wm-border); border-radius: 8px;
	padding: 8px 10px; background: var(--wm-surface); min-width: 0;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.field input[disabled], .field textarea[disabled], .field select[disabled] { background: var(--wm-field); color: var(--wm-muted); }
.field-hint { margin: 0; font-size: 13px; color: var(--wm-muted); line-height: 1.45; }
.field-err { margin: 0; color: var(--wm-danger); font-size: 14px; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--wm-danger) !important; }
.set-actions, .set-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.set-row input { flex: 1 1 200px; width: auto; }
.set-status { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--wm-muted); }
.set-status:empty { display: none; }
.set-status.ok { color: var(--wm-text); }
.set-status.ok .i { color: var(--wm-accent); }
.set-status.err { color: var(--wm-danger); font-weight: 600; }
.set-seg { padding: 0; max-width: 420px; }
.set-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--wm-border); border-radius: 8px; }
.set-item {
	display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 12px;
	border-bottom: 1px solid var(--wm-border); min-width: 0;
}
.set-item:last-child { border-bottom: 0; }
.set-item span { flex: 1; }
.about-name { font-weight: 650; }
.dlg-form { display: grid; gap: 14px; }
@media (max-width: 599.98px) {
	.cw-label { display: none; }
	.cwrite { padding: 0; width: 44px; }
}

/* ---- Phone: one pane at a time ---- */
@media (max-width: 899.98px) {
	.ph-only { display: inline-grid !important; }
	.dt-only, .divider { display: none !important; }
	.panes { display: block; }
	.pane { display: none; height: 100%; }
	#shell[data-pane="folders"] #folders,
	#shell[data-pane="list"] #list-pane,
	#shell[data-pane="reader"] #reader { display: flex; }
	#shell:not([data-pane="list"]) .topbar { display: none; }
	.topbar { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; }
	.topbar { row-gap: 0; }
	.topbar .brand { grid-column: 1 / -1; min-height: 34px; padding: 6px 4px 0; }
	.topbar .brand-name { font-size: 16px; }
	.topbar .brand-name img { max-height: 28px; }
	.reader-nav:not([hidden]) { display: flex; }
	.search { grid-column: 1; max-width: none; }
	.acct { grid-column: 2; }
	#folders .pane-bar, #reader .pane-bar { display: flex; }
	.msg { padding: 16px max(16px, var(--wm-gut-r)) calc(40px + var(--wm-gut-b)) max(16px, var(--wm-gut-l)); }
	.frame-slot { margin: 0 calc(-1 * max(16px, var(--wm-gut-r))) 0 calc(-1 * max(16px, var(--wm-gut-l))); }
	.msg-subject { font-size: 20px; }
	.sender { grid-template-columns: 40px minmax(0, 1fr); }
	.sender .when { grid-column: 2; text-align: left; padding-top: 0; }
	.preview-wrap { padding: 0; }
	.preview { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0;
		padding: var(--wm-gut-t) var(--wm-gut-r) var(--wm-gut-b) var(--wm-gut-l); }
	#folders .pane-bar, #reader .pane-bar, #aux .pane-bar {
		height: calc(56px + var(--wm-gut-t)); padding-top: var(--wm-gut-t);
	}
	#aux { border: 0; }
	.form.settings { padding-left: max(16px, var(--wm-gut-l)); padding-right: max(16px, var(--wm-gut-r)); }
	#folders { background: var(--wm-surface); padding-bottom: calc(24px + var(--wm-gut-b)); }
	.fbtn { min-height: 48px; }
	#list-pane { border: 0; }
	.list-scroll, .list-state { padding-bottom: var(--wm-gut-b); }
	.row-main { padding-top: 12px; padding-bottom: 12px; }
	.toast-region { bottom: calc(16px + var(--wm-gut-b)); }
	.scrim { background: var(--wm-scrim); }
	.pop {
		left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none;
		max-height: 78%; border-radius: 16px 16px 0 0;
		padding: 8px max(8px, var(--wm-gut-r)) calc(10px + var(--wm-gut-b)) max(8px, var(--wm-gut-l));
	}
	.mi { min-height: 48px; }
	.dlg-wrap { place-items: end stretch; padding: 0; }
	.dlg { max-width: none; border-radius: 16px 16px 0 0; border-width: 1px 0 0;
		padding: 0 var(--wm-gut-r) var(--wm-gut-b) var(--wm-gut-l); max-height: 92%; }
	.dlg.wide { height: 100%; max-height: none; border-radius: 0; padding-top: var(--wm-gut-t); }
}

/* ---- Compose ---- */
.compose-btn {
	margin: 14px 12px 6px; min-height: 52px; border-radius: 14px; padding: 0 22px; justify-content: flex-start;
	box-shadow: 0 1px 2px var(--wm-shadow-c);
}
.fab { display: none !important; }
.fbtn .count.muted { color: var(--wm-muted); font-weight: 600; }
.mi[aria-pressed="true"], .mi[aria-pressed="true"] .i { color: var(--wm-accent); font-weight: 650; }
/* A docked panel at the bottom right; the whole screen on a phone */
.compose {
	position: fixed; right: max(24px, var(--wm-gut-r)); bottom: 0; z-index: 30;
	width: min(580px, calc(100% - 48px)); height: min(660px, calc(100% - 72px));
	display: flex; flex-direction: column; background: var(--wm-surface);
	border: 1px solid var(--wm-border); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: var(--wm-shadow);
}
.chead {
	display: flex; align-items: center; gap: 4px; flex: none; height: 52px;
	padding: 0 max(6px, var(--wm-gut-r)) 0 max(6px, var(--wm-gut-l));
	border-bottom: 1px solid var(--wm-border); background: var(--wm-field); border-radius: 12px 12px 0 0;
}
.chead h2 { margin: 0 0 0 8px; font-size: 15px; font-weight: 650; flex: 1; min-width: 0; }
.chead h2:focus:not(:focus-visible) { outline: none; }
.chead .tag { flex: none; }
.cbody { flex: 1; overflow: auto; min-height: 0; display: flex; flex-direction: column; overscroll-behavior: contain; }
.cf {
	position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: none;
	min-height: 48px; padding: 2px max(10px, var(--wm-gut-r)) 2px max(16px, var(--wm-gut-l));
	border-bottom: 1px solid var(--wm-border);
}
.cf > label { color: var(--wm-muted); width: 44px; flex: none; }
.cf input, .cf select {
	flex: 1 1 120px; min-width: 0; min-height: 44px; border: 0; background: none; font-size: 16px;
	padding: 0 4px; border-radius: 6px;
}
.cf select { flex-basis: 200px; background: var(--wm-surface); }
.cf input:focus-visible, .cf select:focus-visible, .cbody textarea:focus-visible { outline-offset: -2px; }
.cf input.rcpt { flex-basis: 80px; }
.chips { display: contents; list-style: none; }
.chip {
	display: inline-flex; align-items: center; max-width: 100%; min-width: 0; height: 34px; padding-left: 12px;
	border-radius: 17px; background: var(--wm-accent-soft); font-size: 14px;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip .ib { width: 40px; height: 44px; margin: -5px -2px; color: var(--wm-muted); }
.chip.bad { background: var(--wm-danger-soft); color: var(--wm-danger); box-shadow: inset 0 0 0 1px var(--wm-danger-line); }
.ccbcc { display: flex; margin-left: auto; }
.sugg {
	position: absolute; left: 60px; right: 12px; top: calc(100% - 2px); z-index: 5; list-style: none; margin: 0;
	padding: 6px; max-height: 300px; overflow: auto; background: var(--wm-surface);
	border: 1px solid var(--wm-border); border-radius: 10px; box-shadow: var(--wm-shadow);
}
.sugg li {
	display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; align-items: center;
	min-height: 52px; padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.sugg li[aria-selected="true"] { background: var(--wm-sel); }
@media (hover: hover) {
	.sugg li:hover { background: var(--wm-hover); }
	.sugg li[aria-selected="true"]:hover { background: var(--wm-sel); }
}
.sugg .avatar { width: 36px; height: 36px; font-size: 14px; grid-row: span 2; }
.sugg small { color: var(--wm-muted); font-size: 13px; }
.sugg li[aria-selected="true"] small { color: var(--wm-text); }
.cbody textarea {
	flex: 1 0 180px; border: 0; background: none; resize: none; font-size: 16px; line-height: 1.5;
	padding: 12px max(16px, var(--wm-gut-r)) 12px max(16px, var(--wm-gut-l)); min-width: 0;
}
.catts { display: grid; gap: 8px; margin: 0; list-style: none; padding: 8px max(12px, var(--wm-gut-r)) 10px max(16px, var(--wm-gut-l)); flex: none; }
.catt {
	display: grid; grid-template-columns: 20px minmax(0, 1fr) 44px; align-items: center; gap: 10px;
	padding: 2px 0 2px 12px; border: 1px solid var(--wm-border); border-radius: 8px;
}
.catt > .i { color: var(--wm-muted); }
.catt.failed { border-color: var(--wm-danger-line); }
.catt .meta { display: grid; min-width: 0; }
.catt .nm { font-size: 14px; font-weight: 600; }
.catt small { color: var(--wm-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.catt small.bad { color: var(--wm-danger); }
.prog { display: block; height: 4px; border-radius: 2px; background: var(--wm-skel); margin: 5px 0 3px; overflow: hidden; }
.prog span { display: block; height: 100%; width: 0; background: var(--wm-accent); }
.cfoot {
	display: flex; align-items: center; gap: 6px; flex: none;
	padding: 8px max(10px, var(--wm-gut-r)) 8px max(16px, var(--wm-gut-l)); border-top: 1px solid var(--wm-border);
}
.cfoot .status { color: var(--wm-muted); font-size: 13px; flex: 1; min-width: 0; }
.cbanner {
	display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; flex: none; margin: 8px 12px 4px;
	padding: 10px 12px; border-radius: 8px; background: var(--wm-danger-soft); font-size: 14px; line-height: 1.45;
}
.cbanner .i { color: var(--wm-danger); margin-top: 1px; }
.cbanner.info { background: var(--wm-field); }
.cbanner.info .i { color: var(--wm-accent); }
.cbanner p { margin: 0; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.cbanner-btns { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-left: 30px; }
.cdrop {
	display: none; position: absolute; top: 52px; right: 0; bottom: 0; left: 0; z-index: 6;
	place-content: center; justify-items: center; gap: 10px; font-weight: 650; color: var(--wm-accent);
	background: var(--wm-accent-soft); border: 2px dashed var(--wm-accent); border-radius: 0 0 0 0;
}
.cdrop .i { width: 32px; height: 32px; }
.compose.dropping .cdrop { display: grid; }
/* A draft being sent elsewhere: shown, not editable */
.compose.readonly .cf input, .compose.readonly textarea { color: var(--wm-muted); }
/* The Drafts folder */
.drafts-view { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.dlist { list-style: none; margin: 0; padding: 0; }
.drow {
	display: flex; align-items: center; padding: 0 max(4px, var(--wm-gut-r)) 0 max(8px, var(--wm-gut-l));
	border-bottom: 1px solid var(--wm-border);
}
.drow .row-main { flex: 1; min-width: 0; }
/* While the docked panel is open, notices sit at the left, clear of Send */
.wm-docked .toast-region { justify-content: flex-start; right: auto; width: calc(100% - min(580px, 100% - 48px) - 48px); min-width: 240px; padding-left: max(24px, var(--wm-gut-l)); }
.draft-row:focus-visible { outline: 2px solid var(--wm-accent); outline-offset: -2px; }
@media (hover: hover) {
	.drow:hover { background: var(--wm-hover); }
}
@media (max-width: 899.98px) {
	.compose-btn { display: none; }
	.fab {
		display: inline-flex !important; position: fixed; z-index: 20; right: max(16px, var(--wm-gut-r));
		bottom: calc(16px + var(--wm-gut-b)); min-height: 56px; padding: 0 22px; border-radius: 16px;
		box-shadow: var(--wm-shadow); font-size: 16px;
	}
	#shell:not([data-pane="list"]) .fab { display: none !important; }
	.toast-region { bottom: calc(84px + var(--wm-gut-b)); }
	.compose {
		top: 0; right: 0; bottom: auto; left: 0; width: auto; height: 100%; border: 0; border-radius: 0; z-index: 35;
		padding: var(--wm-gut-t) 0 var(--wm-gut-b);
	}
	.chead { border-radius: 0; height: 56px; }
	.cdrop { top: 56px; }
	.sugg { left: 8px; right: 8px; }
	.list-scroll, .drafts-view { padding-bottom: calc(88px + var(--wm-gut-b)); }
}
.no-flex-gap .chead > * + *, .no-flex-gap .cfoot > * + * { margin-left: 6px; }
.no-flex-gap .cbanner > * { margin: 0 10px 8px 0; }
.no-flex-gap .cbanner-btns > * { margin: 0 8px 8px 0; }
.no-flex-gap .ccbcc > * + *, .no-flex-gap .chip > * + * { margin-left: 4px; }
.no-flex-gap .cf > * { margin: 0 6px 0 0; }

/* ---- Flex gap fallback: browsers without gap in flex layout (Safari
   before 14.1) get margins instead; js/app.js sets no-flex-gap ---- */
.no-flex-gap .marks > * + *, .no-flex-gap .pane-bar > * + *, .no-flex-gap .tome > * + *,
.no-flex-gap .att > * + *, .no-flex-gap .preview-bar > * + * { margin-left: 4px; }
.no-flex-gap .r1 > * + * { margin-left: 6px; }
.no-flex-gap .btn > * + *, .no-flex-gap .si-top > * + *, .no-flex-gap .toast > * + *,
.no-flex-gap .msgbox > * + * { margin-left: 8px; }
.no-flex-gap .check > * + *, .no-flex-gap .failbox > * + * { margin-left: 10px; }
.no-flex-gap .mi > * + * { margin-left: 12px; }
.no-flex-gap .fbtn > * + * { margin-left: 14px; }
.no-flex-gap .aux-tools > * + *, .no-flex-gap .cacts > * + *, .no-flex-gap .set-actions > * + *,
.no-flex-gap .set-row > * + *, .no-flex-gap .set-item > * + *, .no-flex-gap .set-status > * + * { margin-left: 8px; }
.no-flex-gap .folder-note > * { margin: 0 8px 8px 0; }
.no-flex-gap .banner > *, .no-flex-gap .imgbar > *, .no-flex-gap .atts > * { margin: 0 10px 10px 0; }
.no-flex-gap .msg-head > * { margin: 0 10px 4px 0; }
.no-flex-gap .rtb > * + *, .no-flex-gap .dlg-head > * + * { margin-left: 2px; }
.no-flex-gap .fhead > * + *, .no-flex-gap .tbtn > * + *, .no-flex-gap .dlg-foot > * + * { margin-left: 8px; }

@media (prefers-reduced-motion: reduce) {
	*:not(#wm-unsupported), *::before, *::after {
		animation: none !important; transition: none !important; scroll-behavior: auto !important;
	}
}
