/* Be Chat — feuille de style. Thèmes clair/sombre + couleur d'accent via attributs sur <html>. */
:root {
  --accent: #6c5cff; --accent-2: #8f7bff; --accent-ink: #fff; --accent-soft: rgba(108, 92, 255, .12);
  --bg: #f1f0f9; --surface: #ffffff; --surface-2: #f6f5fc; --surface-3: #eceaf6;
  --text: #17152b; --muted: #6d6988; --faint: #9a97b3; --line: #e6e4f1;
  --in: #ffffff; --in-text: #17152b;
  --danger: #e5484d; --ok: #1faa6b; --warn: #f5a524;
  --shadow: 0 1px 2px rgba(23, 21, 43, .06), 0 8px 24px rgba(23, 21, 43, .08);
  --shadow-lg: 0 24px 70px rgba(23, 21, 43, .22);
  --radius: 18px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0c14; --surface: #16141f; --surface-2: #1d1a29; --surface-3: #262336;
  --text: #edebf8; --muted: #a09cbb; --faint: #6f6b8a; --line: #2a2739;
  --in: #211e2f; --in-text: #edebf8;
  --accent-soft: rgba(143, 123, 255, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
[data-accent="emerald"] { --accent: #0e9f6e; --accent-2: #2cc08c; --accent-soft: rgba(14, 159, 110, .14); }
[data-accent="ocean"] { --accent: #0b84e0; --accent-2: #38a7f5; --accent-soft: rgba(11, 132, 224, .14); }
[data-accent="coral"] { --accent: #f0503c; --accent-2: #ff7a5c; --accent-soft: rgba(240, 80, 60, .14); }
[data-accent="amber"] { --accent: #d97706; --accent-2: #f2a11c; --accent-soft: rgba(217, 119, 6, .16); }
[data-accent="rose"] { --accent: #e0348a; --accent-2: #f565ab; --accent-soft: rgba(224, 52, 138, .14); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* --app-h : hauteur réelle de l'écran, posée par app.js sur iPhone quand l'application installée reçoit une fenêtre trop courte */
html, body { height: var(--app-h, 100%); margin: 0; }
html { overscroll-behavior: none; }
body { font: 15px/1.45 var(--font); color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#root { height: var(--app-h, 100dvh); }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent; }
.ic { flex: none; display: block; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.info-sec { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.info-sec .ticks { display: inline-flex; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
p.center { display: block; padding: 22px 12px; }
.small { font-size: 12.5px; }

.spin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot, .loading { display: grid; place-items: center; padding: 26px; color: var(--muted); }
.boot { height: 100%; }

/* ---------- Boutons et champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 600; background: var(--surface-3); color: var(--text); transition: filter .15s, transform .08s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.big { height: 50px; width: 100%; font-size: 16px; border-radius: 14px; }
.ibtn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; flex: none; position: relative; }
.ibtn:hover { background: var(--surface-3); color: var(--text); }
.ibtn.tiny { width: 28px; height: 28px; vertical-align: middle; margin-left: 4px; }
.ibtn.tiny .ic { width: 16px; height: 16px; }
.ibtn.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.linkbtn { color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.linkbtn:hover { text-decoration: underline; }
.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 80px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.big { height: 52px; font-size: 16px; border-radius: 14px; }
.input.code { height: 64px; font-size: 30px; font-weight: 700; letter-spacing: 12px; text-align: center; border-radius: 16px; margin-bottom: 14px; padding-left: 26px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 2px 6px; font-weight: 500; }
.prefixed { position: relative; }
.prefixed i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-style: normal; font-weight: 600; }
.prefixed .input { padding-left: 30px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { height: 32px; padding: 0 13px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, color .15s; flex: none; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
.chip b { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
.badge { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; flex: none; font-style: normal; }
.badge.muted { background: var(--faint); color: #fff; }
span.badge { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 0 9px; height: 22px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1.5px solid var(--line); transition: background .2s, border-color .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.radio, .checkbox { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); flex: none; display: grid; place-items: center; color: #fff; transition: all .15s; }
.radio.on { border: 7px solid var(--accent); }
.checkbox.on { background: var(--accent); border-color: var(--accent); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .2s; border-radius: 99px; }
kbd { font: 600 12px var(--font); background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }

/* ---------- Avatars ---------- */
.avatar { position: relative; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: .3px; user-select: none; background: linear-gradient(135deg, #8f7bff, #5a3df5); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.c0 { background: linear-gradient(135deg, #8f7bff, #5a3df5); } .avatar.c1 { background: linear-gradient(135deg, #ff8a65, #f0503c); }
.avatar.c2 { background: linear-gradient(135deg, #38c6a3, #0e9f6e); } .avatar.c3 { background: linear-gradient(135deg, #5cc0ff, #0b84e0); }
.avatar.c4 { background: linear-gradient(135deg, #ffc35c, #e58a0b); } .avatar.c5 { background: linear-gradient(135deg, #ff7bb8, #e0348a); }
.avatar.c6 { background: linear-gradient(135deg, #6fe0d8, #0f9aa8); } .avatar.c7 { background: linear-gradient(135deg, #b48cff, #7b3fe4); }
.avatar.c8 { background: linear-gradient(135deg, #5b6282, #2f3552); }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 26%; height: 26%; min-width: 10px; min-height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }
.t0 { --who: #6c5cff; } .t1 { --who: #e2553f; } .t2 { --who: #0e9f6e; } .t3 { --who: #0b84e0; } .t4 { --who: #c97a06; } .t5 { --who: #d42f80; } .t6 { --who: #0f8f9c; } .t7 { --who: #8347e6; }
[data-theme="dark"] .t0 { --who: #a99bff; } [data-theme="dark"] .t1 { --who: #ff9478; } [data-theme="dark"] .t2 { --who: #4fd4a8; } [data-theme="dark"] .t3 { --who: #6cc0ff; }
[data-theme="dark"] .t4 { --who: #ffc35c; } [data-theme="dark"] .t5 { --who: #ff86bf; } [data-theme="dark"] .t6 { --who: #6fe0d8; } [data-theme="dark"] .t7 { --who: #c3a2ff; }

/* ---------- Connexion ---------- */
.auth { height: 100%; display: grid; place-items: center; padding: 20px; position: relative; overflow: auto; background: var(--bg); }
.auth-art, .empty-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 16s ease-in-out infinite; }
.orb.o1 { width: 420px; height: 420px; background: var(--accent-2); top: -120px; left: -80px; }
.orb.o2 { width: 380px; height: 380px; background: #ff7bb8; bottom: -140px; right: -60px; animation-delay: -5s; opacity: .35; }
.orb.o3 { width: 300px; height: 300px; background: #38c6ff; top: 40%; left: 55%; animation-delay: -9s; opacity: .28; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -24px) scale(1.08); } }
.auth-card { position: relative; width: min(430px, 100%); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line); border-radius: 28px; padding: 34px 30px 28px; box-shadow: var(--shadow-lg); animation: rise .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.auth-logo, .logo-big, .rail-logo { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.auth-logo { width: 60px; height: 60px; border-radius: 20px; margin-bottom: 18px; }
.auth-card h1 { font-size: 30px; letter-spacing: -.8px; line-height: 1.15; }
.auth-lead { color: var(--muted); margin: 8px 0 22px; font-size: 15.5px; }
.auth-lead b { color: var(--text); overflow-wrap: anywhere; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points .ic { color: var(--ok); }
.auth-card .back { margin-bottom: 10px; }
.auth-card form + .linkbtn { margin-top: 12px; }
.seg.wide { display: flex; margin-bottom: 16px; }
.seg.wide button { flex: 1; justify-content: center; height: 38px; font-size: 14px; }
.phone-row { display: flex; gap: 8px; }
.country { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); flex: none; transition: border-color .15s; }
.country:hover { border-color: var(--accent); }
.country .ic { color: var(--faint); }
.flag { font-size: 22px; line-height: 1; }
.auth-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.dev-code { display: block; width: 100%; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--text); font-size: 13.5px; margin-bottom: 14px; border: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); }
.dev-code b { letter-spacing: 2px; }

/* ---------- Structure ---------- */
.app { height: 100%; display: grid; grid-template-columns: 76px minmax(300px, 390px) minmax(0, 1fr); background: var(--bg); }
.app.drawer-open { grid-template-columns: 76px minmax(300px, 390px) minmax(0, 1fr) 380px; }
.rail { display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 14px; background: var(--surface); border-right: 1px solid var(--line); }
.rail-logo { width: 44px; height: 44px; border-radius: 15px; }
.rail-tabs { display: flex; flex-direction: column; gap: 4px; flex: 1; margin-top: 6px; }
.rail-btn { position: relative; width: 60px; padding: 9px 0 7px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; transition: background .15s, color .15s; }
.rail-btn:hover { background: var(--surface-2); color: var(--text); }
.rail-btn.on { background: var(--accent-soft); color: var(--accent); }
.rail-badge { position: absolute; top: 3px; right: 6px; background: var(--accent); color: #fff; border-radius: 99px; font-size: 10.5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--surface); box-sizing: content-box; }
.rail-dot { position: absolute; top: 7px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-me { border-radius: 50%; transition: transform .15s; }
.rail-me:hover { transform: scale(1.06); }

.side, .drawer { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); position: relative; }
.drawer { border-right: 0; border-left: 1px solid var(--line); display: none; }
.app.drawer-open .drawer { display: flex; animation: slideL .22s ease; }
@keyframes slideL { from { transform: translateX(24px); opacity: 0; } }
.side-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 10px 18px; min-height: 64px; flex: none; }
.side-head h2 { font-size: 23px; letter-spacing: -.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer .side-head { padding-left: 10px; border-bottom: 1px solid var(--line); }
.drawer .side-head h2 { font-size: 17px; letter-spacing: 0; }
.head-actions { display: flex; gap: 2px; }
.search { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 0 14px; height: 42px; border-radius: 13px; background: var(--surface-2); color: var(--faint); border: 1.5px solid transparent; transition: border-color .15s, background .15s; flex: none; }
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.filters { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.filters::-webkit-scrollbar { display: none; }
.side-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 20px; }
.side > .side-scroll { padding-left: 8px; padding-right: 8px; }
.fab-new { display: none; }

.chat-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px; border-radius: 16px; transition: background .12s; position: relative; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--accent-soft); }
.ci-main { flex: 1; min-width: 0; }
.ci-top, .ci-bot { display: flex; align-items: center; gap: 8px; }
.ci-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 5px; }
.ci-top time { font-size: 12px; color: var(--faint); flex: none; }
.chat-item.unread .ci-top time { color: var(--accent); font-weight: 600; }
.ci-bot { margin-top: 2px; min-height: 21px; }
.ci-bot > span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 14px; }
.chat-item.unread .ci-bot > span:first-child { color: var(--text); }
.ci-flags { display: flex; align-items: center; gap: 5px; color: var(--faint); flex: none; }
.typing { color: var(--accent) !important; font-weight: 500; }
.draft { color: var(--danger); font-style: normal; font-weight: 600; }
.tick-mini { font-style: normal; font-size: 12px; letter-spacing: -3px; margin-right: 6px; color: var(--faint); font-weight: 700; }
.tick-mini.read { color: var(--accent); }
.empty-side { text-align: center; padding: 46px 26px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty-side .ic { color: var(--accent); opacity: .8; margin-bottom: 6px; }
.empty-side b { color: var(--text); font-size: 17px; }
.empty-side .btn { margin-top: 10px; }
h4.sub, .card h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--faint); font-weight: 700; margin: 16px 10px 6px; }

.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 14px; min-height: 52px; color: var(--text); text-decoration: none !important; transition: background .12s; }
button.row:hover, a.row:hover, .row.on { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > .ic { color: var(--faint); }
.row-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex: none; }
.row-ic.accent { background: var(--accent-soft); color: var(--accent); }
.row-ic.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.row.danger .row-main b { color: var(--danger); }
.row.missed .row-main small { color: var(--danger); }
.result { display: block; width: 100%; padding: 10px 12px; border-radius: 14px; }
.result:hover { background: var(--surface-2); }
.result-top { display: flex; gap: 8px; align-items: baseline; }
.result-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.result-top small { color: var(--faint); font-size: 12px; }
.result p { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

.net-banner { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow); }
#toasts { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: #1d1a2e; color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .25s cubic-bezier(.2, 1.2, .4, 1); max-width: 92vw; }
[data-theme="dark"] .toast { background: #f1effc; color: #17152b; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ---------- Écran vide ---------- */
.main { min-width: 0; min-height: 0; position: relative; display: flex; }
.empty-main { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 30px; position: relative; overflow: hidden; }
.empty-main > *:not(.empty-art) { position: relative; }
.empty-main .orb { opacity: .22; }
.logo-big { width: 88px; height: 88px; border-radius: 28px; margin-bottom: 8px; }
.empty-main h2 { font-size: 34px; letter-spacing: -1px; }
.empty-main p { color: var(--muted); max-width: 440px; font-size: 15.5px; }
.empty-keys { display: flex; gap: 6px; align-items: center; color: var(--faint); font-size: 13px; margin-top: 10px; }

/* ---------- Conversation ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; --wall: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 6px; height: 64px; padding: 0 10px 0 14px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); flex: none; z-index: 3; }
.ch-id { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 6px 8px; margin-left: -6px; border-radius: 14px; }
.ch-id:hover { background: var(--surface-2); }
.ch-names { min-width: 0; }
.ch-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.ch-title .ic { color: var(--faint); }
.ch-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 18px; }
.ch-sub.typing { color: var(--accent); }
.ch-actions { display: flex; gap: 2px; flex: none; }
.sel-count { flex: 1; font-size: 16px; padding-left: 6px; }
.only-mobile { display: none; }
.pinned-bar { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 14px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); flex: none; z-index: 2; }
.pin-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 5px 4px; }
.pin-main > .ic { color: var(--accent); }
.pin-main span { min-width: 0; border-left: 2.5px solid var(--accent); padding-left: 10px; }
.pin-main b { display: block; font-size: 12.5px; color: var(--accent); }
.pin-main small { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-body { flex: 1; min-height: 0; position: relative; background: var(--wall); }
.scroller { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.msg-list { display: flex; flex-direction: column; padding: 14px max(14px, calc((100% - 880px) / 2)) 16px; min-height: 100%; justify-content: flex-end; }
[data-wall="aurora"] { --wall: radial-gradient(900px 500px at 12% -5%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, #ff7bb8 12%, transparent), transparent 60%), var(--bg); }
[data-wall="plain"] { --wall: var(--bg); }
[data-wall="dots"] { --wall: radial-gradient(color-mix(in srgb, var(--muted) 22%, transparent) 1.2px, transparent 1.3px) 0 0 / 22px 22px, var(--bg); }
[data-wall="sunset"] { --wall: linear-gradient(160deg, color-mix(in srgb, #ff9a5c 26%, var(--bg)), color-mix(in srgb, #e0348a 18%, var(--bg)) 55%, color-mix(in srgb, #6c5cff 20%, var(--bg))); }
[data-wall="forest"] { --wall: linear-gradient(160deg, color-mix(in srgb, #2cc08c 24%, var(--bg)), color-mix(in srgb, #0f8f9c 16%, var(--bg))); }
[data-wall="ocean"] { --wall: linear-gradient(160deg, color-mix(in srgb, #38a7f5 24%, var(--bg)), color-mix(in srgb, #6c5cff 18%, var(--bg))); }
[data-wall="night"] { --wall: radial-gradient(1.5px 1.5px at 20% 30%, #fff8, transparent), radial-gradient(1px 1px at 70% 20%, #fff7, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #fff6, transparent), radial-gradient(1px 1px at 85% 65%, #fff8, transparent), linear-gradient(180deg, #14122a, #1f1740); }
.chat[data-wall="night"] .day span, .chat[data-wall="night"] .msg.system span { background: rgba(255, 255, 255, .14); color: #fff; }

.day, .unread-sep, .msg.system { align-self: center; margin: 10px 0; text-align: center; }
.day { position: sticky; top: 8px; z-index: 1; }
.day span, .msg.system span { display: inline-block; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(10px); color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 99px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.msg.system { max-width: 86%; margin: 4px 0; }
.msg.system span { font-weight: 500; border-radius: 12px; }
.unread-sep { align-self: stretch; display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: 12.5px; font-weight: 700; }
.unread-sep::before, .unread-sep::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--accent) 40%, transparent); }
.empty-chat { align-self: center; margin: auto; text-align: center; display: grid; justify-items: center; gap: 8px; padding: 30px 26px; color: var(--muted); background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(12px); border-radius: 24px; max-width: 340px; box-shadow: var(--shadow); }
.empty-chat b { color: var(--text); font-size: 17px; }
.hello-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.hello-row .chip { background: var(--accent-soft); color: var(--accent); }

.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; position: relative; max-width: 100%; border-radius: 14px; }
.msg.cont { margin-top: 2px; }
.msg.out { flex-direction: row-reverse; }
.msg .col { display: flex; flex-direction: column; max-width: min(72%, 560px); min-width: 0; align-items: flex-start; }
.msg.out .col { align-items: flex-end; }
.av-btn, .av-gap { width: 30px; flex: none; align-self: flex-start; }
.av-btn { border-radius: 50%; margin-top: 2px; }
.bubble { position: relative; padding: 7px 11px 6px; border-radius: var(--radius); background: var(--in); color: var(--in-text); box-shadow: 0 1px 1.5px rgba(23, 21, 43, .09); min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.msg.in .bubble { border-bottom-left-radius: 6px; }
.msg.in.cont .bubble { border-top-left-radius: 6px; }
.msg.out .bubble { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; border-bottom-right-radius: 6px; }
.msg.out.cont .bubble { border-top-right-radius: 6px; }
.msg.out .bubble a { color: #fff; text-decoration: underline; }
.bubble .text { white-space: pre-wrap; font-size: 15px; line-height: 1.42; }
.bubble .text .ic { display: inline; vertical-align: -2px; }
.bubble.deleted .text { font-style: italic; opacity: .75; }
.bubble code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(125, 120, 160, .18); padding: 1px 5px; border-radius: 6px; }
.bubble pre { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(20, 18, 40, .08); padding: 9px 11px; border-radius: 10px; margin: 4px 0; white-space: pre-wrap; overflow-x: auto; }
.msg.out .bubble code, .msg.out .bubble pre { background: rgba(255, 255, 255, .2); }
.mention { color: var(--accent); font-weight: 600; background: var(--accent-soft); padding: 0 4px; border-radius: 6px; }
.msg.out .mention { color: #fff; background: rgba(255, 255, 255, .22); }
.sender { display: block; font-weight: 700; font-size: 13px; color: var(--who, var(--accent)); margin-bottom: 1px; }
.sender:hover { text-decoration: underline; }
.fwd { display: flex; align-items: center; gap: 5px; font-size: 12px; font-style: italic; opacity: .75; margin-bottom: 2px; }
.quote { display: block; width: 100%; text-align: left; border-left: 3px solid var(--who, var(--accent)); background: color-mix(in srgb, var(--who, var(--accent)) 10%, transparent); border-radius: 8px; padding: 5px 9px; margin: 2px 0 5px; min-width: 120px; }
.quote b { display: block; font-size: 12.5px; color: var(--who, var(--accent)); }
.quote span { display: flex; align-items: center; gap: 5px; font-size: 13.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.msg.out .quote { border-left-color: #fff; background: rgba(255, 255, 255, .18); }
.msg.out .quote b { color: #fff; }
.meta { float: right; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--faint); margin: 6px -3px -2px 12px; line-height: 1; user-select: none; position: relative; top: 3px; }
.meta i { font-style: normal; }
.bubble.inline-meta .text:last-of-type::after { content: ""; display: inline-block; width: var(--mw, 40px); height: 1px; }
.bubble.inline-meta .meta { position: absolute; right: 10px; bottom: 6px; top: auto; float: none; margin: 0; }
.msg.out .meta { color: rgba(255, 255, 255, .78); }
.ticks { display: inline-flex; }
.ticks.read { color: #7df0d0; }
.msg.out .ticks.read { color: #9bfbe0; filter: drop-shadow(0 0 3px rgba(125, 240, 208, .5)); }
.ticks.failed { color: #ffd2d2; }
.row .ticks.read { color: var(--accent); } .row .ticks { color: var(--faint); }
.bubble.emoji-only { background: none !important; box-shadow: none; padding: 0 2px; color: var(--text) !important; }
.bubble.emoji-only .text { font-size: 46px; line-height: 1.15; }
.bubble.emoji-only.e2 .text { font-size: 40px; } .bubble.emoji-only.e3 .text { font-size: 34px; }
.bubble.emoji-only .meta { float: none; display: flex; justify-content: flex-end; margin: 2px 0 0; top: 0; color: var(--muted); background: color-mix(in srgb, var(--surface) 75%, transparent); padding: 3px 7px; border-radius: 99px; width: max-content; margin-left: auto; }
.bubble.emoji-only .ticks.read { color: var(--accent); filter: none; }
.bubble.media-only { padding: 3px; }
.bubble.media-only .meta { position: absolute; right: 9px; bottom: 9px; top: auto; margin: 0; background: rgba(0, 0, 0, .5); color: #fff; padding: 4px 8px; border-radius: 99px; backdrop-filter: blur(6px); }
.media-wrap { margin: -3px -7px 4px; }
.bubble.media-only .media-wrap { margin: 0; }
.media { display: block; max-width: 100%; border-radius: 14px; overflow: hidden; background: rgba(125, 120, 160, .2); position: relative; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); padding-left: 3px; }
.media .dur { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 99px; }
.caption { padding: 2px 7px 0; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: -5px 6px 2px; position: relative; z-index: 1; }
.reaction { height: 26px; padding: 0 8px; border-radius: 99px; background: var(--surface); border: 1.5px solid var(--line); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); transition: transform .12s; animation: pop .25s cubic-bezier(.3, 1.6, .5, 1); }
.reaction:hover { transform: scale(1.1); }
.reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.reaction b { font-size: 12px; color: var(--muted); }
.msg-tools { display: flex; align-self: center; opacity: 0; transition: opacity .12s; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); flex: none; }
.msg-tools .ibtn { width: 32px; height: 32px; border-radius: 10px; }
.msg-tools .ic { width: 18px; height: 18px; }
.msg:hover .msg-tools, .msg-tools:focus-within { opacity: 1; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.msg.flash::after { content: ""; position: absolute; inset: -3px -8px; border-radius: 14px; background: var(--accent); opacity: 0; animation: flash 1.6s ease; pointer-events: none; }
@keyframes flash { 0%, 100% { opacity: 0; } 20%, 50% { opacity: .2; } }
.chat.selecting .msg { cursor: pointer; }
.chat.selecting .msg::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); flex: none; align-self: center; order: -1; background: var(--surface); }
.chat.selecting .msg.out::before { order: 5; }
.chat.selecting .msg.system::before { display: none; }
.msg.selected::before { background: var(--accent) !important; border-color: var(--accent) !important; box-shadow: inset 0 0 0 3px var(--surface); }
.msg.selected { background: var(--accent-soft); }
.chat.selecting .msg-tools { display: none; }

.audio { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 3px 0 0; }
.play-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; padding-left: 2px; transition: transform .12s; }
.play-btn:active { transform: scale(.92); }
.msg.out .play-btn { background: #fff; color: var(--accent); }
.audio-main { flex: 1; min-width: 0; }
.audio-name { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.wave { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.wave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .32; transition: opacity .1s; }
.wave i.on { opacity: 1; }
.msg.in .wave { color: var(--accent); }
.audio-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; opacity: .8; margin-top: 1px; }
.speed { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(125, 120, 160, .2); }
.msg.out .speed { background: rgba(255, 255, 255, .22); }
.voice-av { position: relative; flex: none; }
.voice-av > .ic { position: absolute; right: -3px; bottom: -2px; background: var(--accent); color: #fff; border-radius: 50%; padding: 2px; width: 17px; height: 17px; border: 2px solid var(--in); }
.msg.out .voice-av > .ic { background: #fff; color: var(--accent); border-color: var(--accent); }
.file-card { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -4px 2px; border-radius: 12px; background: rgba(125, 120, 160, .13); color: inherit !important; text-decoration: none !important; min-width: 230px; }
.msg.out .file-card { background: rgba(255, 255, 255, .18); }
.file-ic { position: relative; width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.msg.out .file-ic { background: #fff; color: var(--accent); }
.file-ic i { position: absolute; bottom: 3px; font: 700 7.5px var(--font); letter-spacing: .3px; }
.file-ic .ic { margin-top: -6px; width: 20px; height: 20px; }
.file-meta { flex: 1; min-width: 0; }
.file-meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { opacity: .75; font-size: 12px; }
.location { display: block; margin: -3px -7px 2px; border-radius: 14px; overflow: hidden; color: inherit !important; text-decoration: none !important; width: 270px; max-width: calc(100% + 14px); }
.map { position: relative; height: 150px; overflow: hidden; background: #dfe7ee; }
.map-tiles { position: absolute; left: 0; top: 0; width: 256px; height: 256px; }
.map-tiles img { position: absolute; width: 256px; height: 256px; }
.map-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); color: #e5484d; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.map-pin .ic { fill: #e5484d; stroke: #fff; }
.loc-meta { padding: 7px 10px 2px; }
.loc-meta b { display: block; font-size: 14px; } .loc-meta small { font-size: 11.5px; opacity: .7; }
.contact-card { display: flex; align-items: center; gap: 12px; min-width: 230px; padding: 4px 0; }
.contact-card > div:not(.avatar) { flex: 1; min-width: 0; }
.contact-card b { display: block; } .contact-card small { opacity: .75; }
.msg.out .contact-card .btn { background: rgba(255, 255, 255, .22); color: #fff; }
.poll { min-width: 250px; max-width: 340px; padding: 2px 0; }
.poll-q { display: block; font-size: 15.5px; }
.poll-hint, .poll-total { display: block; font-size: 12px; opacity: .72; margin: 2px 0 8px; }
.poll-total { margin: 8px 0 0; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border-radius: 11px; background: rgba(125, 120, 160, .13); margin-top: 6px; overflow: hidden; font-size: 14.5px; }
.msg.out .poll-opt { background: rgba(255, 255, 255, .16); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 24%, transparent); transition: width .4s cubic-bezier(.2, .9, .3, 1); border-radius: 11px; }
.msg.out .poll-bar { background: rgba(255, 255, 255, .26); }
.poll-opt > *:not(.poll-bar) { position: relative; }
.poll-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; opacity: .6; display: grid; place-items: center; flex: none; }
.poll-opt.mine .poll-check { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.msg.out .poll-opt.mine .poll-check { background: #fff; border-color: #fff; color: var(--accent); }
.poll-label { flex: 1; text-align: left; }
.poll-opt b { font-size: 12.5px; }
.call-card, .once { display: flex; align-items: center; gap: 11px; min-width: 210px; padding: 3px 2px; text-align: left; }
.call-ic { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); display: grid; place-items: center; flex: none; }
.call-card.missed .call-ic { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.msg.out .call-ic { background: rgba(255, 255, 255, .22) !important; color: #fff !important; }
.call-card b, .once b { display: block; font-size: 14.5px; } .call-card small, .once small { font-size: 12.5px; opacity: .78; }
.once > .ic { color: var(--accent); } .msg.out .once > .ic { color: #fff; }
.once.opened { opacity: .65; }

.fab { position: absolute; right: 18px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--muted); display: grid; place-items: center; box-shadow: var(--shadow); z-index: 2; animation: pop .2s ease; }
.fab b { position: absolute; top: -6px; right: -4px; background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
.drop-hint { position: absolute; inset: 10px; border-radius: 22px; border: 2.5px dashed var(--accent); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px); display: none; place-content: center; justify-items: center; gap: 10px; color: var(--accent); font-weight: 600; font-size: 17px; z-index: 20; pointer-events: none; }
.chat.dragging .drop-hint { display: grid; }

/* ---------- Saisie ---------- */
.composer { flex: none; padding: 8px max(12px, calc((100% - 880px) / 2)) calc(10px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px); border-top: 1px solid var(--line); position: relative; z-index: 3; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer.is-recording .composer-row, .composer.is-recording .ctx { display: none; }
.composer .attach { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); }
.input-wrap { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 24px; border: 1.5px solid transparent; transition: border-color .15s, background .15s; min-height: 46px; padding: 0 4px; }
.input-wrap:focus-within { border-color: var(--accent); background: var(--surface); }
.input-wrap .ibtn { border-radius: 50%; margin-bottom: 2px; }
.input-msg { flex: 1; min-width: 0; border: 0; outline: 0; background: none; resize: none; padding: 11px 6px; line-height: 1.4; max-height: 168px; font-size: 15.5px; }
.input-msg::placeholder { color: var(--faint); }
.sched { color: var(--accent); }
.sched b { position: absolute; top: 3px; right: 3px; font-size: 10px; background: var(--accent); color: #fff; min-width: 15px; height: 15px; border-radius: 99px; display: grid; place-items: center; }
.send { width: 46px; height: 46px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 36%, transparent); transition: transform .12s; }
.send:hover { transform: scale(1.06); } .send:active { transform: scale(.94); }
.send .ic { transition: transform .2s; }
.send:not(.mic) .ic { transform: translate(-1px, 1px); }
.composer-note { text-align: center; color: var(--muted); padding: 12px; font-size: 14px; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctx { display: flex; align-items: center; gap: 12px; padding: 4px 4px 8px 10px; animation: rise .18s ease; }
.ctx > .ic { color: var(--accent); }
.ctx-main { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; }
.ctx-main b { display: block; font-size: 13px; color: var(--accent); }
.ctx-main small { display: block; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mentions { position: absolute; left: max(12px, calc((100% - 880px) / 2)); bottom: calc(100% + 6px); width: min(320px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; }
.recording { display: flex; align-items: center; gap: 12px; height: 46px; animation: rise .18s ease; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; flex: none; }
@keyframes blink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; min-width: 42px; }
.rec-wave { flex: 1; height: 34px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; color: var(--accent); }
.rec-wave i { width: 3px; border-radius: 2px; background: currentColor; flex: none; }

/* ---------- Menus ---------- */
.menu-wrap { position: fixed; inset: 0; z-index: 150; }
.menu { position: fixed; min-width: 220px; max-width: min(340px, 94vw); max-height: 86vh; overflow-y: auto; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; animation: menuIn .14s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes menuIn { from { opacity: 0; transform: scale(.94); } }
.menu.bare { padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; overflow: visible; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; }
.menu-item:hover { background: var(--surface-3); }
.menu-item .ic { color: var(--muted); }
.menu-item span { flex: 1; }
.menu-item small { color: var(--faint); font-size: 12px; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 8px; }
.react-row { display: flex; gap: 2px; padding: 4px; background: var(--surface); border-radius: 99px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); width: max-content; max-width: 94vw; }
.menu:not(.bare) .react-row { box-shadow: none; border: 0; background: none; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 5px; width: auto; justify-content: space-between; }
.react-row button { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; display: grid; place-items: center; transition: transform .12s, background .12s; }
.react-row button:hover { transform: scale(1.25); background: var(--surface-3); }
.react-row .more { color: var(--muted); background: var(--surface-3); }
.emoji-panel { width: min(352px, 94vw); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.emoji-tabs { display: flex; padding: 6px 6px 0; border-bottom: 1px solid var(--line); }
.emoji-tabs button { flex: 1; height: 36px; font-size: 18px; border-radius: 10px 10px 0 0; opacity: .55; border-bottom: 2.5px solid transparent; }
.emoji-tabs button.on { opacity: 1; border-bottom-color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; height: 264px; overflow-y: auto; align-content: start; }
.emoji-grid button { aspect-ratio: 1; font-size: 24px; border-radius: 10px; display: grid; place-items: center; }
.emoji-grid button:hover { background: var(--surface-3); }

/* ---------- Fenêtres ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(12, 10, 26, .5); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 18px; animation: fade .16s ease; }
.modal-wrap.out { opacity: 0; transition: opacity .16s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: min(88dvh, 780px); display: flex; flex-direction: column; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); animation: rise .22s cubic-bezier(.2, 1, .3, 1); overflow: hidden; }
.modal.small { width: min(430px, 100%); }
.modal.tall .modal-body { min-height: min(56dvh, 480px); }
.modal-head { display: flex; align-items: center; padding: 16px 12px 6px 22px; }
.modal-head h3 { flex: 1; font-size: 19px; letter-spacing: -.3px; }
.modal-body { padding: 12px 22px 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; flex-wrap: wrap; }
.confirm-text { color: var(--muted); font-size: 15px; white-space: pre-line; }
.modal:not(:has(.modal-head)) .modal-body { padding-top: 22px; }
.picker { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pick-list { margin: 0 -8px; }
.new-actions { margin: 0 -8px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.poll-edit { display: grid; gap: 8px; }
.group-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.group-head .input + .input { margin-top: 8px; }
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 46dvh; overflow-y: auto; }
.attach-grid.single { grid-template-columns: 1fr; }
.attach-item { border-radius: 14px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; display: grid; place-items: center; }
.attach-grid.single .attach-item { aspect-ratio: auto; max-height: 44dvh; }
.attach-item img, .attach-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-grid.single img, .attach-grid.single video { object-fit: contain; max-height: 44dvh; }
.attach-doc { display: grid; justify-items: center; gap: 6px; padding: 18px 10px; text-align: center; color: var(--muted); }
.attach-doc b { color: var(--text); font-size: 13px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.status-compose { border-radius: 20px; aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 20px; margin-bottom: 12px; }
.status-compose textarea { width: 100%; height: 100%; background: none; border: 0; outline: 0; resize: none; color: #fff; font-size: 24px; font-weight: 700; text-align: center; line-height: 1.3; }
.status-compose textarea::placeholder { color: rgba(255, 255, 255, .7); }
.sbg0 { background: linear-gradient(135deg, #8f7bff, #5a3df5); } .sbg1 { background: linear-gradient(135deg, #ff8a65, #e0348a); } .sbg2 { background: linear-gradient(135deg, #2cc08c, #0b84e0); } .sbg3 { background: linear-gradient(135deg, #f2a11c, #f0503c); }
.sbg4 { background: linear-gradient(135deg, #1f1c33, #4b3fa8); } .sbg5 { background: linear-gradient(135deg, #0f9aa8, #2cc08c); } .sbg6 { background: linear-gradient(135deg, #e0348a, #7b3fe4); } .sbg7 { background: linear-gradient(135deg, #38a7f5, #6c5cff); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; flex-direction: row; justify-content: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); transition: transform .12s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2.5px var(--text); }
.swatch.violet { background: #6c5cff; } .swatch.emerald { background: #0e9f6e; } .swatch.ocean { background: #0b84e0; } .swatch.coral { background: #f0503c; } .swatch.amber { background: #d97706; } .swatch.rose { background: #e0348a; }
.walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.wall { height: 68px; border-radius: 14px; background: var(--wall); border: 2px solid var(--line); display: flex; align-items: flex-end; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; }
.wall.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wall[data-wall="night"] { color: #fff; }

/* ---------- Tiroir, réglages ---------- */
.pad { padding: 14px; display: grid; gap: 12px; align-content: start; }
.hero { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 20px 18px; }
.hero h3 { font-size: 22px; letter-spacing: -.4px; margin-top: 8px; overflow-wrap: anywhere; }
.hero-av { position: relative; border-radius: 50%; }
.hero-av.small { flex: none; }
.hero-edit { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 3px solid var(--surface); }
.hero-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.qa { display: grid; justify-items: center; gap: 5px; min-width: 76px; padding: 10px 8px 8px; border-radius: 16px; background: var(--surface-2); color: var(--accent); font-size: 12.5px; font-weight: 600; transition: background .15s; }
.qa:hover { background: var(--accent-soft); }
.about { overflow-wrap: anywhere; white-space: pre-wrap; padding: 0 10px 6px; }
.card { margin: 0 12px 12px; padding: 6px; border-radius: 18px; background: var(--surface-2); }
.side > .side-scroll > .card { margin: 0 4px 12px; }
.card h4 { margin: 8px 10px 4px; }
.card .linkbtn { margin: 0 10px 6px; }
.card .row:hover { background: var(--surface-3); }
.invite { padding: 4px 10px; } .invite code { font-size: 12.5px; word-break: break-all; color: var(--muted); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 8px 8px; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.media-grid button { aspect-ratio: 1; border-radius: 10px; overflow: hidden; position: relative; background: var(--surface-3); }
.media-grid img, .media-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid .play { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; }
.profile-card { display: flex; align-items: center; gap: 14px; width: calc(100% - 8px); margin: 0 4px 12px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px solid var(--line); }
.profile-card > div:nth-child(2) { flex: 1; min-width: 0; }
.profile-card b { display: block; font-size: 18px; } .profile-card small { display: block; color: var(--accent); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card small.muted { color: var(--muted); }
.profile-card > .ic { color: var(--faint); }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; font-weight: 600; }
.set-col { padding: 9px 10px; display: grid; gap: 10px; font-weight: 600; }
.set-line .swatches { gap: 7px; }

/* ---------- Visionneuse ---------- */
.lightbox { position: fixed; inset: 0; z-index: 180; background: rgba(8, 7, 16, .94); display: grid; grid-template-rows: auto 1fr auto; animation: fade .18s ease; color: #fff; }
.lb-top { display: flex; align-items: center; gap: 4px; padding: calc(10px + var(--safe-t)) 12px 6px 20px; }
.lb-top .ibtn { color: #fff; } .lb-top .ibtn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.lb-count { font-size: 14px; opacity: .8; }
.lb-stage { min-height: 0; display: grid; place-items: center; padding: 0 12px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; animation: rise .25s ease; min-height: 0; }
.lb-stage { overflow: hidden; }
.lb-stage img, .lb-stage video { max-height: calc(100dvh - 150px); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; z-index: 2; }
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-cap { text-align: center; padding: 10px 20px calc(16px + var(--safe-b)); display: grid; gap: 2px; font-size: 14px; min-height: 52px; }
.lb-cap b { font-size: 12.5px; opacity: .7; font-weight: 500; }

/* ---------- Statuts ---------- */
.ring { padding: 3px; border-radius: 50%; background: conic-gradient(from 210deg, var(--accent-2), #ff7bb8, var(--accent), var(--accent-2)); flex: none; position: relative; }
.ring .avatar { border: 2.5px solid var(--surface); box-sizing: content-box; }
.ring.seen { background: var(--line); }
.ring.none { background: none; }
.ring-plus { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 2.5px solid var(--surface); }
.status-viewer { position: fixed; inset: 0; z-index: 170; background: rgba(8, 7, 16, .92); backdrop-filter: blur(12px); display: grid; place-items: center; animation: fade .18s ease; }
.sv-card { position: relative; width: min(440px, 100vw); height: min(780px, 100dvh); background: #000; border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; color: #fff; box-shadow: var(--shadow-lg); }
.sv-bars { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 4px; z-index: 4; }
.sv-bars i { flex: 1; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .32); overflow: hidden; }
.sv-bars b { display: block; height: 100%; width: 0; background: #fff; border-radius: 99px; }
.sv-bars i.done b { width: 100%; }
.sv-bars i.run b { animation: bar linear forwards; }
.status-viewer.paused .sv-bars i.run b { animation-play-state: paused; }
@keyframes bar { to { width: 100%; } }
.sv-head { position: absolute; top: calc(22px + var(--safe-t)); left: 10px; right: 6px; display: flex; align-items: center; gap: 10px; z-index: 4; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.sv-head b { display: block; font-size: 15px; } .sv-head small { opacity: .85; font-size: 12.5px; }
.sv-head .ibtn { color: #fff; } .sv-head .ibtn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.sv-stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
.sv-stage p { font-size: 28px; font-weight: 700; text-align: center; padding: 30px; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-stage img, .sv-stage video { width: 100%; height: 100%; object-fit: contain; }
.sv-cap { position: absolute; bottom: 14px; left: 14px; right: 14px; text-align: center; background: rgba(0, 0, 0, .5); padding: 8px 12px; border-radius: 12px; backdrop-filter: blur(6px); }
.sv-foot { position: relative; z-index: 4; padding: 10px 12px calc(12px + var(--safe-b)); display: grid; gap: 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.sv-foot .input { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; border-radius: 99px; }
.sv-foot .input::placeholder { color: rgba(255, 255, 255, .7); }
.sv-quick { display: flex; justify-content: center; gap: 6px; }
.sv-quick button { font-size: 26px; width: 44px; height: 44px; border-radius: 50%; transition: transform .12s; }
.sv-quick button:hover { transform: scale(1.25); }
.sv-views { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; font-weight: 600; color: #fff; }
.sv-tap { position: absolute; top: 90px; bottom: 120px; width: 32%; z-index: 3; }
.sv-tap.l { left: 0; } .sv-tap.r { right: 0; }

/* ---------- Appels ---------- */
.call-screen { position: fixed; inset: 0; z-index: 190; background: #0c0b14; color: #fff; display: grid; place-items: center; overflow: hidden; animation: fade .2s ease; }
.call-bg { position: absolute; inset: -60px; display: grid; place-items: center; filter: blur(70px) saturate(1.3); opacity: .5; }
.call-bg .avatar { width: 80vmax !important; height: 80vmax !important; border-radius: 0; }
.call-screen video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.call-screen.has-video video.remote { display: block; }
.call-info { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding-bottom: 120px; }
.call-info .avatar { box-shadow: 0 0 0 8px rgba(255, 255, 255, .08), 0 0 0 20px rgba(255, 255, 255, .04); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, .08), 0 0 0 34px rgba(255, 255, 255, .03); } }
.call-info h2 { font-size: 28px; margin-top: 18px; letter-spacing: -.5px; }
.call-state { opacity: .8; font-size: 16px; font-variant-numeric: tabular-nums; }
.call-screen.has-video .call-info { position: absolute; top: calc(16px + var(--safe-t)); left: 20px; padding: 0; justify-items: start; text-align: left; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.call-screen.has-video .call-info .avatar { display: none; }
.call-screen.has-video .call-info h2 { font-size: 18px; margin: 0; }
.call-screen video.local { position: absolute; right: 18px; top: calc(18px + var(--safe-t)); width: min(26vw, 200px); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; background: #222; box-shadow: var(--shadow-lg); display: none; transform: scaleX(-1); z-index: 2; }
.call-screen.has-local video.local { display: block; }
.call-controls { position: absolute; bottom: calc(30px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; gap: 14px; padding: 12px 16px; border-radius: 99px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(20px); z-index: 3; }
.cc { width: 60px; height: 60px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; transition: transform .12s, background .15s; position: relative; }
.cc:hover { transform: scale(1.07); background: rgba(255, 255, 255, .26); }
.cc span { position: absolute; top: calc(100% + 16px); font-size: 11.5px; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.cc:hover span { opacity: .9; }
.cc.off { background: #fff; color: #17152b; }
.cc.on { background: var(--accent); }
.cc.red { background: #e5484d; } .cc.green { background: #1faa6b; animation: wiggle 1s ease-in-out infinite; }
.cc.red .ic { transform: rotate(0deg); }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-6deg); } }
.call-min { position: absolute; left: 16px; bottom: calc(40px + var(--safe-b)); width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; z-index: 3; }
.call-screen.mini { inset: auto 18px 18px auto; width: 300px; height: 200px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.call-screen.mini .call-info { padding: 0 0 60px; }
.call-screen.mini .call-info .avatar { width: 48px !important; height: 48px !important; font-size: 18px !important; animation: none; box-shadow: none; }
.call-screen.mini .call-info h2 { font-size: 15px; margin: 0; } .call-screen.mini .call-state { font-size: 13px; }
.call-screen.mini .call-controls { bottom: 10px; padding: 6px 8px; gap: 6px; }
.call-screen.mini .cc { width: 38px; height: 38px; } .call-screen.mini .cc .ic { width: 18px; height: 18px; }
.call-screen.mini .call-min { left: 8px; top: 8px; bottom: auto; width: 32px; height: 32px; }
.call-screen.mini video.local { display: none !important; }

.chat[data-wall="img"] .chat-body::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 30%, transparent); pointer-events: none; }
.chat[data-wall="img"] .day span, .chat[data-wall="img"] .msg.system span { background: rgba(0, 0, 0, .45); color: #fff; }
.wall[data-wall="img"] { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.wall.add { flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-style: dashed; color: var(--accent); background: var(--accent-soft); text-align: center; }

/* ---------- Discussions verrouillées ---------- */
.lock-banner { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13.5px; animation: slideDown .24s ease; }
.lock-banner span { flex: 1; }
.lock-banner .linkbtn { padding: 0; font-size: 13.5px; }

/* ---------- Chaînes ---------- */
.sub-row { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; margin-top: 8px; }
.sub-row .linkbtn { padding: 0; }
.empty-side.compact { padding: 18px 22px; }

/* ---------- Stickers ---------- */
/* Taille bornée au cadre : une image en hauteur (photo portrait) ne doit jamais dépasser sur le message suivant */
.sticker { display: grid; place-items: center; user-select: none; overflow: hidden; }
.sticker img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .18)); }
.sticker.s-emoji { line-height: 1; }
.sticker.s-emoji span { display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18)); transform-origin: 50% 85%; }
.bubble.sticker-only .sticker.sa0 span { animation: stBounce 1.1s var(--spring) 1; }
.bubble.sticker-only .sticker.sa1 span { animation: stWobble 1.2s ease-in-out 1; }
.bubble.sticker-only .sticker.sa2 span { animation: stPulse 1.2s ease-in-out 1; }
.bubble.sticker-only .sticker.sa3 span { animation: stTada 1.1s ease-in-out 1; }
.msg:hover .sticker.sa0 span { animation: stBounce 1.1s var(--spring) infinite; }
.msg:hover .sticker.sa1 span { animation: stWobble 1.2s ease-in-out infinite; }
.msg:hover .sticker.sa2 span { animation: stPulse 1.2s ease-in-out infinite; }
.msg:hover .sticker.sa3 span { animation: stTada 1.1s ease-in-out infinite; }
@keyframes stBounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16%) scale(.96, 1.06); } 55% { transform: translateY(0) scale(1.08, .92); } 75% { transform: translateY(-5%); } }
@keyframes stWobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes stPulse { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.16); } 50% { transform: scale(.96); } 75% { transform: scale(1.08); } }
@keyframes stTada { 0%, 100% { transform: scale(1) rotate(0); } 15% { transform: scale(.9) rotate(-6deg); } 35%, 65% { transform: scale(1.14) rotate(6deg); } 50%, 80% { transform: scale(1.14) rotate(-6deg); } }
.emoji-body { display: flex; flex-direction: column; height: 310px; }
.emoji-body .emoji-grid { flex: 1; height: auto; }
.emoji-modes { display: flex; gap: 4px; padding: 6px; border-top: 1px solid var(--line); background: var(--surface-2); }
.emoji-modes button { flex: 1; height: 32px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.emoji-modes button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; overflow-y: auto; flex: 1; align-content: start; }
.sticker-grid button { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; transition: transform .15s var(--spring), background .12s; }
.sticker-grid button:hover { background: var(--surface-3); transform: scale(1.08); }
.sticker-add { border: 2px dashed var(--line); color: var(--accent); gap: 0; align-content: center; }
.sticker-add small { font-size: 11px; font-weight: 600; }

/* ---------- Mouvement ---------- */
:root { --spring: cubic-bezier(.2, 1.25, .35, 1); --ease-out: cubic-bezier(.32, .72, 0, 1); }
body { touch-action: manipulation; }
.side.tab-in > *:not(.side-head) { animation: tabIn .32s var(--ease-out) both; }
@keyframes tabIn { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
.chat-list.stagger .chat-item { animation: itemIn .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes itemIn { from { opacity: 0; transform: translate3d(0, 14px, 0); } }
.chat-item, .row, .qa, .chip, .rail-btn { transition: background .15s, transform .18s var(--spring), color .15s; }
.chat-item:active, button.row:active, .qa:active { transform: scale(.975); }
.chip:active, .rail-btn:active, .ibtn:active { transform: scale(.92); }
.ibtn { transition: background .15s, color .15s, transform .18s var(--spring); }
.msg.pop { animation: msgIn .34s var(--spring) both; transform-origin: bottom left; }
.msg.out.pop { transform-origin: bottom right; }
@keyframes msgIn { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.9); } }
.msg { touch-action: pan-y; }
.msg .col { will-change: auto; }
.swipe-hint { position: absolute; left: 6px; top: 50%; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); color: var(--accent); display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; transform: translateY(-50%) scale(.5); pointer-events: none; }
.send .ic { animation: pop .22s var(--spring); }
.fab, .reaction { animation-timing-function: var(--spring); }
.menu { animation: menuIn .2s var(--spring); }
.modal { animation: rise .3s var(--spring); }
.badge, .rail-badge { animation: pop .3s var(--spring); }
.ctx, .pinned-bar { animation: slideDown .24s var(--ease-out); }
@keyframes slideDown { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
.lightbox .lb-stage img, .lightbox .lb-stage video { animation: zoomIn .3s var(--ease-out); }
@keyframes zoomIn { from { opacity: 0; transform: scale(.92); } }
.status-viewer .sv-card { animation: zoomIn .3s var(--ease-out); }
.call-screen .call-controls { animation: slideUp .4s var(--spring) both .1s; }
@keyframes slideUp { from { opacity: 0; transform: translate3d(-50%, 30px, 0); } }

/* Applications natives : comportement d'application, pas de page web */
html.native, html.native body { overscroll-behavior: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
html.native .bubble .text, html.native input, html.native textarea, html.native .about, html.native code { -webkit-user-select: text; user-select: text; }

/* ---------- Mobile ---------- */
@media (max-width: 1180px) {
  .app.drawer-open { grid-template-columns: 76px minmax(300px, 390px) minmax(0, 1fr); }
  .drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(400px, 100vw); z-index: 60; box-shadow: var(--shadow-lg); }
}
@media (max-width: 820px) {
  .app, .app.drawer-open { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { grid-row: 1; border-right: 0; }
  .rail { grid-row: 2; flex-direction: row; padding: 4px 6px calc(4px + var(--safe-b)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .rail-logo, .rail-foot { display: none; }
  .rail-tabs { flex-direction: row; margin: 0; justify-content: space-around; width: 100%; }
  .rail-btn { width: auto; flex: 1; max-width: 90px; padding: 7px 0 5px; }
  .rail-badge { right: auto; left: calc(50% + 4px); top: 1px; }
  .rail-dot { right: calc(50% - 18px); }
  .main { position: fixed; inset: 0; z-index: 40; background: var(--bg); transform: translate3d(100%, 0, 0); transition: transform .34s var(--ease-out), visibility 0s .34s; visibility: hidden; will-change: transform; box-shadow: -12px 0 40px rgba(0, 0, 0, .18); }
  .app.chat-open .main { transform: none; visibility: visible; transition: transform .34s var(--ease-out); }
  .main.dragging { transition: none !important; visibility: visible; }
  /* La liste recule légèrement sous la conversation (effet de profondeur) */
  .side { transition: transform .34s var(--ease-out), opacity .34s; will-change: transform; }
  .app.chat-open .side { transform: translate3d(-22%, 0, 0); opacity: .55; }
  .side.dragging { transition: none !important; }
  .rail { transition: transform .34s var(--ease-out); }
  .app.chat-open .rail { transform: translate3d(0, 110%, 0); }
  .input, .input-msg, .search input { font-size: 16px; }
  .modal, .modal.small { animation: sheet .36s var(--spring); }
  .drawer { width: 100vw; }
  .only-mobile { display: inline-grid; }
  .input.code { font-size: 26px; letter-spacing: 8px; padding-left: 18px; }
  .hide-mobile { display: none; }
  .side-head { padding-top: calc(14px + var(--safe-t)); }
  .chat-head { height: calc(58px + var(--safe-t)); padding: var(--safe-t) 4px 0 4px; }
  .ch-id { gap: 10px; margin-left: 0; padding: 4px; }
  .msg .col { max-width: 84%; }
  .msg-tools { display: none; }
  .msg-list { padding: 10px 8px 8px; }
  .composer { padding: 6px 8px calc(8px + var(--safe-b)); }
  .fab-new { display: grid; place-items: center; position: absolute; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 20px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent); z-index: 5; }
  .modal-wrap { padding: 0; place-items: end center; }
  .modal, .modal.small { width: 100%; border-radius: 26px 26px 0 0; max-height: 92dvh; padding-bottom: var(--safe-b); }
  @keyframes sheet { from { transform: translateY(40%); opacity: 0; } }
  .sv-card { border-radius: 0; width: 100vw; height: 100dvh; }
  .call-screen video.local { width: 30vw; }
  .cc { width: 56px; height: 56px; }
  .lb-nav { display: none; }
  .empty-main { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Aide à l’installation */
.install-help ol { margin: 4px 0 12px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.45; }
.install-help p { font-size: 13.5px; line-height: 1.45; margin: 0; }

/* Confidentialité, paiement, sponsorisation */
.privacy .set-col { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.privacy .set-col:last-child { border-bottom: 0; }
.privacy .set-col > span { font-weight: 600; }
.privacy .seg { flex-wrap: wrap; }
.row-actions { display: flex; align-items: center; gap: 4px; }
.pay-form { display: grid; gap: 10px; }
.pay-form .plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-form .plan { display: grid; gap: 3px; padding: 12px 6px; border-radius: 14px; border: 2px solid var(--line); text-align: center; }
.pay-form .plan span { font-size: 12.5px; color: var(--muted); }
.pay-form .plan.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-mm { display: grid; gap: 10px; }
.pay-saved { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); text-align: left; }
.pay-saved span { color: var(--muted); font-size: 13.5px; } .pay-saved.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-form label.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pay-amount { font-size: 22px; font-weight: 800; height: 56px; }
.money-big { font-size: 30px; font-weight: 800; color: var(--accent); text-align: center; padding: 14px; border-radius: 18px; background: var(--accent-soft); }
.money-card { display: grid; gap: 7px; min-width: 232px; padding: 3px 2px; }
.money-head { display: flex; align-items: center; gap: 12px; } .money-head small { display: block; font-size: 12.5px; opacity: .78; } .money-head b { font-size: 20px; }
.money-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok, #22c55e) 18%, transparent); color: var(--ok, #22c55e); }
.msg.out .money-ic { background: rgba(255, 255, 255, .22); color: #fff; } .money-state { font-size: 12.5px; opacity: .8; }
.pay-form .ops { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-form .op { padding: 9px 14px; border-radius: 12px; border: 2px solid var(--line); font-weight: 600; font-size: 14px; }
.pay-form .op.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn.wide { width: 100%; justify-content: center; margin-top: 6px; }
.pay-wait { display: grid; gap: 10px; padding: 10px 0; }
.sp-item { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.sp-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sp-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-stats { display: flex; gap: 18px; font-size: 14px; margin-top: 4px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.tag.active, .tag.sponsored { background: var(--accent-soft); color: var(--accent); }
.sv-head .tag { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---- Be AI ---- */
.ai-btn { color: var(--accent); }
.ai-chips { display: flex; align-items: center; gap: 8px; padding: 8px 12px 2px; overflow-x: auto; scrollbar-width: none; }
.ai-chips[hidden] { display: none; }
.ai-chip { flex: none; max-width: 280px; padding: 7px 13px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chip:hover { filter: brightness(.95); }
.spin.small { width: 16px; height: 16px; border-width: 2px; flex: none; }
.ai-out { min-height: 90px; }
.ai-wait { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 22px 0; }
.ai-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; max-height: 52vh; overflow-y: auto; padding: 12px 14px; border-radius: 14px; background: var(--surface-3); }
.ai-text pre { white-space: pre-wrap; font-size: 13px; margin: 6px 0; }
.ai-err { color: var(--danger); padding: 14px 0; }
.ai-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-top: 10px; }
.ai-lang { margin-bottom: 10px; height: 38px; }

.sv-reply { display: flex; align-items: center; gap: 8px; }
.sv-reply .input { flex: 1; min-width: 0; }
.sv-send { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.sv-send:active { transform: scale(.94); }

/* Signalement */
.report .report-reasons { margin: 10px -8px; }
.report .report-reasons .row { padding: 9px 8px; gap: 12px; }
.report .report-reasons .row b { font-weight: 500; }
.report-block { display: flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; }
.report-block input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Boutique : produits */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.pr-grid > p, .pr-grid > .loading { grid-column: 1 / -1; }
.pr-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; }
.pr-row .pr-card { flex: 0 0 148px; }
.pr-card { display: flex; flex-direction: column; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pr-card:hover { border-color: var(--accent); }
.pr-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-3); }
.pr-img.none, .pr-photo.none, .pr-mini.none { display: grid; place-items: center; color: var(--faint); }
.pr-info { padding: 9px 11px 11px; display: grid; gap: 2px; min-width: 0; }
.pr-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-price { color: var(--accent); font-weight: 700; font-size: 13.5px; }
.pr-price.big { font-size: 22px; }
.pr-stage { position: relative; margin: -4px -4px 12px; }
.pr-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; display: block; background: var(--surface-3); }
.pr-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.pr-dots button { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.pr-dots button.on { background: #fff; }
.pr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; }
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.pr-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.pr-seller { margin: 12px -8px 0; width: calc(100% + 16px); }
.linkbtn.danger { color: var(--danger); margin-top: 10px; }
.pr-form { display: grid; gap: 10px; }
.pr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-pick { position: relative; width: 74px; height: 74px; }
.pr-pick.wide, .pr-add.wide { width: 100%; height: 150px; }
.pr-mini { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; background: var(--surface-3); }
.pr-pick button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--surface); display: grid; place-items: center; }
.pr-add { width: 74px; height: 74px; border-radius: 12px; border: 2px dashed var(--line); color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; }
.pr-add:hover { border-color: var(--accent); color: var(--accent); }

/* Publications sponsorisées */
.ad-card { margin: 4px 16px 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.ad-img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.ad-body { padding: 12px 14px; display: grid; gap: 6px; }
.ad-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.ad-by { display: flex; align-items: center; gap: 8px; }
.ad-by small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ad-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* Résultats détaillés d'une sponsorisation */
.sp-item.click { width: 100%; text-align: left; cursor: pointer; }
.sp-item.click:hover b { color: var(--accent); }
.sp-more { margin-left: auto; color: var(--accent); font-weight: 600; }
.sd { display: grid; gap: 8px; }
.sd-progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sd-progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.sd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.sd-kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.sd-kpi small { color: var(--muted); font-size: 12.5px; }
.sd-kpi b { font-size: 21px; }
.sd-kpi span { color: var(--muted); font-size: 12px; }
.sd-chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; overflow-x: auto; padding-bottom: 2px; }
.sd-col { flex: 1 0 22px; display: grid; grid-template-rows: 16px 1fr 16px; justify-items: center; height: 100%; }
.sd-col em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.sd-col small { font-size: 10px; color: var(--faint); }
.sd-bar { position: relative; width: 70%; max-width: 26px; height: 100%; display: flex; align-items: flex-end; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.sd-bar i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 0; }
.sd-bar u { position: absolute; left: 0; right: 0; bottom: 0; background: #2cc08c; opacity: .9; }
.sd-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.sd-key.v { background: var(--accent); } .sd-key.c { background: #2cc08c; }

/* Badges de compte : certifié, Business */
.acct { display: inline-flex; width: 1.2em; height: 1.2em; min-width: 16px; min-height: 16px; margin-left: 4px; vertical-align: -0.22em; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.acct svg { width: 100%; height: 100%; display: block; }

/* Réponse à un statut en cours d'envoi */
.sending .sv-quick, .sending .sv-reply { opacity: .45; pointer-events: none; }

/* Tontine */
.tontine-slot:empty { display: none; }
.tontine-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; text-align: left; background: var(--accent-soft); border-bottom: 1px solid var(--line); color: var(--text); }
.tontine-bar .grow { display: grid; min-width: 0; }
.tontine-bar b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tontine-bar small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; flex: none; }
.tag.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.tag.ok { background: color-mix(in srgb, var(--ok, #1faa6b) 16%, transparent); color: var(--ok, #1faa6b); }
.tontine { display: grid; gap: 12px; }
.t-hero { display: grid; gap: 2px; padding: 16px; border-radius: 18px; background: var(--accent-soft); }
.t-hero small, .t-hero span { color: var(--muted); font-size: 13.5px; }
.t-hero b { font-size: 26px; font-weight: 800; }
.t-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); }
.t-card .sub { margin: 0 0 2px; }
.t-card p { margin: 0; line-height: 1.45; }
.t-who, .t-row { display: flex; align-items: center; gap: 12px; }
.t-who .grow, .t-row .grow { display: grid; min-width: 0; }
.t-row { padding: 4px 0; }
.t-row b { font-size: 14.5px; font-weight: 600; }
.t-who small, .t-row small { color: var(--muted); font-size: 12.5px; }
.t-row small.ok, .t-state.ok { color: var(--ok, #1faa6b); }
.t-state { color: var(--faint, var(--muted)); display: grid; }
.t-count { font-size: 19px; font-weight: 800; color: var(--accent); }
.t-progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.t-progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.t-actions { display: flex; gap: 10px; margin-top: 6px; }
.t-actions .btn { flex: 1; }
.t-pay { display: grid; gap: 6px; }
.t-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 700; flex: none; }
.t-num.now { background: var(--accent); color: var(--accent-ink, #fff); }
.t-num.ok { background: color-mix(in srgb, var(--ok, #1faa6b) 16%, transparent); color: var(--ok, #1faa6b); }
.t-move { display: flex; }
.t-shares { min-width: 18px; text-align: center; align-self: center; }
.t-move .ibtn { font-size: 17px; font-weight: 700; }

/* Position : carte Google Maps (le clic ouvre Google Maps, la carte elle-même n'est pas manipulable dans le fil) */
.location .map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.react-list { display: grid; gap: 2px; }
.react-list .row { width: 100%; text-align: left; }
.react-emoji { font-size: 22px; }

.tontine-cta { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; text-align: left; background: var(--surface); border-top: 1px solid var(--line); color: var(--text); font-size: 13.5px; }
.tontine-cta .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tontine-cta b { padding: 7px 14px; border-radius: 99px; background: var(--accent); color: var(--accent-ink, #fff); font-size: 13px; flex: none; }
.tontine-cta svg { color: var(--accent); flex: none; }
.msg.system.click { cursor: pointer; }

/* Retouche d'une photo avant l'envoi */
.attach-item { position: relative; }
.attach-edit { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 99px; background: #000a; color: #fff; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(6px); }
.modal.editor { width: min(760px, 100vw - 16px); max-width: none; }
.ed { display: grid; gap: 10px; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 11px; background: var(--surface-3); color: var(--text); font-size: 13px; font-weight: 600; }
.ed-btn.on { background: var(--accent); color: var(--accent-ink, #fff); }
.ed-stage { display: grid; place-items: center; background: #0b0a12; border-radius: 14px; overflow: hidden; }
.ed-canvas { display: block; max-width: 100%; max-height: 58vh; touch-action: none; cursor: crosshair; }
.ed-colors { display: flex; justify-content: center; gap: 10px; min-height: 28px; }
.ed-color { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); }
.ed-color.on { outline: 3px solid var(--accent); outline-offset: 2px; }

.ed-emojis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-height: 46vh; overflow: auto; }
.ed-emojis button { aspect-ratio: 1; display: grid; place-items: center; font-size: 26px; border-radius: 10px; }
.ed-emojis button:hover { background: var(--surface-3); }
.ed-emojis img { width: 34px; height: 34px; object-fit: contain; }

/* Réponse à un statut : aperçu cliquable, flouté une fois le statut expiré */
.status-quote { display: flex; align-items: stretch; gap: 10px; width: 100%; min-width: 220px; margin: -2px -4px 6px; padding: 0 0 0 10px; border-radius: 10px; overflow: hidden; text-align: left; color: inherit; background: color-mix(in srgb, currentColor 10%, transparent); border-left: 3px solid var(--accent); }
.msg.out .status-quote { border-left-color: #fff; }
.status-quote .sq-text { flex: 1; min-width: 0; display: grid; align-content: center; gap: 2px; padding: 7px 0; }
.status-quote .sq-text b { font-size: 13px; }
.status-quote .sq-text small { font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-quote .sq-thumb { position: relative; flex: none; width: 54px; min-height: 54px; display: grid; place-items: center; overflow: hidden; background: #0003; }
.status-quote .sq-thumb img, .status-quote .sq-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.status-quote .sq-thumb i { font-style: normal; font-size: 8px; line-height: 1.2; color: #fff; padding: 4px; text-align: center; overflow: hidden; }
.status-quote .sq-thumb b { position: relative; width: 22px; height: 22px; border-radius: 50%; background: #0009; color: #fff; display: grid; place-items: center; }
.status-quote.gone { cursor: default; }
.status-quote.gone .sq-thumb > * { filter: blur(7px) saturate(.6); transform: scale(1.25); }
.status-quote.gone .sq-text b { opacity: .7; }

/* Album : plusieurs photos ou vidéos envoyées ensemble, en grille dans une seule bulle */
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: min(320px, 70vw); border-radius: 14px; overflow: hidden; }
.album-tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-3); display: block; }
.album.n3 .album-tile:first-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.album-tile img, .album-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.album-tile .play { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%; background: #0009; color: #fff; display: grid; place-items: center; }
.album-more { position: absolute; inset: 0; display: grid; place-items: center; background: #000a; color: #fff; font-size: 24px; font-weight: 700; }
.msg.album-part { display: none; }

/* Statuts : glissement de la carte quand on passe d'une personne à une autre */
.sv-card.slide-r { animation: sv-slide-r .28s cubic-bezier(.2, .8, .2, 1); }
.sv-card.slide-l { animation: sv-slide-l .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sv-slide-r { from { transform: translateX(46%) scale(.94); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes sv-slide-l { from { transform: translateX(-46%) scale(.94); opacity: .3; } to { transform: none; opacity: 1; } }

/* Envoi en arrière-plan : progression affichée sur la bulle (ou la vignette d'un album) */
.media, .album-tile { position: relative; }
.sending { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: #0007; color: #fff; }
.sending small { font-size: 12px; font-weight: 700; }
.sending .spin { width: 30px; height: 30px; border-color: #fff5; border-top-color: #fff; }
.sending.failed { cursor: pointer; }

/* Anneau de statut autour d'une photo de profil : coloré tant qu'il reste un statut à voir, gris ensuite */
.avatar.has-status { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--accent); cursor: pointer; }
.avatar.has-status.seen { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--line); }
.chat-item .avatar.has-status { margin: 0 3px; }

/* Statut en cours de publication : pastille flottante (pourcentage, puis Réessayer / Abandonner en cas d'échec) */
.status-upload { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 900; width: min(420px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 16px; background: var(--surface, #fff); color: var(--text, #111); border: 1px solid var(--line, #0001); box-shadow: 0 10px 34px #0003; font-size: 14px; }
.status-upload .su-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.status-upload .su-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-upload .su-bar { height: 5px; border-radius: 3px; background: var(--surface-3, #0001); overflow: hidden; }
.status-upload .su-bar i { display: block; height: 100%; width: 3%; border-radius: 3px; background: var(--accent, #5a3df5); transition: width .2s; }
.status-upload .su-actions { display: flex; gap: 6px; flex: none; }
.status-upload.failed { border-color: #e5484d66; flex-wrap: wrap; }
.status-upload.failed .su-main { flex-basis: 100%; }
.status-upload.failed .su-actions { margin-left: auto; }
.status-upload.failed .su-label { color: #e5484d; white-space: normal; }
.status-upload.failed .su-bar { display: none; }

/* Tontine : durée libre d'un tour (« tous les N jours ») */
.tontine-days { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 600; }
.tontine-days[hidden] { display: none; }
.tontine-days .input { width: 96px; text-align: center; }

/* ---------- Appel de groupe ---------- */
.call-screen.gcall { display: flex; flex-direction: column; align-items: stretch; padding: calc(14px + var(--safe-t)) 12px calc(118px + var(--safe-b)); gap: 10px; }
.gc-head { display: grid; gap: 2px; padding: 0 6px; }
.gc-head b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-head small { color: #ffffffb0; font-variant-numeric: tabular-nums; }
.gc-grid { flex: 1; min-height: 0; display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }
.gc-grid[data-n="1"] { grid-template-columns: 1fr; }
.gc-grid[data-n="2"] { grid-template-columns: 1fr; }
@media (min-width: 720px) { .gc-grid[data-n="2"] { grid-template-columns: repeat(2, 1fr); } .gc-grid:not([data-n="1"]):not([data-n="2"]):not([data-n="3"]):not([data-n="4"]) { grid-template-columns: repeat(3, 1fr); } .gc-grid[data-n="10"], .gc-grid[data-n="11"], .gc-grid[data-n="12"] { grid-template-columns: repeat(4, 1fr); } }
.gtile { position: relative; min-height: 0; border-radius: 18px; overflow: hidden; background: #1c1a2b; display: grid; place-items: center; outline: 2px solid transparent; transition: outline-color .15s; }
.gtile.speaking { outline-color: var(--accent-2, #8f7bff); }
.gtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.gtile.has-video video { display: block; }
.gtile.me.has-video video { transform: scaleX(-1); }
.gtile.has-video .gt-av { display: none; }
.gtile .gt-foot { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px #000a; }
.gtile .gt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtile .gt-mic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e5484d; flex: none; }
.gtile .gt-mic[hidden] { display: none; }
.call-screen.gcall.mini { padding: 8px; gap: 4px; }
.call-screen.gcall.mini .gc-head small, .call-screen.gcall.mini .call-controls { display: none; }
.call-screen.gcall.mini .gt-av .avatar { width: 40px !important; height: 40px !important; font-size: 15px !important; }
.gcall-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 14px; text-align: left; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-bottom: 1px solid var(--line); color: var(--text); }
.gcall-bar .gb-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; flex: none; }
.gcall-bar .gb-text { flex: 1; min-width: 0; display: grid; }
.gcall-bar .gb-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcall-bar .gb-go { flex: none; padding: 6px 14px; border-radius: 99px; background: var(--ok); color: #fff; font-weight: 700; font-size: 13.5px; }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

/* ---------- Sélection multiple dans la liste des discussions ---------- */
.sel-bar { display: flex; align-items: center; gap: 2px; width: 100%; padding: 4px 6px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); animation: fade .15s ease; }
.sel-bar b { flex: 1; min-width: 0; padding: 0 6px; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-bar .icon-btn, .sel-bar button { color: var(--accent); flex: none; }
.chat-item.selected { background: var(--accent-soft); }
.chat-item.selected .avatar { box-shadow: 0 0 0 2.5px var(--accent); }
.chat-item.selected::after { content: '✓'; position: absolute; left: 44px; top: 40px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }

/* Langue de l'application */
.lang-pick { width: auto; min-width: 150px; height: 40px; }
[dir="rtl"] .chat-item, [dir="rtl"] .row, [dir="rtl"] .set-line { text-align: right; }

/* Arabe (écriture de droite à gauche) : l'heure d'un message passe à gauche ; le texte d'un message suit sa propre langue */
[dir="rtl"] .meta { float: left; margin: 6px 12px -2px -3px; }
[dir="rtl"] .bubble .text { unicode-bidi: plaintext; text-align: start; }

/* Historique d'appels : un rang par personne, détail déroulé au clic */
.call-count { color: var(--muted); font-weight: 600; }
.call-detail { display: grid; gap: 2px; padding: 0 12px 8px 68px; }
.call-detail[hidden] { display: none; }
.call-line { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; color: var(--muted); font-size: 13px; text-align: start; }
.call-line:hover { background: var(--surface-2); }

/* Sponsorisation : emplacements à cocher, avec le supplément de chacun */
.places { display: grid; gap: 8px; margin-bottom: 6px; }
.place { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); text-align: left; transition: border-color .12s, background .12s; }
.place.on { border-color: var(--accent); background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, transparent)); }
.place-box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; }
.place.on .place-box { background: var(--accent); border-color: var(--accent); }
.place-main { flex: 1; min-width: 0; display: grid; }
.place-main small { color: var(--muted); font-size: 12px; }
.place-price { flex: none; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.place.on .place-price { color: var(--accent); }
.sp-thumb { flex: none; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); }
.sp-thumb img, .sp-thumb > * { width: 100%; height: 100%; object-fit: cover; }
.sp-row small { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sp-row small span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention.who { cursor: pointer; }
.badge.at { background: var(--accent-soft); color: var(--accent); }
.status-mention { display: flex; align-items: center; gap: 6px; font-size: 14px; opacity: .9; padding: 2px 0; }
/* Statut : personnes à citer */
.st-mentions { margin-top: 10px; }
.st-mentions summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 6px; }
.st-mentions summary::-webkit-details-marker { display: none; }
.st-mentions .pick-list { max-height: 190px; overflow-y: auto; margin-top: 6px; }
.st-mentions .row.on { background: var(--accent-soft); }
.sv-mention { align-self: center; margin: 0 auto 8px; padding: 5px 12px; border-radius: 99px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 13px; width: max-content; max-width: 90%; }
.modal-wrap:has(.overcall) { z-index: 200; } /* au-dessus de l'écran d'appel */
.bot-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bot-buttons .btn { flex: 1 1 auto; background: var(--surface); color: var(--accent); border: 1px solid var(--line); }
