:root{--jaffa: #F47646;--sandy-brown: #F4934F;--shark07: #1C1E1F;--shark06: #2A2C2E;--emperor: #505050;--emperor02: #555555;--gallery: #EBEBEB;--white: #FFFFFF;--white-t5: rgba(255, 255, 255, .5);--white-t08: rgba(255, 255, 255, .08);--error: #FF4444;--bg: var(--shark07);--bg-elev: var(--shark06);--text: var(--white);--text-muted: var(--emperor);--accent: var(--jaffa);--own-bubble: var(--jaffa);--their-bubble: var(--emperor02);--border: var(--emperor)}*{box-sizing:border-box}html,body,#root{margin:0;padding:0;height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:15px;-webkit-font-smoothing:antialiased}button{background:transparent;border:none;color:inherit;font:inherit;cursor:pointer;padding:0}input,textarea{font-family:inherit}.screen{display:flex;flex-direction:column;height:100vh;overflow:hidden;position:relative}.screen.centered{justify-content:center;align-items:center;text-align:center;padding:24px}.centered{text-align:center}.muted{color:var(--text-muted)}.err{color:var(--error)}h1{font-size:28px;font-weight:700;margin:0 0 24px}.spinner{width:32px;height:32px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite;margin:12px 0}@keyframes spin{to{transform:rotate(360deg)}}.topbar{display:flex;align-items:center;gap:10px;padding:12px 14px;background:var(--shark07);border-bottom:1px solid var(--border);min-height:52px;flex-shrink:0}.topbar .title{font-size:17px;font-weight:600;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .subtitle{display:block;font-size:12px;color:var(--text-muted);font-weight:400;margin-top:2px}.topbar .back{font-size:22px;padding:0 4px;color:var(--accent);line-height:1}.topbar-title-block{flex:1;min-width:0}.topbar-title-block .title{display:block;font-size:22px;font-weight:700}.avatar{width:44px;height:44px;border-radius:50%;flex-shrink:0;background:var(--jaffa);display:flex;align-items:center;justify-content:center;color:var(--white);font-weight:700;font-size:18px;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.room-list{flex:1;overflow-y:auto}.room-row{display:flex;align-items:center;width:100%;text-align:left;padding:12px 14px;border-bottom:1px solid var(--border);gap:12px}.room-row:hover{background:var(--shark06)}.room-info{flex:1;min-width:0}.room-name{font-size:16px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.room-last{color:var(--text-muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.badge{background:var(--accent);color:var(--white);min-width:22px;height:22px;border-radius:11px;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 6px;flex-shrink:0}.timeline-wrap{flex:1;position:relative;overflow:hidden;min-height:0}.timeline{position:absolute;inset:0;overflow-y:auto;padding:12px 12px 6px;display:flex;flex-direction:column;gap:4px}.msg-row{display:flex;flex-direction:column;max-width:80%;margin-bottom:8px}.msg-row.own{align-self:flex-end;align-items:flex-end}.msg-row.their{align-self:flex-start;align-items:flex-start}.bubble{padding:10px 12px 6px;border-radius:14px;font-size:15px;line-height:1.35;word-wrap:break-word;overflow-wrap:break-word}.bubble.own{background:var(--own-bubble);color:var(--white);border-bottom-right-radius:4px}.bubble.their{background:var(--their-bubble);color:var(--white);border-bottom-left-radius:4px}.bubble .body{white-space:pre-wrap}.bubble .body a{color:var(--sandy-brown);text-decoration:underline}.bubble .body code,.bubble .body pre{background:var(--white-t08);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;border-radius:4px;padding:1px 4px}.bubble .body pre{padding:8px 10px;overflow-x:auto;white-space:pre}.bubble .body blockquote{border-left:3px solid var(--emperor);padding-left:8px;margin:4px 0;color:#ffffffd9}.bubble .body p{margin:0 0 4px}.bubble .body p:last-child{margin-bottom:0}.bubble img.msg-image{display:block;max-width:100%;border-radius:8px;margin-bottom:4px}.time{font-size:11px;color:var(--white-t5);text-align:right;margin-top:4px}.reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px;padding:0 2px}.chip{display:inline-flex;align-items:center;gap:4px;background:var(--emperor02);border:1px solid var(--emperor);border-radius:14px;padding:3px 8px;cursor:pointer;color:var(--gallery)}.chip:hover{background:#5a5a5a}.chip .emoji{font-size:16px}.chip .label{font-size:12px}.scroll-down{position:absolute;right:16px;bottom:76px;width:36px;height:36px;border-radius:18px;background:var(--shark07);border:1px solid var(--emperor);display:flex;align-items:center;justify-content:center;z-index:100;box-shadow:0 2px 4px #00000059}.composer{display:flex;align-items:flex-end;gap:8px;padding:8px 12px;border-top:1px solid var(--border);background:var(--shark07);flex-shrink:0}.composer textarea{flex:1;background:var(--emperor02);border:none;color:var(--white);font-size:15px;line-height:1.35;padding:10px 16px;border-radius:20px;outline:none;resize:none;max-height:100px;min-height:40px;overflow-y:auto}.composer textarea::placeholder{color:var(--text-muted)}.composer .send-btn,.composer .mic-btn{width:36px;height:36px;border-radius:18px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.composer .send-btn{background:var(--jaffa)}.composer .send-btn:disabled{background:var(--emperor);cursor:default}.composer .mic-btn{background:transparent}.empty{display:flex;flex-direction:column;align-items:center;padding:32px;gap:8px}.empty .empty-text{font-size:16px;color:var(--text-muted)}.empty .retry{font-size:14px;color:var(--jaffa);margin-top:8px}.avatar-md{width:44px;height:44px;font-size:18px}.avatar-sm{width:30px;height:30px;font-size:14px}.avatar-xs{width:26px;height:26px;font-size:12px}.avatar{width:44px;height:44px;font-size:18px}.avatar.sm{width:30px;height:30px;font-size:14px}.search-bar{padding:6px 12px 8px;background:var(--shark07);border-bottom:1px solid var(--border)}.search-bar input{width:100%;background:var(--emperor02);border:none;border-radius:18px;color:var(--white);font-size:14px;padding:8px 14px;outline:none}.search-bar input::placeholder{color:var(--text-muted)}.room-row{align-items:flex-start}.room-name-row,.room-last-row{display:flex;align-items:center;gap:8px}.room-name-row{margin-bottom:3px}.room-name-row .room-name{flex:1;margin-bottom:0}.room-when{font-size:12px;color:var(--text-muted);flex-shrink:0}.room-last-row .room-last{flex:1;margin:0}.msg-row{display:flex;flex-direction:row;align-items:flex-end;max-width:82%;margin-bottom:0;gap:6px}.msg-row.own{align-self:flex-end;flex-direction:row-reverse}.msg-row.their{align-self:flex-start}.msg-avatar-slot{width:26px;min-width:26px;flex-shrink:0;align-self:flex-end}.msg-body-col{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.msg-row.own .msg-body-col{align-items:flex-end}.sender{font-size:12px;color:var(--sandy-brown);font-weight:600;margin-bottom:2px;padding:0 4px}.bubble.pos-first.own{border-top-right-radius:14px;border-bottom-right-radius:6px}.bubble.pos-middle.own{border-top-right-radius:6px;border-bottom-right-radius:6px}.bubble.pos-last.own{border-top-right-radius:6px;border-bottom-right-radius:4px}.bubble.pos-first.their{border-top-left-radius:14px;border-bottom-left-radius:6px}.bubble.pos-middle.their{border-top-left-radius:6px;border-bottom-left-radius:6px}.bubble.pos-last.their{border-top-left-radius:6px;border-bottom-left-radius:4px}.msg-row.pos-middle{margin-bottom:1px}.msg-row.pos-first{margin-top:6px;margin-bottom:1px}.msg-row.pos-last{margin-top:1px;margin-bottom:6px}.msg-row.pos-solo{margin-top:6px;margin-bottom:6px}.reply-btn{align-self:center;width:24px;height:24px;border-radius:12px;background:var(--shark06);border:1px solid var(--border);color:var(--text-muted);font-size:14px;opacity:0;transition:opacity .15s}.msg-row:hover .reply-btn{opacity:1}.reply-quote{display:flex;flex-direction:column;align-items:flex-start;gap:2px;border-left:3px solid var(--sandy-brown);padding:4px 8px;margin-bottom:6px;background:#00000026;border-radius:4px;width:100%;cursor:pointer;color:inherit;text-align:left}.reply-quote .reply-name{font-size:12px;font-weight:600;color:var(--sandy-brown)}.reply-quote .reply-body{font-size:13px;color:#ffffffd9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.highlight .bubble{outline:2px solid var(--sandy-brown);outline-offset:2px;transition:outline-color .6s}.edited{color:#ffffff8c;margin-right:4px}.msg-audio,.msg-video{display:block;max-width:260px;margin-bottom:4px}.msg-file{display:flex;align-items:center;gap:8px;padding:8px 10px;background:#00000026;border-radius:8px;margin-bottom:4px;color:inherit;text-decoration:none}.msg-file .file-icon{font-size:22px}.msg-file .file-info{display:flex;flex-direction:column;min-width:0}.msg-file .file-name{font-size:14px;color:var(--white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.msg-file .file-meta{font-size:11px;color:#fff9}.date-sep{display:flex;justify-content:center;margin:12px 0 6px}.date-sep span{background:var(--shark06);color:var(--text-muted);font-size:12px;padding:3px 10px;border-radius:10px}.typing-row{display:flex;align-items:center;gap:8px;align-self:flex-start;padding:6px 12px;color:var(--text-muted);font-size:13px}.typing-dots{display:flex;gap:3px}.typing-dots span{width:6px;height:6px;background:var(--text-muted);border-radius:50%;animation:typing-bounce 1.2s infinite ease-in-out}.typing-dots span:nth-child(2){animation-delay:.15s}.typing-dots span:nth-child(3){animation-delay:.3s}@keyframes typing-bounce{0%,60%,to{transform:translateY(0);opacity:.5}30%{transform:translateY(-3px);opacity:1}}.chip.reaction{padding:2px 8px;font-size:13px}.chip.reaction .count{color:var(--gallery);font-size:12px;font-weight:600}.chip.reaction.mine{background:#f476462e;border-color:var(--jaffa)}.chip.suggested{background:transparent;border:1px dashed var(--border);color:var(--gallery)}.reactions.suggested{margin-top:6px}.reply-preview{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--shark06);border-top:1px solid var(--border)}.reply-preview .reply-arrow{color:var(--sandy-brown);font-size:18px}.reply-preview .reply-content{flex:1;min-width:0;border-left:3px solid var(--sandy-brown);padding-left:8px}.reply-preview .reply-name{display:block;font-size:12px;color:var(--sandy-brown);font-weight:600}.reply-preview .reply-body{display:block;font-size:13px;color:var(--white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview .reply-cancel{color:var(--text-muted);font-size:20px;padding:0 4px;line-height:1}.composer{flex-direction:column;gap:0;padding:0;border-top:1px solid var(--border);background:var(--shark07)}.composer-row{display:flex;align-items:flex-end;gap:8px;padding:8px 12px}.composer .attach-btn{width:36px;height:36px;border-radius:18px;display:flex;align-items:center;justify-content:center;font-size:22px;color:var(--text-muted);flex-shrink:0}.composer .attach-btn:hover{color:var(--sandy-brown)}.composer .attach-btn:disabled{opacity:.4;cursor:default}.emoji-picker{position:fixed;z-index:9999;width:296px;background:var(--shark06);border:1px solid var(--border);border-radius:12px;padding:8px;box-shadow:0 8px 24px #00000080}.emoji-picker-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px}.emoji-btn{aspect-ratio:1;font-size:22px;border-radius:6px;display:flex;align-items:center;justify-content:center}.emoji-btn:hover{background:var(--shark07)}.lightbox{position:fixed;inset:0;background:#000000e6;z-index:9998;display:flex;align-items:center;justify-content:center;padding:20px}.lightbox img{max-width:100%;max-height:100%;object-fit:contain;border-radius:4px}.lightbox-close{position:absolute;top:12px;right:12px;width:36px;height:36px;border-radius:18px;background:#ffffff1a;color:var(--white);font-size:24px;line-height:1;display:flex;align-items:center;justify-content:center}.lightbox-close:hover{background:#fff3}.retry-btn{margin-top:16px;padding:10px 20px;border-radius:20px;background:var(--jaffa);color:var(--white);font-size:15px;font-weight:600}.retry-btn:hover{filter:brightness(1.08)}@supports (padding: env(safe-area-inset-bottom)){.composer-row{padding-bottom:calc(8px + env(safe-area-inset-bottom))}}
