:root{--tg-bg: #ffffff;--tg-text: #111111;--tg-hint: #8a8a8a;--tg-link: #2481cc;--tg-button: #2481cc;--tg-button-text: #ffffff;--tg-secondary: #f1f1f1;--line: color-mix(in srgb, var(--tg-hint) 24%, transparent);--line-soft: color-mix(in srgb, var(--tg-hint) 14%, transparent);--hover: color-mix(in srgb, var(--tg-hint) 10%, transparent);--danger: #d04848;--success: #2e9e5b;--radius: 14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:var(--tg-text);background:var(--tg-bg);-webkit-font-smoothing:antialiased}*{box-sizing:border-box}html,body{margin:0;height:100%;background:var(--tg-secondary)}#root{height:100%;max-width:1600px;margin:0 auto;background:var(--tg-bg)}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}.app-shell{height:100%;display:flex;flex-direction:column;background:var(--tg-bg)}.layout{display:flex;height:100%;min-height:0}.pane{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%}.pane-list{flex:1 1 auto;width:100%;background:var(--tg-bg)}.pane-chat{display:none;flex:1 1 auto}.layout.chat-open .pane-list{display:none}.layout.chat-open .pane-chat{display:flex}@media(min-width:900px){.pane-list{flex:0 0 340px;width:340px;border-right:1px solid var(--line)}.pane-chat,.layout.chat-open .pane-list{display:flex}.back{display:none}}.screen{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;flex:1}.header{display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--tg-bg);border-bottom:1px solid var(--line);flex-shrink:0}.header-main{min-width:0;flex:1}.header h1{margin:0;font-size:17px;font-weight:650;display:flex;align-items:center;gap:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-sub{margin-top:2px;font-size:12px;color:var(--tg-hint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-badge{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--tg-button);color:var(--tg-button-text);font-size:12px;font-weight:700;display:grid;place-items:center}.header-actions{display:flex;gap:6px;flex-shrink:0}.back{width:34px;height:34px;border:0;border-radius:50%;background:var(--tg-secondary);font-size:18px;line-height:1;flex-shrink:0}.back:hover{background:var(--hover)}.search-wrap{position:relative;padding:8px 12px;flex-shrink:0}.search{width:100%;padding:9px 32px 9px 12px;border:0;border-radius:12px;background:var(--tg-secondary);outline:none;font-size:14px}.search:focus{box-shadow:0 0 0 2px color-mix(in srgb,var(--tg-button) 40%,transparent)}.search-clear{position:absolute;right:20px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:var(--tg-hint);font-size:18px;line-height:1;padding:0 4px}.list{overflow-y:auto;flex:1;min-height:0}.row{display:flex;gap:12px;width:100%;padding:10px 14px;border:0;border-left:3px solid transparent;background:transparent;color:inherit;text-decoration:none;text-align:left}.row:hover{background:var(--hover)}.row.active{background:color-mix(in srgb,var(--tg-button) 12%,transparent);border-left-color:var(--tg-button)}.row.unread .name,.row.unread .preview{color:var(--tg-text);font-weight:650}.row.unread:not(.active){background:color-mix(in srgb,var(--tg-button) 6%,transparent)}.avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;font-size:15px;flex-shrink:0}.avatar.small{width:36px;height:36px;font-size:13px}.row-main{min-width:0;flex:1}.row-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.time{color:var(--tg-hint);font-size:12px;flex-shrink:0}.row-sub{margin-top:1px;font-size:12px;color:var(--tg-hint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:3px}.preview{color:var(--tg-hint);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--tg-button);color:var(--tg-button-text);font-size:12px;font-weight:700;display:grid;place-items:center;flex-shrink:0}.muted,.center{padding:24px 16px;color:var(--tg-hint);text-align:center}.center{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%}.banner{margin:8px 12px;padding:10px 12px;border-radius:10px;font-size:13px}.banner.error,.error{color:var(--danger)}.banner.error{background:color-mix(in srgb,var(--danger) 10%,transparent)}.error-text{color:var(--danger)}.placeholder{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:40px 28px;text-align:center;color:var(--tg-hint)}.placeholder.small{padding:32px 20px}.placeholder-icon{font-size:34px;opacity:.7}.placeholder h2{margin:0;font-size:16px;font-weight:650;color:var(--tg-text)}.placeholder p{margin:0;font-size:13px;max-width:320px;line-height:1.45}.spinner{width:22px;height:22px;border-radius:50%;border:2px solid var(--line);border-top-color:var(--tg-button);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.skeleton-list{padding:4px 0}.skeleton-row{display:flex;gap:12px;padding:12px 16px;align-items:center}.skeleton-avatar{width:46px;height:46px;border-radius:50%;flex-shrink:0}.skeleton-lines{flex:1;display:flex;flex-direction:column;gap:7px}.skeleton-lines span{height:10px;border-radius:5px}.skeleton-lines span:first-child{width:45%}.skeleton-lines span:last-child{width:80%}.skeleton-avatar,.skeleton-lines span{background:var(--line-soft);animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{50%{opacity:.45}}.chat-header{gap:10px}.chat-log{flex:1;overflow-y:auto;padding:12px 16px 18px;background:var(--tg-secondary);display:flex;flex-direction:column;gap:6px;min-height:0}.chat-log:before{content:"";flex:1 0 auto}.load-older{align-self:center;margin-bottom:6px}.day-divider{display:flex;justify-content:center;margin:10px 0 4px}.day-divider span{padding:3px 12px;border-radius:12px;background:color-mix(in srgb,var(--tg-bg) 75%,transparent);color:var(--tg-hint);font-size:12px;font-weight:600}.bubble-row{display:flex}.bubble-row.in{justify-content:flex-start}.bubble-row.out{justify-content:flex-end}.bubble{max-width:min(560px,82%);padding:8px 11px;border-radius:var(--radius);background:var(--tg-bg);box-shadow:0 1px 2px #00000014}.bubble-row.in .bubble{border-bottom-left-radius:5px}.bubble-row.out .bubble{background:color-mix(in srgb,var(--tg-button) 16%,var(--tg-bg));border-bottom-right-radius:5px}.bubble.failed{background:color-mix(in srgb,var(--danger) 10%,var(--tg-bg))}.bubble-text{white-space:pre-wrap;word-break:break-word;font-size:15px;line-height:1.4}.attachment{display:flex;align-items:center;gap:8px;margin-bottom:6px;padding:8px 10px;border-radius:10px;background:color-mix(in srgb,var(--tg-hint) 12%,transparent);font-size:13px}.attachment-icon{font-size:17px}.attachment-meta{min-width:0;display:flex;flex-direction:column;word-break:break-word}.attachment-note{font-style:normal;font-size:11px;color:var(--tg-hint)}.attachment-body{min-width:0;display:flex;flex-direction:column;gap:2px;word-break:break-word}.attachment-error{font-size:11px;color:#d14343}.attachment-media{display:flex;flex-direction:column;gap:6px;margin-bottom:6px}.attachment-media audio{width:100%;max-width:280px;height:36px}.attachment-media video{width:100%;max-width:320px;max-height:260px;border-radius:12px;background:#000}.photo-button{padding:0;border:0;background:none;border-radius:12px;overflow:hidden;cursor:zoom-in;line-height:0}.photo-button img{display:block;max-width:100%;max-height:320px;border-radius:12px}.media-placeholder{display:flex;align-items:center;justify-content:center;min-height:72px;padding:12px;border-radius:12px;background:color-mix(in srgb,var(--tg-hint) 12%,transparent);font-size:12px;color:var(--tg-hint)}.link-button{align-self:flex-start;border:0;padding:0;background:none;font-size:12px;color:var(--tg-link, var(--tg-button));text-decoration:underline;cursor:pointer}.link-button:disabled{opacity:.6;cursor:default}.recording-bar{margin:8px 12px 0;padding:8px 10px;border-radius:12px;background:color-mix(in srgb,#d14343 12%,var(--tg-secondary));display:flex;align-items:center;gap:10px;font-size:13px}.recording-time{flex:1;font-variant-numeric:tabular-nums}.recording-dot{width:10px;height:10px;border-radius:50%;background:#d14343;animation:pulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes pulse{0%,to{opacity:1}50%{opacity:.25}}.attach.mic.active{background:color-mix(in srgb,#d14343 20%,transparent);border-radius:10px}.bubble-meta{display:flex;justify-content:flex-end;gap:6px;margin-top:3px;font-size:11px;color:var(--tg-hint)}.status-failed{color:var(--danger)}.bubble-error{margin-top:4px;font-size:12px;color:var(--danger);word-break:break-word}.scroll-down{position:absolute;right:18px;bottom:96px;width:38px;height:38px;border:0;border-radius:50%;background:var(--tg-bg);color:var(--tg-text);box-shadow:0 2px 8px #0000002e;font-size:17px;line-height:1}.composer-wrap{background:var(--tg-bg);border-top:1px solid var(--line);flex-shrink:0}.composer-note{padding:8px 14px 0;font-size:13px}.composer-note.success{color:var(--success)}.file-chip{margin:8px 12px 0;padding:8px 10px;border-radius:12px;background:var(--tg-secondary);display:flex;align-items:center;gap:10px;font-size:13px}.file-icon{font-size:18px}.file-info{flex:1;min-width:0;display:flex;flex-direction:column}.file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.file-sub{color:var(--tg-hint);font-size:12px}.chip-remove{border:0;background:transparent;font-size:20px;line-height:1;padding:0 4px;flex-shrink:0}.progress{margin:8px 12px 0;height:4px;border-radius:4px;background:var(--tg-secondary);overflow:hidden}.progress span{display:block;height:100%;background:var(--tg-button);transition:width .15s linear}.composer{display:flex;flex-direction:column;gap:8px;padding:10px 12px 4px}.composer-actions{display:flex;align-items:center;gap:8px}.composer-actions .send{margin-left:auto}.composer textarea{width:100%;min-height:40px;max-height:140px;resize:none;border:0;border-radius:18px;padding:10px 14px;background:var(--tg-secondary);outline:none;font-size:15px;line-height:1.35}.composer textarea:focus{box-shadow:0 0 0 2px color-mix(in srgb,var(--tg-button) 40%,transparent)}.attach{width:40px;height:40px;flex-shrink:0;border:0;border-radius:50%;background:var(--tg-secondary);font-size:17px}.attach:hover:not(:disabled){background:var(--hover)}.send,.primary{border:0;border-radius:18px;padding:10px 16px;background:var(--tg-button);color:var(--tg-button-text);font-weight:650;flex-shrink:0}.ghost{border:1px solid var(--line);border-radius:10px;padding:5px 10px;background:transparent;color:var(--tg-text);font-size:13px}.ghost:hover:not(:disabled){background:var(--hover)}.ghost.danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 40%,transparent)}.composer-hint{padding:0 14px calc(8px + env(safe-area-inset-bottom));font-size:11px;color:var(--tg-hint);min-height:18px}@media(hover:none){.composer-hint span:not(.error-text){visibility:hidden}}.login{padding:32px 20px;display:flex;flex-direction:column;gap:12px;max-width:420px;margin:0 auto}.login h1{margin:0;font-size:22px}.login .muted{padding:0;text-align:left}.login input{padding:12px;border-radius:12px;border:0;background:var(--tg-secondary)}
