/* Gestion d'un serveur, commune au portail et à l'interface d'administration :
   ce qui n'est pas dans le système de composants (ammit.css) — éditeur au
   format Discord et son aperçu (thème sombre de Discord), personnalisation
   des salons et rôles, sélecteurs d'émojis et de styles, modération,
   statistiques, mise en place des journaux. */

/* ------------------------------------------------------------- formulaires */
.manage .row-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.manage form.refuse input { width: 11rem; padding: .3rem .5rem; }
.manage pre.plain { white-space: pre-wrap; font: inherit; margin: 0 0 .5rem; }
.manage .notice.warn { border-left-color: var(--warn); }

/* ------------------------------------------------------------------ éditeur */
.editor { display: flex; flex-direction: column; gap: .4rem; }
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .35rem;
  border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface-2);
}
.editor-toolbar .tool {
  font: inherit; font-size: .88rem; min-width: 2rem; padding: .25rem .5rem; border-radius: 5px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); cursor: pointer; font-weight: 500;
}
.editor-toolbar .tool:hover { border-color: var(--accent); background: var(--surface); color: var(--text); }
.editor-toolbar .tool.var { font-family: var(--font-mono); font-size: .8rem; }
.editor-toolbar .tool-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 .2rem; }
.editor-toolbar .tool-pick { font-size: .85rem; padding: .25rem 1.6rem .25rem .4rem; max-width: 11rem; width: auto; }
.editor-input { font-family: inherit; min-height: 6rem; }
.editor-foot { display: flex; justify-content: flex-end; font-size: .82rem; }
.editor-count.over { color: var(--bad); font-weight: 600; }

