.chat-shell { min-height: min(72vh, 720px); display: grid; grid-template-columns: 310px minmax(0, 1fr); overflow: hidden; background: #121212; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; }
.conversation-list { min-width: 0; overflow-y: auto; background: #101010; border-right: 1px solid rgba(255,255,255,.08); }
.conversation-item { width: 100%; min-height: 74px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; color: #cdcdcd; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; cursor: pointer; }
.conversation-item:hover, .conversation-item.is-active { background: #161616; }
.conversation-item strong, .conversation-item small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item small { margin-top: 4px; color: #8f8f8f; }
.conversation-item em { min-width: 22px; height: 22px; display: grid; place-items: center; color: #fff; background: #1e018f; border-radius: 999px; font-size: 12px; font-style: normal; }
.chat-window { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: #121212; }
.chat-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.chat-header strong, .chat-header span { display: block; }
.chat-header span { margin-top: 3px; color: #8f8f8f; font-size: 13px; }
.chat-messages { min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-message { max-width: 78%; display: flex; align-self: flex-start; }
.chat-message.mine { align-self: flex-end; }
.message-bubble { min-width: 0; padding: 10px 12px; background: #161616; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; }
.chat-message.mine .message-bubble { color: #fff; background: #1e018f; border-color: #3214bb; }
.chat-message.is-deleted .message-bubble { opacity: .62; }
.message-bubble p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.message-bubble footer { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 6px; color: rgba(205,205,205,.78); font-size: 12px; }
.message-bubble footer button { padding: 0; color: inherit; background: transparent; border: 0; cursor: pointer; }
.message-media { display: block; max-width: min(260px, 100%); margin-top: 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); }
.message-link { display: block; margin-top: 8px; color: #fff; text-decoration: underline; overflow-wrap: anywhere; }
.message-status { color: #f5b84b; }
.chat-tools { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.chat-tools .icon-btn { width: 38px; min-height: 38px; border-radius: 8px; }
.chat-upload input { display: none; }
.emoji-picker, .gif-picker { position: absolute; left: 12px; bottom: calc(100% + 8px); z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; max-width: min(420px, calc(100vw - 42px)); padding: 10px; background: #161616; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; box-shadow: 0 20px 54px rgba(0,0,0,.48); }
.emoji-picker[hidden], .gif-picker[hidden] { display: none; }
.emoji-picker button { width: 36px; height: 36px; background: #121212; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; cursor: pointer; }
.gif-picker button { width: 96px; display: grid; gap: 4px; padding: 6px; color: #cdcdcd; background: #121212; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; cursor: pointer; }
.gif-picker img { width: 100%; height: 56px; object-fit: cover; border-radius: 6px; }
.gif-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.chat-form input[type="text"] { flex: 1; min-width: 0; color: #cdcdcd; background: #0c0c0c; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 11px 12px; }
.chat-empty { padding: 16px; color: #8f8f8f; }

@media (max-width: 760px) {
    .chat-shell { grid-template-columns: 1fr; min-height: 76vh; }
    .conversation-list { max-height: 230px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
    .chat-message { max-width: 92%; }
    .chat-form { align-items: stretch; }
    .chat-form .pill { padding: 0 12px; }
}
