/**
 * <TextField> — habillage « pro » du panel.
 *
 * Chargé APRÈS panel.css et trix.css : il redéfinit les jetons de couleur (variables
 * --panel-*, --accent*) utilisés par panel.css, puis restyle la mise en page (barre du haut,
 * barre latérale, cartes, formulaires, boutons, connexion). Pour revenir à l'ancien
 * habillage, il suffit de retirer la ligne <link ... panel-pro.css> de tpl/index.html.
 */

/* Jetons
-------------------------------------------------- */
:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ring: rgba(79, 70, 229, .22);
  --accent-soft: rgba(79, 70, 229, .09);
  --accent-text: #4338ca;
  --accent-on: #ffffff;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .09);
  --success: #16a34a;
  --warning: #d97706;

  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --hover: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 15.5rem;
  --topbar-h: 3.75rem;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Variables historiques de panel.css, réalignées sur la nouvelle palette */
  --panel-bg: #f6f7f9;
  --panel-text: var(--text);
  --panel-text-rgb: 17, 24, 39;
  --panel-muted: var(--muted);
  --panel-hover: var(--hover);
  --panel-hover-rgb: 243, 244, 246;
  --panel-border: var(--border-strong);
  --panel-input-alt: var(--hover);
  --panel-input-bg: var(--surface);
  --panel-icon-muted: #9ca3af;
}
:root[data-theme="dark"] {
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-ring: rgba(129, 140, 248, .3);
  --accent-soft: rgba(129, 140, 248, .14);
  --accent-text: #c7d2fe;
  --accent-on: #0e1014;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);
  --success: #4ade80;
  --warning: #fbbf24;

  --surface: #16181d;
  --surface-2: #1c1f26;
  --border: #262a33;
  --border-strong: #343a46;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --hover: #1f232b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .6), 0 4px 10px -4px rgba(0, 0, 0, .4);

  --panel-bg: #0e1014;
  --panel-text-rgb: 229, 231, 235;
  --panel-hover-rgb: 31, 35, 43;
  --panel-icon-muted: #6b7280;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --accent: #818cf8; --accent-hover: #a5b4fc; --accent-ring: rgba(129, 140, 248, .3);
    --accent-soft: rgba(129, 140, 248, .14); --accent-text: #c7d2fe; --accent-on: #0e1014;
    --danger: #f87171; --danger-soft: rgba(248, 113, 113, .13);
    --surface: #16181d; --surface-2: #1c1f26; --border: #262a33; --border-strong: #343a46;
    --text: #e5e7eb; --muted: #9ca3af; --hover: #1f232b;
    --panel-bg: #0e1014; --panel-text-rgb: 229, 231, 235; --panel-hover-rgb: 31, 35, 43;
  }
}

/* Base
-------------------------------------------------- */
body {
  font-family: var(--font);
  font-size: .9375rem;
  background: var(--panel-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); }
.caption {
  margin: 0 0 .75rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
}

