:root{color-scheme:light;--bg: #eef1f4;--panel: #ffffff;--ink: #15202b;--muted: #5c6b7a;--line: #d5dde5;--accent: #1f6f5b;--accent-ink: #ffffff;--human: #e8f1ff;--agent: #eef7f0;--system: #f4f1ea;--integration: #f7eef5;--danger: #a11919;font-family:IBM Plex Sans,Segoe UI,sans-serif;line-height:1.45;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;overflow:hidden}#root{overflow:hidden}button,input,textarea{font:inherit}.login-shell{min-height:100%;height:100%;overflow:auto;display:grid;place-items:center;padding:2rem;background:radial-gradient(circle at top left,rgba(31,111,91,.12),transparent 40%),linear-gradient(180deg,#f7faf8,var(--bg))}.login-lang{margin-bottom:1rem}.login-lang .lang-switch button{border-color:var(--line);color:var(--ink);background:var(--panel)}.login-lang .lang-switch button.active{background:#1f6f5b1f;border-color:var(--accent);color:var(--ink)}.card{width:min(420px,100%);background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:2rem;box-shadow:0 10px 30px #15202b0f}h1,h2{margin:0;font-weight:650}.muted{color:var(--muted)}.error{color:var(--danger)}.tg-auth-button{display:block;width:100%;margin-top:1.25rem;padding:.75rem 1rem;border:0;border-radius:8px;background:#54a9eb;color:#fff;cursor:pointer}.chat-shell{display:grid;grid-template-columns:280px 1fr 240px;height:100%;overflow:hidden;background:var(--bg)}.sidebar{display:flex;flex-direction:column;background:#163028;color:#edf5f1;border-right:1px solid #0f211c;min-width:0;min-height:0;height:100%;overflow:hidden}.sidebar-top{display:flex;align-items:center;justify-content:space-between;padding:1rem 1rem .5rem}.brand{font-size:1.15rem;letter-spacing:.02em}.sidebar-actions{padding:.5rem 1rem .75rem}.topic-nav{display:flex;flex-direction:column;gap:.25rem;padding:0 .5rem;overflow:auto;flex:1;min-height:0}.topic-item{display:flex;flex-direction:column;align-items:flex-start;gap:.1rem;width:100%;border:0;border-radius:8px;background:transparent;color:inherit;padding:.55rem .7rem;cursor:pointer;text-align:left}.topic-item:hover,.topic-item.active{background:#ffffff14}.topic-name{color:#edf5f1a6;font-size:.85rem}.sidebar-user{padding:1rem;border-top:1px solid rgba(255,255,255,.08);display:flex;flex-direction:column;gap:.35rem}.lang-switch{display:grid;grid-template-columns:1fr 1fr;gap:.25rem;margin-bottom:.35rem}.lang-switch button{border:1px solid rgba(237,245,241,.22);background:transparent;color:#edf5f1d9;border-radius:6px;padding:.35rem .4rem;font-size:.8rem;cursor:pointer}.lang-switch button.active{background:#edf5f124;border-color:#edf5f173;color:#edf5f1;font-weight:600}.lang-switch button:hover{border-color:#edf5f166}.chat-main{display:grid;grid-template-rows:auto 1fr auto;min-width:0;min-height:0;height:100%;overflow:hidden;background:var(--panel)}.chat-header{display:flex;align-items:center;gap:.75rem;padding:.85rem 1rem;border-bottom:1px solid var(--line)}.ws-status{margin-left:auto;color:var(--muted);font-size:.9rem}.message-list{overflow:auto;min-height:0;padding:1rem;display:flex;flex-direction:column;gap:.75rem;background:linear-gradient(180deg,#f8fafb,#fff 120px)}.msg{border:1px solid var(--line);border-radius:12px;padding:.75rem .9rem;max-width:min(720px,100%)}.msg-human{background:var(--human)}.msg-agent{background:var(--agent)}.msg-system{background:var(--system)}.msg-integration{background:var(--integration)}.msg-self{margin-left:auto}.msg-header{display:flex;gap:.5rem;align-items:baseline;flex-wrap:wrap;margin-bottom:.35rem}.msg-author{font-weight:650}.msg-source,.msg-time{color:var(--muted);font-size:.85rem}.msg-parent{display:block;width:100%;text-align:left;border:0;border-left:3px solid rgba(21,32,43,.2);background:#ffffff8c;color:var(--muted);padding:.35rem .55rem;margin-bottom:.45rem;border-radius:0 8px 8px 0;cursor:pointer}.msg-content{margin:0;white-space:pre-wrap;word-break:break-word;font:inherit}.msg-footer{margin-top:.45rem}.msg-highlight{outline:2px solid var(--accent)}.composer{border-top:1px solid var(--line);padding:.85rem 1rem 1rem;background:#fbfcfd}.reply-context{display:flex;justify-content:space-between;gap:.75rem;background:#eef6f3;border:1px solid #cfe0d9;border-radius:10px;padding:.55rem .7rem;margin-bottom:.65rem}.reply-snippet{margin:.2rem 0 0;color:var(--muted);font-size:.9rem}.composer-row{display:grid;grid-template-columns:1fr auto;gap:.65rem}.composer textarea{width:100%;resize:vertical;min-height:4.5rem;border:1px solid var(--line);border-radius:10px;padding:.7rem .8rem}.composer button,.btn-secondary,.sidebar-actions button{border:0;border-radius:8px;background:var(--accent);color:var(--accent-ink);padding:.7rem 1rem;cursor:pointer}.btn-secondary,.sidebar-actions button{background:transparent;color:inherit;border:1px solid rgba(255,255,255,.25)}.composer button:disabled{opacity:.55;cursor:not-allowed}.composer-meta{display:flex;justify-content:space-between;gap:1rem;margin-top:.45rem;font-size:.85rem}.link-btn,.icon-btn{border:0;background:transparent;color:var(--accent);cursor:pointer;padding:0}.sidebar .link-btn{color:#9fd7c4;text-align:left}.icon-btn{font-size:1.35rem;line-height:1;color:inherit}.load-older{align-self:center;color:var(--ink);border:1px solid var(--line);background:#fff}.empty-state,.pad{padding:1rem}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f171473;display:grid;place-items:center;padding:1rem;z-index:20}.modal{width:min(420px,100%);background:var(--panel);border-radius:12px;padding:1.25rem;display:flex;flex-direction:column;gap:.75rem}.modal label{display:flex;flex-direction:column;gap:.35rem;font-size:.95rem}.modal input{border:1px solid var(--line);border-radius:8px;padding:.6rem .7rem}.modal-actions{display:flex;justify-content:flex-end;gap:.5rem}.modal .btn-secondary{color:var(--ink);border-color:var(--line)}.roster-panel{border-left:1px solid var(--line);background:var(--panel);display:flex;flex-direction:column;min-width:220px;max-width:280px;min-height:0;height:100%;overflow:hidden}.roster-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid var(--line)}.roster-list{list-style:none;margin:0;padding:.5rem;overflow:auto;flex:1;min-height:0}.roster-item{width:100%;display:flex;gap:.5rem;align-items:flex-start;text-align:left;border:0;background:transparent;padding:.45rem .35rem;border-radius:8px;cursor:pointer;color:inherit}.roster-item:hover{background:#0000000a}.roster-meta{display:flex;flex-direction:column;gap:.1rem;min-width:0}.roster-name{font-weight:600;font-size:.92rem}.roster-role,.roster-status{font-size:.78rem}.presence-dot.online{color:#1b7f4a}.presence-dot.offline{color:#8a8f8c}.avatar-fallback{display:inline-grid;place-items:center;border-radius:50%;background:#d7e2db;font-size:.7rem;font-weight:700}.avatar-btn{border:0;padding:0;background:transparent;cursor:pointer}.role-badge{font-size:.72rem;border:1px solid var(--line);border-radius:999px;padding:.05rem .45rem}.linkish{border:0;background:transparent;padding:0;font:inherit;font-weight:600;cursor:pointer;color:inherit}.mini-profile{width:min(440px,100%);background:var(--panel);border-radius:12px;padding:1rem;display:flex;flex-direction:column;gap:.75rem}.mini-profile-header{display:flex;gap:.75rem;align-items:flex-start}.mini-profile-edit label,.mini-profile-view p{display:flex;flex-direction:column;gap:.3rem}.mini-profile-edit input,.mini-profile-edit textarea{border:1px solid var(--line);border-radius:8px;padding:.5rem .65rem;font:inherit}.row-actions{display:flex;gap:.5rem}.mobile-only{display:none}@media (max-width: 800px){.chat-shell{grid-template-columns:1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:min(84vw,300px);transform:translate(-105%);transition:transform .18s ease;z-index:10}.sidebar.open{transform:translate(0)}.roster-panel{position:fixed;inset:0 0 0 auto;width:min(84vw,300px);max-width:none;transform:translate(105%);transition:transform .18s ease;z-index:10}.roster-panel.open{transform:translate(0)}.mobile-only{display:inline-flex}}
