/* Mail: the folder list on the left, the open message or the message being written on the right. On a narrow
   screen the two stack, the list first. */

.mail__layout { display: grid; grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.mail__layout > .ui-card { margin: 0; min-width: 0; }
@media (max-width: 60rem) { .mail__layout { grid-template-columns: minmax(0, 1fr); } }

.mail__claim { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.mail__claim .field { width: 100%; max-width: 30rem; }
.mail__address { display: flex; align-items: center; gap: 0.35rem; }
.mail__address input { flex: 1 1 auto; min-width: 0; }
.mail__at { color: var(--rl-text-muted); white-space: nowrap; }
.mail__problem { color: var(--rl-danger); }
.mail__kept { color: var(--rl-text-muted); }

.mail__folders { max-width: 100%; flex-wrap: wrap; }
.mail__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.6rem; }
.mail__search {
    flex: 1 1 10rem; min-width: 0; min-height: var(--rl-control-h); padding: 0 0.6rem;
    border: 1px solid var(--rl-border); border-radius: 0.4rem; background: var(--rl-surface); color: var(--rl-text); font: inherit;
}
.mail__starred { margin: 0; white-space: nowrap; }

.mail__rows { list-style: none; margin: 0; padding: 0; }
.mail__row { display: flex; align-items: flex-start; border-bottom: 1px solid var(--rl-border); }
.mail__row:last-child { border-bottom: 0; }
.mail__row.is-open { background: color-mix(in srgb, var(--rl-accent) 10%, transparent); }
.mail__rowMain {
    flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.6rem;
    padding: 0.55rem 0.4rem 0.55rem 0; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.mail__rowMain:hover .mail__subject { text-decoration: underline; }
.mail__rowMain:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: -2px; }
.mail__who, .mail__subject, .mail__snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__who { color: var(--rl-text-muted); font-size: 0.85rem; }
.mail__when { color: var(--rl-text-muted); font-size: 0.8rem; white-space: nowrap; }
.mail__subject { grid-column: 1 / -1; }
.mail__snippet { grid-column: 1 / -1; color: var(--rl-text-muted); font-size: 0.85rem; }
.mail__row.is-unread .mail__who, .mail__row.is-unread .mail__subject { color: var(--rl-text); font-weight: 650; }
.mail__clip { width: 0.85rem; height: 0.85rem; vertical-align: -0.1rem; margin-left: 0.25rem; opacity: 0.7; }

.mail__star {
    flex: none; width: 2rem; height: 2.2rem; display: grid; place-items: center; background: none; border: 0;
    color: var(--rl-text-muted); cursor: pointer;
}
.mail__star svg { width: 1rem; height: 1rem; }
.mail__star.is-on { color: var(--rl-warn, #d9a441); }
.mail__star:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: -2px; }

.mail__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.15rem 0.75rem; margin: 0 0 0.75rem; }
.mail__head dt { color: var(--rl-text-muted); font-size: 0.85rem; }
.mail__head dd { margin: 0; overflow-wrap: anywhere; }
.mail__addr { margin-left: 0.35rem; }
.mail__checks { margin: 0 0 0.5rem; }

.mail__delivery { list-style: none; margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--rl-border); border-radius: 0.5rem; font-size: 0.9rem; }
.mail__delivery li { overflow-wrap: anywhere; }
.mail__delivery li.is-ok { color: var(--rl-ok, var(--rl-accent)); }
.mail__delivery li.is-bad { color: var(--rl-danger); }

