/* ───────────── Gestion Studio · direction artistique ─────────────
   Fond très sombre, grands panneaux arrondis, accent lilas → violet, typographie Outfit. */

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0a0d;
  --panel: #141418;
  --panel-2: #1a1a20;
  --panel-3: #22222a;
  --panel-4: #2a2a33;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --text: #f3f3f6;
  --muted: #a3a3ad;
  --dim: #6d6d78;
  --accent: #d38ae6;
  --accent-2: #8f7cf7;
  --accent-soft: rgba(211, 138, 230, 0.14);
  --grad: linear-gradient(135deg, #8f7cf7 0%, #d38ae6 100%);
  --blurple: #5865f2;
  --green: #2fbf71;
  --red: #e5484d;
  --yellow: #f5c84c;
  --r-xl: 26px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(143, 124, 247, 0.08), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(211, 138, 230, 0.06), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: rgba(211, 138, 230, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────────── Démarrage ───────────── */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot-logo { width: 64px; height: 64px; border-radius: 20px; background: var(--grad); box-shadow: 0 10px 40px rgba(211, 138, 230, 0.35); animation: pulse 1.4s ease-in-out infinite; }
.boot-text { color: var(--muted); font-weight: 500; }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }

/* ───────────── Structure ───────────── */
.app { height: 100%; display: grid; grid-template-rows: 64px 1fr; gap: 14px; padding: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); min-height: 0; }
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr) 312px; gap: 14px; min-height: 0; }

/* Barre supérieure */
.topbar { display: flex; align-items: center; padding: 0 12px 0 14px; gap: 12px; border-radius: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand-logo { width: 36px; height: 36px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.brand-accent { color: var(--accent); }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.live-pill { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 13.5px; font-weight: 500; }
.live-pill b { color: var(--text); font-weight: 600; }
.eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; border-radius: 2px; background: var(--grad); animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; animation-delay: -0.2s; }
.eq i:nth-child(2) { height: 90%; animation-delay: -0.5s; }
.eq i:nth-child(3) { height: 60%; animation-delay: -0.1s; }
.eq i:nth-child(4) { height: 100%; animation-delay: -0.7s; }
.eq i:nth-child(5) { height: 50%; animation-delay: -0.3s; }
@keyframes eq { 50% { transform: scaleY(0.35); } }

.user-pill { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border-radius: 999px; background: var(--panel-2); font-weight: 600; font-size: 14px; }
.chip-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: 13.5px; transition: 0.15s; }
.chip-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); transition: 0.15s; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.mobile-only { display: none; }

/* Avatars */
.avatar { position: relative; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; text-transform: uppercase; overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .status { position: absolute; right: -2px; bottom: -2px; width: 34%; height: 34%; border-radius: 50%; border: 3px solid var(--panel); }
.status.online { background: var(--green); }
.status.idle { background: var(--yellow); }
.status.dnd { background: var(--red); }
.status.offline { background: #5c5c66; }

/* ───────────── Colonne de gauche : serveur & salons ───────────── */
.side-left { display: flex; flex-direction: column; overflow: hidden; }
.server-head { padding: 14px; border-bottom: 1px solid var(--line); }
.server-banner { height: 84px; border-radius: 16px; position: relative; overflow: hidden;
  background: radial-gradient(120px 80px at 85% 20%, rgba(255, 255, 255, 0.28), transparent 70%),
    radial-gradient(160px 90px at 10% 110%, rgba(0, 0, 0, 0.35), transparent 70%),
    radial-gradient(2px 2px at 20px 20px, rgba(255, 255, 255, 0.25) 50%, transparent 51%) 0 0 / 22px 22px,
    linear-gradient(120deg, #4b3bd6 0%, #8f4fd8 50%, #e07ac9 100%); }
.server-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(10, 10, 13, 0.75)); }
.server-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.server-icon { width: 40px; height: 40px; border-radius: 13px; background: var(--grad); display: grid; place-items: center; font-weight: 800; }
.server-name { font-weight: 700; font-size: 16px; }
.server-sub { color: var(--dim); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 0 10px; white-space: nowrap; }
.server-sub span::before { content: '●'; margin-right: 5px; font-size: 9px; vertical-align: 2px; }
.server-sub .on::before { color: var(--green); }

.channels { flex: 1; overflow-y: auto; padding: 8px 10px 14px; }
.cat { margin-top: 14px; }
.cat-title { display: flex; align-items: center; gap: 4px; padding: 4px 8px; color: var(--dim); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.channel { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 1px 0; border-radius: 10px; color: var(--muted); font-size: 14.5px; font-weight: 500; text-align: left; transition: background 0.12s, color 0.12s; position: relative; }
.channel:hover { background: var(--panel-2); color: var(--text); }
.channel.active { background: var(--panel-3); color: var(--text); }
.channel .ch-icon { color: var(--dim); flex: none; }
.channel .ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.channel.unread .ch-name { color: var(--text); font-weight: 600; }
.channel.unread::before { content: ''; position: absolute; left: -10px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }
.channel .lock { color: var(--dim); }
.channel.top { background: linear-gradient(90deg, var(--accent-soft), transparent); color: var(--text); }
.channel.top .ch-icon { color: var(--accent); }
.channel.new { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--accent-soft); } }
.voice-users { margin: 0 0 4px 28px; }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 3px 8px; font-size: 13.5px; color: var(--muted); border-radius: 8px; }
.voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--green); }

