/* Chat Habib v39 — reply + copy + inline image viewer */
.wa-thumb-link.inline-image-open{display:block;width:100%;padding:0;border:0;background:transparent;text-align:left;cursor:pointer}
.msgrow .bubble{position:relative}
.reply-quote{display:block;width:100%;margin:0 0 7px;padding:7px 9px;border:0;border-left:3px solid #57a996;border-radius:8px;background:rgba(255,255,255,.55);text-align:left;cursor:pointer;color:inherit}
.reply-quote b{display:block;margin-bottom:2px;font-size:11px;line-height:1.2;color:#147a73}.reply-quote span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.35;opacity:.8}.reply-quote.missing{opacity:.65}.reply-quote.optimistic{cursor:default}
.message-reply-btn,.message-copy-btn{position:absolute;top:5px;width:28px;height:28px;border:0;border-radius:999px;background:rgba(255,255,255,.9);box-shadow:0 2px 8px rgba(0,0,0,.08);opacity:0;pointer-events:none;font-size:14px;line-height:1;cursor:pointer;z-index:3}.message-reply-btn{right:5px}.message-copy-btn{right:37px}.msgrow:hover .message-reply-btn,.msgrow:hover .message-copy-btn,.msgrow:focus-within .message-reply-btn,.msgrow:focus-within .message-copy-btn{opacity:1;pointer-events:auto}.me .message-reply-btn,.me .message-copy-btn{background:rgba(231,244,241,.94)}.message-copy-btn.copied{background:#147a73!important;color:#fff!important}
#adminMsgs .message-delete-btn{right:69px}.reply-jump-focus .bubble{outline:2px solid rgba(20,122,115,.35);outline-offset:2px}
.reply-compose-preview{display:flex;align-items:center;gap:10px;margin:0 0 7px;padding:8px 10px;border-left:3px solid #57a996;border-radius:9px;background:#f2faf7;box-shadow:0 1px 0 rgba(0,0,0,.03)}.reply-compose-preview>div{min-width:0;flex:1}.reply-compose-preview b,.reply-compose-preview span{display:block}.reply-compose-preview b{font-size:11px;color:#147a73;margin-bottom:2px}.reply-compose-preview span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-compose-cancel{width:28px;height:28px;border:0;border-radius:999px;background:transparent;font-size:20px;color:var(--muted);cursor:pointer}
.image-viewer-open{overflow:hidden}.inline-image-viewer{position:fixed;inset:0;z-index:3000;display:flex;flex-direction:column;background:rgba(7,17,14,.94);backdrop-filter:blur(8px)}.inline-image-viewer-head{display:flex;align-items:center;gap:14px;min-height:56px;padding:10px 14px;color:#fff;background:rgba(0,0,0,.2)}.inline-image-viewer-head>b{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.inline-image-viewer-head>div{display:flex;align-items:center;gap:8px}.inline-image-viewer-head a{padding:8px 11px;border-radius:9px;background:rgba(255,255,255,.12);color:#fff;text-decoration:none;font-size:12px;font-weight:700}.inline-image-close{width:36px;height:36px;border:0;border-radius:999px;background:rgba(255,255,255,.12);color:#fff;font-size:25px;line-height:1;cursor:pointer}.inline-image-stage{flex:1;min-height:0;display:grid;place-items:center;padding:14px;overflow:auto}.inline-image-stage img{display:block;max-width:100%;max-height:100%;object-fit:contain;border-radius:4px}
@media(max-width:720px){.message-reply-btn,.message-copy-btn{opacity:.82;pointer-events:auto}.reply-quote{padding:6px 8px}.reply-compose-preview{margin:0 6px 6px}.inline-image-viewer-head{padding-top:max(10px,env(safe-area-inset-top));}.inline-image-stage{padding:8px}}
.chat-video-open,.peer-media-open{position:relative;display:block;width:100%;padding:0;border:0;background:transparent;text-align:left;cursor:pointer}.chat-video-open video,.peer-media-open video{display:block;width:100%;pointer-events:none}.chat-video-play{position:absolute;left:50%;top:50%;display:grid;place-items:center;transform:translate(-50%,-50%);width:54px;height:54px;border-radius:50%;background:#000b;color:#fff;font-size:22px;box-shadow:0 2px 12px #0005;pointer-events:none}.peer-media-open img{display:block}.inline-image-stage video{display:block;max-width:100%;max-height:100%;width:auto;height:auto;background:#000;border-radius:8px}
.inline-image-viewer-head a{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 13px;border:1px solid rgba(255,255,255,.28);border-radius:999px;background:rgba(255,255,255,.12);color:#fff;font-size:13px;font-weight:700;line-height:1.2;text-align:center;box-shadow:none}.inline-image-viewer-head a:hover{background:rgba(255,255,255,.22);color:#fff}.inline-image-viewer-head a:focus-visible{outline:3px solid #fff;outline-offset:3px}@media(max-width:600px){.inline-image-viewer-head{flex-wrap:wrap}.inline-image-viewer-head>b{flex-basis:100%;order:0}.inline-image-viewer-head>div{width:100%;order:1}.inline-image-viewer-head a{flex:1}}
.chat-media-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;padding:5px 6px;background:rgba(255,255,255,.72);border-top:1px solid rgba(84,101,95,.11)}.chat-media-action{appearance:none;display:inline-flex;align-items:center;gap:5px;min-height:32px;padding:5px 9px;border:0;border-radius:999px;background:transparent!important;color:#415a54!important;font:inherit;font-size:12px;font-weight:650!important;line-height:1;text-decoration:none;box-shadow:none!important;cursor:pointer}.chat-media-action>span{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#e6f1ed;color:#147a73;font-size:15px;font-weight:800}.chat-media-action>small{font:inherit;font-size:11px}.chat-media-action:hover,.chat-media-action:focus-visible{background:#eaf3f0!important;color:#0d6962!important;outline:0}.chat-media-action:focus-visible{box-shadow:0 0 0 2px #268e84!important}.chat-media-action:disabled{opacity:.55;cursor:wait}.chat-document-card{display:flex!important;flex-direction:column;align-items:stretch!important;gap:0!important;min-width:250px;background:rgba(255,255,255,.66)!important}.chat-document-summary{display:flex;align-items:center;gap:11px;padding:12px 10px}.chat-document-summary>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:650;color:#263d37}.chat-document-summary .doc-icon{display:grid;place-items:center;width:42px;height:48px;border-radius:7px;background:#e8f1ee;color:#147a73;font-size:11px;font-weight:850}.peer-file>.chat-media-actions{border-radius:0 0 9px 9px}.peer-file-caption,.wa-thumb-footer,.media-caption{font-size:11px}
/* File messages render their text below the media as one caption. */
.msgrow.has-attachment-caption .bubble>.media-card:first-child,.msgrow.has-attachment-caption .bubble>.wa-thumb-card:first-child,.msgrow.has-attachment-caption .bubble>.doc-card:first-child{margin-top:0}
.msgrow.has-attachment-caption .attachment-caption{margin-top:7px;padding:9px 4px 2px;border-top:1px solid rgba(84,101,95,.16);white-space:pre-wrap}
.msgrow.has-attachment-caption .social-embeds{margin-top:8px}
/* Compact WhatsApp-style attachment bubble, including messages rendered before the JS refresh. */
.msgrow.has-attachment-caption .bubble,.msgrow .bubble:has(> .media-card),.msgrow .bubble:has(> .wa-thumb-card),.msgrow .bubble:has(> .doc-card){display:flex;flex-direction:column;width:min(390px,82vw)!important;max-width:min(390px,82vw)!important;padding:5px 5px 6px!important;overflow:hidden}
.msgrow.has-attachment-caption .bubble>.media-card,.msgrow.has-attachment-caption .bubble>.wa-thumb-card,.msgrow.has-attachment-caption .bubble>.doc-card,.msgrow .bubble:has(> .media-card)>.media-card,.msgrow .bubble:has(> .wa-thumb-card)>.wa-thumb-card,.msgrow .bubble:has(> .doc-card)>.doc-card{order:1;width:100%!important;max-width:none!important;margin:0!important;border:0!important;border-radius:8px!important;box-shadow:none}
.msgrow.has-attachment-caption .bubble>.message-text,.msgrow .bubble:has(> .media-card)>.message-text,.msgrow .bubble:has(> .wa-thumb-card)>.message-text,.msgrow .bubble:has(> .doc-card)>.message-text{order:2;margin:0!important;padding:10px 7px 5px!important;border-top:0!important;font-size:14px!important;line-height:1.45!important;white-space:pre-wrap}
.msgrow.has-attachment-caption .bubble>.meta,.msgrow .bubble:has(> .media-card)>.meta,.msgrow .bubble:has(> .wa-thumb-card)>.meta,.msgrow .bubble:has(> .doc-card)>.meta{order:3;padding:0 5px 2px}
.msgrow.has-attachment-caption .wa-thumb-link,.msgrow .bubble:has(> .wa-thumb-card) .wa-thumb-link{aspect-ratio:auto;max-height:440px;background:#e8eeeb}
.msgrow.has-attachment-caption .wa-thumb-image,.msgrow .bubble:has(> .wa-thumb-card) .wa-thumb-image{width:100%;height:auto;max-height:440px;object-fit:contain}
.msgrow.has-attachment-caption .wa-thumb-footer,.msgrow.has-attachment-caption .media-caption,.msgrow .bubble:has(> .wa-thumb-card) .wa-thumb-footer,.msgrow .bubble:has(> .media-card) .media-caption{padding:7px;background:rgba(255,255,255,.82)}
.msgrow.has-attachment-caption .chat-media-actions,.msgrow .bubble:has(> .wa-thumb-card) .chat-media-actions,.msgrow .bubble:has(> .media-card) .chat-media-actions{padding:5px 6px}
@media(max-width:520px){.msgrow.has-attachment-caption .bubble,.msgrow .bubble:has(> .media-card),.msgrow .bubble:has(> .wa-thumb-card),.msgrow .bubble:has(> .doc-card){width:min(340px,88vw)!important;max-width:min(340px,88vw)!important}}
/* Media must follow its real content height; never reserve white letterbox rows. */
.wa-thumb-card{display:grid!important;grid-template-rows:auto auto;align-items:start;height:auto!important;min-height:0!important;background:transparent!important;border:0!important}
.wa-thumb-link,.wa-thumb-link.inline-image-open{display:block!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;padding:0!important;margin:0!important;line-height:0!important;background:transparent!important}
.wa-thumb-image,.msgrow.has-attachment-caption .wa-thumb-image,.msgrow .bubble:has(> .wa-thumb-card) .wa-thumb-image{display:block!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;object-fit:initial!important;background:transparent!important}
.wa-thumb-card>.chat-media-actions,.media-card>.chat-media-actions,.peer-file>.chat-media-actions{align-self:stretch;min-height:0!important;margin:0!important;padding:4px 2px 0!important;border:0!important;background:transparent!important}
