/* ===== style4.css : invitations, médias, mentions, visionneuse ===== */
body.hide-previews .conv-preview-text { filter: blur(6px); }
body.hide-previews .conv-item:active .conv-preview-text, body.hide-previews .conv-item:hover .conv-preview-text { filter: none; }
.bubble.mention-me { box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .6), 0 2px 8px rgba(0, 0, 0, .05); }
#invitePreviewSheet, #micTestSheet, #mediaSheet { z-index: 320; }

/* mentions */
.mention-panel { display: none; flex-direction: column; gap: 2px; max-width: 640px; margin: 0 auto; width: 100%; padding: 6px 12px 0; background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, .08); }
.mention-panel.show { display: flex; animation: slideUpReply .18s var(--ease); }
.mention-opt { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 6px; border-radius: 12px; text-align: left; color: var(--text); }
.mention-opt:active { background: var(--bg-card); }
.mo-av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.mo-av img { width: 100%; height: 100%; object-fit: cover; }
.mo-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-user { color: var(--text-3); font-size: 12.5px; }

/* hors connexion */
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 600; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: #374151; color: #fff; font-size: 13px; font-weight: 700; text-align: center; transform: translateY(-110%); transition: transform .25s var(--ease); }
.offline-bar.show { transform: none; }
.offline-bar.back { background: var(--success); }

/* médias */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; }
.media-grid button { border: 0; padding: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 14px; color: var(--text); text-decoration: none; cursor: pointer; }
.media-row:active { background: var(--hover); }
.media-row > i { width: 38px; height: 38px; border-radius: 50%; background: rgba(var(--brand-rgb), .14); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.media-row div { min-width: 0; flex: 1; }
.media-row b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-row small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-hint { font-size: 12px; color: var(--text-3); text-align: center; padding: 12px 0 0; }

/* invitation */
.inv-card { padding: 8px 20px 22px; text-align: center; }
.inv-label2 { font-size: 12.5px; color: var(--text-3); margin: 4px 0 12px; }
.inv-photo { width: 96px; height: 96px; border-radius: 26px; margin: 0 auto 12px; overflow: hidden; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; box-shadow: 0 10px 28px rgba(var(--brand-rgb), .3); }
.inv-photo img { width: 100%; height: 100%; object-fit: cover; }
.inv-icon { width: 70px; height: 70px; border-radius: 50%; margin: 8px auto 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--bg-card); color: var(--text-3); }
.inv-name { font-size: 21px; font-weight: 800; color: var(--text); word-break: break-word; }
.inv-meta { display: flex; justify-content: center; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--text-3); }
.inv-meta i { margin-right: 5px; color: var(--brand); }
.inv-desc { font-size: 14px; color: var(--text-2); line-height: 1.45; margin: 12px 0 6px; word-break: break-word; }
.inv-later { border: 0; background: transparent; color: var(--text-3); font-weight: 700; font-size: 14px; padding: 12px; margin-top: 2px; width: 100%; }
.invite-embed { display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer; }
.invite-embed .lc-icon { overflow: hidden; }
.invite-embed .lc-icon img { width: 100%; height: 100%; object-fit: cover; }
.invite-embed .mini-btn { margin-left: auto; }
.msg-row.sent .invite-embed .mini-btn { background: #fff; color: var(--brand); }

/* visionneuse */
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.iv-prev { left: 12px; }
.iv-next { right: 12px; }
.iv-count { position: absolute; top: max(22px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 13px; background: rgba(0, 0, 0, .4); padding: 4px 12px; border-radius: 100px; }
.iv-count:empty { display: none; }
.iv-dl { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 66px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; text-decoration: none; }
.img-viewer img { transition: transform .2s; }
.img-viewer.zoomed img { transform: scale(2.4); cursor: zoom-out; }

/* glisser-déposer */
.conv-view.drop-over::after { content: "Dépose l'image pour l'envoyer"; position: absolute; inset: 10px; border: 3px dashed var(--brand); border-radius: 24px; background: rgba(var(--brand-rgb), .12); display: flex; align-items: center; justify-content: center; color: var(--brand); font-weight: 800; font-size: 18px; z-index: 20; pointer-events: none; }

/* test du micro */
.diag-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.diag-row i { font-size: 20px; margin-top: 2px; }
.diag-row.ok i { color: var(--success); }
.diag-row.ko i { color: var(--danger); }
.diag-row.na i { color: var(--text-3); }
.diag-row b { display: block; font-size: 14px; color: var(--text); }
.diag-row small { color: var(--text-3); font-size: 12.5px; word-break: break-word; }
.diag-tip { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--brand-light); color: var(--brand); font-weight: 700; font-size: 13.5px; line-height: 1.4; }
