/* style-r5-lists.css - design round 5, JOB 4: the CHAT LIST rows and the CHAT HEADER. Loaded after style-r5-icons.css. Pure CSS.
   Row = avatar | name + time / two-line preview | unread dot. Header = back | title + presence | quick icons. */

/* ---------- chat list rows ---------- */
#chat-list { background: #121212; padding: 4px 0 24px; }
#chat-list li { position: relative; padding: 11px 14px 11px 12px; gap: 12px; border-bottom: 0; margin: 0 8px 4px; border-radius: 18px; transition: background-color .15s, transform .12s cubic-bezier(.2, .8, .2, 1); }
#chat-list li + li::before { content: none; }
#chat-list li:active { transform: scale(.985); background: #1E1E21; }
@media (hover: hover) { #chat-list li:hover { background: #19191B; } }
#chat-list li.unread { background: linear-gradient(90deg, rgba(6, 199, 85, .13), rgba(6, 199, 85, .04) 75%); border-left: 0; box-shadow: inset 3px 0 0 #06C755; }
.chat-row-top { align-items: center; gap: 8px; }
.chat-row-top .chat-row-title { font-size: 15.5px; font-weight: 700; letter-spacing: .005em; color: #F2F2F4; }
#chat-list li.unread .chat-row-title { color: #fff; }
.chat-row-time { font-size: 11.5px; font-variant-numeric: tabular-nums; color: #8E8E93; letter-spacing: .01em; }
.chat-row-last { font-size: 13.5px; line-height: 1.35; color: #9C9CA3; margin-top: 3px; }
.chat-row-last b { color: #D2D2D8; font-weight: 600; }
.chat-row-last i { color: #77777E; }
.chat-row-typing { color: #34C759; font-style: italic; }
.chat-row-dot { width: 12px; height: 12px; background: linear-gradient(145deg, #3CE680, #06C755); box-shadow: 0 0 0 3px rgba(6, 199, 85, .22), 0 0 10px rgba(6, 199, 85, .6); animation: r5Glow 2.4s ease-in-out infinite; }
@keyframes r5Glow { 50% { box-shadow: 0 0 0 5px rgba(6, 199, 85, .12), 0 0 14px rgba(6, 199, 85, .75); } }
.chat-pin, .chat-muted { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .08); vertical-align: 1px; margin-right: 4px; }
.chat-muted { opacity: .8; margin-left: 4px; margin-right: 0; }
/* place / host rows keep their colour edge, but rounded with the rest */
#chat-list li.host-chat, .chat-place-row.here { box-shadow: inset 4px 0 0 var(--barcol, #FFB547); border-left: 0 !important; }
.chat-place-row:not(.here) { background: linear-gradient(90deg, rgba(10, 132, 255, .1), rgba(10, 132, 255, .03) 75%); }
#chat-list li.req-card { margin: 6px 8px; }
.list-actions button { border-radius: 14px; }
#friends-bar { padding: 12px 12px 10px; gap: 12px; background: linear-gradient(180deg, #1C1C1E, #181819); }
.friend-item .friend-name { font-size: 10.5px; font-weight: 600; color: #B4B4BC; }

/* ---------- chat header ---------- */
#chat-view > .topbar { padding: max(6px, env(safe-area-inset-top)) 8px 6px 4px; gap: 4px; background: linear-gradient(180deg, #212124, #1C1C1E); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 6px 16px rgba(0, 0, 0, .35); }
.chat-title-wrap { margin: 0 4px; gap: 2px; justify-content: center; }
.chat-title-wrap #chat-title { font-size: 17px; font-weight: 800; letter-spacing: -.005em; line-height: 1.2; color: #fff; }
.chat-presence { font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.chat-presence:not(:empty)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #636366; flex: none; }
.chat-presence.on::before { background: #30D158; box-shadow: 0 0 6px rgba(48, 209, 88, .8); } .chat-presence.away::before { background: #FFD60A; } .chat-presence.off::before { background: #636366; }
.chat-presence.off { color: #8E8E93; }
#chat-pin-card { margin: 8px 10px 0; border-radius: 16px; border: 1px solid #3A3A3C; background: linear-gradient(160deg, #2A2A2E, #222225); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
#creation-banner { border-radius: 14px; margin: 8px 10px 0; }

@media (prefers-reduced-motion: reduce) { .chat-row-dot { animation: none; } #chat-list li { transition: none; } #chat-list li:active { transform: none; } }

/* ---------- wide screens: a tidy centred list ---------- */
@media (min-width: 900px) {
  #chat-list { width: 100%; max-width: 780px; margin: 0 auto; }
  #friends-bar { justify-content: center; }
  #chat-list li { padding: 13px 16px; }
}
