/* Chat and Mail pages (1.1; chat.js, mail.js). WorthForth tokens with fallbacks; 40px controls, 4px corners,
   WCAG 2.2 AA contrast and visible focus. Two columns on wide screens, one column on phones. */
.chat-layout,.mail-layout{display:grid;grid-template-columns:minmax(14rem,18rem) minmax(0,1fr);gap:1rem;align-items:start;min-width:0}
.mail-layout{grid-template-columns:minmax(10rem,13rem) minmax(14rem,22rem) minmax(0,1fr)}
.chat-list,.mail-boxes,.mail-list{list-style:none;margin:0;padding:0;display:grid;gap:.35rem}
.chat-item,.mail-box,.mail-item{display:grid;gap:.15rem;width:100%;min-height:40px;text-align:left;padding:.55rem .7rem;border:1px solid var(--border,#d8dfeb);border-radius:4px;background:var(--surface,#fff);color:inherit}
.chat-item.current,.chat-item[aria-current="true"]{border-color:var(--accent,#173f3c);box-shadow:inset 3px 0 0 var(--accent,#173f3c)}
.chat-title,.mail-item .from{font-weight:600;overflow-wrap:anywhere}
.chat-preview,.mail-item .preview{color:var(--muted,#5b6a66);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mail-item.unread .subject{font-weight:600}
.badge{display:inline-block;min-width:1.4rem;padding:0 .35rem;border-radius:4px;background:var(--accent,#173f3c);color:#fff;font-size:.75rem;text-align:center}
.chat-thread,.mail-read{display:grid;gap:.6rem;min-width:0;border:1px solid var(--border,#d8dfeb);border-radius:4px;padding:1rem;background:var(--surface,#fff)}
.chat-messages{list-style:none;margin:0;padding:0;display:grid;gap:.45rem;max-height:60vh;overflow-y:auto}
.chat-message{display:grid;gap:.1rem;max-width:min(36rem,90%);padding:.5rem .7rem;border-radius:4px;background:var(--surface-soft,#f4f7f5)}
.chat-message.mine{justify-self:end;background:#e2ece7}
.chat-message.pending{opacity:.75}
.chat-message .who{font-size:.78rem;font-weight:600;color:var(--muted,#5b6a66)}
.chat-message .body{white-space:pre-wrap;overflow-wrap:anywhere}
.chat-message .when{font-size:.72rem;color:var(--muted,#5b6a66)}
.chat-compose,.mail-compose,.chat-new{display:grid;gap:.5rem}
.chat-compose textarea,.mail-compose textarea,.mail-compose input,.chat-new input{font:inherit;min-height:40px;padding:.5rem .6rem;border:1px solid #6b7c88;border-radius:4px;background:#fbfdfc;color:#19252a}
.chat-compose button,.mail-compose button,.chat-new button,.chat-panel .actions button,.mail-panel .actions button{min-height:40px}
.mail-body{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;margin:0}
.mail-read .meta,.chat-thread .note{color:var(--muted,#5b6a66);font-size:.85rem}
.chat-panel :focus-visible,.mail-panel :focus-visible{outline:3px solid var(--accent,#173f3c);outline-offset:2px}
@media(max-width:860px){.chat-layout,.mail-layout{grid-template-columns:1fr}.chat-messages{max-height:none}}
/* Reports (1.1): a Report button on others' messages, the report form and the moderators' queue. */
.chat-message .chat-report{justify-self:start;min-height:40px;padding:.3rem .7rem;font-size:.8rem}
.chat-report-form,.chat-report-queue{display:grid;gap:.5rem;border:1px solid var(--border,#d8dfeb);border-radius:4px;padding:1rem;background:var(--surface,#fff)}
.chat-report-form select,.chat-report-form textarea{font:inherit;min-height:40px;padding:.5rem .6rem;border:1px solid #6b7c88;border-radius:4px;background:#fbfdfc;color:#19252a}
.chat-report-form button,.chat-report-queue button{min-height:40px}
.chat-report-items{list-style:none;margin:0;padding:0;display:grid;gap:.75rem}
.chat-report-items blockquote{margin:0;padding:.5rem .7rem;border-left:3px solid var(--accent,#173f3c);background:var(--surface-soft,#f4f7f5);white-space:pre-wrap;overflow-wrap:anywhere}
.chat-report-form :focus-visible,.chat-report-queue :focus-visible{outline:3px solid var(--accent,#173f3c);outline-offset:2px}
