.avatar img,.self-avatar img { width:100%;height:100%;object-fit:cover;border-radius:50%; }
.self-avatar { padding:0;overflow:hidden; }
.bubble { position:relative; }
.message-quick-actions { position:absolute;right:8px;top:-22px;display:flex;gap:2px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--surface);box-shadow:0 3px 10px #0001;opacity:0;pointer-events:none;z-index:2; }
.message-quick-actions .icon-button { width:30px;height:28px; }
.bubble:hover .message-quick-actions,.bubble:focus-within .message-quick-actions { opacity:1;pointer-events:auto; }
.message-highlight { outline:2px solid var(--green);outline-offset:3px; }
.voice-panel { margin:10px 26px 0;padding:15px;border:1px solid var(--theme-border);border-radius:12px;background:var(--surface);color:var(--theme-text); }
.voice-heading { display:flex;gap:8px;align-items:center;font-size:13px; }
.voice-heading time { margin-left:auto;color:var(--muted);font-variant-numeric:tabular-nums; }
.recording-dot { width:8px;height:8px;border-radius:50%;background:#ce4b55; }
#voice-wave { display:block;width:100%;height:52px;margin:8px 0; }
.voice-actions { display:flex;justify-content:flex-end;gap:8px; }
.voice-actions button { margin-top:8px;font-size:12px;min-height:38px; }
.voice-panel audio,.attachment-preview audio { width:100%;height:40px;margin:10px 0; }
.voice-message { width:285px;max-width:100%; }
.voice-message > span { display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin-bottom:8px; }
.voice-message svg { width:16px;height:16px; }
.voice-message audio { display:block;width:100%;height:40px; }
.media-modal audio { display:block;width:100%;margin:18px 0; }
.profile-photo { display:grid;place-items:center;width:88px;height:88px;border-radius:50%;margin:18px auto;background:var(--theme-selected);color:var(--green);font-size:24px;font-weight:600;overflow:hidden; }
.profile-photo img { width:100%;height:100%;object-fit:cover; }
.profile-photo-actions { display:flex;justify-content:center;gap:8px; }
.profile-photo-actions button { margin-top:0; }
.search-result { display:block;width:100%;padding:14px;border:1px solid var(--line);border-radius:9px;background:var(--theme-soft);text-align:left;color:var(--theme-text);margin:9px 0; }
.search-result:hover { border-color:var(--green); }
.search-result span { font-size:10px;color:var(--muted); }
.search-result p { margin:7px 0 0;font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere; }
#search-results { max-height:40dvh;overflow:auto; }
.media-tabs { display:flex;gap:5px;flex-wrap:wrap; }
.media-tabs button { margin:0; }
.media-tabs [aria-pressed="true"] { background:var(--theme-selected);color:var(--green);outline:1px solid var(--green); }
.media-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:48dvh;overflow:auto; }
.media-tile { padding:0;background:var(--theme-soft);border:1px solid var(--line);border-radius:9px;overflow:hidden;color:var(--theme-text);text-align:left; }
.media-tile:hover { border-color:var(--green); }
.media-tile img { width:100%;aspect-ratio:4/3;object-fit:cover;display:block; }
.media-tile>span:last-child { display:block;padding:10px;font-size:11px; }
.media-tile .media-tile-icon { display:grid;place-items:center;aspect-ratio:4/3;background:var(--theme-selected);color:var(--green); }
.media-tile-icon svg { width:32px;height:32px; }
.notification-state { padding:14px;background:var(--theme-soft);border-radius:8px;color:var(--theme-text);font-size:13px;line-height:1.6; }
@media(pointer:coarse) { .message-quick-actions { display:none; } .bubble { -webkit-touch-callout:none; } }
@media(max-width:720px) { .voice-panel { margin:8px 10px 0; } .composer { gap:2px; } .composer .icon-button { width:32px; } .composer textarea { padding-left:2px; } .voice-message { width:255px; } }

.audio-wave { display:block;width:100%;height:32px;margin:8px 0;fill:var(--green);stroke:none;opacity:.85; }

.invite-person { text-align:center; }
.invite-person h3 { margin:12px 0 5px;font-size:20px;overflow-wrap:anywhere; }
.invite-person p { color:var(--muted);font-size:13px;margin:0; }
.invite-link-actions { display:flex;flex-wrap:wrap;gap:8px;margin:8px 0; }
#friend-invite-link { font-size:12px; }
#invite-error + .confirm-actions { flex-wrap:wrap; }
