/* ==============================================================================================
   Dashboard REDLIGHT — feuille unique de l'interface staff.

   Refonte du 29/09/2026 : même charte que le site public (web/public/site/site.css), déclinée pour un
   outil de travail. Trois différences assumées avec le site :
   - plus DENSE : le site est une vitrine, on y passe une minute ; le staff passe ici des heures, sur
     des listes et des formulaires longs. Moins de marge, des titres plus petits, tout tient à l'écran ;
   - un THÈME CLAIR, que le site n'a plus : il reste proposé ici, même si personne ne l'a choisi à la
     date de la refonte (0 préférence enregistrée sur 3) ;
   - pas de verre sur les cartes : le flou d'arrière-plan ne sert qu'à l'ossature (barre latérale,
     barre du haut, fenêtres, menus), qui passe AU-DESSUS du contenu qui défile. Posé sur chaque carte,
     il coûtait un calque GPU par carte pour flouter un fond déjà flou.

   Les noms des jetons ci-dessous sont ceux d'avant la refonte : ils sont repris par les 45 pages, y
   compris en style en ligne dans le JavaScript. Seules leurs valeurs ont changé.

   Les cartes image de Discord (src/leveling/cards/theme.ts) recopiaient ces valeurs à la main ; elles
   n'ont PAS suivi la refonte (hors périmètre : ça demandait un redémarrage du bot).
   ============================================================================================== */

/* Police du site, hébergée sur place (licence OFL). Les chemins sont absolus : le même dossier
   public/ sert les deux domaines, /site/fonts/ existe donc aussi sous dashboard.red-light.fr. */
@font-face {
  font-family: "Geist";
  src: url("/site/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/site/fonts/Geist-Italic-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/site/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --header-h: 58px;
  /* Espace autour et entre les panneaux flottants (sidebar/topbar/contenu) — voir .layout, .sidebar, .topbar, .toasts. */
  --shell-gap: 14px;

  /* Le noir du site. Les surfaces sont des blancs très transparents : elles prennent la teinte du fond
     au lieu d'imposer la leur, et les contours sont NEUTRES (blancs), plus rosés comme avant la
     refonte — le rouge est réservé à ce qui compte (action principale, élément actif, alerte). */
  --bg: #0a0607;
  --bg-elevated: rgb(255 255 255 / 0.035);
  --bg-card: rgb(255 255 255 / 0.045);
  --bg-card-hover: rgb(255 255 255 / 0.075);
  --bg-input: rgb(0 0 0 / 0.3);
  --bg-input-focus: rgb(0 0 0 / 0.42);
  --border: rgb(255 255 255 / 0.085);
  --border-soft: rgb(255 255 255 / 0.055);
  --border-hover: rgb(255 255 255 / 0.17);
  --text: #f6eeee;
  /* Couleurs pleines, pas des blancs transparents : des pages les concatènent ou les posent sur des
     fonds variés. --text-faint garde 5:1 sur une carte, lisible en 12 px. */
  --text-muted: #a8a0a1;
  --text-faint: #8a8284;

  /* Fond d'une carte, du haut vers le bas : une lumière qui tombe, comme le verre du site. */
  --carte-haut: rgb(255 255 255 / 0.048);
  --carte-bas: rgb(255 255 255 / 0.02);
  /* Arête claire en haut des surfaces : c'est elle qui donne l'épaisseur, sans ombre portée lourde. */
  --reflet: inset 0 1px 0 rgb(255 255 255 / 0.07);

  --accent: #ff3b4e;
  --accent-hover: #ff6b5c;
  --accent-dim: #ff3b4e1f;
  --accent-glow: rgba(255, 59, 78, 0.42);

  /* États. Comme sur le site, jamais décoratifs : ils disent « actif », « en attente », « refusé ». */
  --success: #3ddc84;
  --success-dim: #3ddc841a;
  --danger: #ff3b4e;
  --danger-hover: #ff6b5c;
  --danger-dim: #ff3b4e1f;
  /* Rouge clair du texte des actions destructrices : le rouge de la marque sur un fond rougi tombe
     sous 4,5:1. */
  --danger-texte: #ff8f99;
  --warning: #f5b94e;
  --warning-dim: #f5b94e1a;
  --yellow: #eab308;
  --violet: #c86bff;

  /* Le rouge du bouton principal du site : au milieu, là où se trouve le texte, 5,1:1 avec le blanc. */
  --gradient-brand: linear-gradient(180deg, #f2384d 0%, #d4172f 52%, #a10e26 100%);
  --gradient-cool: linear-gradient(135deg, #c86bff, #ff6b5c);

  /* Formes, comme sur le site mais resserrées : tout ce qui se clique est une pilule, une carte a 18 px
     d'arrondi, ce qui vit à l'intérieur 12, l'ossature 22. */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 44px -26px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.85);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  /* Petit rebond d'un bouton relâché — la version sans `linear()` du ressort du site, que tous les
     navigateurs lisent. */
  --ressort: cubic-bezier(0.34, 1.45, 0.64, 1);
  --dur-fast: 0.15s;
  --dur: 0.25s;
  --dur-slow: 0.4s;

  /* Flou de verre appliqué explicitement sur chaque panneau de l'ossature (backdrop-filter ne se
     propage pas via les variables de couleur) — voir .topbar, .sidebar, .modal, .toast, etc. */
  --glass-blur: blur(22px) saturate(170%);

  /* Surfaces de l'ossature. Regroupées ici parce qu'elles doivent toutes basculer ensemble en thème
     clair — et parce que le fond de popover était recopié à l'identique dans sept règles différentes. */
  --page-field: #0a0607;
  --chrome-bg: rgb(20 11 13 / 0.62);
  --sidebar-base: rgb(16 9 11 / 0.5);
  --popover-bg: linear-gradient(180deg, #1c1315, #140c0e);
  --well: rgba(0, 0, 0, 0.28);
  --well-strong: rgba(0, 0, 0, 0.36);
  --btn-secondary-bg: rgb(255 255 255 / 0.06);
  --btn-secondary-hover: rgb(255 255 255 / 0.1);
  --backdrop: rgb(6 3 4 / 0.62);
  --backdrop-strong: rgb(6 3 4 / 0.74);
  --switch-knob-on: #06210f;
  /* Troisième couleur du graphique de sanctions, à côté de --accent et --warning : elle était écrite en
     dur dans moderation.js alors que les deux autres sont des jetons. */
  --sanction-warn: #ffb3b8;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Une seule famille depuis la refonte : les titres se distinguent par la graisse et l'approche,
     comme sur le site, plus par une seconde police. */
  --font-display: var(--font-sans);
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
}

/* ---------- Thème clair ----------
   Le dashboard est conçu en sombre, qui reste son identité et le réglage par défaut : sans l'attribut
   data-theme="light" sur <html> (posé par theme-mode.js, puis confirmé depuis le serveur), rien ici ne
   s'applique et l'interface est pixel pour pixel celle d'avant.

   Seuls les jetons de :root sont redéfinis — aucune règle de mise en page n'est dupliquée. Le sélecteur
   html[data-theme="light"] est plus spécifique qu'un simple :root, donc ce bloc gagne quel que soit
   l'ordre dans le fichier.

   Ce bloc remplace l'ancien mode contrasté (accessibilité, cibles WCAG AAA), retiré sur demande. Les
   valeurs ci-dessous visent tout de même des contrastes confortables : le texte principal est à ~14:1
   sur le fond, le texte secondaire au-dessus de 4,5:1. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4f5;
  /* Surfaces : en sombre ce sont des blancs très transparents posés sur du noir ; en clair elles doivent
     au contraire s'assombrir légèrement, sans quoi elles disparaissent purement et simplement. */
  --bg-elevated: rgba(24, 12, 18, 0.035);
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(255, 255, 255, 0.9);
  --bg-input-focus: #ffffff;
  /* Neutres comme en sombre depuis la refonte : le rouge est réservé à ce qui compte. */
  --border: rgba(40, 16, 24, 0.12);
  --border-soft: rgba(40, 16, 24, 0.075);
  --border-hover: rgba(40, 16, 24, 0.26);
  --carte-haut: #ffffff;
  --carte-bas: rgba(255, 255, 255, 0.82);
  --reflet: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --text: #1b1418;
  --text-muted: #6b5a61;
  --text-faint: #86717a;

  /* L'accent passe du corail clair (lisible sur noir) à un rouge profond : le #ff3b4e d'origine sur du
     blanc tombe sous 3:1, illisible pour du texte ou une icône. */
  --accent: #d8123f;
  --accent-hover: #b80f35;
  --accent-dim: rgba(216, 18, 63, 0.1);
  --accent-glow: rgba(216, 18, 63, 0.26);

  /* Même raison pour les couleurs d'état : les versions pensées pour un fond noir sont toutes trop
     claires sur du blanc. */
  --success: #17794f;
  --success-dim: rgba(23, 121, 79, 0.12);
  --danger: #c4123c;
  --danger-hover: #a30f31;
  --danger-dim: rgba(196, 18, 60, 0.1);
  --danger-texte: #b3102f;
  --warning: #96600a;
  --warning-dim: rgba(150, 96, 10, 0.13);
  --yellow: #8a6d00;
  --violet: #6f35a8;

  --gradient-brand: linear-gradient(180deg, #ea2a45 0%, #cf1430 52%, #a10e26 100%);
  --gradient-cool: linear-gradient(135deg, #8b3fd1, #e81746);

  /* Les ombres d'origine sont des noirs très opaques, pensés pour se fondre dans un fond noir. Sur du
     clair elles produisent des halos sales : même géométrie, teinte adoucie. */
  --shadow-sm: 0 1px 2px rgba(70, 25, 40, 0.1);
  --shadow-md: 0 14px 34px -18px rgba(70, 25, 40, 0.3);
  --shadow-lg: 0 24px 60px -22px rgba(70, 25, 40, 0.35);

  --page-field: #f7f4f5;
  --chrome-bg: rgba(255, 255, 255, 0.78);
  --sidebar-base: rgba(255, 255, 255, 0.62);
  --popover-bg: linear-gradient(160deg, #ffffff, #f7f4f5 65%);
  /* Les « puits » (champ de recherche, jauges) sont des noirs transparents : sur du clair ils doivent
     au contraire assombrir très légèrement, sans quoi le creux disparaît. */
  --well: rgba(24, 12, 18, 0.05);
  --well-strong: rgba(24, 12, 18, 0.08);
  --btn-secondary-bg: rgba(24, 12, 18, 0.06);
  --btn-secondary-hover: rgba(24, 12, 18, 0.11);
  /* Le voile des fenêtres modales reste sombre pour isoler le contenu, mais moins opaque : un quasi-noir
     sur une page claire produit un contraste brutal. */
  --backdrop: rgba(45, 28, 34, 0.42);
  --backdrop-strong: rgba(45, 28, 34, 0.55);
  --switch-knob-on: #ffffff;
  /* Le rose pâle d'origine se distinguait à peine du rail clair de la jauge. */
  --sanction-warn: #d4607a;
}

/* Le décor de fond (halos rouges flous) est calibré pour se détacher d'un noir : sur du blanc il
   empâte la page. Nettement atténué plutôt que masqué, pour garder un fond vivant. */
html[data-theme="light"] .blob { opacity: 0.08; }
html[data-theme="light"] .blob.b2 { opacity: 0.05; }


* {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

/* Barres de défilement discrètes et neutres, comme sur le site, partout où une zone défile. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.14) transparent;
}

html[data-theme="light"] * {
  scrollbar-color: rgb(40 16 24 / 0.2) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  /* Un clic avec un micro-glissement (souris/trackpad) ne doit jamais démarrer une sélection de texte
     sur l'interface (boutons, en-têtes, cartes...) — seuls les champs de formulaire restent sélectionnables
     (les navigateurs ignorent toujours user-select:none hérité pour le texte saisi dans input/textarea). */
  user-select: none;
}

input,
textarea,
select,
[contenteditable] {
  user-select: text;
}

/* ---------- Fond ambiant (voir maquette validée) ---------- */

.bg-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--page-field);
}

/* Deux lumières rouges, IMMOBILES depuis la refonte. Elles dérivaient en boucle : joli sur la vitrine,
   mais un outil ouvert des heures n'a pas à faire travailler la carte graphique en permanence, ni à
   bouger dans le coin de l'œil pendant qu'on lit un ticket. */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  background: radial-gradient(circle at 50% 50%, var(--accent) 0%, #7a0f24 45%, transparent 72%);
  opacity: 0.13;
}

/* Au-dessus du contenu, décalée vers la droite : elle éclaire le haut de la page sans laver de rouge
   la barre latérale ni la recherche. */
.blob.b1 { width: 760px; height: 520px; top: -340px; left: 38%; }
.blob.b2 { width: 560px; height: 560px; bottom: -320px; right: -160px; opacity: 0.08; }
.blob.b3 { display: none; }

/* Plus de grain photographique ici depuis le 11/10/2026. Mélangé (overlay) à toute la page, il obligeait
   le navigateur à recomposer l'écran entier à chaque image de défilement, pour un apport invisible :
   2 niveaux de couleur sur 255 au plus en thème sombre, 4 en thème clair (mesuré au pixel). Sans lui, le
   défilement d'une longue liste passait de 22 à 37 images par seconde sur un PC sans carte graphique
   efficace. Le site public garde le sien, qui fait partie de son identité. */

button {
  font-family: inherit;
}

h1, h2, h3, .brand, .login-title, .chart-title, .nav-group-title {
  font-family: var(--font-display);
}

/* Titres : la graisse et l'approche serrée font la hiérarchie, comme sur le site. */
h1, h2, h3 {
  font-weight: 620;
  letter-spacing: -0.018em;
}

/* Chiffres alignés en colonnes (horodatages, identifiants) : chasse fixe pour que les colonnes ne
   "dansent" pas quand les valeurs changent. Les grands chiffres (.stat-value) restent en Geist, avec
   des chiffres de largeur égale : la police à chasse fixe les espaçait trop à grande taille. */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.stat-value {
  font-variant-numeric: tabular-nums;
}

/* Les chiffres des cases et des colonnes de tableau sont en Geist, comme sur le site, même quand la page
   leur pose `mono` : à chasse fixe, l'espace des milliers devenait un grand trou (« 184  300 »). Les
   chiffres restent de largeur égale, les colonnes s'alignent toujours. */
.stat .mono,
td.mono {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

::selection {
  background: rgb(255 59 78 / 0.38);
  color: #fff;
}

html[data-theme="light"] ::selection {
  background: rgb(216 18 63 / 0.2);
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* Icône du sprite du site (web/public/site/icons.svg, Phosphor, licence MIT) : elle prend la couleur
   et la taille du texte qui l'entoure. */
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: currentColor;
  vertical-align: -0.18em;
}

/* ---------- Animations ---------- */

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes scaleOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.96); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(28px) scale(0.96); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: var(--shell-gap);
  z-index: 50;
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px 0 12px;
  background: var(--chrome-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--reflet), var(--shadow-md);
}

.brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-shadow: 0 0 22px var(--accent-glow);
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

#presence-voice-row {
  position: relative;
  cursor: default;
}

.voice-popover {
  position: absolute;
  top: -8px;
  left: calc(100% + 10px);
  min-width: 240px;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--popover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 60;
  white-space: normal;
  cursor: default;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.voice-popover[hidden] {
  display: none;
}

.voice-popover-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.voice-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease-out);
}

