/* mail.css — split out of style.css on 2026-09-02 so a feature's styles live
   with the feature and parallel sessions stop colliding in one 4,600-line
   file. The mailbox (mail.js, #mail-screen): threads, messages, announcements, the composer, the prefs and the menu badge.
   Loads AFTER style.css (index.html), so the cascade order the rules had
   inside it is preserved: nothing here was moved relative to what follows it. */

/* ================================================================ mailbox
   ✉️ #mail-screen (js/mail.js): threads / thread / compose over the
   ordinary overlay+panel, above the admin panel so a reply opens on top */
#mail-screen { z-index: 40; }
#mail-screen .panel { width: min(680px, 94vw); }
.mail-badge {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 900; line-height: 1.5; vertical-align: 1px;
  background: linear-gradient(180deg, #ffd76a, #e8a820); color: #4a3000;
}
.mail-badge.hidden { display: none; }
.mail-body { text-align: left; min-height: 240px; }
.mail-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; margin: 4px 0; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  color: inherit; font: inherit; text-align: left;
}
.mail-row:hover { background: rgba(255,255,255,.09); }
.mail-row.unread { border-color: rgba(255,215,106,.5); background: rgba(255,215,106,.07); }
.mail-ava {
  flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 900; font-size: 15px;
  background: linear-gradient(180deg, #3d4668, #262c45); color: #cfd6ee;
}
.mail-ava.off { background: linear-gradient(180deg, #6e5a2e, #4a3c1c); }
.mail-mid { flex: 1; min-width: 0; }
.mail-mid b { display: block; font-size: 14px; }
.mail-mid small { display: block; opacity: .65; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-pend { font-style: normal; font-size: 11px; font-weight: 700; color: #ffd76a; margin-left: 6px; }
.mail-end { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.mail-end time { font-size: 11px; opacity: .55; }
.mail-n {
  font-style: normal; font-size: 11px; font-weight: 900; padding: 0 6px;
  border-radius: 999px; background: linear-gradient(180deg, #ffd76a, #e8a820); color: #4a3000;
}
.mail-thhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mail-thhead b { font-size: 15px; }
.mail-msgs { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.mail-msg {
  max-width: 86%; padding: 8px 12px; border-radius: 12px 12px 12px 4px;
  background: rgba(255,255,255,.07); align-self: flex-start; font-size: 13.5px; line-height: 1.45;
}
.mail-msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: rgba(66,132,110,.28); }
.mail-msg b { display: block; margin-bottom: 2px; }
.mail-msg span { white-space: pre-line; overflow-wrap: anywhere; }
.mail-msg time { display: block; font-size: 10.5px; opacity: .5; margin-top: 3px; }
.mail-kind { display: block; font-style: normal; font-size: 11px; font-weight: 800; color: #ffd76a; margin-bottom: 2px; }
.mail-banner {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; margin: 6px 0;
  border-radius: 10px; border: 1px solid rgba(255,215,106,.5); background: rgba(255,215,106,.08);
  font-size: 13px;
}
.mail-bacts { display: flex; gap: 8px; }
.mail-reply { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.mail-reply textarea, .mail-compose textarea, .mail-compose input {
  flex: 1; width: 100%; resize: vertical; border-radius: 9px; padding: 8px 10px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.15); color: inherit; font: inherit; font-size: 13.5px;
}
.mail-compose { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mail-compose label { width: 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mail-ann { display: flex; gap: 10px; padding: 9px 10px; margin: 4px 0; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 13px; }
.mail-ann.fresh { border: 1px solid rgba(255,215,106,.45); background: rgba(255,215,106,.06); }
.mail-ann i { font-style: normal; font-size: 18px; }
.mail-ann b { display: block; }
.mail-ann span { display: block; opacity: .75; white-space: pre-line; }
.mail-ann time { display: block; font-size: 11px; opacity: .5; margin-top: 2px; }
.mail-prefrow > span { max-width: 62%; }
.mail-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%) translateY(8px);
  background: rgba(20,24,40,.95); border: 1px solid rgba(255,255,255,.2); border-radius: 10px;
  padding: 8px 14px; font-size: 13px; opacity: 0; pointer-events: none; transition: .18s; max-width: 90%;
}
.mail-toast.show { opacity: 1; transform: translateX(-50%); }
/* admin ✉️ Mail: the composer's recipient-search dropdown */
.adm-mail-hits {
  position: absolute; left: 32px; right: 0; top: calc(100% + 4px); z-index: 5;
  display: flex; flex-direction: column; max-height: 240px; overflow-y: auto;
  background: rgba(18,20,34,.98); border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.5); padding: 4px;
}
.adm-mail-hits.hidden { display: none; }
.adm-mail-hits button {
  text-align: left; padding: 7px 10px; border-radius: 7px; border: 0;
  background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 10px;
}
.adm-mail-hits button:hover { background: rgba(255,255,255,.1); }
.adm-mail-hits button small { opacity: .5; }
