:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --panel-3: #262b36;
  --border: #2a2f3a;
  --border-strong: #3a414f;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #5865f2;
  --accent-hover: #4752f0;
  --accent-text: #ffffff;
  --ok: #3ba55d;
  --warn: #faa61a;
  --danger: #ed4245;
  --radius: 10px;
  --radius-sm: 7px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --panel-2: #f3f4f7;
    --panel-3: #e9ebf0;
    --border: #dcdfe6;
    --border-strong: #c3c8d4;
    --text: #1f2330;
    --muted: #5c6475;
  }
}

* {
  box-sizing: border-box;
}

/*
 * `hidden` doit toujours l'emporter : plusieurs classes d'ici imposent un
 * `display` (flex, grid, inline-block) qui, etant une regle d'auteur, passerait
 * devant le `[hidden] { display: none }` du navigateur. C'est ce qui laissait le
 * bouton de connexion visible une fois connecte.
 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 23px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 12px;
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 650;
}

p {
  margin: 0 0 12px;
}

code {
  background: var(--panel-3);
  border-radius: 4px;
  padding: 1.5px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.87em;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* Connexion                                                           */
/* ------------------------------------------------------------------ */

.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 460px;
  width: 100%;
}

/* ------------------------------------------------------------------ */
/* Barre du haut                                                       */
/* ------------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 24px;
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}

.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.tab:hover {
  background: var(--panel-2);
  color: var(--text);
}
.tab[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-text);
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.user img {
  border-radius: 50%;
}

/* ------------------------------------------------------------------ */
/* Contenu                                                             */
/* ------------------------------------------------------------------ */

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 110px;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}

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