/* Boutons
-------------------------------------------------- */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.125rem;
  padding: .4rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: 500 .8125rem/1.2 var(--font);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.button:hover, button:hover { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.button:focus, button:focus { box-shadow: 0 0 0 3px var(--accent-ring); }
.button i, button i { font-size: .95em; }

.button-primary, .button-accent, .button-success,
.button.button-primary, .button.button-accent, .button.button-success {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-on);
}
.button-primary:hover, .button-accent:hover, .button-success:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-on);
}
.button-error, .button.button-error {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}
.button-error:hover, .button.button-error:hover { border-color: var(--danger); background: var(--danger); color: #fff; }
.button-warning, .button.button-warning {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.button-ghost, .button.button-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.button-ghost:hover, .button.button-ghost:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.button-ghost.button-error { color: var(--danger); }
.button-ghost.button-error:hover { background: var(--danger-soft); color: var(--danger); }
.button-icon { min-width: 2.125rem; padding: .4rem; }
.button-block { display: flex; width: 100%; }
button[disabled], .button[disabled] { opacity: .55; cursor: not-allowed; }

/* Champs
-------------------------------------------------- */
input, select, textarea {
  min-height: 2.375rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  font: .875rem/1.45 var(--font);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }
input[type="checkbox"], input[type="radio"], input[type="range"], input[type="file"] { min-height: 0; box-shadow: none; }
input[type="color"] { padding: .25rem; height: 2.375rem; }
textarea { min-height: 6rem; }
select { padding-right: 2rem; }
label { font-size: .8125rem; font-weight: 500; color: var(--text); }
.label { margin-top: 1.1rem; margin-bottom: .35rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.component > .label:first-of-type, .section-head + .label, form > .label:first-of-type { margin-top: 0; }
.label label { margin: 0; }
.label small code { font-size: .7rem; color: var(--muted); background: var(--hover); padding: .1rem .35rem; border-radius: 4px; }
.label a { color: var(--text); text-decoration: none; }
.label a:hover { color: var(--accent-text); }
.label a i { color: var(--muted); }
.page-route, .label-suggestion { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.field > .page-route, .field > p.page-route { margin: .1rem 0 0; }
.toggle-group { border-color: var(--border-strong); border-radius: 8px; padding: 2px; background: var(--hover); }
.toggle-group input[type="radio"] + span { border-radius: 6px; padding: .3rem .85rem; font-weight: 500; color: var(--muted); }
.toggle-group input[type="radio"]:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toggle-group input[type="radio"]:checked:hover + span, .toggle-group input[type="radio"]:focus + span { background: var(--surface); color: var(--text); }
/* Etat sélectionné bien lisible : « Activé » (value="1") en couleur d'accent avec une coche,
   « Désactivé » (value="0") en neutre contrasté — on voit d'un coup d'œil ce qui est actif. */
.toggle-group input[type="radio"] + span { transition: background-color 150ms, color 150ms, box-shadow 150ms; }
.toggle-group input[type="radio"]:not(:checked) + span:hover { color: var(--text); }
.toggle-group input[type="radio"][value="1"]:checked + span,
.toggle-group input[type="radio"][value="1"]:checked:hover + span,
.toggle-group input[type="radio"][value="1"]:focus:checked + span { background: var(--accent); color: var(--accent-on); font-weight: 600; box-shadow: 0 1px 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.toggle-group input[type="radio"][value="1"]:checked + span::before { content: "✓"; margin-right: .35rem; font-weight: 700; }
.toggle-group input[type="radio"][value="0"]:checked + span,
.toggle-group input[type="radio"][value="0"]:checked:hover + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow), inset 0 0 0 1px var(--border-strong); }
.toggle-group input[type="radio"]:focus-visible + span { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
.switch-track { background: var(--border-strong); }
.form-error { color: var(--danger); font-size: .8rem; }

/* Barre du haut
-------------------------------------------------- */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar-h);
  padding: 0 1rem 0 3.75rem;
  overflow: visible;
  background: color-mix(in srgb, var(--panel-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
@media (min-width: 768px) {
  .title-bar { left: var(--sidebar-w); padding: 0 1.75rem; }
}
.title-bar-heading { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.panel-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-size: .72rem; line-height: 1.3; }
.breadcrumbs li + li::before { content: "/"; margin: 0 .4rem; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.title-bar-actions { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.topbar-button, .topbar-icon {
  margin: 0;
  min-height: 2.125rem;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}
.topbar-button { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .7rem; border-radius: 8px; font-size: .8125rem; font-weight: 500; border: 1px solid transparent; }
.topbar-button:hover, .topbar-icon:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.topbar-icon { width: 2.125rem; padding: 0; border-radius: 8px; position: relative; float: none; }
.panel-theme-toggle { float: none; margin: 0; }
@media (max-width: 640px) { .topbar-button-label, .user-menu-name { display: none; } }

/* Menu du compte */
.user-menu { position: relative; margin-left: .35rem; }
.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .2rem .5rem .2rem .2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  font-size: .8125rem;
  font-weight: 500;
  user-select: none;
}
.user-menu-toggle::-webkit-details-marker { display: none; }
.user-menu-toggle:hover { border-color: var(--border-strong); }
.user-menu-avatar { object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: .85rem; }
.user-menu-chevron { font-size: .65rem; color: var(--muted); transition: transform .15s; }
.user-menu[open] .user-menu-chevron { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .45rem);
  z-index: 30;
  width: 17.5rem;
  max-width: calc(100vw - 1.5rem);
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pro-pop .12s ease-out;
}
/* Avatar + name/login on the first row, the badges on a full-width second row (side by side). */
.user-menu-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .7rem; row-gap: .55rem; padding: .6rem .65rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.user-menu-identity { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.user-menu-header strong { font-size: .875rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-login { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-badges { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .35rem; }
.user-menu-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.5; white-space: nowrap; text-decoration: none; }
.user-menu-badge--admin { background: var(--accent-soft); color: var(--accent-text); }
.user-menu-badge--editor { background: rgba(5, 150, 105, .12); color: #047857; }
.user-menu-badge--dev { background: rgba(217, 119, 6, .13); color: #b45309; }
a.user-menu-badge--dev:hover, a.user-menu-badge--dev:focus-visible { background: rgba(217, 119, 6, .22); color: #92400e; outline: none; }
a.user-menu-badge--dev:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #d97706; }
:root[data-theme="dark"] .user-menu-badge--editor { color: #6ee7b7; }
:root[data-theme="dark"] .user-menu-badge--dev, :root[data-theme="dark"] a.user-menu-badge--dev:hover { color: #fbbf24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .user-menu-badge--editor { color: #6ee7b7; } :root:not([data-theme="light"]) .user-menu-badge--dev { color: #fbbf24; } }
.user-menu-header-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--hover); color: var(--muted); object-fit: cover; }
.user-menu-item {
  box-sizing: border-box; /* width: 100% + padding must stay inside the dropdown (hover background) */
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  margin: 0;
  padding: .5rem .65rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: .8125rem;
  font-weight: 450;
  text-align: left;
  text-decoration: none;
}
.user-menu-item i { width: 1rem; color: var(--muted); text-align: center; }
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--hover); color: var(--text); border: 0; outline: none; }
/* The menu items include a <button> (My profile): neutralise the generic button focus ring/border
   (button:focus, .focused added by app.min.js) so it looks like its <a> siblings. */
.user-menu-item:focus, .user-menu-item.focused { box-shadow: none; border: 0; }
.user-menu-dropdown button.user-menu-item { min-height: 0; height: auto; line-height: inherit; background: transparent; }
.user-menu-dropdown button.user-menu-item:hover, .user-menu-dropdown button.user-menu-item:focus-visible { background: var(--hover); }
.user-menu-item.is-current { background: var(--accent-soft); color: var(--accent-text); font-weight: 550; }
.user-menu-item.is-current i { color: var(--accent-text); }
.user-menu-item--stacked { align-items: flex-start; }
.user-menu-item--stacked i { margin-top: .15rem; }
.user-menu-item--stacked > span { display: flex; flex-direction: column; gap: .05rem; }
.user-menu-item-hint { color: var(--muted); font-size: .72rem; font-weight: 400; line-height: 1.35; }
.user-menu-item--danger, .user-menu-item--danger i { color: var(--danger); }
.user-menu-item--danger:hover, .user-menu-item--danger:focus-visible { background: var(--danger-soft); color: var(--danger); }
.user-menu-separator { height: 1px; margin: .3rem 0; background: var(--border); }
@keyframes pro-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.toggle-navigation { top: .875rem; left: .75rem; width: 2.125rem; height: 2.125rem; border-radius: 8px; color: var(--text); box-shadow: none; }

/* Barre latérale
-------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  box-sizing: border-box;
  padding: 1rem .75rem .75rem;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: none;
}
@media (min-width: 768px) { .sidebar { display: flex; } }
.sidebar.show { display: flex; box-shadow: var(--shadow-lg); }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .25rem .5rem 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.sidebar-brand img { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-brand-name { font-weight: 700; font-size: .98rem; letter-spacing: -.01em; }
.sidebar-brand-badge { padding: .1rem .4rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .65rem; font-weight: 700; letter-spacing: .04em; }
.sidebar-wrapper { flex: 1; height: auto; overflow-y: auto; margin: 0 -.25rem; padding: 0 .25rem; }
.sidebar .caption { margin: 1.1rem .65rem .4rem; }
.sidebar .caption:first-child { margin-top: .25rem; }
.sidebar-navigation { margin: 0; }
.sidebar-navigation > li { display: flex; align-items: center; margin: 1px 0; padding: 0; font-weight: 400; }
.sidebar-navigation > li.active { font-weight: 400; }
.sidebar-navigation > li.active::before { content: none; }
.sidebar-navigation > li > a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .65rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .875rem;
  text-decoration: none;
  transition: background-color .12s, color .12s;
}
.sidebar-navigation > li > a > i { width: 1rem; text-align: center; font-size: .9rem; opacity: .85; }
.sidebar-navigation > li > a:hover { background: var(--hover); color: var(--text); }
.sidebar-navigation > li.active > a { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sidebar-navigation > li.active > a > i { opacity: 1; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-navigation > li { position: relative; }
.sidebar-add { margin-top: .35rem !important; }
.sidebar-add button { width: 100%; justify-content: flex-start; margin: 0; padding: .45rem .65rem; border: 1px dashed var(--border-strong); background: transparent; box-shadow: none; color: var(--muted); font-weight: 500; }
.sidebar-add button:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.sidebar-footer { padding: .75rem .5rem 0; border-top: 1px solid var(--border); margin-top: .5rem; }
.sidebar-copyright { margin: 0 0 .5rem; color: var(--muted, #6b7280); font-size: .72rem; line-height: 1.4; }
.sidebar-license .license-state { color: var(--success); font-weight: 700; }
.sidebar-license a { color: var(--accent-text); }
.sidebar-license.is-unverified .license-state { color: var(--danger); font-weight: 600; }
.sidebar-version { font-variant-numeric: tabular-nums; opacity: .8; }
.sidebar-footer .dev-badge { margin-bottom: .25rem; }
.dev-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .55rem; border-radius: 999px; background: rgba(217, 119, 6, .12); color: var(--warning); font-size: .72rem; font-weight: 600; }

/* Contenu
-------------------------------------------------- */
.main { margin: calc(var(--topbar-h) + 1.25rem) 1rem 2rem; }
@media (min-width: 768px) { .main { margin: calc(var(--topbar-h) + 1.75rem) 2rem 2.5rem calc(var(--sidebar-w) + 2rem); } }
.main .row { margin: 0; gap: 1.5rem; }
@media (min-width: 1200px) {
  .main .row { flex-wrap: nowrap; align-items: flex-start; }
  .main .row > .col-l-3-4 { flex: 1 1 0; max-width: none; min-width: 0; }
  .main .row > .col-l-1-4 { flex: 0 0 19rem; max-width: 19rem; position: sticky; top: calc(var(--topbar-h) + 1.75rem); }
}
.main .col-narrow { flex: 1 1 auto !important; max-width: 52rem !important; }
.component {
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.section-head { margin-bottom: 1.25rem; }
.section-title { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; }
.section-count { margin-left: .35rem; padding: .1rem .45rem; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: .75rem; font-weight: 600; vertical-align: middle; }
.section-sub { margin: .25rem 0 0; color: var(--muted); font-size: .825rem; line-height: 1.45; }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state i { display: block; margin-bottom: .5rem; font-size: 1.75rem; opacity: .6; }
.empty-state p { margin: 0; font-size: .875rem; }

/* Onglets de langue */
.lang-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 1rem; }
.lang-tabs-label { margin-right: .35rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.lang-tab {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.lang-tab:hover { border-color: var(--border-strong); background: var(--hover); color: var(--text); }
.lang-tab.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-on); }
.lang-tab--missing { border-style: dashed; background: transparent; color: var(--muted); box-shadow: none; }
.lang-tab--missing:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* Barre d'outils développeur */
.file-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  margin: 0 0 1rem;
  padding: .45rem .6rem .45rem .9rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.file-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.file-toolbar-label { margin-right: .25rem; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.file-toolbar-name { margin-right: .25rem; padding: .15rem .45rem; border-radius: 5px; background: var(--hover); font-size: .75rem; }
.file-toolbar .button, .file-toolbar button { margin: 0; min-height: 1.875rem; font-size: .78rem; }

/* Barre d'enregistrement collante */
.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem -1.5rem -1.5rem;
  padding: .8rem 1.5rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 -6px 16px -10px rgba(16, 24, 40, .18);
}
.form-actions-hint { color: var(--muted); font-size: .78rem; }
.form-actions button { margin: 0; min-width: 8rem; }

/* Panneau des boucles */
.flow-panel { padding: 1rem; }
.flow-panel-head { padding: .5rem .5rem .75rem; }
.flow-panel-head .caption { margin: 0; }
.flow-panel .section-sub { font-size: .76rem; }
.flow-empty { margin: 0 .5rem .75rem; color: var(--muted); font-size: .8rem; }
.flow-list { margin: 0 0 .5rem; padding: 0; list-style: none; }
.flow { margin: 0 0 .15rem; }
.flow-link, .flow-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  border-radius: 8px;
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
}
.flow-link > i, .flow-title > i { width: 1rem; text-align: center; color: var(--muted); }
.flow-link:hover { background: var(--hover); color: var(--text); }
.flow-link--statics { margin-bottom: .5rem; border: 1px solid var(--border); }
.flow-link--statics > i:last-child { margin-left: auto; font-size: .7rem; }
.flow.is-open { padding-bottom: .35rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.flow-title { font-weight: 650; }
.flow-count { margin-left: auto; min-width: 1.5rem; padding: .05rem .45rem; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: .72rem; font-weight: 600; text-align: center; }
.flow-key { display: block; margin: -.3rem 0 .25rem 2.25rem; font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.flow-new { margin: .25rem .5rem .4rem; width: calc(100% - 1rem); justify-content: flex-start; border: 1px dashed var(--border-strong); color: var(--muted); }
.flow-new:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.flow-items { margin: 0; padding: 0 .35rem; list-style: none; max-height: 50vh; overflow-y: auto; }
.flow-item { display: flex; align-items: center; margin: 1px 0; border-radius: 7px; font-size: .82rem; }
.flow-item > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .4rem .5rem; border-radius: 7px; color: var(--text); text-decoration: none; }
.flow-item > a:hover { background: var(--hover); }
.flow-item.is-current { gap: .55rem; padding: .25rem .25rem .25rem .5rem; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.flow-item-id { flex-shrink: 0; min-width: 1.4rem; color: var(--muted); font-family: var(--mono); font-size: .7rem; }
.flow-item.is-current .flow-item-id { color: inherit; }
.flow-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-item-delete { margin: 0 0 0 auto; min-height: 1.75rem; min-width: 1.75rem; padding: .25rem; }
.flow-panel > .button-block { margin: .25rem 0 0; justify-content: flex-start; border: 1px dashed var(--border-strong); color: var(--muted); }

/* Paramètres */
.options-page-header {
  top: calc(var(--topbar-h) + .75rem);
  margin: 0 0 1.25rem;
  padding: .5rem .5rem .5rem .5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.options-page-header .button { margin: 0; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--hover); }
.segmented a { padding: .35rem 1rem; border-radius: 7px; color: var(--muted); font-size: .84rem; font-weight: 500; text-decoration: none; }
.segmented a:hover { color: var(--text); }
.segmented a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.options-form .component > .caption { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .75rem; color: var(--text); cursor: pointer; }
.collapse-chevron { color: var(--muted); }

/* Médiathèque */
.media-toolbar { align-items: flex-start; margin-bottom: 1rem; }
.media-toolbar .section-head { margin: 0; }
.dropzone { border: 1.5px dashed var(--border-strong) !important; border-radius: 12px !important; background: var(--surface-2) !important; }
.dropzone:hover { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.media-item { border-radius: 10px; }

/* Fenêtres modales et notifications
-------------------------------------------------- */
.modal-backdrop { background: rgba(10, 12, 16, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-content { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-content .caption { font-size: .8rem; color: var(--text); }
.modal-error { border-radius: 16px 16px 0 0; background: var(--danger); }
.notification { width: 340px; padding: 1rem 1.25rem 1rem 3rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .875rem; }
.notification-info { background: var(--accent); color: var(--accent-on); }
/* panel.css : textes posés sur la couleur d'accent */
.toggle-group input[type="radio"]:checked + span, .dropdown-item.selected { color: var(--accent-on); }
.notification-success { background: #15803d; }
.notification-warning { background: #b45309; }
.notification-error { background: #b91c1c; }
.notification-container { top: calc(var(--topbar-h) + .75rem); }
.tooltip { border-radius: 6px; padding: .3rem .5rem; background: #111827; color: #f9fafb; font-weight: 500; }

/* Éditeurs */
.editor-toolbar, trix-toolbar { border-color: var(--border-strong); }
.editor-textarea, trix-editor { border-color: var(--border-strong) !important; border-radius: 0 0 8px 8px !important; }

/* Connexion / installation
-------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  background:
    radial-gradient(60rem 30rem at 50% -10%, var(--accent-soft), transparent 70%),
    var(--panel-bg);
}
.auth-card {
  width: 100%;
  max-width: 24rem;
  box-sizing: border-box;
  padding: 2.25rem 2rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: .75rem; }
.auth-brand img { width: 44px; height: 44px; border-radius: 11px; }
.auth-brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.auth-brand-sub { color: var(--muted); font-size: .78rem; }
.auth-title { margin: 1.75rem 0 .3rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.auth-text { margin: 0 0 1.5rem; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.auth-form label { display: block; margin: 0 0 .35rem; }
.auth-form input[type="password"] { margin-bottom: 1rem; }
.auth-help { display: block; margin: -.65rem 0 1rem; color: var(--muted); font-size: .76rem; }
.auth-optional { color: var(--muted); font-weight: 400; font-size: .8em; }
.auth-remember { display: flex !important; align-items: center; margin: -.25rem 0 1.25rem !important; font-weight: 400; color: var(--muted); }
.auth-form .button-block { min-height: 2.6rem; margin: 0; font-size: .875rem; }
.auth-alert { margin: 0 0 1rem; padding: .65rem .8rem; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: .82rem; }
.auth-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.5rem; color: var(--muted); font-size: .8rem; text-decoration: none; }
.auth-back:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.media-grid > .empty-state { grid-column: 1 / -1; width: 100%; }

/* Onglet de traduction pas encore proposé sur le site + menu « Ajouter une langue » */
.lang-tab--offline:not(.is-active) { border-style: dashed; color: var(--muted); }
.lang-add { position: relative; }
.lang-tab--add { list-style: none; cursor: pointer; border-style: dashed; background: transparent; color: var(--muted); box-shadow: none; font-weight: 500; letter-spacing: 0; }
.lang-tab--add::-webkit-details-marker { display: none; }
.lang-add[open] > .lang-tab--add, .lang-tab--add:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.lang-add-menu {
  position: absolute; left: 0; top: calc(100% + .45rem); z-index: 30;
  width: 17rem; padding: .5rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-lg);
  animation: pro-pop .12s ease-out;
}
.lang-add-title { margin: .25rem .4rem .4rem; color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.lang-add-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 0 .5rem; padding: 0; list-style: none; }
.lang-add-list a { display: flex; align-items: center; gap: .45rem; padding: .4rem .45rem; border-radius: 7px; color: var(--text); font-size: .82rem; text-decoration: none; }
.lang-add-list a:hover { background: var(--hover); }
.lang-add-code { min-width: 1.6rem; padding: .05rem .25rem; border-radius: 4px; background: var(--hover); color: var(--muted); font-size: .65rem; font-weight: 700; text-align: center; }
.lang-add-form { display: flex; gap: .35rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.lang-add-form input { flex: 1; min-width: 0; margin: 0; min-height: 2rem; padding: .3rem .55rem; font-size: .8rem; }
.lang-add-form button { margin: 0; min-height: 2rem; }
.lang-add-help { margin: .5rem .25rem .15rem; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 480px) { .lang-add-menu { position: fixed; left: 1rem; right: 1rem; top: auto; width: auto; } }


/* Comptes : profil, utilisateurs, activité
-------------------------------------------------- */
.user-menu-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: 1.5rem; object-fit: cover; }
.profile-avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.profile-avatar-actions label.button { margin: 0; cursor: pointer; }
.profile-subtitle { margin: 0 0 .15rem; font-size: .95rem; }

.user-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.user-avatar, .activity-avatar, .last-edit-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--hover); color: var(--muted); object-fit: cover; }

/* Utilisateurs : grille avatar | infos | actions, formulaire d'édition sur toute la largeur. */
.users-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.users-add-toggle { flex: none; margin: 0; white-space: nowrap; }
.users-add-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; box-shadow: none; }
/* Formulaire d'ajout replié par défaut : la liste prend toute la largeur ; ouvert, il
   glisse dans la colonne de droite (au-dessus de la liste sur mobile). */
.users-layout:not(.is-adding) > .users-main { flex: 0 0 100%; max-width: 100%; }
.users-aside[hidden] { display: none; }
.users-layout.is-adding > .users-aside { animation: users-aside-in .22s ease-out; }
@keyframes users-aside-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.users-aside > .component { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.users-aside-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.users-aside-head .button { margin: 0 -.4rem 0 0; }
@media (max-width: 992px) {
  .users-layout.is-adding > .users-aside { order: -1; margin-bottom: 1.5rem; }
  .users-aside > .component { position: static; }
  @keyframes users-aside-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
}
.add-label-short { display: none; }
.users-aside { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
@media (max-width: 640px) {
  .users-add-toggle .add-label-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .users-add-toggle .add-label-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .users-layout.is-adding > .users-aside { animation: none; } }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.35rem; padding: 0 .4rem; margin-left: .35rem; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: .75rem; font-weight: 600; vertical-align: middle; }
.user-search { position: relative; margin: 0 0 .75rem; }
.user-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.user-search input { width: 100%; margin: 0; padding-left: 2.3rem; }
.user-noresult { margin: 1rem 0 .25rem; padding: 1.25rem; text-align: center; color: var(--muted); font-size: .875rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

.user-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: .9rem; align-items: center;
  margin: 0 -.75rem; padding: .85rem .75rem; border-radius: var(--radius);
  border-top: 1px solid var(--border); scroll-margin-top: calc(var(--topbar-h) + 1rem);
  transition: background-color .15s ease;
}
.user-row:first-child { border-top-color: transparent; }
.user-row:hover { background: var(--surface-2); }
.user-row.is-open { background: var(--surface-2); border-top-color: transparent; }
.user-row.is-open + .user-row { border-top-color: transparent; }
.user-row.is-highlight { animation: user-highlight 2.4s ease-out; }
@keyframes user-highlight { 0%, 35% { background: var(--accent-soft); } 100% { background: transparent; } }
.user-avatar { width: 44px; height: 44px; font-size: .9rem; }
.user-avatar--initials { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; letter-spacing: .02em; }
.user-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.user-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; min-width: 0; }
.user-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.user-you { font-size: .7rem; padding: .05rem .45rem; border-radius: 999px; background: var(--hover); color: var(--muted); font-weight: 500; }
.user-meta { display: flex; flex-wrap: wrap; gap: 0 .9rem; min-width: 0; font-size: .8rem; color: var(--muted); }
.user-meta > * { min-width: 0; }
.user-login { font-family: var(--mono); font-size: .76rem; }
.um-email { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-never { font-style: italic; }
.um-actions { display: flex; align-items: center; gap: .15rem; align-self: center; }
.um-actions .button { margin: 0; }
.user-edit-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }

.role-badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.role-badge--admin { background: var(--accent-soft); color: var(--accent-text); }
.role-badge--editor { background: rgba(22, 163, 74, .1); color: var(--success); }
.role-badge--writer { background: rgba(217, 119, 6, .12); color: var(--warning); }

.user-edit-form {
  grid-column: 1 / -1; margin-top: .85rem; padding: 1.1rem 1.15rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
  animation: user-form-in .15s ease-out;
}
.user-edit-form[hidden] { display: none; }
@keyframes user-form-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid-2 > div > label:first-child { margin-top: 0; }
.form-grid-2 > div:nth-child(n+3) > label:first-child { margin-top: .85rem; }
.user-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.user-edit-actions .button, .user-edit-actions button { margin: 0; }
.user-edit-buttons { display: flex; gap: .5rem; margin-left: auto; }
.user-delete-reason { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }

/* Mot de passe : afficher/masquer + générer */
.input-reveal { position: relative; display: flex; align-items: stretch; gap: .5rem; }
.input-reveal input { flex: 1; min-width: 0; margin: 0; padding-right: 2.6rem; }
.input-reveal .reveal-toggle {
  position: absolute; top: 0; bottom: 0; width: 2.5rem; display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: var(--radius);
}
.input-reveal .reveal-toggle:hover { color: var(--text); }
.input-reveal .reveal-toggle:focus-visible { outline: 2px solid var(--accent-ring); }
.input-reveal .reveal-toggle { right: 0; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-top: .85rem; }
.label-row label { margin: 0 !important; }
.link-button { display: inline-flex; align-items: center; gap: .3rem; margin: 0; padding: .1rem .2rem; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; border-radius: 6px; }
.link-button:hover { text-decoration: underline; text-underline-offset: 2px; }
.link-button:focus-visible { outline: 2px solid var(--accent-ring); }
.label-row + .input-reveal { margin-top: .35rem; }
.user-add-form .button-block { margin-top: 1.1rem; }

@media (max-width: 640px) {
  .user-row { column-gap: .65rem; align-items: start; margin: 0 -.5rem; padding: .85rem .5rem; }
  .um-actions { align-self: start; margin-right: -.35rem; }
  .user-avatar { width: 38px; height: 38px; font-size: .8rem; }
  .user-meta { flex-direction: column; }
  .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid-2 > div:nth-child(n+2) > label:first-child { margin-top: .85rem; }
  .user-edit-form { padding: 1rem .9rem; }
  .user-edit-buttons { width: 100%; }
  .user-edit-buttons .button, .user-edit-buttons button { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .user-row.is-highlight, .user-edit-form { animation: none; } }
.rights-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 0; }
.rights-table th, .rights-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rights-table thead th { border-bottom-color: var(--border); padding-top: 0; }
.rights-table tbody tr:last-child th, .rights-table tbody tr:last-child td { border-bottom: 0; }
.rights-table tbody th { text-align: left; font-weight: 500; color: var(--text); padding-right: .5rem; }
.rights-table td, .rights-table thead th:not(:first-child) { text-align: center; width: 7rem; }
.role-help { margin-top: 1.5rem; }
.rights-table tbody tr:hover { background: var(--surface-2, rgba(127,127,127,.06)); }
@media (max-width: 560px) { .rights-table { font-size: .8rem; } .rights-table th, .rights-table td { padding: .5rem .2rem; } .rights-table td, .rights-table thead th:not(:first-child) { width: 3.6rem; } .rights-table .role-badge { font-size: .62rem; padding: .1rem .35rem; } }
.rt-yes { display: inline-block; vertical-align: middle; fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rt-no { color: var(--muted); opacity: .5; }

.activity-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.activity-filter select { min-width: 12rem; margin: 0; }
.activity-row { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.activity-row:first-child { border-top: 0; }
.activity-avatar { width: 32px; height: 32px; font-size: .8rem; }
.activity-main { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: .875rem; }
.activity-main code { font-size: .78rem; }
.activity-detail { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.activity-time { flex: none; font-size: .78rem; color: var(--muted); white-space: nowrap; }

.last-edit { display: flex; align-items: center; gap: .45rem; margin: 0 0 1rem; font-size: .8rem; color: var(--muted); }
.last-edit img, .last-edit-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; font-size: .6rem; }
.last-edit strong { color: var(--text); font-weight: 600; }
.user-add-form label, .user-edit-form label, .profile-form > label { display: block; margin-top: .85rem; }
.user-add-form .label-suggestion, .user-edit-form .label-suggestion, .profile-form .label-suggestion { display: block; }
.user-add-form input, .user-add-form select, .user-edit-form input, .user-edit-form select { width: 100%; }

/* Démo : identifiants par défaut (page de connexion) + bandeau "configurez votre compte"
-------------------------------------------------- */
.auth-demo { margin: 0 0 1.25rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: .85rem; }
.auth-demo-head { display: flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--accent-text); margin-bottom: .55rem; }
.auth-demo-creds { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0 0 .5rem; }
.auth-demo-creds dt { color: var(--muted); }
.auth-demo-creds dd { margin: 0; }
.auth-demo-creds code { padding: .1rem .45rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: .85rem; user-select: all; }
.auth-demo-fill { margin-left: -.2rem; }
.auth-demo-note { margin: .45rem 0 0; font-size: .78rem; color: var(--muted); }

.setup-banner-main { margin-bottom: 0 !important; }
.setup-banner-main ~ .main { margin-top: 1.25rem; }
.setup-banner { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; border-radius: var(--radius-lg); background: rgba(217, 119, 6, .1); border: 1px solid rgba(217, 119, 6, .35); }
.setup-banner-icon { flex: none; font-size: 1.15rem; color: var(--warning); }
.setup-banner-text { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .85rem; color: var(--text); }
.setup-banner-text span { color: var(--muted); }
.setup-banner-button { flex: none; margin: 0; white-space: nowrap; }
.setup-banner--demo { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.setup-banner--demo .setup-banner-icon { color: var(--accent-text); }
@media (max-width: 640px) {
  .setup-banner { flex-wrap: wrap; }
  .setup-banner-button { width: 100%; justify-content: center; }
}
.profile-demo-hint { display: flex; align-items: flex-start; gap: .4rem; margin: .5rem 0 0; padding: .55rem .7rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; }

/* Settings › Navigation — site menu editor (see initNavEditor() in editor-extras.js) */
.nav-intro { margin-bottom: .75rem; }
.nav-notice { display: flex; gap: .5rem; align-items: flex-start; margin: 0 0 1rem; padding: .65rem .8rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); font-size: .84rem; }
.nav-editor { list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: navrow; }
.nav-row { counter-increment: navrow; margin: 0 0 .6rem; padding: .6rem .75rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: box-shadow .12s, opacity .12s; }
.nav-row:hover { box-shadow: var(--shadow); }
.nav-row.is-dragging { opacity: .45; border-style: dashed; }
.nav-row.is-missing { border-color: var(--danger); }
.nav-row-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.nav-row-head::before { content: counter(navrow); order: 1; min-width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: .72rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav-handle { order: 0; flex: 0 0 auto; width: 12px; height: 20px; cursor: grab; opacity: .55; background-image: radial-gradient(circle, var(--muted) 1.4px, transparent 1.6px); background-size: 6px 5px; }
.nav-handle:hover { opacity: 1; }
.nav-row.is-dragging .nav-handle { cursor: grabbing; }
.nav-row-title { order: 2; flex: 1 1 auto; display: flex; align-items: center; gap: .45rem; min-width: 0; }
.nav-row-title i { color: var(--muted); }
.nav-row-title code { font-size: .75rem; color: var(--muted); }
.nav-missing { font-size: .75rem; color: var(--danger); font-weight: 600; }
.nav-row-actions { order: 3; display: flex; gap: .15rem; }
.nav-row-actions .button { margin: 0; }
.nav-row-actions .button:disabled { opacity: .3; cursor: default; }
.nav-remove:hover { color: var(--danger); }
.nav-row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem .75rem; }
.nav-field { display: flex; flex-direction: column; gap: .2rem; margin: 0; font-size: .75rem; color: var(--muted); }
.nav-field input { margin: 0; }
.nav-field-url { grid-column: 1 / -1; }
.nav-empty { padding: 1.25rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.nav-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.nav-add .select-icon-wrap { flex: 1 1 220px; }
.nav-add select, .nav-add .button { margin: 0; }

/* Guided tour (tpl/forms/tour.html, initTour() in editor-extras.js): the spotlight's huge
   box-shadow dims the whole page except the highlighted element; the blocker catches clicks
   so the page can't be used mid-tour. */
.tour { position: fixed; inset: 0; z-index: 3000; }
.tour[hidden] { display: none; }
.tour-blocker { position: absolute; inset: 0; background: transparent; }
.tour.is-centered .tour-blocker { background: rgba(15, 23, 42, .55); }
.tour-spotlight { position: fixed; border-radius: 12px; pointer-events: none;
  /* Same three shadows (ring, halo, dimmer) everywhere, keyframes included: interpolating
     lists of different lengths pairs the ring with the dimmer and tints the whole page. */
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 3px var(--accent-ring), 0 0 0 9999px rgba(15, 23, 42, .55);
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
  animation: tour-pulse 1.8s ease-in-out infinite; }
.tour.is-centered .tour-spotlight { display: none; }
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 3px var(--accent-ring), 0 0 0 9999px rgba(15, 23, 42, .55); }
  50% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 9px var(--accent-ring), 0 0 0 9999px rgba(15, 23, 42, .55); }
}
.tour-popover { position: fixed; width: min(360px, calc(100vw - 32px)); padding: 1.1rem 1.2rem .9rem; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); outline: none;
  transition: left .28s ease, top .28s ease; }
.tour-step h3 { margin: 0 0 .4rem; font-size: 1rem; font-weight: 650; letter-spacing: 0; }
.tour-step p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.tour-footer { display: flex; align-items: center; gap: .4rem; margin-top: 1rem; }
.tour-footer button { margin: 0; }
.tour-progress { margin-right: auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .tour-spotlight, .tour-popover { transition: none; animation: none; }
}

/* Activity pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.pager [aria-disabled="true"] { opacity: .4; pointer-events: none; }
.pager-status { font-size: .825rem; color: var(--muted); padding: 0 .5rem; }

/* Visit statistics */
.stats-periods { display: flex; flex-wrap: wrap; gap: .25rem; }
.stats-periods .is-active { background: var(--accent-soft); color: var(--accent-text); }
.stats-notice { margin: 1rem 0 0; padding: .6rem .8rem; border-radius: var(--radius); background: var(--hover); color: var(--muted); font-size: .825rem; }
.stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.stats-kpi { display: flex; flex-direction: column; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stats-kpi-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stats-kpi-value { font-size: 1.6rem; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.stats-kpi-sub { font-size: .75rem; color: var(--muted); }
.stats-chart { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.stats-bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.stats-bar:hover .stats-bar-fill { opacity: 1; }
.stats-bar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); opacity: .75; border-radius: 3px 3px 0 0; }
.stats-bar-visitors { position: absolute; left: 25%; right: 25%; bottom: 0; background: var(--text); opacity: .4; border-radius: 2px 2px 0 0; }
.stats-bar-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: .25rem; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.stats-legend { margin: .6rem 0 0; font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.stats-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; background: var(--accent); opacity: .75; }
.stats-swatch--visitors { background: var(--text); opacity: .4; margin-left: .5rem; }
.stats-top { list-style: none; margin: .5rem 0 0; padding: 0; }
.stats-top li { position: relative; display: flex; align-items: center; gap: .75rem; padding: .45rem .6rem; font-size: .85rem; border-top: 1px solid var(--border); }
.stats-top li:first-child { border-top: 0; }
.stats-top-bar { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--accent-soft); border-radius: var(--radius); z-index: 0; }
.stats-top-key { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .8rem; }
.stats-top-count { position: relative; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-top-count small { color: var(--muted); margin-left: .25rem; }
.stats-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem 2rem; margin-top: 2rem; }
.stats-list--wide { grid-column: 1 / -1; }
.stats-list .caption { margin-bottom: .25rem; }
