/* ==========================================================================
   Tableau de bord — design sobre
   Thème sombre uni par défaut, mode clair avec [data-theme="light"] sur <html>.
   Une seule couleur d'accent (bleu). Pas de flou, pas de dégradés, peu d'animations.
   ========================================================================== */

/* ---------- Couleurs et mesures ---------- */
:root {
  color-scheme: dark;
  --bg: #111214;            /* zone principale */
  --bg-side: #0c0d0f;       /* barre du haut, colonnes de gauche */
  --bg-rail: #08090a;       /* colonne des serveurs */
  --surface: #1a1c1f;       /* champs, menus, cartes */
  --surface-2: #222428;     /* survol */
  --border: #26282c;
  --border-strong: #34373c;
  --text: #e6e7e9;
  --text-2: #a1a4aa;
  --text-3: #6b6f76;
  --accent: #3b82f6;
  --accent-hover: #2f6fdb;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-text: #ffffff;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  --topbar: 56px;
  --rail: 68px;
  --sidebar: 248px;
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-side: #f6f7f9;
  --bg-rail: #eceef1;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --border: #e3e5e8;
  --border-strong: #d0d3d8;
  --text: #15171a;
  --text-2: #50545b;
  --text-3: #8a8f97;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --shadow: 0 8px 24px rgba(15, 20, 30, 0.12);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  font: 14px/1.5 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code { font: 12.5px/1.4 var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.hint { font-size: 12.5px; color: var(--text-3); }
.nowrap { white-space: nowrap; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-orange { color: var(--orange); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6;
        stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Mise en page : barre du haut + 2 colonnes à gauche + contenu ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: 16px; padding: 0 16px 0 14px;
  background: var(--bg-side); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; overflow: hidden;
              background: var(--accent); color: #fff; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: var(--radius);
               color: var(--text-2); font-weight: 500; }
.topbar-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.topbar .menu-button { display: none; }

.shell { display: grid; grid-template-columns: var(--rail) var(--sidebar) minmax(0, 1fr); padding-top: var(--topbar); min-height: 100dvh; }

/* Colonne des serveurs */
.rail {
  position: sticky; top: var(--topbar); height: calc(100dvh - var(--topbar)); overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0;
  background: var(--bg-rail); border-right: 1px solid var(--border);
}
.rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; display: grid; place-items: center; }
.rail-item::before { content: ""; position: absolute; left: -12px; width: 4px; height: 0; border-radius: 0 4px 4px 0;
                     background: var(--text); transition: height 0.15s; }
.rail-item:hover::before { height: 16px; }
.rail-item.active::before { height: 32px; background: var(--accent); }
.rail-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
             background: var(--surface); color: var(--text-2); font-weight: 650; font-size: 14px;
             border: 1px solid var(--border); transition: border-color 0.15s, color 0.15s; }