.voice-popover-row:hover {
  background: var(--bg-card);
}

.voice-popover-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-input);
  object-fit: cover;
}

.voice-popover-info {
  min-width: 0;
  flex: 1;
}

.voice-popover-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-popover-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand {
  position: relative;
  margin-bottom: 4px;
}

.guild-switcher {
  position: relative;
}

/* En tête de la barre latérale : le serveur géré, et l'espace dans lequel on se trouve. Un clic ouvre
   le changeur de serveur, le survol les chiffres de présence. */
.guild-switcher-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 6px 8px 6px 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.brand-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

/* « Espace staff », sous le nom du serveur. */
.brand-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-switcher-caret {
  font-size: 15px;
  color: var(--text-faint);
}

.guild-switcher-trigger:hover {
  background: var(--bg-card);
}

.guild-switcher.open .guild-switcher-trigger {
  background: var(--bg-card);
  border-color: var(--border);
}

.guild-switcher-icon,
.guild-switcher-icon-fallback,
.guild-switcher-item-icon,
.guild-switcher-item-icon-fallback {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--gradient-brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 6px 16px -6px rgba(255, 59, 78, 0.6);
}

.guild-switcher-item-icon,
.guild-switcher-item-icon-fallback {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.guild-switcher-icon-fallback,
.guild-switcher-item-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

/* `display:flex` ci-dessus a une spécificité égale à la règle UA `[hidden]{display:none}` mais gagne
   car elle vient du CSS auteur — sans ce correctif, le rond de secours restait visible à côté de la
   vraie image du serveur (le "point rouge" signalé) même quand une icône réelle était chargée. */
.guild-switcher-icon[hidden],
.guild-switcher-icon-fallback[hidden],
.guild-switcher-item-icon[hidden],
.guild-switcher-item-icon-fallback[hidden] {
  display: none;
}

/* Nom du serveur géré : c'est lui qui se lit en premier. */
.guild-switcher-name {
  max-width: 100%;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  /* Même largeur que le déclencheur (donc que le bandeau de la sidebar) — un menu plus large que lui
     dépassait visuellement du panneau. */
  width: 100%;
  max-width: calc(100vw - 24px);
  max-height: 360px;
  display: flex;
  flex-direction: column;
  background: var(--popover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.guild-switcher-menu[hidden] {
  display: none;
}

.guild-switcher-list {
  overflow-y: auto;
}

.guild-switcher-actions {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.guild-switcher-add {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.guild-switcher-add:hover {
  color: var(--text);
  background: var(--bg-card);
}

.brand-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--popover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  z-index: 65;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.brand-popover[hidden] {
  display: none;
}

.brand-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.brand-popover-row > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-popover-row strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Point vert « en ligne » : une icône pleine ferait trop, un simple point dit la présence. */
.presence-point {
  width: 8px;
  height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgb(61 220 132 / 0.5);
}

.guild-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.guild-switcher-item:hover {
  background: var(--bg-card);
}

.guild-switcher-item.active {
  background: var(--accent-dim);
}

.guild-switcher-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-switcher-item-members {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.conn-status--connected .conn-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.conn-status--connecting .conn-dot {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse 1.2s infinite;
}

.conn-status--disconnected .conn-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

/* Le texte n'est utile que quand quelque chose mérite l'attention (connexion en cours/perdue) — une fois
   connecté, le point vert suffit et n'encombre plus la topbar (voir maquette : juste une puce, pas de texte). */
.conn-status--connected .conn-label {
  display: none;
}

/* ---------- Badge utilisateur (topbar) ---------- */

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding: 4px 4px 4px 4px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.user-badge:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

/* ---------- Recherche universelle + cloche de notifications (topbar) ---------- */

/* Recherche : bornée en largeur, elle n'a pas à traverser tout l'écran pour taper un pseudo. */
.topbar-search {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--well);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text-faint);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.topbar-search:focus-within {
  border-color: rgb(255 59 78 / 0.55);
  background: var(--well-strong);
}

.topbar-search > .ic {
  font-size: 15px;
}

/* Sélecteur par ID (et non par classe, absente du markup) : nécessaire aussi pour battre en spécificité
   la règle globale "input[type=text]" (fond/bordure/padding par défaut) définie plus bas dans ce fichier,
   qui sinon prendrait le dessus malgré "all: unset" et empêchait le champ de s'étirer sur toute la largeur. */
#topbar-search-input {
  all: unset;
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

#topbar-search-input::placeholder {
  color: var(--text-faint);
}

.topbar-search-results {
  position: absolute;
  /* Part du bas du DÉCLENCHEUR (petit, centré dans la topbar), pas du bas de la topbar elle-même — cette
     marge est volontairement généreuse pour que le panneau s'ouvre sous le CADRE de la topbar entier,
     sans jamais le chevaucher. */
  top: calc(100% + 18px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  background: var(--popover-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.topbar-search-results[hidden] {
  display: none;
}

.search-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 8px 10px 4px;
}

.search-result {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.search-result:hover {
  background: var(--bg-card);
}

.search-result-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.icon-btn {
  all: unset;
  position: relative;
  box-sizing: border-box;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 17px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), scale 0.4s var(--ressort);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-card);
}

.icon-btn:active {
  scale: 0.92;
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

.icon-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.notif-badge[hidden] {
  display: none;
}

/* Signale une demande de unban en attente directement sur la cloche (voir app.js::refreshUnbanPendingIndicator) —
   allumage jaune persistant tant que ça reste en attente, + un léger wiggle ponctuel (classe .wiggle, retirée après
   coup) déclenché uniquement à l'arrivée d'une VRAIE nouvelle demande. */
.notif-bell .icon-btn.pending {
  background: var(--warning-dim);
  border-color: var(--warning);
  color: var(--warning);
}

.notif-bell .icon-btn.wiggle {
  animation: bell-wiggle 0.6s ease-in-out;
}

@keyframes bell-wiggle {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-14deg); }
  30% { transform: rotate(11deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
  90% { transform: rotate(2deg); }
}

.notif-panel {
  position: absolute;
  /* "right: 0" se cale sur .topbar-right (voir sa règle plus haut, position:relative) et non sur la
     cloche elle-même — sinon le panneau s'ouvrait aligné au petit bouton cloche, décalé vers la gauche du
     badge utilisateur au lieu de s'ouvrir sous tout le coin droit (avatar compris). Même remarque que
     .topbar-search-results pour la marge verticale : généreuse pour sortir entièrement du cadre de la
     topbar avant d'afficher le panneau, jamais superposé dessus. */
  top: calc(100% + 22px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: 420px;
  display: flex;
  flex-direction: column;
  background: var(--popover-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  overflow: hidden;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.notif-panel[hidden] {
  display: none;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
  font-weight: 620;
}

.notif-mark-all {
  all: unset;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease-out);
}

.notif-mark-all:hover {
  color: var(--accent-hover);
}

.notif-list {
  overflow-y: auto;
  padding: 6px;
}

.notif-item {
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: background var(--dur-fast) var(--ease-out);
}

.notif-item.is-unread {
  background: var(--accent-dim);
  cursor: pointer;
}

.notif-item.is-unread:hover {
  background: rgba(255, 59, 78, 0.16);
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-item.is-unread .notif-item-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 6px 1px var(--accent);
  flex-shrink: 0;
}

/* Variante jaune de l'entrée "demande de unban en attente" (état live, pas une notification stockée —
   voir app.js::unbanNotifItemHtml) : mêmes classes de base que .is-unread, teinte différente pour la
   distinguer visuellement des vraies notifications personnelles. */
.notif-item.notif-item--unban {
  background: var(--warning-dim);
}

.notif-item.notif-item--unban:hover {
  background: rgba(245, 197, 24, 0.2);
}

.notif-item.notif-item--unban .notif-item-title::before {
  background: var(--warning);
  box-shadow: 0 0 6px 1px var(--warning);
}

.notif-item-body {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 3px 0;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-faint);
}

.user-badge-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Grade staff le plus élevé, affiché à côté du pseudo. La couleur vient du rôle Discord lui-même
   (voir renderUserBadgeRole dans app.js) ; ce qui est fixé ici, c'est seulement la forme. */
.user-badge-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 15px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.user-badge-logout:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

/* ---------- Écran de connexion ---------- */

.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

/* Le sélecteur [hidden] du navigateur (UA, "display: none") a une priorité plus faible que n'importe
   quelle règle "display" d'origine auteur, même moins spécifique — donc sans cette règle explicite,
   .login-screen resterait affiché malgré l'attribut hidden (cf. même piège déjà rencontré sur .guild-switcher-icon-fallback). */
.login-screen[hidden] {
  display: none;
}

/* Le même verre que les panneaux du site, avec son arête claire en haut. */
.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  text-align: center;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.075), rgb(255 255 255 / 0.02)), rgb(24 10 13 / 0.42);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 34px 32px 30px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 30px 80px -30px rgb(0 0 0 / 0.85);
  animation: fadeSlideIn var(--dur-slow) var(--ease) both;
}

html[data-theme="light"] .login-card {
  background: rgb(255 255 255 / 0.86);
  box-shadow: var(--reflet), var(--shadow-lg);
}

/* La marque du bandeau du site : logo et nom, pour que l'arrivée depuis www.red-light.fr se lise
   comme une continuité. */
.login-marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.login-marque img {
  display: block;
}

.login-surtitre {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

html[data-theme="light"] .login-surtitre {
  color: var(--accent);
}

.login-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 16px;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 10px 26px -8px var(--accent-glow);
}

.login-title {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.login-desc {
  margin: 0 auto 24px;
  max-width: 32ch;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.login-error {
  margin: -10px 0 16px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-dim);
  /* Rose pâle en dur : lisible sur le fond sombre d'origine, il devenait invisible sur le --danger-dim
     très clair du thème clair. */
  color: var(--danger);
  font-size: 12px;
}

/* Le bleu de Discord reste : c'est la couleur que ses règles de marque imposent au bouton de
   connexion, et celle que l'on reconnaît d'instinct. La forme, elle, suit le site. */
.btn-discord {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 10px 28px -10px rgba(88, 101, 242, 0.7);
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), scale 0.4s var(--ressort);
}

.btn-discord:hover {
  background: #4c59e6;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 14px 34px -10px rgba(88, 101, 242, 0.85);
}

.btn-discord:active {
  scale: 0.97;
}

.discord-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  align-items: start;
  gap: var(--shell-gap);
  min-height: calc(100vh - 2 * var(--shell-gap));
  padding: var(--shell-gap);
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: var(--shell-gap);
  min-width: 0;
}

.sidebar {
  flex-shrink: 0;
  position: sticky;
  top: var(--shell-gap);
  height: calc(100vh - 2 * var(--shell-gap));
  background: linear-gradient(180deg, rgb(255 255 255 / 0.04), rgb(255 255 255 / 0.01)), var(--sidebar-base);
  /* Pas de flou d'arrière-plan : rien ne passe jamais derrière la barre latérale (le contenu défile à
     côté, et sur écran étroit elle devient opaque), il ne changeait donc pas un pixel — mesuré le
     11/10/2026 — mais était recalculé à chaque image de défilement. La barre du haut garde le sien :
     les pages défilent dessous, et là il se voit. */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--reflet), var(--shadow-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Volontairement PAS overflow:auto ici : ça découperait les menus (changeur de serveur, infobulle de
     présence) qui débordent de la sidebar. Seul .nav-scroll ci-dessous défile. */
  overflow: visible;
}

.nav-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: 0 2px;
  margin: 0 -2px;
  scrollbar-width: none;
}

/* La barre de défilement du menu est masquée (la molette, le clavier et le tactile défilent toujours) :
   la languette collée au bord coupait le verre du panneau. */
.nav-scroll::-webkit-scrollbar {
  width: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Titre de groupe : petites capitales discrètes. Il nomme la tâche, il ne se lit pas avant les pages. */
.nav-group-title {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 10px 5px;
  cursor: pointer;
  border-radius: 8px;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav-group-title:hover {
  color: var(--text-muted);
}

.nav-group-title:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: -2px;
}

.nav-group:first-child .nav-group-title {
  padding-top: 6px;
}

/* Le chevron n'apparaît qu'au survol du titre, ou quand le groupe est replié (il dit alors pourquoi
   les pages ont disparu). */
.nav-group-chevron {
  font-size: 12px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out), rotate var(--dur-fast) var(--ease-out);
}

.nav-group-title:hover .nav-group-chevron,
.nav-group-title:focus-visible .nav-group-chevron,
.nav-group.collapsed .nav-group-chevron {
  opacity: 1;
}

.nav-group.collapsed .nav-group-chevron {
  rotate: -90deg;
}

.nav-group.collapsed .nav-item {
  display: none;
}

/* Masque un groupe entier (titre compris) si l'accès a rendu tous ses éléments invisibles. */
.nav-group:not(:has(.nav-item:not([hidden]))) {
  display: none;
}

/* Bloc réservé aux Owners, en bas : séparé du menu par un trait, il ne se replie pas. */
.sidebar-proprio {
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-footer {
  padding: 8px 6px 2px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-formation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: color var(--dur-fast) var(--ease-out);
}

.sidebar-formation .ic {
  font-size: 15px;
  color: var(--text-faint);
}

.sidebar-formation:hover {
  color: var(--text);
}

.sidebar-footer-legal {
  display: flex;
  gap: 10px;
  padding: 0 4px;
}

.sidebar-footer-link {
  background: none;
  border: none;
  /* Ce sont des <a> : sans cette règle, le navigateur les souligne par défaut, ce qui alourdit
     visuellement le bas de la barre latérale. Le survol reste signalé par la couleur. */
  text-decoration: none;
  color: var(--text-faint);
  font-size: 11.5px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.sidebar-footer-link:hover {
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--dur) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.toggle-switch:hover {
  border-color: var(--border-hover);
}

.toggle-switch.on {
  background: var(--success);
  border-color: var(--success);
}

.toggle-switch.on::after {
  transform: translateX(18px);
  background: var(--switch-knob-on);
}

.mapping-row {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ---------- Giveaways : liste + participant en direct ---------- */

.giveaway-participant-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.giveaway-participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  animation: fadeSlideIn var(--dur-slow) var(--ease) both;
}

.giveaway-participant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.giveaway-participant-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.giveaway-winner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240, 178, 50, 0.22), rgba(240, 178, 50, 0.05));
  border: 1px solid rgba(240, 178, 50, 0.4);
  font-size: 13px;
  font-weight: 600;
  margin: 3px 4px 3px 0;
}

.giveaway-winner-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.giveaway-static-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  max-height: 260px;
  overflow-y: auto;
}

