/* OMBRA — thème monochrome (noir, gris, blanc), interface dense façon Discord × Telegram */
:root, [data-theme="dark"] {
  --bg0: #0a0a0a; --bg1: #111111; --bg2: #161616; --bg3: #1d1d1d; --bg4: #262626;
  --line: #2c2c2c; --mut: #8c8c8c; --txt: #e9e9e9; --hi: #ffffff; --inv: #0a0a0a;
  --hover: rgba(255, 255, 255, .055); --active: rgba(255, 255, 255, .1); --shadow: rgba(0, 0, 0, .55);
  --radius: 10px; --fs: 1;
  color-scheme: dark;
}
[data-theme="oled"] { --bg0: #000; --bg1: #050505; --bg2: #000; --bg3: #0e0e0e; --bg4: #181818; --line: #222; }
[data-theme="light"] {
  --bg0: #dcdcdc; --bg1: #ececec; --bg2: #fafafa; --bg3: #ffffff; --bg4: #e6e6e6;
  --line: #d0d0d0; --mut: #666; --txt: #1a1a1a; --hi: #000; --inv: #fff;
  --hover: rgba(0, 0, 0, .05); --active: rgba(0, 0, 0, .09); --shadow: rgba(0, 0, 0, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(15px * var(--fs)); }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--txt); }
body { font: 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--hi); }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.rot { transform: rotate(135deg); }
.muted { color: var(--mut); }
.center { text-align: center; }
.grow { flex: 1; }
.hint { color: var(--mut); font-size: .8rem; padding: 4px 10px 8px; margin: 0; }
kbd { font: .8rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg4); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }

/* ---------- Logo */
.logo { display: inline-block; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(90deg, var(--hi) 50%, var(--inv) 50%); box-shadow: inset 0 0 0 2px var(--hi); flex: none; }
.logo.small { width: 24px; height: 24px; }
.logo.big { width: 64px; height: 64px; }

/* ---------- Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 8px; background: var(--bg4); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--active); border-color: var(--mut); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--hi); color: var(--inv); border-color: var(--hi); }
.btn.primary:hover { filter: brightness(.88); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: transparent; border-color: var(--mut); color: var(--hi); }
.btn.danger:hover { background: var(--hi); color: var(--inv); }
.btn.small { min-height: 30px; padding: 0 12px; font-size: .8rem; }
.btn.wide { width: 100%; min-height: 44px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--inv) transparent var(--inv) transparent; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--txt) transparent var(--txt) transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--mut); transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--txt); }
.icon-btn.off { color: var(--hi); background: var(--active); }
.icon-btn.on { color: var(--inv); background: var(--hi); }
.icon-btn.danger:hover { background: var(--hi); color: var(--inv); }
.mini-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--mut); }
.mini-btn:hover { color: var(--txt); background: var(--hover); }
.mini-btn .ic { width: 15px; height: 15px; }
.link { color: var(--hi); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 2px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--hi); box-shadow: 0 0 0 3px var(--hover); }
textarea { resize: vertical; min-height: 70px; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.fl { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.field-hint { color: var(--mut); font-size: .75rem; }
.form-error { color: var(--hi); font-weight: 600; font-size: .85rem; margin: 6px 0; min-height: 0; }
.form-error:not(:empty)::before { content: "⚠ "; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 6px 0 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--hi); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-c { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Connexion (/login) */
.auth { position: relative; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; place-items: center; padding: 20px; overflow: auto; height: 100dvh;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg3), var(--bg0) 60%); }
.auth-orb { position: fixed; width: 720px; height: 720px; border-radius: 50%; left: 50%; top: 52%; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle at 35% 40%, rgba(255, 255, 255, .07), transparent 60%); box-shadow: inset -60px 0 120px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .035); animation: drift 18s ease-in-out infinite alternate; }
[data-theme="light"] .auth-orb { background: radial-gradient(circle at 35% 40%, rgba(0, 0, 0, .05), transparent 60%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .05); }
@keyframes drift { from { transform: translate(-52%, -50%) rotate(0); } to { transform: translate(-48%, -52%) rotate(25deg); } }
.auth-top { justify-self: start; position: relative; z-index: 1; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; color: var(--hi); text-decoration: none; font-weight: 800; letter-spacing: .22em; font-size: 1rem; padding: 6px 8px; border-radius: 10px; }
.brand-link:hover { background: var(--hover); }
.brand-link .logo { width: 28px; height: 28px; }
.auth-card { position: relative; z-index: 1; width: min(420px, 100%); background: color-mix(in srgb, var(--bg2) 92%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 32px 30px 26px; box-shadow: 0 30px 80px var(--shadow); text-align: center; backdrop-filter: blur(10px); animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
.auth-card h1 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 22px; color: var(--mut); }
.auth-card form { text-align: left; }
.auth-card label { display: grid; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 14px; }
.auth-card label input { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 1rem; color: var(--txt); }
.auth-card .field-hint { display: block; margin: -8px 0 14px; text-transform: none; letter-spacing: 0; }
.opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
.pw { position: relative; display: block; }
.pw input { padding-right: 84px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: .75rem; font-weight: 600; color: var(--mut); padding: 6px 8px; border-radius: 6px; text-transform: none; letter-spacing: 0; }
.pw-toggle:hover { color: var(--txt); background: var(--hover); }
.auth-switch { margin: 18px 0 0; color: var(--mut); font-size: .9rem; }
.badge-teaser { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: .8rem; color: var(--mut); }
.auth-foot { position: relative; z-index: 1; display: flex; gap: 10px; color: var(--mut); font-size: .75rem; padding-top: 16px; }
.auth-foot a { color: var(--mut); }
.auth-foot a:hover { color: var(--hi); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Coque applicative */
.app { display: grid; grid-template-columns: 72px 260px minmax(0, 1fr) 256px; height: 100dvh; }
.app.hide-members { grid-template-columns: 72px 260px minmax(0, 1fr) 0; }
.app.hide-members .members { display: none; }
.app.offline .chat-head::after { content: "Reconnexion au temps réel…"; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); background: var(--hi); color: var(--inv); font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 0 0 8px 8px; z-index: 5; }
.backdrop { display: none; }

/* Rail */
.rail { background: var(--bg0); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.rail-list { display: contents; }
.rail-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--bg3); display: grid; place-items: center; font-weight: 700; font-size: .95rem; color: var(--txt); transition: border-radius .22s cubic-bezier(.3, .7, .3, 1), background .2s, color .2s; flex: none; }
.rail-btn:hover, .rail-btn.active { border-radius: 16px; background: var(--hi); color: var(--inv); }
.rail-btn.has-icon { background: var(--bg3); }
.rail-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.rail-btn::before { content: ""; position: absolute; left: -12px; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--hi); transition: height .2s; }
.rail-btn.unread::before { height: 8px; }
.rail-btn:hover::before { height: 20px; }
.rail-btn.active::before { height: 40px; }
.rail-btn.home .logo { transition: transform .4s; }
.rail-btn.home:hover .logo, .rail-btn.home.active .logo { transform: rotate(180deg); box-shadow: inset 0 0 0 2px var(--inv); background: linear-gradient(90deg, var(--inv) 50%, var(--hi) 50%); }
.rail-btn.add { background: var(--bg2); border: 1px dashed var(--line); color: var(--hi); }
.rail-btn.add:hover { border-style: solid; }
.rail-btn.dm { background: transparent; overflow: visible; }
.rail-btn.dm .rail-av { width: 48px; height: 48px; }
.rail-btn .pill, .item .pill { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hi); color: var(--inv); font-size: .68rem; font-weight: 800; display: inline-grid; place-items: center; }
.rail-btn .pill { position: absolute; right: -3px; bottom: -3px; box-shadow: 0 0 0 3px var(--bg0); }
.voice-dot { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--hi); color: var(--inv); box-shadow: 0 0 0 3px var(--bg0); }
.voice-dot .ic { width: 12px; height: 12px; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--line); flex: none; }

