.bubble{position:relative;min-width:90px;padding-right:28px}.bubble-tools{position:absolute;right:4px;top:3px;opacity:0;transition:opacity .15s}.bubble:hover .bubble-tools,.bubble:focus-within .bubble-tools{opacity:1}.bubble-tools button{min-height:25px;padding:0 7px;font-size:19px;line-height:22px}.message-text{white-space:pre-wrap;overflow-wrap:anywhere}.chat-image{padding:0;border:0;background:transparent;display:block;max-width:280px;overflow:hidden;margin:0 0 9px;border-radius:8px}.chat-image img{display:block;max-height:250px;width:auto;max-width:100%;object-fit:contain}.chat-audio{display:block;width:290px;max-width:100%;height:42px;margin:7px 0}.chat-video{display:block;max-width:310px;width:100%;max-height:320px;border-radius:8px;margin-bottom:9px}.chat-document{display:flex;align-items:center;gap:12px;padding:13px;border-radius:9px;background:#ffffff80;border:1px solid #ccd7ea;color:#34486c;text-decoration:none;margin-bottom:9px;min-width:210px;max-width:350px}.chat-document>span:first-child{font-size:26px}.chat-document span:nth-child(2){min-width:0;flex:1}.chat-document b{overflow-wrap:anywhere;font-size:12px}.chat-document small{text-align:left;margin-top:5px}.chat-contact{display:grid;gap:8px;border:1px solid #ccd7ea;border-radius:8px;padding:13px;margin:8px 0}.chat-contact span{font-size:12px}.chat-location{display:block;padding:13px;background:#ffffff80;color:#345385;border-radius:8px}.message-quote{display:grid;gap:5px;max-width:100%;width:100%;text-align:left;border:0;border-left:3px solid #839cc7;background:#ffffff80;color:#496288;padding:8px 11px;margin-bottom:9px;font-weight:400;font-size:11px;border-radius:5px}.message-quote span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-reactions{font-size:17px;margin-top:5px;white-space:normal;line-height:1.6}.message-reactions:empty{display:none}.forwarded-note{font-size:10px;font-style:italic;color:#6d7b91;margin-bottom:6px}.message-deleted .message-text{font-style:italic;color:#758197}.media-unavailable{font-size:11px;color:#8b7250;white-space:normal}.message-menu,.chat-menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}.message-menu button,.chat-menu-grid button{text-align:left;font-size:12px;min-height:42px}.emoji-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:20px 0}.emoji-grid button{font-size:23px;min-height:48px}.danger-text{color:#a23d36}.search-hit{width:100%;display:grid;gap:8px;text-align:left;background:#f1f4fa;color:#34496c;margin-top:9px;font-size:12px;white-space:normal}.search-hit small{font-weight:400}.thread-search-results{max-height:50vh;overflow:auto}.full-chat-image{display:block;max-height:70vh;max-width:100%;margin:auto;object-fit:contain}.compose-context{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:9px 12px;border-left:3px solid #8ca6cf;background:#f1f4fa;font-size:11px;color:#5b6d8d;line-height:1.6;margin-bottom:9px}.composer-tools{display:flex;gap:4px;align-items:center;min-height:36px;margin-bottom:6px}.composer-tools .icon-button{font-size:21px;padding:3px 8px;min-height:34px}.composer-help{font-size:9px;color:#7c8ba5;margin-left:auto}.chat-state-bar,.chat-history-bar,.chat-action-status{padding:7px 18px;font-size:10px;line-height:1.6;background:#f6f1e5;color:#857049;flex-shrink:0}.chat-history-bar{background:#edf1fa;color:#5c7095}.chat-action-status{background:#f4f6fb;color:#75809a}.recording-panel{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border:1px solid #ead6d2;background:#fff4f1;border-radius:9px;font-size:12px}.recording-dot{width:9px;height:9px;background:#c6675c;border-radius:50%;animation:record-blink 1.2s infinite}.recording-panel #recordingClock{font-variant-numeric:tabular-nums}.message-highlight{outline:2px solid #9db3db;outline-offset:3px}.operation-full-backup{margin-top:24px}.operation-full-backup .backup-list{margin-top:20px;display:grid;gap:8px}.backup-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border:1px solid var(--line);border-radius:8px;font-size:12px}.backup-item small{display:block;margin-top:4px}.backup-controls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:15px;margin:20px 0}.backup-settings .dialog-actions{margin-top:12px}@keyframes record-blink{50%{opacity:.3}}
@media(max-width:760px){.bubble-tools{opacity:1}.chat-audio{width:240px}.chat-video{max-width:250px}.chat-image{max-width:240px}.message-menu,.chat-menu-grid{grid-template-columns:1fr}.composer-help{display:none}.composer-tools{gap:3px}.composer-tools .icon-button{padding:5px 9px;min-height:40px}.backup-controls{grid-template-columns:1fr}.backup-item{align-items:flex-start;flex-direction:column}.chat-state-bar,.chat-action-status,.chat-history-bar{padding:5px 12px;font-size:9px}}
@media(prefers-reduced-motion:reduce){.recording-dot{animation:none}}

.draft-audio{display:block;width:min(300px,100%);height:36px;margin-top:6px}.draft-photo{display:block;max-width:110px;max-height:70px;object-fit:contain;margin-top:6px;border-radius:8px}
/* Reserve o espaço antes do download para manter a conversa na posição de leitura. */
.chat-image{width:280px;height:158px;max-width:100%}.chat-image img{width:100%;height:100%;max-height:100%;object-fit:contain}.chat-video{aspect-ratio:16/9;object-fit:contain;background:#192130}
@media(max-width:760px){.chat-image{width:240px;height:135px}}
@media(max-width:760px){.thread-actions button[data-action="take"]:disabled{display:none}.thread-head .thread-identity{min-width:0}.thread-head .thread-identity h2{max-width:100%}}