.mail__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.25rem 0 0.9rem; }
.mail__frameBar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin-bottom: 0.4rem; }
/* The frame is white whatever the theme: a message is laid out by its sender for a white page. */
.mail__frame { display: block; width: 100%; height: min(70vh, 48rem); border: 1px solid var(--rl-border); border-radius: 0.5rem; background: #fff; }
.mail__text {
    margin: 0; padding: 0.75rem; border: 1px solid var(--rl-border); border-radius: 0.5rem; background: var(--rl-surface);
    white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 70vh; overflow: auto;
}

.mail__filesTitle { margin: 1rem 0 0.35rem; font-size: 0.95rem; }
.mail__files { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.mail__files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; overflow-wrap: anywhere; }

.mail .mail__wide { max-width: none; }
.mail__body { font: inherit; resize: vertical; }
.mail__tip { margin-top: 1rem; }

/* The list's second row: the filter, the tick boxes, and what to do with what is ticked. */
.mail__filter {
    flex: none; min-height: var(--rl-control-h); padding: 0 0.5rem;
    border: 1px solid var(--rl-border); border-radius: 0.4rem; background: var(--rl-surface); color: var(--rl-text); font: inherit;
}
.mail__everywhere { margin: 0; white-space: nowrap; }
.mail__bulk {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin-bottom: 0.4rem; padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rl-border);
}
.mail__pick { margin: 0 0.4rem 0 0; white-space: nowrap; color: var(--rl-text-muted); font-size: 0.85rem; }
.mail__check { flex: none; margin: 0.75rem 0.1rem 0 0.15rem; }
.mail__where { margin-left: 0.4rem; vertical-align: 0.05rem; }
.mail__more { display: flex; justify-content: center; padding: 0.75rem 0 0.1rem; }