/* Barre latérale */
.sidebar { background: var(--bg1); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--bg0); }
.side-head { position: relative; min-height: 52px; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--bg0); box-shadow: 0 1px 0 var(--line); flex: none; }
.side-head.has-banner { min-height: 120px; align-items: flex-end; padding: 0; overflow: hidden; }
.side-banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side-head.has-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, .75)); pointer-events: none; }
.server-name { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; gap: 6px; padding: 14px 10px; font-weight: 700; text-align: left; border-radius: 6px; }
.server-name span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name:hover { background: var(--hover); }
.has-banner .server-name { color: #fff; }
.search-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; background: var(--bg0); color: var(--mut); font-size: .82rem; text-align: left; }
.search-btn:hover { color: var(--txt); }
.search-btn .ic { width: 16px; height: 16px; }
.side-list { flex: 1; overflow-y: auto; padding: 8px 8px 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-section { display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.side-section:first-child { padding-top: 8px; }
.item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--mut); text-align: left; transition: background .12s, color .12s; min-height: 34px; }
.item:hover { background: var(--hover); color: var(--txt); }
.item.active { background: var(--active); color: var(--hi); }
.item.unread { color: var(--hi); font-weight: 600; }
.item.unread::before { content: ""; position: absolute; }
.item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .two { flex: 1; min-width: 0; display: grid; }
.item .sub { color: var(--mut); font-size: .75rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.dm, .item.grp { min-height: 44px; }
.item .glyph { width: 18px; height: 18px; opacity: .8; }
.item.channel .label, .cat-name { filter: grayscale(1); }
.item .count { font-size: .7rem; color: var(--mut); background: var(--bg0); border-radius: 8px; padding: 1px 7px; }
.item.voice.live { color: var(--txt); }
.live-ic { color: var(--hi); }
.live-ic .ic { width: 15px; height: 15px; animation: pulse 1.6s ease-in-out infinite; }
.gav { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg4); color: var(--txt); font-weight: 700; font-size: .78rem; flex: none; }
.gav.secret { background: var(--hi); color: var(--inv); }
.gav .ic { width: 16px; height: 16px; }
.cat { margin-top: 14px; }
.cat-head { display: flex; align-items: center; padding-right: 4px; }
.cat-toggle { flex: 1; display: flex; align-items: center; gap: 2px; padding: 4px 2px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); text-align: left; min-width: 0; }
.cat-toggle:hover { color: var(--txt); }
.cat-toggle .ic { transition: transform .15s; width: 12px; height: 12px; }
.cat.closed .cat-toggle .ic { transform: rotate(-90deg); }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-users { list-style: none; margin: 2px 0 6px 28px; padding: 0; display: grid; gap: 2px; }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; color: var(--mut); font-size: .82rem; }
.voice-user:hover { background: var(--hover); color: var(--txt); }
.voice-user .vu-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--hi); }
.voice-user.speaking .vu-name { color: var(--hi); }
.live-pill { font-size: .6rem; font-weight: 800; letter-spacing: .06em; background: var(--hi); color: var(--inv); padding: 1px 6px; border-radius: 4px; }

