/* ===== style3.css : vocal, groupes, invitation, non-sélection ===== */

/* ----- texte non sélectionnable (sauf champs de saisie) ----- */
.app-page, .conv-view, .sheet-overlay, .img-viewer { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }
.app-page input, .app-page textarea, .conv-view input, .conv-view textarea, .sheet-overlay input, .sheet-overlay textarea { -webkit-user-select: text; -moz-user-select: text; user-select: text; -webkit-touch-callout: default; }
.inv-link, .inv-code { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.app-page ::selection, .conv-view ::selection, .sheet-overlay ::selection { background: transparent; color: inherit; }
.app-page input::selection, .conv-view input::selection, .sheet-overlay input::selection,
.app-page textarea::selection, .conv-view textarea::selection, .sheet-overlay textarea::selection,
.inv-link::selection, .inv-code::selection { background: rgba(var(--brand-rgb), .3); }
img { -webkit-user-drag: none; user-drag: none; }

/* ----- empilement des feuilles ----- */
#groupSettingsSheet, #msgInfoSheet { z-index: 300; }
#groupFormSheet, #inviteSheet { z-index: 310; }
#convOptionsSheet, #msgActionsSheet { z-index: 330; }

/* ----- bulle vocale ----- */
.bubble.has-voice { padding: 9px 10px 6px; width: min(310px, 100%); max-width: 100%; }
.voice-player { display: flex; align-items: center; gap: 10px; min-width: 238px; }
.vp-play {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex-shrink: 0; font-size: 17px;
  background: rgba(var(--brand-rgb), .14); color: var(--brand);
  display: flex; align-items: center; justify-content: center; transition: transform .18s var(--spring), background .15s;
}
.vp-play i { margin-left: 2px; }
.vp-play i.fa-pause { margin-left: 0; }
.vp-play:active { transform: scale(.88); }
.msg-row.sent .vp-play { background: rgba(255, 255, 255, .26); color: #fff; }
.vp-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vp-wave { display: flex; align-items: center; gap: 2px; height: 32px; cursor: pointer; touch-action: none; }
.vp-wave i { flex: 1; min-width: 2px; border-radius: 3px; background: currentColor; opacity: .3; transition: opacity .12s; }
.vp-wave i.on { opacity: 1; background: var(--brand); }
.msg-row.sent .vp-wave i { background: #fff; }
.msg-row.sent .vp-wave i.on { background: #fff; opacity: 1; }
.msg-row.sent .vp-wave i:not(.on) { opacity: .45; }
.vp-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .85; }
.vp-dot { width: 8px; height: 8px; border-radius: 50%; background: #34b7f1; flex-shrink: 0; }
.vp-side { position: relative; width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.vp-avatar { position: relative; width: 44px; height: 44px; }
.vp-av { display: flex; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--brand-grad); color: #fff; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.vp-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-row.sent .vp-av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); }
.vp-mic { position: absolute; right: -3px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%; background: var(--bg); color: var(--text-3); font-size: 10px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.voice-player.played .vp-mic { color: #34b7f1; }
.vp-speed { width: 44px; height: 30px; border: 0; border-radius: 100px; background: rgba(0, 0, 0, .14); color: inherit; font-weight: 800; font-size: 12px; transition: transform .15s; }
.vp-speed:active { transform: scale(.9); }
.msg-row.sent .vp-speed { background: rgba(255, 255, 255, .28); }
.voice-player.playing .vp-play { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), .45); animation: vpPulse 1.6s infinite; }
@keyframes vpPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), .45); } 70% { box-shadow: 0 0 0 11px rgba(var(--brand-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0); } }

/* ----- enregistreur ----- */
.voice-rec, .voice-prev { display: none; max-width: 640px; margin: 0 auto; width: 100%; flex-shrink: 0; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.voice-rec.show { display: flex; align-items: center; gap: 8px; animation: slideUpReply .2s var(--ease); }
.voice-prev.show { display: block; animation: slideUpReply .2s var(--ease); }
.vr-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg); box-shadow: 0 0 0 1px var(--border);
  color: var(--text-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: transform .15s var(--spring);
}
.vr-btn:active { transform: scale(.88); }
.vr-btn.trash { color: var(--danger); }
.vr-btn.vr-send { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .4); }
.vr-mid { flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 24px; background: var(--bg); box-shadow: 0 0 0 1px var(--border), 0 4px 16px rgba(0, 0, 0, .06); overflow: hidden; }
.vr-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; flex-shrink: 0; animation: recPulse 1s infinite; }
.voice-rec.paused .vr-dot { animation: none; opacity: .4; }
@keyframes recPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.vr-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; color: var(--text); min-width: 38px; }
.vr-wave { flex: 1; min-width: 0; height: 28px; width: 100%; }
.vp-fx { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.vp-fx::-webkit-scrollbar { display: none; }
.fx-chip { flex-shrink: 0; border: 0; border-radius: 100px; padding: 8px 14px; font-size: 13px; font-weight: 700; background: var(--bg-card); color: var(--text); transition: transform .15s var(--spring); }
.fx-chip:active { transform: scale(.94); }
.fx-chip.active { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .35); }
.fx-chip.busy { opacity: .6; animation: recPulse 1s infinite; }
.vp-line { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 30px; padding: 6px; box-shadow: 0 0 0 1px var(--border), 0 4px 16px rgba(0, 0, 0, .06); }
.vp-line .vp-wave { flex: 1; min-width: 0; }
.vp-line .vp-time { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 800; color: var(--text); min-width: 34px; text-align: center; }
.conv-mic { background: var(--brand-grad); }

