:root {
  --bg: #0d1012;
  --sidebar: #12161a;
  --panel: #171c20;
  --panel-2: #1d2328;
  --line: #262d33;
  --text: #e8eeec;
  --muted: #8e9a97;
  --accent: #3beeae;
  --accent-soft: rgba(59, 238, 174, 0.12);
  --accent-ink: #052a1c;
  --danger: #f2555a;
  --warn: #f4c152;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }

/* ───── Boutons & formulaires ───── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px;
  padding: 9px 16px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: #3a434a; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
select, input[type=text], input:not([type]), textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 110px; font-family: Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

/* ───── Écrans centrés ───── */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-card { text-align: center; max-width: 420px; }
.login-card img { height: 96px; margin: 0 auto 18px; }
.login-card h1 { font-size: 26px; margin: 0 0 8px; }
.login-card p { color: var(--muted); margin: 0 0 26px; }
.alert { background: rgba(242, 85, 90, .1); border: 1px solid rgba(242, 85, 90, .35); color: #ffb3b5; padding: 10px 14px; border-radius: 9px; margin-bottom: 18px; text-align: left; }
.alert.warn { background: rgba(244, 193, 82, .08); border-color: rgba(244, 193, 82, .35); color: #ffe1a3; }
.alert.ok { background: var(--accent-soft); border-color: rgba(59, 238, 174, .35); color: #b9ffe5; }

/* ───── Barre du haut ───── */
.topbar { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--sidebar); position: sticky; top: 0; z-index: 20; }
.topbar .logo { height: 34px; }
.topbar .title { font-weight: 700; font-size: 16px; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; }
.user-chip span { font-weight: 600; }

/* ───── Choix du serveur ───── */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.page h1 { font-size: 24px; margin: 0 0 6px; }
.page .sub { color: var(--muted); margin: 0 0 24px; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.guild-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.guild-card .gicon { width: 72px; height: 72px; border-radius: 50%; background: var(--panel-2) center/cover; display: grid; place-items: center; font-weight: 700; font-size: 22px; color: var(--muted); }
.guild-card .gname { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.guild-card .btn { width: 100%; }

/* ───── Mise en page serveur ───── */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; }
.guild-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 18px; cursor: pointer; }
.guild-switch:hover { border-color: #3a434a; }
.guild-switch .gicon { width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2) center/cover; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.guild-switch .gname { font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-switch small { color: var(--muted); }
.nav-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.nav a:hover { background: var(--panel); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.content { padding: 28px 32px 60px; min-width: 0; }
.content h1 { font-size: 22px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.content h1 svg { width: 24px; height: 24px; flex: none; color: var(--accent); }
.content .sub { color: var(--muted); margin: 0 0 22px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav-title { display: none; }
  .nav a { white-space: nowrap; }
  .content { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; }
  .topbar .title, .user-chip span { display: none; }
  .page { padding: 24px 16px 48px; }
}

/* ───── Cartes ───── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .card-sub { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 750; margin-top: 4px; display: flex; align-items: center; gap: 10px; }
.stat .value img { width: 30px; height: 30px; border-radius: 50%; }
.stat .value .small { font-size: 15px; }

.hero { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.hero .gicon { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-2) center/cover; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--muted); flex: none; }
.hero h1 { margin: 0; }
.hero p { margin: 2px 0 0; color: var(--muted); }

.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.module { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text); transition: border-color .15s, transform .15s; }
.module:hover { border-color: var(--accent); transform: translateY(-2px); }
.module .m-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.module .m-icon svg { width: 22px; height: 22px; }
.module h3 { margin: 4px 0 0; font-size: 15px; }
.module p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); width: fit-content; }
.badge.on { background: var(--accent-soft); color: var(--accent); }
.badge.off { background: rgba(244, 193, 82, .12); color: var(--warn); }
.badge.closed { background: rgba(242, 85, 90, .12); color: var(--danger); }

/* ───── Choix du style de panel ───── */
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.choice { border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; background: var(--panel-2); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); margin-right: 8px; }
.choice b { font-size: 14px; }
.choice p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }

/* ───── Tableaux ───── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
.rank { font-weight: 800; width: 40px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.tabs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button.active { background: var(--accent); color: var(--accent-ink); }

.steps { margin: 0 0 18px; padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 4px; }
.steps code { background: var(--bg); padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* ───── Éditeur de panels ───── */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } }
.color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.color-row input[type=color] { width: 46px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: none; padding: 0; cursor: pointer; }
.color-row code { color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0 14px; font-weight: 600; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
textarea.prose { font-family: inherit; font-size: 14px; word-break: normal; min-height: 220px; }
.cat-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.cat { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.cat.with-q { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; }
.cat input { padding: 8px 10px; }
.cat input.emo { text-align: center; }
.cat .cat-actions { display: flex; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: #3a434a; }
.icon-btn.del:hover { color: var(--danger); border-color: rgba(242, 85, 90, .5); }
.cat-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr) 104px; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 11px; }
.cat-head.with-q { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 104px; }
@media (max-width: 700px) {
  .cat, .cat.with-q { grid-template-columns: 56px minmax(0, 1fr); }
  .cat .cat-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .cat-head { display: none; }
}

/* ───── Aperçu Discord ───── */
.dc-preview { background: #313338; border-radius: 10px; padding: 16px; color: #dbdee1; font-size: 15px; line-height: 1.375; position: sticky; top: 84px; }
.dc-msg { display: flex; gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #111 center/cover; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.dc-name { color: #fff; font-weight: 600; }
.dc-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 3px; line-height: 16px; }
.dc-time { color: #949ba4; font-size: 12px; }
.dc-container { border-left: 4px solid; background: #2b2d31; border-radius: 8px; padding: 14px 16px; max-width: 560px; }
.dc-container img.banner { width: 100%; border-radius: 6px; margin-bottom: 10px; }
.dc-sep { border-top: 1px solid #3f4147; margin: 12px 0; }
.dc-select { background: #1e1f22; border: 1px solid #1e1f22; border-radius: 6px; padding: 10px 12px; color: #949ba4; display: flex; justify-content: space-between; }
.dc-options { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 6px; margin-top: 6px; max-height: 220px; overflow: auto; }
.dc-opt { display: flex; gap: 10px; padding: 8px 12px; align-items: flex-start; }
.dc-opt .e { width: 22px; text-align: center; flex: none; }
.dc-opt .e img { width: 22px; height: 22px; }
.dc-opt b { display: block; color: #dbdee1; font-weight: 600; font-size: 14px; }
.dc-opt small { color: #949ba4; font-size: 12.5px; }
.md a { color: #00a8fc; }
.md code { background: #1e1f22; border-radius: 4px; padding: 0 3px; font-family: Consolas, monospace; font-size: 85%; }
.md pre { background: #1e1f22; border-radius: 4px; padding: 7px; white-space: pre-wrap; font-family: Consolas, monospace; font-size: 13px; margin: 4px 0; }
.md .h1 { font-size: 24px; font-weight: 700; color: #fff; margin: 6px 0 2px; line-height: 1.25; }
.md .h2 { font-size: 20px; font-weight: 700; color: #fff; margin: 6px 0 2px; line-height: 1.25; }
.md .h3 { font-size: 16px; font-weight: 700; color: #fff; margin: 6px 0 2px; }
.md .sub { font-size: 12px; color: #949ba4; }
.md .quote { border-left: 4px solid #4e5058; padding-left: 12px; }
.md .li { padding-left: 14px; text-indent: -10px; }
.md .mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.md .spoiler { background: #1e1f22; color: transparent; border-radius: 3px; }
.md .emoji { width: 1.375em; height: 1.375em; vertical-align: bottom; display: inline; }

/* ───── Éditeur d'embed visuel ───── */
.ee { max-width: 760px; }
.ee-msg { display: flex; gap: 14px; }
.ee-content { width: 100%; background: #1e1f22; border: 1px solid transparent; border-radius: 8px; padding: 12px 14px; color: #dbdee1; font: inherit; font-size: 15px; resize: none; overflow: hidden; min-height: 46px; word-break: normal; }
.ee-embed-row { display: flex; gap: 10px; margin-top: 12px; align-items: flex-start; }
.ee-side { display: flex; flex-direction: column; gap: 8px; width: 40px; flex: none; align-items: center; }
.ee-color { width: 32px; height: 32px; border-radius: 8px; overflow: hidden; border: 1px solid #3f4147; position: relative; cursor: pointer; }
.ee-color input { position: absolute; inset: -6px; width: 44px; height: 44px; border: 0; padding: 0; cursor: pointer; }
.ee-embed { flex: 1; min-width: 0; max-width: 520px; background: #2b2d31; border-left: 4px solid; border-radius: 6px; padding: 12px 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 4px 14px; }
.ee-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ee input.bare, .ee textarea.bare { width: 100%; background: transparent; border: 1px dashed transparent; border-radius: 5px; padding: 4px 6px; color: #dbdee1; font: inherit; outline: none; resize: none; overflow: hidden; word-break: normal; min-height: 0; }
.ee input.bare:hover, .ee textarea.bare:hover { border-color: #4e5058; }
.ee input.bare:focus, .ee textarea.bare:focus { border-color: var(--accent); background: rgba(0,0,0,.15); }
.ee .bare::placeholder { color: #80848e; }
.ee .ee-title { font-weight: 700; font-size: 16px; color: #fff; }
.ee .ee-desc { font-size: 14px; }
.ee-line { display: flex; align-items: center; gap: 6px; }
.ee-ico { width: 26px; height: 26px; border-radius: 50%; border: 1px dashed #5c6068; flex: none; background: center/cover; cursor: pointer; display: grid; place-items: center; color: #80848e; font-size: 12px; }
.ee-ico.set { border-style: solid; border-color: transparent; }
.ee-thumb { width: 88px; height: 88px; border: 1px dashed #5c6068; border-radius: 6px; display: grid; place-items: center; color: #80848e; cursor: pointer; background: center/cover no-repeat; font-size: 11px; text-align: center; padding: 4px; }
.ee-image { grid-column: 1 / -1; min-height: 120px; border: 1px dashed #5c6068; border-radius: 6px; display: grid; place-items: center; color: #80848e; cursor: pointer; background: center/contain no-repeat; margin-top: 8px; font-size: 13px; }
.ee-thumb.set, .ee-image.set { border-color: transparent; color: transparent; }
@media (max-width: 640px) {
  .ee .dc-msg > .dc-avatar { display: none; }
  .ee-embed-row { gap: 6px; }
  .ee-side { width: 30px; }
  .ee-color { width: 28px; height: 28px; }
  .ee-del { width: 30px; height: 30px; }
  .ee-embed { grid-template-columns: minmax(0, 1fr) 60px; padding: 10px; gap: 4px 8px; }
  .ee-thumb { width: 60px; height: 60px; font-size: 10px; }
  .ee-fields { grid-template-columns: minmax(0, 1fr); }
  .ee-field.inline { grid-column: 1 / -1; }
  .img-slot[data-tip]:hover::before { display: none; }
}
.img-slot { position: relative; transition: border-color .15s, background-color .15s; }
.img-slot:hover { border-color: var(--accent); color: #dbdee1; }
.img-slot.drop { border-color: var(--accent); background-color: var(--accent-soft); }
.img-slot.loading { opacity: .5; pointer-events: none; }
.img-slot.loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #4e5058; border-top-color: var(--accent); animation: spin .8s linear infinite; }
.img-slot[data-tip]:hover::before {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #111214; color: #fff; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 8px; white-space: nowrap; z-index: 10; pointer-events: none;
}
.ee-image[data-tip]:hover::before { left: 50%; top: auto; bottom: calc(100% + 8px); transform: translateX(-50%); }
.img-del { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 11px; cursor: pointer; display: none; place-items: center; z-index: 11; }
.img-slot.set:hover .img-del { display: grid; }
.ee-image.set { min-height: 200px; }
.ee-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.ee-footer input.bare { font-size: 12.5px; }
.ee-footer label { color: #949ba4; white-space: nowrap; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.ee-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ee-field { grid-column: 1 / -1; background: rgba(0,0,0,.14); border-radius: 6px; padding: 4px; position: relative; }
.ee-field.inline { grid-column: span 1; }
.ee-field .fname { font-weight: 700; color: #fff; font-size: 14px; }
.ee-field .fvalue { font-size: 14px; }
.ee-field .ftools { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-size: 11.5px; color: #949ba4; }
.ee-field .ftools label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.ee-field .ftools button { background: none; border: 0; color: #949ba4; cursor: pointer; font-size: 13px; }
.ee-field .ftools button:hover { color: var(--danger); }
.ee-sep { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.ee-sep span { flex: 1; border-top: 1px solid #4e5058; }
.ee-sep button { background: none; border: 0; color: #80848e; cursor: pointer; font-size: 12px; opacity: 0; }
.ee-sep:hover button { opacity: 1; }
.ee-sep button:hover { color: var(--danger); }
.ee-add-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ee-add { background: none; border: 0; color: #00a8fc; cursor: pointer; font-weight: 600; padding: 4px 6px; text-align: left; }
.ee-add:hover { text-decoration: underline; }
.ee-big-add { margin-top: 16px; }
.ee-del { width: 34px; height: 34px; border-radius: 8px; border: 0; background: rgba(242, 85, 90, .15); color: var(--danger); cursor: pointer; flex: none; }
.ee-del:hover { background: rgba(242, 85, 90, .28); }
.ee-count { font-size: 11.5px; color: #949ba4; }
.ee-count.over { color: var(--danger); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; z-index: 5; }

/* ───── Sélecteur d'emoji ───── */
.emo-btn { height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; display: grid; place-items: center; font-size: 20px; padding: 0; }
.emo-btn:hover { border-color: var(--accent); }
.emo-btn .emoji, .emo-btn img { width: 24px; height: 24px; object-fit: contain; }
.emo-empty { color: var(--muted); font-size: 16px; }
.label-row { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.small-btn { padding: 3px 10px; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); }
.emoji-picker {
  position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5); padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.emoji-picker .ep-search { padding: 8px 10px; }
.ep-scroll { max-height: 280px; overflow-y: auto; padding-right: 2px; }
.ep-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 6px 2px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; }
.ep-grid button { height: 36px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 22px; display: grid; place-items: center; padding: 0; }
.ep-grid button:hover { background: var(--panel-2); }
.ep-grid img { width: 28px; height: 28px; object-fit: contain; }
.ep-none { width: 100%; padding: 6px; font-size: 13px; }

/* ───── Actions sur les tickets ───── */
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.card-title-row h2 { margin: 0; }
.danger-btn { color: var(--danger); border-color: rgba(242, 85, 90, .35); background: rgba(242, 85, 90, .08); }
.danger-btn:hover { border-color: var(--danger); background: rgba(242, 85, 90, .15); }
.actions-col { text-align: right; width: 1%; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .icon-btn { text-decoration: none; font-size: 14px; }
.icon-btn.disabled { opacity: .35; cursor: default; }

/* ───── Commandes personnalisées ───── */
.prefix-row { display: flex; gap: 8px; max-width: 320px; }
.prefix-row input { max-width: 120px; font-family: Consolas, monospace; font-size: 16px; text-align: center; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cmd-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.cmd-card.off { opacity: .55; }
.cmd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cmd-card-name { font-family: Consolas, monospace; font-size: 16px; color: var(--accent); overflow-wrap: anywhere; }
.cmd-card-desc { margin: 0; color: var(--muted); font-size: 13.5px; }
.cmd-card-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-content: flex-start; }
.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent); }

.cmd-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.cmd-head .spacer { flex: 1; }
.cmd-head .icon-btn { width: 36px; height: 36px; font-size: 20px; text-decoration: none; }
.cmd-title { display: flex; align-items: center; gap: 2px; font-size: 22px; font-weight: 750; min-width: 0; }
.cmd-title > span:first-child { color: var(--accent); font-family: Consolas, monospace; }
.cmd-title input { background: transparent; border: 1px dashed transparent; border-radius: 8px; font: inherit; color: var(--text); padding: 2px 6px; width: min(420px, 60vw); }
.cmd-title input:hover, .cmd-title input:focus { border-color: var(--line); outline: none; }
.cmd-title .pen { color: var(--muted); font-size: 16px; }
.action-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.action-choice { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; text-align: left; background: var(--panel); border: 2px solid rgba(59, 238, 174, .45); border-radius: 10px; padding: 16px; font-weight: 700; cursor: pointer; min-height: 84px; }
.action-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.action-choice b { font-size: 20px; color: var(--accent); line-height: 1; }
.action-card { border-color: rgba(59, 238, 174, .35); }
.action-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.action-head .cat-actions { display: flex; gap: 4px; flex: none; }
.variant-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.variant-row .tabs { margin-bottom: 0; }
.add-variant { margin-top: 14px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; }
.chip.all { padding-right: 12px; color: var(--muted); }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; }
.chip button:hover { color: var(--danger); }
.vars { color: var(--muted); font-size: 13.5px; line-height: 2; }
.vars code, .sub code { background: var(--bg); padding: 2px 6px; border-radius: 5px; color: var(--accent); }

/* ───── Pages des modules ───── */
.module-form .card h2 { font-size: 16px; }
.module-form .card-title-row { margin-bottom: 8px; }
.switch.big { width: 46px; height: 26px; }
.switch.big span::after { width: 20px; height: 20px; }
.switch.big input:checked + span::after { transform: translateX(20px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row b { display: block; font-size: 14px; }
.toggle-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.module-form small.help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.6; }
.module-form small.help code { background: var(--bg); padding: 1px 5px; border-radius: 4px; color: var(--accent); }
.module-form .f > .lbl, .lbl { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.list-label { margin-top: 8px; }
.num-row { display: flex; align-items: center; gap: 10px; }
.num-row input { max-width: 140px; }
.num-row .suffix { color: var(--muted); }
input[type=number] { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; outline: none; }
input[type=number]:focus { border-color: var(--accent); }
textarea.plain { font-family: inherit; font-size: 14px; word-break: normal; min-height: 80px; }
.list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.list-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.list.compact .list-item { background: var(--panel-2); padding: 12px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.list-head .cat-actions { display: flex; gap: 4px; }
.list-body.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; align-items: end; }
.list-body.inline .emo-btn { width: 100%; }
.list > .btn { align-self: flex-start; }
.progress { width: 120px; height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }
td small { color: var(--muted); font-size: 11.5px; }
td.wrap { white-space: normal; min-width: 180px; }

/* ───── Personnalisation ───── */
.brand-images { display: flex; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.brand-images .grow { flex: 1; min-width: 220px; }
.img-pick { background: var(--panel-2) center/cover no-repeat; border: 2px dashed var(--line); cursor: pointer; transition: border-color .15s; }
.img-pick:hover { border-color: var(--accent); }
.brand-avatar { width: 96px; height: 96px; border-radius: 50%; }
.brand-banner { height: 96px; border-radius: 10px; }
.brand-img-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.brand-img-actions .btn { padding: 5px 10px; font-size: 12.5px; }
.count { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.plain-fieldset:disabled { opacity: .55; }
.profile-card { background: #232428; border-radius: 10px; overflow: hidden; max-width: 340px; }
.pc-banner { height: 110px; background: center/cover no-repeat; }
.pc-avatar { width: 84px; height: 84px; border-radius: 50%; border: 6px solid #232428; background: #111 center/cover; margin: -46px 0 0 14px; position: relative; }
.pc-avatar i { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; border: 4px solid #232428; }
.pc-body { padding: 6px 16px 16px; }
.pc-name { color: #fff; font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pc-user { color: #b5bac1; font-size: 13px; }
.pc-activity { margin-top: 10px; background: #2b2d31; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.pc-section { margin-top: 12px; font-size: 13.5px; }
.pc-section b { display: block; color: #fff; font-size: 12px; margin-bottom: 4px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(90px); background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 10px; font-weight: 700; transition: transform .25s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); color: #fff; }
.toast.show { transform: translateX(-50%) translateY(0); }
