* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #0b141a; color: #e9edef; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }

.screen { height: 100vh; display: flex; align-items: center; justify-content: center; }
#chat-screen { align-items: stretch; }

.auth-box { width: 100%; max-width: 360px; padding: 30px; background: #111b21; border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.auth-box h1 { text-align: center; color: #00a884; }
.tabs { display: flex; gap: 8px; }
.tab { flex: 1; padding: 10px; border: none; border-radius: 8px; background: #202c33; color: #8696a0; cursor: pointer; }
.tab.active { background: #00a884; color: #fff; }
input { padding: 12px; border: none; border-radius: 8px; background: #202c33; color: #e9edef; outline: none; }
.btn { padding: 12px; border: none; border-radius: 8px; cursor: pointer; background: #202c33; color: #e9edef; }
.btn.primary { background: #00a884; color: #fff; }
.btn.danger { background: #e53935; color: #fff; }
.btn.small { padding: 8px 12px; font-size: 13px; }
.error { color: #ff6b6b; font-size: 14px; min-height: 18px; }

#chat-screen { display: flex; }
#sidebar { width: 300px; background: #111b21; border-right: 1px solid #222d34; display: flex; flex-direction: column; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: #202c33; }
#user-list { flex: 1; overflow-y: auto; }
.user-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #1f2c33; }
.user-item:hover { background: #202c33; }
.user-item.selected { background: #2a3942; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #00a884; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.u-name { flex: 1; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #25d366; }
.badge { background: #25d366; color: #0b141a; border-radius: 10px; padding: 2px 7px; font-size: 12px; font-weight: bold; }

#chat-area { flex: 1; display: flex; flex-direction: column; background: #0b141a; }
#chat-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #202c33; }
#messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { display: flex; }
.msg.incoming { justify-content: flex-start; }
.msg.outgoing { justify-content: flex-end; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 10px; background: #202c33; }
.msg.outgoing .bubble { background: #005c4b; }
.time { font-size: 11px; color: #8696a0; text-align: right; margin-top: 4px; }
.file-img { max-width: 260px; max-height: 260px; border-radius: 8px; cursor: pointer; display: block; }
.file-video { max-width: 260px; border-radius: 8px; }
.file-info { font-size: 12px; color: #8696a0; margin-top: 4px; word-break: break-all; }
#typing-indicator { padding: 0 16px; font-size: 13px; color: #8696a0; font-style: italic; min-height: 18px; }
#chat-input-row { display: flex; gap: 8px; padding: 12px; background: #202c33; }
#msg-input { flex: 1; }

#call-modal { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#remote-video { width: 100%; height: 100%; object-fit: contain; }
#local-video { position: absolute; bottom: 90px; right: 16px; width: 150px; border-radius: 10px; border: 2px solid #fff; background: #000; }
#call-modal.voice-only #remote-video { display: none; }
#call-modal.voice-only #local-video { position: static; width: 200px; height: 200px; border-radius: 50%; }
#call-info { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 18px; z-index: 10; }
#call-modal button { position: absolute; bottom: 24px; z-index: 10; padding: 14px 28px; }
#end-call-btn { left: 50%; transform: translateX(-50%); }
#answer-call-btn { left: calc(50% - 140px); }
#reject-call-btn { left: calc(50% + 20px); }