.me-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.12); }
.me-bar .who { flex: 1; min-width: 0; line-height: 1.2; }
.me-bar .who b { display: block; font-size: 14px; }
.me-bar .who span { color: var(--dim); font-size: 12px; }

/* ───────────── Chat ───────────── */
.chat { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 0 22px; height: 64px; border-bottom: 1px solid var(--line); flex: none; }
.chat-head .title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.chat-head .title .ch-icon { color: var(--dim); }
.chat-head .topic { color: var(--dim); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 1px solid var(--line-2); padding-left: 12px; flex: 1; }
.chat-head .flags { display: flex; gap: 6px; }
.flag { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.flag.warn { color: var(--yellow); }

.messages { flex: 1; overflow-y: auto; padding: 18px 0 8px; scroll-behavior: smooth; }
.welcome-head { padding: 18px 26px 22px; }
.welcome-head .big-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; color: var(--muted); margin-bottom: 12px; }
.welcome-head h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.welcome-head p { margin: 0; color: var(--muted); }

.msg { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; padding: 3px 26px 3px 22px; position: relative; }
.msg:hover { background: rgba(255, 255, 255, 0.018); }
.msg.first { margin-top: 14px; }
.msg .avatar-col { padding-top: 2px; }
.msg .time-hover { visibility: hidden; color: var(--dim); font-size: 10.5px; text-align: right; padding-top: 4px; }
.msg:hover .time-hover { visibility: visible; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.msg-author { font-weight: 600; font-size: 15px; cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.app-tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--blurple); color: #fff; vertical-align: 2px; letter-spacing: 0.02em; }
.msg-time { color: var(--dim); font-size: 12px; }
.msg-body { color: #e2e2e8; word-wrap: break-word; }
.msg.deleting { animation: del 0.45s ease forwards; }
@keyframes del { to { opacity: 0; transform: translateX(-10px); max-height: 0; padding: 0; margin: 0; } }
.msg.appear { animation: appear 0.35s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } }
.interaction-ref { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; margin: 0 0 2px; }
.interaction-ref .mini-avatar { width: 16px; height: 16px; font-size: 8px; }
.interaction-ref b { color: var(--muted); font-weight: 600; }
.interaction-ref .cmd { color: var(--accent); font-weight: 600; }
.ephemeral-note { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12.5px; margin-top: 6px; }
.ephemeral-note button { color: var(--accent); }
.ephemeral-note button:hover { text-decoration: underline; }
.msg.ephemeral { background: rgba(143, 124, 247, 0.04); }
.system-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 6px 0; }
.system-line .arrow { color: var(--green); }
.system-line .arrow.out { color: var(--red); }
.notice-auto { color: var(--muted); font-style: italic; }

