#chatScreen { min-height: 100%; }
.chat-panel { display: flex; flex-direction: column; min-height: min(68vh, 680px); padding: 14px; gap: 10px; }
.chat-peer { color: var(--muted, #8a8797); font-size: .8rem; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 28px; color: var(--muted, #8a8797); font-size: .75rem; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 260px; max-height: 56vh; padding: 8px 2px; overscroll-behavior: contain; overflow-anchor: none; }
.chat-message { flex-shrink: 0; }
.chat-empty { margin: auto; max-width: 260px; text-align: center; color: var(--muted, #8a8797); font-size: .9rem; }
.chat-message { align-self: flex-start; max-width: min(84%, 440px); padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: rgba(130, 111, 175, .14); overflow-wrap: anywhere; }
.chat-message.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: rgba(111, 83, 222, .2); }
.chat-message header { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 4px; color: var(--muted, #8a8797); font-size: .7rem; }
.chat-message p { margin: 0; white-space: pre-wrap; }
.chat-message img { display: block; width: min(100%, 320px); max-height: 360px; object-fit: contain; border-radius: 10px; }
.chat-message .expense-share { display: grid; gap: 3px; min-width: 180px; padding: 7px 0; }
.chat-composer { display: flex; align-items: center; gap: 8px; padding: 7px; border: 1px solid rgba(120, 104, 160, .2); border-radius: 18px; background: rgba(255,255,255,.58); }
.chat-composer input[type="text"], .chat-composer input:not([type]) { flex: 1; min-width: 0; padding: 9px 4px; border: 0; outline: 0; background: transparent; color: inherit; }
.chat-composer button, .chat-attach { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 13px; background: rgba(113, 91, 191, .14); color: inherit; font-size: 1.2rem; cursor: pointer; }
.chat-composer #sendChat { background: #6446d6; color: white; }
.chat-composer button:disabled { opacity: .45; cursor: wait; }
.chat-hint { margin: 0; text-align: center; color: var(--muted, #8a8797); font-size: .72rem; }
.chat-unread { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 4px; place-items: center; border-radius: 99px; background: #7659e8; color: white; font-size: .68rem; }
#pushEnable { justify-content: space-between; cursor: pointer; }
#pushEnable[hidden] { display: none; }
#pushDisable[hidden] { display: none; }
@media (prefers-color-scheme: dark) { .chat-composer { background: rgba(31, 25, 48, .85); } }
