/* The mailbox page, its letter and its new letter */
#mailBody tr { cursor: pointer; }
#mailBody tr.is-unread td { font-weight: 700; }
.mail-who { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject { display: block; max-width: 620px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--primary); }
.mail-more { padding: 12px; text-align: center; }
.mail-note { margin: 0; padding: 18px; color: var(--muted); }
#mailFolders b { margin-left: 4px; font-weight: 700; }
#mailFolders b:empty { display: none; }
#mailReadModal .modal { width: min(860px, 100%); }
#mailWriteModal .modal { width: min(720px, 100%); }
.mail-head-lines { margin: 0 0 10px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.mail-head-lines div { margin-bottom: 2px; }
.mail-head-lines span { color: var(--muted); }
.mail-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mail-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mail-files a, .mail-files span.mail-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 13px; overflow-wrap: anywhere; text-decoration: none; }
.mail-files button { padding: 0 2px; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.mail-images { margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.mail-images button { margin-left: 6px; }
/* a letter's own look stays inside its frame, on white, whatever the theme */
.mail-frame { display: block; width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mail-text { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: var(--text); }
.mail-write { display: flex; flex-direction: column; gap: 0; }
.mail-row { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); }
.mail-row.hidden { display: none; }
.mail-row label { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: 14px; }
.mail-row input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 6px 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font: inherit; outline: none; }
.mail-cc { flex: 0 0 auto; padding: 4px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.mail-cc:hover { color: var(--text); }
#mailWriteBody { display: block; width: 100%; min-height: 150px; margin-top: 10px; padding: 4px 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font: inherit; line-height: 1.5; resize: none; overflow: hidden; outline: none; }
.mail-sign { padding: 6px 0 10px; font-size: 14px; color: var(--text); }
.mail-sign.hidden, .mail-quoted.hidden { display: none; }
.mail-sign-dash { color: var(--muted); margin-bottom: 8px; }
.mail-sign img { display: block; max-width: 220px; max-height: 70px; margin-bottom: 10px; }
.mail-sign-text { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.mail-quoted { margin-bottom: 10px; padding: 8px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.mail-foot { position: sticky; bottom: -1px; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 0 2px; border-top: 1px solid var(--line); background: var(--panel-elevated); }
.mail-attach { cursor: pointer; }
.mail-write-head { display: flex; align-items: flex-start; gap: 8px; }
.cp-mail-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 8px; width: 100%; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cp-mail-row:last-child { border-bottom: 0; }
.cp-mail-row.is-unread b { font-weight: 800; }
.cp-mail-row small { grid-column: 2 / -1; color: var(--muted); overflow-wrap: anywhere; }
.cp-mail-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-mail-row time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 900px) {
  .mail-who, .mail-subject { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  #mailBody td:nth-child(2) { grid-column: 1 / -1; }
  #mailBody td:first-child { grid-column: 1 / -1; order: -1; }
  #mailBody td::before { display: none; }
  #mailBody tr { grid-template-columns: minmax(0, 1fr) auto; }
}
#view-mail th, #mailBody td { text-align: left; }
#mailBody td:last-child, #view-mail th:last-child { text-align: right; white-space: nowrap; }