/* ---------- Giveaways : opener style "ouverture de caisse" ---------- */

.giveaway-reel-viewport {
  position: relative;
  height: 128px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  margin: 18px 0;
}

.giveaway-reel-viewport::before,
.giveaway-reel-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  z-index: 2;
  pointer-events: none;
}

.giveaway-reel-viewport::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-card), transparent);
}

.giveaway-reel-viewport::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-card), transparent);
}

.giveaway-reel-marker {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  z-index: 3;
}

.giveaway-reel-marker::before,
.giveaway-reel-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
}

.giveaway-reel-marker::before {
  top: -1px;
  border-top: none;
  border-bottom-color: var(--accent);
}

.giveaway-reel-marker::after {
  bottom: -1px;
  border-bottom: none;
  border-top-color: var(--accent);
}

.giveaway-reel-track {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
}

.giveaway-reel-item {
  flex-shrink: 0;
  width: 92px;
  height: 100px;
  margin: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.giveaway-reel-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.giveaway-reel-item-name {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.giveaway-reel-item.is-winner {
  border-color: var(--warning);
  background: linear-gradient(180deg, var(--warning-dim), var(--bg-input));
  box-shadow: 0 0 26px rgba(240, 178, 50, 0.5);
}

@keyframes giveawayTrophyPop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  45% { transform: scale(1.35) rotate(10deg); opacity: 1; }
  65% { transform: scale(0.92) rotate(-6deg); }
  82% { transform: scale(1.08) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes giveawayGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(240, 178, 50, 0.45); }
  50% { text-shadow: 0 0 28px rgba(240, 178, 50, 0.95); }
}

@keyframes giveawayBurst {
  0% { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.giveaway-reveal {
  position: relative;
  text-align: center;
  padding: 14px 0 8px;
  animation: fadeSlideIn var(--dur-slow) var(--ease) both;
}

.giveaway-reveal::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 70px;
  height: 70px;
  margin-left: -35px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 178, 50, 0.55), transparent 70%);
  animation: giveawayBurst 0.8s var(--ease-out) both;
  pointer-events: none;
}

.giveaway-reveal-trophy {
  position: relative;
  display: inline-block;
  font-size: 46px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 16px rgba(240, 178, 50, 0.7));
  animation: giveawayTrophyPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.giveaway-reveal-title {
  position: relative;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.giveaway-reveal-name {
  position: relative;
  font-size: 26px;
  font-weight: 800;
  color: var(--warning);
  animation: giveawayGlow 1.8s ease-in-out 0.6s infinite;
}

/* Entrée de la barre latérale : une ligne fine (32 px) avec son icône, pour que les 42 pages tiennent
   à l'écran. Avant la refonte, chaque entrée faisait 43 px et la barre ne montrait qu'un tiers du menu. */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.nav-ic {
  font-size: 16px;
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease-out);
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text);
}

.nav-item:hover .nav-ic {
  color: var(--text-muted);
}

/* Page ouverte : fond rougi, icône rouge et un trait à gauche, comme la goutte du bandeau du site. */
.nav-item.active {
  background: rgb(255 59 78 / 0.11);
  color: var(--text);
  font-weight: 560;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.nav-item.active .nav-ic {
  color: var(--accent-hover);
}

/* Le blanc de l'entrée active était écrit pour le sombre : en clair, il tombait sur un rose pâle et
   le nom de la page ouverte devenait illisible. */
html[data-theme="light"] .nav-item.active {
  color: var(--accent);
  background: rgb(216 18 63 / 0.08);
}

html[data-theme="light"] .nav-item.active .nav-ic {
  color: var(--accent);
}

/* Point d'alerte, à droite de l'entrée : invisible tant que rien n'attend (voir .pending plus bas). */
.nav-item .nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: transparent;
}

/* Signale une demande en attente (voir app.js::refreshUnbanPendingIndicator et le contact du site) :
   un clignotement lent, visible depuis n'importe quelle page de la barre latérale. */
.nav-item .nav-dot.pending {
  background: var(--danger);
  box-shadow: 0 0 8px 1px var(--accent-glow);
}

@media (prefers-reduced-motion: no-preference) {
  .nav-item .nav-dot.pending {
    animation: nav-dot-pulse 2.4s ease-in-out infinite;
  }
}

@keyframes nav-dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px 1px var(--danger); }
  50% { opacity: 0.3; box-shadow: 0 0 0 0 transparent; }
}

/* .nav-item a un "display: flex" d'origine auteur qui, sans cette règle, prime sur le "display: none"
   du sélecteur [hidden] du navigateur (même piège que .login-screen / .guild-switcher-icon-fallback). */
.nav-item[hidden] {
  display: none;
}

/* 80 px en bas : la bulle de chat, fixe dans le coin, recouvrait la dernière ligne de chaque page. */
.content {
  flex: 1;
  padding: 2px 2px 80px;
  overflow-x: auto;
}

.content.page-enter > * {
  animation: fadeSlideIn 0.4s var(--ease) both;
}

.content.page-enter > *:nth-child(1) { animation-delay: 0s; }
.content.page-enter > *:nth-child(2) { animation-delay: 0.04s; }
.content.page-enter > *:nth-child(3) { animation-delay: 0.08s; }
.content.page-enter > *:nth-child(4) { animation-delay: 0.12s; }
.content.page-enter > *:nth-child(5) { animation-delay: 0.16s; }
.content.page-enter > *:nth-child(n+6) { animation-delay: 0.18s; }

.empty-state {
  color: var(--text-muted);
  animation: fadeIn var(--dur-slow) var(--ease) both;
}

/* Placeholder "Chargement…" transitoire entre deux pages : mêmes couleurs que .empty-state mais SANS
   animation propre, pour ne pas jouer un fondu qui serait aussitôt suivi par celui de .page-enter sur
   le vrai contenu (voir renderPage() dans app.js). */
.loading-flash {
  color: var(--text-muted);
}

/* ---------- Écran étroit (voir « Menu sur écran étroit » dans app.js) ----------
   Pas de mise en page propre au téléphone (aucun membre du staff n'ouvrait le dashboard sur mobile à la
   date de la refonte) : juste de quoi rester utilisable. La barre latérale sort de la grille et s'ouvre
   par-dessus la page, sur un voile, depuis le bouton de la barre du haut. */

.topbar-menu,
.sidebar-voile {
  display: none;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-menu {
    display: grid;
    flex: none;
  }

  .sidebar {
    position: fixed;
    top: var(--shell-gap);
    bottom: var(--shell-gap);
    left: var(--shell-gap);
    z-index: 95;
    width: min(290px, calc(100vw - 2 * var(--shell-gap)));
    height: auto;
    background: var(--popover-bg);
    translate: calc(-100% - 2 * var(--shell-gap)) 0;
    transition: translate 0.35s var(--ease);
  }

  body.menu-ouvert .sidebar {
    translate: 0 0;
  }

  .sidebar-voile {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: var(--backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out);
  }

  body.menu-ouvert .sidebar-voile {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    gap: 8px;
    padding: 0 6px;
  }

  .topbar-search {
    min-width: 0;
  }

  .conn-label,
  .user-badge-name,
  .user-badge-role {
    display: none;
  }
}

/* ---------- En-tête de page (voir enTetePage dans app.js) ----------
   Posé au-dessus de chaque page, directement sur le fond (pas dans une carte) : il dit où l'on est et
   ce que fait la page, et porte les onglets Suivi / Réglages. */

.page-tete {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 4px 2px;
}

.page-tete[hidden] {
  display: none;
}

.page-tete-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 23px;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 10px 26px -12px var(--accent-glow);
}

.page-tete-ic .ic {
  color: inherit;
}

.page-tete-texte {
  flex: 1;
  min-width: 0;
}

.page-tete-groupe {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

html[data-theme="light"] .page-tete-groupe {
  color: var(--accent);
}

.page-tete-titre {
  margin: 0;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.page-tete-desc {
  margin: 3px 0 0;
  max-width: 80ch;
  color: var(--text-muted);
  font-size: 13.5px;
}

.page-tete-desc:empty {
  display: none;
}

.page-tete-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Onglets de page (voir page-onglets.js) ----------
   Deux segments dans une pilule, comme les segments du site. Les cartes de l'onglet non choisi sont
   masquées, jamais retirées : la page continue de les remplir. */

.page-onglets {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--border-soft);
}

.page-onglet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.page-onglet .ic {
  font-size: 15px;
}

.page-onglet:hover {
  color: var(--text);
}

.page-onglet[aria-selected="true"] {
  color: var(--text);
  background: var(--btn-secondary-hover);
  box-shadow: var(--reflet), 0 0 0 1px var(--border);
}

.page-onglet[aria-selected="true"] .ic {
  color: var(--accent-hover);
}

html[data-theme="light"] .page-onglet[aria-selected="true"] {
  background: #ffffff;
}

.page-onglet:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 1px;
}

#content[data-onglet-actif="suivi"] .onglet-reglages,
#content[data-onglet-actif="reglages"] .onglet-suivi {
  display: none !important;
}

@media (max-width: 760px) {
  .page-tete {
    flex-wrap: wrap;
  }

  .page-tete-actions {
    width: 100%;
  }
}

/* ---------- Paramètres : sous-menu vertical (voir pages/settings.js) ----------
   Les onglets restent des .btn (le script bascule btn-primary / btn-secondary pour marquer le choix) :
   on les habille ici en entrées de menu, comme celles de la barre latérale. */

.reglages-cadre {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Pas de `position: sticky` : #content défile en largeur (overflow-x), il devient donc le conteneur de
   défilement de référence, et le décalage « collant » repoussait le menu de 86 px vers le bas sans
   jamais le faire suivre le défilement de la fenêtre. */
.reglages-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--carte-haut), var(--carte-bas));
  border: 1px solid var(--border);
  box-shadow: var(--reflet);
}

.reglages-nav-titre {
  margin: 10px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reglages-nav-titre:first-child {
  margin-top: 4px;
}

.reglages-nav .btn,
.reglages-nav .btn-secondary,
.reglages-nav .btn-primary {
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: normal;
  text-align: left;
}

.reglages-nav .btn .ic {
  font-size: 15px;
  color: var(--text-faint);
}

.reglages-nav .btn:hover:not(:disabled) {
  background: var(--bg-card);
  color: var(--text);
  border: 0;
}

.reglages-nav .btn-primary,
.reglages-nav .btn-primary:hover:not(:disabled) {
  background: rgb(255 59 78 / 0.11);
  color: var(--text);
  font-weight: 560;
}

.reglages-nav .btn-primary .ic {
  color: var(--accent-hover);
}

html[data-theme="light"] .reglages-nav .btn-primary {
  background: rgb(216 18 63 / 0.08);
  color: var(--accent);
}

.reglages-corps {
  min-width: 0;
}

@media (max-width: 980px) {
  .reglages-cadre {
    grid-template-columns: 1fr;
  }

}

/* ---------- À traiter (voir pages/atraiter.js) ---------- */

.atraiter-resume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  min-height: 1.5em;
  color: var(--text-muted);
  font-size: 14px;
}

.atraiter-resume strong {
  color: var(--text);
  font-weight: 600;
}

.atraiter-resume .ic {
  color: var(--success);
  font-size: 17px;
}

.atraiter-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

/* Tuile d'une file d'attente : un gros chiffre, ce qu'il compte, et où aller. Toute la tuile est le
   lien — c'est un <button>, remis à plat pour ressembler aux autres cartes. */
/* Le chiffre est toujours au même endroit, sous le titre : c'est lui qu'on compare d'une tuile à
   l'autre. Le détail prend la place qui reste, le lien reste en bas. */
.card.atraiter-tuile {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 6px;
  min-height: 150px;
  margin: 0;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  border-color: rgb(255 59 78 / 0.3);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(255 59 78 / 0.14), transparent 60%),
    linear-gradient(180deg, var(--carte-haut), var(--carte-bas));
  transition: border-color var(--dur-fast) var(--ease-out), scale 0.4s var(--ressort);
}

.card.atraiter-tuile:hover {
  border-color: rgb(255 59 78 / 0.55);
}

.atraiter-tuile:active {
  scale: 0.985;
}

.atraiter-tuile:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

.atraiter-tuile-tete {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 560;
  color: var(--text-muted);
}

.atraiter-tuile-tete .ic {
  font-size: 17px;
  color: var(--accent-hover);
}

.atraiter-tuile-compte {
  display: flex;
  align-items: center;
  min-height: 46px;
  margin-top: 6px;
  font-size: 40px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.atraiter-tuile-detail {
  font-size: 12.5px;
  color: var(--text-muted);
}

.atraiter-tuile-lien {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--accent-hover);
}

.atraiter-tuile-lien .ic {
  transition: translate 0.45s var(--ressort);
}

.atraiter-tuile:hover .atraiter-tuile-lien .ic {
  translate: 3px 0;
}

/* Rien en attente : la tuile se calme, le chiffre devient une coche verte. */
.card.atraiter-tuile--calme {
  border-color: var(--border);
  background: linear-gradient(180deg, var(--carte-haut), var(--carte-bas));
}

.card.atraiter-tuile--calme:hover {
  border-color: var(--border-hover);
}

.atraiter-tuile--calme .atraiter-tuile-tete .ic,
.atraiter-tuile--calme .atraiter-tuile-lien {
  color: var(--text-muted);
}

.atraiter-tuile--calme .atraiter-tuile-compte {
  color: var(--success);
  font-size: 30px;
}

.card.atraiter-tuile--erreur {
  cursor: default;
  border-color: var(--border);
  background: linear-gradient(180deg, var(--carte-haut), var(--carte-bas));
}

html[data-theme="light"] .atraiter-tuile-tete .ic,
html[data-theme="light"] .atraiter-tuile-lien {
  color: var(--accent);
}

html[data-theme="light"] .atraiter-tuile--calme .atraiter-tuile-tete .ic,
html[data-theme="light"] .atraiter-tuile--calme .atraiter-tuile-lien {
  color: var(--text-muted);
}

.atraiter-section {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 17px;
}

.atraiter-section span {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-faint);
}

.atraiter-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.atraiter-grille > .card {
  margin-bottom: 14px;
}

.atraiter-chiffres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.atraiter-chiffre {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
}

.atraiter-chiffre-libelle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  /* « Avertissements » est plus large qu'une case : il se coupe à l'endroit prévu (trait d'union
     conditionnel dans pages/atraiter.js) plutôt que de déborder sur la case voisine. */
  hyphens: manual;
}

.atraiter-chiffre-libelle .ic {
  font-size: 14px;
  color: var(--text-faint);
}

