/*
 * Pošta as an app of the desk (js/shell/mail.js): its mark, the dialog of the connection, the window with the boxes,
 * the threads and a thread. Reading only.
 */
.mail-tile { width: 38px; height: 38px; flex: none; display: grid; }
.mail-tile--big { width: 56px; height: 56px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)); }
/* the red dot of the mark lights only while the inbox holds something unread (js/shell/mail.js watchMailUnread) */
.mail-mark__dot { display: none; }
body.has-mail-unread .mail-mark__dot { display: block; }
svg.mail-mark, svg.mc-mark { display: block; width: 100% !important; height: 100% !important; }
.desk-app--mail .desk-app__icon, .desk-app--metricool .desk-app__icon { background: none; border: 0; padding: 0; overflow: visible; }

.mail-points { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; line-height: 19px; color: var(--text); }
.mail-points b { color: var(--text-strong); }

.mail-win { grid-template-rows: auto minmax(0, 1fr); }
.mail-win .chrome .brand { width: auto; min-width: 200px; }
.mail-win .chrome .tools { gap: 8px; }
.mail-ro { padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--text-strong) 12%, transparent); color: var(--text-muted); font-size: 11px; line-height: 16px; white-space: nowrap; }
.mail-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; }
.mail-body[hidden] { display: none; }
.mail-boxes { display: grid; align-content: start; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--line); overflow-y: auto; }
.mail-box { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; font-size: 14px; line-height: 20px; color: var(--text); }
.mail-box:hover, .mail-box:focus-visible { background: color-mix(in srgb, var(--text-strong) 7%, transparent); color: var(--text-strong); }
.mail-box[aria-current="page"] { background: var(--nav-active-bg, var(--surface-2)); color: var(--nav-active-fg, var(--text-strong)); font-weight: 600; }
.mail-count { min-width: 20px; padding: 0 6px; border-radius: 99px; background: #ed1c24; color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }
.mail-page { min-height: 0; overflow-y: auto; padding: 18px 28px 32px; }
.mail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mail-head h2 { margin: 0; font-size: 20px; line-height: 28px; letter-spacing: -0.02em; min-width: 0; overflow-wrap: anywhere; }
.mail-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-l, 14px); background: var(--surface-1); overflow: hidden; }
.mail-row { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 20px; color: var(--text-muted); }
.mail-list > .mail-row:first-child { border-top: 0; }
.mail-row:hover, .mail-row:focus-visible { background: color-mix(in srgb, var(--text-strong) 6%, transparent); }
.mail-row__from { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.mail-row__from small { font-size: 11px; color: var(--text-muted); }
.mail-row__text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row__text b { font-weight: 500; color: var(--text); }
.mail-row__when { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail-row.is-unread .mail-row__from, .mail-row.is-unread .mail-row__text b { color: var(--text-strong); font-weight: 700; }
.mail-row.is-unread .mail-row__when { color: var(--text-strong); font-weight: 600; }
.mail-star { color: #edba37; }
.mail-empty { padding: 24px 4px; }
.mail-more { margin-top: 14px; }
.mail-thread { display: grid; gap: 12px; }
.mail-msg { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-l, 14px); background: var(--surface-1); }
.mail-msg.is-unread { border-color: var(--line-strong, var(--line)); }
.mail-msg__head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.mail-msg__head b { color: var(--text-strong); }
.mail-msg__head time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.mail-msg__to { margin: 2px 0 0; font-size: 12px; line-height: 16px; color: var(--text-muted); overflow-wrap: anywhere; }
.mail-msg__text { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 22px; color: var(--text); }
.mail-files { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.mail-files li { display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-strong); }
.mail-files small { font-size: 11px; color: var(--text-muted); }
@media (max-width: 820px) {
  .mail-win .chrome-bar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; height: auto; }
  .mail-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .mail-boxes { display: flex; gap: 6px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .mail-box { flex: none; min-height: 44px; }
  .mail-page { padding: 14px 12px 28px; }
  .mail-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'from when' 'text text'; gap: 2px 10px; min-height: 44px; }
  .mail-row__from { grid-area: from; }
  .mail-row__when { grid-area: when; }
  .mail-row__text { grid-area: text; }
  .mail-msg__head { flex-direction: column; gap: 2px; }
}

/* ---------- soft loading: content fades in, the shape of the page shimmers where nothing is known yet ---------- */
.mail-view { animation: mail-in 0.22s ease both; }
@keyframes mail-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mail-ghost { pointer-events: none; }
.mail-list--ghost .mail-row { cursor: default; }
.mail-bone { display: block; height: 10px; border-radius: 99px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--text-strong) 8%, transparent) 25%, color-mix(in srgb, var(--text-strong) 16%, transparent) 50%, color-mix(in srgb, var(--text-strong) 8%, transparent) 75%);
  background-size: 200% 100%; animation: mail-shimmer 1.4s ease-in-out infinite; }