/* Voix connectée + carte utilisateur */
.voice-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg1); animation: rise .25s ease; }
.vb-info { flex: 1; min-width: 0; display: grid; }
.vb-state { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--hi); }
.vb-state.connecting { color: var(--mut); }
.vb-state.connecting .ic { animation: pulse 1s infinite; }
.vb-where { font-size: .75rem; color: var(--mut); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-where:hover { color: var(--txt); text-decoration: underline; }
.vb-actions { display: flex; gap: 2px; }
.vb-actions .icon-btn { width: 30px; height: 30px; }
.me { display: flex; align-items: center; gap: 2px; padding: 8px; background: var(--bg0); flex: none; }
.me-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 8px; text-align: left; }
.me-id:hover { background: var(--hover); }
.who { min-width: 0; display: grid; line-height: 1.2; }
.who strong { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font-size: .72rem; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .icon-btn { width: 32px; height: 32px; }
.me .icon-btn .ic { width: 18px; height: 18px; }

/* Avatars */
.avatar { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: .85rem; flex: none; user-select: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.xs { width: 22px; height: 22px; font-size: .55rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.3rem; }
.avatar.xl { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar.xxl { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg1); background: var(--bg4); border: 2px solid var(--mut); box-sizing: border-box; }
.avatar[data-status="online"]::after { background: var(--hi); border-color: var(--hi); }
.avatar[data-status="idle"]::after { background: linear-gradient(135deg, var(--hi) 50%, transparent 50%); border-color: var(--hi); }
.avatar[data-status="dnd"]::after { background: radial-gradient(circle, var(--bg1) 0 30%, var(--hi) 32%); border-color: var(--hi); }
.avatar.nodot::after, .avatar.xs::after { display: none; }
.avatar.ring { box-shadow: 0 0 0 6px var(--bg2); }
.tone-0 { background: #f2f2f2; color: #111; } .tone-1 { background: #bdbdbd; color: #111; } .tone-2 { background: #7a7a7a; color: #fff; }
.tone-3 { background: #3d3d3d; color: #fff; } .tone-4 { background: #1c1c1c; color: #fff; box-shadow: inset 0 0 0 1px #3a3a3a; }

/* Badges rares */
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badges.full { justify-content: center; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; min-width: 24px; padding: 0 6px; border-radius: 7px; background: var(--bg4); border: 1px solid var(--line); font-size: .78rem; color: var(--txt); cursor: default; }
.badges.full .badge { height: 30px; padding: 0 10px; }
.badge .bl { font-size: .75rem; font-weight: 600; }
.badge.mini { height: 18px; min-width: 18px; padding: 0 4px; font-size: .65rem; margin-left: 4px; vertical-align: 2px; }
.badge.big { width: 54px; height: 54px; border-radius: 14px; justify-content: center; font-size: 1.5rem; }
.badge.r-legendary { background: var(--hi); color: var(--inv); border-color: var(--hi); position: relative; overflow: hidden; }
.badge.r-legendary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(128, 128, 128, .45) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite; }
.badge.r-mythic { background: linear-gradient(90deg, var(--hi) 50%, var(--inv) 50%); color: var(--mut); border-color: var(--hi); }
.badge.r-mythic .bl { color: var(--hi); mix-blend-mode: difference; }
.badge.r-rare { border: 1px solid var(--hi); color: var(--hi); box-shadow: inset 0 0 0 2px var(--bg4), inset 0 0 0 3px var(--mut); }
.badge.r-uncommon { border-color: var(--mut); }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* Conversation */
.chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg2); }
.chat.drop::after { content: "Dépose ton image ou ton GIF ici"; position: absolute; inset: 12px; border: 2px dashed var(--hi); border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--bg2) 85%, transparent); font-weight: 700; z-index: 10; }
.chat-head { position: relative; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--bg0); box-shadow: 0 1px 0 var(--line); flex: none; }
.conv-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.conv-icon { display: inline-grid; place-items: center; color: var(--mut); }
.conv-title h2 { margin: 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-title .meta { color: var(--mut); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; border-left: 1px solid var(--line); }
.head-actions { display: flex; gap: 2px; }
.mobile-only { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 24px; color: var(--mut); max-width: 560px; margin: auto; }
.empty h3 { margin: 4px 0 0; color: var(--txt); font-size: 1.3rem; }
.empty p { margin: 0; }
.empty.start { justify-items: start; text-align: left; margin: 0; padding: 24px 18px 18px; max-width: none; }
.empty.start .row-c { justify-content: flex-start; margin-top: 8px; }
.handle { color: var(--mut); margin: 0; }
.big-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--bg4); display: grid; place-items: center; color: var(--hi); }
.big-ic .ic { width: 30px; height: 30px; }
.home-empty { padding-top: 8vh; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 14px; }
.quick-card { display: grid; justify-items: start; gap: 4px; text-align: left; padding: 14px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--line); color: var(--txt); transition: transform .15s, border-color .15s; }
.quick-card:hover { transform: translateY(-2px); border-color: var(--mut); }
.quick-card small { color: var(--mut); }
.loading-state { min-height: 160px; align-content: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--hi); animation: spin .8s linear infinite; }
.day-sep { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; color: var(--mut); font-size: .72rem; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.msg { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: 6px 16px 4px 8px; margin-top: 10px; }
.msg.grouped { margin-top: 0; padding-top: 1px; padding-bottom: 1px; }
.msg:hover { background: var(--hover); }
.msg.mentioned { background: color-mix(in srgb, var(--hi) 7%, transparent); box-shadow: inset 2px 0 0 var(--hi); }
.msg.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: var(--active); } }
.msg .avatar-btn { justify-self: center; align-self: start; border-radius: 50%; margin-top: 2px; }
.msg .avatar-btn:hover .avatar { filter: brightness(1.1); }
.msg .avatar-btn .avatar::after { box-shadow: 0 0 0 3px var(--bg2); }
.side-time { justify-self: center; font-size: .65rem; color: var(--mut); opacity: 0; padding-top: 4px; }
.msg:hover .side-time { opacity: 1; }
.msg-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.author { font-weight: 700; color: var(--hi); }
.author:hover { text-decoration: underline; }
.msg-head time { font-size: .72rem; color: var(--mut); }
.content { margin: 0; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.mention { background: var(--active); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { background: var(--hi); color: var(--inv); }
.spoiler { background: var(--bg4); color: transparent; border-radius: 4px; cursor: pointer; user-select: none; display: inline-block; padding: 0 4px; transition: color .25s, background .25s; }
.spoiler * { visibility: hidden; }
.spoiler.revealed { background: var(--active); color: inherit; user-select: auto; cursor: auto; }
.spoiler.revealed * { visibility: visible; }
.msg-meta { display: flex; gap: 8px; align-items: center; font-size: .7rem; color: var(--mut); margin-top: 2px; }
.ttl { display: inline-flex; gap: 3px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; }
.ttl .ic { width: 12px; height: 12px; }
.reply-ref { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--mut); margin: 0 0 2px -2px; max-width: 100%; text-align: left; }
.reply-ref strong { color: var(--txt); }
.reply-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-ref:hover { color: var(--txt); }
.attachment { position: relative; margin: 6px 0 2px; max-width: min(420px, 100%); }
.att-btn { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg0); }
.att-btn img { display: block; max-width: 100%; max-height: 340px; object-fit: contain; }
.gif-tag { position: absolute; left: 8px; top: 8px; font: 800 .62rem/1 system-ui; letter-spacing: .08em; background: rgba(0, 0, 0, .7); color: #fff; padding: 4px 6px; border-radius: 5px; pointer-events: none; }
.spoiler-img .att-btn img { filter: blur(28px) grayscale(1); transform: scale(1.1); }
.spoiler-img .att-btn::after { content: "IMAGE MASQUÉE — CLIQUER"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: #fff; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; transition: transform .1s, border-color .15s; }
.reaction:hover { border-color: var(--mut); }
.reaction:active { transform: scale(.92); }
.reaction.mine { border-color: var(--hi); background: var(--active); }
.reaction .emo { filter: grayscale(1); }
.msg-actions { position: absolute; right: 16px; top: -14px; display: flex; gap: 0; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 2px; opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: 0 4px 14px var(--shadow); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; pointer-events: auto; }
.msg-actions button { width: 30px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--mut); }
.msg-actions button:hover { background: var(--hover); color: var(--txt); }
.msg-actions .ic { width: 17px; height: 17px; }
.msg.enter { animation: msgIn .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.vanish { animation: vanish .45s ease forwards; }
@keyframes vanish { to { opacity: 0; filter: blur(6px); transform: scale(.98); } }
[data-density="compact"] .msg { grid-template-columns: 40px minmax(0, 1fr); margin-top: 2px; padding-top: 2px; padding-bottom: 2px; }
[data-density="compact"] .msg .avatar { width: 24px; height: 24px; font-size: .55rem; }
[data-density="compact"] .msg .avatar::after { display: none; }

.typing { height: 22px; padding: 0 18px; font-size: .75rem; color: var(--mut); display: flex; align-items: center; gap: 6px; flex: none; }
.typing:not(.on) { visibility: hidden; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--txt); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }

.composer { margin: 0 16px 16px; background: var(--bg3); border-radius: 12px; border: 1px solid var(--line); flex: none; transition: border-color .15s; }
.composer:focus-within { border-color: var(--mut); }
.composer.spoiler-on { border-style: dashed; border-color: var(--hi); }
.composer.sending { opacity: .8; }
.composer-row { display: flex; align-items: center; gap: 4px; padding: 6px; }
.composer-row input#msgInput { border: 0; background: transparent; box-shadow: none; padding: 8px 6px; }
.composer #spoilerBtn[aria-pressed="true"] { color: var(--inv); background: var(--hi); }
.send { min-height: 34px; }
.reply-bar, .attach-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--mut); }
.reply-bar strong { color: var(--txt); }
.att-chip { display: flex; align-items: center; gap: 10px; background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; max-width: 100%; }
.att-chip img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; color: var(--txt); }

