/* Staff chat uses the clinic palette and existing controls. */
.tc-shell{display:grid;grid-template-columns:290px minmax(0,1fr);padding:0;overflow:hidden;height:calc(100dvh - 148px);min-height:470px;max-height:1000px}
.tc-sidebar{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:var(--bg)}
.tc-list-head{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px}.tc-list-head h2{font-size:18px}.tc-list-head button{font-size:24px}
.tc-sidebar>.search{margin:0 12px 12px;flex:none}.tc-sidebar .search input{min-width:0;font-size:14px}.tc-rooms{overflow:auto;min-height:0;flex:1}
.tc-room{display:flex;width:100%;height:auto;min-height:80px;gap:10px;padding:14px 12px;border:0;border-radius:0;border-bottom:1px solid var(--line);white-space:normal;text-align:left;background:transparent;justify-content:flex-start;font-weight:400}
.tc-room.active{background:var(--green-bg);box-shadow:inset 3px 0 var(--green)}.tc-room:hover{background:var(--green-bg)}.tc-room .avatar{flex-shrink:0}
.tc-room-text{flex:1;min-width:0}.tc-room-text strong{font-size:14px;display:block;overflow-wrap:anywhere}.tc-room-text small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;font-size:12px;margin-top:4px}.tc-room-meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px;font-size:11px}.tc-room-meta .counter{font-size:12px}.tc-list-label{padding:8px 16px}
.tc-pane{display:flex;flex-direction:column;min-width:0;min-height:0;background:#fff}.tc-head{min-height:76px;padding:14px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}.tc-head h2{font-size:18px;overflow-wrap:anywhere}.tc-head .quiet{font-size:12px;margin-top:3px}.tc-head>div{min-width:0}.tc-back{display:none}
.tc-error{margin:12px 16px 0;flex-shrink:0;overflow-wrap:anywhere}.tc-error[hidden],.tc-bottom[hidden],.tc-recording[hidden]{display:none!important}
.tc-log{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px;background:var(--bg);scrollbar-gutter:stable}.tc-empty{padding:24px;text-align:center}.tc-message{display:flex;margin:0 0 14px}.tc-message.own{justify-content:flex-end}.tc-bubble{max-width:86%;min-width:110px;padding:12px 14px;border:1px solid var(--line);border-radius:14px 14px 14px 3px;background:white}.own .tc-bubble{background:var(--green-bg);border-radius:14px 14px 3px 14px}.tc-author{font-size:12px;color:var(--blue)}.tc-text{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:4px;font-size:15px}.is-deleted .tc-text{font-style:italic}.tc-message-meta{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:6px;flex-wrap:wrap;color:var(--muted);font-size:11px}.tc-message-meta button.tc-read,.tc-message-meta button.tc-delete{min-height:28px;border:0;background:none;padding:0;font-size:11px;color:var(--muted);font-weight:400;white-space:normal;text-align:left}.tc-message-meta button.tc-read.is-read{color:var(--green);font-weight:600}.tc-message-meta button.tc-delete{min-width:28px;font-size:18px}
.tc-file{margin-top:8px;max-width:100%;min-width:0}.tc-download{display:block;font-size:13px;overflow-wrap:anywhere;max-width:100%;margin-top:5px;text-decoration:underline}.tc-photo{display:block;width:260px;height:195px;max-width:100%;max-height:280px;border-radius:8px;object-fit:contain}.tc-load-more{display:flex;margin:0 auto 16px;font-size:13px}
/* Voice message: round play button and a waveform that fills as it plays. */
.tc-ic{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none;pointer-events:none}.tc-ic.is-solid{fill:currentColor;stroke:none}
.tc-voice{display:flex;align-items:center;gap:10px;min-width:0;width:100%}
button.tc-voice-play{position:relative;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:var(--green);color:#fff;display:inline-flex;align-items:center;justify-content:center;touch-action:manipulation}button.tc-voice-play:hover:not(:disabled){background:#214F43}button.tc-voice-play:disabled{opacity:.45;cursor:default}
.tc-voice.is-busy .tc-voice-play::after{content:"";position:absolute;inset:-3px;border-radius:50%;border:2px solid transparent;border-top-color:var(--green);animation:tc-spin .8s linear infinite}@keyframes tc-spin{to{transform:rotate(360deg)}}
.tc-voice-body{flex:1;min-width:0}.tc-voice-wave{display:flex;align-items:center;gap:2px;height:26px;cursor:pointer;touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;border-radius:4px}.tc-voice-wave i{display:block;flex:0 1 3px;min-width:1.5px;border-radius:2px;background:#285F5066;transition:background-color .1s}.tc-voice-wave i.on{background:var(--green)}.tc-voice.is-pending .tc-voice-wave i{background:#285F5026}
.tc-voice-time{display:inline-block;vertical-align:top;font-size:12px;line-height:16px;color:var(--muted);font-variant-numeric:tabular-nums}
.tc-voice.is-compact{gap:8px}.tc-voice.is-compact button.tc-voice-play{width:32px;height:32px;min-width:32px;min-height:32px}.tc-voice.is-compact .tc-ic{width:16px;height:16px}.tc-voice.is-compact .tc-voice-body{display:flex;align-items:center;gap:8px}.tc-voice.is-compact .tc-voice-wave{flex:1;min-width:0;height:24px;gap:1.5px;overflow:hidden}.tc-voice.is-compact .tc-voice-wave i{min-width:1px}.tc-voice.is-compact .tc-voice-time{font-size:13px}
.tc-bubble.is-voice{padding:8px 12px 4px;width:fit-content;min-width:min(250px,100%)}.tc-bubble.is-voice .tc-file{margin-top:0}.tc-bubble.is-voice .tc-author{display:block;margin-bottom:6px}.tc-bubble.is-voice .tc-message-meta{margin-top:-20px;flex-wrap:nowrap;gap:5px;white-space:nowrap;pointer-events:none;min-height:24px}.tc-bubble.is-voice .tc-message-meta button{pointer-events:auto;min-height:24px;white-space:nowrap}.tc-message-meta button.tc-read.is-read{color:var(--green)}
/* Composer: one round button that is the microphone while empty and send when there is content. */
.tc-compose{padding:12px 16px;border-top:1px solid var(--line);flex-shrink:0}.tc-compose-row{display:flex;align-items:flex-end;gap:8px}.tc-compose-row textarea{flex:1;min-width:0;min-height:44px;max-height:140px;resize:none;width:100%;border:1px solid var(--line);border-radius:22px;padding:10px 16px;font:inherit;line-height:22px;background:var(--bg);overflow-y:auto}.tc-compose-hint{font-size:11px;margin-top:6px}.tc-compose.is-recording .tc-compose-row,.tc-compose.is-recording .tc-compose-hint{display:none}
button.tc-round{flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:transparent;color:var(--ink);touch-action:manipulation}button.tc-round[hidden]{display:none}button.tc-compose-btn{color:var(--muted)}button.tc-compose-btn:hover:not(:disabled){background:var(--green-bg);color:var(--green)}
button.tc-rec-send{background:var(--green);color:#fff}button.tc-rec-send:hover:not(:disabled){background:#214F43}button.tc-rec-send .tc-ic{width:20px;height:20px;transform:translateX(-1px)}button.tc-rec-trash{color:var(--red)}button.tc-rec-trash:hover:not(:disabled){background:var(--red-bg)}button.tc-rec-pause{border:1.5px solid var(--ink)}button.tc-rec-pause:hover:not(:disabled){background:var(--green-bg)}button.tc-rec-pause .tc-ic.is-solid{width:18px;height:18px}
.tc-recording{display:flex;align-items:center;gap:8px}.tc-rec-track{flex:1;min-width:0;height:44px;border-radius:22px;background:var(--green-bg);display:flex;align-items:center;padding:0 14px}.tc-rec-live,.tc-rec-preview{flex:1;min-width:0;display:flex;align-items:center;gap:10px}.tc-rec-live[hidden],.tc-rec-preview[hidden]{display:none}.tc-rec-preview{margin-left:-8px}
.tc-rec-dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--red);animation:tc-pulse 1.2s ease-in-out infinite}@keyframes tc-pulse{50%{opacity:.35}}#tc-rec-wave{flex:1;min-width:0;width:100%;height:30px;color:var(--green);display:block}.tc-rec-time{flex:none;font-size:14px;color:var(--ink);font-variant-numeric:tabular-nums}
@media(prefers-reduced-motion:reduce){.tc-rec-dot{animation:none}.tc-voice.is-busy .tc-voice-play::after{animation-duration:2s}}.tc-compose :disabled{opacity:.55;cursor:default}.tc-queue{display:flex;gap:8px;flex-wrap:wrap}.tc-queued{display:flex;align-items:center;gap:8px;border:1px solid var(--line);padding:6px 8px;border-radius:8px;margin-bottom:8px;max-width:100%;min-width:0;flex-wrap:wrap}.tc-queued img{width:42px;height:42px;object-fit:cover;border-radius:5px}.tc-queued-name{font-size:12px;overflow-wrap:anywhere;flex:1;min-width:80px}.tc-queued button{min-height:32px;padding:0 6px}.tc-queued.is-voice{flex:1 1 100%;flex-wrap:nowrap;border-radius:14px;background:var(--green-bg);border-color:transparent;padding:8px 10px}.tc-queued.is-voice .tc-voice{flex:1;min-width:0}.tc-progress{font-size:12px;overflow-wrap:anywhere}.tc-progress:empty{display:none}.tc-bottom{flex-shrink:0;align-self:center;color:var(--blue);font-size:13px}.tc-drag{outline:3px dashed var(--green);outline-offset:-4px}
.team-chat .fab{display:none!important}
@media(max-width:1100px) and (min-width:701px){.tc-shell{grid-template-columns:240px minmax(0,1fr)}.tc-room-text small{max-width:110px}}
@media(max-width:700px){.team-chat .main{padding-bottom:92px}.team-chat .pagehead .head-tools{display:none}.team-chat .pagehead{margin-bottom:12px;min-height:36px}.tc-shell{display:block;height:calc(100dvh - 185px);min-height:0;border-radius:12px}.tc-sidebar{height:100%;border:0}.tc-pane{display:none;height:100%}.tc-shell.is-conversation .tc-sidebar{display:none}.tc-shell.is-conversation .tc-pane{display:flex}.tc-back{display:inline-flex;font-size:28px;padding:0 8px}.tc-head{padding:10px 12px;min-height:68px}.tc-head h2{font-size:16px}.tc-log{padding:12px}.tc-bubble{max-width:94%;padding:10px 12px}.tc-compose{padding:8px 10px}.tc-compose-row{gap:4px}.tc-compose-row textarea{font-size:16px;padding:10px 14px}.tc-room-text small{max-width:210px}.tc-compose-hint{display:none}.tc-error{margin:8px 10px 0;font-size:13px;padding:10px}.tc-recording{gap:4px}.tc-rec-track{padding:0 10px}.tc-rec-live{gap:8px}.tc-rec-preview{margin-left:-4px}.tc-rec-time{font-size:13px}.tc-bubble.is-voice{min-width:min(230px,100%)}}
@media(max-width:360px){.tc-compose{padding:8px 6px}.tc-recording{gap:2px}.tc-rec-track{padding:0 8px}.tc-rec-live{gap:6px}.tc-rec-dot{width:8px;height:8px}.tc-rec-time{font-size:12px}.tc-rec-preview{margin-left:-6px}.tc-voice.is-compact .tc-voice-body{gap:6px}.tc-voice.is-compact .tc-voice-time{font-size:12px}}
.tc-room .avatar.has-photo{position:relative;overflow:hidden}.tc-room .avatar.has-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit}
/* ── Telegram-like layer: avatars and roles in the feed, quotes, forwards, reactions, menu, reply/edit bar, @mentions, pin, search, profile ── */
.tc-head{gap:10px}.tc-head-text{flex:1;min-width:0}
button.tc-head-ava{width:auto;min-height:0;height:auto;padding:0;margin:0;border:0;background:none;border-radius:50%;flex-shrink:0}button.tc-head-ava[hidden]{display:none}
.tc-head-ava .avatar{width:40px;height:40px;font-size:14px}
#tc-subtitle.is-typing{color:var(--green);font-weight:600}
button.tc-icon-btn{width:40px;min-width:40px;height:40px;min-height:40px;padding:0;border-radius:50%;border:0;background:none;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
button.tc-icon-btn:hover{background:var(--green-bg);color:var(--ink)}button.tc-icon-btn .tc-ic{width:20px;height:20px}
.avatar{position:relative}.avatar.has-photo{overflow:visible}.avatar.has-photo>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%}
.avatar.is-online::after{content:'';position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;background:#2E9E5B;box-shadow:0 0 0 2px #fff}
/* поиск */
.tc-find{position:relative;border-bottom:1px solid var(--line);background:#fff;flex-shrink:0}.tc-find[hidden]{display:none}
.tc-find-row{display:flex;align-items:center;gap:8px;padding:6px 10px 6px 16px;color:var(--muted)}.tc-find-row .tc-ic{width:18px;height:18px}
.tc-find-row input{flex:1;min-width:0;border:0;outline:0;font:inherit;font-size:15px;background:transparent;color:var(--ink);min-height:40px}
.tc-find-results{max-height:min(320px,45vh);overflow:auto}.tc-find-results:empty{display:none}
button.tc-find-item{display:flex;flex-direction:column;align-items:stretch;gap:3px;width:100%;height:auto;min-height:0;margin:0;padding:10px 16px;border:0;border-top:1px solid var(--line);border-radius:0;background:#fff;text-align:left;font-weight:400;white-space:normal}
button.tc-find-item:hover,button.tc-find-item:focus-visible{background:var(--green-bg)}
.tc-find-head{display:flex;justify-content:space-between;gap:10px;font-size:13px}.tc-find-head time{color:var(--muted);font-size:12px}
.tc-find-text{font-size:14px;color:var(--ink);overflow-wrap:anywhere}.tc-find-text mark{background:#F6E2A8;color:inherit;border-radius:3px;padding:0 1px}
.tc-find-empty{padding:12px 16px;font-size:14px}
/* закреп */
.tc-pin{display:flex;align-items:center;gap:4px;padding:4px 8px 4px 0;border-bottom:1px solid var(--line);background:#fff;flex-shrink:0}.tc-pin[hidden]{display:none}
button.tc-pin-main{flex:1;min-width:0;display:flex;align-items:center;gap:10px;height:auto;min-height:48px;margin:0;padding:6px 8px 6px 16px;border:0;border-radius:0;background:none;text-align:left;font-weight:400;white-space:nowrap;box-shadow:inset 3px 0 var(--green)}
button.tc-pin-main .tc-ic{color:var(--green);width:18px;height:18px}
.tc-pin-main>span{min-width:0;display:flex;flex-direction:column;font-size:13px}.tc-pin-main b{color:var(--green);font-size:12.5px;font-weight:600}
#tc-pin-text{overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
/* лента: аватар слева, имя + должность, группировка подряд идущих */
.tc-message{align-items:flex-end;gap:8px;position:relative}
.tc-message.has-ava{padding-left:0}
button.tc-ava{width:34px;min-width:34px;height:34px;min-height:34px;padding:0;margin:0 0 2px;border:0;background:none;border-radius:50%;flex-shrink:0;align-self:flex-end}
.tc-ava .avatar{width:34px;height:34px;font-size:12.5px}
.tc-message.has-ava:not(.is-last) .tc-ava{visibility:hidden}
.tc-message:not(.is-last){margin-bottom:4px}
.tc-message:not(.is-first) .tc-author-row{display:none}
.tc-author-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:2px}
button.tc-author{width:auto;min-height:0;height:auto;padding:0;margin:0;border:0;background:none;font-size:13px;font-weight:600;color:var(--blue);text-align:left;white-space:normal}
button.tc-author:hover{text-decoration:underline}
.tc-role{font-size:11px;font-weight:600;line-height:1;padding:3px 7px;border-radius:999px;background:var(--green-bg);color:var(--green);white-space:nowrap}
.tc-fwd{display:flex;align-items:center;gap:5px;font-size:12.5px;color:var(--muted);margin:2px 0 4px}.tc-fwd .tc-ic{width:15px;height:15px}.tc-fwd b{color:var(--blue);font-weight:600}
button.tc-quote{display:flex;flex-direction:column;align-items:stretch;gap:1px;width:100%;height:auto;min-height:0;margin:4px 0 2px;padding:5px 9px;border:0;border-radius:6px;background:#EEF4F0;box-shadow:inset 3px 0 var(--green);text-align:left;font-weight:400;white-space:normal;cursor:pointer}
.own button.tc-quote{background:#DDE9E1}
.tc-quote b{font-size:12.5px;color:var(--green);font-weight:600}.tc-quote span{font-size:13px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.tc-quote.is-gone span{font-style:italic;color:var(--muted)}
.tc-at-name{font-weight:600;color:var(--blue)}.tc-at-name.is-me{background:#F6E2A8;border-radius:4px;padding:0 2px}
.tc-message.is-mention .tc-bubble{box-shadow:inset 3px 0 #D9A23A}
.tc-edited{font-style:italic}
button.tc-appt{display:flex;align-items:center;gap:10px;width:100%;height:auto;min-height:0;margin:6px 0 2px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;text-align:left;font-weight:400;white-space:normal}
button.tc-appt:hover:not(:disabled){border-color:#B7CDC0;background:#FAFCFB}
.tc-appt .tc-ic{color:var(--green);width:22px;height:22px}.tc-appt>span{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tc-appt b{font-size:14px;overflow-wrap:anywhere}.tc-appt small{font-size:12.5px;color:var(--muted)}
.tc-appt-st{font-style:normal;font-size:11.5px;font-weight:600;padding:3px 8px;border-radius:999px;background:var(--blue-bg);color:var(--blue);white-space:nowrap}
.tc-appt-st[data-st="Подтверждена"]{background:var(--green-bg);color:var(--green)}.tc-appt-st[data-st="Новая"]{background:var(--amber-bg);color:var(--amber)}.tc-appt-st[data-st="Отменена"]{background:var(--red-bg);color:var(--red)}
.tc-reactions{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
button.tc-react{display:inline-flex;align-items:center;gap:4px;width:auto;height:28px;min-height:28px;margin:0;padding:0 9px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:13px;font-weight:600;color:var(--ink)}
button.tc-react.is-mine{background:var(--green-bg);border-color:#9FC3B1;color:var(--green)}
.tc-react-e{font-size:15px;line-height:1}
.tc-message-meta button.tc-more{min-width:28px;min-height:28px;height:28px;width:28px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted);display:inline-flex;align-items:center;justify-content:center}
.tc-message-meta button.tc-more .tc-ic{width:18px;height:18px}.tc-message-meta button.tc-more:hover{background:rgba(0,0,0,.05);color:var(--ink)}
.tc-message.is-menu .tc-bubble{box-shadow:0 0 0 2px #9FC3B1}
@keyframes tc-flash{0%,40%{background:#F6E2A8}100%{background:transparent}}
.tc-message.is-flash .tc-bubble{animation:tc-flash 1.5s ease}
/* меню сообщения */
.tc-menu-wrap{position:fixed;inset:0;z-index:1600}
.tc-menu-back{position:absolute;inset:0}
.tc-menu{position:absolute;min-width:230px;max-width:min(320px,calc(100vw - 20px));background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 34px #213E4930;padding:6px;display:flex;flex-direction:column}
.tc-menu-react{display:flex;justify-content:space-between;gap:2px;padding:2px 2px 6px;border-bottom:1px solid var(--line);margin-bottom:4px}
.tc-menu-react button{width:38px;min-width:38px;height:38px;min-height:38px;padding:0;margin:0;border:0;border-radius:50%;background:none;font-size:21px;line-height:1}
.tc-menu-react button:hover,.tc-menu-react button:focus-visible{background:var(--green-bg);transform:scale(1.12)}
.tc-menu-react button.is-mine{background:var(--green-bg)}
button.tc-menu-item{display:flex;align-items:center;gap:12px;width:100%;height:auto;min-height:42px;margin:0;padding:8px 12px;border:0;border-radius:8px;background:none;text-align:left;font-size:14.5px;font-weight:500;color:var(--ink)}
button.tc-menu-item .tc-ic{width:19px;height:19px;color:var(--muted)}
button.tc-menu-item:hover,button.tc-menu-item:focus-visible{background:var(--green-bg)}
button.tc-menu-item.is-danger,button.tc-menu-item.is-danger .tc-ic{color:var(--red)}
.tc-menu-wrap.is-sheet .tc-menu-back{background:#213E4955}
.tc-menu-wrap.is-sheet .tc-menu{left:0;right:0;bottom:0;top:auto;max-width:none;width:100%;border-radius:20px 20px 0 0;padding:10px 10px calc(12px + env(safe-area-inset-bottom));animation:tc-up .2s cubic-bezier(.2,.8,.25,1)}
.tc-menu-wrap.is-sheet .tc-menu-react{justify-content:space-around;padding-bottom:10px}
.tc-menu-wrap.is-sheet .tc-menu-react button{width:46px;min-width:46px;height:46px;font-size:25px}
.tc-menu-wrap.is-sheet button.tc-menu-item{min-height:50px;font-size:16px}
@keyframes tc-up{from{transform:translateY(100%)}to{transform:none}}
/* ответ / правка над полем ввода */
.tc-ctx{display:flex;align-items:center;gap:8px;padding:6px 4px 8px 8px}.tc-ctx[hidden]{display:none}
.tc-ctx-ic{color:var(--green);display:flex}.tc-ctx-ic .tc-ic{width:20px;height:20px}
button.tc-ctx-body{flex:1;min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:1px;height:auto;min-height:0;margin:0;padding:3px 10px;border:0;border-radius:0;background:none;box-shadow:inset 3px 0 var(--green);text-align:left;font-weight:400}
.tc-ctx-body b{font-size:13px;color:var(--green);font-weight:600}.tc-ctx-body span{font-size:13.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* подсказка @ */
.tc-compose{position:relative}
.tc-mention{position:absolute;left:10px;right:10px;bottom:calc(100% + 4px);z-index:5;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 28px #213E4926;padding:4px;max-height:280px;overflow:auto}.tc-mention[hidden]{display:none}
button.tc-mention-item{display:flex;align-items:center;gap:10px;width:100%;height:auto;min-height:48px;margin:0;padding:6px 10px;border:0;border-radius:8px;background:none;text-align:left;font-weight:400}
button.tc-mention-item.is-on,button.tc-mention-item:hover{background:var(--green-bg)}
.tc-mention-item .avatar{width:32px;height:32px;font-size:12px;flex-shrink:0}
/* выбор переписки и профиль */
.tc-pick-dialog .tc-pick-list{max-height:min(420px,60vh);overflow:auto;margin:0 -8px 8px;border-top:1px solid var(--line)}
.tc-pick-dialog button.tc-room{min-height:64px;margin:0}
.tc-prof{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding:6px 0 14px}
.tc-prof-ava .avatar{width:96px;height:96px;font-size:32px}.tc-prof-ava .avatar.is-online::after{width:16px;height:16px;right:4px;bottom:4px;box-shadow:0 0 0 3px #fff}
.tc-prof-name{font-size:19px;font-weight:700;color:var(--ink);margin-top:8px}
.tc-prof-role{font-size:12.5px;font-weight:600;padding:4px 10px;border-radius:999px;background:var(--green-bg);color:var(--green)}.tc-prof-role:empty{display:none}
.tc-prof-seen{font-size:13px;color:var(--muted)}
.dialog button.tc-prof-write{display:flex;align-items:center;justify-content:center;gap:8px}
.counter.tc-at{background:var(--green);color:#fff;min-width:22px}
#nav-msg.tc-has-mention,#bn-msgn.tc-has-mention{background:var(--green);color:#fff}
.tc-message.is-swipe-ready::before{content:'↩';position:absolute;left:-28px;top:50%;transform:translateY(-50%);font-size:18px;color:var(--green)}
@media(max-width:700px){
  .tc-message{touch-action:pan-y}
  .tc-bubble{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  .tc-head{padding:8px 6px 8px 4px;gap:6px}.tc-head-ava .avatar{width:36px;height:36px}
  button.tc-ava,.tc-ava .avatar{width:30px;min-width:30px;height:30px;min-height:30px;font-size:11.5px}
  .tc-bubble{max-width:calc(100% - 38px)}.tc-message.own .tc-bubble,.tc-message:not(.has-ava) .tc-bubble{max-width:90%}
  .tc-pin-main{min-height:44px}
}
@media(prefers-reduced-motion:reduce){.tc-menu-wrap.is-sheet .tc-menu{animation:none}.tc-message.is-flash .tc-bubble{animation:none;box-shadow:0 0 0 2px #D9A23A}}
button.tc-menu-item,button.tc-pin-main,button.tc-mention-item,button.tc-appt{justify-content:flex-start}
button.tc-find-item,button.tc-ctx-body,button.tc-quote{justify-content:flex-start}
.tc-menu:focus{outline:none}
.tc-ctx-body b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* ── Компактные файлы, галочки прочтения, просмотр фото, уведомления (2026-11-10) ── */
.tc-room .avatar.has-photo{overflow:visible}.tc-room .avatar.has-photo img{border-radius:50%}
.tc-list-head{gap:4px}.tc-list-head h2{flex:1}
button.tc-icon-btn.is-off{color:var(--red)}
.tc-message-meta{gap:6px;margin-top:4px}
.tc-message-meta button.tc-read{display:inline-flex;align-items:center;gap:2px;min-height:20px;height:20px;padding:0 2px;color:var(--muted)}
.tc-message-meta button.tc-read .tc-ic{width:17px;height:17px;stroke-width:2.2}
.tc-message-meta button.tc-read.is-read{color:#7FA894}.tc-message-meta button.tc-read.is-all{color:var(--green)}
.tc-sending{font-style:italic}
.tc-message.is-ghost .tc-bubble{opacity:.65}
/* фото в сообщении */
button.tc-photo-btn{display:block;width:auto;height:auto;min-height:0;margin:0;padding:0;border:0;border-radius:10px;background:none;cursor:zoom-in;overflow:hidden}
.tc-photo{display:block;width:auto;height:auto;max-width:min(300px,100%);max-height:320px;min-width:80px;border-radius:10px;object-fit:cover;background:#EEF2EF}
/* документ */
a.tc-doc{display:flex;align-items:center;gap:10px;max-width:320px;padding:8px 10px 8px 8px;border-radius:10px;background:rgba(255,255,255,.65);border:1px solid var(--line);text-decoration:none;color:var(--ink)}
.own a.tc-doc{background:rgba(255,255,255,.55)}
a.tc-doc:hover{border-color:#B7CDC0;background:#fff}
.tc-doc-ic{flex-shrink:0;width:38px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:800;letter-spacing:.02em;color:#fff;background:#8E9A94}
.tc-doc-ic.is-pdf{background:#C9483F}.tc-doc-ic.is-doc{background:#3F6FC9}.tc-doc-ic.is-xls{background:#2E8B57}.tc-doc-ic.is-ppt{background:#D2722A}.tc-doc-ic.is-aud{background:#7B5FB8}
.tc-doc-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tc-doc-body b{font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tc-doc-body small{font-size:12px;color:var(--muted)}
.tc-doc-dl{flex-shrink:0;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--green);background:var(--green-bg)}
.tc-doc-dl .tc-ic{width:18px;height:18px}
.tc-file+.tc-file{margin-top:6px}
/* вложения перед отправкой */
.tc-queue{display:flex;flex-wrap:wrap;gap:8px;padding:0 4px}.tc-queue:empty{display:none}
.tc-queued{display:flex;align-items:center;gap:8px;max-width:min(280px,100%);padding:6px 6px 6px 6px;border:1px solid var(--line);border-radius:12px;background:#fff;position:relative}
.tc-queued.is-voice{max-width:100%;flex:1}
img.tc-queued-thumb,.tc-queued-thumb{width:42px;height:42px;border-radius:8px;object-fit:cover;flex-shrink:0}
.tc-queued-text{min-width:0;display:flex;flex-direction:column;gap:1px;padding-right:2px}
.tc-queued-text b{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tc-queued-text small{font-size:11.5px;color:var(--muted)}
button.tc-queued-x{width:26px;min-width:26px;height:26px;min-height:26px;padding:0;margin:0 0 0 2px;border:0;border-radius:50%;background:#EEF2EF;color:var(--muted);display:flex;align-items:center;justify-content:center;flex-shrink:0}
button.tc-queued-x .tc-ic{width:14px;height:14px}button.tc-queued-x:hover{background:var(--red-bg);color:var(--red)}
/* просмотр фото */
.tc-viewer{position:fixed;inset:0;z-index:1700;background:rgba(12,20,18,.92);display:flex;flex-direction:column;outline:none}
.tc-viewer-stage{flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;cursor:zoom-in}
.tc-viewer.is-zoomed .tc-viewer-stage{cursor:grab}
.tc-viewer-stage img{max-width:96vw;max-height:calc(100dvh - 90px);object-fit:contain;transform-origin:center center;transition:transform .12s ease;user-select:none;-webkit-user-drag:none;border-radius:4px}
.tc-viewer-bar{position:absolute;top:0;left:0;right:0;display:flex;align-items:center;gap:6px;padding:10px 12px calc(10px) 16px;background:linear-gradient(rgba(0,0,0,.45),transparent);color:#fff}
.tc-viewer-name{flex:1;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tc-viewer-btn{width:42px;min-width:42px;height:42px;min-height:42px;padding:0;margin:0;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;display:inline-flex;align-items:center;justify-content:center}
.tc-viewer-btn:hover{background:rgba(255,255,255,.24)}.tc-viewer-btn .tc-ic{width:20px;height:20px}
/* профиль: крупное фото открывается по нажатию */
.tc-prof-ava{position:relative}button.tc-prof-zoom{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:0;border:0;border-radius:50%;background:transparent;cursor:zoom-in}
/* меню уведомлений */
.tc-notify-menu{width:320px;max-width:calc(100vw - 20px)}.tc-notify-menu button.tc-menu-item{gap:12px;padding:10px 12px;min-height:56px}.tc-notify-menu button.tc-menu-item>svg{flex-shrink:0;align-self:center}
button.tc-switch{justify-content:flex-start}.tc-switch-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;text-align:left;white-space:normal;line-height:1.3}.tc-switch-text>span{white-space:normal;overflow-wrap:anywhere}.tc-switch-text small{font-size:12.5px;color:var(--muted);font-weight:400;white-space:normal}.tc-switch-knob{margin-left:8px}
.tc-switch-knob{flex-shrink:0;width:36px;height:22px;border-radius:999px;background:#CBD5D0;position:relative;transition:background .15s}
.tc-switch-knob::after{content:'';position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}
.tc-switch-knob.is-on{background:var(--green)}.tc-switch-knob.is-on::after{transform:translateX(14px)}
/* свёрнутое меню: точка с числом непрочитанных на кнопке разворота */
@media(max-width:700px){.tc-photo{max-width:100%;max-height:280px}a.tc-doc{max-width:100%}.tc-viewer-stage img{max-width:100vw}}
.tc-queued{flex-wrap:nowrap;margin-bottom:0}.tc-queued-text{flex:1}.tc-queued button.tc-queued-x{min-height:26px;padding:0}
.tc-queued .tc-doc-ic{font-size:10px}
/* ── Скрепка: меню вложений и окна поиска пациента / записи ── */
.tc-attach-menu{min-width:270px}
button.tc-attach-item{min-height:52px}button.tc-attach-item .tc-ic{width:22px;height:22px;color:var(--green)}
.tc-search-dialog .tc-pick-q{width:100%;min-height:44px;margin:0 0 10px;padding:0 14px;border:1px solid #9AAEA2;border-radius:10px;font:inherit;font-size:15px;background:#fff;color:var(--ink)}
.tc-search-dialog .tc-pick-q:focus{outline:2px solid var(--green);outline-offset:0;border-color:var(--green)}
.tc-search-dialog button.tc-room{min-height:60px;align-items:center}
.tc-search-dialog .tc-room-text small{max-width:none;white-space:normal}
.tc-search-dialog .tc-appt-st{flex-shrink:0;margin-left:auto}
.tc-patient .tc-appt-st{background:var(--green-bg);color:var(--green)}
@media(max-width:700px){.tc-search-dialog .tc-pick-q{font-size:16px}}

/* ===== Компактная лента: время в углу пузыря, разделители дней, группы, «…» сбоку (2026-11-10) ===== */
.tc-bubble{position:relative;min-width:0;padding:8px 12px 7px}
.tc-text{margin-top:2px;line-height:1.42}
.tc-author-row+.tc-text{margin-top:2px}
.tc-message-meta{gap:4px;margin-top:3px;font-size:11px;line-height:1;white-space:nowrap;flex-wrap:nowrap}
.tc-message-meta time{font-variant-numeric:tabular-nums}
.tc-message-meta button.tc-read{min-height:16px;height:16px}
.tc-message-meta button.tc-read .tc-ic{width:16px;height:16px}
/* Короткий текст: время на одной строке с текстом (как в Telegram) — невидимый «хвост» резервирует место под время */
.tc-bubble.meta-in .tc-message-meta{position:absolute;right:10px;bottom:7px;margin:0}
.tc-bubble.meta-in>.tc-text::after{content:'';display:inline-block;width:var(--tc-meta-w,40px);height:1px}
.tc-bubble.meta-in.m-own{--tc-meta-w:60px}.tc-bubble.meta-in.m-ed{--tc-meta-w:98px}.tc-bubble.meta-in.m-own.m-ed{--tc-meta-w:118px}
.tc-message.is-ghost .tc-bubble.meta-in{--tc-meta-w:92px}
/* Разделитель дня */
.tc-day{display:flex;justify-content:center;margin:6px 0 12px;position:sticky;top:0;z-index:2;pointer-events:none}
.tc-day span{font-size:12px;font-weight:600;color:var(--muted);background:#ffffffe6;border:1px solid var(--line);border-radius:999px;padding:3px 10px;box-shadow:0 1px 2px #213E4910}
/* Группы: 3px внутри, 14px между */
.tc-message{margin:0 0 14px}
.tc-message:not(.is-last){margin-bottom:3px}
.tc-message:not(.is-first) .tc-bubble{border-top-left-radius:6px}.tc-message.own:not(.is-first) .tc-bubble{border-top-left-radius:14px;border-top-right-radius:6px}
/* «…» сбоку от пузыря */
.tc-message>button.tc-more{align-self:center;flex-shrink:0;width:30px;height:30px;min-height:30px;min-width:30px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;opacity:0;transition:opacity .12s}
.tc-message>button.tc-more .tc-ic{width:18px;height:18px}
.tc-message.own>button.tc-more{order:-1}
.tc-message:hover>button.tc-more,.tc-message>button.tc-more:focus-visible,.tc-message.is-menu>button.tc-more{opacity:1}
.tc-message>button.tc-more:hover{background:rgba(0,0,0,.05);color:var(--ink)}
@media(hover:none){.tc-message>button.tc-more{display:none}}

/* ===== Телефон: открытая переписка на весь экран, прокручивается только лента ===== */
@media(max-width:700px){
  html.chat-full,html.chat-full body{overflow:hidden;overscroll-behavior:none}
  html.chat-full .tc-shell{position:fixed;left:var(--tc-vl,0px);top:var(--tc-vt,0px);width:100%;width:var(--tc-vw,100%);height:100vh;height:100dvh;height:var(--tc-vh,100dvh);touch-action:manipulation;min-height:0;max-height:none;margin:0;border:0;border-radius:0;box-shadow:none;z-index:40;background:#fff}
  html.chat-full .tc-pane{height:100%}
  html.chat-full .tc-head{padding-top:calc(10px + env(safe-area-inset-top));min-height:0}
  html.chat-full .tc-compose{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  html.chat-full.tc-kb .tc-compose{padding-bottom:8px}
  html.chat-full .tc-log{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  html.chat-full .bottomnav,html.chat-full .pagehead,html.chat-full #view-switch,html.chat-full .admin-role,html.chat-full .mobile-add{display:none!important}
  .tc-bubble{max-width:90%}
}

/* ===== Обои чата (2026-11-10): .tc-log и превью в окне выбора получают data-wall ===== */
.tc-log[data-wall],.tc-wall-pv{background-color:var(--bg);background-repeat:repeat;background-attachment:scroll}
.tc-log[data-wall=mint],.tc-wall-pv[data-wall=mint]{background-color:#E6F0EA;background-image:radial-gradient(#CFE1D5 1.3px,transparent 1.5px);background-size:18px 18px}
.tc-log[data-wall=sand],.tc-wall-pv[data-wall=sand]{background-color:#F4EDE1;background-image:radial-gradient(#E8DCC7 1.2px,transparent 1.4px);background-size:22px 22px}
.tc-log[data-wall=sky],.tc-wall-pv[data-wall=sky]{background-image:linear-gradient(165deg,#E1ECF6 0%,#EEF4F9 55%,#F6F9FB 100%)}
.tc-log[data-wall=lavender],.tc-wall-pv[data-wall=lavender]{background-image:linear-gradient(165deg,#ECE5F5 0%,#F3EFF8 55%,#F8F6FA 100%)}
.tc-log[data-wall=dawn],.tc-wall-pv[data-wall=dawn]{background-image:linear-gradient(165deg,#FBE6D8 0%,#F4E7F1 50%,#E5EDF7 100%)}
.tc-log[data-wall=leaves],.tc-wall-pv[data-wall=leaves]{background-color:#EDF4EF;background-size:64px 64px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23C9DDCF' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M12 22c0-7 5-12 12-12 0 7-5 12-12 12Zm0 0 8-8'/%3E%3Cpath d='M44 54c0-7 5-12 12-12 0 7-5 12-12 12Zm0 0 8-8'/%3E%3Cpath d='M46 18c6 0 10 4 10 10-6 0-10-4-10-10Zm0 0 6 6'/%3E%3Cpath d='M10 46c6 0 10 4 10 10-6 0-10-4-10-10Zm0 0 6 6'/%3E%3C/g%3E%3C/svg%3E")}
.tc-log[data-wall=plus],.tc-wall-pv[data-wall=plus]{background-color:#F3F7F5;background-size:44px 44px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg stroke='%23D6E3DC' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M11 7v8M7 11h8'/%3E%3Cpath d='M33 29v8M29 33h8'/%3E%3C/g%3E%3C/svg%3E")}
.tc-log[data-wall=night],.tc-wall-pv[data-wall=night]{background-color:#1D2928;background-image:radial-gradient(#ffffff12 1.2px,transparent 1.4px);background-size:20px 20px}
.tc-log[data-wall=photo],.tc-wall-pv[data-wall=photo]{background-color:#D9E2DD;background-image:var(--tc-wall-photo);background-size:cover;background-position:center;background-repeat:no-repeat}
.tc-log[data-wall=photo].tc-wall-dim,.tc-wall-pv[data-wall=photo].tc-wall-dim{background-image:linear-gradient(#FCFCFA8C,#FCFCFA8C),var(--tc-wall-photo)}
/* На тёмных обоях и фото — подписи вне пузырей читаемы */
.tc-log[data-wall=night] .tc-empty,.tc-log[data-wall=night]>p.quiet{color:#C9D6D1}
.tc-log[data-wall=night] .tc-load-more,.tc-log[data-wall=photo] .tc-load-more{background:#ffffffe6;border-radius:999px}
.tc-log[data-wall=night] .tc-message:not(.own) .tc-bubble{border-color:transparent}
.tc-log[data-wall=photo]:not(.tc-wall-dim) .tc-bubble{box-shadow:0 1px 2px #0000001f}
/* Окно выбора */
.tc-wall-dialog{width:min(560px,calc(100vw - 32px));max-width:none}
.tc-wall-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:4px 0 14px}
button.tc-wall-tile{display:flex;flex-direction:column;align-items:stretch;gap:6px;height:auto;min-height:0;padding:0;margin:0;border:0;background:none;color:var(--ink);font-size:13px;font-weight:600;text-align:center;cursor:pointer}
.tc-wall-pv{position:relative;display:block;aspect-ratio:3/4;border-radius:14px;border:1px solid var(--line);overflow:hidden;transition:box-shadow .12s}
.tc-wall-tile[aria-checked=true] .tc-wall-pv{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--green)}
.tc-wall-tile[aria-checked=true] .tc-wall-pv::after{content:'';position:absolute;top:7px;right:7px;width:20px;height:20px;border-radius:50%;background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat}
.tc-wall-tile:focus-visible .tc-wall-pv{outline:3px solid #9FC3B1;outline-offset:2px}
.tc-wall-pv i{position:absolute;display:block;height:12%;border-radius:8px}
.tc-wall-pv .tc-wall-b1{left:9%;top:22%;width:58%;background:#fff;border:1px solid #DEE5E0}
.tc-wall-pv .tc-wall-b2{right:9%;top:42%;width:52%;background:#E9EFEB;border:1px solid #D3DED7}
.tc-wall-pv .tc-wall-b3{left:9%;top:62%;width:40%;background:#fff;border:1px solid #DEE5E0}
.tc-wall-pv[data-wall=night] .tc-wall-b1,.tc-wall-pv[data-wall=night] .tc-wall-b3{border-color:transparent}
.tc-wall-tools{display:flex;flex-direction:column;gap:8px;margin-bottom:6px}
button.tc-wall-upload{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:48px;margin:0;border:1px dashed #9AAEA2;border-radius:12px;background:#fff;color:var(--ink);font-weight:600}
button.tc-wall-upload .tc-ic{width:20px;height:20px}
button.tc-wall-dim-row{border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-height:56px}
button.tc-wall-dim-row[hidden]{display:none}
button.tc-wall-del{align-self:center;color:var(--red);min-height:40px}
.tc-wall-note{font-size:13px;margin:4px 0 8px}
@media(max-width:700px){.tc-wall-grid{gap:10px}.tc-wall-dialog{width:calc(100vw - 24px)}}
@media(max-width:360px){.tc-wall-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}button.tc-wall-tile{font-size:12px}}
/* На цветных обоях свои пузыри чуть насыщеннее, у всех — лёгкая тень, чтобы не сливались с фоном */
.tc-log[data-wall]:not([data-wall=none]) .tc-bubble{box-shadow:0 1px 2px #213E4914}
.tc-log[data-wall]:not([data-wall=none]):not([data-wall=night]) .tc-message.own .tc-bubble{background:#D8EADF;border-color:#C3DACB}
.tc-wall-pv:not([data-wall=none]):not([data-wall=night]) .tc-wall-b2{background:#D8EADF;border-color:#C3DACB}
