/* 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; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 var(--font); color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#root { height: 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); }
.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; }
.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; }
.msg.pop { animation: msgIn .22s cubic-bezier(.2, 1, .3, 1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@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; }

/* ---------- 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: translateX(100%); transition: transform .26s cubic-bezier(.2, .9, .3, 1); visibility: hidden; }
  .app.chat-open .main { transform: none; visibility: visible; }
  .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); animation: sheet .26s cubic-bezier(.2, 1, .3, 1); }
  @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; } }