/* Appel entrant */
.incoming { display: flex; align-items: center; gap: 12px; margin: 10px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--hi); color: var(--inv); animation: rise .3s ease; flex: none; flex-wrap: wrap; }
.incoming .two { display: grid; }
.incoming small { opacity: .7; }
.incoming .btn.primary { background: var(--inv); color: var(--hi); border-color: var(--inv); }
.incoming .btn.ghost { color: var(--inv); }
.incoming .avatar { animation: pulse 1.2s infinite; }

/* Panneau d'appel et scène vocale */
.call-panel { background: var(--bg0); border-bottom: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 12px; flex: none; }
.call-panel.stage { flex: 1; align-content: stretch; grid-template-rows: auto 1fr auto; min-height: 0; border: 0; }
.call-panel.mini .call-grid { grid-template-columns: repeat(auto-fill, 150px); }
.call-panel.mini .tile { min-height: 96px; }
.call-panel.mini .tile .avatar { width: 48px; height: 48px; font-size: .9rem; }
.call-top { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--mut); font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hi); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.call-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; min-height: 0; overflow: auto; align-content: center; }
.call-grid[data-count="1"] { grid-template-columns: minmax(0, 720px); justify-content: center; }
.call-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.call-grid.has-focus { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.call-grid > .empty { grid-column: 1 / -1; }
.tile { position: relative; min-height: 160px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--bg3); display: grid; place-items: center; cursor: pointer; transition: box-shadow .15s; animation: rise .3s ease; }
.tile.preview { opacity: .75; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.tile.screen video { object-fit: contain; }
.tile.has-video video { display: block; }
.tile.has-video .tile-avatar { display: none; }
.tile.me video { transform: scaleX(-1); }
.tile.me.screen video { transform: none; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--hi); }
.tile.speaking .avatar { box-shadow: 0 0 0 4px var(--bg3), 0 0 0 7px var(--hi); }
.tile .avatar { transition: box-shadow .12s; }
.tile.focused { grid-column: 1 / -1; grid-row: 1; aspect-ratio: auto; min-height: 50vh; }
.tile-label { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 7px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-flags { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; align-items: center; }
.tile-flags .flag { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; }
.call-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ctrl { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--bg4); color: var(--txt); border: 1px solid var(--line); transition: background .15s, transform .1s; }
.ctrl:hover { background: var(--active); }
.ctrl:active { transform: scale(.94); }
.ctrl[aria-pressed="true"]#camBtn, .ctrl[aria-pressed="true"]#screenBtn { background: var(--hi); color: var(--inv); }
.ctrl.off { background: var(--hi); color: var(--inv); }
.ctrl.danger { background: var(--hi); color: var(--inv); width: 64px; border-radius: 25px; }
.ctrl.danger:hover { filter: brightness(.85); }
.call-panel.mini .ctrl { width: 40px; height: 40px; }