.atraiter-chiffre-valeur {
  font-size: 21px;
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.atraiter-chiffre--vert .atraiter-chiffre-libelle .ic {
  color: var(--success);
}

.atraiter-chiffre--rouge .atraiter-chiffre-valeur {
  color: #ff7a86;
}

html[data-theme="light"] .atraiter-chiffre--rouge .atraiter-chiffre-valeur {
  color: var(--danger-texte);
}

.atraiter-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

.atraiter-liste {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
}

.atraiter-ligne {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.atraiter-ligne:hover {
  background: var(--bg-card);
}

.atraiter-ligne-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--accent-hover);
  background: var(--accent-dim);
}

.atraiter-ligne-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-input);
}

.atraiter-ligne-texte {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.atraiter-ligne-titre {
  font-size: 13.5px;
  font-weight: 560;
}

.atraiter-ligne-sous {
  font-size: 12.5px;
  color: var(--text-muted);
}

.atraiter-ligne-extrait {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atraiter-ligne-droite {
  flex: none;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cards & forms ---------- */

/* Une carte ne bouge plus au survol : elle n'est pas cliquable, et le soulèvement suggérait le
   contraire — sur une page de réglages, tout le formulaire tressautait sous la souris. Pas de flou
   d'arrière-plan non plus (voir l'en-tête du fichier). Les cartes cliquables ont leur propre classe. */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--carte-haut), var(--carte-bas));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--reflet), var(--shadow-md);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 620;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 560;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 14px;
  max-width: 78ch;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  transition: color var(--dur-fast) var(--ease-out);
}

/* Libellés en casse normale depuis la refonte : en petites majuscules, une case à cocher posée dans
   un champ (« AFFICHER L'AVATAR DU MEMBRE ») se lisait comme un titre qui crie. */
.field label {
  font-size: 12.5px;
  font-weight: 540;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.field:focus-within label {
  color: var(--text);
}

.hint {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
}

select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="search"],
input[type="url"],
textarea {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

select:hover,
input:hover,
textarea:hover {
  border-color: var(--border-hover);
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: rgb(255 59 78 / 0.7);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-input-focus);
}

::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

select[multiple] {
  min-height: 100px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%239a9aa5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select[multiple] {
  background-image: none;
  padding-right: 12px;
}

input[type="file"] {
  display: block;
  width: 100%;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

input[type="file"]:hover {
  border-color: var(--accent);
  background: var(--bg-input-focus);
}

input[type="file"]::file-selector-button {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  margin-right: 10px;
  font-size: 12.5px;
  font-weight: 560;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

input[type="file"]::file-selector-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

/* Boutons : des pilules, comme tout ce qui se clique sur le site. Pas de soulèvement au survol ; le
   bouton s'enfonce sous le doigt et revient avec un petit rebond.

   `inline-flex` pour qu'une icône et son libellé restent centrés l'un sur l'autre ; le bouton reste
   un élément en ligne, les rangées de boutons des pages ne bougent pas. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.35;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  /* Le blanc était écrit en dur ici alors que le fond du bouton de base est --bg-input, presque noir en
     sombre mais presque blanc en clair : le libellé aurait disparu sur tous les boutons neutres du
     dashboard. Les variantes à fond coloré (primaire, Discord) reposent leur blanc juste après. */
  color: var(--text);
  background: var(--btn-secondary-bg);
  border-color: var(--border);
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), scale 0.4s var(--ressort);
}

.btn:hover:not(:disabled) {
  background: var(--btn-secondary-hover);
  border-color: var(--border-hover);
}

.btn:active:not(:disabled) {
  scale: 0.96;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Le rouge du bouton principal du site, avec son relief. C'est la SEULE action rouge pleine d'une
   page : l'action destructrice (.btn-danger) ne lui ressemble plus. */
.btn-primary {
  color: #fff;
  text-shadow: 0 1px 0 rgb(60 0 8 / 0.3);
  background: var(--gradient-brand);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    inset 0 -2px 6px rgb(70 0 10 / 0.3),
    0 0 0 1px rgb(255 82 98 / 0.5),
    0 8px 22px -10px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-brand);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.38),
    inset 0 -2px 6px rgb(70 0 10 / 0.3),
    0 0 0 1px rgb(255 110 124 / 0.7),
    0 12px 28px -10px rgb(255 59 78 / 0.6);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover);
  border-color: var(--border-hover);
}

/* Action destructrice : teintée, pas pleine. Elle était du même rouge plein que le bouton principal,
   si bien que « Enregistrer » et « Supprimer » se ressemblaient à s'y méprendre. */
.btn-danger {
  color: var(--danger-texte);
  background: rgb(255 59 78 / 0.1);
  border-color: rgb(255 59 78 / 0.3);
}

.btn-danger:hover:not(:disabled) {
  color: #fff;
  background: rgb(255 59 78 / 0.22);
  border-color: rgb(255 59 78 / 0.55);
}

html[data-theme="light"] .btn-danger:hover:not(:disabled) {
  color: var(--danger-texte);
  background: rgb(196 18 60 / 0.14);
}

/* Vert : un ajout ou une validation. Teinté lui aussi, pour que la page n'ait jamais qu'une seule
   action pleine. */
.btn-success {
  color: var(--success);
  background: var(--success-dim);
  border-color: rgb(61 220 132 / 0.3);
}

.btn-success:hover:not(:disabled) {
  background: rgb(61 220 132 / 0.18);
  border-color: rgb(61 220 132 / 0.5);
}

html[data-theme="light"] .btn-success {
  border-color: rgb(23 121 79 / 0.3);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  gap: 5px;
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
}

/* En-têtes en casse normale, discrets : ils nomment la colonne, ils ne la titrent pas. */
th {
  color: var(--text-faint);
  font-weight: 540;
  font-size: 12px;
  background: var(--bg-elevated);
  border-bottom-color: var(--border);
  white-space: nowrap;
  /* Un simple clic sur l'en-tête ne doit jamais démarrer une sélection de texte (voir .clickable-row). */
  user-select: none;
}

th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }

tr:last-child td {
  border-bottom: none;
}

.clickable-row {
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
  /* Évite qu'un clic légèrement "glissé" (souris/trackpad) déclenche une sélection de texte au lieu
     d'ouvrir la ligne — la sélection reste possible dans les champs de formulaire, non affectés par ceci. */
  user-select: none;
}

.clickable-row:hover td {
  background: var(--bg-elevated);
}

/* ---------- Tickets chat ---------- */

.ticket-chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 62vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.ticket-msg {
  font-size: 13.5px;
  animation: fadeSlideIn 0.3s var(--ease) both;
}

.ticket-msg.ticket-msg-bot {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

.ticket-msg .author {
  font-weight: 600;
}

.ticket-msg .meta {
  color: var(--text-faint);
  font-size: 11px;
  margin-left: 6px;
}

.ticket-msg .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 3px;
}

.ticket-msg .attachment {
  display: block;
  color: var(--accent);
  font-size: 12px;
  margin-top: 4px;
}

.ticket-msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.ticket-msg-image {
  display: block;
  max-width: 280px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg-elevated);
  cursor: zoom-in;
  transition: transform var(--dur) var(--ease-out);
}

.ticket-msg-image:hover {
  transform: scale(1.02);
}

/* ---------- Galerie média (fiche membre) ---------- */

/* Style des puces de filtre Tous/Image/Vidéo/GIF — réutilisé dans la lightbox (voir .lightbox-filter-bar
   plus bas), qui les positionne différemment (barre fixe en haut de l'écran plutôt qu'en flux normal). */
.media-filter-chip {
  all: unset;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.media-filter-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.media-filter-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.media-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: zoom-in;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.media-tile:hover {
  transform: scale(1.03);
  border-color: var(--border-hover);
}

.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.media-tile-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* ---------- Tags ---------- */

/* Étiquettes : petites capitales, liseré de leur propre couleur. Les pages écrivent le libellé
   normalement (« Ban », « Ouvert ») : les capitales viennent d'ici, pas du texte. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent);
}

/* Vignette d'une preuve (log-popup.js). Le cadre rogne le flou des médias copiés d'un spam par le salon
   piège : sans lui, le halo du filtre déborde sur le texte voisin. */
.proof-cadre {
  display: inline-block;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 6px;
}

.proof-thumb.proof-floutee {
  filter: blur(18px);
  cursor: pointer !important;
}

.tag-ban { background: rgb(255 59 78 / 0.13); color: #ff7a86; }
.tag-mute { background: rgb(234 179 8 / 0.12); color: var(--yellow); }
.tag-warn { background: rgb(245 185 78 / 0.12); color: var(--warning); }
.tag-quarantine { background: rgb(200 107 255 / 0.12); color: #d79bff; }
.tag-open { background: rgb(61 220 132 / 0.12); color: var(--success); }
.tag-closed { background: rgb(255 255 255 / 0.06); color: var(--text-muted); }

html[data-theme="light"] .tag-ban { color: var(--danger-texte); }
html[data-theme="light"] .tag-quarantine { color: var(--violet); }

/* Ancienneté d'un ticket resté ouvert : doré au bout d'une semaine, rouge au bout d'un mois.
   La couleur porte sur l'étiquette « Ouvert » elle-même, parce que c'est la colonne qu'on parcourt des
   yeux — un dossier oublié depuis six semaines doit sauter à la figure sans avoir à lire les dates. */
.tag-open-semaine { background: rgb(245 185 78 / 0.16); color: var(--warning); }
.tag-open-mois { background: rgb(255 59 78 / 0.16); color: #ff7a86; }

/* Étiquette d'anomalie de configuration : un réglage pointe vers un salon qui n'existe plus. */
.tag-alerte { background: rgb(255 59 78 / 0.16); color: #ff7a86; }

/* Niveau d'activité d'un membre (voir src/lib/activity-tag.ts) — même gamme de couleurs que les autres
   étiquettes : gris = neutre, vert = bon signe, doré = remarquable. */
.tag-activity-inactive { background: rgb(255 255 255 / 0.06); color: var(--text-muted); }
.tag-activity-active { background: rgb(61 220 132 / 0.12); color: var(--success); }
.tag-activity-very-active { background: rgb(245 185 78 / 0.14); color: var(--warning); }

html[data-theme="light"] .tag-open-mois,
html[data-theme="light"] .tag-alerte { color: var(--danger-texte); }
html[data-theme="light"] .tag-closed,
html[data-theme="light"] .tag-activity-inactive { background: rgb(40 16 24 / 0.06); }

/* Note sur 5 (voir Ui.etoiles) : étoiles pleines ambrées, vides en retrait. */
.etoiles {
  display: inline-flex;
  gap: 1px;
  vertical-align: -0.15em;
  color: var(--warning);
  white-space: nowrap;
}

.etoiles .etoile-vide {
  color: var(--text-faint);
  opacity: 0.55;
}

/* Série de jours d'une flamme (pages Flammes, Classement). */
.flamme {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.flamme .ic {
  color: #ff7a3d;
}

/* ---------- Vérifiés (tableau à 3 colonnes par rôle) ---------- */

.verified-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.verified-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.verified-column-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.verified-role-select {
  width: 100%;
}

.verified-column-list {
  /* Pas de hauteur max/scroll interne : la colonne s'étire pour montrer toute la liste, quelle que soit sa longueur. */
}

/* ---------- List items ---------- */

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--dur-fast) var(--ease-out);
}

/* .list-item a un "display: flex" d'origine auteur qui, sans cette règle, prime sur le "display: none"
   du sélecteur [hidden] du navigateur — le filtre des préréglages de sanction n'aurait donc rien masqué
   (même piège que .nav-item[hidden] / .login-screen plus haut). */
.list-item[hidden] {
  display: none;
}

.list-item:hover {
  background: var(--bg-elevated);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-main {
  min-width: 0;
}

.list-item-title {
  font-weight: 560;
}

.list-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-line;
}

.list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- Recherche de membre (voir Ui.memberSearchFieldHtml) ---------- */

.member-search-results {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 6px;
}

.member-search-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--dur-fast) var(--ease-out);
}

.member-search-item:hover {
  background: var(--bg-elevated);
}

/* ---------- Menus déroulants cherchables (voir Ui.enhanceSearchableSelect dans ui.js) ----------
   Même langage visuel que le sélecteur de serveur (.guild-switcher-*) : chevron qui pivote à l'ouverture,
   menu avec fadeSlideIn/ombre/rayon identiques, pour rester cohérent avec le reste du dashboard. */

.searchable-select {
  position: relative;
  /* Un <div> n'a pas la logique de taille intrinsèque d'un <select> (qui s'ajuste à sa plus longue option) ;
     sans plancher explicite, un <select> sans largeur inline (ex. "Lundi"/"Mardi"...) s'écrase quasiment à
     rien dans un conteneur flex (.row) — voir le style inline reporté depuis le <select> d'origine ci-dessus,
     qui prévaut sur ce plancher quand il existe. */
  min-width: 160px;
}

.searchable-select-native {
  display: none !important;
}

.searchable-select-input {
  width: 100%;
  cursor: text;
  padding-right: 32px !important;
}

.searchable-select-input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.searchable-select-input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.searchable-select-chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 11px;
  pointer-events: none;
  transition: transform var(--dur) var(--ease-out);
}

.searchable-select.is-open .searchable-select-chevron {
  transform: translateY(-50%) rotate(180deg);
}

/* position/largeur exactes posées en JS (positionDropdown, dans ui.js) — "fixed" et ajoutée hors de
   .searchable-select (en portail, directement sur <body> ou la <dialog>) pour ne jamais rester piégée
   derrière un ancêtre ayant son propre contexte d'empilement (carte, tableau...). */
.searchable-select-dropdown {
  position: fixed;
  width: max-content;
  max-width: min(420px, 90vw);
  max-height: 280px;
  overflow-y: auto;
  background: var(--popover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.searchable-select-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--dur-fast) var(--ease-out);
}

.searchable-select-item:hover,
.searchable-select-item.is-active {
  background: var(--bg-card);
}

.searchable-select-item.is-selected {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.searchable-select-empty {
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- Objectifs (espace personnel) ---------- */

.objective-card {
  position: relative;
  background: linear-gradient(160deg, var(--bg-card-hover), var(--bg-card) 60%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-md);
}

.objective-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.objective-title {
  font-weight: 700;
  font-size: 14px;
}

.objective-level {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.objective-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.objective-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-brand);
  transition: width 0.6s var(--ease-out);
}

.objective-bar-fill.is-max {
  background: linear-gradient(90deg, var(--warning), #ffd76a);
}

.objective-progress-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  top: var(--shell-gap);
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* Le conteneur porte popover="manual" (voir index.html) pour s'afficher au-dessus des modales <dialog>.
   Le navigateur applique alors ses propres styles de popover — centrage par inset:0 + margin:auto,
   bordure, fond opaque, padding — qu'il faut neutraliser pour conserver l'ancrage en haut à droite et
   la transparence. Les deux règles :popover-open sont ignorées par un navigateur sans l'API, qui
   retombe donc sur le display:flex ci-dessus : aucune régression. */
.toasts[popover] {
  inset: auto;
  top: var(--shell-gap);
  right: 20px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  overflow: visible;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
}

.toasts[popover]:not(:popover-open) {
  display: none;
}

.toasts[popover]:popover-open {
  display: flex;
}

/* Notification : une pastille de verre, avec un point de couleur qui dit son état. Le liseré latéral
   épais d'avant faisait « alerte système » même pour un simple « Enregistré ». */
.toast {
  position: relative;
  pointer-events: auto;
  background: var(--chrome-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 16px 11px 34px;
  min-width: 240px;
  max-width: 380px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--reflet), var(--shadow-lg);
  animation: toastIn 0.35s var(--ease) both;
}

.toast::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--accent-glow);
}

.toast--leaving {
  animation: toastOut 0.22s var(--ease-out) both;
}

.toast--success::before { background: var(--success); box-shadow: 0 0 10px 1px rgb(61 220 132 / 0.45); }
.toast--error { border-color: rgb(255 59 78 / 0.35); }
.toast--error::before { background: var(--danger); }

/* ---------- Modal ---------- */

/* Fond opaque : une fenêtre passe au-dessus de la page, et un verre trop transparent laissait lire
   le formulaire du dessous à travers le sien. */
.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--popover-bg);
  color: var(--text);
  padding: 0;
  min-width: 400px;
  max-width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--reflet), var(--shadow-lg);
}

