*{box-sizing:border-box;margin:0;padding:0}body{justify-content:center;align-items:center;height:100vh;margin:0;padding:0;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;display:flex}.chat-container{justify-content:center;min-width:800px;max-width:800px;height:90vh;display:flex}.chat-window{background:#fff;border-radius:12px;flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden;box-shadow:0 2px 16px #0000001a}.messages-list{flex-direction:column;flex:1;gap:12px;padding:16px;display:flex;overflow-y:auto}.loading,.empty-chat{color:#999;text-align:center;margin-top:20px}.message{align-items:flex-start;gap:8px;max-width:75%;display:flex}.message-own{flex-direction:row!important;justify-content:flex-end!important;align-self:flex-end!important;margin-left:auto!important}.message-other{flex-direction:row!important;justify-content:flex-start!important;align-self:flex-start!important;margin-right:auto!important}.message-own .message-avatar{order:2}.message-own .message-image{border:1px solid #ffffff4d}.message-other .message-avatar{order:0}.message-avatar{color:#555;background:#e0e0e0;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-weight:700;display:flex}.message-content{word-break:break-word;background:#fff;border-radius:12px;padding:8px 12px;box-shadow:0 1px 4px #00000014}.message-own .message-text img{background:#fff3;border-radius:8px}.message-own .message-content{color:#fff;background:#0084ff;padding-right:28px}.message-header{justify-content:space-between;gap:12px;margin-bottom:4px;font-size:.85rem;display:flex}.sender-name{font-weight:600}.message-own .sender-name{color:#fff}.message-time{color:#888;white-space:nowrap}.message-own .message-time{color:#fffc}.message-text{font-size:1rem;line-height:1.4}.message-input{background:#f9f9f9;border-top:1px solid #eee;gap:8px;padding:12px 16px;display:flex}.message-input input{border:1px solid #ddd;border-radius:24px;outline:none;flex:1;padding:10px 14px;font-size:1rem;transition:border-color .2s}.message-input input:focus{border-color:#0084ff}.message-input button{color:#fff;cursor:pointer;background:#0084ff;border:none;border-radius:24px;padding:10px 18px;font-size:1rem;transition:background .2s}.message-input button:hover{background:#006bbf}.auth-container{background:#f0f2f5;justify-content:center;align-items:center;height:100vh;display:flex}.auth-form{background:#fff;border-radius:12px;width:350px;padding:30px;box-shadow:0 2px 16px #0000001a}.auth-form h2{text-align:center;margin-bottom:20px}.auth-form input{border:1px solid #ddd;border-radius:8px;width:100%;margin-bottom:12px;padding:12px;font-size:16px}.auth-form button{color:#fff;cursor:pointer;background:#0084ff;border:none;border-radius:8px;width:100%;padding:12px;font-size:16px}.auth-form button:disabled{background:#ccc}.auth-error{color:#c00;text-align:center;background:#ffe0e0;border-radius:8px;margin-bottom:12px;padding:10px}.auth-switch{text-align:center;color:#0084ff;cursor:pointer;margin-top:15px}.chat-header{color:#fff;background:#0084ff;justify-content:space-between;align-items:center;padding:12px 16px;font-weight:600;display:flex}.chat-user{align-items:center;gap:10px;display:flex}.logout-btn{color:#fff;cursor:pointer;background:#fff3;border:1px solid #ffffff4d;border-radius:6px;padding:4px 12px;font-size:14px}.logout-btn:hover{background:#ffffff4d}body.dark{background-color:#1a1a2e}body.dark .chat-window{background:#16213e;box-shadow:0 2px 16px #0000004d}body.dark .chat-header{background:#0f3460}body.dark .message-other .message-content{color:#e0e0e0;background:#1a1a2e}body.dark .message-own .message-content{background:#0084ff}body.dark .message-input{background:#16213e;border-top:1px solid #0f3460}body.dark .message-input input{color:#e0e0e0;background:#1a1a2e;border-color:#0f3460}body.dark .message-time,body.dark .loading,body.dark .empty-chat{color:#aaa}body.dark .auth-container{background:#1a1a2e}body.dark .auth-form{color:#e0e0e0;background:#16213e}body.dark .auth-form input{color:#e0e0e0;background:#1a1a2e;border-color:#0f3460}body.dark .auth-form h2{color:#e0e0e0}body.dark .auth-switch{color:#4da6ff}.theme-toggle{cursor:pointer;background:0 0;border:none;border-radius:6px;padding:4px 8px;font-size:20px}body.dark .theme-toggle{color:gold}.theme-toggle:hover{background:#ffffff1a}.typing-indicator{color:#888;padding:4px 16px;font-size:13px;font-style:italic}.message-text:hover .edit-btn{opacity:.6}.edit-mode{gap:4px;display:flex}.edit-mode input{border:1px solid #ddd;border-radius:6px;flex:1;padding:4px 8px;font-size:14px}.message-other .msg-menu-container{right:4px}.msg-dots{cursor:pointer;color:inherit;opacity:0;background:0 0;border:none;border-radius:4px;padding:2px 6px;font-size:16px;line-height:1}.message-content:hover .msg-dots{opacity:.6}.msg-dots:hover{background:#0000001a;opacity:1!important}body.dark .msg-dots:hover{background:#ffffff1a}.msg-dropdown{z-index:100;background:#fff;border-radius:8px;min-width:130px;margin-bottom:4px;padding:4px;position:absolute;bottom:100%;right:0;box-shadow:0 4px 12px #00000026}body.dark .msg-dropdown{background:#fff}.msg-dropdown button{cursor:pointer;text-align:left;color:#000;background:0 0;border:none;border-radius:6px;width:100%;padding:8px 12px;font-size:14px;display:block}.msg-dropdown button:hover,body.dark .msg-dropdown button:hover{background:#adadad}.msg-dropdown button:last-child:hover{color:#b30505}.message-content{position:relative}.msg-menu-container{position:absolute;top:auto;bottom:4px;right:4px}.avatar-img{object-fit:cover;border-radius:50%;width:100%;height:100%}.message-own .message-text{padding-right:28px}@media (width<=768px){.chat-container{width:100%!important;min-width:auto!important;max-width:100%!important;height:100vh!important}.chat-window{border-radius:0;width:100%;height:100%}body{height:100vh;display:block}.chat-header{padding:10px 12px;font-size:14px}.user-badge span{display:none}.logout-btn{padding:4px 8px;font-size:12px}.messages-list{padding:8px}.message{max-width:90%}.message-input{gap:4px;padding:8px}.message-input input{padding:10px;font-size:16px}.message-input button{padding:10px 14px;font-size:14px}.modal-content{width:90%;min-width:auto;padding:20px}.auth-form{width:90%;padding:20px}.emoji-picker{width:200px}}@media (width<=480px){.message{max-width:95%}.message-content{padding:6px 10px}.message-text{font-size:15px}.message-time{font-size:11px}}.user-badge{cursor:pointer;background:#ffffff26;border-radius:20px;align-items:center;gap:8px;padding:4px 10px;transition:background .2s;display:flex}.user-badge:hover{background:#ffffff40}.user-badge-avatar{background:#ffffff4d;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;font-size:12px;font-weight:700;display:flex}.modal-overlay{z-index:1000;background:#00000080;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:fixed;top:0;left:0}.modal-content{text-align:center;background:#fff;border-radius:16px;min-width:300px;padding:30px;position:relative}body.dark .modal-content{color:#e0e0e0;background:#16213e}.modal-close{cursor:pointer;color:inherit;background:0 0;border:none;font-size:20px;position:absolute;top:10px;right:12px}.profile-avatar{border-radius:50%;width:100px;height:100px;margin:16px auto;overflow:hidden}.profile-avatar-img{object-fit:cover;width:100%;height:100%}.profile-avatar-placeholder{color:#fff;justify-content:center;align-items:center;width:100%;height:100%;font-size:36px;font-weight:700;display:flex}.profile-username{margin-bottom:16px;font-size:18px;font-weight:600}.upload-btn{color:#fff;cursor:pointer;background:#0084ff;border-radius:10px;padding:10px 20px;display:inline-block}.online-badge{opacity:.9;font-size:13px}.message-image{cursor:pointer;border-radius:8px;max-width:250px;max-height:300px;margin-bottom:4px;display:block}.message-audio{max-width:250px;margin-bottom:4px}.message-file{color:inherit;margin-bottom:4px;text-decoration:underline;display:block}.date-separator{text-align:center;margin:8px 0;padding:8px 0}.date-separator span{color:#666;background:#0000001a;border-radius:12px;padding:4px 12px;font-size:13px}body.dark .date-separator span{color:#aaa;background:#ffffff1a}.sticky-date{z-index:10;text-align:center;background:inherit;padding:6px 0;position:sticky;top:0}.sticky-date:after{content:attr(data-text)}.sticky-date span{color:#666;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#0000001a;border-radius:12px;padding:4px 12px;font-size:13px}body.dark .sticky-date span{color:#aaa;background:#ffffff1a}.reply-preview{cursor:pointer;background:#0084ff1a;border-left:3px solid #0084ff;border-radius:0 8px 8px 0;margin-bottom:6px;padding:6px 10px;font-size:13px}.message-own .reply-preview{background:#ffffff26;border-left-color:#ffffff80}.reply-sender{color:#0084ff;font-size:12px;font-weight:700}.message-own .reply-sender{color:#ffffffe6}.reply-text{opacity:.85;white-space:nowrap;text-overflow:ellipsis;margin-top:2px;font-size:13px;overflow:hidden}.reply-bar{background:#e3f2fd;border-top:2px solid #0084ff;align-items:center;gap:8px;padding:8px 12px;display:flex}body.dark .reply-bar{background:#0d2137;border-color:#0084ff}.reply-bar-text strong{color:#0084ff}.reply-bar-text{flex:1;font-size:13px}.reply-bar button{cursor:pointer;width:24px;height:24px;color:inherit;background:#0000001a;border:none;border-radius:50%;justify-content:center;align-items:center;font-size:14px;display:flex}body.dark .reply-preview{background:#0084ff26}.emoji-btn{color:#fff;cursor:pointer;background:#0084ff;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;font-size:18px;display:flex}.read-status{opacity:.7;margin-left:4px;font-size:11px}.message-own .read-status{color:#ffffffe6}