/* Writing: the people a half-typed address might be, the formatting switch, and the assistant's line. */
.mail__copies { align-self: flex-start; margin: -0.3rem 0 0.6rem; font-size: 0.85rem; }
.mail__suggest { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: -0.3rem 0 0.7rem; }
.mail__person { cursor: pointer; font: inherit; font-size: 0.8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__person:hover { border-color: var(--rl-accent); }
.mail__person:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 1px; }
.mail__format { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin: -0.2rem 0 0.7rem; }
.mail__format .check { margin: 0; }
.mail__preview { height: min(40vh, 24rem); margin-bottom: 0.8rem; }
.mail__ai { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.9rem; }
.mail__ai input {
    flex: 1 1 auto; min-width: 0; min-height: var(--rl-control-h); padding: 0 0.6rem;
    border: 1px solid var(--rl-border); border-radius: 0.4rem; background: var(--rl-surface); color: var(--rl-text); font: inherit;
}
.mail__ai .btn, .mail__aiBar .btn { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.mail__ai svg, .mail__aiBar svg { width: 0.9rem; height: 0.9rem; }

/* Reading: what the assistant made of it, and the other messages of the conversation. */
.mail__aiBar { margin-top: -0.5rem; }
.mail__summary {
    margin: 0 0 0.9rem; padding: 0.6rem 0.8rem; border: 1px solid color-mix(in srgb, var(--rl-accent) 35%, var(--rl-border));
    border-radius: 0.5rem; background: color-mix(in srgb, var(--rl-accent) 7%, transparent);
}
.mail__summary p { margin: 0.25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail__thread { margin: 0 0 0.9rem; border: 1px solid var(--rl-border); border-radius: 0.5rem; padding: 0.4rem 0.7rem; }
.mail__thread summary { cursor: pointer; color: var(--rl-text-muted); font-size: 0.9rem; }
.mail__thread ul { list-style: none; margin: 0.35rem 0 0; padding: 0; }
.mail__thread li + li { border-top: 1px solid var(--rl-border); }
.mail__thread li button {
    width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.05rem 0.6rem; padding: 0.4rem 0;
    text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.mail__thread li button:disabled { cursor: default; }
.mail__thread li.is-open .mail__who { color: var(--rl-text); font-weight: 650; }
.mail__thread li button:hover:not(:disabled) .mail__snippet { text-decoration: underline; }
.mail__thread li button:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: -2px; }

/* Settings: plain sections under small headings, a rule as a boxed row of its conditions and what it does. */
.mail__setTitle { margin: 1.2rem 0 0.4rem; font-size: 0.95rem; }
.mail__setTitle:first-child { margin-top: 0; }
.mail__dates { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-top: 0.5rem; }
.mail__dates .field { max-width: 12rem; }
.mail__rule { margin: 0.6rem 0; padding: 0.6rem 0.75rem; border: 1px solid var(--rl-border); border-radius: 0.5rem; min-width: 0; }
.mail__ruleHead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
.mail__ruleHead .check { margin: 0; }
.mail__ruleHead input:not([type=checkbox]) { flex: 1 1 10rem; min-width: 0; }
.mail__ruleGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 0.75rem; }
.mail__ruleGrid .field { max-width: none; margin-bottom: 0.5rem; }
.mail__ruleDo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.mail__ruleDo .check { margin: 0; }
.mail__block { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.5rem; max-width: 30rem; }
.mail__block input { flex: 1 1 auto; min-width: 0; }
.mail__save { margin-top: 1.2rem; }
.mail__facts { margin: 0 0 0.5rem; padding-left: 1.1rem; }

/* A caution above a message or a draft: signs of a scam, a file that was spoken of and not added. */
.mail__warn {
    margin: 0 0 0.9rem; padding: 0.6rem 0.8rem; border: 1px solid color-mix(in srgb, var(--rl-danger, #d9534f) 55%, var(--rl-border));
    border-radius: 0.5rem; background: color-mix(in srgb, var(--rl-danger, #d9534f) 9%, transparent); overflow-wrap: anywhere;
}
.mail__warn p { margin: 0.25rem 0 0; }
.mail__warn ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.mail__warn .mail__actions { margin: 0.5rem 0 0; }
.mail__test { margin-left: 0.25rem; padding: 0.05rem 0.25rem; font-size: 0.85rem; max-width: 100%; }
.mail__import { flex-wrap: wrap; max-width: none; }

/* ---- The three parts of the page: folders, the list, the message. Thunderbird's three layouts lay them out. ---- */

.mail__app { display: grid; gap: 1rem; align-items: start; --mail-pad: 0.55rem; --mail-folders: 14.5rem; }
.mail__app > .ui-card, .mail__app > .mail__read > .ui-card { margin: 0; min-width: 0; }
.mail__folderPane { grid-area: folders; }
.mail__listPane { grid-area: list; min-width: 0; }
.mail__read { grid-area: read; min-width: 0; }
.mail__app--vertical { grid-template-columns: var(--mail-folders) minmax(19rem, 27rem) minmax(0, 1fr); grid-template-areas: "folders list read"; }
.mail__app--classic { grid-template-columns: var(--mail-folders) minmax(0, 1fr); grid-template-areas: "folders list" "folders read"; }
.mail__app--wide { grid-template-columns: var(--mail-folders) minmax(0, 1fr); grid-template-areas: "folders list" "read read"; }
.mail__app--nofolders.mail__app--vertical { grid-template-columns: minmax(19rem, 27rem) minmax(0, 1fr); grid-template-areas: "list read"; }
.mail__app--nofolders.mail__app--classic, .mail__app--nofolders.mail__app--wide { grid-template-columns: minmax(0, 1fr); grid-template-areas: "list" "read"; }
.mail__app--nofolders .mail__folderPane, .mail__app--noread .mail__read { display: none; }
.mail__app--noread.mail__app--vertical { grid-template-columns: var(--mail-folders) minmax(0, 1fr); grid-template-areas: "folders list"; }
.mail__app--noread.mail__app--nofolders.mail__app--vertical { grid-template-columns: minmax(0, 1fr); grid-template-areas: "list"; }
.mail__app--compact { --mail-pad: 0.22rem; }
.mail__app--relaxed { --mail-pad: 0.85rem; }
.mail__app--classic .mail__scroll, .mail__app--wide .mail__scroll { max-height: 42vh; overflow: auto; }
.mail__app--vertical .mail__scroll { max-height: calc(100vh - 13rem); min-height: 14rem; overflow: auto; }
@media (max-width: 70rem) {
    .mail__app.mail__app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "folders" "list" "read"; }
    .mail__app .mail__scroll { max-height: 60vh; }
}

/* The folders. One line each: a mark, the name, a count. */
.mail__folderPane { padding: 0.6rem 0.5rem; }
.mail__folderHead {
    display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin: 0.8rem 0.4rem 0.2rem;
    color: var(--rl-text-muted); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
}
.mail__folderHead:first-child { margin-top: 0.1rem; }
.mail__folderHead button { background: none; border: 0; color: var(--rl-text-muted); cursor: pointer; padding: 0 0.2rem; font: inherit; line-height: 1; }
.mail__folderHead button:hover { color: var(--rl-accent); }
.mail__folderList { list-style: none; margin: 0; padding: 0; }
.mail__folder {
    width: 100%; display: flex; align-items: center; gap: 0.45rem; padding: 0.32rem 0.5rem; border: 0; border-radius: 0.4rem;
    background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0;
}
.mail__folder:hover { background: color-mix(in srgb, var(--rl-accent) 8%, transparent); }
.mail__folder.is-on { background: color-mix(in srgb, var(--rl-accent) 16%, transparent); font-weight: 650; }
.mail__folder.has-unread .mail__folderName { font-weight: 650; }
.mail__folder:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: -2px; }
.mail__folder svg { flex: none; width: 1rem; height: 1rem; opacity: 0.8; }
.mail__folderName { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__folderCount { flex: none; font-size: 0.75rem; color: var(--rl-text-muted); font-variant-numeric: tabular-nums; }
.mail__folder.has-unread .mail__folderCount {
    color: var(--rl-accent-contrast, #fff); background: var(--rl-accent); border-radius: 1rem; padding: 0 0.4rem; font-weight: 650;
}
.mail__dot { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--dot, var(--rl-text-muted)); }
.mail__newFolder { display: flex; gap: 0.3rem; margin: 0.3rem 0.4rem; }
.mail__newFolder input { flex: 1 1 auto; min-width: 0; }

/* The tools of the list: a row of small buttons, the quick filter under it, then what is ticked. */
.mail__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin-bottom: 0.5rem; }
.mail__bar .mail__search { flex: 1 1 9rem; }
.mail__toggle {
    display: inline-flex; align-items: center; gap: 0.3rem; min-height: 1.9rem; padding: 0 0.6rem; border: 1px solid var(--rl-border);
    border-radius: 1rem; background: var(--rl-surface); color: var(--rl-text-muted); font: inherit; font-size: 0.82rem; cursor: pointer; white-space: nowrap;
}
.mail__toggle:hover { color: var(--rl-text); border-color: var(--rl-accent); }
.mail__toggle[aria-pressed="true"], .mail__toggle.is-on {
    background: color-mix(in srgb, var(--rl-accent) 18%, var(--rl-surface)); border-color: var(--rl-accent); color: var(--rl-text); font-weight: 650;
}
.mail__toggle.is-not { background: color-mix(in srgb, var(--rl-danger) 14%, var(--rl-surface)); border-color: var(--rl-danger); color: var(--rl-text); text-decoration: line-through; }
.mail__toggle:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 1px; }
.mail__toggle svg { width: 0.85rem; height: 0.85rem; }
.mail__qf {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; padding: 0.45rem 0.5rem;
    border: 1px solid var(--rl-border); border-radius: 0.5rem; background: color-mix(in srgb, var(--rl-accent) 4%, transparent);
}
.mail__qf input[type=search] { flex: 1 1 9rem; min-width: 0; min-height: 1.9rem; }
.mail__qfRow { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.mail__qfCount { margin-left: auto; color: var(--rl-text-muted); font-size: 0.82rem; white-space: nowrap; }

/* A menu that opens under its button, with nothing but a details element to open it. */
.mail__menu { position: relative; display: inline-block; }
.mail__menu > summary { list-style: none; cursor: pointer; }
.mail__menu > summary::-webkit-details-marker { display: none; }
.mail__menuBody {
    position: absolute; z-index: 30; top: calc(100% + 0.25rem); left: 0; min-width: 13rem; max-width: min(22rem, 86vw); max-height: 60vh; overflow: auto;
    padding: 0.35rem; border: 1px solid var(--rl-border); border-radius: 0.5rem; background: var(--rl-surface); box-shadow: var(--rl-shadow, 0 8px 24px rgb(0 0 0 / 0.25));
}
.mail__menu--right .mail__menuBody { left: auto; right: 0; }
.mail__menuBody button, .mail__menuBody a {
    width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border: 0; border-radius: 0.35rem; background: none;
    color: inherit; font: inherit; font-size: 0.9rem; text-align: left; text-decoration: none; cursor: pointer;
}
.mail__menuBody button:hover, .mail__menuBody a:hover { background: color-mix(in srgb, var(--rl-accent) 12%, transparent); }
.mail__menuBody button.is-on::after { content: "\2713"; margin-left: auto; color: var(--rl-accent); }
.mail__menuBody hr { margin: 0.3rem 0; border: 0; border-top: 1px solid var(--rl-border); }
.mail__menuBody h4 { margin: 0.3rem 0.5rem 0.15rem; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rl-text-muted); }
.mail__menuBody kbd { margin-left: auto; }

/* Rows: a card of two or three lines, or one line of a table. A heading where the list is grouped. */
.mail__row .mail__rowMain { padding-block: var(--mail-pad); }
.mail__row.is-cursor { box-shadow: inset 3px 0 0 var(--rl-accent); }
.mail__row.is-picked { background: color-mix(in srgb, var(--rl-accent) 7%, transparent); }
.mail__row.is-ignored .mail__rowMain { opacity: 0.55; }
.mail__group {
    display: flex; align-items: baseline; gap: 0.5rem; padding: 0.5rem 0.3rem 0.2rem; color: var(--rl-text-muted);
    font-size: 0.74rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; border-bottom: 1px solid var(--rl-border);
}
.mail__twisty {
    flex: none; width: 1.3rem; height: 2.2rem; display: grid; place-items: center; background: none; border: 0; color: var(--rl-text-muted);
    cursor: pointer; font-size: 0.7rem;
}
.mail__twisty:hover { color: var(--rl-accent); }
.mail__indent { flex: none; width: calc(var(--depth, 0) * 0.9rem); }
.mail__marks { display: inline-flex; gap: 0.2rem; margin-left: 0.3rem; color: var(--rl-text-muted); font-size: 0.8rem; }
.mail__tag {
    display: inline-block; max-width: 9rem; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 0.6rem; font-size: 0.72rem; line-height: 1.35;
    background: var(--tag, #7c8594); color: var(--tag-ink, #fff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: 0.08rem;
}
.mail__threadCount { margin-left: 0.35rem; padding: 0 0.35rem; border: 1px solid var(--rl-border); border-radius: 0.6rem; font-size: 0.72rem; color: var(--rl-text-muted); }
.mail__prio { color: var(--rl-danger); font-weight: 700; margin-right: 0.2rem; }
.mail__table { width: 100%; border-collapse: collapse; font-size: 0.88rem; table-layout: fixed; }
.mail__table th {
    position: sticky; top: 0; z-index: 1; padding: 0.3rem 0.4rem; text-align: left; font-size: 0.75rem; font-weight: 650; color: var(--rl-text-muted);
    background: var(--rl-surface); border-bottom: 1px solid var(--rl-border); white-space: nowrap;
}
.mail__table th button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.mail__table th button:hover { color: var(--rl-accent); }
.mail__table td { padding: var(--mail-pad) 0.4rem; border-bottom: 1px solid var(--rl-border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.mail__table tr.is-unread td { font-weight: 650; }
.mail__table tr.is-open td { background: color-mix(in srgb, var(--rl-accent) 10%, transparent); }
.mail__table tr.is-cursor td:first-child { box-shadow: inset 3px 0 0 var(--rl-accent); }
.mail__table tbody tr { cursor: pointer; }
/* A heading across the table is a cell of it, whole, whatever the cells under it cut short. */
.mail__table td.mail__group { display: table-cell; overflow: visible; text-overflow: clip; cursor: default; padding: 0.5rem 0.4rem 0.2rem; }
.mail__table .mail__star { height: auto; width: 1.4rem; }
.mail__cNarrow { width: 1.9rem; }
.mail__cWho { width: 26%; }
.mail__cDate { width: 5.6rem; }
.mail__cSize { width: 4.4rem; text-align: right; }

/* The open message: who it is from with a way to keep them, the notices above it, the full list of headers. */
.mail__known { background: none; border: 0; padding: 0 0.2rem; cursor: pointer; color: var(--rl-text-muted); vertical-align: -0.15rem; }
.mail__known.is-on { color: var(--rl-warn, #d9a441); }
.mail__known svg { width: 0.95rem; height: 0.95rem; }
.mail__note {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin: 0 0 0.9rem; padding: 0.55rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--rl-accent) 40%, var(--rl-border)); border-radius: 0.5rem;
    background: color-mix(in srgb, var(--rl-accent) 7%, transparent); overflow-wrap: anywhere;
}
.mail__note > div:first-child { flex: 1 1 18rem; min-width: 0; }
.mail__note p { margin: 0.15rem 0 0; }
.mail__note dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.1rem 0.7rem; margin: 0.3rem 0 0; }
.mail__note dt { color: var(--rl-text-muted); font-size: 0.85rem; }
.mail__note dd { margin: 0; }
.mail__allHeaders { margin: 0 0 0.9rem; max-height: 16rem; overflow: auto; border: 1px solid var(--rl-border); border-radius: 0.5rem; padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.mail__allHeaders table { border-collapse: collapse; width: 100%; }
.mail__allHeaders th { text-align: left; vertical-align: top; padding: 0.05rem 0.6rem 0.05rem 0; white-space: nowrap; color: var(--rl-text-muted); font-weight: 600; }
.mail__allHeaders td { overflow-wrap: anywhere; font-family: var(--rl-mono, ui-monospace, monospace); }

/* Writing: the address lines with what they might mean under them, the formatting buttons, the options. */
.mail__addrLine { position: relative; }
.mail__ac {
    position: absolute; z-index: 20; left: 0; right: 0; top: 100%; list-style: none; margin: 0.15rem 0 0; padding: 0.25rem; max-height: 16rem; overflow: auto;
    border: 1px solid var(--rl-border); border-radius: 0.5rem; background: var(--rl-surface); box-shadow: var(--rl-shadow, 0 8px 24px rgb(0 0 0 / 0.25));
}
.mail__ac button {
    width: 100%; display: flex; gap: 0.5rem; align-items: baseline; padding: 0.3rem 0.5rem; border: 0; border-radius: 0.35rem; background: none;
    color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.mail__ac button:hover, .mail__ac button.is-on { background: color-mix(in srgb, var(--rl-accent) 14%, transparent); }
.mail__ac small { color: var(--rl-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__fmt { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: -0.3rem 0 0.4rem; }
.mail__fmt button {
    min-width: 2rem; min-height: 1.9rem; padding: 0 0.45rem; border: 1px solid var(--rl-border); border-radius: 0.35rem; background: var(--rl-surface);
    color: var(--rl-text); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.mail__fmt button:hover { border-color: var(--rl-accent); }
.mail__opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0 0 0.8rem; }
.mail__opts .check { margin: 0; }
.mail__opts select, .mail__opts input[type=datetime-local] { min-height: 1.9rem; }
.mail__later { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 0.8rem; padding: 0.5rem 0.7rem; border: 1px dashed var(--rl-border); border-radius: 0.5rem; }

/* Settings and the address book: tabs along the top, and cards one to a line. */
.mail__tabs { margin-bottom: 0.9rem; flex-wrap: wrap; max-width: 100%; }
.mail__cards { list-style: none; margin: 0; padding: 0; }
.mail__card { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.2rem; border-bottom: 1px solid var(--rl-border); min-width: 0; }
.mail__card:last-child { border-bottom: 0; }
.mail__cardMain { flex: 1 1 auto; min-width: 0; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mail__cardMain strong, .mail__cardMain span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__cardMain span { color: var(--rl-text-muted); font-size: 0.85rem; }
.mail__avatar {
    flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
    background: var(--dot, var(--rl-accent)); color: #fff; text-transform: uppercase;
}
.mail__grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 0.9rem; }
.mail__grid2 .field { max-width: none; }
.mail__term { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.4rem; }
.mail__term select, .mail__term input { min-height: 1.9rem; min-width: 0; }
.mail__term input { flex: 1 1 8rem; }
.mail__tagRow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.mail__tagRow input[type=text] { flex: 1 1 8rem; min-width: 0; }
.mail__tagRow input[type=color] { width: 2.2rem; height: 1.9rem; padding: 0; border: 1px solid var(--rl-border); border-radius: 0.35rem; background: none; }
.mail__keys { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.mail__keys th { text-align: left; padding: 0.7rem 0 0.2rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rl-text-muted); }
.mail__keys td { padding: 0.18rem 0; border-bottom: 1px solid var(--rl-border); }
.mail__keys td:last-child { text-align: right; white-space: nowrap; }
.mail kbd {
    display: inline-block; padding: 0.02rem 0.35rem; border: 1px solid var(--rl-border); border-bottom-width: 2px; border-radius: 0.3rem;
    background: var(--rl-surface); font: 0.78rem var(--rl-mono, ui-monospace, monospace); color: var(--rl-text-muted);
}
.mail__undo { margin-left: auto; }