/* Markdown */
.md h1, .md h2, .md h3 { margin: 4px 0 2px; line-height: 1.25; letter-spacing: -0.01em; }
.md h1 { font-size: 24px; }
.md h2 { font-size: 20px; }
.md h3 { font-size: 16.5px; }
.md .sub { display: block; color: var(--dim); font-size: 12.5px; }
.md code { background: var(--panel-4); padding: 1px 5px; border-radius: 5px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.md blockquote { margin: 2px 0; padding-left: 10px; border-left: 3px solid var(--panel-4); }
.md a { color: #7aa7ff; text-decoration: none; }
.md a:hover { text-decoration: underline; }
.mention { background: rgba(88, 101, 242, 0.25); color: #c9cdfb; padding: 0 3px; border-radius: 4px; font-weight: 500; cursor: pointer; }
.mention:hover { background: var(--blurple); color: #fff; }
.mention.role { background: color-mix(in srgb, var(--role) 22%, transparent); color: var(--role); }
.mention.channel { background: rgba(88, 101, 242, 0.18); }
.ts { background: var(--panel-3); padding: 0 4px; border-radius: 4px; }
.md .ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: #dbdee1; }
.md h2 .ic, .md h3 .ic { width: 1em; height: 1em; }

/* ───────────── Composants des messages du bot (Components V2) ───────────── */
.cv2 { margin-top: 4px; max-width: 640px; }
.container { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px 20px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.container::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent-bar, var(--blurple)); }
.c-sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.c-sep.large { margin: 10px 0; }
.c-section { display: flex; gap: 14px; align-items: center; }
.c-section > .md { flex: 1; min-width: 0; }
.c-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.c-gallery { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.c-gallery img { width: 100%; border-radius: 10px; display: block; }
.c-row { display: flex; flex-wrap: wrap; gap: 8px; }

.dbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 14px; transition: filter 0.12s, transform 0.08s, background 0.12s; white-space: nowrap; }
.dbtn:active { transform: translateY(1px); }
.dbtn:hover { filter: brightness(1.12); }
.dbtn .ic { width: 17px; height: 17px; }
.dbtn .emo { font-size: 16px; line-height: 1; }
.dbtn.primary { background: var(--blurple); color: #fff; }
.dbtn.secondary { background: var(--panel-4); color: #e8e8ee; }
.dbtn.success { background: #248046; color: #fff; }
.dbtn.danger { background: #c4302e; color: #fff; }
.dbtn.link { background: var(--panel-4); color: #e8e8ee; }
.dbtn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.dselect { position: relative; width: 100%; }
.dselect-btn { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line-2); color: var(--muted); text-align: left; }
.dselect-btn:hover { border-color: rgba(255, 255, 255, 0.2); }
.dselect-btn .val { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; color: var(--text); }
.dselect-btn .val.placeholder { color: var(--dim); }
.dselect-btn .chev { color: var(--dim); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: var(--panel-3); font-size: 13px; }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ───────────── Barre de saisie & commandes slash ───────────── */
.composer-wrap { position: relative; padding: 0 18px 14px; flex: none; }
.composer { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px 6px 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); transition: border-color 0.15s, box-shadow 0.15s; }
.composer:focus-within { border-color: rgba(211, 138, 230, 0.35); box-shadow: 0 0 0 4px rgba(211, 138, 230, 0.07); }
.composer input { flex: 1; min-width: 60px; background: none; border: 0; outline: 0; font-size: 15px; padding: 8px 0; }
.composer input::placeholder { color: var(--dim); }
.composer .plus { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-4); color: var(--muted); display: grid; place-items: center; flex: none; }
.composer .send { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; transition: 0.15s; }
.composer .send:disabled { background: var(--panel-4); color: var(--dim); }
.cmd-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; flex: none; }
.opt-chip { display: flex; align-items: center; border-radius: 8px; background: var(--panel-3); overflow: hidden; flex: none; border: 1px solid transparent; }
.opt-chip.focus { border-color: rgba(211, 138, 230, 0.5); }
.opt-chip.missing { border-color: rgba(229, 72, 77, 0.6); }
.opt-chip .k { padding: 4px 8px; color: var(--muted); font-size: 13px; background: var(--panel-4); }
.opt-chip input { width: 130px; padding: 4px 8px; font-size: 14px; background: none; border: 0; outline: 0; }
.opt-chip .v { padding: 4px 8px; font-size: 14px; }
.opt-fields { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; }
.composer-hint { color: var(--dim); font-size: 12.5px; padding: 6px 6px 0; min-height: 22px; }
.composer-hint b { color: var(--muted); }
.composer.locked { opacity: 0.6; }

.slash-menu { position: absolute; left: 18px; right: 18px; bottom: calc(100% - 6px); max-height: 380px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; z-index: 20; }
.slash-group { color: var(--dim); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 10px 4px; }
.slash-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; text-align: left; }
.slash-item .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-3); display: grid; place-items: center; color: var(--accent); flex: none; }
.slash-item b { display: block; font-weight: 600; }
.slash-item span { color: var(--dim); font-size: 13px; }
.slash-item .args { color: var(--dim); font-size: 12.5px; margin-left: auto; font-family: ui-monospace, Menlo, monospace; }
.slash-item.sel, .slash-item:hover { background: var(--panel-3); }
.pick-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; text-align: left; }
.pick-item.sel, .pick-item:hover { background: var(--panel-3); }
.pick-item small { color: var(--dim); margin-left: auto; }