/* Aperçu au rendu de Discord (thème sombre de Discord dans les deux interfaces). */
.discord-preview { background: #313338; color: #dbdee1; border-radius: 8px; padding: .7rem .9rem; font-size: .95rem; line-height: 1.4; }
.discord-preview .dp-label { display: block; color: #949ba4; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem; }
.discord-preview .dp-body { overflow-wrap: anywhere; }
.discord-preview .dp-gap { height: .7em; }
.discord-preview h3.dp-h { font-size: 1.5rem; margin: .3rem 0; color: #f2f3f5; }
.discord-preview h4.dp-h { font-size: 1.25rem; margin: .3rem 0; color: #f2f3f5; }
.discord-preview h5.dp-h { font-size: 1.05rem; margin: .3rem 0; color: #f2f3f5; }
.discord-preview .dp-sub { font-size: .8rem; color: #949ba4; }
.discord-preview ul, .discord-preview ol { margin: .2rem 0; padding-left: 1.4rem; }
.discord-preview blockquote { margin: .2rem 0; padding-left: .7rem; border-left: 4px solid #4e5058; }
.discord-preview code { background: #2b2d31; color: #dbdee1; padding: .1em .3em; border-radius: 4px; font-size: .88em; }
.discord-preview pre.dp-code { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: .5rem; white-space: pre-wrap; margin: .3rem 0; font-size: .85rem; }
.discord-preview a { color: #00a8fc; }
.discord-preview .dp-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 .15em; font-weight: 500; }
.discord-preview .dp-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; }
.discord-preview .dp-spoiler:hover { color: #dbdee1; }
.discord-preview .dp-emoji { width: 1.375em; height: 1.375em; vertical-align: bottom; }
.discord-preview .dp-empty { color: #949ba4; font-style: italic; }
.discord-preview .dp-embed { background: #2b2d31; border-left: 4px solid #1abc9c; border-radius: 4px; padding: .6rem .8rem; max-width: 520px; }
.discord-preview .dp-embed-title { font-weight: 700; color: #f2f3f5; margin-bottom: .3rem; }
.discord-preview .dp-embed-image { color: #949ba4; font-size: .8rem; margin-top: .4rem; overflow-wrap: anywhere; }
.discord-preview .dp-embed-footer { color: #949ba4; font-size: .78rem; margin-top: .5rem; }

/* ----------------------------------------------------- messages permanents */
.permanent { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1rem; margin: 0 0 .8rem; background: var(--bg-2); }
.permanent > summary { cursor: pointer; padding: .75rem 0; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-weight: 500; }
.permanent[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: .8rem; }
.permanent > form, .permanent > .actions-row { margin-bottom: .8rem; }

/* ---------------------------------------------------------- personnalisation */
.tree { display: flex; flex-direction: column; gap: .2rem; }
.tree-group { border-bottom: 1px solid var(--border); padding: .3rem 0; }
.tree-group:last-child { border-bottom: 0; }
.tree-item { padding: .25rem .4rem; border-radius: var(--radius-s); }
.tree-item:target { outline: 2px solid var(--accent); }
.tree-item.nested { margin-left: 1.5rem; }
.tree-category > .tree-line .tree-name { font-weight: 700; }
.tree-line { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tree-name { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.tree-actions { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.tree-edit { margin: .2rem 0 .3rem; }
.tree-edit > summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.tree-edit[open] { border: 1px solid var(--border); border-radius: var(--radius-s); padding: .6rem .8rem; background: var(--bg-2); }
.role-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .4rem; background: var(--muted); vertical-align: middle; }
.role-pick .choice-list { max-height: 10rem; }
.template { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1rem; margin: 0 0 .8rem; }
.template > summary { cursor: pointer; padding: .75rem 0; font-weight: 500; }
.template-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.template-grid fieldset { display: flex; flex-direction: column; gap: .3rem; }
.template-grid .stat-card.chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* -------------------------------------------------------------- publications */
.answers { display: flex; flex-direction: column; gap: .4rem; }
.answer-row { display: grid; grid-template-columns: 5rem 1fr; gap: .5rem; }
.poll-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.poll-results li { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr auto; gap: .8rem; align-items: center; }
.poll-results meter { width: 100%; }
.editor-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.editor-list li { display: flex; gap: .6rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--border); }

/* -------------------------------------------------------------- statistiques */
.stats-chart { width: 100%; height: auto; max-height: 240px; display: block; }
.stats-chart rect { fill: var(--accent); }
.stats-chart rect:hover { fill: var(--accent-strong); }
.stats-chart text { fill: var(--muted); font-size: 9px; }
.stats-chart line { stroke: var(--border); stroke-width: .5; }
.member-cell { min-width: 180px; }
.member-cell .avatar { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: .45rem; float: left; }
.member-title { margin: 0; font-size: 1.4rem; }
.role-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.role-badge { display: inline-flex; align-items: center; }
.heatmap { display: grid; grid-template-columns: auto repeat(24, 1fr); gap: 2px; font-size: .72rem; }
.heatmap .heat-label { color: var(--muted); padding-right: .4rem; white-space: nowrap; }
.heatmap .heat-cell { aspect-ratio: 1; border-radius: 2px; background: var(--surface-2); }

/* ------------------------------------- émojis, symboles et styles de texte */
.name-field { display: flex; gap: .35rem; align-items: stretch; }
.name-field input { flex: 1; min-width: 0; }
.name-tool {
  font: inherit; padding: 0 .55rem; border-radius: var(--radius-s); cursor: pointer; flex: none;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.name-tool:hover { border-color: var(--accent); background: var(--surface-2); color: var(--text); }
.picker {
  position: absolute; z-index: 60; width: min(380px, 92vw); max-height: 340px; overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-l);
  box-shadow: var(--shadow); padding: .5rem;
}
.picker-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .4rem; position: sticky; top: -.5rem; background: var(--surface); padding: .25rem 0; }
.picker-tabs button {
  font: inherit; font-size: .82rem; padding: .25rem .6rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.picker-tabs button.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.2rem, 1fr)); gap: .2rem; }
.picker-grid button {
  font-size: 1.25rem; line-height: 1; padding: .35rem 0; border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text);
}
.picker-grid button:hover { background: var(--surface-2); border-color: var(--border); }
.picker-list { display: flex; flex-direction: column; gap: .15rem; }
.picker-list button {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; text-align: left;
  font: inherit; padding: .45rem .6rem; border-radius: var(--radius-s); cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid transparent;
}
.picker-list button:hover { background: var(--surface-2); border-color: var(--border); }
.picker-label { color: var(--muted); font-size: .82rem; flex: none; }
.picker-sample { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- modération */
.comment-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .6rem; }
.comment-list li { border: 1px solid var(--border); border-radius: var(--radius-s); padding: .5rem .7rem; background: var(--bg-2); }
.comment-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .2rem; }
.comment-head form { margin-left: auto; }
.item-actions { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.item-actions form { display: flex; flex-direction: column; gap: .5rem; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: .35rem 0 .7rem 1.1rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .75rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .when { color: var(--muted); font-size: .82rem; }
.timeline .what { font-weight: 600; }
.transcript { max-height: 420px; overflow: auto; background: var(--bg-2); border-radius: var(--radius-s); padding: .6rem; font-size: .85rem; }
.question-row { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center; }
.finding { border-left: 4px solid var(--border); padding: .4rem .7rem; margin: 0 0 .6rem; background: var(--bg-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.finding.erreur { border-color: var(--bad); }
.finding.attention { border-color: var(--warn); }
.finding.info { border-color: var(--accent); }

/* --------------------------------------------- mise en place des journaux */
.proposal { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 0; border-top: 1px solid var(--border); }
.proposal-text { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 260px; }
.proposal-actions, .proposal-actions form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }

@media (max-width: 760px) {
  .tree-item.nested { margin-left: .75rem; }
  .poll-results li { grid-template-columns: 1fr; gap: .2rem; }
  .question-row { grid-template-columns: 1fr; }
}

/* Couleur d'un rôle : palette de Discord, sélecteur, code en option. */
.colour-field { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.colour-field label { margin: 0; }
.colour-field input[type="color"] { width: 2.3rem; height: 2.3rem; padding: .15rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding-bottom: .35rem; }
button.swatch { width: 1.45rem; height: 1.45rem; min-height: 0; min-width: 0; padding: 0; line-height: 0; border-radius: 50%; border: 2px solid transparent; background: var(--surface-2); box-shadow: none; }
button.swatch.none { background: transparent; border: 2px dashed var(--muted); }
button.swatch.selected, button.swatch:focus-visible { border-color: var(--text); outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* Assistant de configuration : étapes, actions, points à vérifier. */
.wizard-steps { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.wizard-steps a { display: inline-flex; align-items: center; gap: .45rem; padding: .32rem .7rem .32rem .35rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .86rem; background: var(--surface); }
.wizard-steps a:hover { color: var(--text); border-color: var(--border-strong); }
.wizard-steps .num { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--surface-3); font-size: .78rem; font-weight: 600; }
.wizard-steps .state-enregistree a { color: var(--text-2); }
.wizard-steps .state-enregistree .num { background: var(--good-soft); color: var(--good); }
.wizard-steps .state-passee .num { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.wizard-steps .current a { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.wizard-steps .current .num { background: var(--accent); color: #fff; text-decoration: none; }
.wizard-card h2 { margin-top: 0; }
.wizard-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; align-items: center; margin-top: 1.2rem; }
.wizard-actions > a.button:first-child { margin-right: auto; }
.wizard-card fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
@media (max-width: 640px) {
  .wizard-steps .label { display: none; }
  .wizard-steps .current .label { display: inline; }
}

/* Comparatif gratuit / premium (Abonnement et fonctionnalités) : coches et croix. */
.compare th:not(:first-child), .compare td:not(:first-child) { text-align: center; width: 10rem; }
.compare td { vertical-align: middle; }
.compare td.mark .icon { width: 1.15rem; height: 1.15rem; }
.compare .icon.yes { color: var(--good); }
.compare .icon.no { color: var(--bad); opacity: .8; }
.compare-detail { display: block; margin-top: .2rem; font-size: .8rem; color: var(--muted); font-weight: 400; }