/* Liste de choix d'un formulaire modal, en remplacement d'un <select>.
   Un menu déroulant natif ouvert DANS une modale qui défile est inutilisable : à la molette, le
   navigateur referme la liste et fait défiler la modale à la place, et une liste longue se retrouve
   coupée. Une liste posée à plat n'a aucun de ces deux problèmes. */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft, rgba(0, 0, 0, 0.12));
}

/* Les trois dernières déclarations annulent `.field label`, qui met les libellés de champ en petites
   majuscules grises : appliqué à des noms de catégories, le résultat est illisible et braillard. */
.choice-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}

.choice-list label:hover { background: var(--bg-card-hover); }

/* La bordure suit la case cochée, sans script : c'est l'état natif du bouton radio qui décide. */
.choice-list label:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  font-weight: 600;
}

.choice-list input[type="radio"] { flex: none; margin: 0; }

.modal--wide {
  width: min(920px, 94vw);
  max-width: none;
}

.modal[open] {
  animation: scaleIn 0.28s var(--ease) both;
}

.modal--closing {
  animation: scaleOut 0.18s var(--ease-out) both;
}

.modal::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.28s var(--ease) both;
}

.modal--closing::backdrop {
  animation: fadeOut 0.18s var(--ease-out) both;
}

/* ---------- Passif du membre (historique bans/demandes précédentes) ---------- */

.unban-history-badges {
  display: inline-flex;
  gap: 6px;
  margin-top: 4px;
}

.unban-history { display: flex; flex-direction: column; gap: 6px; }

.unban-history-item {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  font-size: 12.5px;
  line-height: 1.5;
}

.unban-history-item--warn { border-color: var(--warning-dim); background: var(--warning-dim); }
.unban-history-item--danger { border-color: var(--danger-dim); background: var(--danger-dim); }

/* ---------- Raison du bannissement (au-dessus du fil, demandes de unban) ---------- */

.unban-ban-reason {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-dim);
  background: var(--danger-dim);
}

.unban-ban-reason-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.unban-ban-reason-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin-bottom: 6px;
}

.unban-ban-reason-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.unban-ban-reason-actions { margin-top: 8px; }

.unban-evidence-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card-hover);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.unban-evidence-link:hover { border-color: var(--accent); color: var(--accent-hover); }

/* ---------- Fil de conversation (demandes de unban) ---------- */

.unban-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  scroll-behavior: smooth;
}

.unban-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

.unban-row { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.unban-row--user { align-self: flex-start; }
.unban-row--staff { align-self: flex-end; flex-direction: row-reverse; }

.unban-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  margin-bottom: 2px;
}

.unban-bubble-col { display: flex; flex-direction: column; min-width: 0; }
.unban-row--staff .unban-bubble-col { align-items: flex-end; }

.unban-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 4px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  animation: bubbleIn 0.2s var(--ease-out) both;
}

.unban-row--staff .unban-bubble {
  border-radius: var(--radius-sm) var(--radius-sm) 4px var(--radius-sm);
  border-color: transparent;
  background: var(--gradient-brand);
  color: #fff;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.unban-message-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.unban-message-text {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.unban-bubble-images { display: flex; flex-wrap: wrap; gap: 6px; }
.unban-bubble-images:has(+ .unban-message-text) { margin-bottom: 8px; }
.unban-bubble-image {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  object-fit: cover;
}
/* Une seule image : plus grande, comme avant l'ajout du multi-fichiers. */
.unban-bubble-images:only-child .unban-bubble-image:only-child { width: 240px; height: 240px; }

/* ---------- Zone de saisie type messagerie (pilule + bouton rond) ---------- */

.unban-attach-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.unban-attach-btn:hover { border-color: var(--accent); color: var(--accent-hover); }

/* Fichiers en attente d'envoi : petits onglets avec le nom, pas de gros cadre "image jointe". */
.unban-attach-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.unban-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 11.5px;
}
.unban-attach-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.unban-attach-chip-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card-hover);
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}
.unban-attach-chip-remove:hover { background: var(--danger); }

.unban-composer { display: flex; align-items: flex-end; gap: 10px; }

/* Le sélecteur de fichier natif reste invisible (piloté par .unban-attach-btn) : sans cette règle,
   "input[type=file] { display:block; ... }" plus haut (pour d'autres formulaires du dashboard) l'emporte
   sur l'attribut "hidden" — spécificité plus élevée — et affiche le contrôle natif complet dans la barre. */
.unban-composer input[type="file"][hidden] { display: none; }

.unban-composer-input {
  flex: 1;
  resize: none;
  /* Pas de barre de défilement interne : la hauteur grandit avec le contenu (voir autoGrowComposer) jusqu'à
     max-height, "overflow: hidden" masque tout dépassement au lieu d'un slider. */
  overflow: hidden;
  /* Sans ça, la règle générique "textarea { min-height: 70px }" (pour les formulaires classiques) s'applique
     aussi ici et fait une barre de saisie ~2× plus haute que les boutons ronds à côté (42px) — même bug
     partout où ce composer est réutilisé (tickets de unban, chat inter-staff, chat Direction). 42px les aligne
     exactement au repos, tout en restant libre de grandir avec le texte (voir autoGrowComposer) jusqu'à max-height. */
  min-height: 42px;
  max-height: 200px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.unban-composer-input:focus { outline: none; border-color: var(--accent); background: var(--bg-input-focus); }

.unban-send-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(255, 59, 78, 0.35);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.unban-send-btn:hover:not(:disabled) { transform: translateY(-1px) scale(1.05); }
.unban-send-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }

.unban-composer-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin: 6px 0 0 4px;
}

/* ---------- Lightbox (zoom des images de transcript) ---------- */

/* En tant que <dialog>, la lightbox est promue dans la "top layer" du navigateur — au-dessus de
   n'importe quel autre <dialog> déjà ouvert (ex. la modale des tickets), quel que soit le z-index. */
.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: var(--backdrop-strong);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  cursor: zoom-out;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.22s var(--ease) both;
}

.lightbox--closing {
  animation: fadeOut 0.16s var(--ease-out) both;
}

.lightbox::backdrop {
  background: transparent;
}

/* Anim d'entrée/sortie dédiée (opacité seule) : scaleIn/scaleOut (utilisées ailleurs, ex. le modal)
   pilotent aussi "transform" avec un fill-mode "both", qui reste appliqué en continu même une fois
   l'animation terminée — ça écrasait en permanence le transform du zoom ci-dessous (le clic changeait
   bien la classe, mais le scale(1) de fin d'animation gagnait toujours sur le scale(1.7) du zoom). */
@keyframes lightboxMediaIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes lightboxMediaOut {
  to { opacity: 0; }
}

.lightbox img,
.lightbox video {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: lightboxMediaIn 0.3s var(--ease) both;
  cursor: default;
}

/* Cliquer l'image affichée en grand bascule un zoom rapproché (voir openLightbox dans ui.js) ; la vidéo
   garde son curseur neutre puisqu'elle a déjà ses propres contrôles (plein écran natif). */
.lightbox img {
  cursor: zoom-in;
  transition: transform 0.25s var(--ease-out);
}

/* Le niveau de zoom (scale) est fixé en ligne par ui.js selon la réglette — cette classe ne porte que le
   curseur et la mise au premier plan. Sans position+z-index, l'image (non positionnée) reste peinte sous
   les éléments positionnés (flèches, bande de vignettes, filtre) quel que soit son ordre dans le DOM. */
.lightbox-img--zoomed {
  cursor: zoom-out;
  position: relative;
  z-index: 5;
}

.lightbox--closing img,
.lightbox--closing video {
  animation: lightboxMediaOut 0.16s var(--ease-out) both;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.lightbox-download {
  position: absolute;
  top: 20px;
  right: 76px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.lightbox-download[hidden] {
  display: none;
}

.lightbox-download:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.lightbox-close:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: scale(1.08);
}

/* Navigation entre plusieurs médias (galerie) : flèches latérales + bande de vignettes en bas. Cachées
   (attribut [hidden]) quand la lightbox n'affiche qu'un média isolé (avatar, preuve...). */
.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.lightbox-arrow:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-arrow--prev { left: 20px; }
.lightbox-arrow--next { right: 20px; }

/* Le `display:flex` ci-dessus (et sur .lightbox-filter-bar/.lightbox-thumbs plus bas) a une spécificité
   égale à la règle UA `[hidden]{display:none}` mais gagne car elle vient du CSS auteur — même piège que
   .guild-switcher-icon/.login-screen plus haut. Sans ce correctif, flèches/filtre/vignettes restaient
   visibles malgré l'attribut hidden (ex. filtrer sur un type absent laissait les flèches affichées). */
.lightbox-arrow[hidden] {
  display: none;
}

/* Filtre Tous/Image/Vidéo/GIF de la galerie en cours — repositionne les mêmes puces que la fiche membre
   (voir .media-filter-chip) en barre fixe centrée en haut de l'écran. */
.lightbox-filter-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 180px);
}

.lightbox-filter-bar[hidden] {
  display: none;
}

.lightbox-empty {
  color: var(--text-muted);
  font-size: 14px;
}

/* Réglette de niveau de zoom — z-index au-dessus de l'image même zoomée (contrairement aux vignettes,
   qu'on veut au contraire recouvertes par le zoom) pour rester utilisable pendant qu'on zoome. */
.lightbox-zoom-slider {
  position: fixed;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 15px;
  user-select: none;
}

.lightbox-zoom-slider[hidden] {
  display: none;
}

.lightbox-zoom-slider input[type="range"] {
  width: 140px;
  accent-color: var(--accent);
  cursor: pointer;
}

.lightbox--gallery img,
.lightbox--gallery video {
  max-height: 72vh;
}

/* Le padding latéral (~50% du viewport) laisse assez de vide de chaque côté pour que même la toute
   première ou dernière vignette puisse être scrollée jusqu'au centre exact (voir showLightboxItem dans
   ui.js, qui centre la vignette active) — un simple padding fixe l'aurait laissée collée au bord. */
.lightbox-thumbs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 8px calc(50vw - 40px);
  overflow-x: auto;
  scroll-behavior: smooth;
}

.lightbox-thumbs[hidden] {
  display: none;
}

/* Hauteur fixe, largeur libre : chaque vignette garde le format (portrait/paysage) de son média au lieu
   d'être recadrée en carré — voir .lightbox-thumb img/video plus bas. */
.lightbox-thumb {
  all: unset;
  flex-shrink: 0;
  height: 54px;
  min-width: 28px;
  max-width: 96px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.lightbox-thumb:hover {
  opacity: 0.85;
}

/* Agrandie pour signaler visuellement quelle vignette est la sélection actuelle. */
.lightbox-thumb.active {
  opacity: 1;
  border-color: var(--accent);
  transform: scale(1.15);
}

.lightbox-thumb img,
.lightbox-thumb video {
  height: 100%;
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  pointer-events: none;
}

.modal-form {
  padding: 22px 24px 20px;
}

.modal-form h2 {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.02em;
}

/* Les boutons de la fenêtre sont posés sur un pied séparé du formulaire par un trait : on voit d'un
   coup d'œil où finit la saisie et où se trouve la décision. */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 20px -24px -20px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-soft);
  background: rgb(0 0 0 / 0.14);
}

html[data-theme="light"] .modal-actions {
  background: rgb(40 16 24 / 0.03);
}

.badge-empty {
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- Vue d'ensemble (Modération) ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stat-card {
  margin-bottom: 0;
}

/* Chiffre clé posé DANS une carte (roulette, coffres, blackjack, inventaire, échanges) : ces pages
   l'écrivaient sans qu'aucun style n'existe, les chiffres flottaient sans cadre. Même case que les
   chiffres de « À traiter ». */
.stat-row > .stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
}

.stat-row > .stat .stat-value {
  font-size: 22px;
}

