/* Estilos do chat (prefixo ch-). Feito primeiro para o celular: lista rolável e barra de digitar fixa embaixo. */
.ch-rooms { display: flex; flex-direction: column; gap: 6px; }
.ch-room { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); }
.ch-room:hover { text-decoration: none; background: var(--surface-2); }
.ch-room.unread b { color: var(--text); }
.ch-room-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-room-info b, .ch-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ch-room-meta .count, .ch .count { background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: 12px; font-weight: 800; padding: 1px 8px; }
.ch-av-class { background: var(--brand); color: var(--brand-ink); }
.ch-av-class .ico { width: 18px; height: 18px; }
.ch-pick { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.ch-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.ch-pick-row:hover { background: var(--surface-2); text-decoration: none; }

/* Conversa: ocupa a área toda do conteúdo */
.ch-screen { display: flex; flex-direction: column; height: calc(100vh - 64px); height: calc(100dvh - 64px); max-width: 900px; margin: -16px auto 0; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.ch-head-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ch-head-info b, .ch-head-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-back { padding: 6px; }
.ch-list { flex: 1; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
.ch-more { align-self: center; margin-bottom: 8px; }
.ch-day { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg-2); padding: 2px 10px; border-radius: 99px; margin: 8px 0; }
.ch-msg { display: flex; align-items: flex-end; gap: 8px; margin: 3px 0; max-width: 85%; }
.ch-msg .avatar { width: 30px; height: 30px; font-size: 12px; flex: none; }
.ch-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.ch-msg.sys { align-self: center; max-width: 100%; }
.ch-removed { font-size: 12px; color: var(--muted); font-style: italic; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg-2); border-radius: 99px; }
.ch-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; min-width: 60px; box-shadow: var(--shadow); }
.ch-msg.mine .ch-bubble { background: var(--brand); color: var(--brand-ink); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.ch-msg.staff:not(.mine) .ch-bubble { border-color: var(--accent); }
.ch-msg.deleted .ch-bubble { opacity: .55; text-decoration: line-through; }
.ch-msg.pinned .ch-bubble { border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn-bg); }
.ch-name { font-size: 12px; font-weight: 800; color: var(--accent); margin-bottom: 2px; }
.ch-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--accent); color: #fff; border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.ch-pin { font-size: 11px; font-weight: 800; color: var(--warn); display: inline-flex; align-items: center; gap: 4px; }
.ch-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
.ch-time { font-size: 11px; color: var(--muted); margin-top: 2px; text-align: right; }
.ch-msg.mine .ch-time { color: rgba(22, 23, 26, .6); }
.ch-screen[data-staff] .ch-msg:not(.sys) { cursor: pointer; }

/* Barra de digitar (fixa embaixo no celular) */
.ch-compose { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; z-index: 2; }
.ch-form { display: flex; align-items: flex-end; gap: 6px; }
.ch-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 120px; line-height: 1.35; padding: 9px 12px; border-radius: 20px; }
.ch-form .btn.primary { border-radius: 50%; width: 42px; height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ch-count { flex: none; }
.ch-rules { padding: 4px 6px 0; }
.ch-emojis { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 0 8px; }
.ch-emojis[hidden] { display: none; }
.ch-emojis button { font-size: 22px; background: none; border: 0; border-radius: 8px; padding: 4px 6px; cursor: pointer; line-height: 1; }
.ch-emojis button:hover { background: var(--bg-2); }
.ch-locked { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 6px 4px; }
.ch-quote { background: var(--surface-2); border-left: 3px solid var(--line-2); padding: 8px 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-deleted { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow: auto; margin-top: 6px; }
.ch-deleted > div { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
@media (max-width: 700px) {
  .ch-screen { height: calc(100vh - 56px); height: calc(100dvh - 56px); margin: -12px -12px 0; }
  .ch-hide-sm { display: none; }
  .ch-msg { max-width: 92%; }
}