/* Membres */
.members { background: var(--bg1); overflow-y: auto; padding: 8px; border-left: 1px solid var(--bg0); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.member { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; text-align: left; }
.member:hover { background: var(--hover); }
.member.offline { opacity: .45; }
.member.offline:hover { opacity: 1; }
.member .nm { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.member strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member small { color: var(--mut); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.speaking .avatar { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--hi); }
.crown { color: var(--hi); }
.members-empty h3 { font-size: 1rem; margin: 8px 8px 12px; }
.side-profile .pcard { border-radius: 12px; }

/* Carte de profil */
.pcard { background: var(--bg3); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.pcard-banner { height: 110px; background: var(--bg4); position: relative; }
.pcard.tone-0 .pcard-banner { background: #d9d9d9; } .pcard.tone-1 .pcard-banner { background: #a8a8a8; } .pcard.tone-2 .pcard-banner { background: #5e5e5e; }
.pcard.tone-3 .pcard-banner { background: #333; } .pcard.tone-4 .pcard-banner { background: #1a1a1a; }
.pcard-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 14px; margin-top: -44px; position: relative; }
.pcard-head .avatar { box-shadow: 0 0 0 6px var(--bg3); }
.pcard-head .avatar::after { box-shadow: 0 0 0 4px var(--bg3); }
.pcard-head .badges { background: var(--bg2); border-radius: 9px; padding: 4px; margin-bottom: 4px; }
.pcard-body { padding: 10px 16px 16px; }
.pcard-body h3 { margin: 4px 0 0; font-size: 1.25rem; }
.pcard-body h4 { margin: 12px 0 4px; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.pcard-body p { margin: 0; }
.cstatus { margin-top: 8px !important; font-size: .9rem; }
.pcard-sep { height: 1px; background: var(--line); margin: 12px 0 0; }
.bio { white-space: pre-wrap; font-size: .9rem; }
.since { font-size: .85rem; }

/* Modales */
dialog { background: var(--bg2); color: var(--txt); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); box-shadow: 0 30px 80px var(--shadow); }
dialog[open] { animation: pop .22s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(2px); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
#modalForm { display: flex; flex-direction: column; max-height: calc(100dvh - 42px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 6px; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-head p { margin: 4px 0 0; font-size: .85rem; }
.modal-body { padding: 10px 18px; overflow-y: auto; }
#modalForm > .form-error { padding: 0 18px; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 14px 18px; background: var(--bg1); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
dialog.profile { width: min(400px, calc(100vw - 24px)); }
dialog.profile .modal-head { display: none; }
dialog.profile .modal-body { padding: 0; }
dialog.profile .pcard { border: 0; border-radius: 16px 16px 0 0; }
dialog.lightbox { width: auto; max-width: calc(100vw - 24px); background: transparent; border: 0; box-shadow: none; }
dialog.lightbox .modal-head { color: #fff; }
.lightbox-img { display: block; max-width: 92vw; max-height: 78vh; border-radius: 10px; margin: auto; }
dialog.center .modal-head { justify-content: center; text-align: center; }
.welcome { display: grid; justify-items: center; gap: 10px; text-align: center; }
.welcome p { margin: 0; }
dialog.search { width: min(560px, calc(100vw - 24px)); }
.results { margin-top: 10px; display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.result { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; text-align: left; width: 100%; }
.result:hover, .result:focus-visible { background: var(--hover); }
.result .two { flex: 1; min-width: 0; display: grid; }
.result small { color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .go { display: inline-flex; gap: 4px; align-items: center; font-size: .75rem; color: var(--mut); }
.result:hover .go { color: var(--hi); }
.code-row { display: flex; gap: 10px; align-items: stretch; margin: 10px 0; }
.code { flex: 1; font: 700 1.3rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .24em; background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; user-select: all; }
.list { display: grid; gap: 6px; }
.disc { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--bg3); }
.disc .two { flex: 1; min-width: 0; display: grid; }
.disc-ic { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--bg4); font-weight: 700; flex: none; }
.disc-ic img { width: 100%; height: 100%; object-fit: cover; }
.icon-upload { width: 84px; height: 84px; border-radius: 50%; border: 2px dashed var(--mut); display: inline-grid; place-items: center; align-content: center; gap: 2px; color: var(--mut); margin: 4px auto 14px; overflow: hidden; }
.icon-upload:hover { color: var(--hi); border-color: var(--hi); }
.icon-upload img { width: 100%; height: 100%; object-fit: cover; }
.icon-upload small { font-size: .6rem; font-weight: 800; letter-spacing: .08em; }
.templates, fieldset.plain { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.templates legend, fieldset.plain legend { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 6px; padding: 0; }
.tpl, .type-opt, .rcard, .theme-opt { position: relative; display: block; }
.tpl input, .type-opt input, .rcard input, .theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card, .type-opt > span, .rcard > span { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; transition: border-color .15s, background .15s; }
.tpl-card small, .type-opt small, .rcard small { color: var(--mut); font-size: .78rem; filter: grayscale(1); }
.tpl input:checked + .tpl-card, .type-opt input:checked + span, .rcard input:checked + span { border-color: var(--hi); background: var(--active); box-shadow: inset 0 0 0 1px var(--hi); }
.tpl input:focus-visible + .tpl-card, .type-opt input:focus-visible + span, .rcard input:focus-visible + span, .theme-opt input:focus-visible + .theme-sw { outline: 2px solid var(--hi); outline-offset: 2px; }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-opt > span { justify-items: start; }
.radio-cards { display: grid; gap: 8px; margin-bottom: 14px; }

/* Menus et sélecteur de réactions */
.picker, .menu { position: fixed; z-index: 80; background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px var(--shadow); animation: pop .15s ease; }
.picker { display: flex; padding: 4px; gap: 2px; }
.picker button { width: 36px; height: 36px; border-radius: 8px; font-size: 1.2rem; filter: grayscale(1); transition: transform .1s, filter .1s; }
.picker button:hover, .picker button:focus-visible { background: var(--hover); transform: scale(1.15); filter: none; }
.menu { min-width: 220px; padding: 6px; display: grid; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: .88rem; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hi); color: var(--inv); }
.menu-item .ic { width: 16px; height: 16px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 24px)); }
.toast { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--hi); color: var(--inv); padding: 10px 14px; border-radius: 10px; font-size: .88rem; font-weight: 600; box-shadow: 0 10px 30px var(--shadow); animation: rise .25s ease; }
.toast.error { background: var(--bg3); color: var(--txt); border: 1px solid var(--hi); }
.toast .btn { background: var(--inv); color: var(--hi); border-color: var(--inv); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }

/* Paramètres plein écran (style Discord) */
.settings { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr); background: var(--bg2); animation: setIn .22s ease; }
@keyframes setIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
.set-nav { background: var(--bg1); display: flex; justify-content: flex-end; overflow-y: auto; }
.set-nav-inner { width: 230px; padding: 60px 8px 20px 20px; display: grid; align-content: start; gap: 2px; }
.set-title { font-weight: 800; padding: 0 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-group { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); padding: 14px 10px 6px; }
.set-tab { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 6px; color: var(--mut); text-align: left; font-size: .92rem; }
.set-tab:hover { background: var(--hover); color: var(--txt); }
.set-tab.active { background: var(--active); color: var(--hi); font-weight: 600; }
.set-tab.danger { color: var(--txt); }
.set-sep { height: 1px; background: var(--line); margin: 10px; }
.set-ver { color: var(--mut); font-size: .7rem; padding: 10px; margin: 0; }
.set-main { position: relative; overflow-y: auto; }
.set-content { max-width: 900px; padding: 60px 40px 80px; }
.set-content h2 { margin: 0 0 18px; font-size: 1.3rem; }
.set-content h3 { margin: 22px 0 8px; font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.set-close { position: fixed; top: 56px; right: max(24px, calc((100vw - 1400px) / 2)); display: grid; justify-items: center; gap: 4px; color: var(--mut); font-size: .65rem; font-weight: 700; }
.set-close .ic { width: 36px; height: 36px; padding: 7px; border-radius: 50%; border: 2px solid var(--mut); }
.set-close:hover { color: var(--hi); }
.set-close:hover .ic { border-color: var(--hi); }
.set-block { margin: 0 0 18px; }
.set-block h3 { margin-top: 0; }
.set-block p { margin: 0 0 8px; font-size: .85rem; }
.save-bar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; padding: 10px; background: var(--bg0); border-radius: 10px; margin-top: 10px; box-shadow: 0 8px 30px var(--shadow); }
.profile-edit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.preview-col { position: sticky; top: 20px; }
.preview-col .side-section { padding-top: 0; }
.count { justify-self: end; color: var(--mut); font-size: .72rem; }
.tones { display: flex; gap: 10px; }
.tones label { cursor: pointer; }
.tones input { position: absolute; opacity: 0; }
.swatch { display: block; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); }
.tones input:checked + .swatch { box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--hi); }
.tones input:focus-visible + .swatch { outline: 2px solid var(--hi); outline-offset: 4px; }
.acc-card { background: var(--bg1); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.acc-card .pcard { border: 0; border-radius: 0; }
.acc-card .pcard-body h4, .acc-card .pcard-body .bio, .acc-card .pcard-sep, .acc-card .since { display: none; }
.acc-fields { margin: 0 14px 14px; background: var(--bg2); border-radius: 10px; padding: 6px 14px; }
.acc-f { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.acc-f:last-child { border-bottom: 0; }
.acc-f small { grid-column: 1; font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: var(--mut); }
.acc-f span { grid-column: 1; }
.acc-f .btn, .acc-f select { grid-column: 2; grid-row: 1 / span 2; width: auto; }
.toggle-row { position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tr-text { flex: 1; display: grid; gap: 2px; }
.tr-text small { color: var(--mut); }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 42px; height: 24px; border-radius: 12px; background: var(--bg4); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--mut); transition: transform .2s, background .2s; }
.toggle-row input:checked + .switch { background: var(--hi); border-color: var(--hi); }
.toggle-row input:checked + .switch::after { transform: translateX(18px); background: var(--inv); }
.toggle-row input:focus-visible + .switch { outline: 2px solid var(--hi); outline-offset: 2px; }
.facts { padding-left: 18px; color: var(--mut); display: grid; gap: 6px; }
.badge-grid { display: grid; gap: 10px; }
.badge-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--line); opacity: .55; }
.badge-card.owned { opacity: 1; border-color: var(--mut); }
.badge-card p { margin: 2px 0 0; font-size: .82rem; color: var(--mut); }
.badge-card .rar { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.badge-card .own { font-size: .75rem; font-weight: 700; }
.meter { width: 220px; height: 10px; border-radius: 5px; background: var(--bg4); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--hi); transition: width .08s; }
.theme-row { display: flex; gap: 14px; flex-wrap: wrap; }
.theme-opt { display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.theme-sw { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line); }
.t-dark .theme-sw { background: #161616; } .t-oled .theme-sw { background: #000; } .t-light .theme-sw { background: #fafafa; }
.theme-opt input:checked + .theme-sw { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--hi); }
input[type=range] { width: 100%; accent-color: var(--hi); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; align-items: center; }
.keys dd { margin: 0; color: var(--mut); }
.chan-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chan-row input, .chan-row select { flex: 1 1 140px; width: auto !important; padding: 7px 9px !important; }
.chan-row > .ic { color: var(--mut); }
.cat-edit { margin-top: 18px; padding: 12px; border-radius: 12px; background: var(--bg1); }
.cat-edit-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cat-edit-head input { font-weight: 700; }
.srv-icon-prev { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--bg4); font-weight: 800; font-size: 1.4rem; flex: none; }
.srv-icon-prev img, .srv-banner-prev img { width: 100%; height: 100%; object-fit: cover; }
.srv-banner-prev { display: grid; place-items: center; height: 120px; border-radius: 12px; overflow: hidden; background: var(--bg4); color: var(--mut); margin-bottom: 10px; }