/* Des cases plus étroites que les cartes de chiffres : six tiennent sur une ligne (page Échanges). */
.stat-row:has(> .stat) {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-row > .stat .hint {
  margin-top: 2px;
}

/* Rang d'un classement : or, argent et bronze pour les trois premiers (voir medalFor, page Crédits). */
.rang {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 650;
}

.rang-1 { color: #f5b94e; background: rgb(245 185 78 / 0.16); box-shadow: inset 0 0 0 1px rgb(245 185 78 / 0.4); }
.rang-2 { color: #cfd3da; background: rgb(207 211 218 / 0.12); box-shadow: inset 0 0 0 1px rgb(207 211 218 / 0.35); }
.rang-3 { color: #d9905c; background: rgb(217 144 92 / 0.14); box-shadow: inset 0 0 0 1px rgb(217 144 92 / 0.38); }

html[data-theme="light"] .rang-1 { color: #96600a; }
html[data-theme="light"] .rang-2 { color: #5d6470; }
html[data-theme="light"] .rang-3 { color: #9a5424; }

.stat-card--clickable {
  cursor: pointer;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 540;
}

/* En Geist même quand la page pose `mono` sur le chiffre (la plupart le font) : à cette taille, la
   police à chasse fixe espaçait trop les chiffres. Ils restent de largeur égale (tabular-nums). */
.stat-value {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 620;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.delta.up { color: var(--success); background: var(--success-dim); }
.delta.down { color: var(--accent-hover); background: var(--accent-dim); }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px 1px var(--success-dim);
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--success);
  font-weight: 600;
  flex-shrink: 0;
}

.grid-main,
.lower-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  align-items: start;
}

/* Le graphe et l'activité récente sont à égalité : une courbe a besoin de largeur, mais un graphe
   plus large que la colonne voisine déséquilibrait visiblement la page. `minmax(0, 1fr)` parce qu'un
   `1fr` nu ne descend pas sous la largeur minimale du contenu — la légende du graphe, ici. */
.lower-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  /* Les deux cartes descendent à la même hauteur : sinon la plus courte laissait un vide au-dessus de
     la carte suivante de la page, et la rangée se terminait en escalier. */
  align-items: stretch;
}

.lower-grid > .card {
  display: flex;
  flex-direction: column;
}

/* Le graphe prend toute la hauteur restante de sa carte. Réservé à cette rangée : sur la page Logs du
   bot, les deux graphes sont au contraire posés au bas de leur carte, à hauteur égale. */
.lower-grid .mod-chart-card .rl-chart {
  flex: 1;
  min-height: 208px;
}

@media (max-width: 980px) {
  .grid-main,
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

.hero-card,
.breakdown-card,
.mod-chart-card,
.activity-card {
  margin-bottom: 0;
}

.hero-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 540;
}

/* Le grand chiffre en Geist et non plus à chasse fixe, comme les chiffres du site. */
.hero-value {
  font-family: var(--font-sans);
  font-size: 40px;
  font-weight: 650;
  line-height: 1.05;
  margin: 10px 0 2px;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.quick-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.qa {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--btn-secondary-bg);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 560;
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), scale 0.4s var(--ressort);
}

.qa:hover {
  border-color: var(--border-hover);
  background: var(--btn-secondary-hover);
}

.qa:active {
  scale: 0.96;
}

.qa-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 13px;
  background: var(--gradient-brand);
  color: #fff;
  flex-shrink: 0;
}

/* ---------- Synchro média (Paramètres → Médias) ---------- */

.media-sync-progress {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--well-strong);
  margin: 14px 0 0;
}

.media-sync-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-brand);
  transition: width 0.35s var(--ease-out);
}

.media-sync-progress--indeterminate .media-sync-progress-fill {
  left: -30%;
  animation: mediaSyncIndeterminate 1.1s ease-in-out infinite;
}

@keyframes mediaSyncIndeterminate {
  0% {
    left: -30%;
  }
  100% {
    left: 100%;
  }
}

.media-sync-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.media-sync-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  min-width: 112px;
}

.media-sync-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.media-sync-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.breakdown-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 14px;
  background: var(--well-strong);
}

