@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

/*
 * Dashboard — thème sombre épuré.
 * Les surfaces se distinguent par leur ton (pas de bordures) ;
 * le violet électrique est réservé aux actions et aux états actifs.
 */
:root {
  /* Tons neutres, dérivés de l'encre #171329 */
  --n-0: #0f0c1d;   /* barre latérale, champs */
  --n-1: #171329;   /* fond (encre) */
  --n-2: #1e1a35;   /* blocs */
  --n-3: #282342;   /* relief, survol */
  --n-4: #332d52;   /* relief appuyé */
  --n-5: #463f6b;
  --t-1: #f7f5ff;   /* texte principal (blanc cassé) */
  --t-2: #b7b1d1;   /* texte secondaire */
  --t-3: #7b7598;   /* texte discret */

  /* Couleur principale : violet électrique */
  --primary: #5630ff;
  --primary-hover: #6a48ff;
  --primary-rgb: 86 48 255;
  --primary-soft: rgb(var(--primary-rgb) / 0.16);
  --primary-soft-2: rgb(var(--primary-rgb) / 0.26);
  --primary-text: #c8bcff; /* lavande pâle */
  --success: #d8ff80;      /* lime */
  --success-rgb: 216 255 128;
  --danger: #f2555a;
  --danger-rgb: 242 85 90;

  /* Alias utilisés par les pages */
  --bg: var(--n-1);
  --surface: var(--n-2);
  --surface-2: var(--n-3);
  --input: var(--n-0);
  --text: var(--t-1);
  --text-2: var(--t-2);
  --text-3: var(--t-3);
  --accent: var(--primary);
  --accent-hover: var(--primary-hover);
  --accent-text: var(--primary-text);
  --accent-soft: var(--primary-soft);
  --accent-soft-hover: var(--primary-soft-2);
  --o-400: var(--primary-text);
  --o-500: var(--primary);
  --o-600: var(--primary);
  --red-400: var(--danger);
  --slate-950: var(--n-0);
  --slate-900: var(--n-2);
  --slate-850: var(--n-2);
  --slate-800: var(--n-1);
  --slate-700: var(--n-3);
  --slate-600: var(--n-4);
  --braise: var(--primary);
  --ambre: var(--primary-text);

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --sidebar-w: 264px;
  --font: 'Geist', proxima-nova, Helvetica, Arial, sans-serif;
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);

  /* Aperçu Discord (couleurs réelles de Discord) */
  --dc-bg: #313338;
  --dc-container: #393a41;
  --dc-text: #dbdee1;
  --dc-muted: #949ba4;
  --dc-link: #00a8fc;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Pages sans barre latérale (connexion, chargement, Mes serveurs) : fond uni */
body:not(:has(.app:not(.no-sidebar))) { background: var(--n-1) !important; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  /* Moitié gauche couleur de la barre latérale : sur écran ultra-large, la marge à gauche de la sidebar la prolonge */
  background: linear-gradient(to right, var(--n-0) 50%, var(--n-1) 50%);
  color: var(--t-2);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-soft-2); color: var(--t-1); }
svg.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; color: var(--t-1); margin: 0; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--t-1); margin: 0; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--t-1); margin: 0; }
.muted { color: var(--t-2); }
.subtle { color: var(--t-3); font-size: 13px; }

/* ───────────── Structure ───────────── */
/*
 * Largeur du dashboard : tout l'écran sur un écran classique (16:9, 16:10…),
 * colonne centrée de 1920 px sur un écran ultra-large (21:9 et plus), comme MEE6.
 */
:root { --topbar-h: 60px; --app-w: 100vw; --app-side: 0px; }
@media (min-aspect-ratio: 21/10) and (min-width: 2100px) {
  :root { --app-w: 1920px; --app-side: calc((100vw - 1920px) / 2); }
}
.app { display: flex; min-height: calc(100vh - var(--topbar-h)); max-width: var(--app-w); margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); width: var(--sidebar-w); flex: none;
  background: var(--n-0); display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto;
}
.app.no-sidebar .sidebar { display: none; }

/* Barre du haut : logo Kivo à gauche, profil à droite */
.topbar {
  position: sticky; top: 0; z-index: 45; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 calc(var(--app-side) + 24px);
  background: var(--n-0); box-shadow: 0 1px 0 rgba(255,255,255,.04);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--t-1); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.topbar-right { position: relative; margin-left: auto; }
.profile-btn {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 0; border-radius: 999px;
  background: transparent; color: var(--t-2); cursor: pointer; transition: background-color .15s, color .15s;
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { background: var(--n-2); color: var(--t-1); }
.profile-btn .icon { width: 16px; height: 16px; transition: transform .15s; }
.profile-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 250px; padding: 6px;
  display: flex; flex-direction: column; border-radius: 12px; background: var(--n-3); box-shadow: var(--shadow-float);
  animation: dd-in .12s ease-out;
}
.profile-menu[hidden] { display: none; }
.profile-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; }
.profile-who strong { display: block; color: var(--t-1); font-size: 14px; }
.profile-who span { display: block; color: var(--t-3); font-size: 12px; }
.profile-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--t-2); font: 500 14px var(--font); text-align: left; cursor: pointer; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.profile-item .icon { width: 18px; height: 18px; color: var(--t-3); }
.profile-item:hover { background: var(--n-4); color: var(--t-1); }
.profile-item.danger:hover, .profile-item.danger:hover .icon { color: var(--danger); }
.profile-sep { height: 1px; margin: 6px 4px; background: var(--n-4); }

/* Page « Mes serveurs » */
.servers-page { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.servers-title { text-align: center; font-size: 30px; font-weight: 700; margin-top: 4px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 28px; }
.server-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.server-banner {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: var(--n-2); transition: filter .15s;
}
.server-card a:hover .server-banner { filter: brightness(1.12); }
.server-banner-bg { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(28px) saturate(1.2); opacity: .55; }
.server-icon { position: relative; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.server-icon.initials { display: grid; place-items: center; background: var(--n-1); color: var(--t-1); font-weight: 700; font-size: 20px; box-shadow: 0 0 0 2px var(--n-5); }
.server-card.absent .server-banner { filter: grayscale(.4) brightness(.85); }
.server-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.server-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.server-info strong { color: var(--t-1); font-size: 15px; overflow-wrap: anywhere; }
.server-info span { color: var(--t-3); font-size: 13px; }
.server-meta .btn { flex: none; }

/* Notes de mises à jour */
.updates-page { max-width: 900px; margin: 0 auto; }
.update { padding: 22px 24px; }
.update-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.update ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--t-2); font-size: 14px; line-height: 1.5; }
.main { flex: 1; min-width: 0; padding: 40px 48px 140px; background: var(--n-1); }
/* Le contenu occupe toute la largeur disponible (demande de Julien) */
.main-inner { width: 100%; }

/* Sélecteur de serveur */
.guild-switch { position: relative; margin-bottom: 18px; }
.guild-switch > button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: transparent; border: 0; border-radius: var(--r); cursor: pointer; text-align: left;
  font-size: 14px; font-weight: 600; color: var(--t-1); transition: background-color .15s;
}
.guild-switch > button:hover { background: var(--n-2); }
.guild-switch .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-switch > button .icon { width: 16px; height: 16px; color: var(--t-3); }
.guild-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--n-3); border-radius: var(--r); padding: 6px; box-shadow: var(--shadow-float);
  max-height: 60vh; overflow-y: auto;
}
.guild-menu a, .guild-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
  background: none; border: 0; cursor: pointer; text-align: left; font-size: 14px; color: var(--t-2);
  transition: background-color .15s, color .15s;
}
.guild-menu a:hover, .guild-menu button:hover, .guild-menu a.current { background: var(--n-4); color: var(--t-1); }
.guild-menu hr { border: 0; height: 4px; margin: 0; }

.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--n-4); }
.guild-icon {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--primary); color: #fff; object-fit: cover;
}