/* ───────────── Colonne de droite ───────────── */
.side-right { display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 4px; margin: 12px; padding: 4px; background: var(--panel-2); border-radius: 14px; flex: none; }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13.5px; transition: 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-4); color: var(--text); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.right-body { flex: 1; overflow-y: auto; padding: 0 12px 14px; }
.group-title { color: var(--dim); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 14px 8px 6px; display: flex; gap: 6px; }
.member { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; text-align: left; transition: background 0.12s; }
.member:hover { background: var(--panel-2); }
.member .nm { flex: 1; min-width: 0; }
.member .nm b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .nm .app-tag { display: inline; font-size: 9.5px; }
.member .nm > span { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member.offline { opacity: 0.45; }
.member .badges { display: flex; gap: 4px; color: var(--dim); }
.member .badges .warn-n { font-size: 11px; font-weight: 700; color: var(--yellow); background: rgba(245, 200, 76, 0.12); padding: 1px 6px; border-radius: 6px; }
.member.flash { animation: flash 1.2s ease; }

.scenario { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; margin-bottom: 8px; transition: 0.15s; }
.scenario:hover { background: var(--panel-3); transform: translateY(-1px); }
.scenario .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.scenario b { display: block; font-weight: 600; font-size: 14.5px; }
.scenario span { color: var(--dim); font-size: 12.5px; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel-2); margin-bottom: 12px; }
.toggle-row .txt { flex: 1; }
.toggle-row b { display: block; font-size: 14px; }
.toggle-row span { color: var(--dim); font-size: 12.5px; }
.switch { width: 42px; height: 24px; border-radius: 12px; background: var(--panel-4); position: relative; transition: 0.2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: 0.2s; }
.switch.on { background: var(--grad); }
.switch.on::after { left: 21px; }

.feed-item { display: flex; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); animation: appear 0.35s ease; }
.feed-item .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); flex: none; color: var(--accent); }
.feed-item b { font-size: 13.5px; font-weight: 600; display: block; }
.feed-item span { color: var(--dim); font-size: 12px; }
.empty { color: var(--dim); text-align: center; padding: 30px 10px; font-size: 13.5px; }

/* ───────────── Fenêtres (modals, profil, menus) ───────────── */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#layer > * { pointer-events: auto; }
.backdrop { position: fixed; inset: 0; background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); animation: pop 0.18s ease; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 4px; }
.modal-head .app-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 12px 20px 6px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 11px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); outline: 0; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(211, 138, 230, 0.5); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.btn { height: 40px; padding: 0 18px; border-radius: 12px; font-weight: 600; background: var(--panel-3); }
.btn.primary { background: var(--grad); color: #fff; }
.btn:hover { filter: brightness(1.1); }

.popover { position: fixed; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; max-height: 320px; overflow-y: auto; min-width: 220px; animation: pop 0.12s ease; z-index: 60; }
.popover .opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 14px; }
.popover .opt:hover { background: var(--panel-3); }
.popover .opt.checked::after { content: '✓'; margin-left: auto; color: var(--accent); font-weight: 800; }
.popover .opt small { color: var(--dim); display: block; font-size: 12px; }

