:root{--bg: #f4f6fa;--surface: #ffffff;--surface-2: #eef1f6;--text: #141a24;--muted: #5d6778;--border: #dde2ea;--accent: #2f6fed;--accent-text: #ffffff;--bubble-out: #2f6fed;--bubble-out-text: #ffffff;--bubble-in: #ffffff;--danger: #d23b3b;--ok: #1f9d55;--warn-bg: #fff4d6;--warn-text: #6b4c00;--error-bg: #fde8e8;--error-text: #8a1c1c;--info-bg: #e7efff;--info-text: #1d3f8f;--radius: 12px;--shadow: 0 8px 30px rgb(0 0 0 / .12);color-scheme:light dark}@media (prefers-color-scheme: dark){:root{--bg: #0f1420;--surface: #171e2c;--surface-2: #1f2838;--text: #e8ecf3;--muted: #97a2b5;--border: #2a3446;--accent: #5b8cff;--bubble-out: #3a6ff0;--bubble-in: #1f2838;--warn-bg: #3a3014;--warn-text: #f3d37a;--error-bg: #3d1a1a;--error-text: #ffb4b4;--info-bg: #1a2a4d;--info-text: #b8ccff;--shadow: 0 8px 30px rgb(0 0 0 / .5)}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font:15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased}h1,h2,h3{margin:0;line-height:1.2}h3{font-size:15px;margin-bottom:6px}p{margin:0}hr{border:none;border-top:1px solid var(--border);width:100%}button,input,textarea{font:inherit;color:inherit}input,textarea{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 12px;width:100%}input:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:-1px}.muted{color:var(--muted)}.small-text{font-size:13px}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.hidden{display:none}.row{display:flex;gap:8px;align-items:center}.row.wrap{flex-wrap:wrap}.stack{display:flex;flex-direction:column;gap:12px}.center{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;padding:16px}.narrow{max-width:420px;margin:0 auto}.btn{border:1px solid var(--border);background:var(--surface);border-radius:10px;padding:10px 16px;cursor:pointer;font-weight:600}.btn:hover:not(:disabled){background:var(--surface-2)}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.btn.primary:hover:not(:disabled){filter:brightness(1.08);background:var(--accent)}.btn.danger{color:var(--danger)}.btn:disabled{opacity:.55;cursor:default}.icon-btn{border:none;background:transparent;width:38px;height:38px;border-radius:10px;cursor:pointer;font-size:18px;flex:none}.icon-btn:hover:not(:disabled){background:var(--surface-2)}.icon-btn:disabled{opacity:.4;cursor:default}.link{border:none;background:none;padding:0;color:var(--accent);cursor:pointer;font-weight:600;text-decoration:underline}.notice{border-radius:10px;padding:10px 12px;font-size:14px}.notice.warn{background:var(--warn-bg);color:var(--warn-text)}.notice.error{background:var(--error-bg);color:var(--error-text)}.notice.info{background:var(--info-bg);color:var(--info-text)}.field{display:flex;flex-direction:column;gap:6px}.field>span{font-weight:600;font-size:14px}.switch{display:flex;gap:10px;align-items:center;cursor:pointer}.switch input{width:18px;height:18px;flex:none}.badge{background:var(--accent);color:var(--accent-text);border-radius:999px;font-size:12px;font-weight:700;min-width:20px;padding:1px 6px;text-align:center}.card{background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow)}.welcome{min-height:100%;display:grid;place-items:center;padding:16px}.welcome-card{width:100%;max-width:440px;padding:24px;display:flex;flex-direction:column;gap:16px}.brand{display:flex;align-items:center;gap:12px}.segmented{display:flex;background:var(--surface-2);border-radius:10px;padding:3px}.segmented button{flex:1;border:none;background:transparent;padding:8px;border-radius:8px;cursor:pointer;font-weight:600;color:var(--muted)}.segmented button[aria-selected=true]{background:var(--surface);color:var(--text);box-shadow:0 1px 3px #0000001f}.layout{display:grid;grid-template-columns:320px 1fr;height:100%;height:100dvh}.sidebar{border-right:1px solid var(--border);background:var(--surface);display:flex;flex-direction:column;min-height:0;gap:8px;padding-top:env(safe-area-inset-top)}.sidebar>.notice{margin:0 12px}.sidebar-head{display:flex;justify-content:space-between;align-items:center;padding:12px 12px 4px 16px}.me{font-weight:700;font-size:17px}.status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}.dot{width:8px;height:8px;border-radius:50%;background:var(--muted)}.status-online .dot{background:var(--ok)}.status-offline .dot,.status-replaced .dot,.status-accountGone .dot{background:var(--danger)}.install{display:flex;gap:8px;align-items:flex-start}.chat-list{list-style:none;margin:0;padding:0 8px 8px;overflow-y:auto;flex:1}.chat-list .empty{padding:16px 8px;font-size:14px}.chat-item{display:flex;align-items:center;gap:12px;width:100%;border:none;background:transparent;padding:10px 8px;border-radius:12px;cursor:pointer;text-align:left}.chat-item:hover{background:var(--surface-2)}.chat-item.active{background:var(--info-bg)}.chat-item-text{display:flex;flex-direction:column;min-width:0;flex:1}.chat-item-name{font-weight:600}.chat-item-preview{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.verified{color:var(--ok);font-size:12px}.warn-mark{background:var(--danger);color:#fff;border-radius:50%;font-size:11px;padding:0 6px;margin-left:4px}.avatar{width:42px;height:42px;border-radius:50%;background:var(--accent);color:var(--accent-text);display:grid;place-items:center;font-weight:700;flex:none}.avatar.small{width:34px;height:34px}.main{min-width:0;min-height:0;display:flex;flex-direction:column}.placeholder{flex:1}.chat{display:flex;flex-direction:column;height:100%;min-height:0}.chat>.notice{margin:8px 12px 0}.chat-head{display:flex;align-items:center;gap:8px;padding:8px 12px;padding-top:max(8px,env(safe-area-inset-top));border-bottom:1px solid var(--border);background:var(--surface)}.chat-head .back{display:none}.chat-title{display:flex;align-items:center;gap:10px;flex:1;min-width:0;border:none;background:none;cursor:pointer;text-align:left;padding:0}.chat-title>span:last-child{display:flex;flex-direction:column;min-width:0}.chat-title .name{font-weight:700}.chat-title .muted{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.messages{flex:1;overflow-y:auto;padding:16px 12px;display:flex;flex-direction:column;gap:6px}.messages>.notice{align-self:center;text-align:center;max-width:460px;margin-bottom:8px}.bubble{max-width:min(75%,560px);padding:8px 12px;border-radius:16px;box-shadow:0 1px 1px #0000000f}.bubble.in{align-self:flex-start;background:var(--bubble-in);border:1px solid var(--border);border-bottom-left-radius:4px}.bubble.out{align-self:flex-end;background:var(--bubble-out);color:var(--bubble-out-text);border-bottom-right-radius:4px}.bubble-text{white-space:pre-wrap;overflow-wrap:anywhere}.bubble-meta{font-size:11px;opacity:.75;text-align:right;margin-top:2px}.bubble.out .link{color:inherit}.state.failed{font-weight:700}.system{align-self:center;font-size:13px;background:var(--surface-2);border-radius:10px;padding:6px 10px;max-width:90%;text-align:center}.system.missed{color:var(--danger)}.composer{display:flex;gap:8px;padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface);align-items:flex-end}.composer textarea{resize:none;max-height:140px;field-sizing:content}.dialog{border:none;padding:0;border-radius:16px;background:var(--surface);color:var(--text);box-shadow:var(--shadow);width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px)}.dialog::backdrop{background:#00000073}.dialog-body{padding:16px 20px 20px}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.safety{display:grid;grid-template-columns:repeat(4,1fr);gap:6px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:18px;background:var(--surface-2);border-radius:10px;padding:12px;text-align:center;margin-top:8px}.call{position:fixed;inset:0;background:#0b0f17;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;z-index:50;padding:24px 16px max(24px,env(safe-area-inset-bottom))}.call .remote{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}.call .local{position:absolute;right:16px;top:max(16px,env(safe-area-inset-top));width:min(28vw,180px);border-radius:12px;transform:scaleX(-1);box-shadow:var(--shadow);background:#222}.call.video{justify-content:flex-end}.call-avatar{width:120px;height:120px;border-radius:50%;background:var(--accent);display:grid;place-items:center;font-size:48px;font-weight:700}.call-info{text-align:center;position:relative;text-shadow:0 1px 4px rgb(0 0 0 / .6)}.call-name{font-size:24px;font-weight:700}.call-status .muted{color:#c4ccda}.call-controls{display:flex;gap:20px;position:relative}.round{width:64px;height:64px;border-radius:50%;border:none;background:#ffffff2e;color:#fff;font-size:24px;cursor:pointer}.round.on{background:#fff;color:#000}.round.danger{background:var(--danger)}.round.ok{background:var(--ok)}@media (max-width: 699px){.layout{grid-template-columns:1fr}.layout.has-chat .sidebar{display:none}.layout:not(.has-chat) .main{display:none}.sidebar{border-right:none}.chat-head .back{display:block;font-size:26px}.bubble{max-width:85%}}.spacer,.grow{flex:1}.lang-select{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;padding:6px 8px;font:inherit;font-size:14px}.btn.small{padding:6px 10px;font-size:13px}.tag{display:inline-block;margin-left:6px;font-size:11px;font-weight:600;background:var(--surface-2);color:var(--muted);border-radius:6px;padding:0 6px;vertical-align:middle}.avatar.group{background:var(--surface-2);font-size:20px}.avatar.small.group{font-size:16px}.link-wait{align-items:center;text-align:center}.link-wait details,.link-wait .steps{align-self:stretch;text-align:left}.steps{margin:0;padding-left:20px;font-size:14px}.qr{width:280px;height:280px;max-width:100%;border-radius:12px;background:#fff;image-rendering:pixelated}.qr.placeholder{display:grid;place-items:center;background:var(--surface-2)}.scanner{width:100%;max-height:320px;border-radius:12px;background:#000;object-fit:cover}.pick-list,.member-list,.device-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.pick-list{max-height:220px;overflow-y:auto}.member-list li,.device-list li{display:flex;align-items:center;gap:8px}.device-list li{padding:8px 0;border-bottom:1px solid var(--border)}.member{display:flex;align-items:center;gap:10px;flex:1;border:none;background:none;padding:6px 4px;border-radius:10px;cursor:pointer;text-align:left}.member:hover:not(:disabled){background:var(--surface-2)}.member:disabled{cursor:default}.bubble-sender{font-size:12px;font-weight:700;color:var(--accent);margin-bottom:2px}.bubble.has-att{padding:4px}.bubble.has-att .bubble-text,.bubble.has-att .bubble-meta,.bubble.has-att .bubble-sender{padding:0 8px}.bubble.has-att .bubble-meta{padding-bottom:4px}.att-media{display:block;border:none;padding:0;background:var(--surface-2);border-radius:12px;overflow:hidden;width:min(320px,70vw);max-height:360px;cursor:pointer;position:relative}.att-media img,video.att-media{display:block;width:100%;height:auto;max-height:360px;object-fit:cover}.att-media.placeholder{cursor:default;display:grid;place-items:center}.att-media .blur{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:blur(12px);transform:scale(1.1)}.att-state{position:relative;font-size:13px;background:#0000008c;color:#fff;padding:4px 10px;border-radius:999px}.att-state .link{color:#fff;margin-left:6px}.att-file{display:flex;align-items:center;gap:10px;padding:8px;min-width:220px;max-width:320px}.bubble.out .att-file .muted{color:inherit;opacity:.8}.att-icon{font-size:26px}.att-file-text{display:flex;flex-direction:column;min-width:0;flex:1}.att-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.bubble audio{width:min(300px,65vw);display:block}.file-chip{display:flex;align-items:center;gap:8px;margin:0 12px;padding:6px 6px 6px 12px;background:var(--surface-2);border-radius:10px;font-size:14px;min-width:0}.file-chip .att-name{flex:1}.lightbox{position:fixed;inset:0;z-index:40;background:#000000e6;display:grid;place-items:center;padding:16px;cursor:zoom-out}.lightbox img{max-width:100%;max-height:100%;object-fit:contain}details summary{cursor:pointer;color:var(--accent);font-weight:600;font-size:14px;margin-bottom:8px}.state.read{color:#8fd3ff;font-weight:700}.bubble.out .state.delivered,.bubble.out .state.sent{opacity:.9}.call-banner{display:flex;align-items:center;justify-content:space-between;gap:8px}.call.group-call{justify-content:space-between;gap:12px;padding-top:max(16px,env(safe-area-inset-top))}.group-call-head{position:relative;text-align:center;font-size:15px}.group-call-head .link{color:#fff;font-size:17px}.group-call-head .muted{color:#c4ccda}.tiles{flex:1;width:100%;max-width:1100px;min-height:0;display:grid;gap:8px;grid-template-columns:1fr;grid-auto-rows:1fr}.tiles.n2,.tiles.n3,.tiles.n4{grid-template-columns:1fr 1fr}.tiles.n5,.tiles.n6{grid-template-columns:1fr 1fr 1fr}.tile{position:relative;background:#1a2130;border-radius:14px;overflow:hidden;display:grid;place-items:center;min-height:0}.tile-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.tile.self .tile-video{transform:scaleX(-1)}.tile-avatar{width:72px;height:72px;border-radius:50%;background:var(--accent);display:grid;place-items:center;font-size:30px;font-weight:700}.tile-name{position:absolute;left:8px;bottom:8px;font-size:13px;background:#0000008c;padding:2px 8px;border-radius:8px}.tile-name .muted{color:#c4ccda}@media (max-width: 599px){.tiles.n2,.tiles.n3,.tiles.n4{grid-template-columns:1fr}.tiles.n3,.tiles.n4,.tiles.n5,.tiles.n6{grid-template-columns:1fr 1fr}}.hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}.strength{height:4px;border-radius:2px;background:var(--surface-2);overflow:hidden}.strength span{display:block;height:100%;width:10%;background:var(--danger);transition:width .2s}.strength.s1 span{width:25%}.strength.s2 span{width:50%;background:#e0a400}.strength.s3 span{width:75%;background:var(--ok)}.strength.s4 span{width:100%;background:var(--ok)}.error-text{color:var(--danger)}.request-panel{padding:12px 16px;padding-bottom:max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface)}.request-note{margin:0;padding:8px 12px;border-left:3px solid var(--accent);background:var(--surface-2);border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere}.bubble.out .state.sent,.bubble.out .state.delivered{opacity:.7}.bubble.out .state.read{color:#9dffcf;opacity:1;font-weight:800;text-shadow:0 0 1px rgb(0 0 0 / .25)}.toasts{position:fixed;right:16px;bottom:max(16px,env(safe-area-inset-bottom));z-index:45;display:flex;flex-direction:column;gap:8px;width:min(360px,calc(100vw - 32px))}.toast{display:flex;align-items:center;gap:4px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:4px;animation:toast-in .2s ease-out}.toast-body{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:2px;border:none;background:none;padding:8px 10px;text-align:left;cursor:pointer}.toast-body span{color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}@keyframes toast-in{0%{transform:translateY(8px);opacity:0}}@media (max-width: 599px){.toasts{right:16px;left:16px;width:auto;top:max(12px,env(safe-area-inset-top));bottom:auto}}