/* Encadré d'explication */
.hint {
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.hint strong {
  color: var(--text);
}
.hint ol {
  margin: 8px 0 0;
  padding-left: 20px;
}
.hint li {
  margin-bottom: 4px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat .label {
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.stat .value {
  font-size: 24px;
  font-weight: 650;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.stat .hint {
  background: none;
  border: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 12.5px;
}

.grid {
  display: grid;
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid.split {
  grid-template-columns: minmax(230px, 300px) 1fr;
  align-items: start;
}

@media (max-width: 820px) {
  .grid.split {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 20px 14px 110px;
  }
  .topbar {
    height: auto;
    padding: 12px 14px;
  }
}

/* ------------------------------------------------------------------ */
/* Règles de l'automod                                                 */
/* ------------------------------------------------------------------ */

.rule {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.12s;
}
.rule[data-off="true"] {
  background: transparent;
}
.rule[data-off="true"] .rule-body,
.rule[data-off="true"] .rule-help {
  display: none;
}

.rule-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rule-head .switch {
  flex: 1;
  min-width: 200px;
}
.rule-title {
  font-weight: 600;
}
.rule-help {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}
.rule-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.rule-body .full {
  grid-column: 1 / -1;
}

.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge.ban,
.badge.kick {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.badge.timeout,
.badge.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.badge.delete {
  color: var(--text);
}

/* ------------------------------------------------------------------ */
/* Formulaires                                                         */
/* ------------------------------------------------------------------ */

label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 500;
}

.field {
  min-width: 0;
}
.field + .field {
  margin-top: 16px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font: inherit;
  transition: border-color 0.12s, background 0.12s;
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* --- Interrupteurs --- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.switch input[type="checkbox"] {
  appearance: none;
  flex: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.16s, background 0.16s;
}
.switch input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input[type="checkbox"]:checked::after {
  background: #fff;
  transform: translateX(18px);
}
.switch input[type="checkbox"]:hover {
  border-color: var(--accent);
}

/* --- Boutons --- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.button:hover {
  background: var(--accent-hover);
}
.button.ghost {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.button.ghost:hover {
  background: var(--panel-3);
  border-color: var(--accent);
}
.button.danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}
.button.danger:hover {
  background: var(--danger);
  color: #fff;
}
.button.small {
  padding: 6px 11px;
  font-size: 13px;
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.button:disabled:hover {
  background: var(--accent);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.actions .spacer {
  flex: 1;
}

/* ------------------------------------------------------------------ */
/* Étiquettes sélectionnées (exemptions)                               */
/* ------------------------------------------------------------------ */

.chips {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
  align-content: flex-start;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 13px;
  max-width: 100%;
}
.chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip .chip-remove {
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.chip .chip-remove:hover {
  background: var(--danger);
  color: #fff;
}

.chips-empty {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  padding: 6px 2px;
}

/* ------------------------------------------------------------------ */
/* Conditions des annonces                                             */
/* ------------------------------------------------------------------ */

.placeholders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.placeholder {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.placeholder.invalid {
  border-color: var(--danger);
}

.placeholder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.token-input {
  display: inline-flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.token-input input {
  border: none;
  background: none;
  padding: 7px 2px;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
}
.token-input input:focus-visible {
  outline: none;
}
.token-input:focus-within {
  border-color: var(--accent);
}

.placeholder-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.counter {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
}
.counter .over {
  color: var(--danger);
  font-weight: 600;
}

/* Types de logs */

.logtype {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.logtype:last-child {
  border-bottom: none;
}
.logtype[data-off="true"] .logtype-topic,
.logtype[data-off="true"] .logtype-channel {
  opacity: 0.45;
}

.logtype-channel {
  grid-row: 1;
  grid-column: 2;
  font-size: 12.5px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  align-self: center;
}
.logtype-channel.missing {
  color: var(--warn);
  font-family: inherit;
}

.logtype-topic {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  padding-left: 50px;
}

@media (max-width: 620px) {
  .logtype-topic {
    padding-left: 0;
  }
}

/* Champ avec bouton accolé */

.input-row {
  display: flex;
  gap: 6px;
}
.input-row input {
  flex: 1;
  min-width: 0;
}
.input-row .button {
  flex: none;
}

/* Galerie d'images hébergées */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.gallery-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

.gallery-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
  background: var(--panel-3);
}
.gallery-meta {
  font-size: 11px;
  color: var(--muted);
  padding: 5px 7px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-actions {
  display: flex;
  gap: 3px;
  padding: 5px 6px 6px;
}
.gallery-actions button {
  flex: 1;
  padding: 4px 5px;
  font-size: 11px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.gallery-actions button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gallery-actions button.remove {
  flex: none;
  width: 26px;
}
.gallery-actions button.remove:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* Barre d'outils de formatage */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 5px 6px;
}

.toolbar + textarea {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.tool {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tool:hover {
  background: var(--panel-3);
  color: var(--text);
}
.tool:active {
  background: var(--accent);
  color: var(--accent-text);
}

.tool-sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 4px;
}

/* Aide-mémoire */

.lexicon {
  margin-top: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
}
.lexicon[open] {
  padding-bottom: 14px;
}
.lexicon summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  list-style-position: inside;
}
.lexicon summary:hover {
  color: var(--text);
}
.lexicon-table {
  margin-bottom: 12px;
}
.lexicon-table td {
  padding: 7px 10px;
  font-size: 13px;
}
.lexicon-table td:first-child {
  width: 45%;
  white-space: nowrap;
}
.lexicon p {
  margin: 0 0 8px;
}

/* Aperçu façon Discord */

.discord-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* En-tête du message */

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.msg-name {
  font-weight: 650;
}
.msg-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.msg-time {
  font-size: 12px;
  color: var(--muted);
}

/* Markdown rendu */

.md {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.md-blank {
  height: 0.6em;
}
.md-heading {
  margin: 6px 0 2px;
  font-weight: 700;
  line-height: 1.3;
}
h1.md-heading {
  font-size: 20px;
}
h2.md-heading {
  font-size: 17px;
}
h3.md-heading {
  font-size: 15px;
}
.md-small {
  font-size: 12px;
  color: var(--muted);
}
.md-quote {
  margin: 2px 0;
  padding-left: 10px;
  border-left: 4px solid var(--border-strong);
}
.md-list-item {
  display: flex;
  gap: 8px;
  padding-left: 6px;
}
.md-bullet {
  flex: none;
  color: var(--muted);
}
.md-code {
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.87em;
}
.md-block {
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 11px;
  margin: 5px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-x: auto;
}
.md-spoiler {
  background: var(--border-strong);
  border-radius: 3px;
  color: transparent;
  cursor: pointer;
}
.md-spoiler:hover {
  color: inherit;
}
.md-mention,
.md-time {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 500;
}
.md-link {
  color: #00a8fc;
  text-decoration: none;
}
.md-link:hover {
  text-decoration: underline;
}

.preview-warning {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--warn);
  white-space: pre-line;
}

.embed-preview {
  position: relative;
  background: var(--panel-3);
  border-radius: 4px;
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.5;
}

.embed-preview .embed-author {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.embed-preview .embed-title {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 8px;
  color: var(--text);
}
.embed-preview .embed-description {
  white-space: pre-wrap;
  word-break: break-word;
}
.embed-preview .embed-footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.embed-preview .embed-image {
  margin-top: 12px;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}
.embed-preview .embed-thumbnail {
  float: right;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 0 8px 12px;
}
.embed-preview .embed-media-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  font-style: italic;
}

input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Parcours côté Discord */

.flow {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flow-step {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}
.flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 36px;
  bottom: -2px;
  width: 1px;
  background: var(--border-strong);
}

.flow-number {
  flex: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 650;
  z-index: 1;
}

.flow-body {
  min-width: 0;
  padding-top: 2px;
}
.flow-title {
  font-weight: 550;
  font-size: 14px;
  margin-bottom: 6px;
}
.flow-body p {
  margin: 0;
}

.flow-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.flow-list li {
  margin-bottom: 2px;
}

/* ------------------------------------------------------------------ */
/* Tables, listes, aperçu                                              */
/* ------------------------------------------------------------------ */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}
.table th {
  text-align: left;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.list li:hover {
  border-color: var(--border-strong);
}
.list li[aria-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.list .name {
  font-weight: 600;
}
.list .meta {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.preview {
  word-break: break-word;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* Barre d'enregistrement et notifications                             */
/* ------------------------------------------------------------------ */

.savebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--panel);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -6px 24px rgb(0 0 0 / 0.2);
  z-index: 20;
}
.savebar span {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--warn);
}

.toast {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  border-left-width: 3px;
  background: var(--panel);
  font-size: 14px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}
.toast[data-kind="ok"] {
  border-left-color: var(--ok);
}
.toast[data-kind="error"] {
  border-left-color: var(--danger);
}