.rail-icon img { width: 100%; height: 100%; object-fit: cover; }
.rail-item:hover .rail-icon { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.rail-item.active .rail-icon { border-color: var(--accent); }
a.rail-item:hover { text-decoration: none; }
.rail-sep { width: 28px; height: 1px; background: var(--border); flex: none; }
.rail-add .rail-icon { color: var(--green); background: transparent; border-style: dashed; }

/* Barre latérale des modules */
.sidebar {
  position: sticky; top: var(--topbar); height: calc(100dvh - var(--topbar)); overflow-y: auto;
  background: var(--bg-side); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-server { display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px; }
.sidebar-server .server-icon { width: 36px; height: 36px; border-radius: 10px; }
.sidebar-server strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sidebar-server .hint { display: block; }
.sidebar-server > div { min-width: 0; }
.module-search { position: relative; margin: 0 12px 8px; }
.module-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.module-search .input { padding-left: 32px; min-height: 34px; font-size: 13px; }
.nav-groups { padding: 4px 8px 16px; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-group-title {
  width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px;
  border: 0; background: none; cursor: pointer; color: var(--text-3);
  font: 600 11px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-group-title:hover { color: var(--text-2); }
.nav-group-title .icon { width: 14px; height: 14px; transition: transform 0.15s; }
.nav-group.collapsed .nav-group-title .icon { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-items { display: grid; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; border-left: 2px solid transparent;
}
.nav-item .icon { width: 17px; height: 17px; color: var(--text-3); }
.nav-item:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent);
                                 border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.nav-item[aria-current="page"] .icon { color: var(--accent); }
.nav-empty { padding: 8px 10px; }

/* Contenu */
.content { min-width: 0; padding: 28px clamp(16px, 4vw, 44px) 120px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 20px;
             border-bottom: 1px solid var(--border); }
.page-head p { margin-top: 6px; color: var(--text-2); max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Sections séparées par une fine ligne : titre + description à gauche, réglages dessous */
.section { padding: 24px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head p { margin-top: 4px; color: var(--text-2); font-size: 13px; }
.section-body { display: grid; gap: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
@media (max-width: 760px) { .cols-2 { grid-template-columns: 1fr; } }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-head { margin-bottom: 8px; }
.preview-head .label { margin: 0; }

/* ---------- Champs ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.label, .field > label, .field > .row-between > label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.label .hint, .field label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 14px/1.4 var(--font);
  transition: border-color 0.12s;
  -webkit-appearance: none; appearance: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.textarea { min-height: 96px; resize: vertical; }
.select { padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f97' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px; }
.select option { background: var(--surface); color: var(--text); }
.input-number { width: 84px; text-align: center; }
.input-color { width: 110px; font-family: var(--mono); }
.color-swatch { width: 38px; height: 38px; padding: 3px; border-radius: var(--radius); border: 1px solid var(--border);
                background: var(--surface); cursor: pointer; flex: none; }
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color-swatch::-moz-color-swatch { border: 0; border-radius: 4px; }
.field-warning { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--orange); }
.field-warning .icon { width: 15px; height: 15px; }

/* Ligne « réglage + interrupteur » */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px;
              border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toggle-row .text { display: grid; gap: 2px; min-width: 0; }
.toggle-row .text > span:first-child, .toggle-row .text > label:first-child { font-weight: 550; }
.toggle-list { display: grid; gap: 8px; }

/* Interrupteur */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
                        background: #fff; transition: transform 0.15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.5; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 550 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: transparent; }
.btn-success { color: var(--green); }
.btn-success:hover { border-color: var(--green); background: transparent; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }

/* Onglets (Bienvenue / Au revoir…) : contrôle segmenté sobre */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: var(--surface);
             border: 1px solid var(--border); }
.segmented button, .segmented a { border: 0; background: none; color: var(--text-2); padding: 6px 12px; border-radius: 5px;
                                   font: 550 13px/1.2 var(--font); cursor: pointer; text-decoration: none; }
.segmented button:hover, .segmented a:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented a[aria-current="page"] { background: var(--surface-2); color: var(--text); }

/* ---------- Étiquettes, alertes ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
         font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.badge.green { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); }
.badge.red { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.badge.orange { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 35%, transparent); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px;
         border: 1px solid var(--border); background: var(--surface); }
.alert .icon { margin-top: 1px; }
.alert.error { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.alert.error .icon { color: var(--red); }
.alert.info .icon { color: var(--accent); }

/* ---------- Sélecteur avec recherche (rôles, salons) ---------- */
.picker { position: relative; }
.picker.open { z-index: 25; }
.picker-field {
  width: 100%; min-height: 38px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 34px 4px 8px; position: relative; text-align: left; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 14px/1.3 var(--font); transition: border-color 0.12s;
}
.picker-field:hover { border-color: var(--border-strong); }
.picker.open .picker-field { border-color: var(--accent); }
.picker-field:disabled { cursor: not-allowed; opacity: 0.6; }
.picker-chevron { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 15px; height: 15px; }
.picker-chips { display: contents; }
.picker-placeholder { color: var(--text-3); padding-left: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border-radius: 5px;
        background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 500; }
.chip-x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; cursor: pointer;
          color: var(--text-3); font-size: 14px; line-height: 1; }
.chip-x:hover { background: var(--border); color: var(--text); }
.picker-field:disabled .chip { padding-right: 8px; }
.role-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; }
.picker-prefix { color: var(--text-3); font-weight: 600; width: 12px; text-align: center; flex: none; }
.picker-tag { padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap;
              color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.picker-panel { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); padding: 6px;
                border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.picker-search { min-height: 34px; }
.picker-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.picker-group { padding: 10px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.picker-group:first-child { padding-top: 2px; }
.picker-option { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.picker-option:hover, .picker-option:focus { background: var(--surface-2); outline: none; }
.picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); flex: none; display: grid; place-items: center; }
.picker-option[aria-selected="true"] .picker-check { background: var(--accent); border-color: var(--accent); }
.picker-option[aria-selected="true"] .picker-check::after { content: ""; width: 8px; height: 4px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.picker-empty { padding: 10px; text-align: center; }
.section:has(.picker.open) { position: relative; z-index: 26; }

/* ---------- Image (zone de dépôt) ---------- */
.dropzone { display: grid; place-items: center; min-height: 140px; padding: 12px; cursor: pointer; text-align: center;
            border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface); transition: border-color 0.12s; }
.dropzone:hover, .dropzone.dragging, .dropzone:focus-within { border-color: var(--accent); }
.dropzone-empty { display: grid; gap: 4px; justify-items: center; color: var(--text-2); }
.dropzone-empty .icon { width: 24px; height: 24px; color: var(--text-3); }
.dropzone-image { max-width: 100%; max-height: 240px; border-radius: var(--radius-sm); object-fit: contain; }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row .input { flex: 1; min-width: 0; }
[data-image-card].busy { opacity: 0.6; pointer-events: none; }
@media (max-width: 560px) { .link-row { flex-wrap: wrap; } }

/* ---------- Carte en image (bienvenue / au revoir) ---------- */
.card-preview { position: relative; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.card-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 340; transition: opacity 0.15s; }
.card-preview.loading img { opacity: 0.55; }
.card-preview.failed::after { content: "Aperçu indisponible : vérifie les réglages, puis réessaie."; position: absolute; inset: 0;
                              display: grid; place-items: center; padding: 12px; text-align: center; color: var(--text-2); font-size: 13px; }
.card-preview.failed img { visibility: hidden; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } }
[data-card-image].busy { opacity: 0.6; pointer-events: none; }
[data-card-image] .row { margin: 8px 0 6px; }
.range { width: 100%; accent-color: var(--accent); }

/* Variables insérables */
.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip-button { cursor: pointer; color: var(--text-2); font: 500 12px/1.2 var(--mono); padding: 4px 8px; }
.chip-button:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Éditeur avec aperçu à droite ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 32px; align-items: start; }
.preview-col { position: sticky; top: calc(var(--topbar) + 24px); padding-top: 24px; }
.preview-col .label { display: block; margin-bottom: 8px; }
.preview-col .hint { margin-top: 10px; display: block; }
@media (max-width: 1240px) {
  .editor { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .preview-col { position: static; order: -1; padding-bottom: 8px; }
}

/* Aperçu façon Discord (couleurs de Discord) */
.dc { display: flex; gap: 14px; padding: 14px 14px 16px; border-radius: var(--radius); background: #313338; color: #dbdee1;
      font-size: 15px; line-height: 1.375; border: 1px solid var(--border); }
:root[data-theme="light"] .dc { background: #ffffff; color: #313338; }
.dc-avatar, .dc-thumb { display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; font-weight: 700;
                        color: #fff; background: #5865f2; }
.dc-avatar { width: 40px; height: 40px; }
.dc-thumb { width: 80px; height: 80px; font-size: 26px; }
.dc-avatar img, .dc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dc-body { min-width: 0; flex: 1; display: grid; gap: 4px; align-content: start; }
.dc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-head strong { color: #f2f3f5; font-weight: 600; }
:root[data-theme="light"] .dc-head strong { color: #060607; }
.dc-tag { padding: 0 5px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; }
.dc-time { font-size: 12px; color: #949ba4; }
.dc-mention { padding: 0 3px; border-radius: 4px; font-weight: 500; color: #c9cdfb; background: rgba(88, 101, 242, 0.3); }
:root[data-theme="light"] .dc-mention { color: #505cdc; background: rgba(88, 101, 242, 0.15); }
.dc-embed { max-width: 520px; padding: 10px 14px 14px 12px; border-radius: 4px; border-left: 4px solid #5865f2;
            background: #2b2d31; display: grid; gap: 8px; }
:root[data-theme="light"] .dc-embed { background: #f2f3f5; }
.dc-embed-grid { display: flex; gap: 14px; justify-content: space-between; }
.dc-embed-text { display: grid; gap: 6px; min-width: 0; align-content: start; }
.dc-title { font-weight: 700; color: #f2f3f5; overflow-wrap: anywhere; }
:root[data-theme="light"] .dc-title { color: #060607; }
.dc-desc { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-desc code { font-size: 12.5px; background: #1e1f22; border: 0; color: inherit; }
:root[data-theme="light"] .dc-desc code { background: #e3e5e8; }
.dc-image { max-width: 100%; max-height: 300px; border-radius: 4px; object-fit: contain; justify-self: start; }
.dc-footer { font-size: 12px; color: #949ba4; }
@media (max-width: 480px) { .dc-thumb { width: 56px; height: 56px; } .dc { gap: 10px; padding: 12px; } }

/* ---------- Chiffres (Accueil, Modération) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.stat { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: var(--radius);
        background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat .badge { justify-self: start; }
a.stat-link:hover { border-color: var(--border-strong); text-decoration: none; }
.cols-sections { gap: 0 40px; }
.cols-sections > .section:last-of-type { border-bottom: 1px solid var(--border); }
@media (min-width: 761px) { .cols-sections > .section { border-bottom: 1px solid var(--border); } }

/* ---------- Listes et tableaux ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-emoji { font-size: 18px; width: 26px; text-align: center; flex: none; }
.list-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.list-main strong, .list-main .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table-row:last-child { border-bottom: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.segmented .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--text-3); margin-left: 2px; }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
.page-alert { margin-top: 20px; }
.section-note { margin-top: 12px; align-items: center; }
.alert-action { margin-left: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 20px; }

/* Logs : emoji · texte · salon dédié · interrupteur */
.log-type { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(200px, 260px) auto; gap: 10px 14px; }
.log-type-channel { display: grid; gap: 4px; min-width: 0; }
.log-type .list-main .hint { white-space: normal; }
.log-type:has(.switch input:not(:checked)) .log-type-channel { opacity: 0.4; }
.log-type:has(.switch input:not(:checked)) .list-main { opacity: 0.6; }
@media (max-width: 760px) {
  .log-type { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .log-type-channel { grid-column: 2 / -1; grid-row: 2; }
}

/* Compteurs */
.counter-row .list-main { gap: 5px; }
.voice-pill { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
              padding: 2px 8px; border-radius: 5px; font-size: 12.5px; color: var(--text-2); background: var(--bg); border: 1px solid var(--border); }
@media (max-width: 480px) { .counter-state { display: none; } }

/* ---------- Tickets : éditeur des boutons ---------- */
.types-editor, .questions-editor { display: grid; gap: 8px; }
.type-row { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.type-top { display: grid; grid-template-columns: 56px minmax(0, 1fr) 110px auto; gap: 8px; align-items: center; }
.type-emoji { text-align: center; padding-left: 6px; padding-right: 6px; }
.type-message { min-height: 60px; }
.type-tools { display: flex; gap: 2px; }
.btn-mini { width: 32px; min-height: 32px; padding: 0; }
.btn-mini .icon { width: 16px; height: 16px; }
.btn-mini[data-move="delete"]:hover { color: var(--red); }
@media (max-width: 560px) {
  .type-top { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .type-tools { grid-row: 1; grid-column: 3; }
  .type-style { grid-row: 2; grid-column: 1 / -1; }
}
.publish-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
@media (max-width: 560px) { .publish-row { grid-template-columns: 1fr; } }
.ticket-row .btn { flex: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.section-head .segmented { flex-wrap: wrap; }
@media (max-width: 640px) { .section-head { flex-wrap: wrap; } }

/* Boutons Discord dans l'aperçu */
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; max-width: 520px; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 16px; border-radius: 8px;
             color: #fff; font-size: 14px; font-weight: 500; background: #5865f2; }
.dc-button.secondary { background: #4e5058; }
.dc-button.success { background: #248046; }
.dc-button.danger { background: #da373c; }
.dc-emoji { width: 18px; height: 18px; object-fit: contain; }
.dc-no-buttons { font-size: 13px; color: #949ba4; font-style: italic; }
.section-alert { margin-bottom: 12px; }
.dc-thumb.small { width: 64px; height: 64px; border-radius: 8px; font-size: 22px; }
.dc-embed-info { border-left-color: #3498db; }

/* ---------- Candidatures ---------- */
.app-list { display: grid; gap: 8px; }
.app-item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.app-item[open] { border-color: var(--border-strong); }
.app-item summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.app-item summary::-webkit-details-marker { display: none; }
.app-item summary:hover { background: var(--surface-2); }
.app-chevron { color: var(--text-3); transition: transform 0.15s; flex: none; width: 16px; height: 16px; }
.app-item[open] .app-chevron { transform: rotate(180deg); }
.app-body { padding: 6px 16px 16px; display: grid; gap: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.answers { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.answers strong { font-weight: 600; }
.answers p { margin-top: 2px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.decision { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border-left: 3px solid var(--text-3); }
.decision.green { border-left-color: var(--green); }
.decision.red { border-left-color: var(--red); }
.decision p { margin-top: 4px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .app-item summary .badge:not(.orange):not(.green):not(.red) { display: none; } }

.dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border-radius: var(--radius); color: var(--text);
          background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog-body { display: grid; gap: 14px; padding: 20px; }
.dialog-actions { justify-content: flex-end; }

.form-name-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
.question-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.question-number { display: grid; place-items: center; width: 28px; height: 28px; margin-top: 5px; border-radius: 50%;
                   font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text-2); }
.question-text { min-height: 38px; resize: vertical; }
.question-row .type-tools { margin-top: 3px; }
@media (max-width: 560px) {
  .question-row { grid-template-columns: minmax(0, 1fr) auto; }
  .question-number { display: none; }
}
.dc-menu { flex-direction: column; gap: 6px; }
.dc-select { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px;
             background: #1e1f22; color: #949ba4; font-size: 14px; }
:root[data-theme="light"] .dc-select { background: #ebedef; color: #5c5e66; }
.dc-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #2b2d31; }
:root[data-theme="light"] .dc-option { background: #f2f3f5; }
.dc-option.off { opacity: 0.4; text-decoration: line-through; }
.dc-option-emoji { font-size: 20px; display: grid; place-items: center; }
.dc-option-text { display: grid; gap: 1px; min-width: 0; font-size: 14px; }
.dc-option-text strong { font-weight: 500; overflow-wrap: anywhere; }
.dc-option-text span { font-size: 12.5px; color: #949ba4; }

/* ---------- Annonces ---------- */
.mention-choice { display: grid; grid-template-columns: repeat(3, 1fr); }
.dropzone-small { min-height: 110px; }
.emoji-bar { display: flex; flex-wrap: wrap; gap: 4px; max-height: 88px; overflow-y: auto; }
.emoji-btn { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border-radius: var(--radius-sm); cursor: pointer;
             background: var(--surface); border: 1px solid var(--border); }
.emoji-btn:hover { border-color: var(--border-strong); }
.emoji-btn img { width: 20px; height: 20px; object-fit: contain; }
.dc-footer-server { display: flex; align-items: center; gap: 8px; }
.dc-footer-icon { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none;
                  font-size: 10px; font-weight: 700; color: #fff; background: #5865f2; }
.dc-footer-icon img { width: 100%; height: 100%; object-fit: cover; }
.dc-reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.dc-reactions:empty { display: none; }
.dc-reaction { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 8px; font-size: 14px;
               font-weight: 600; color: #c9cdfb; background: rgba(88, 101, 242, 0.15); border: 1px solid rgba(88, 101, 242, 0.6); }
:root[data-theme="light"] .dc-reaction { color: #505cdc; }
.dc-reaction .dc-emoji { width: 16px; height: 16px; }

/* ---------- Modération ---------- */
.filters { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(140px, 1fr)) auto; gap: 12px; align-items: end; }
.filters-actions { flex-wrap: nowrap; }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters-actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }
.avatar.big { width: 52px; height: 52px; font-size: 19px; }
.member-file h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-counts { margin-top: 12px; gap: 6px; }
.sanction { display: grid; grid-template-columns: 140px minmax(160px, 1fr) minmax(0, 1.6fr) auto; gap: 14px; }
.sanction-type { justify-self: start; }
.sanction-user { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); border-radius: var(--radius-sm);
                 padding: 3px 6px; margin: -3px -6px; }
.sanction-user:hover { background: var(--surface-2); text-decoration: none; }
.sanction-reason { color: var(--text-2); overflow-wrap: anywhere; }
.sanction-meta { text-align: right; white-space: nowrap; }
.sanction-meta > span { display: block; }
@media (max-width: 900px) {
  .sanction { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .sanction-type { grid-column: 2; grid-row: 1; justify-self: end; }
  .sanction-user { grid-column: 1; grid-row: 1; }
  .sanction-reason { grid-column: 1 / -1; }
  .sanction-meta { grid-column: 1 / -1; text-align: left; white-space: normal; }
  .sanction-meta > span { display: inline; }
}

/* ---------- Pages hors serveur (connexion, liste des serveurs, erreurs) ---------- */
body.simple { padding-top: var(--topbar); }
.page { max-width: 1080px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; }
.center-page { min-height: calc(100dvh - var(--topbar) - 56px); display: grid; place-items: center; padding: 24px 16px; }

/* ---------- Pied de page (liens légaux, sur toutes les pages) ---------- */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
               padding: 16px clamp(16px, 4vw, 40px); border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.content .site-footer { margin: 56px 0 0; padding: 16px 0 0; }

/* ---------- Conditions d'utilisation / confidentialité ---------- */
.legal { max-width: 820px; }
.legal-head { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.legal-head h1 { font-size: 26px; margin: 4px 0 6px; }
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.legal section { padding: 22px 0; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--topbar) + 12px); }
.legal section:last-child { border-bottom: 0; }
.legal h2 { font-size: 17px; margin-bottom: 10px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.65; }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: 10px; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }
.legal strong { color: var(--text); }
.legal-table { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.legal-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; padding: 12px 14px;
             border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.legal-row:first-child { border-top: 0; }
.legal-row-head { background: var(--surface); color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
@media (max-width: 640px) {
  .legal-row { grid-template-columns: 1fr; gap: 4px; }
  .legal-row-head { display: none; }
}
.panel { width: min(100%, 440px); display: grid; gap: 14px; padding: 28px; border-radius: var(--radius);
         background: var(--surface); border: 1px solid var(--border); }
.btn-large { min-height: 42px; font-size: 14.5px; }
.status-line { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot.green { background: var(--green); } .dot.orange { background: var(--orange); }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.server-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius);
               background: var(--surface); border: 1px solid var(--border); color: var(--text); }
a.server-card:hover { border-color: var(--border-strong); text-decoration: none; }
.server-card .server-icon { width: 44px; height: 44px; font-size: 15px; }
.server-card.is-muted .server-icon { opacity: 0.6; }
.empty-box { display: grid; gap: 6px; padding: 20px; border-radius: var(--radius); border: 1px dashed var(--border-strong); text-align: center; }

/* ---------- Historique d'un ticket (conversation façon Discord) ---------- */
.ticket-search { display: grid; grid-template-columns: minmax(200px, 1fr) 180px auto; gap: 12px; align-items: end; margin-bottom: 12px; }
@media (max-width: 760px) { .ticket-search { grid-template-columns: 1fr; } }
.search-result { margin-bottom: 8px; }
.ticket-info .stat strong { font-size: 14.5px; overflow-wrap: anywhere; }
.chat { background: #313338; color: #dbdee1; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px 16px;
        font-size: 15px; line-height: 1.375; }
:root[data-theme="light"] .chat { background: #ffffff; color: #313338; }
.chat-group { display: flex; gap: 14px; padding-top: 14px; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: #5865f2; }
.chat-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chat-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-author { color: #f2f3f5; font-weight: 600; }
:root[data-theme="light"] .chat-author { color: #060607; }
.chat-author.is-staff { color: #57f287; }
:root[data-theme="light"] .chat-author.is-staff { color: #248046; }
.chat-tag { padding: 0 5px; border-radius: 4px; background: #248046; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; }
.chat-message { position: relative; display: grid; gap: 4px; justify-items: start; }
.chat-message:hover { background: rgba(0, 0, 0, 0.06); }
.chat-hour { position: absolute; left: -54px; top: 3px; width: 44px; text-align: right; font-size: 11px; color: #949ba4; opacity: 0; }
.chat-message:hover .chat-hour { opacity: 1; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; justify-self: stretch; }
.chat-text code, .chat-embed code { font-size: 12.5px; background: #1e1f22; border: 0; color: inherit; }
.chat-edited { font-size: 11px; color: #949ba4; }
.chat-image { max-width: min(400px, 100%); max-height: 320px; border-radius: 6px; object-fit: contain; display: block; }
.chat-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; max-width: 100%;
             background: #2b2d31; border: 1px solid #1e1f22; color: #00a8fc; }
:root[data-theme="light"] .chat-file { background: #f2f3f5; border-color: #e3e5e8; }
.chat-file span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-embed { justify-self: stretch; }
.chat-field { display: grid; gap: 2px; font-size: 14px; }
.chat-note { margin-top: 10px; }
@media (max-width: 560px) { .chat { padding: 6px 10px 12px; } .chat-group { gap: 10px; } .chat-hour { display: none; } }

/* ---------- Barre « modifications non enregistrées » ---------- */
.savebar {
  position: fixed; z-index: 35; bottom: 16px; left: calc(var(--rail) + var(--sidebar) + 24px); right: 24px;
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 10px 10px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); transform: translateY(calc(100% + 32px)); visibility: hidden; transition: transform 0.18s, visibility 0.18s;
}
form.dirty .savebar { transform: none; visibility: visible; }
.savebar-text { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.savebar-text .icon { color: var(--orange); }
.savebar > .row { margin-left: auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; top: calc(var(--topbar) + 12px); right: 16px; display: flex; flex-direction: column;
          gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: min(400px, calc(100vw - 32px));
         padding: 10px 14px; border-radius: var(--radius); pointer-events: auto; font-weight: 500;
         background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
         animation: toast-in 0.15s ease-out both; }
.toast.leaving { animation: toast-out 0.15s ease-in forwards; }
.toast .icon { width: 18px; height: 18px; }
.toast.success { border-left: 3px solid var(--green); } .toast.success .icon { color: var(--green); }
.toast.error { border-left: 3px solid var(--red); } .toast.error .icon { color: var(--red); }
.toast.info { border-left: 3px solid var(--accent); } .toast.info .icon { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-out { to { opacity: 0; } }

/* ---------- Menus déroulants (avatar) ---------- */
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; }
.dropdown summary::-webkit-details-marker { display: none; }
.avatar-button { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: var(--radius); color: var(--text-2); }
.avatar-button:hover, .dropdown[open] .avatar-button { background: var(--surface); color: var(--text); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-fallback, .server-icon.avatar-fallback { display: inline-grid; place-items: center; font-weight: 650; color: #fff; background: var(--accent); }
.server-icon { border-radius: 10px; object-fit: cover; flex: none; }
.user-name { font-weight: 550; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; z-index: 50;
                 border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.dropdown-menu form { margin: 0; }
.dropdown-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm);
                 border: 0; background: none; color: var(--text); font: 500 13.5px/1.2 var(--font); cursor: pointer; text-align: left; }
.dropdown-item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-item .icon { width: 16px; height: 16px; color: var(--text-3); }
.dropdown-item.danger, .dropdown-item.danger .icon { color: var(--red); }
.dropdown-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.dropdown-head { padding: 6px 10px 8px; }

/* ---------- Téléphone : les colonnes de gauche deviennent un menu ---------- */
.drawer-backdrop { display: none; }
@media (max-width: 900px) {
  .topbar .menu-button { display: inline-flex; }
  .topbar-link .label-text, .user-name { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail, .sidebar { position: fixed; top: var(--topbar); bottom: 0; height: auto; z-index: 45;
                    transform: translateX(-110%); transition: transform 0.18s; }
  .rail { left: 0; width: var(--rail); }
  .sidebar { left: var(--rail); width: min(var(--sidebar), calc(100vw - var(--rail) - 24px));
             transform: translateX(calc(-100% - var(--rail) - 8px)); }   /* entièrement hors de l'écran */
  body.drawer-open .rail, body.drawer-open .sidebar { transform: none; }
  body.drawer-open .drawer-backdrop { display: block; position: fixed; inset: var(--topbar) 0 0 0; z-index: 44; background: rgba(0, 0, 0, 0.5); }
  .savebar { left: 12px; right: 12px; bottom: 12px; }
  .content { padding-top: 20px; }
  .page-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