.mail-bone--short { width: 38px; }
.mail-msg.mail-ghost { display: grid; gap: 12px; padding: 20px 18px; }
@keyframes mail-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
/* a quiet sign that the list is being renewed behind what is shown */
.mail-busy { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text-strong) 18%, transparent); border-top-color: var(--text-muted); animation: mail-spin 0.8s linear infinite; }
@keyframes mail-spin { to { transform: rotate(360deg); } }
.mail-row { transition: background 0.12s ease; }
@media (prefers-reduced-motion: reduce) {
  .mail-view, .mail-bone, .mail-busy { animation: none; }
}
/* the bar of the window as the bar of AI Bistro: the name takes the width of the side column, the search fills the
   row from the edge of the page, the address of the mailbox sits at the right end */
.mail-win:not(.mc-win) .chrome .brand { flex: none; width: 190px; min-width: 0; }
.mail-win:not(.mc-win) .hrm-searchform { flex: 1 1 auto; }
.mail-win .chrome .tools { margin-left: auto; }
.mail-user { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-1); font-size: 13px; line-height: 20px; white-space: nowrap; }
.mail-user[hidden] { display: none; }
.mail-user__face { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; background: #414042; }
.mail-user b { font-weight: 600; color: var(--text-strong); }
@container win (max-width: 1100px) { .mail-user b { display: none; } .mail-user { padding: 5px; } }
@media (max-width: 820px) { .mail-user b { display: none; } .mail-user { padding: 5px; } }
@media (max-width: 820px) { .mail-win:not(.mc-win) .hrm-searchform { flex: 1 1 100%; } .mail-win:not(.mc-win) .chrome .brand { flex: 1 1 0; width: auto; } }

/* the reply under a thread (14. 11. 2026): a quiet field, the main button in the blue of the system */
.mail-reply { display: grid; gap: 8px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-l, 14px); background: var(--surface-1); }
/* a new letter as a page of the window (15. 11. 2026); the frame of the form is the one of HRM (css/hrm.css) */
.mail-new { margin: 0; }
.mail-new__title { margin: 0; font-size: 18px; line-height: 24px; }
.mail-new .input, .mail-new .textarea { width: 100%; }
.mail-new .mail-new__fields[inert] { opacity: .6; }
.mail-box--new { font-weight: 600; margin-bottom: 6px; }
.mail-reply.is-staged { border-color: color-mix(in srgb, var(--sys-blue, #0a84ff) 45%, var(--line)); }
/* a designed letter in its frame: white, as it was designed, in a card of the thread (15. 11. 2026) */
.mail-html { display: block; width: 100%; height: 120px; margin-top: 10px; border: 0; border-radius: 10px; background: #fff; color-scheme: light; }
.mail-html[hidden], .mail-msg__text[hidden] { display: none; }
.mail-html__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mail-html__note { flex: 1 1 200px; min-width: 0; font-size: 12px; line-height: 16px; color: var(--text-muted); }
.shell-body .mail-html__bar .btn { padding: 4px 10px; font-size: 12px; line-height: 18px; border-radius: 8px; }
.mail-msg--html .mail-msg__text { border-top: 0; padding-top: 0; }
.mail-reply__head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; line-height: 20px; color: var(--text-muted); min-width: 0; }
.mail-reply__head b { color: var(--text-strong); }
.mail-reply__to { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-reply__text { width: 100%; min-height: 84px; resize: none; font: inherit; font-size: 14px; line-height: 22px; overflow-y: auto; }
.mail-reply__row { display: flex; align-items: center; gap: 10px; }
.mail-reply__note { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-reply__keys { font-size: 12px; color: var(--text-muted); opacity: .8; margin-right: -2px; }
.mail-reply__clear { visibility: hidden; }
.mail-reply.has-text .mail-reply__clear { visibility: visible; }
/* the buttons that send are in the red of Pošta (15. 11. 2026, Štěpán), as the red of HRM in HRM; pale while there is nothing to send */
.mail-win { --mail-accent: #ed1c24; }
:root[data-theme="light"] .mail-win { --mail-accent: #d8141c; }
.shell-body .mail-win :is(.mail-reply, .mail-new) .btn--primary { background: var(--mail-accent); color: #fff; border-color: transparent; box-shadow: none; font-weight: 600; }
.shell-body .mail-win :is(.mail-reply, .mail-new) .btn--primary:hover { background: color-mix(in srgb, var(--mail-accent) 88%, #fff); color: #fff; }
.shell-body .mail-win :is(.mail-reply, .mail-new) .btn--primary:focus-visible { outline: 2px solid var(--mail-accent); outline-offset: 2px; }
.mail-reply:not(.has-text) .btn--primary { opacity: .45; }
.mail-reply:focus-within { border-color: color-mix(in srgb, var(--text-strong) 28%, var(--line)); }
@media (max-width: 640px) { .mail-reply__keys { display: none; } }
.mail-reply--off { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mail-reply--off p { margin: 0; font-size: 13px; color: var(--text-muted); }