/* Navigation */
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: var(--r-sm); color: var(--t-2); font-size: 14px; font-weight: 500;
  transition: background-color .15s, color .15s;
}
.nav a .icon { width: 18px; height: 18px; color: var(--t-3); transition: color .15s; }
.nav a:hover { background: var(--n-2); color: var(--t-1); }
.nav a:hover .icon { color: var(--t-2); }
.nav a.active { background: var(--n-3); color: var(--t-1); }
.nav a.active .icon { color: var(--primary-text); }
/* Point d'état à droite du libellé */
.nav a .dot { order: 3; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--n-5); }
.nav a .dot.on { background: var(--success); }
.nav-section { margin: 22px 10px 6px; font-size: 12px; font-weight: 500; color: var(--t-3); }
.sidebar-footer { margin-top: auto; padding: 10px; display: flex; align-items: center; gap: 10px; border-radius: var(--r); background: var(--n-2); }
.sidebar-footer .who { flex: 1; min-width: 0; font-weight: 500; font-size: 13px; color: var(--t-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .btn.icon-only { width: 30px; height: 30px; }

/* ───────────── En-tête de page ───────────── */
.page-head { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-head .text { flex: 1; }
.page-head p { margin: 8px 0 0; color: var(--t-2); font-size: 15px; max-width: 900px; }

/* ───────────── Boutons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px;
  padding: 0 16px; border-radius: var(--r); border: 0; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 600; background: var(--primary); color: #fff;
  transition: background-color .15s, color .15s, transform .1s;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--n-3); color: var(--t-1); }
.btn.secondary:hover { background: var(--n-4); }
.btn.ghost { background: transparent; color: var(--t-2); font-weight: 500; }
.btn.ghost:hover { background: var(--n-3); color: var(--t-1); }
.btn.danger { background: rgb(var(--danger-rgb) / 0.12); color: var(--danger); }
.btn.danger:hover { background: rgb(var(--danger-rgb) / 0.2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon-only { width: 34px; height: 34px; padding: 0; }
.btn .icon { width: 16px; height: 16px; }

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; color: var(--t-1); font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 42px; height: 24px; border-radius: 99px; flex: none; background: var(--n-5); transition: background-color .2s; }
.switch .track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch.small .track { width: 36px; height: 20px; }
.switch.small .track::after { width: 14px; height: 14px; }
.switch.small input:checked + .track::after { transform: translateX(16px); }

/* Onglets : contrôle segmenté */
.tabs { display: inline-flex; gap: 2px; padding: 4px; margin-bottom: 28px; background: var(--n-2); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.tabs button {
  background: none; border: 0; cursor: pointer; white-space: nowrap; padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--t-2); transition: background-color .15s, color .15s;
}
.tabs button:hover { color: var(--t-1); }
.tabs button.active { background: var(--n-4); color: var(--t-1); }

/* Blocs */
.panel { background: var(--n-2); border-radius: var(--r-lg); margin-bottom: 16px; }
.panel-head { display: flex; align-items: flex-start; gap: 16px; width: 100%; padding: 22px 24px; background: none; border: 0; text-align: left; cursor: pointer; }
.panel-head .text { flex: 1; }
.panel-head h3 { font-size: 16px; }
.panel-head p { margin: 4px 0 0; color: var(--t-2); font-size: 14px; max-width: 900px; }
.panel-head .chev { width: 18px; height: 18px; color: var(--t-3); margin-top: 3px; transition: transform .2s, color .15s; }
.panel-head:hover .chev { color: var(--t-1); }
.panel.collapsed .chev { transform: rotate(180deg); }
.panel.collapsed .panel-body { display: none; }
.panel-body { padding: 0 24px 24px; }
.panel-body > .divider { display: none; }

/* ───────────── Champs ───────────── */
.grid { display: grid; gap: 20px 24px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .field > .label { color: var(--t-1); font-size: 13px; font-weight: 500; }
.field .hint { color: var(--t-3); font-size: 12.5px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; background: var(--n-0); border: 0; border-radius: var(--r);
  padding: 10px 14px; font-size: 14px; color: var(--t-1); outline: none; transition: background-color .15s, box-shadow .15s;
}
.input:hover, .select:hover, .textarea:hover { background: #131418; }
.input:focus, .select:focus, .textarea:focus { background: #131418; box-shadow: 0 0 0 2px rgb(var(--primary-rgb) / 0.35); }
.input::placeholder, .textarea::placeholder { color: var(--t-3); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a3ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select option, .select optgroup { background: var(--n-3); color: var(--t-1); }
.color-input { display: flex; gap: 10px; align-items: center; }
.color-input input[type=color] { width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r); background: none; cursor: pointer; }
.color-input input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type=color]::-webkit-color-swatch { border: 0; border-radius: var(--r); }
.check-row { display: flex; align-items: center; gap: 12px; color: var(--t-1); }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker { display: flex; flex-direction: column; gap: 10px; }

/* Puces */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-sm);
  background: var(--n-3); color: var(--t-1); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .15s;
}
.chip:hover { background: var(--n-4); }
.chip code { font-family: inherit; color: var(--primary-text); }
.chip-on, .chip-on:hover { background: var(--primary); color: #fff; }
.role-chip { cursor: default; }
.role-chip .swatch { width: 8px; height: 8px; border-radius: 50%; }
.role-chip button { background: none; border: 0; padding: 0; margin-right: -2px; cursor: pointer; color: var(--t-3); display: flex; }
.role-chip button:hover { color: var(--danger); }
.role-chip button .icon { width: 14px; height: 14px; }

/* Choix exclusifs */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.radio-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; border-radius: var(--r);
  background: var(--n-0); color: var(--t-2); transition: background-color .15s, color .15s;
}
.radio-card strong { font-weight: 500; color: var(--t-1); }
.radio-card:hover { background: #131418; }
.radio-card.checked { background: var(--primary-soft); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 3px; background: var(--n-4); transition: box-shadow .15s, background-color .15s; }
.radio-card.checked .radio-dot { background: var(--primary); box-shadow: inset 0 0 0 4px var(--primary), inset 0 0 0 8px #fff; }
.radio-card input:focus-visible + .radio-dot { outline: 2px solid var(--primary); outline-offset: 2px; }
.radio-card .subtle { font-size: 13px; margin-top: 2px; }

/* ───────────── Menus déroulants maison ───────────── */
.dd { position: relative; width: 100%; min-width: 0; }
.auto-action .dd, .inline .dd { width: auto; }
.dd-trigger {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px;
  background: var(--n-0); border: 0; border-radius: var(--r); cursor: pointer; text-align: left;
  font-size: 14px; color: var(--t-1); transition: background-color .15s, box-shadow .15s;
}
.dd-trigger:hover, .dd-trigger.open { background: #131418; }
.dd-trigger.open { box-shadow: 0 0 0 2px rgb(var(--primary-rgb) / 0.35); }
.dd-trigger:disabled { opacity: .5; cursor: not-allowed; }
.dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-label.placeholder { color: var(--t-3); }
.dd-chev { width: 16px; height: 16px; color: var(--t-3); transition: transform .15s; }
.dd-trigger.open .dd-chev { transform: rotate(180deg); color: var(--t-1); }
.entry .dd-trigger, .auto-action .dd-trigger { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }

.dd-pop {
  z-index: 1000; max-width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column;
  padding: 6px; border-radius: 12px; background: var(--n-3); box-shadow: var(--shadow-float);
  animation: dd-in .12s ease-out;
}
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-search {
  margin: 0 0 6px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-sm); outline: none;
  background: var(--n-0); color: var(--t-1); font-size: 13.5px;
}
.dd-search::placeholder { color: var(--t-3); }
.dd-list { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--n-5) transparent; }
.dd-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 500; color: var(--t-3); }
.dd-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--t-1); cursor: pointer; user-select: none;
}
.dd-option .dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-option.active { background: var(--n-4); }
.dd-option.selected { color: var(--primary-text); }
.dd-option.muted-opt { color: var(--t-2); }
.dd-option.disabled { opacity: .45; cursor: not-allowed; }
.dd-check { width: 16px; height: 16px; color: var(--primary-text); }
.dd-empty { padding: 12px 10px; color: var(--t-3); font-size: 13px; }

/* Sélecteur de couleur */
.cp-trigger {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 6px; border: 0; border-radius: var(--r);
  background: var(--n-0); color: var(--t-1); cursor: pointer; font-size: 13.5px; transition: background-color .15s;
}
.cp-trigger:hover, .cp-trigger.open { background: #131418; }
.cp-swatch { width: 32px; height: 32px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cp-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; color: var(--t-2); }
.color-pop { width: 264px; padding: 12px; gap: 12px; }
.cp-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.cp-cell { aspect-ratio: 1; border: 0; border-radius: 7px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: transform .1s; }
.cp-cell:hover { transform: scale(1.12); }
.cp-cell.selected { box-shadow: 0 0 0 2px var(--n-3), 0 0 0 4px var(--t-1); }
.cp-row { display: flex; gap: 8px; align-items: center; }
.cp-preview { width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cp-hex { min-height: 40px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; text-transform: uppercase; }

/* ───────────── Tableau de bord ───────────── */
.hero { display: flex; align-items: center; gap: 24px; margin-bottom: 40px; padding: 24px; border-radius: var(--r-lg); background: var(--n-2); }
.hero .bot-avatar { width: 64px; height: 64px; border-radius: 16px; }
.hero .text { flex: 1; min-width: 0; }
.hero h1 { font-size: 22px; }
.hero p { margin: 4px 0 0; color: var(--t-2); max-width: 640px; }
.hero .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; max-width: 720px; }
.hero .stats div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--n-1); }
.hero .stats strong { font-size: 18px; font-weight: 600; color: var(--t-1); }
.hero .stats span { color: var(--t-3); font-size: 12.5px; }
.hero .subtle { display: flex; align-items: center; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 7px; box-shadow: 0 0 0 3px rgb(var(--success-rgb) / .15); }

.section-title { margin: 0 0 16px; font-size: 20px; }
.module-group { margin-bottom: 36px; }
.module-group > h3 { margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--t-3); }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.module-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'icon state' 'title title' 'desc desc';
  align-items: start; align-content: start; gap: 4px 12px; padding: 18px; border-radius: var(--r-lg); background: var(--n-2);
  cursor: pointer; transition: background-color .15s;
}
.module-card:hover { background: var(--n-3); }
.module-card .icon-tile { grid-area: icon; width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 12px; }
.module-card .icon-tile .icon { width: 20px; height: 20px; }
.module-card.off .icon-tile { background: var(--n-3); color: var(--t-3); }
.module-card h3 { grid-area: title; font-size: 15px; }
.module-card p { grid-area: desc; margin: 0; color: var(--t-2); font-size: 13.5px; line-height: 1.5; }
.module-card .state {
  grid-area: state; justify-self: end; display: inline-flex; align-items: center; gap: 6px; height: 26px;
  padding: 0 10px; border: 0; border-radius: 99px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: rgb(var(--success-rgb) / .12); color: var(--success); transition: background-color .15s, color .15s;
}
.module-card .state .icon { width: 14px; height: 14px; }
.module-card .state:hover { background: rgb(var(--success-rgb) / .2); }
.module-card .state.off { background: var(--n-3); color: var(--t-2); }
.module-card .state.off:hover { background: var(--primary); color: #fff; }

/* ───────────── Listes et tableaux ───────────── */
.table { width: 100%; border-collapse: separate; border-spacing: 0 2px; font-size: 14px; }
.table th { text-align: left; color: var(--t-3); font-size: 12.5px; font-weight: 500; padding: 6px 12px; }
.table td { padding: 10px 12px; vertical-align: middle; color: var(--t-1); }
.table tbody tr td { transition: background-color .15s; }
.table tbody tr:hover td { background: var(--n-3); }
.table tbody td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.table tbody td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.empty { text-align: center; padding: 40px 20px; color: var(--t-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { width: 36px; height: 36px; color: var(--t-3); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--r); transition: background-color .15s; }
.list-row:hover { background: var(--n-3); }
.list-row .text { flex: 1; min-width: 0; color: var(--t-1); }
.cmd { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 6px; flex: none; background: var(--n-0); color: var(--primary-text); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; }
.icon-tile-sm { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.progress { height: 6px; border-radius: 99px; background: var(--n-0); overflow: hidden; margin-bottom: 4px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.rank-cell { font-weight: 600; color: var(--t-2); width: 48px; text-align: center; }

/* Lignes répétées (récompenses, actions automatiques, rôles de panneau) */
.entry, .auto-action { background: var(--n-1); border-radius: var(--r); margin-bottom: 8px; }
.entry { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px; align-items: center; padding: 8px; }
.entry .input, .entry .select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.entry .select { padding-right: 34px; background-position: right 10px center; }
.auto-action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; color: var(--t-2); }
.auto-action .select, .auto-action .input { width: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--primary-soft); color: var(--t-1); }
.notice .icon { color: var(--primary-text); flex: none; }

/* Grille des règles (auto-modération) */
.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.rule { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rule-head { display: flex; align-items: center; justify-content: flex-start; gap: 4px; color: var(--t-1); font-size: 13px; font-weight: 500; }
.rule-head .btn { width: 26px; height: 26px; padding: 0; flex: none; }
.rule-head .btn .icon { width: 15px; height: 15px; }
.rule.has-settings .rule-head .btn { color: var(--primary-text); }
.rule-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sous-page d'une règle (réglages façon MEE6) */
.subpage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.subpage-head h1 { margin: 0; font-size: 22px; font-weight: 600; flex: 1; min-width: 0; }
.subpage-back { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--t-2); cursor: pointer; transition: background-color .15s, color .15s; }
.subpage-back:hover { background: var(--n-2); color: var(--t-1); }
.subpage-back .icon { width: 20px; height: 20px; }
.subpage-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.perm-grid { display: grid; gap: 24px; max-width: 560px; }
.perm-block { display: grid; gap: 10px; }
.perm-title { font-weight: 600; color: var(--t-1); }
.perm-option { display: flex; align-items: center; gap: 10px; color: var(--t-2); font-size: 14px; cursor: pointer; width: fit-content; }
.perm-option input { position: absolute; opacity: 0; pointer-events: none; }
.perm-option .radio-dot { margin-top: 0; }
.perm-option.checked { color: var(--t-1); }
.perm-option.checked .radio-dot { background: var(--primary); box-shadow: inset 0 0 0 4px var(--primary), inset 0 0 0 8px #fff; }
.perm-option input:focus-visible + .radio-dot { outline: 2px solid var(--primary); outline-offset: 2px; }
.perm-picker { padding: 12px 14px; border-radius: var(--r); background: var(--n-0); }
.perm-hint { margin: 18px 0 0; font-size: 13px; }

/* Liste de mots en puces */
.tag-input { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--n-0); cursor: text; }
.tags { display: contents; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-size: 13px; font-weight: 500; max-width: 100%; }
.tag button { display: flex; padding: 2px; border: 0; border-radius: 50%; background: none; color: inherit; opacity: .7; cursor: pointer; }
.tag button:hover { opacity: 1; background: rgba(255,255,255,.08); }
.tag button .icon { width: 13px; height: 13px; }
.tag-entry { flex: 1; min-width: 140px; height: 28px; border: 0; outline: 0; background: none; color: var(--t-1); font: inherit; font-size: 14px; }
.tag-entry::placeholder { color: var(--t-3); }

/* Démonstration des mots interdits */
.words-demo { display: grid; gap: 12px; margin-top: 8px; }
.words-demo h3 { margin: 0; font-size: 16px; }
.words-demo > p { margin: 0; }
.demo-case { display: grid; gap: 6px; max-width: 560px; }
.demo-case strong { color: var(--t-1); font-weight: 500; }
.demo-case .subtle { font-size: 13px; }
.demo-msg { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--n-0); }
.demo-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.demo-author { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--t-1); }
.demo-bot { padding: 1px 5px; border-radius: 4px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 600; }
.demo-text { color: var(--t-2); margin-top: 2px; }
.demo-text mark { padding: 0 2px; border-radius: 3px; background: var(--t-1); color: var(--n-0); }
.demo-text mark.soft { background: var(--primary-soft); color: var(--primary-text); }