.breakdown-seg {
  height: 100%;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-val {
  font-weight: 600;
  color: var(--text);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.chart-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

.mod-chart-wrap {
  margin-top: 8px;
}

/* Synthèse des Logs du bot : neuf mesures compactes dans une seule carte, là où neuf cartes empilées
   repoussaient les graphiques sous la ligne de flottaison. */
.bl-synthese {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 14px 10px;
}

.bl-mesure {
  min-width: 0;
  padding: 2px 0;
}

.bl-mesure-valeur {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.01em;
}

.bl-mesure-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.bl-mesure-puce {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bl-mesure-note {
  margin-top: 2px;
  padding-left: 13px;
  font-size: 10.5px;
  color: var(--text-faint);
}

/* Les deux graphes des Logs du bot, côte à côte et de hauteur égale. Le tracé est poussé en bas de
   sa carte (`margin-top: auto`) : sans ça, la légende de l'un et le paragraphe de l'autre décaleraient
   les deux courbes l'une par rapport à l'autre. */
.bl-charts {
  display: grid;
  /* minmax(0, 1fr) et non 1fr : un `1fr` nu ne descend pas sous la largeur minimale de son contenu,
     et la légende à sept entrées volait alors les trois quarts de la ligne. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.bl-charts > .card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.bl-charts .card-desc {
  margin-bottom: 0;
}

.bl-charts .rl-chart {
  margin-top: auto;
  padding-top: 12px;
}

@media (max-width: 1100px) {
  .bl-charts {
    grid-template-columns: 1fr;
  }
}

/* Prévisualisation « en tant que grade » : jaune d'avertissement, impossible à confondre avec le reste
   du dashboard, et présent sur toutes les pages tant qu'elle dure. */
.preview-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 var(--shell-gap) var(--shell-gap);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(245, 185, 78, 0.45);
  background: rgba(245, 185, 78, 0.12);
  color: #f5d99e;
  font-size: 13.5px;
  line-height: 1.45;
}

.preview-banner[hidden] {
  display: none;
}

.preview-banner-icon {
  font-size: 17px;
  line-height: 1;
}

.preview-banner-text {
  flex: 1;
  min-width: 220px;
}

.preview-banner-text strong {
  color: #ffe9bf;
}

.preview-banner-exit {
  border: 1px solid rgba(245, 185, 78, 0.6);
  background: rgba(245, 185, 78, 0.18);
  color: #ffe9bf;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.preview-banner-exit:hover {
  background: rgba(245, 185, 78, 0.3);
  transform: translateY(-1px);
}

/* ---------------- Avertissement d'inactivité (auth.js) ----------------
   Position fixe et non dans le flux, contrairement au bandeau de prévisualisation : il apparaît deux
   minutes avant la déconnexion, donc souvent pendant une lecture, le contenu déroulé loin du haut de
   page. Dans le flux il serait apparu hors de l'écran, au moment précis où il fallait le voir. */

.idle-banner {
  position: fixed;
  /* Sous la barre du haut, pas par-dessus : centré en haut de l'écran, il recouvrait la recherche et le
     bouton de déconnexion — de quoi gêner précisément la personne qu'on vient d'alerter. */
  top: calc(var(--header-h) + var(--shell-gap) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(680px, calc(100vw - 2 * var(--shell-gap)));
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-hover);
  background: rgba(40, 12, 16, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.idle-banner[hidden] {
  display: none;
}

.idle-banner-icon {
  font-size: 17px;
  line-height: 1;
}

.idle-banner-text strong {
  /* Le compte à rebours : c'est le seul chiffre de la phrase, il doit se lire d'un coup d'œil et ne pas
     faire sautiller le texte à chaque seconde — d'où la chasse fixe. */
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--accent-hover);
}

.idle-banner-btn {
  border: 1px solid var(--border-hover);
  background: var(--accent-dim);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.idle-banner-btn:hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
}

/* Sur un écran étroit la phrase et le bouton passent à la ligne : une pastille à bords ronds devient
   alors une grosse bulle difforme. Même bandeau, coins simplement adoucis. */
@media (max-width: 720px) {
  .idle-banner {
    border-radius: 16px;
    text-align: center;
  }
}

/* Le fond du bandeau est une couleur en dur (il doit rester opaque par-dessus n'importe quel contenu),
   donc il ne suit pas les variables : en thème clair, il serait resté une pastille noire. */
html[data-theme="light"] .idle-banner {
  background: rgba(255, 252, 252, 0.95);
}

/* Motif d'une déconnexion automatique, sur l'écran de connexion : une information, pas un échec —
   d'où un ton neutre là où .login-error est rouge. */
.login-notice {
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-notice[hidden] {
  display: none;
}

/* ---------------- Graphiques (rl-chart.js) ---------------- */

.rl-chart {
  position: relative;
  margin-top: 10px;
  min-height: 208px;
}

.rl-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.rl-chart-grille {
  stroke: var(--border-soft);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.rl-chart-axe-y,
.rl-chart-axe-x {
  fill: var(--text-faint);
  font-size: 10.5px;
  font-family: inherit;
}

.rl-chart-axe-y { text-anchor: end; }
.rl-chart-axe-x { text-anchor: middle; text-transform: capitalize; }

.rl-chart-ligne {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.rl-chart-repere {
  stroke: var(--border-hover);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.rl-chart-pastille {
  stroke: var(--bg);
  stroke-width: 2;
  pointer-events: none;
}

/* Infobulle : posée au-dessus du tracé, elle ne doit jamais intercepter la souris. */
.rl-chart-bulle {
  position: absolute;
  top: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(20, 10, 12, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 11.5px;
  white-space: nowrap;
  z-index: 3;
}

/* `display: flex` l'emporte sur l'attribut `hidden` du navigateur : sans cette ligne, l'infobulle
   vide reste visible dans le coin du graphe, par-dessus la graduation. */
.rl-chart-bulle[hidden] {
  display: none;
}

.rl-bulle-date {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.rl-bulle-ligne {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.rl-bulle-ligne strong {
  margin-left: auto;
  padding-left: 12px;
  color: var(--text);
}

.mod-chart-svg {
  display: block;
  width: 100%;
  height: 140px;
  overflow: visible;
}

.mod-chart-days {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: capitalize;
}

.activity-head h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-row:last-child {
  border-bottom: none;
}

.a-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--bg-card);
  color: var(--text-muted);
}

.a-badge.ban { background: var(--accent-dim); color: var(--accent-hover); }
.a-badge.mute { background: var(--warning-dim); color: var(--warning); }
.a-badge.warn { background: rgba(255, 150, 150, 0.14); color: #ffb3b8; }
.a-badge.ticket { background: var(--success-dim); color: var(--success); }
.a-badge.quarantine { background: rgb(200 107 255 / 0.12); color: #d79bff; }

html[data-theme="light"] .a-badge.warn { color: var(--danger-texte); background: rgb(196 18 60 / 0.08); }
html[data-theme="light"] .a-badge.quarantine { color: var(--violet); }

.a-main {
  flex: 1;
  min-width: 0;
}

.a-title {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.a-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.a-time {
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ---------- Charts ---------- */

.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.pie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.pie-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.pie-grid-compact .pie-wrap {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .two-col-layout {
    grid-template-columns: 1fr;
  }
}

.pie-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.pie-chart-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease-out);
}

.pie-chart-wrap:hover {
  transform: scale(1.04);
}

.pie-chart {
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border), 0 10px 26px -14px rgba(0, 0, 0, 0.7), 0 0 30px var(--accent-dim);
  transition: box-shadow var(--dur) var(--ease-out);
}

.pie-chart-wrap:hover .pie-chart {
  box-shadow: 0 0 0 1px var(--border-hover), 0 14px 34px -14px rgba(0, 0, 0, 0.8), 0 0 44px var(--accent-dim);
}

.pie-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  animation: fadeIn var(--dur-slow) var(--ease) both;
  animation-delay: 0.15s;
}

.pie-center-value {
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.pie-center-sub {
  color: var(--text-muted);
  margin-top: 2px;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}

.pie-legend strong {
  color: var(--text);
}

.pie-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chart-card {
  overflow-x: auto;
}

.mod-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px 28px;
}

.chart-title-total {
  color: var(--text);
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(64px, 120px) 1fr 30px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.bar-row-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.bar-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Générateur Components V2 / Embed — l'éditeur (barre d'outils, cartes de blocs, panneau JSON, envoi)
   adopte le thème verre noir/rouge du dashboard comme le reste de l'interface : les variables ci-dessous
   qui n'ont pas d'équivalent global (--panel*, --text-dim, --radius local, --mono, --sans) sont redéfinies
   ici, tandis que --border/--text/--text-faint/--accent/--danger/--success héritent directement de :root.
   Seul l'aperçu du message (.preview-frame et son contenu .dc-*, voir plus bas) reste figé dans les
   couleurs et la police de Discord, quel que soit le thème du dashboard — voir la re-définition locale
   de --accent/--mono/font-family sur .preview-frame. */

.discord-generator {
  --panel: var(--bg-card);
  --panel-2: var(--bg-input);
  --panel-3: var(--bg-card-hover);
  --text-dim: var(--text-muted);
  --radius: var(--radius-sm);
  --mono: var(--font-mono);
  --sans: var(--font-sans);

  background: linear-gradient(160deg, var(--bg-card-hover), var(--bg-card) 60%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-md);
}

.discord-generator * {
  box-sizing: border-box;
}

.discord-generator .layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 880px) {
  .discord-generator .layout {
    grid-template-columns: 1fr;
  }
}

.discord-generator .col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 0 0 10px;
}

.discord-generator .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.discord-generator .toolbar button {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.discord-generator .toolbar button:hover {
  background: var(--panel-3);
  border-color: var(--accent);
}

.discord-generator .toolbar .danger-link {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.discord-generator .toolbar .danger-link:hover {
  color: var(--danger);
}

.discord-generator .empty-state,
.discord-generator .empty-hint {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.discord-generator .empty-hint {
  padding: 10px;
}

.discord-generator .block-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.discord-generator .block-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
}

.discord-generator .block-type-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.discord-generator .tag-text { background: #1c3d3a; color: #5fd9c9; }
.discord-generator .tag-section { background: #2e2350; color: #b8a6f5; }
.discord-generator .tag-separator { background: #2c2d31; color: #96989d; }
.discord-generator .tag-gallery { background: #3d2233; color: #f2a6cf; }
.discord-generator .tag-actionrow { background: #1a2f52; color: #7fb3f5; }
.discord-generator .tag-container { background: #3d2f10; color: #f5c463; }

.discord-generator .block-actions {
  display: flex;
  gap: 4px;
}

.discord-generator .icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.discord-generator .icon-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.discord-generator .icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.discord-generator .icon-btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.discord-generator .block-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discord-generator .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discord-generator .field-label {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.discord-generator .field-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.discord-generator textarea,
.discord-generator input[type="text"],
.discord-generator select {
  width: 100%;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: var(--sans);
  resize: vertical;
}

/* ---------- Message de bienvenue : formulaire + aperçu façon Discord ---------- */

.welcome-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .welcome-layout {
    grid-template-columns: 1fr;
  }
}

.welcome-field-group-title {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 20px 0 10px;
}

.welcome-field-group-title:first-child {
  margin-top: 0;
}

.welcome-preview-wrap {
  position: sticky;
  top: 18px;
}

.welcome-preview-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}

/* Le fond et les couleurs ci-dessous imitent volontairement le thème sombre de Discord (pas les tokens du
   dashboard) : c'est un aperçu de ce que les membres verront réellement dans l'app, pas une carte du dashboard. */
.welcome-preview {
  background: #313338;
  border-radius: var(--radius-sm);
  padding: 8px;
}

.welcome-preview-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

.welcome-preview-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.welcome-preview-body {
  flex: 1;
  min-width: 0;
}

.welcome-preview-title {
  color: #f2f3f5;
  font-weight: 800;
  font-size: 15px;
  margin: 0 0 4px;
  overflow-wrap: break-word;
}

.welcome-preview-desc {
  color: #dbdee1;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.welcome-preview-footer {
  color: #949ba4;
  font-size: 11px;
  margin-top: 6px;
  overflow-wrap: break-word;
}

.welcome-preview-banner {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
  display: block;
}

.welcome-preview-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.welcome-preview-btn {
  padding: 7px 14px;
  border-radius: 8px;
  background: #4752c4;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.welcome-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.welcome-button-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.welcome-button-row input {
  flex: 1;
  min-width: 0;
}

.discord-generator textarea:focus,
.discord-generator input[type="text"]:focus,
.discord-generator select:focus {
  outline: none;
  border-color: var(--accent);
}

.discord-generator input[type="color"] {
  width: 40px;
  height: 28px;
  padding: 2px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
}

.discord-generator .hint {
  font-size: 11px;
  color: var(--text-faint);
}

.discord-generator .checkbox-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.discord-generator .checkbox-row input {
  cursor: pointer;
}

/* ---------- Bulle de chat flottante (voir chat-bubble.js) ---------- */

/* Bulle de chat : le rouge du bouton principal du site, en plus petit — elle recouvrait le coin des
   pages (tableaux, boutons « Enregistrer » en bas à droite). */
.chat-bubble-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 23px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 0 0 1px rgb(255 82 98 / 0.5), 0 14px 34px -10px var(--accent-glow), var(--shadow-md);
  z-index: 80;
  transition: scale 0.45s var(--ressort), box-shadow var(--dur-fast) var(--ease-out);
}

.chat-bubble-fab:hover {
  scale: 1.06;
}

.chat-bubble-fab:active {
  scale: 0.94;
}

.chat-bubble-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warning);
  color: #1a1200;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.chat-bubble-badge[hidden] {
  display: none;
}

.chat-bubble-panel {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  background: var(--popover-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  overflow: hidden;
  animation: fadeSlideIn 0.18s var(--ease) both;
}

.chat-bubble-panel[hidden] {
  display: none;
}

.chat-bubble-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.chat-bubble-tab {
  all: unset;
  flex: 1;
  text-align: center;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.chat-bubble-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.chat-bubble-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
}

.chat-bubble-body .unban-thread {
  flex: 1;
}

/* ---------- Boîte de réception Direction (page dédiée Owner, voir pages/directionchat.js) ---------- */

.direction-inbox {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  /* "stretch" (pas "start") : les deux colonnes doivent occuper toute la hauteur de la rangée pour que la
     boîte de conversation à droite puisse elle-même s'étirer jusqu'en bas (voir .interstaff-body plus bas). */
  align-items: stretch;
}

@media (max-width: 900px) {
  .direction-inbox {
    grid-template-columns: 1fr;
  }
}

.direction-inbox-list-col {
  max-height: 70vh;
  overflow-y: auto;
}

/* ---------- Jeu de comptage (voir pages/counting.js) ---------- */

.counting-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.counting-mode-card {
  all: unset;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.counting-mode-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.counting-mode-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.counting-mode-card-label {
  font-weight: 700;
  font-size: 14px;
}

.counting-mode-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.list-item.is-active {
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
}

.discord-generator .row-with-remove {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.discord-generator .row-with-remove > .field,
.discord-generator .row-with-remove > textarea,
.discord-generator .row-with-remove > .mini-button-editor,
.discord-generator .row-with-remove > .button-editor-wrap {
  flex: 1;
  min-width: 0;
}

.discord-generator .button-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.discord-generator .remove-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  margin-top: 1px;
}

.discord-generator .remove-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.discord-generator .add-link {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
}

.discord-generator .add-link:hover {
  text-decoration: underline;
}

.discord-generator .accessory-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.discord-generator .accessory-toggle button {
  flex: 1;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.discord-generator .accessory-toggle button.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 59, 78, 0.18);
}

.discord-generator .mini-button-editor {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--panel-2);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}

.discord-generator .mini-button-editor input,
.discord-generator .mini-button-editor select {
  width: auto;
  flex: 1;
  min-width: 90px;
}

.discord-generator .sub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.discord-generator .sub-toolbar button {
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
}

.discord-generator .sub-toolbar button:hover {
  color: var(--text);
  border-color: var(--accent);
}

.discord-generator .sub-block-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ancre l'aperçu dans les couleurs/police réelles de Discord — indépendant du thème du dashboard
   au-dessus (voir commentaire sur .discord-generator) : --accent sert au cercle d'avatar et au badge
   "APP" (bleu Discord plutôt que le rouge du dashboard), --mono à l'affichage du code inline. */
.discord-generator .preview-frame {
  --accent: #5865f2;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Couleur de texte de Discord, posée explicitement. L'aperçu héritait jusqu'ici du --text du
     dashboard, ce qui passait inaperçu tant que les deux étaient clairs — en thème clair, ce texte
     serait devenu noir sur le fond sombre de l'aperçu, donc illisible. */
  color: #dbdee1;
  background: #1a1b1e;
  border: 1px solid #232328;
  border-radius: 12px;
  padding: 16px;
}

.discord-generator .dc-msg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.discord-generator .dc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.discord-generator .dc-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.discord-generator .dc-username {
  font-size: 14.5px;
  font-weight: 600;
  color: #f2f3f5;
}

.discord-generator .dc-app-tag {
  font-size: 9.5px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.discord-generator .dc-timestamp {
  font-size: 11.5px;
  color: #949ba4;
}

.discord-generator .dc-body {
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.45;
}

.discord-generator .dc-empty-hint {
  color: #6d6f78;
  font-size: 13px;
  padding: 10px 0;
}

.discord-generator .dc-text-display {
  margin: 2px 0 4px;
}

.discord-generator .dc-h1 { font-size: 20px; font-weight: 700; color: #f2f3f5; margin: 6px 0 2px; }
.discord-generator .dc-h2 { font-size: 17px; font-weight: 700; color: #f2f3f5; margin: 5px 0 2px; }
.discord-generator .dc-h3 { font-size: 15px; font-weight: 700; color: #f2f3f5; margin: 4px 0 2px; }
.discord-generator .dc-subtext { font-size: 12px; color: #949ba4; margin: 2px 0; }
.discord-generator .dc-quote { border-left: 3px solid #4e5058; padding-left: 10px; color: #dbdee1; margin: 3px 0; }
.discord-generator .dc-p { margin: 2px 0; white-space: pre-wrap; }
.discord-generator .dc-spacer { height: 8px; }
.discord-generator .dc-list { margin: 2px 0; padding-left: 22px; }
.discord-generator .dc-list li { margin: 1px 0; }

.discord-generator .dc-code {
  background: #2b2d31;
  border: 1px solid #1e1f22;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #dbdee1;
}

.discord-generator .dc-link { color: #00a8fc; text-decoration: none; }
.discord-generator .dc-link:hover { text-decoration: underline; }

.discord-generator .dc-spoiler {
  background: #1a1b1e;
  color: transparent;
  border-radius: 3px;
  cursor: pointer;
  padding: 0 2px;
}

.discord-generator .dc-spoiler.revealed {
  background: #2c2d31;
  color: inherit;
}

.discord-generator .dc-section {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 4px 0;
}

.discord-generator .dc-section-content { flex: 1; min-width: 0; }
.discord-generator .dc-section-text:not(:last-child) { margin-bottom: 2px; }
.discord-generator .dc-thumb-wrap { flex-shrink: 0; }
.discord-generator .dc-thumb { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; display: block; }
.discord-generator .dc-section-btn-wrap { flex-shrink: 0; display: flex; align-items: center; min-height: 40px; }

.discord-generator .dc-separator { display: flex; align-items: center; }
.discord-generator .dc-sep-line { width: 100%; border-top: 1px solid #3f4147; }

.discord-generator .dc-gallery { display: grid; gap: 4px; margin: 4px 0; }
.discord-generator .dc-gallery-item { border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: #2b2d31; }
.discord-generator .dc-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.discord-generator .dc-action-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }

.discord-generator .dc-btn {
  padding: 2px 16px;
  height: 32px;
  border-radius: 3px;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--sans);
}

.discord-generator .dc-btn-1 { background: #5865f2; } .discord-generator .dc-btn-1:hover { background: #4752c4; }
.discord-generator .dc-btn-2 { background: #4e5058; } .discord-generator .dc-btn-2:hover { background: #6d6f78; }
.discord-generator .dc-btn-3 { background: #248046; } .discord-generator .dc-btn-3:hover { background: #1a6334; }
.discord-generator .dc-btn-4 { background: #da373c; } .discord-generator .dc-btn-4:hover { background: #a12828; }
.discord-generator .dc-btn-5 { background: #4e5058; } .discord-generator .dc-btn-5:hover { background: #6d6f78; }

.discord-generator .dc-container {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background: #2b2d31;
  margin: 6px 0;
}

.discord-generator .dc-container-accent { width: 4px; flex-shrink: 0; }
.discord-generator .dc-container-body { flex: 1; min-width: 0; padding: 12px 14px; }

.discord-generator .dc-container-spoiler .dc-container-body {
  filter: blur(6px);
  cursor: pointer;
  transition: filter 0.15s;
  user-select: none;
}

.discord-generator .dc-container-spoiler.revealed .dc-container-body {
  filter: none;
  cursor: default;
}

.discord-generator .json-panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-top: 16px;
  overflow: hidden;
}

.discord-generator .json-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border-soft);
}

.discord-generator .json-panel-header span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.discord-generator .component-count { font-size: 11px; color: var(--text-faint); }
.discord-generator .component-count.over-limit { color: var(--danger); font-weight: 600; }

.discord-generator .copy-btn {
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.discord-generator .copy-btn:hover { border-color: var(--accent); }

.discord-generator .json-output {
  margin: 0;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #b8dba8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}

.discord-generator .flags-note {
  padding: 0 12px 10px;
  font-size: 11px;
  color: var(--text-faint);
}

.discord-generator .send-panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-top: 12px;
  padding: 12px;
}

.discord-generator .send-panel .col-title { margin-bottom: 8px; }
.discord-generator .send-row { display: flex; gap: 8px; }
.discord-generator .send-row select { flex: 1; }

.discord-generator .send-row button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.discord-generator .send-row button:hover { background: var(--accent-hover); }

.discord-generator .send-row button.secondary-btn {
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text);
}

.discord-generator .send-row button.secondary-btn:hover {
  background: var(--panel-2);
  border-color: var(--accent);
}

.discord-generator .send-status { font-size: 12px; margin-top: 8px; color: var(--text-faint); min-height: 15px; }
.discord-generator .send-status.success { color: var(--success); }
.discord-generator .send-status.error { color: var(--danger); }

/* Aperçu d'embed classique */

.discord-generator .dc-embed {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  background: #2b2d31;
  max-width: 520px;
}

.discord-generator .dc-embed-accent {
  width: 4px;
  flex-shrink: 0;
}

.discord-generator .dc-embed-body {
  padding: 10px 16px 16px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.discord-generator .dc-embed-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.discord-generator .dc-embed-author img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.discord-generator .dc-embed-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.discord-generator .dc-embed-title a {
  color: #00a8fc;
  text-decoration: none;
}

.discord-generator .dc-embed-desc {
  font-size: 13px;
  color: #dbdee1;
  line-height: 1.375;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.discord-generator .dc-embed-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.discord-generator .dc-embed-field {
  min-width: 0;
}

.discord-generator .dc-embed-field.full {
  grid-column: 1 / -1;
}

.discord-generator .dc-embed-field-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.discord-generator .dc-embed-field-value {
  font-size: 13px;
  color: #dbdee1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.discord-generator .dc-embed-image {
  margin-top: 10px;
  border-radius: 4px;
  max-width: 100%;
  display: block;
}

.discord-generator .dc-embed-thumb-wrap {
  float: right;
  margin-left: 16px;
}

.discord-generator .dc-embed-thumb {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.discord-generator .dc-embed-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: #949ba4;
}

.discord-generator .dc-embed-footer img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- Espace inter-staff (page dédiée, onglets Staff/Direction — voir pages/interstaff.js) ----------
   Étirée jusqu'en bas de l'écran (calc sur --header-h/--shell-gap, les seuls repères fixes du châssis) plutôt
   que limitée à une hauteur fixe : la zone de lecture des messages doit rester utilisable même avec beaucoup
   d'historique, sans obliger à faire défiler toute la page. */
.interstaff-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 3 * var(--shell-gap));
  min-height: 420px;
}

.interstaff-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}

.interstaff-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.interstaff-body .unban-thread {
  flex: 1;
  max-height: none;
}

.interstaff-body .direction-inbox {
  flex: 1;
  min-height: 0;
}

.interstaff-body .direction-inbox-list-col,
.interstaff-body .direction-inbox-detail-col {
  max-height: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.interstaff-body .direction-inbox-list-col {
  overflow-y: auto;
}

/* ---------- Menu contextuel des messages (clic droit : modifier/supprimer — voir chat-ui.js) ---------- */

.chat-context-menu {
  position: fixed;
  z-index: 200;
  min-width: 160px;
  padding: 6px;
  background: var(--popover-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeSlideIn 0.12s var(--ease) both;
}

.chat-context-menu-item {
  all: unset;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.chat-context-menu-item:hover {
  background: var(--bg-card-hover);
}

.unban-message-edited {
  font-style: italic;
  opacity: 0.8;
}

/* ---------- Contact site (page dashboard + fil de conversation) ---------- */

.contact-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px;
}

.contact-message {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg-input);
}

/* Réponses de l'équipe décalées et accentuées : dans un fil long, il faut distinguer d'un coup d'œil
   qui a écrit quoi sans lire les en-têtes. */
.contact-message.is-staff {
  border-left: 3px solid var(--accent);
  margin-left: 24px;
}

.contact-message.is-visitor {
  margin-right: 24px;
}

.contact-message-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 12px;
}

.contact-message-body {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- Actions de l'en-tête du panneau de notifications ---------- */

.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Poubelle : suppression définitive, donc volontairement discrète au repos et rouge au survol —
   elle ne doit pas attirer le clic autant que "Tout marquer comme lu", qui est réversible. */
.notif-clear {
  display: inline-grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: var(--radius-sm);
  opacity: 0.55;
  transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.notif-clear:hover {
  opacity: 1;
  background: var(--danger-dim, rgba(239, 68, 68, 0.14));
}

/* Même traitement visuel que l'alerte de déban, pour que les deux se distinguent des notifications
   ordinaires au premier coup d'œil. */
.notif-item--contact {
  border-left: 3px solid var(--accent);
}

/* Éditeur du panneau de tickets : les deux colonnes (formulaire / aperçu) s'empilent sur écran étroit. */
@media (max-width: 900px) {
  .panel-editor-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ── Configuration en lecture seule ─────────────────────────────────────────────
   Posé par Ui.applyConfigLock (ui.js) sur les blocs marqués data-config quand la personne connectée n'a
   pas le droit de configurer ce module (Paramètres → Droits de modification). Volontairement 100 % CSS :
   le verrou n'ajoute aucun élément au DOM, pour ne pas fausser les sélecteurs des pages. */
.config-locked::before {
  content: "🔒 Lecture seule — la configuration de ce module est réservée au propriétaire du serveur.";
  display: block;
  margin-bottom: 14px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--warning-dim);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.config-locked :is(button, input, select, textarea):disabled,
.config-locked-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Filtres du graphique d'activité (page Modération) ──────────────────────────
   Chaque entrée de légende est un bouton qui masque ou réaffiche sa courbe. */
.chart-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.chart-filter:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.chart-filter.off {
  text-decoration: line-through;
}

.chart-filter .hint {
  font-weight: 500;
}

/* ---------- Écran de chargement ----------
   Même écran que sur la one-page (web/public/landing.html), pour que le passage du site au dashboard
   se lise comme une continuité et non comme deux applications différentes. Il couvre l'écran jusqu'à ce
   que auth.js ait tranché entre connexion, accès refusé et dashboard — avant ça, le corps de page est
   vide et laisserait voir un flash noir. Durée minimale d'affichage côté auth.js, pour éviter qu'il
   n'apparaisse et disparaisse en un clignotement sur une session déjà valide. */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.boot.done { opacity: 0; visibility: hidden; }

.boot::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px circle at 50% 38%, rgba(255, 59, 78, 0.26), transparent 62%),
    radial-gradient(900px circle at 50% 110%, rgba(255, 59, 78, 0.12), transparent 60%);
}

.boot-mark {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(34px, 8vw, 58px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(150deg, #ffffff 20%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: boot-breathe 1.8s ease-in-out infinite;
}

.boot-bar {
  position: relative;
  width: 180px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
/* Barre indéterminée : la durée du chargement n'est pas connue à l'avance, une progression chiffrée
   serait inventée. */
.boot-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: boot-slide 1.15s ease-in-out infinite;
}

@keyframes boot-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }
@keyframes boot-slide { 0% { left: -45%; } 100% { left: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .boot-mark, .boot-bar span { animation: none; }
  .boot-bar span { left: 0; width: 100%; opacity: 0.5; }
}

/* ---------- Champs date/heure ---------- */

/* L'icône native du sélecteur de date est dessinée en noir par le navigateur : invisible sur le fond
   sombre du dashboard. `invert` la repeint en clair, et elle ne prend la couleur d'accent qu'au survol,
   pour qu'on la repère sans qu'elle tire l'œil en permanence. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75) sepia(0.2) saturate(0.4);
  cursor: pointer;
  opacity: 0.7;
  border-radius: 4px;
  padding: 2px;
  transition: opacity var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  filter: invert(0.55) sepia(1) saturate(6) hue-rotate(-18deg);
}

/* Les sous-champs (jour/mois/année) sont des zones distinctes dans le champ : sans style propre, le
   segment en cours d'édition garde le surlignage bleu du système, hors charte. */
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="datetime-local"]::-webkit-datetime-edit-text {
  color: var(--text-faint);
  padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-day-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-month-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field:focus {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  outline: none;
}

/* ---------- Sélecteur de couleur ---------- */

/* Le <input type="color"> natif est un rectangle gris au bord système, impossible à styliser lui-même.
   Il est donc réduit à une pastille ronde (le champ garde tout son comportement : clic = palette de l'OS),
   posée dans un cadre qui affiche aussi la valeur hexadécimale. */
.color-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.color-field:hover {
  border-color: var(--border-hover);
}

.color-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.color-field input[type="color"] {
  /* -moz-color-swatch / -webkit-color-swatch : la pastille interne du champ. Sans ces règles, le
     navigateur garde une marge blanche autour de la couleur, qui trahit le rectangle d'origine. */
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.color-field input[type="color"]:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), var(--shadow-md);
}

/* Le générateur Components V2 avait sa propre règle pour le champ natif (rectangle 40x28 avec marge) —
   antérieure à ce composant. Les propriétés qu'elle est seule à poser survivraient à l'intérieur du cadre. */
.color-field input[type="color"] {
  margin-left: 0;
  vertical-align: baseline;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-field input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Champ hexadécimal : même valeur que la pastille, saisissable au clavier (copier-coller d'une couleur de
   charte, ce que la palette de l'OS ne permet pas toujours). */
.color-field-hex {
  width: 84px;
  padding: 4px 8px !important;
  border: none !important;
  background: none !important;
  color: var(--text) !important;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.color-field-hex:focus {
  outline: none;
  box-shadow: none !important;
}

/* Raccourcis vers les couleurs de la charte : la plupart des embeds reprennent l'une d'elles, les
   proposer évite d'ouvrir la palette système pour un rouge qu'on retapait de mémoire. */
.color-field-presets {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
}

.color-preset {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.75;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.color-preset:hover {
  transform: scale(1.25);
  opacity: 1;
}

.color-preset.is-current {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--text);
}

/* ---------- Sélection multiple (menu déroulant à cases) ---------- */

/* Reprend le menu de .searchable-select : même champ, même liste, mêmes animations. Seules changent la
   case à cocher devant chaque ligne et la liste de puces sous le champ. */
.multi-select-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.multi-select-check {
  flex: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border-hover);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: transparent;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.searchable-select-item.is-selected .multi-select-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* La ligne sélectionnée ne se teinte pas en entier comme dans un menu à choix unique : avec plusieurs
   lignes cochées, l'aplat rouge saturait la liste. La coche suffit à marquer l'état. */
.searchable-select-item.is-selected.multi-select-item {
  background: none;
  color: var(--text);
  font-weight: 500;
}

.searchable-select-item.is-selected.multi-select-item:hover,
.searchable-select-item.is-selected.multi-select-item.is-active {
  background: var(--bg-card);
}

.multi-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.multi-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 11px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  max-width: 260px;
}

.multi-select-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-chip button {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.multi-select-chip button:hover {
  background: var(--danger);
  color: #fff;
}

.multi-select-empty {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 8px;
}

/* Indication d'un champ à corriger, sous un champ de formulaire : plus visible qu'un .hint ordinaire
   sans passer par un bandeau d'erreur, qui serait disproportionné pour une saisie encore en cours. */
.hint-warning {
  color: var(--warning);
}

/* ---------- Formation du staff : invitation d'accueil et rappel ----------
   La formation vit sur le site public (www.red-light.fr/test-staff) et non dans le dashboard : c'est la
   même page pour ceux qui n'ont pas encore l'accès staff. Le dashboard se contente d'y renvoyer, une
   fois à l'ouverture, puis discrètement sous le badge tant qu'elle n'est pas validée. */

.formation-modal {
  border: none;
  padding: 0;
  background: transparent;
  /* Un <dialog> ne suit pas la couleur de texte de la page : sans cette ligne, il repart du noir du
     navigateur, illisible sur le fond sombre du dashboard. .modal pose la même. */
  color: var(--text);
  max-width: 520px;
  width: calc(100% - 32px);
}

.formation-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.formation-modal-inner {
  border-radius: 20px;
  border: 1px solid var(--border);
  /* Fond OPAQUE sous le dégradé : les jetons --bg-card sont translucides (ils comptent sur le
     backdrop-filter des panneaux). Posés seuls sur un <dialog>, ils laissaient lire le logo de la page
     au travers du texte. La couleur de base ferme la carte, le dégradé lui garde son relief. */
  background: linear-gradient(160deg, var(--bg-card-hover), var(--bg-card) 60%), var(--bg);
  padding: 30px 30px 24px;
  text-align: center;
  box-shadow: 0 0 0 1px var(--accent-dim), 0 30px 80px rgba(0, 0, 0, 0.5);
}

.formation-modal-ico { font-size: 40px; line-height: 1; margin-bottom: 12px; color: var(--accent-hover); }
.formation-modal-inner h2 { margin: 0 0 12px; font-size: 21px; letter-spacing: -0.01em; }
.formation-modal-inner > p { margin: 0 auto 18px; max-width: 400px; color: var(--text-muted); font-size: 14.5px; line-height: 1.65; }

.formation-modal-points {
  text-align: left;
  margin: 0 0 18px;
  padding: 14px 18px 14px 34px;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
}
.formation-modal-points li + li { margin-top: 6px; }

.formation-modal-meta { font-size: 12.5px; color: var(--text-muted); margin: 0 0 20px; }

.formation-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.formation-modal-actions .btn { flex: 1 1 auto; min-width: 160px; justify-content: center; }

/* Rappel sous le badge. Ancré sur .topbar-right (position:relative), comme le panneau de
   notifications : calé sur le coin droit de la barre, pas sur le badge seul. */
.formation-nudge {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(255, 31, 77, 0.28);
  animation: formation-nudge-in 0.3s ease both;
}

.formation-nudge:hover { filter: brightness(1.07); }
.formation-nudge[hidden] { display: none; }

/* La flèche qui rattache la pastille au badge : sans elle, elle flotte sans qu'on sache de quoi elle parle. */
.formation-nudge::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 24px;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: var(--accent);
}

@keyframes formation-nudge-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .formation-nudge { animation: none; }
}

/* Remise à niveau exigée d'un demandeur de débannissement (page Demandes de unban). */
.unban-quiz-state {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-input);
  font-size: 13.5px;
  line-height: 1.55;
}
.unban-quiz-state.ok { border-left-color: var(--success); }
.unban-quiz-state .hint { display: inline-block; margin-top: 4px; }

/* ── Fiche membre : les rôles en colonne de droite ───────────────────────────────────────────────
   Les couleurs des pastilles viennent des rôles Discord eux-mêmes et sont posées en style inline par
   pages/member-profile.js : elles changent d'un serveur à l'autre et ne peuvent pas vivre ici. */
.member-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

/* Sous cette largeur, la colonne des rôles passe simplement dessous : la fiche s'ouvre dans une
   fenêtre, qui est déjà étroite sur un portable. */
@media (max-width: 1100px) {
  .member-top { grid-template-columns: 1fr; }
}

/* Les rôles sont partis dans le volet : la colonne qui leur était réservée doit disparaître, sinon
   elle laisse 320 px de vide à droite du contenu de la pop-up. */
.member-top--solo { grid-template-columns: 1fr; }

.role-group + .role-group { margin-top: 13px; }

.role-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 7px;
}

.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.role-chip img { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; }

/* ── Volet latéral d'une pop-up (rôles de la fiche membre) ───────────────────────────────────────
   Un panneau distinct, posé À CÔTÉ de la modale et non à l'intérieur. Il vit dans la "top layer"
   (popover="manual") : c'est le seul moyen de passer au-dessus du fond assombri d'un <dialog>, et
   l'`overflow` de la modale ne peut donc pas le rogner. Sa position est calculée en JS à partir de
   celle de la modale, qui dépend de la largeur de l'écran. */
.side-panel {
  position: fixed;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  /* Le navigateur impose `color: CanvasText` à tout élément [popover], soit du NOIR sur ce thème
     sombre. Sans cette reprise, le titre du volet — seul texte qui hérite, les autres ayant leur
     propre couleur — s'affichait en noir sur fond noir. */
  color: var(--text);
  overflow: visible;
  width: 320px;
}

.side-panel:popover-open {
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.28s var(--ease) both;
}

/* Le volet est SOUDÉ à la tranche droite de la pop-up : bordure gauche retirée et coins du HAUT
   aplatis des deux côtés de la jointure. Sans ça, deux cartes arrondies posées bord à bord laissent
   une couture visible.
   Sa hauteur suit son contenu (`auto`) et s'arrête là où finissent les rôles : la forcer à celle de
   la pop-up ouvrait un grand rectangle vide sous le dernier rôle. Les coins du BAS restent donc
   arrondis de part et d'autre, chaque bloc finissant à sa propre hauteur. */
.side-panel .card {
  margin: 0;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
  border-top-left-radius: 0;
  border-left: none;
}

.modal--with-side {
  border-top-right-radius: 0;
}

/* Défilement sans languette : le contenu défile toujours (molette, tactile, clavier), seule la barre
   disparaît. Elle traversait la jointure entre la pop-up et son volet, et coupait l'ensemble en deux. */
.modal,
.side-panel .card {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal::-webkit-scrollbar,
.side-panel .card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* La pop-up reste CENTRÉE à l'écran ; c'est sa largeur qui cède pour que le volet tienne à sa droite.
   Un `margin-right` fixe avait l'effet inverse de celui recherché : la marge gauche, en `auto`,
   absorbait tout le reste et l'ensemble penchait visiblement à droite.
   320 px de volet + 16 px de marge, comptés DEUX fois pour que le centrage soit préservé. */
.modal--with-side {
  width: min(920px, calc(100vw - 704px));
}

/* ---------- Conversation en pleine page (demandes de déban, Contact site) ----------
   Remplace la fenêtre d'avant (23/11/2026, demande du propriétaire) : on y voyait cinq messages à la fois.
   Infos à gauche, fil et zone de réponse à droite sur toute la hauteur restante de l'écran — la hauteur
   est posée par Ui.ajusterVuePleine, mesurée sous la barre du haut et au-dessus de la bulle de chat. */
.conv-vue {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  min-height: 420px;
}

.conv-infos,
.conv-fil {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--carte-haut), var(--carte-bas));
  border: 1px solid var(--border);
  box-shadow: var(--reflet);
}

.conv-infos {
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.conv-infos .field { margin-bottom: 0; }
.conv-infos .conv-actions { display: flex; flex-direction: column; gap: 8px; }
.conv-infos .conv-actions .btn { justify-content: center; width: 100%; }

.conv-retour { align-self: flex-start; }

.conv-fil-tete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.conv-fil-tete img,
.conv-fil-tete .unban-avatar {
  width: 36px;
  height: 36px;
  margin: 0;
}

.conv-fil-titre { min-width: 0; display: flex; flex-direction: column; }
.conv-fil-titre strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-fil-titre span { font-size: 12px; color: var(--text-muted); }
.conv-fil-tete .tag { margin-left: auto; }

/* Le fil prend toute la place libre et défile seul : la zone de réponse reste toujours visible en bas. */
.conv-fil .unban-thread {
  flex: 1;
  max-height: none;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 18px 22px;
}

.conv-fil .unban-row { max-width: min(72%, 760px); }

.conv-saisie {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border-soft);
}

.conv-saisie .hint { margin: 8px 0 0; }

@media (max-width: 900px) {
  .conv-vue {
    grid-template-columns: 1fr;
    height: auto !important;
  }
  .conv-fil .unban-thread { max-height: 60vh; min-height: 260px; }
}

/* ---------- Vote du staff sur une demande de déban (colonne de gauche de la conversation) ---------- */
.vote-bloc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
}
.vote-bloc .btn { justify-content: center; width: 100%; }
.vote-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vote-chiffres { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vote-chiffres span { display: inline-flex; align-items: center; gap: 6px; }
.vote-pour { color: var(--success); }
.vote-contre { color: var(--danger-texte); }
/* La barre des anciens « j'aime / je n'aime pas » : vert pour, rouge contre, grise tant que personne n'a voté. */
.vote-barre { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--border); }
.vote-barre-pour { background: var(--success); transition: width var(--dur-fast) var(--ease-out); }
.vote-barre-contre { background: var(--danger); transition: width var(--dur-fast) var(--ease-out); }
.vote-barre--vide span { background: transparent; }
.vote-noms { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.vote-liens { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; }
.vote-liens a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-hover); text-decoration: none; }
.vote-liens a:hover { text-decoration: underline; }
