/* «Рядом» — ответы и полноэкранные изображения */
.reply-preview{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f1ecf7;border-left:3px solid #7259bc;padding:10px 12px;margin-bottom:9px;border-radius:10px 12px 12px 10px}
.reply-preview[hidden]{display:none!important}
.reply-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
.reply-copy b{font-size:12px;color:#6550a8}
.reply-copy span{font-size:12px;color:#81778a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reply-close{border:0;background:#e5dbee;color:#77678a;font-size:24px;line-height:1;border-radius:50%;width:33px;height:33px;flex-shrink:0;cursor:pointer}
.quoted-message{display:flex;flex-direction:column;text-align:left;width:100%;border:0;border-left:3px solid #c4afe6;background:#f6f1fb;color:#655677;border-radius:7px;padding:7px 10px;margin-bottom:8px;gap:2px;max-width:100%;cursor:pointer}
.mine .quoted-message{background:#ffffff20;color:#ede9ff;border-left-color:#cfbafa}
.quoted-message strong{font-size:11px;line-height:1.35;font-weight:750}
.quoted-message span{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;opacity:.83}
.msg-actions{display:flex;gap:5px;margin-top:5px;align-items:center;justify-content:flex-start}
.mine .msg-actions{justify-content:flex-end}
.msg-actions button{border:1px solid #ded2ee;background:#fff9ff;color:#6e54b4;border-radius:11px;padding:8px 13px;font-size:12px;font-weight:750;cursor:pointer;box-shadow:0 4px 12px #5144660f}
.msg-row .bubble{cursor:pointer}
.msg-row .bubble:has(button){cursor:default}
.msg-row.quote-flash .bubble{box-shadow:0 0 0 3px #c2a5f0,0 7px 20px #71576320}
.message-photo{border:0;background:transparent;display:block;padding:0;margin:0;cursor:zoom-in;max-width:100%;border-radius:12px;overflow:hidden}
.message-photo img{margin-bottom:0}
.avatar[data-action="view-avatar"]{cursor:zoom-in}
.avatar[data-action="view-avatar"]:focus-visible{outline:3px solid #9c85da;outline-offset:3px}
.image-lightbox{position:fixed;inset:0;width:100vw;height:100dvh;z-index:9999;background:#151119f5;display:flex;align-items:center;justify-content:center;overscroll-behavior:contain;padding:calc(67px + env(safe-area-inset-top,0px)) 12px calc(22px + env(safe-area-inset-bottom,0px));touch-action:pan-x pan-y;backdrop-filter:blur(10px)}
.lightbox-bar{position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:calc(10px + env(safe-area-inset-top,0px)) 18px 10px;color:#faf5ff;font-size:13px;font-weight:600;min-height:62px;background:linear-gradient(#130e1bb8,#130e1b00)}
.lightbox-close{border:1px solid #ffffff45;color:white;background:#ffffff23;border-radius:50%;width:44px;height:44px;font-size:32px;line-height:1;display:grid;place-items:center;cursor:pointer;flex-shrink:0}
.lightbox-close:focus-visible{outline:3px solid #dbcbff;outline-offset:3px}
.lightbox-img{display:block;object-fit:contain;max-width:100%;max-height:100%;width:auto;height:auto;border-radius:10px;box-shadow:0 10px 40px #00000032}
@media(max-width:700px){.reply-preview{margin:0 2px 9px;padding:9px 11px}.quoted-message{padding:7px 8px}.msg-actions button{padding:9px 14px}.image-lightbox{padding-left:8px;padding-right:8px}.lightbox-bar{padding-left:15px;padding-right:15px}}
@media(prefers-reduced-motion:reduce){.msg-row.quote-flash .bubble{transition:none}}