.profile { width: 320px; padding: 0; overflow: hidden; }
.profile .p-banner { height: 70px; }
.profile .p-body { padding: 0 16px 16px; }
.profile .p-avatar { margin-top: -34px; border: 6px solid var(--panel-2); border-radius: 50%; display: inline-block; }
.profile h4 { margin: 6px 0 0; font-size: 19px; }
.profile .p-sub { color: var(--dim); font-size: 13px; }
.profile .p-box { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 13px; }
.profile .p-box .lbl { color: var(--dim); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.profile .p-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.profile .p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.profile .p-actions .dbtn { justify-content: center; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: toast 0.25s ease; max-width: 360px; }
.toast .ico { color: var(--accent); }
@keyframes toast { from { transform: translateY(10px); opacity: 0; } }

/* ───────────── Écrans étroits (activité redimensionnée) ───────────── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .side-right { display: none; position: fixed; right: 14px; top: 92px; bottom: 14px; width: 320px; z-index: 30; box-shadow: var(--shadow); }
  .side-right.open { display: flex; }
  .mobile-only { display: grid; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-left { display: none; }
  .topbar-center { display: none; }
  .app { padding: 8px; gap: 8px; }
}

/* Version du Studio (remplie au déploiement) */
.brand-version { margin-left: 10px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.brand-version:empty { display: none; }

/* Introduction : vidéo de présentation avant de tester le Studio */
#intro { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 500px at 80% -10%, rgba(143, 124, 247, 0.28), transparent), radial-gradient(900px 400px at 0% 110%, rgba(211, 138, 230, 0.18), transparent), var(--bg); transition: opacity 0.5s ease; }
#intro.out { opacity: 0; pointer-events: none; }
.intro-wrap { width: min(1100px, 100%, calc((100vh - 190px) * 16 / 9)); display: grid; gap: 18px; }
.intro-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.intro-head h1 { margin: 0; font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.intro-head h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-head p { margin: 0; color: var(--muted); font-size: 14px; }
.intro-player { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line-2); background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); aspect-ratio: 16 / 9; }
.intro-player video { width: 100%; height: 100%; display: block; object-fit: cover; }
.intro-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 13, 0.45); border: 0; cursor: pointer; color: #fff; font: inherit; transition: background 0.2s; }
.intro-play:hover { background: rgba(10, 10, 13, 0.3); }
.intro-play[hidden] { display: none; }
.intro-play .disc { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: 0 10px 40px rgba(211, 138, 230, 0.45); }
.intro-play small { display: block; margin-top: 14px; font-size: 14px; color: var(--muted); }
.intro-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.intro-actions .hint { color: var(--dim); font-size: 13px; }
.intro-btn { border: 0; border-radius: 12px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; color: #fff; background: var(--panel-3); transition: transform 0.15s, background 0.2s; }
.intro-btn:hover { transform: translateY(-1px); background: var(--panel-4); }
.intro-btn.primary { background: var(--grad); box-shadow: 0 8px 24px rgba(211, 138, 230, 0.3); }

/* ───── Accueil du Studio : trois choix ───── */
#launcher { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; overflow: auto; opacity: 0; transition: opacity 0.35s ease; background: radial-gradient(1100px 480px at 85% -10%, rgba(57, 174, 239, 0.22), transparent), radial-gradient(900px 420px at 0% 110%, rgba(211, 138, 230, 0.2), transparent), rgba(8, 8, 12, 0.94); backdrop-filter: blur(6px); }
#launcher.in { opacity: 1; }
.launcher-wrap { width: min(1040px, 100%); display: grid; gap: 28px; }
.launcher-kicker { letter-spacing: 0.4em; font-size: 12px; font-weight: 700; color: #39aeef; }
.launcher-head h1 { margin: 8px 0 6px; font-size: clamp(26px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.02em; }
.launcher-head h1 span { background: linear-gradient(110deg, #39aeef, #8f7cf7 55%, #d38ae6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.launcher-head p { margin: 0; color: var(--muted); font-size: 16px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.choice { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; position: relative; overflow: hidden; }
.choice::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: 0.9; }
.choice:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.choice-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: color-mix(in srgb, var(--c) 30%, transparent); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); }
.choice-title { font-size: 21px; font-weight: 700; }
.choice-text { color: var(--muted); font-size: 14px; line-height: 1.5; }
.choice-go { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--c); }
.launcher-skip { all: unset; cursor: pointer; justify-self: center; color: var(--dim); font-size: 14px; }
.launcher-skip:hover { color: var(--text); }
@media (max-width: 860px) { .choices { grid-template-columns: 1fr; } }

/* ───── Tutoriel automatique ───── */
#tcursor { position: fixed; left: 0; top: 0; z-index: 99999; pointer-events: none; opacity: 0; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55)); }
.tripple { position: fixed; z-index: 99998; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 3px solid #39aeef; pointer-events: none; animation: trip 0.6s ease-out forwards; }
@keyframes trip { from { opacity: 0.9; transform: scale(0.3); } to { opacity: 0; transform: scale(1.5); } }
#tcap { position: fixed; left: 36px; top: 74px; z-index: 99990; max-width: min(520px, calc(100vw - 72px)); pointer-events: none; opacity: 0; transform: translateY(-16px); transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); padding: 6px 0 40px; }
#tcap::before { content: ''; position: absolute; inset: -40px -120px -20px -60px; z-index: -1; background: radial-gradient(ellipse 80% 90% at 20% 30%, rgba(4, 4, 8, 0.94), rgba(4, 4, 8, 0.7) 55%, transparent 80%); }
#tcap.show { opacity: 1; transform: none; }
#tcap .tk { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: 0.34em; font-weight: 700; color: #39aeef; }
#tcap .tk i { display: block; width: 36px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #39aeef, #8f7cf7); }
#tcap .tt { margin-top: 10px; font-size: clamp(26px, 3.4vw, 42px); line-height: 1.06; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); }
#tcap .tt b { background: linear-gradient(110deg, #39aeef, #8f7cf7 60%, #d38ae6); -webkit-background-clip: text; background-clip: text; color: transparent; }
#tcap .ts { margin-top: 10px; font-size: 16px; line-height: 1.45; color: #c3c7d4; max-width: 480px; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7); }
#tbar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 99991; display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 18px; border-radius: 999px; background: rgba(16, 16, 21, 0.9); border: 1px solid var(--line-2); backdrop-filter: blur(10px); font-size: 13px; color: var(--muted); }
.tskip { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 999px; background: var(--panel-3); color: var(--text); font-weight: 600; }
.tskip:hover { background: var(--panel-4); }

/* ───── Presets, sauvegardes, détail des modifications ───── */
#presets-ov, #detail-ov { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 16px; background: rgba(6, 6, 10, 0.78); backdrop-filter: blur(5px); opacity: 0; transition: opacity 0.3s; }
#presets-ov.in, #detail-ov { opacity: 1; }
.ov-wrap { width: min(860px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); padding: 22px; display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.ov-wrap.small { width: min(560px, 100%); }
.ov-head { display: flex; align-items: center; justify-content: space-between; }
.ov-head h2 { margin: 0; font-size: 20px; }
.ov-x { all: unset; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); }
.ov-x:hover { background: var(--panel-3); color: var(--text); }
.ov-msg { padding: 11px 14px; border-radius: 12px; background: var(--panel-2); color: var(--muted); font-size: 14px; line-height: 1.45; }
.ov-msg.done { background: rgba(47, 191, 113, 0.12); color: #9be7bd; }
.ov-section { display: grid; gap: 8px; }
.ov-title { font-weight: 700; font-size: 15px; }
.ov-title small { font-weight: 400; color: var(--dim); margin-left: 6px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ov-item { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.ov-item div { display: grid; gap: 3px; min-width: 0; }
.ov-item b { font-size: 14px; }
.ov-item span { color: var(--dim); font-size: 12.5px; line-height: 1.35; }
.ov-empty { color: var(--dim); font-size: 13px; padding: 6px 2px; }
.ov-btn { all: unset; cursor: pointer; flex: none; padding: 8px 14px; border-radius: 10px; background: var(--panel-3); font-weight: 600; font-size: 13px; }
.ov-btn:hover { background: var(--panel-4); }
.ov-btn.primary { background: var(--grad); color: #fff; }
.ov-btn.ghost { background: transparent; border: 1px solid var(--line-2); }
.ov-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.ov-count { margin-right: auto; color: var(--dim); font-size: 13px; }
.detail-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.detail-list li { padding: 8px 12px; border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }

/* ───── Barre des modifications en attente ───── */
#voice-pill.real { padding: 0; background: transparent; border: 0; }
#pending { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 13px; }
#pending .dot { width: 9px; height: 9px; border-radius: 50%; background: #2fbf71; flex: none; }
#pending .dot.warn { background: #f5c84c; }
#pending .dot.ok { background: #2fbf71; }
#pending .dot.pulse { animation: pend 1.2s ease-in-out infinite; }
@keyframes pend { 50% { opacity: 0.35; } }
#pending em { font-style: normal; color: #f5c84c; font-weight: 600; }
.pend-actions { display: flex; gap: 6px; }
.pend-btn { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 999px; background: var(--panel-3); font-weight: 600; font-size: 12.5px; }
.pend-btn.primary { background: var(--grad); color: #fff; }
.pend-btn[disabled] { opacity: 0.4; cursor: default; }

/* Tutoriel : explication en carte flottante en bas (ne masque pas le haut de l'interface) */
#tcap { left: 50%; top: auto; bottom: 84px; width: min(640px, calc(100vw - 32px)); max-width: none; padding: 16px 24px 18px 28px; border-radius: 20px; background: rgba(10, 10, 14, 0.86); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); transform: translate(-50%, 18px); overflow: hidden; }
#tcap::before { inset: 0 auto 0 0; width: 5px; background: linear-gradient(180deg, #39aeef, #8f7cf7 60%, #d38ae6); }
#tcap.show { transform: translate(-50%, 0); }
#tcap .tt { font-size: clamp(22px, 2.6vw, 30px); margin-top: 6px; }
#tcap .ts { font-size: 15px; max-width: none; }

/* Tutoriel : l'explication vit dans la colonne de droite (jamais au-dessus du salon ni de la configuration) */
body.tutoring .toasts { display: none !important; }
#tcap { left: auto; right: 14px; top: 86px; bottom: auto; width: 312px; max-width: none; padding: 16px 18px 18px 22px; border-radius: 18px; transform: translateX(26px); }
#tcap.show { transform: none; }
#tcap .tt { font-size: 22px; line-height: 1.12; }
#tcap .ts { font-size: 14px; line-height: 1.45; }
#tbar { left: auto; right: 14px; bottom: 14px; transform: none; width: 312px; justify-content: space-between; border-radius: 16px; }
@media (max-width: 1100px) {
  #tcap { left: 50%; right: auto; top: auto; bottom: 84px; width: min(560px, calc(100vw - 32px)); transform: translate(-50%, 18px); }
  #tcap.show { transform: translate(-50%, 0); }
  #tbar { left: 50%; right: auto; transform: translateX(-50%); width: auto; }
}

/* ───── Code d'accès du Studio (serveur réel) ───── */
#code-ov { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px; background: rgba(6, 6, 10, 0.9); backdrop-filter: blur(6px); }
#code-ov .code-hint { margin: 0; color: var(--muted); line-height: 1.5; }
#code-ov .code-in { appearance: none; outline: none; font-family: inherit; user-select: text; -webkit-user-select: text; box-sizing: border-box; width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2); font-size: 24px; letter-spacing: 4px; text-align: center; text-transform: uppercase; color: var(--text); }
#code-ov .code-err { margin: 0; min-height: 18px; color: #f87171; font-size: 13px; }
#code-ov .code-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#code-ov button { all: unset; cursor: pointer; padding: 10px 16px; border-radius: 10px; background: var(--panel-3); color: var(--text); font-weight: 600; }
#code-ov .code-ok { background: linear-gradient(110deg, #39aeef, #8f7cf7); color: #fff; }