/* ───────────── Éditeur + aperçu Discord ───────────── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 20px; align-items: start; }
.editor .preview-col { position: sticky; top: 24px; }
.dc-preview { background: var(--dc-bg); border-radius: var(--r-lg); padding: 16px 16px 20px; font-size: 15px; color: var(--dc-text); }
.dc-preview .dc-label { color: var(--dc-muted); font-size: 12px; font-weight: 500; margin-bottom: 14px; display: flex; justify-content: space-between; }
.dc-msg { display: flex; gap: 14px; }
.dc-msg .avatar { width: 40px; height: 40px; }
.dc-body { flex: 1; min-width: 0; }
.dc-author { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dc-author strong { color: #fff; font-weight: 600; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.dc-time { color: var(--dc-muted); font-size: 12px; }
.dc-container { background: var(--dc-container); border-radius: 8px; padding: 16px; border-left: 4px solid var(--primary); max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.dc-section { display: flex; gap: 12px; align-items: flex-start; }
.dc-section > .dc-text { flex: 1; min-width: 0; }
.dc-thumb { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex: none; }
.dc-text { line-height: 1.375; overflow-wrap: anywhere; }
.dc-text h1 { font-size: 24px; color: #fff; margin: 4px 0; font-weight: 700; }
.dc-text h2 { font-size: 20px; color: #fff; margin: 4px 0; font-weight: 700; }
.dc-text h3 { font-size: 16px; color: #fff; margin: 2px 0; font-weight: 700; }
.dc-text .li { position: relative; padding-left: 18px; }
.dc-text .li::before { content: '•'; position: absolute; left: 4px; color: var(--dc-muted); }
.dc-text .li.num::before { content: attr(data-n); left: 0; }
.dc-text .dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; transition: color .15s; }
.dc-text .dc-spoiler:hover { color: inherit; background: rgba(255,255,255,.06); }
.dc-text .sub { font-size: 13px; color: var(--dc-muted); }
.dc-text blockquote { margin: 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.dc-text code { background: #2b2d31; padding: 1px 4px; border-radius: 4px; font-size: 13.5px; }
.dc-text a { color: var(--dc-link); }
.dc-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-sep { border-top: 1px solid rgba(255,255,255,.08); margin: 4px 0; }
.dc-image { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
.dc-button { background: #4e5058; color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 14px; font-weight: 500; flex: none; align-self: center; }

/* Barre d'enregistrement flottante */
.savebar {
  position: fixed; left: calc(var(--app-side) + var(--sidebar-w) + (var(--app-w) - var(--sidebar-w)) / 2); bottom: 24px; z-index: 40;
  width: calc(var(--app-w) - var(--sidebar-w) - 96px); /* même largeur que le contenu (marges de .main) */
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 20px; border-radius: 10px;
  background: var(--n-0); box-shadow: var(--shadow-float); color: var(--t-1); font-weight: 500;
  transform: translate(-50%, 140%); opacity: 0; visibility: hidden; transition: transform .25s ease, opacity .2s, visibility .2s;
}
.savebar.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.savebar span { flex: 1; min-width: 0; margin-right: 12px; }
.savebar .btn { height: 38px; padding: 0 16px; flex: none; }

/* Notifications */
.toasts {
  position: fixed; right: calc(var(--app-side) + 24px); bottom: 24px; z-index: 1100;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none; transition: bottom .25s ease;
}
/* Au-dessus de la barre d'enregistrement quand elle est affichée */
body:has(.savebar.show) .toasts { bottom: 96px; }
.toast {
  pointer-events: auto; position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: 12px;
  width: min(380px, calc(100vw - 32px)); padding: 12px 10px 15px 12px; border-radius: 12px;
  background: var(--n-3); color: var(--t-1); box-shadow: var(--shadow-float); font-weight: 500; line-height: 1.4;
  animation: toast-in .28s cubic-bezier(.2, .9, .3, 1.15);
}
.toast.leaving { animation: toast-out .2s ease forwards; }
.toast-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgb(var(--success-rgb) / .14); color: var(--success); }
.toast-icon .icon { width: 18px; height: 18px; }
.toast.error .toast-icon { background: rgb(var(--danger-rgb) / .16); color: var(--danger); }
.toast.info .toast-icon { background: var(--primary-soft); color: var(--primary-text); }
.toast-msg { flex: 1; min-width: 0; padding-top: 5px; font-size: 14px; overflow-wrap: anywhere; }
.toast-close { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--t-3); cursor: pointer; }
.toast-close:hover { background: var(--n-4); color: var(--t-1); }
.toast-close .icon { width: 16px; height: 16px; }
.toast-bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--success); opacity: .7; transform-origin: left; animation: toast-timer var(--d, 3500ms) linear forwards; }
.toast.error .toast-bar { background: var(--danger); }
.toast.info .toast-bar { background: var(--primary); }
.toast:hover .toast-bar { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(28px); } }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* Fenêtre de confirmation */
.confirm-text { margin: 0; color: var(--t-2); line-height: 1.5; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--n-1); }
.login-card { text-align: center; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 32px; border-radius: 18px; background: var(--n-2); }
.login-card .guild-icon { border-radius: 20px !important; }
.login-card .btn { height: 44px; padding: 0 22px; margin-top: 8px; }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--t-3); }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--n-4); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile */
.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor .preview-col { position: static; }
  .grid.cols-3, .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry { grid-template-columns: 1fr 1fr; }
  .hero .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-float); }
  .app.nav-open .sidebar { transform: none; }
  .main { padding: 24px 16px 140px; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .grid.cols-2, .grid.cols-3, .rules-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .savebar { left: 50%; width: calc(100vw - 32px); }
  .toasts { right: 16px; bottom: 16px; }
  body:has(.savebar.show) .toasts { bottom: 88px; }
  .page-head { flex-direction: column; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ───────────────────────── Sélecteur de couleur (façon Discord) ───────────────────────── */
.color-pop { width: 272px; padding: 14px; }
.cpk { display: flex; flex-direction: column; gap: 12px; }
.cpk-group { display: flex; flex-direction: column; gap: 8px; }
.cpk-title { font-size: 13px; font-weight: 600; color: var(--t-1); }
.cpk-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.cpk-swatch { width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); transition: transform .1s; }
.cpk-swatch:hover { transform: scale(1.15); }
.cpk-swatch:focus-visible { outline: 2px solid var(--t-1); outline-offset: 2px; }
.cpk-area { position: relative; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none; }
.cpk-area-thumb { position: absolute; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.5); pointer-events: none; }
.cpk-hue { position: relative; height: 12px; border-radius: 6px; cursor: pointer; touch-action: none;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.cpk-hue-thumb { position: absolute; top: 50%; width: 8px; height: 18px; border-radius: 4px; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.5); pointer-events: none; }
.cpk-area:focus-visible, .cpk-hue:focus-visible { outline: 2px solid var(--t-1); outline-offset: 2px; }
.cpk-inputs { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 6px; }
.cpk-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--t-3); }
.cpk-input { width: 100%; min-width: 0; height: 34px; padding: 0 8px; border: 0; border-radius: 7px; background: var(--n-0); color: var(--t-1); font: 500 13px ui-monospace, 'SF Mono', Menlo, monospace; text-transform: uppercase; }
.cpk-input:focus { outline: 2px solid var(--primary-soft-2); }

/* ───────────────────────── Éditeur de message (façon MEE6) ───────────────────────── */
.me { display: flex; flex-direction: column; gap: 14px; }
.me-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.me-vars-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--t-3); margin-right: 4px; }
.me-vars-label .icon { width: 15px; height: 15px; }
.me-toolbar-right { margin-left: auto; display: flex; gap: 6px; }

