:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#18243b;background:#f0f4fa;font-size:15px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer;border:0;border-radius:12px;padding:11px 16px;background:#1262f4;color:white}button:disabled{opacity:.5;cursor:default}button.secondary{background:#edf2fa;color:#425571}button.danger{background:#fff0f0;color:#b53535}input,textarea,select{border:1px solid #dce3ee;border-radius:10px;padding:12px;background:white;color:#18243b;max-width:100%}input:focus,textarea:focus{outline:2px solid #84b3ff}h1,h2,h3,p{margin-top:0}small,.muted{color:#7b879c}label{display:block;margin:12px 0}label input:not([type=checkbox]){display:block;width:100%;margin-top:8px}#toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);background:#192e50;color:white;border-radius:12px;padding:12px 22px;z-index:10;display:none;max-width:90vw}.login{min-height:100dvh;display:grid;place-items:center;padding:24px;background:radial-gradient(at top left,#d8efff,transparent 55%),radial-gradient(at bottom right,#e3ddff,transparent 55%)}.login form{width:390px;max-width:100%;padding:36px;background:white;border:1px solid #e5eaf3;border-radius:28px;box-shadow:0 22px 80px #243b6710}.brand{display:flex;align-items:center;gap:12px}.brand img{width:46px;height:46px;border-radius:12px}.brand h1{font-size:24px;margin:0}.tag{background:#eef5ff;color:#2c6cce;padding:7px 10px;border-radius:8px;font-size:12px}.login .tag{display:inline-block;margin:24px 0 8px}.login button{width:100%;margin:12px 0}.app{display:grid;grid-template-columns:320px 1fr;height:100dvh;max-width:1500px;margin:auto;background:white;border-inline:1px solid #e2e8f0}.sidebar{display:flex;flex-direction:column;background:#f8faff;border-right:1px solid #e2e8f0;min-height:0}.sidebar>header{padding:26px 22px 18px}.sidebar .brand h1{font-size:22px}.sidebar .brand img{width:40px;height:40px}.nav{display:flex;gap:8px;padding:0 18px 18px}.nav button{flex:1;background:#eaf0fb;color:#41618c;padding:10px 6px}.search{margin:0 18px 18px;width:calc(100% - 36px)}.conversations{overflow:auto;flex:1;padding:0 10px}.conversation{width:100%;display:flex;align-items:center;text-align:left;gap:12px;padding:16px 12px;background:transparent;color:#18243b;margin-bottom:5px;border-radius:14px}.conversation.active{background:#e8f0ff}.avatar{display:grid;place-items:center;width:46px;height:46px;flex-shrink:0;background:#dbe9ff;color:#1961cd;border-radius:15px;font-weight:650}.avatar.group{background:#e9e2ff;color:#7350c1}.conversation .meta{min-width:0;flex:1}.conversation strong{display:block;margin-bottom:6px}.conversation small{font-size:12px}.badge{background:#f35d71;border-radius:12px;color:white;padding:3px 7px;font-size:11px}.sidefooter{padding:16px 22px;border-top:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;font-size:13px}.sidefooter button{padding:7px 10px}.chat{display:flex;flex-direction:column;min-width:0;min-height:0}.chathead{padding:22px 28px;border-bottom:1px solid #e8edf4;display:flex;align-items:center;gap:12px}.chathead h2{font-size:18px;margin:0 0 6px}.chathead .right{margin-left:auto}.chathead small{font-size:12px}.back{display:none}.messages{flex:1;overflow:auto;padding:24px 28px;background:#f3f6fa}.notice{text-align:center;font-size:12px;color:#8190a4;margin-bottom:24px}.message{display:flex;flex-direction:column;align-items:flex-start;margin:16px 0}.message.me{align-items:flex-end}.message small{font-size:11px;margin:0 4px 6px}.bubble{background:white;border:1px solid #e7edf5;box-shadow:0 2px 3px #23344d03;border-radius:4px 16px 16px 16px;padding:12px 16px;white-space:pre-wrap;overflow-wrap:anywhere;max-width:min(80%,600px);line-height:1.6}.me .bubble{background:#dcebff;border-color:#cce0ff;border-radius:16px 4px 16px 16px}.bubble img{display:block;max-width:100%;max-height:320px;border-radius:10px;cursor:zoom-in}.bubble audio{max-width:100%;width:250px}.composer{padding:14px 24px 18px;border-top:1px solid #e6ecf4}.tools{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap}.tools button{background:#f0f4fb;color:#506987;padding:9px 12px}.inputrow{display:flex;gap:12px;align-items:flex-end}.inputrow textarea{flex:1;resize:none;min-height:56px;max-height:150px;border:0;background:#f6f8fc}.inputrow button{flex-shrink:0}.composer footer{font-size:11px;color:#94a0b2;margin-top:9px;display:flex;justify-content:space-between}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#7888a1;text-align:center;padding:28px}.empty img{width:95px;border-radius:25px;margin-bottom:24px;box-shadow:0 12px 40px #1663ed20}.empty h2{color:#283d5e;font-weight:550}.empty p{max-width:340px;font-size:13px;line-height:1.8}.emojis{display:flex;flex-wrap:wrap;gap:8px;max-width:450px}.emojis button{font-size:25px;background:#f2f5fa;padding:8px}dialog{border:1px solid #e3e9f3;border-radius:22px;padding:25px;max-width:94vw;width:520px;max-height:90dvh;overflow:auto;box-shadow:0 24px 120px #13234340}dialog::backdrop{background:#17274466}dialog h2{font-size:20px}dialog #closemodal{margin-top:18px}dialog .row{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid #eef1f6}dialog .row button{font-size:12px;padding:8px 10px}dialog .row .actions{display:flex;gap:5px}canvas{display:block;width:100%;height:auto;touch-action:none;background:#e9edf4;border-radius:8px}.edittools{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.edittools button.selected{background:#1d56bc;color:white}.edittools input{width:50px;padding:3px}.hint{font-size:12px;line-height:1.7;color:#7d8da6}.status{font-size:11px;color:#8292aa;padding:0 28px 8px}form .error{color:#c93647;font-size:13px}#connection.offline{color:#cc4353}.recording{background:#fff0f0!important;color:#cb3a3a!important}button:focus-visible{outline:3px solid #9dbeff;outline-offset:3px}
@media(max-width:700px){.app{display:block}.sidebar{height:100dvh;width:100%}.chat{height:100dvh;display:none}.app.open .sidebar{display:none}.app.open .chat{display:flex}.back{display:block;padding:7px 12px;background:#edf2fa;color:#425571}.chathead{padding:15px}.chathead .tag{display:none}.messages{padding:18px 14px}.composer{padding:10px 12px max(14px,env(safe-area-inset-bottom))}.bubble{max-width:88%}.composer footer span:last-child{display:none}.sidebar>header{padding-top:22px}.inputrow{gap:8px}.inputrow button{padding:12px}.chathead h2{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}dialog{padding:20px}}

.gifgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.gifgrid button{padding:0;overflow:hidden}.gifgrid img{display:block;width:100%}details{margin:20px 0}summary{cursor:pointer}

.login label.remember{display:flex;align-items:center;gap:8px;font-size:13px}.remember input{width:17px;height:17px}

.status[hidden]{display:none}.composer footer{justify-content:flex-end}@media(max-width:700px){.composer footer{display:none}}

/* Device viewport and safe-area layout */
html,body{height:100%;width:100%;overflow:hidden;overscroll-behavior:none}#root{height:var(--app-height,100dvh);width:100%;overflow:hidden}.app{height:100%;width:100%;min-height:0;overflow:hidden}.sidebar>header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.accounttools{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-left:auto}.accountname{font-size:13px;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gear{display:grid;place-items:center;padding:8px;background:#edf2fa;color:#425571;flex-shrink:0}.chathead,.composer,.nav,.search{flex-shrink:0}.messages,.conversations{min-height:0;overscroll-behavior:contain;overflow-x:hidden}.inputrow textarea{min-width:0;width:0}.chathead>div{min-width:0}.chathead h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tools{min-width:0}.login{height:100%;min-height:0;overflow:auto}dialog{max-height:calc(var(--app-height,100dvh) - 32px)}
@media(max-width:700px){
.app{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);border:0}.sidebar,.chat{height:100%;min-height:0;width:100%;max-width:100%}.sidebar>header{padding:16px 18px;flex-wrap:nowrap}.sidebar .brand{gap:8px;min-width:0}.sidebar .brand h1{font-size:21px;white-space:nowrap}.accountname{max-width:65px}.accounttools{gap:3px}.brand img{flex-shrink:0}.composer{padding:10px 12px 12px}.chathead{gap:8px}.chathead .tag{display:block;margin-left:auto;font-size:10px;padding:6px;white-space:nowrap}.chathead h2{max-width:135px}.chathead #groupinfo{padding:8px;font-size:12px;flex-shrink:0}.chathead .back{padding:8px 10px;flex-shrink:0}.tools{gap:6px;flex-wrap:nowrap}.tools button{font-size:13px;padding:9px 8px;white-space:nowrap}.inputrow textarea,input,textarea,select{font-size:16px}.inputrow button{padding:12px 14px}.inputrow{min-width:0}.bubble audio{width:230px;max-width:100%}.bubble{min-width:0}.login{padding:16px}.login form{padding:26px 22px}.chat .empty{display:none}
}
@media(max-width:360px){.sidebar .brand h1{font-size:18px}.sidebar .brand img{width:34px;height:34px}.accountname{max-width:48px}.chathead .tag{font-size:9px}.tools button{padding:9px 6px}.chathead h2{max-width:95px}}

button,a,input,textarea,select{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{user-select:none;-webkit-user-select:none}button:active{filter:brightness(.96)}.chathead,.composer{position:relative;z-index:1}.messages{overflow-anchor:none;scroll-behavior:auto}
@media(max-width:700px){.gear,.back,.nav button,.tools button,.inputrow button,#groupinfo{min-height:44px}.gear{min-width:44px}.tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.tools button{min-width:0;padding:9px 2px;font-size:13px;border-radius:11px}.inputrow{align-items:stretch}.inputrow textarea{min-height:52px;max-height:110px;line-height:1.5;padding:12px}.inputrow button{align-self:stretch;min-width:60px}.chathead{min-height:68px}.chathead>div{flex:1}.chathead .tag{flex:0 0 auto}.accounttools .gear svg{display:block}.accounttools{flex-shrink:0}.chathead .back{min-width:38px}}
body{position:fixed;inset:0}

.avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.accountavatar{width:25px;height:25px;border-radius:8px;object-fit:cover}.accountname{display:flex;align-items:center;gap:5px}.profileactions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:15px}#avatarfile[hidden]{display:none}

.notificationentry{margin:0 18px 14px;font-size:13px;background:#e4efff;color:#2164c6}.senderavatar{width:22px;height:22px;object-fit:cover;border-radius:7px;vertical-align:middle;margin-right:5px}
.inputrow [hidden]{display:none!important}.voice-toggle{display:grid;place-items:center;padding:8px;min-width:42px;align-self:center;background:#edf2fa;color:#425571}#holdtalk{flex:1;min-width:0;background:#f0f3f7;color:#28384b;font-size:17px;font-weight:550;min-height:54px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}#holdtalk.holding{background:#dce8fb}.tools{grid-template-columns:repeat(3,minmax(0,1fr))}#voiceoverlay{position:fixed;inset:0;z-index:20;background:#17243b22;display:grid;place-items:center;pointer-events:none}.voiceindicator{background:#1c3351ed;color:white;border-radius:24px;padding:28px 35px;text-align:center;min-width:200px}.voiceindicator>svg{width:44px;height:44px}.voiceindicator strong{display:block;font-size:25px;margin-top:10px}.voiceindicator p{font-size:14px;margin:12px 0 0}#voiceoverlay.cancel .voiceindicator{background:#b9414bf2}.voicewaves{height:32px;display:flex;align-items:center;justify-content:center;gap:5px;margin-top:12px}.voicewaves i{display:block;background:#77befb;width:5px;height:25px;border-radius:5px;animation:voicewave .7s ease-in-out infinite alternate}.voicewaves i:nth-child(2){animation-delay:.2s}.voicewaves i:nth-child(3){animation-delay:.4s}.voicewaves i:nth-child(4){animation-delay:.1s}.voicewaves i:nth-child(5){animation-delay:.3s}@keyframes voicewave{from{transform:scaleY(.3)}to{transform:scaleY(1)}}@media(prefers-reduced-motion:reduce){.voicewaves i{animation:none}}.message-toast{position:fixed;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:15;max-width:calc(100% - 24px);width:350px;text-align:left;background:#1c3351;color:white;border-radius:16px;box-shadow:0 8px 32px #15243b35;padding:16px;cursor:pointer}.message-toast small{color:#bed7f2;display:block;margin-top:5px}
@media(max-width:700px){.inputrow .voice-toggle{min-width:42px;width:42px;min-height:44px}.inputrow #holdtalk{min-width:0;width:0;min-height:54px}.inputrow #text{padding:12px 10px}.inputrow #send{min-width:54px;padding:10px}.inputrow{gap:6px}}
.voice-message{display:flex;align-items:center;justify-content:space-between;gap:28px;min-width:125px;max-width:100%;min-height:34px;padding:0;background:transparent;color:#295583;font-size:16px}.soundwave{font-size:20px;letter-spacing:-5px;line-height:1}.voice-message.playing .soundwave{animation:voiceplaying .7s infinite alternate}@keyframes voiceplaying{from{opacity:.35}to{opacity:1}}audio[hidden]{display:none!important}

.pullstatus{flex-shrink:0;text-align:center;padding:10px;color:#567498;font-size:12px;background:#eef4fd}.pullstatus[hidden]{display:none}

.inputrow .voice-toggle{width:30px;min-width:30px;height:36px;min-height:36px;padding:4px;background:transparent;align-self:center;border-radius:9px}.voice-toggle svg{width:20px;height:20px}@media(max-width:700px){.inputrow .voice-toggle{width:30px;min-width:30px;min-height:36px;height:36px;padding:4px}.inputrow{gap:4px}.inputrow #text{flex:1;min-width:0}}

.message>small{display:flex;align-items:center;gap:4px;min-height:24px}.message-menu{font-size:20px;line-height:1;padding:0 6px;min-width:28px;min-height:26px;background:transparent;color:#7086a1;border-radius:7px}.message-actions{display:flex;gap:10px;flex-wrap:wrap}.withdrawn{background:transparent!important;border-color:transparent!important;box-shadow:none!important;color:#8491a3;font-size:12px;font-style:italic}#editmessageform textarea{width:100%;resize:vertical}@media(max-width:700px){.message-menu{min-width:36px;min-height:32px}}

#root{position:fixed;left:0;top:var(--viewport-top,0px);height:var(--app-height,100dvh);width:100%;max-width:100%;overflow:hidden}@media(max-width:700px){.keyboard-open .app{padding-bottom:0}.keyboard-open .composer{padding-bottom:2px}.keyboard-open .composer footer{display:none}}