/* ----- épingle de message ----- */
.pin-bar { display: none; align-items: center; gap: 10px; padding: 8px 14px; background: var(--bg); box-shadow: 0 1px 0 var(--border); max-width: 640px; margin: 0 auto; width: 100%; z-index: 2; }
.pin-bar.show { display: flex; }
.pin-bar > i { color: var(--brand); font-size: 14px; }
.pin-text { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.pin-bar button { border: 0; background: var(--bg-card); color: var(--text-2); width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }

/* ----- paramètres du groupe ----- */
.gs-wrap { padding: 4px 14px 22px; }
.gs-hero { text-align: center; padding: 4px 0 6px; }
.gs-photo-wrap { position: relative; width: 108px; margin: 6px auto 10px; }
.gs-photo { width: 108px; height: 108px; border-radius: 50%; overflow: hidden; background: var(--brand-grad); color: #fff; font-size: 40px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(var(--brand-rgb), .3); }
.gs-photo img { width: 100%; height: 100%; object-fit: cover; }
.gs-cam { position: absolute; right: -2px; bottom: 0; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--bg); background: var(--brand-grad); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.gs-title { font-size: 21px; font-weight: 800; color: var(--text); }
.gs-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.gs-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.gs-quick button { border: 0; border-radius: 16px; padding: 12px 4px 10px; background: var(--bg-card); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; transition: transform .15s var(--spring); }
.gs-quick button i { font-size: 18px; color: var(--brand); }
.gs-quick button:active { transform: scale(.93); }
.gs-card { margin-top: 12px; padding: 12px 12px 8px; border-radius: 18px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--border); }
.gs-card-title { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.gs-desc { font-size: 14.5px; color: var(--text-2); line-height: 1.45; margin-bottom: 8px; }
.gs-btn { width: 100%; border: 0; border-radius: 12px; padding: 12px; margin-bottom: 6px; background: var(--bg); color: var(--text); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 0 0 1px var(--border); }
.gs-btn.danger { color: var(--danger); }
.gs-btn:active { transform: scale(.98); }
.gs-card .conv-item { padding: 8px 6px; }
.gs-card .conv-avatar { width: 44px; height: 44px; font-size: 16px; }
.role-badge { flex-shrink: 0; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 100px; background: rgba(var(--brand-rgb), .14); color: var(--brand); }
.role-badge.owner { background: var(--brand-grad); color: #fff; }

/* ----- invitation ----- */
.inv-label { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); margin: 6px 0; }
.inv-link { padding: 13px 14px; border-radius: 14px; background: var(--bg-card); font-weight: 700; font-size: 14px; color: var(--text); word-break: break-all; }
.inv-code { padding: 13px 14px; border-radius: 14px; background: var(--bg-card); font-weight: 800; font-size: 20px; letter-spacing: 2px; text-align: center; color: var(--brand); word-break: break-all; }
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.inv-grid button { border: 0; border-radius: 16px; padding: 12px 4px 10px; background: var(--bg-card); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.inv-grid button i { font-size: 20px; color: var(--brand); }
.inv-grid button:active { transform: scale(.93); }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row span { color: var(--text-3); }
.info-row b { color: var(--text); text-align: right; word-break: break-word; }
.info-row:last-child { border-bottom: 0; }
.conv-name { display: flex; align-items: center; min-width: 0; }