/* Pages de référence API */
.docs { display: grid; grid-template-columns: 300px 1fr; min-height: 100dvh; }
body:has(.docs) { overflow: auto; }
.docs nav { background: var(--bg1); padding: 20px 14px; display: grid; align-content: start; gap: 4px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.docs nav a { color: var(--mut); text-decoration: none; padding: 6px 10px; border-radius: 6px; font: .8rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.docs nav a:hover, .docs nav a.active { background: var(--active); color: var(--hi); }
.brand { display: flex; align-items: center; gap: 10px; }
.doc-brand { padding: 0 10px 12px; }
.docs main { padding: 40px; max-width: 860px; }
.docs h1 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font: 700 1.4rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.method { background: var(--hi); color: var(--inv); padding: 3px 10px; border-radius: 6px; font-size: .9rem; }
.tagline { color: var(--mut); font-size: 1.1rem; }
.docs pre { background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; font-size: .85rem; }
.doc-link { font-weight: 700; }
.noscript { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 5; margin: 0; background: var(--hi); color: var(--inv); padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: calc(100vw - 24px); text-align: center; }

/* ---------- Responsive */
@media (max-width: 1100px) {
  .app, .app.hide-members { grid-template-columns: 72px 248px minmax(0, 1fr); }
  .members { position: fixed; right: 0; top: 0; bottom: 0; width: min(290px, 86vw); z-index: 30; transform: translateX(100%); transition: transform .25s ease; box-shadow: -20px 0 50px var(--shadow); }
  .app.show-members .members { transform: none; display: block; }
  .app.show-members .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 25; }
  .profile-edit { grid-template-columns: 1fr; }
  .preview-col { position: static; }
}
@media (max-width: 900px) {
  .app, .app.hide-members { grid-template-columns: minmax(0, 1fr); }
  .rail, .sidebar { position: fixed; top: 0; bottom: 0; z-index: 30; transition: transform .25s ease; }
  .rail { left: 0; width: 72px; transform: translateX(-100%); }
  .sidebar { left: 72px; width: min(300px, calc(100vw - 72px)); transform: translateX(calc(-100% - 72px)); }
  .app.drawer-open .rail, .app.drawer-open .sidebar { transform: none; }
  .app.drawer-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 25; }
  .mobile-only { display: inline-grid; }
  .conv-title .meta { display: none; }
  .chat-head { padding: 0 6px; gap: 4px; }
  .head-actions .icon-btn { width: 32px; }
  .composer { margin: 0 8px 10px; }
  .composer-row .send { padding: 0 12px; }
  .msg { grid-template-columns: 48px minmax(0, 1fr); padding-right: 10px; }
  .msg-actions { right: 8px; }
  .quick { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .set-nav { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); }
  .set-nav-inner { width: auto; display: flex; padding: 10px 70px 10px 10px; gap: 4px; align-items: center; }
  .set-group, .set-ver, .set-sep, .set-title { display: none; }
  .set-tab { white-space: nowrap; }
  .set-content { padding: 20px 16px 80px; }
  .set-close { top: 8px; right: 8px; background: var(--bg1); border-radius: 50%; }
  .set-close small { display: none; }
  .set-close .ic { width: 34px; height: 34px; }
  .call-grid, .call-grid[data-count="2"] { grid-template-columns: 1fr; }
  .tile { min-height: 140px; }
  .types { grid-template-columns: 1fr; }
  .docs { grid-template-columns: 1fr; }
  .docs nav { position: static; height: auto; }
  .docs main { padding: 20px; }
  .auth-card { padding: 26px 20px 22px; }
  .auth-orb { width: 480px; height: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

/* Profile editor and monochrome achievement artwork. */
.badge-art{width:28px;height:28px;object-fit:contain;display:block}.badge.mini .badge-art{width:20px;height:20px}.badge.big .badge-art{width:58px;height:58px}.pbadge-glyph .badge-art{width:38px;height:38px}
.badge,.badge.big,.badge.mini,.pbadge-glyph{background:transparent!important;border-color:transparent!important;box-shadow:none!important;color:var(--text)!important}.badge .bg{display:flex;align-items:center;justify-content:center}.badge.full{gap:8px}
.profile-edit{gap:32px;align-items:start}.profile-edit .preview-col{position:sticky;top:24px}.profile-edit .set-block{border:1px solid var(--border,#333);border-radius:14px;padding:20px;margin-bottom:18px}.profile-edit .save-bar{position:sticky;bottom:0;z-index:2;padding:14px;background:var(--bg,#141414);border:1px solid var(--border,#333);border-radius:12px;display:flex;gap:10px;align-items:center}.profile-save-state{flex:1;font-size:12px;color:var(--muted,#aaa)}.profile-edit .field input,.profile-edit .field textarea{border-radius:9px}.profile-edit .preview-col .pcard{box-shadow:0 14px 40px #0003}.video-attachment video{display:block;max-width:100%;width:min(480px,100%);max-height:420px;border-radius:12px;background:#080808}.video-attachment figcaption{font-size:12px;color:var(--muted,#aaa);padding-top:6px}
@media(max-width:900px){.profile-edit{display:flex;flex-direction:column-reverse}.profile-edit .preview-col{position:static;width:100%}.profile-edit .save-bar{flex-wrap:wrap}.profile-save-state{flex-basis:100%}}

.audio-attachment{max-width:360px;width:100%;margin:8px 0}.audio-attachment audio{display:block;width:100%;min-width:0;height:44px}.audio-attachment figcaption{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--mut);margin-bottom:6px}.voice-message-recorder{display:flex;flex-direction:column;gap:18px;align-items:center;text-align:center}.voice-message-recorder audio{max-width:100%;width:320px}.voice-message-time{font-size:32px;font-variant-numeric:tabular-nums;letter-spacing:2px}

.call-dock{display:flex;align-items:center;gap:8px;flex:none;padding:7px 12px;background:var(--bg1);border-bottom:1px solid var(--line)}.dock-place{display:flex;flex-direction:column;align-items:flex-start;min-width:0;flex:1;text-align:left}.dock-place strong,.dock-place small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dock-place small{font-size:11px;color:var(--mut)}#activeCallsBtn{position:relative}#activeCallsBtn.has-activity::after{content:"";width:6px;height:6px;border-radius:50%;background:var(--hi);position:absolute;right:3px;top:3px}.group-add-row{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.group-add-row .field{flex:1;min-width:160px;margin:0}.group-member-list .disc{flex-wrap:wrap}.group-member-list .two{min-width:100px;flex:1}.call-dock .icon-btn{min-height:40px;min-width:40px}
@media(max-width:420px){.chat-head .icon-btn{width:34px;min-width:34px}.call-dock{padding:6px;gap:3px}.call-dock .icon-btn{min-width:38px;width:38px}.dock-place strong{font-size:12px}.head-actions #searchBtn{display:none}}

.gif-library{width:min(760px,calc(100vw - 20px))}.gif-library-content{display:grid;gap:14px}.gif-tabs{display:flex;gap:6px;flex-wrap:wrap}.gif-tabs button{padding:9px 12px;border-radius:8px;border:1px solid var(--line);min-height:40px}.gif-tabs [aria-selected=true]{background:var(--hi);color:var(--inv)}.gif-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.gif-card{min-width:0;display:flex;flex-direction:column;gap:6px;padding:6px;background:var(--bg1);border:1px solid var(--line);border-radius:10px}.gif-pick{width:100%;text-align:left}.gif-pick img{display:block;width:100%;height:110px;object-fit:contain;border-radius:6px;background:#0c0c0c}.gif-pick span{display:block;font-size:12px;padding:6px 2px;overflow-wrap:anywhere}.gif-card>small{font-size:11px;color:var(--mut)}.gif-create-preview img{display:block;max-width:100%;max-height:220px;margin:10px auto;border-radius:10px}.gif-library-button{font-size:11px;font-weight:800;letter-spacing:-.5px}.gif-library .modal-body{min-height:0}
@media(max-width:600px){.gif-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.gif-pick img{height:100px}.gif-tabs{gap:4px}.gif-tabs button{padding:8px;font-size:12px}.composer-row #gifLibraryBtn{width:32px;min-width:32px}.gif-library .modal-foot{padding:10px}.gif-library .modal-foot .btn{font-size:12px}}

.composer{position:relative}.composer-menu{position:absolute;bottom:calc(100% + 8px);left:0;width:245px;max-width:calc(100vw - 24px);max-height:min(330px,calc(var(--app-height,100dvh) - var(--safe-top,0px) - var(--safe-bottom,0px) - 130px));overflow-y:auto;z-index:50;padding:6px;background:var(--bg2);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 35px #0007}.composer-menu button{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:9px 12px;text-align:left;border-radius:8px}.composer-menu button:hover,.composer-menu button:focus-visible{background:var(--active)}.menu-gif-label{width:20px;font-size:10px;font-weight:800}.composer-plus[aria-expanded=true] .ic{transform:rotate(45deg)}.file-attachment{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid var(--line);padding:12px;border-radius:10px;text-decoration:none;max-width:100%;margin:8px 0;background:var(--bg1)}.file-attachment span{overflow-wrap:anywhere}.file-attachment small{font-size:11px;color:var(--mut)}