/* Icône d'émoji dans chaque champ de l'éditeur (visible au survol / pendant la saisie) */
.me-in-wrap { position: relative; display: block; min-width: 0; }
.me-in-wrap > .me-in { padding-right: 34px; }
.me-emoji-btn {
  position: absolute; right: -4px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  display: grid; place-items: center; background: transparent; font-size: 17px; line-height: 1; cursor: pointer;
  filter: grayscale(1); opacity: 0; transition: opacity .12s, filter .12s, transform .12s;
}
.me-in-wrap.multi .me-emoji-btn { top: 2px; transform: none; }
.me-content-row .me-emoji-btn { right: 8px; }
.me-content-row .me-in-wrap.multi .me-emoji-btn { top: 10px; }
.me-in-wrap:hover .me-emoji-btn, .me-in-wrap:focus-within .me-emoji-btn, .me-emoji-btn.open { opacity: .7; }
.me-emoji-btn:hover, .me-emoji-btn.open { opacity: 1; filter: none; transform: translateY(-50%) scale(1.12); }
.me-in-wrap.multi .me-emoji-btn:hover, .me-in-wrap.multi .me-emoji-btn.open { transform: scale(1.12); }
@media (hover: none) { .me-emoji-btn { opacity: .7; } }
.me-emoji-icon { font-size: 15px; line-height: 1; }

