/* Pictures in the chat — viewer panel + presenter console (public/js/chatMedia.js).
   Light only, no shadows. Colors fall back to literals when a page lacks a token. */

/* Picture inside a message, under the text. */
.chat-img{display:block;max-width:100%;max-height:220px;width:auto;height:auto;margin-top:6px;border:1px solid var(--border,rgb(15 23 32 / .10));border-radius:10px;cursor:zoom-in;background:#fff;object-fit:contain}
.chat-text:empty{display:none}

/* Attach button (paper clip) next to the input. */
.chat-attach{flex:0 0 auto;width:42px;height:42px;border:1px solid var(--border,rgb(15 23 32 / .10));border-radius:50%;background:#fff;color:var(--ink,#0f1722);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.chat-attach:hover{background:var(--surface,rgb(15 23 32 / .04))}
.chat-attach:disabled{opacity:.45;cursor:default}
.chat-attach svg{display:block}
.chat-file{display:none}

/* Preview of the picture before it is sent, with a remove button. */
.chat-preview{display:none;padding:6px 10px 0;flex:0 0 auto}
.chat-preview.show{display:flex;align-items:flex-start;gap:6px}
.chat-preview.busy{opacity:.55}
.chat-preview-img{display:block;width:64px;height:64px;object-fit:cover;border:1px solid var(--border,rgb(15 23 32 / .10));border-radius:8px;background:#fff}
.chat-preview-rm{flex:0 0 auto;width:24px;height:24px;border:1px solid var(--border,rgb(15 23 32 / .10));border-radius:50%;background:#fff;color:var(--ink,#0f1722);font-size:12px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.chat-preview-rm:hover{background:var(--surface,rgb(15 23 32 / .04))}

/* Fullscreen view. Light backdrop; closes on any click or Esc. */
.chat-lightbox{position:fixed;inset:0;z-index:10000;background:rgb(252 253 255 / .96);display:flex;align-items:center;justify-content:center;padding:16px;cursor:zoom-out}
.chat-lightbox-img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;border:1px solid var(--border,rgb(15 23 32 / .10));border-radius:10px;background:#fff;object-fit:contain}

/* Presenter console: composer wraps so the preview sits on its own line. */
.tchat-compose{flex-wrap:wrap}
.tchat-compose .chat-preview{flex:1 0 100%;order:-1;padding:0 0 4px}
.tchat-compose .chat-attach{width:34px;height:34px}
.tchat-error{flex:1 0 100%;font-size:.78rem;color:var(--red,#d63031);min-height:0}
.tchat-error:empty{display:none}
.tchat-msg .chat-img{max-height:160px}

/* chat replies («Ответить»), viewer and workshop page */
.chat-reply-btn { margin-left: 8px; border: 0; background: none; color: var(--text-dim, #8b8b94); font: 600 .72rem inherit; font-family: inherit; cursor: pointer; padding: 0 2px; }
.chat-reply-btn:hover { color: var(--link, #2f55d4); }
/* «Ответить» only on the message under the mouse (always on touch screens) */
@media (hover: hover) { .chat-msg .chat-reply-btn { visibility: hidden; } .chat-msg:hover .chat-reply-btn { visibility: visible; } }
.chat-quote { cursor: pointer; }
.chat-msg.chat-flash { animation: chat-flash 1.8s ease-out; }
@keyframes chat-flash { 0%, 35% { background: #fff4dc; border-color: #f1d39a; } 100% { } }
.chat-quote { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 4px 0 2px; padding: 4px 8px; border-left: 3px solid var(--link, #2f55d4); background: var(--surface, #f3f1ec); border-radius: 6px; font-size: .8rem; color: var(--text-dim, #5d5d66); }
.chat-quote-author { font-weight: 700; color: var(--text, #17171b); }
.chat-quote-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-quote.to-me { border-left-color: #1f8a5b; }
.chat-quote-me { font-weight: 700; color: #fff; background: #1f8a5b; border-radius: 999px; padding: 0 7px; font-size: .7rem; }
.chat-msg.to-me { border-color: #bfe0cd !important; background: #e6f4ec !important; }
.chat-replybar { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 12px; margin: 8px 10px 0; border-radius: 10px; background: var(--aqua-50, #e9eefc); font-size: .82rem; }
.chat-replybar[hidden] { display: none; }
.chat-replybar-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-replybar-x { border: 0; background: none; cursor: pointer; color: inherit; font-size: .9rem; padding: 2px 6px; }