/* ───────────── Sélecteur d'émojis (façon Discord) ───────────── */
.emoji-pop { width: 420px; height: 440px; max-height: min(440px, calc(100vh - 24px)); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.emoji-head { padding: 12px; }
.emoji-search { width: 100%; height: 38px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: var(--n-0); color: var(--t-1); font: 14px var(--font); outline: none; }
.emoji-search:focus { box-shadow: 0 0 0 2px rgb(var(--primary-rgb) / .35); }
.emoji-main { flex: 1; min-height: 0; display: flex; }
.emoji-rail { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; background: var(--n-2); overflow-y: auto; }
.emoji-rail[hidden] { display: none; }
.emoji-rail-btn { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; display: grid; place-items: center; background: transparent; font-size: 20px; cursor: pointer; filter: grayscale(1); opacity: .65; transition: filter .12s, opacity .12s, background-color .12s; }
.emoji-rail-btn:hover { filter: none; opacity: 1; background: var(--n-4); }
.emoji-rail-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.emoji-list { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 10px 10px; scroll-behavior: smooth; }
.emoji-section h4 { position: sticky; top: -4px; z-index: 1; display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 2px 6px; background: var(--n-3); color: var(--t-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.emoji-section-icon { width: 16px; height: 16px; border-radius: 50%; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; margin-bottom: 6px; }
.emoji-cell { aspect-ratio: 1; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; padding: 0; transition: background-color .1s; }
.emoji-cell:hover, .emoji-cell:focus-visible { background: var(--n-4); }
.emoji-cell img { width: 30px; height: 30px; object-fit: contain; }
.emoji-empty { padding: 32px 8px; text-align: center; color: var(--t-3); }
.emoji-foot { flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; background: var(--n-2); color: var(--t-1); font-weight: 600; font-size: 14px; }
.emoji-preview-glyph { font-size: 24px; line-height: 1; display: grid; place-items: center; }
.emoji-preview-glyph img { width: 26px; height: 26px; object-fit: contain; }
.emoji-preview-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bouton d'émoji (panneaux de rôles) et listes d'émojis (starboards) */
.emoji-field { display: inline-flex; align-items: center; gap: 2px; }
.emoji-btn { width: 40px; height: 40px; border: 0; border-radius: var(--r); display: grid; place-items: center; background: var(--n-0); cursor: pointer; font-size: 22px; line-height: 1; transition: background-color .12s; }
.emoji-btn:hover, .emoji-btn.open { background: var(--n-3); }
.emoji-btn-empty { filter: grayscale(1); opacity: .45; }
.emoji-glyph.custom { width: 24px; height: 24px; object-fit: contain; }
.emoji-clear { width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--t-3); font-size: 16px; line-height: 1; cursor: pointer; }
.emoji-clear:hover { background: var(--n-3); color: var(--danger); }
.emoji-clear[hidden] { display: none; }
.emoji-chip { font-size: 18px; }
.emoji-chip .emoji-glyph { font-size: 18px; line-height: 1; }
.emoji-chip .emoji-glyph.custom { width: 20px; height: 20px; }
.emoji-add .icon { width: 14px; height: 14px; }
.emoji-inline { display: inline-block; vertical-align: -3px; margin-right: 2px; }
img.emoji-inline { width: 16px; height: 16px; object-fit: contain; }
.dc-text .dc-emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }

/* Guide de mise en forme */
.fmt-guide { display: flex; flex-direction: column; gap: 18px; }
.fmt-intro { margin: 0; font-size: 14px; }
.fmt-group h3 { font-size: 13px; font-weight: 600; color: var(--t-3); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.fmt-group { display: flex; flex-direction: column; gap: 4px; }
.fmt-row {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; align-items: center; width: 100%;
  padding: 9px 12px; border: 0; border-radius: var(--r-sm); background: var(--n-0); color: var(--t-2); font: 14px var(--font); text-align: left; cursor: pointer;
  transition: background-color .15s;
}
.fmt-row:hover { background: var(--n-3); color: var(--t-1); }
.fmt-row code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; color: var(--primary-text); overflow-wrap: anywhere; }
.fmt-tip { font-size: 14px; }
.fmt-title { font-size: 18px; font-weight: 700; color: var(--t-1); margin: 4px 0 -6px; }
.fmt-example { width: 100%; padding: 0; border: 0; border-radius: var(--r); background: var(--n-0); text-align: left; cursor: pointer; transition: background-color .15s; }
.fmt-example:hover { background: var(--n-3); }
.fmt-example pre { margin: 0; padding: 14px 16px; font: 13px/1.6 ui-monospace, 'Cascadia Code', Consolas, monospace; color: var(--t-1); white-space: pre-wrap; overflow-wrap: anywhere; }
.fmt-notes p { margin: 6px 0 0; color: var(--t-2); font-size: 13.5px; }

/* Aperçu : séparateurs, boutons, médias des conteneurs */
.dc-gap { height: 4px; }
.dc-gap.large { height: 16px; }
.dc-gap.visible { height: 9px; background: linear-gradient(rgba(255,255,255,.1), rgba(255,255,255,.1)) center / 100% 1px no-repeat; }
.dc-gap.large.visible { height: 25px; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-link-button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.dc-link-button:hover { background: #6d6f78; }
.dc-ext { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dc-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; }
.dc-gallery.n2, .dc-gallery.n4 { grid-template-columns: 1fr 1fr; }
.dc-gallery.n3 { grid-template-columns: 1fr 1fr 1fr; }
.dc-gallery img { width: 100%; max-height: 260px; object-fit: cover; display: block; background: #2b2d31; }
.dc-gallery img.broken { min-height: 80px; }
@media (max-width: 560px) { .fmt-row { grid-template-columns: 1fr; gap: 4px; } }
.me-msg { display: flex; gap: 14px; }
.me-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: var(--n-3); }
.me-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.me-author { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.me-author strong { color: #fff; font-weight: 600; }
.me-time { color: var(--t-3); font-size: 12px; }

.me-in {
  display: block; width: 100%; border: 0; border-radius: 6px; padding: 4px 8px; margin: 0 -8px; width: calc(100% + 16px);
  background: transparent; color: var(--dc-text); font: inherit; resize: none; line-height: 1.4;
  transition: background-color .12s;
}
textarea.me-in { field-sizing: content; min-height: 30px; overflow: hidden; }
.me-in::placeholder { color: var(--t-3); }
.me-in:hover { background: rgba(255,255,255,.035); }
.me-in:focus { outline: none; background: rgba(255,255,255,.06); }

/* Largeur de l'éditeur de message : suit l'écran, comme un message dans Discord */
.me { --me-w: 820px; }
.me-content-row { max-width: var(--me-w); }
.me-content-row .me-in.me-content { margin: 0; width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--n-0); font-size: 15px; min-height: 46px; }
.me-content-row .me-in.me-content:hover { background: #0b0c0e; }

.me-row { display: grid; grid-template-columns: 34px minmax(0, var(--me-w)) 34px; justify-content: start; gap: 10px; align-items: start; margin-left: -44px; }
.me-tools { display: flex; flex-direction: column; gap: 8px; }
.me-tool {
  width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
  background: var(--n-3); color: var(--t-2); transition: background-color .12s, color .12s;
}
.me-tool .icon { width: 17px; height: 17px; }
.me-tool:hover { background: var(--n-4); color: var(--t-1); }
.me-tool.active { background: var(--primary); color: #fff; }
.me-tool.danger { background: rgb(var(--danger-rgb) / .12); color: var(--danger); }
.me-tool.danger:hover { background: rgb(var(--danger-rgb) / .22); }
.me-color { background: conic-gradient(#f43f5e, #f59e0b, #fee75c, #d8ff80, #06b6d4, #5630ff, #c8bcff, #f43f5e); padding: 0; }
.me-color:hover { background: conic-gradient(#f43f5e, #f59e0b, #fee75c, #d8ff80, #06b6d4, #5630ff, #c8bcff, #f43f5e); filter: brightness(1.1); }
.me-color-dot { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 3px var(--n-3); }
.me-color-dot.none { background: var(--n-3); }

.me-card {
  min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 14px 16px;
  border-radius: 8px; background: var(--n-0); border-left: 4px solid var(--n-5); color: var(--dc-text); font-size: 15px;
}
.me-card.preview { gap: 8px; }
.me-card-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.me-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.me-in.me-header { font-size: 13px; color: var(--dc-muted); }
.me-in.me-title { font-size: 18px; font-weight: 700; color: #fff; }
.me-in.me-footer { font-size: 13px; color: var(--dc-muted); }

.me-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; margin-top: 4px; }
.me-field-inputs { display: flex; flex-direction: column; }
.me-in.me-field-name { font-weight: 700; font-size: 14px; color: #fff; }
.me-in.me-field-value { font-size: 14px; }
.me-x { width: 26px; height: 26px; border: 0; border-radius: 6px; display: grid; place-items: center; background: transparent; color: var(--t-3); cursor: pointer; }
.me-x .icon { width: 14px; height: 14px; }
.me-x:hover { background: var(--n-3); color: var(--danger); }
.me-add-field {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px -2px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: transparent; color: var(--primary-text); font: 600 14px var(--font); cursor: pointer;
}
.me-add-field .icon { width: 15px; height: 15px; }
.me-add-field .icon:last-child { width: 13px; height: 13px; opacity: .7; }

/* Menu « Ajouter » d'un bloc */
.me-add-menu { width: 300px; padding: 6px; gap: 1px; }
.me-add-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; color: var(--t-3); text-transform: uppercase; letter-spacing: .04em; }
.me-add-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--t-2); text-align: left; cursor: pointer; transition: background-color .12s, color .12s;
}
.me-add-item .icon { width: 18px; height: 18px; color: var(--t-3); flex: none; }
.me-add-item span { display: flex; flex-direction: column; min-width: 0; }
.me-add-item strong { font: 500 14px var(--font); color: var(--t-1); }
.me-add-item small { font-size: 12px; color: var(--t-3); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.me-add-item:hover:not(:disabled), .me-add-item:focus-visible { background: var(--n-4); }
.me-add-item:hover:not(:disabled) .icon { color: var(--primary-text); }
.me-add-item:disabled { opacity: .45; cursor: not-allowed; }
.me-add-field:hover { background: var(--primary-soft); }

.me-img {
  position: relative; display: grid; place-items: center; border: 1.5px dashed var(--n-5); border-radius: 8px; background: transparent;
  color: var(--t-3); cursor: pointer; overflow: hidden; padding: 0; transition: background-color .12s, color .12s, border-color .12s;
}
.me-img .icon { width: 26px; height: 26px; }
.me-img:hover { background: rgba(255,255,255,.03); color: var(--t-2); border-color: var(--t-3); }
.me-img.filled { border-style: none; }
.me-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-img-edit { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; opacity: 0; transition: opacity .12s; }
.me-img-edit .icon { width: 20px; height: 20px; }
.me-img:hover .me-img-edit, .me-img:focus-visible .me-img-edit { opacity: 1; }
.me-thumb { width: 80px; height: 80px; }
.me-image { width: 100%; height: 140px; margin: 6px 0 4px; }
.me-image.filled { height: auto; max-height: 260px; }

.me-empty-preview { color: var(--t-3); font-size: 14px; font-style: italic; }

.me-links { display: flex; flex-wrap: wrap; gap: 8px; }
.me-linkbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px;
  background: #4e5058; color: #fff; font: 500 14px var(--font); cursor: pointer; transition: background-color .12s;
}
.me-linkbtn .icon { width: 14px; height: 14px; opacity: .8; }
.me-linkbtn:hover, .me-linkbtn.open { background: #5d5f68; }

.me-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: var(--me-w); }
.me-count { margin-left: auto; font-size: 12px; color: var(--t-3); font-variant-numeric: tabular-nums; }
.me-count.over { color: var(--danger); }
.me-add-link {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: var(--me-w); height: 46px; padding: 0 14px;
  border: 1.5px dashed var(--n-5); border-radius: 10px; background: transparent; color: var(--t-2); font: 500 15px var(--font); cursor: pointer;
  transition: background-color .12s, color .12s, border-color .12s;
}
.me-add-link .icon { width: 20px; height: 20px; }
.me-add-link:hover { background: rgba(255,255,255,.03); color: var(--t-1); border-color: var(--t-3); }

.me-pop { width: 320px; padding: 14px; gap: 8px; }
.me-pop-title { font-size: 14px; font-weight: 600; color: var(--t-1); }
.me-pop-label { font-size: 12px; color: var(--t-3); margin-top: 2px; }
.me-pop-hint { font-size: 12px; color: var(--t-3); }
.me-pop-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.me-choice {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--n-2);
  color: var(--t-1); font: 500 13px var(--font); cursor: pointer; text-align: left;
}
.me-choice img, .me-choice .icon { width: 22px; height: 22px; border-radius: 50%; flex: none; object-fit: cover; }
.me-choice:hover { background: var(--n-4); }
.me-choice.active { background: var(--primary-soft-2); color: var(--primary-text); }
.danger-text { color: var(--danger) !important; align-self: flex-start; }
.danger-text:hover { background: rgb(var(--danger-rgb) / .12) !important; }

@media (max-width: 720px) {
  .me-row { margin-left: 0; grid-template-columns: minmax(0, 1fr); }
  .me-row .me-tools { flex-direction: row; }
  .me-content-row { max-width: none; }
}

/* ───────────────────────── Bot personnalisé ───────────────────────── */
.cb { display: flex; flex-direction: column; gap: 16px; }
.cb .page-head { margin-bottom: 8px; }
.cb-steps { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cb-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.cb-step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft-2); color: var(--primary-text); font-weight: 700; font-size: 13px; }
.cb-step strong { color: var(--t-1); font-weight: 600; }
.cb-step p { margin: 2px 0 0; color: var(--t-2); font-size: 14px; line-height: 1.5; }
.cb-step a { color: var(--primary-text); text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.cb-step a .icon { width: 13px; height: 13px; }
.cb-step a:hover { text-decoration: underline; }
.cb-token { display: flex; gap: 10px; max-width: 640px; align-items: stretch; }
.cb-token .btn { height: auto; }
.cb-token .input { flex: 1; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.cb-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.cb-note .icon { width: 15px; height: 15px; flex: none; }

.cb-status { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 14px; background: var(--n-2); }
.cb-status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--t-3); }
.cb-status-text { flex: 1; min-width: 0; }
.cb-status-text strong { color: var(--t-1); font-size: 15px; }
.cb-status-text p { margin: 2px 0 0; color: var(--t-2); font-size: 14px; }
.cb-status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cb-status.tone-ok .cb-status-dot { background: var(--success); box-shadow: 0 0 0 4px rgb(var(--success-rgb) / .18); }
.cb-status.tone-wait .cb-status-dot { background: var(--primary); animation: cb-pulse 1.2s ease-in-out infinite; }
.cb-status.tone-warn { background: rgb(245 158 11 / .1); }
.cb-status.tone-warn .cb-status-dot { background: #f59e0b; }
.cb-status.tone-err { background: rgb(var(--danger-rgb) / .1); }
.cb-status.tone-err .cb-status-dot { background: var(--danger); }
@keyframes cb-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cb-status.tone-wait .cb-status-dot { animation: none; } }

.cb-grid { display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(0, 300px); gap: 28px; align-items: start; }
.cb-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cb-avatar { position: relative; width: 140px; height: 140px; padding: 0; border: 0; border-radius: 24px; overflow: hidden; cursor: pointer; background: var(--n-3); display: block; }
.cb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-avatar-edit { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(0,0,0,.55); color: #fff; font: 600 13px var(--font); opacity: 0; transition: opacity .12s; }
.cb-avatar-edit .icon { width: 20px; height: 20px; }
.cb-avatar:hover .cb-avatar-edit, .cb-avatar:focus-visible .cb-avatar-edit { opacity: 1; }

.cb-ava { position: relative; width: 36px; height: 36px; flex: none; }
.cb-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--n-3); }
.cb-presence { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 3px var(--n-0); background: #23a55a; }
.cb-presence.idle { background: #f0b232; }
.cb-presence.dnd { background: #f23f43; }
.cb-presence.invisible { background: #80848e; }
.cb-ava.lg { width: 84px; height: 84px; margin-top: -48px; }
.cb-ava.lg img { box-shadow: 0 0 0 6px #111214; }
.cb-ava.lg .cb-presence { width: 20px; height: 20px; right: 2px; bottom: 2px; box-shadow: 0 0 0 5px #111214; }

.cb-member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--n-0); }
.cb-member-text { min-width: 0; }
.cb-name { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-name.lg { font-size: 20px; font-weight: 700; margin-top: 10px; }
.cb-activity-line { color: var(--dc-muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-profile { border-radius: 12px; overflow: hidden; background: #111214; }
.cb-banner { height: 64px; background: linear-gradient(120deg, var(--primary), #c8bcff); }
.cb-profile-body { padding: 0 16px 16px; }
.cb-tag { color: var(--dc-muted); font-size: 14px; margin-top: 2px; }
.cb-activity-card { margin-top: 14px; padding: 12px; border-radius: 8px; background: var(--n-2); }
.cb-activity-type { color: var(--dc-muted); font-size: 12px; font-weight: 600; }
.cb-activity-text { color: #fff; font-size: 14px; font-weight: 600; margin-top: 4px; word-break: break-word; }

.cb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cb-actions .spacer { flex: 1; }
.cb-actions + div:not(:empty) { margin-top: 16px; }

@media (max-width: 1100px) { .cb-grid { grid-template-columns: 140px minmax(0, 1fr); } .cb-grid .cb-col:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .cb-grid, .cb-grid .cb-col:last-child { grid-template-columns: 1fr; } .cb-token { flex-direction: column; } }

/* ───────────────────────── Fenêtre modale ───────────────────────── */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px; background: rgb(8 6 18 / .72); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; border-radius: 18px; background: var(--n-2); box-shadow: var(--shadow-float); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--t-1); }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--t-2); cursor: pointer; }
.modal-close:hover { background: var(--n-3); color: var(--t-1); }
.modal-close .icon { width: 18px; height: 18px; }
.modal-body { padding: 12px 24px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }

/* Kivo, la mascotte */
.login-kivo { width: 150px; height: auto; display: block; margin: 0 auto 4px; }
.kivo-empty { width: 140px; height: auto; }

/* ───────────────────────── Niveaux (façon MEE6) ───────────────────────── */
.rank-card-frame { border-radius: 10px; overflow: hidden; background: var(--n-0); aspect-ratio: 934 / 282; }
/* Aperçus de cartes dans les pages : taille réduite, comme sur MEE6 */
.rank-card-frame.compact { max-width: 480px; }
.rank-card-img { display: block; width: 100%; height: auto; transition: opacity .15s; }
.rank-card-img.loading { opacity: .6; }

.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.reward { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--n-0); }
.reward-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--n-3); color: var(--t-1); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.reward-del { width: 30px; height: 30px; border: 0; border-radius: 8px; display: grid; place-items: center; background: rgb(var(--danger-rgb) / .12); color: var(--danger); cursor: pointer; flex: none; }
.reward-del:hover { background: rgb(var(--danger-rgb) / .22); }
.reward-del .icon { width: 15px; height: 15px; }
.reward-level { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 9px; background: var(--n-2); color: var(--t-3); font-size: 14px; cursor: text; }
.reward-level input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--t-1); font: 600 15px var(--font); outline: none; }
.reward-level:focus-within { box-shadow: 0 0 0 2px var(--primary-soft-2); }

/* Curseur (taux d'XP, opacité) */
.range { --p: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--p), var(--n-4) var(--p)); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--p), var(--n-4) var(--p)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.range::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--primary-soft-2); }
.rate { max-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.rate-ticks { display: flex; justify-content: space-between; margin: 0 2px; font-size: 12px; color: var(--t-3); font-variant-numeric: tabular-nums; }
.rate-ticks span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.rate-ticks span.on { color: var(--t-1); font-weight: 600; }

/* ───────────── Classement (dashboard + page publique) ───────────── */
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 70px 70px 48px; gap: 14px; align-items: center;
  padding: 10px 14px; border-radius: 12px; background: var(--n-2); transition: background-color .12s;
}
.lb-row.with-actions { grid-template-columns: 36px minmax(0, 1fr) 70px 70px 48px auto; }
.lb-row:not(.lb-head):hover { background: var(--n-3); }
.lb-row.me { background: var(--primary-soft); }
.lb-head { background: transparent; padding-top: 0; padding-bottom: 0; color: var(--t-3); font-size: 12px; }
.lb-head .icon { width: 16px; height: 16px; }
.lb-head .lb-col-user { display: flex; padding-left: 4px; }
.lb-level-head { text-align: center; font-weight: 600; }
.lb-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--n-4); color: var(--t-1); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-rank.top1 { background: linear-gradient(135deg, #ffe27a, #f5b400); color: #3a2800; }
.lb-rank.top2 { background: linear-gradient(135deg, #eef1f6, #a9b3c2); color: #252a33; }
.lb-rank.top3 { background: linear-gradient(135deg, #f3b98a, #c9783f); color: #3a1d08; }
.lb-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t-1); font-weight: 600; font-size: 14px; }
.lb-stat { display: flex; justify-content: flex-end; color: var(--t-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-ring { position: relative; display: grid; place-items: center; justify-self: center; }
.lb-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lb-ring-track { fill: none; stroke: var(--n-4); stroke-width: 3.5; }
.lb-ring-fill { fill: none; stroke: var(--primary); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.lb-row.podium .lb-ring-fill { stroke: var(--success); }
.lb-ring span { position: relative; color: var(--t-1); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-actions { display: flex; gap: 6px; }
.lb-act { width: 32px; height: 32px; border: 0; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: background-color .12s; }
.lb-act .icon { width: 16px; height: 16px; }
.lb-act.add { background: rgb(var(--success-rgb) / .12); color: var(--success); }
.lb-act.add:hover { background: rgb(var(--success-rgb) / .22); }
.lb-act.remove { background: rgb(var(--danger-rgb) / .12); color: var(--danger); }
.lb-act.remove:hover { background: rgb(var(--danger-rgb) / .22); }
.lb-search { max-width: 360px; }
.lb-none { padding: 18px 14px; }
.xp-who { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--n-0); }
.xp-who strong { color: var(--t-1); }
.xp-input { font-size: 18px; font-weight: 600; -moz-appearance: textfield; }
.xp-input::-webkit-outer-spin-button, .xp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 640px) {
  .lb-row, .lb-row.with-actions { grid-template-columns: 30px minmax(0, 1fr) 44px auto; gap: 10px; }
  .lb-row .lb-stat { display: none; }
  .lb-row:not(.with-actions) { grid-template-columns: 30px minmax(0, 1fr) 44px; }
}

/* Page « Classement » du dashboard (paramètres) */
.lbs { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.lbs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.lbs-head p { margin: 6px 0 0; color: var(--t-2); font-size: 14px; }
.lbs-block { display: flex; align-items: center; gap: 20px; padding: 18px 20px; border-radius: 12px; background: var(--n-1); }
.lbs-block .text { flex: 1; min-width: 0; }
.lbs-block h3 { font-size: 15px; }
.lbs-block p { margin: 4px 0 0; color: var(--t-2); font-size: 13.5px; }
.lbs-url {
  display: flex; align-items: center; max-width: 520px; min-height: 46px; padding: 0 14px; border-radius: var(--r);
  background: var(--n-0); cursor: text; transition: box-shadow .15s;
}
.lbs-url:focus-within { box-shadow: 0 0 0 2px rgb(var(--primary-rgb) / .35); }
.lbs-url-prefix { color: var(--t-3); font-size: 15px; white-space: nowrap; }
.lbs-slug-input { flex: 1; min-width: 60px; height: 44px; border: 0; background: transparent; color: var(--t-1); font: 600 15px var(--font); outline: none; padding: 0 0 0 2px; }
.lbs-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.lbs-link { color: var(--primary-text); overflow-wrap: anywhere; }

/* Page publique du classement */
.lb-page .topbar { position: sticky; }
.lbp { max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }
.lbp-me { color: var(--t-1); font-weight: 600; font-size: 14px; padding-right: 6px; }
.lbp-hero { position: relative; margin-bottom: 60px; }
.lbp-banner {
  position: relative; height: 240px; border-radius: 0 0 18px 18px; overflow: hidden;
  background: radial-gradient(120% 140% at 15% 0%, #8f7bff 0%, transparent 55%), radial-gradient(90% 120% at 90% 100%, #c8bcff55 0%, transparent 60%), var(--primary);
}
.lbp-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lbp-back {
  position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px;
  background: rgb(15 12 29 / .75); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; backdrop-filter: blur(6px);
}
.lbp-back .icon { width: 15px; height: 15px; }
.lbp-back:hover { background: rgb(15 12 29 / .9); }
.lbp-icon {
  position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%); width: 104px; height: 104px; border-radius: 22px; object-fit: cover;
  box-shadow: 0 0 0 5px var(--n-1), var(--shadow-float); background: var(--n-3);
}
.lbp-icon.initials { display: grid; place-items: center; color: var(--t-1); font-size: 30px; font-weight: 700; }
.lbp-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.lbp-title > div { display: flex; flex-direction: column; gap: 4px; }
.lbp-title h1 { font-size: 30px; font-weight: 700; }
.lbp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.lbp-aside { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 14px; }
.lbp-side { margin: 0; }
.lbp-side .panel-head { padding: 18px 20px; }
.lbp-side .panel-body { padding: 0 20px 18px; }
.lbp-tools { display: flex; flex-direction: column; gap: 2px; }
.lbp-tool {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--t-2); font: 500 14px var(--font); text-align: left; cursor: pointer; transition: background-color .12s, color .12s;
}
.lbp-tool .icon { width: 18px; height: 18px; color: var(--t-3); }
.lbp-tool:hover { background: var(--n-3); color: var(--t-1); }
.lbp-tool.danger, .lbp-tool.danger .icon { color: var(--danger); }
.lbp-tool.danger:hover { background: rgb(var(--danger-rgb) / .12); }
.lbp-rewards { display: flex; flex-direction: column; gap: 14px; }
.lbp-reward-level { margin-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--t-3); text-transform: uppercase; letter-spacing: .05em; }
.lbp-how p { margin: 0 0 8px; color: var(--t-2); font-size: 14px; line-height: 1.55; }
.lbp-more { display: flex; margin: 16px auto 0; }
.lbp-more[hidden] { display: none; }
.lbp-error { padding-top: 80px; }
@media (max-width: 900px) {
  .lbp-grid { grid-template-columns: 1fr; }
  .lbp-aside { position: static; order: -1; }
  .lbp { padding: 0 12px 60px; }
  .lbp-banner { height: 160px; }
}

.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cmd-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--n-0); }
.cmd-item strong { color: var(--primary-text); font-size: 14px; }
.cmd-item span { color: var(--t-2); font-size: 13px; }
/* Tickets, statistiques, économie */
.state-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(216,255,128,.12); color: #D8FF80; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.stat-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--n-0); }
.stat-row .icon-tile-sm { flex: none; margin-top: 22px; }
.stat-row > .btn { margin-top: 22px; flex: none; }
.stat-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.state-pill.muted { background: var(--n-3); color: var(--t-2); }

/* Tickets : liste des panneaux et éditeur */
.tk-table { display: grid; gap: 8px; }
.tk-head, .tk-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.2fr) 40px; align-items: center; gap: 12px; }
.tk-head { padding: 0 18px; color: var(--t-3); font-size: 12.5px; font-weight: 500; }
.tk-row { padding: 14px 18px; border-radius: var(--r); background: var(--n-0); cursor: pointer; transition: background-color .15s; }
.tk-row:hover { background: var(--n-1); }
.tk-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-name strong { color: var(--t-1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-name .subtle { font-size: 13px; }
.tk-time { color: var(--t-1); font-size: 14px; }
.subpage-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--t-3); cursor: text; }
.subpage-title .icon { width: 18px; height: 18px; flex: none; }
.subpage-title-input { min-width: 0; width: 100%; max-width: 520px; border: 0; outline: 0; background: none; color: var(--t-1); font: inherit; font-size: 22px; font-weight: 600; padding: 4px 6px; border-radius: var(--r-sm); }
.subpage-title-input:hover, .subpage-title-input:focus { background: var(--n-1); }
.tk-types { display: flex; flex-direction: column; gap: 10px; }
.tk-type { display: flex; align-items: center; gap: 10px; }
.tk-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; height: 40px; padding: 0 16px; border: 0; border-radius: 8px; color: #fff; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: filter .15s, opacity .15s; }
.tk-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-btn:hover { filter: brightness(1.1); }
.tk-btn.style-primary { background: #5865F2; }
.tk-btn.style-secondary { background: #4E5058; }
.tk-btn.style-success { background: #248046; }
.tk-btn.style-danger { background: #DA373C; }
.tk-btn.off { opacity: .45; }
.tk-type.selected .tk-btn { box-shadow: 0 0 0 2px var(--n-0), 0 0 0 4px var(--t-1); }
.tk-editor { display: grid; gap: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--n-0); }
.tk-editor-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.tk-colors { display: flex; gap: 8px; height: 44px; align-items: center; padding: 0 12px; border-radius: var(--r); background: var(--n-2); }
.tk-color { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; transition: transform .1s; }
.tk-color:hover { transform: scale(1.12); }
.tk-color .icon { width: 13px; height: 13px; stroke-width: 3; }
.tk-add { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: 0; border-radius: var(--r); background: var(--n-0); color: var(--t-2); font: inherit; font-size: 14px; cursor: pointer; transition: background-color .15s, color .15s; }
.tk-add:hover { background: var(--n-1); color: var(--t-1); }
@media (max-width: 760px) {
  .tk-head { display: none; }
  .tk-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .tk-time { display: none; }
  .tk-editor-row { grid-template-columns: 1fr; }
}
/* Salons temporaires : Hubs */
.new-hub { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 18px; padding: 22px 24px; border: 0; border-radius: var(--r-lg, 14px); background: var(--n-1); color: var(--t-1); font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.new-hub:hover { background: var(--n-2); }
.new-hub .icon { width: 20px; height: 20px; color: var(--t-2); }
.hub-row { grid-template-columns: minmax(0, 1fr) 40px; }
.hub-preview { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-sm); background: var(--n-2); color: var(--t-1); font-size: 14px; font-weight: 500; }
.hub-preview .icon { width: 16px; height: 16px; color: var(--t-2); }
.check-row.align-top { align-items: flex-start; }
.check-row.align-top .switch { margin-top: 2px; }
.slider { display: grid; gap: 6px; }
.slider-top { display: flex; justify-content: flex-end; }
.slider-value { color: var(--primary-text); font-size: 13px; font-weight: 600; }
.slider-marks { position: relative; height: 16px; margin: 0 9px; color: var(--t-3); font-size: 11.5px; }
.slider-marks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
/* Modération */
.mod-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; position: relative; padding-top: 22px; }
.mod-stats-label { position: absolute; top: 0; left: 2px; font-size: 12.5px; }
.mod-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--n-1); box-shadow: inset 3px 0 0 var(--c); }
.mod-stat strong { font-size: 26px; font-weight: 700; color: var(--t-1); line-height: 1.1; }
.mod-stat span { color: var(--t-2); font-size: 13px; }
.mod-toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.mod-search { max-width: 520px; }
.mod-filters .chip { height: 30px; }
.mod-list { display: grid; gap: 6px; }
.mod-row { display: grid; grid-template-columns: 56px 170px minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1fr) 120px; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--n-0); font-size: 14px; }
.mod-row.warn-row { grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 1.8fr) minmax(0, 1fr) 120px 40px; }
.mod-row.mod-head { background: none; padding-block: 0 2px; color: var(--t-3); font-size: 12.5px; font-weight: 500; }
.mod-id { font-variant-numeric: tabular-nums; }
.mod-person { display: flex; flex-direction: column; min-width: 0; }
.mod-person > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-person .subtle { font-size: 12px; }
.mod-reason { color: var(--t-1); overflow-wrap: anywhere; }
.mod-date { color: var(--t-2); white-space: nowrap; }
.mod-sub { font-size: 12px; margin-top: 4px; }
.mod-badge { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mod-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.mod-dot-on { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: #D8FF80; vertical-align: middle; }
.mod-custom { display: grid; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--n-0); }
@media (max-width: 980px) {
  .mod-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-row, .mod-row.warn-row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .mod-row.mod-head { display: none; }
  .mod-row .mod-reason { grid-column: 1 / -1; }
}

/* Économie */
.eco-currency { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.eco-icon { display: flex; align-items: center; justify-content: center; width: 100px; height: 100px; border-radius: var(--r); background: var(--n-0); flex: none; }
.eco-icon .eco-coin { font-size: 52px; line-height: 1; }
.eco-icon img.eco-coin { width: 56px; height: 56px; }
.eco-coin { font-size: 15px; line-height: 1; }
img.eco-coin { width: 16px; height: 16px; vertical-align: -2px; }
.eco-boost { grid-template-columns: minmax(0, 1fr) auto 40px; }
.eco-items { display: flex; flex-wrap: wrap; gap: 12px; }
.eco-item { display: flex; flex-direction: column; width: 140px; height: 140px; padding: 0; border: 0; border-radius: var(--r); background: var(--n-0); color: var(--t-1); font: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: background-color .15s, transform .1s; }
.eco-item:hover { background: var(--n-1); }
.eco-add { align-items: center; justify-content: center; color: var(--t-2); }
.eco-add .icon { width: 36px; height: 36px; }
.eco-item-head { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px 0; font-size: 12.5px; }
.eco-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eco-item-head span { color: var(--t-3); white-space: nowrap; }
.eco-item-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px 10px; font-size: 12.5px; text-align: center; color: var(--t-2); overflow: hidden; }
.eco-item-body > span:not(.role-pill) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.eco-item-body img { max-width: 100%; max-height: 64px; object-fit: contain; border-radius: 6px; }
.eco-image-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.eco-image-box { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 12px; background: var(--n-1); color: var(--t-3); flex: none; overflow: hidden; }
.eco-image-box img { width: 100%; height: 100%; object-fit: contain; }
.eco-item-price { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; background: var(--n-2); font-size: 13px; font-weight: 600; }
.eco-bet { display: flex; align-items: center; gap: 10px; }
.eco-sub { margin: 0; font-size: 14px; font-weight: 600; color: var(--t-1); }
.panel.panel-danger { box-shadow: inset 0 0 0 1px rgba(218, 55, 60, .55); }
.shop-item { display: grid; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--n-0); }
@media (max-width: 760px) {
  .stat-fields { grid-template-columns: 1fr; }
  .stat-row .icon-tile-sm { display: none; }
}
.cmd-item.cmd-toggle { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.cmd-toggle .cmd-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmd-toggle.off .cmd-text { opacity: .5; }
.cmd-toggle .switch span { color: inherit; font-size: inherit; }

/* Éditeur de carte */
.rc-editor { display: flex; flex-direction: column; gap: 18px; }
.rc-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 16px; align-items: start; }
.rc-swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--n-0); }
.rc-swatch { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); transition: transform .1s; }
.rc-swatch:hover { transform: scale(1.12); }
.rc-swatch.active { box-shadow: 0 0 0 2px var(--n-0), 0 0 0 4px var(--t-1); }
.rc-custom { background: conic-gradient(#f43f5e, #f59e0b, #fee75c, #d8ff80, #06b6d4, #5630ff, #c8bcff, #f43f5e); position: relative; }
.rc-custom.active::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--c); }
.rc-opacity .range { margin-top: 8px; }
.rc-bgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rc-bg { position: relative; aspect-ratio: 311 / 94; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--n-0); color: var(--t-2); font: 500 13px var(--font); display: flex; align-items: center; justify-content: center; gap: 8px; }
.rc-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-bg:hover { filter: brightness(1.12); }
.rc-bg.active { box-shadow: 0 0 0 3px var(--primary); }
.rc-upload { background: transparent; border: 1.5px dashed var(--n-5); }
.rc-upload .icon { width: 18px; height: 18px; }
.rc-upload:hover { border-color: var(--t-3); color: var(--t-1); filter: none; }
@media (max-width: 720px) { .rc-row { grid-template-columns: 1fr; } .rc-bgs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ───────────────────────── Licences ───────────────────────── */
.status-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill.on { background: rgb(var(--success-rgb) / .14); color: var(--success); }
.status-pill.off { background: rgb(var(--danger-rgb) / .14); color: var(--danger); }
.lock-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--n-3); color: var(--t-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.lock-pill .icon { width: 15px; height: 15px; }
.nav a.locked { color: var(--t-3); }
.nav-lock { order: 3; margin-left: auto; display: flex; color: var(--t-3); }
.nav-lock .icon { width: 13px; height: 13px; }
.module-card.locked { opacity: .6; }
.module-card .state.locked { display: inline-flex; align-items: center; gap: 6px; background: var(--n-3); color: var(--t-3); cursor: default; }
.module-card .state.locked:hover { background: var(--n-3); color: var(--t-3); }
/* Badge de formule, à la couleur choisie dans Administration → Formules (--plan) */
.plan-badge { --plan: #5630FF; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; vertical-align: middle;
  background: color-mix(in srgb, var(--plan) 22%, transparent); color: color-mix(in srgb, var(--plan) 50%, #F7F5FF); }
.plan-badge .icon { width: 13px; height: 13px; }
.plan-badge.lg { padding: 5px 12px; font-size: 13.5px; }
.plan-badge.lg .icon { width: 15px; height: 15px; }
.plan-badge.none { background: var(--n-3); color: var(--t-3); }
.server-info .server-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.server-info .server-sub .plan-badge { font-size: 11.5px; color: color-mix(in srgb, var(--plan) 50%, #F7F5FF); }
.server-info .server-sub .plan-badge.none { color: var(--t-3); }
.hero-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.icon-tile-sm[style*="--plan"] { background: color-mix(in srgb, var(--plan) 20%, transparent); color: color-mix(in srgb, var(--plan) 50%, #F7F5FF); }
.lic-desc { margin: 4px 0 2px; }
.lic-head h3 { margin-bottom: 4px; }

/* Bloc « Licence » du tableau de bord */
.license-panel { --plan: #5630FF; display: flex; align-items: center; flex-wrap: wrap; gap: 20px 32px; margin: -24px 0 40px; padding: 20px 24px; border-radius: var(--r-lg);
  background: linear-gradient(100deg, color-mix(in srgb, var(--plan) 16%, var(--n-2)) 0%, var(--n-2) 55%); }
.license-panel .icon-tile-sm { background: color-mix(in srgb, var(--plan) 24%, transparent); color: color-mix(in srgb, var(--plan) 50%, #F7F5FF); }
.license-main { display: flex; align-items: flex-start; gap: 14px; flex: 1 1 280px; min-width: 0; }
.license-main p { margin: 6px 0 0; }
.license-main > div:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.license-label { color: var(--t-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.license-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.license-fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: var(--r); background: var(--n-1); min-width: 110px; }
.license-fact span { color: var(--t-3); font-size: 12px; }
.license-fact strong { color: var(--t-1); font-size: 14px; font-weight: 600; }
.license-holder { display: inline-flex; align-items: center; gap: 7px; }
.license-holder img { width: 20px; height: 20px; border-radius: 50%; flex: none; }

/* Couleur d'une formule (fenêtre Administration) */
.plan-color-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.plan-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-swatch { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; transition: transform .12s; }
.plan-swatch:hover { transform: scale(1.08); }
.plan-swatch.active { transform: scale(1.12); }
.plan-swatch .icon { width: 15px; height: 15px; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
.plan-swatch.custom { background: var(--n-3); color: var(--t-2); }
.plan-swatch.custom .icon { width: 14px; height: 14px; }
/* Couronne des licences (image, garde ses couleurs) */
.crown { width: 15px; height: auto; flex: none; object-fit: contain; display: inline-block; }
.plan-badge .crown { width: 14px; }
.plan-badge.lg .crown { width: 16px; }
.nav-lock .crown { width: 14px; }
.lock-pill .crown, .module-card .state.locked .crown { width: 15px; }
.icon-tile-sm .crown { width: 22px; }
.btn .crown { width: 16px; }
.crown.xl { width: 72px; margin-bottom: 4px; }
.nav a .crown.nav-crown { width: 18px; }
.crown.plan-icon { height: auto; aspect-ratio: 1; object-fit: contain; }
.plan-icon-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.plan-icon-box { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: var(--n-1); flex: none; }
.crown.plan-icon-xl { width: 44px; }
.sidebar-license { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: var(--n-2); text-decoration: none; transition: background-color .15s; }
.sidebar-license:hover { background: var(--n-3); }
.sidebar-license-state { color: var(--success); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.module-card.locked .crown { opacity: 1; }
.locked-page { min-height: 50vh; justify-content: center; }
.locked-page .muted { max-width: 520px; }

/* Serveur sans licence */
.nolic { max-width: 620px; margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.nolic-kivo { width: 150px; height: auto; }
.nolic h1 { font-size: 28px; }
.nolic-text { margin: 0; font-size: 15px; line-height: 1.6; }
.nolic-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.nolic-actions p { margin: 0 0 6px; }
.nolic-license { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 12px; background: var(--n-2); text-align: left; }
.nolic-license > div { display: flex; flex-direction: column; gap: 2px; }
.nolic-license strong { color: var(--t-1); }

/* Mes licences */
.narrow-page { max-width: 900px; margin: 0 auto; }
.lic-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.lic-head { display: flex; align-items: center; gap: 14px; }
.lic-head .text { flex: 1; min-width: 0; }
.lic-guilds { display: flex; flex-direction: column; gap: 6px; }
.lic-guild .btn .icon { width: 15px; height: 15px; }
/* Langues : drapeaux ronds */
.flag { width: 22px; height: 22px; border-radius: 50%; flex: none; display: block; }
.flag.lg { width: 30px; height: 30px; }
.lang-switch { position: relative; }
.lang-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--n-2); cursor: pointer; transition: background-color .15s; }
.lang-btn:hover { background: var(--n-3); }
.lang-btn .flag { width: 24px; height: 24px; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 180px; padding: 6px; border-radius: 14px; background: var(--n-2); box-shadow: 0 12px 32px rgb(0 0 0 / .35); }
.lang-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--t-1); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.lang-item:hover { background: var(--n-3); }
.lang-item span { flex: 1; }
.lang-item .icon { width: 16px; height: 16px; color: var(--primary-text); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.lang-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-choice { display: flex; align-items: center; gap: 12px; min-width: 200px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--n-1); color: var(--t-1); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.lang-choice:hover { background: var(--n-3); }
.lang-choice.active { background: var(--primary-soft); }
.lang-choice span { flex: 1; text-align: left; }
.lang-choice .icon { width: 18px; height: 18px; color: var(--primary-text); }

/* Fenêtre « Activer Kivo » (Administration → Serveurs) */
.activate-step { display: flex; flex-direction: column; gap: 10px; }
.activate-step h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.activate-step > p { margin: -4px 0 0; }
.step-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 700; flex: none; }
.choice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--n-1); color: var(--t-1); font: inherit; text-align: left; cursor: pointer; transition: background-color .15s; }
.choice:hover { background: var(--n-3); }
.choice.selected { background: var(--primary-soft); }
.choice .avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.choice-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--n-3); color: var(--t-2); flex: none; }
.choice-icon .icon { width: 15px; height: 15px; }
.choice-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 1; min-width: 0; }
.choice-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.choice-text small { color: var(--t-3); font-size: 12px; }
.choice-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--n-3); flex: none; }
.choice.selected .choice-check { background: var(--primary); color: #fff; }
.choice-check .icon { width: 13px; height: 13px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--n-1); align-self: flex-start; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--t-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--t-1); }
.seg button.active { background: var(--n-3); color: var(--t-1); }
.activate-summary { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--t-1); font-size: 13.5px; line-height: 1.5; }
.activate-summary .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--primary-text); }

/* Fenêtre « Transférer la licence » */
.transfer-flow { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px; border-radius: var(--r-lg); background: var(--n-1); }
.transfer-guild { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; text-align: center; }
.transfer-guild strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t-1); }
.transfer-guild .guild-icon { width: 40px; height: 40px; }
.transfer-empty { display: grid; place-items: center; background: var(--n-3); color: var(--t-3); }
.transfer-empty .icon { width: 18px; height: 18px; }
.transfer-arrow { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.transfer-arrow .icon { width: 18px; height: 18px; }
.lic-guild { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--n-1); }
.lic-guild .name { flex: 1; min-width: 0; color: var(--t-1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lic-add .dd, .lic-add .select { width: auto; min-width: 260px; }

/* Administration */
.admin-page .tabs button { display: inline-flex; align-items: center; gap: 8px; }
.admin-page .tabs .icon { width: 16px; height: 16px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.admin-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border: 0; border-radius: var(--r-lg); background: var(--n-2); text-align: left; cursor: pointer; transition: background-color .15s; }
.admin-stat:hover { background: var(--n-3); }
.admin-stat strong { margin-top: 6px; color: var(--t-1); font-size: 26px; font-weight: 700; }
.admin-stat > span:last-child { color: var(--t-2); font-size: 13px; }
.admin-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-search { max-width: 420px; }
.admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--n-2); }
.admin-row.banned { opacity: .65; }
.admin-row.clickable { cursor: pointer; transition: background-color .15s; }
.admin-row.clickable:hover { background: var(--n-3); }
.admin-row.compact { padding: 10px 14px; background: var(--n-1); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--primary-text); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-filter { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--n-2); color: var(--t-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.admin-filter:hover { background: var(--n-3); }
.admin-filter.active { background: var(--primary); color: #fff; }
.admin-filter span { padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / .2); font-size: 12px; }
.admin-bot { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 5px; border-radius: 8px; background: var(--n-3); color: var(--t-1); font-size: 13px; }
.admin-bot img, .admin-bot .icon { width: 18px; height: 18px; border-radius: 50%; }
.admin-bot small { color: var(--t-3); font-size: 11.5px; }
.admin-bot.on small { color: var(--success); }
.user-sheet { display: flex; flex-direction: column; gap: 22px; }
.user-sheet-head { display: flex; align-items: center; gap: 16px; }
.user-sheet-head .avatar { width: 56px; height: 56px; border-radius: 50%; }
.user-sheet-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.user-sheet-section { display: flex; flex-direction: column; gap: 10px; }
.user-sheet-section h3 { font-size: 15px; }
.user-sheet-section .admin-list { gap: 6px; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-title strong { color: var(--t-1); }
.admin-note { color: var(--t-2); font-size: 13px; font-style: italic; }
.admin-meta { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.admin-meta strong { color: var(--t-1); font-size: 16px; }
.admin-meta span { color: var(--t-3); font-size: 12px; }
.admin-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-empty { padding: 20px; }
.admin-guilds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.admin-guild { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 4px; border-radius: 8px; background: var(--n-3); color: var(--t-1); font-size: 13px; max-width: 240px; }
.admin-guild > span:not(.guild-icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-guild .guild-icon { border-radius: 6px; font-size: 9px; }
.admin-guild button { display: flex; border: 0; background: none; padding: 0; color: var(--t-3); cursor: pointer; }
.admin-guild button:hover { color: var(--danger); }
.admin-guild button .icon { width: 14px; height: 14px; }
.admin-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.admin-plan { margin: 0; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.admin-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-plan-head p { margin: 4px 0 0; }
.admin-plan-facts { display: flex; flex-direction: column; gap: 6px; color: var(--t-2); font-size: 13px; }
.admin-plan-facts span { display: inline-flex; align-items: center; gap: 8px; }
.admin-plan-facts .icon { width: 16px; height: 16px; color: var(--t-3); }
.admin-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.admin-modules[hidden] { display: none; }
.admin-module { padding: 10px 12px; border-radius: var(--r-sm); background: var(--n-0); cursor: pointer; }
.admin-module input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.admin-module span { display: flex; flex-direction: column; color: var(--t-1); font-size: 14px; }
.admin-module small { color: var(--t-3); font-size: 12px; }
@media (max-width: 760px) {
  .admin-row { flex-wrap: wrap; }
  .admin-meta { display: none; }
  .admin-actions { width: 100%; justify-content: flex-start; }
}

/* ───────────────────────── Paramètres ───────────────────────── */
.settings-narrow { max-width: 520px; }
.warn-line { display: flex; align-items: center; gap: 8px; color: #ffb35c; font-size: 14px; font-weight: 600; }
.warn-line .icon { width: 18px; height: 18px; }
.embed-sample-msg { max-width: 560px; padding: 16px; border-radius: 12px; background: var(--dc-bg); }
.embed-sample { transition: border-color .15s; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.color-value { font: 600 14px ui-monospace, 'Cascadia Code', Consolas, monospace; color: var(--t-2); }
.settings-list p { margin: 0; }
.settings-list ul { margin: 6px 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ───────────────────────── Bienvenue (sections activables, façon MEE6) ───────────────────────── */
.wsec-head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; }
.wsec-head .text { flex: 1; min-width: 0; }
.wsec-head h3 { font-size: 16px; }
.wsec-head p { margin: 4px 0 0; color: var(--t-2); font-size: 14px; }
.wsec-body { display: flex; flex-direction: column; gap: 18px; padding: 0 24px 24px; }
.wsec-body[hidden] { display: none; }
.wsec.open .wsec-head { padding-bottom: 18px; }
.wsec-sep { height: 1px; background: var(--n-3); }
.wsec-narrow { max-width: 480px; }
.wsec-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.welcome-card-editor { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; max-width: 640px; }
.welcome-card-frame { max-width: 480px; border-radius: 14px; overflow: hidden; background: var(--n-0); aspect-ratio: 1024 / 450; }
.welcome-card-img { display: block; width: 100%; height: auto; transition: opacity .15s; }
.welcome-card-img.loading { opacity: .6; }

/* ── Anti-raide ── */
.ar-status { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.ar-discon { display: grid; gap: 8px; }
.ar-level { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px; border: 0; border-radius: var(--r); background: var(--n-0); color: var(--t-1); font: inherit; text-align: left; cursor: pointer; transition: background-color .15s; }
.ar-level:hover:not(:disabled) { background: var(--n-1); }
.ar-level.active { background: color-mix(in srgb, var(--primary) 22%, var(--n-0)); cursor: default; }
.ar-level-num { font-size: 20px; font-weight: 700; white-space: nowrap; }
.ar-level-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ar-level-text .subtle { font-size: 13px; }
.ar-score { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.ar-score > strong { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: color-mix(in srgb, var(--primary) 22%, var(--n-0)); font-size: 30px; font-weight: 700; color: #C8BCFF; }
.ar-score > div { display: flex; flex-direction: column; gap: 2px; }
.ar-audit { display: grid; gap: 6px; }
.ar-audit-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--n-0); }
.ar-audit-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ar-audit-row .subtle { font-size: 13px; overflow-wrap: anywhere; }
.ar-audit-row svg { width: 20px; height: 20px; display: block; }
.ar-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--n-1); }
.ar-card strong { font-size: 22px; font-weight: 700; color: var(--t-1); line-height: 1.2; }
.ar-card .ar-sub { font-size: 12.5px; }
.ar-card .btn { align-self: flex-start; margin-top: 8px; }
.ar-card.ar-calm strong { color: #D8FF80; }
.ar-card.ar-alert { background: color-mix(in srgb, #FF6B8A 12%, var(--n-1)); }
.ar-card.ar-alert strong { color: #FF6B8A; }
.ar-inline { align-items: flex-end; gap: 14px; }
.ar-inline .field { margin: 0; }
.ar-publish { display: flex; align-items: center; gap: 10px; padding-bottom: 2px; }
.ar-setup { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r); background: color-mix(in srgb, var(--primary) 14%, var(--n-0)); }
.ar-setup > div { display: flex; flex-direction: column; gap: 2px; }
.ar-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto 240px; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--n-0); }
.ar-filter-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ar-filter-text .subtle { font-size: 13px; }
.ar-captcha-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.ar-preview { display: grid; gap: 8px; justify-items: start; }
.ar-captcha { width: 100%; max-width: 380px; border-radius: 12px; display: block; }
.ar-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ar-limit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--n-0); }
.mod-row.ar-row { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1.4fr) 130px; }
@media (max-width: 1400px) { .ar-status { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .ar-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-captcha-grid { grid-template-columns: 1fr; }
  .ar-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ar-status, .ar-limits { grid-template-columns: 1fr; }
  .ar-filter { grid-template-columns: 1fr; }
  .mod-row.ar-row { grid-template-columns: 1fr; }
}
