/* MDTED — écrans : formulaires, onglets, tableau de bord, explorateur, connexion, dépôt, bureau, aide.
   Extrait mécanique de style.css (aucune règle modifiée). */
/* ===================== formulaires ===================== */
.stacked label { display: block; margin: 13px 0 5px; font-weight: 700; font-size: var(--text-xs); }
.stacked input[type=text], .stacked input[type=password], .stacked input[type=number],
.stacked input[type=file], .stacked select, .stacked textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--control-border);
  border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--ink);
}
.stacked input:focus, .stacked select:focus, .stacked textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, .13);
}
.stacked fieldset {
  border: 1px solid var(--line); border-radius: var(--radius);
  margin: 14px 0; padding: 6px 16px 12px;
}
.stacked fieldset legend { font-weight: 800; font-size: var(--text-xs); padding: 0 8px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--text-sm); margin: 6px 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; }
.filter-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-xs); font-weight: 700; color: var(--ink-soft); }
.form-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 30px; max-width: 660px;
}
.hint { color: var(--ink-soft); font-size: var(--text-xs); }
.filters { margin-bottom: 16px; }

/* ===================== onglets ===================== */
.tabs .tab-headers { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab-header {
  border: 1px solid transparent; border-bottom: none; background: transparent;
  padding: 9px 16px; cursor: pointer; font: inherit; font-size: var(--text-sm); font-weight: 700;
  color: var(--ink-soft); border-radius: 9px 9px 0 0;
}
.tab-header.active { background: var(--surface); border-color: var(--line); color: var(--accent-strong); }
.tab {
  display: none; background: var(--surface); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 18px 20px;
}
.tab.active { display: block; }

/* ===================== divers ===================== */
.progress { height: 9px; background: var(--track); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width var(--motion-base) var(--ease); }

/* ===================== tableau de bord ===================== */
/* Intertitre de groupe : même casse de phrase que les en-têtes de tableau.
   En capitales de 12 px espacées de .12em, il criait plus fort que les titres
   de panneau qu'il est censé introduire. */
.section-title {
  font-size: var(--text-sm); font-weight: 700; letter-spacing: -.005em;
  color: var(--text-2); margin: 26px 0 10px;
}
/* ---------- tableau de bord : cartes chiffres ---------- */
/* Les quatre cartes du tableau de bord partagent exactement la même anatomie :
   puce et libellé sur la même ligne, valeur au même corps, note en pied de
   carte. La hiérarchie vient des tons, pas d'un fond exceptionnel. */
.data-overview {
  margin: 24px 0 18px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.data-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.data-overview-head h2 { margin: 0; font-size: var(--text-md); }
.data-overview-link, .panel-link {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--accent-strong); font-size: var(--text-xs); font-weight: 700; text-decoration: none;
}
.data-overview-link:hover, .panel-link:hover { text-decoration: underline; }
.data-overview-link .ico, .panel-link .ico { width: 13px; height: 13px; }
.data-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
/* Les compteurs de données disponibles reprennent la tuile `.stat` des pages
   détail : filet de ton à gauche, libellé, valeur en chasse fixe. Le ton porte
   la même sémantique que les KPI au-dessus (accent, accent alternatif, ok). */
.data-stat {
  --stat-tone: var(--line-strong);
  --stat-tone-text: var(--text-1);
  position: relative; min-width: 0;
  padding: 12px 14px 12px 17px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.data-stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-start-start-radius: var(--radius); border-end-start-radius: var(--radius);
  background: var(--stat-tone);
}
.data-stat.tone-accent  { --stat-tone: var(--accent); --stat-tone-text: var(--accent-strong); }
.data-stat.tone-alt     { --stat-tone: var(--accent-alt); --stat-tone-text: var(--accent-alt); }
.data-stat.tone-ok      { --stat-tone: var(--ok); --stat-tone-text: var(--ok-strong); }
.data-stat.tone-warn    { --stat-tone: var(--amber); --stat-tone-text: var(--amber-strong); }
.data-stat.tone-danger  { --stat-tone: var(--danger); --stat-tone-text: var(--danger-strong); }
.data-stat-value {
  margin-top: 4px; font-size: var(--text-2xl); font-weight: 750;
  line-height: var(--leading-tight); letter-spacing: -.025em; font-variant-numeric: tabular-nums;
  color: var(--stat-tone-text);
}
.dashboard-panels { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-heading .panel-title { margin: 0; }
.activity-list { list-style: none; margin: 0; padding: 0; }
/* Le bloc texte a une base de 260 px : si la pastille d'état ne tient pas à
   côté de cette base, elle passe à la ligne au lieu de le comprimer. Sans
   cette base, « En attente d'approbation (avec erreurs) » prenait 263 des
   312 px d'un panneau étroit et le nom du fichier tombait à 8 px — une lettre
   par ligne, une ligne de liste haute de 1187 px. */
.activity-list li {
  display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
/* Le badge d'état est long (« En attente d'approbation (avec erreurs) ») :
   sans repli il imposait sa largeur au panneau et cassait la page mobile. */
.activity-list .state { white-space: normal; max-width: 100%; }
.activity-list li:last-child { border-bottom: none; }
.activity-main { flex: 1 1 260px; min-width: 0; }
.activity-name { font-weight: 650; font-size: var(--text-sm); }
/* Deux lignes au plus : un nom d'archive de 120 caractères ne doit pas
   transformer une ligne de liste en paragraphe. Le titre complet reste
   disponible par l'attribut title du lien. */
.activity-name a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.activity-meta { color: var(--text-2); font-size: var(--text-xs); margin-top: 2px; }
.quick-actions { display: grid; gap: 10px; }
.quick-action {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); text-decoration: none; color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.quick-action:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.quick-action strong { display: block; font-size: var(--text-sm); }
/* La pastille porte la même teinte que l'entrée de menu correspondante. Les
   quatre couples encre/fond sont ceux que scripts/check-contrast.mjs contrôle
   déjà pour les badges : aucune couleur de raccourci n'est inventée ici. */
.quick-action-mark {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong);
}
.quick-action-mark .ico { width: 18px; height: 18px; vertical-align: 0; }
.quick-action-mark.tone-alt { background: var(--accent-alt-soft); color: var(--accent-alt); }
.quick-action-mark.tone-amber { background: var(--amber-soft); color: var(--amber-strong); }
.quick-action-mark.tone-ok { background: var(--ok-soft); color: var(--ok-strong); }
.quick-action-text { flex: 1; min-width: 0; }
/* Le sous-titre est un enfant direct du bloc texte, plus « tout span du lien » :
   la règle large descendait aussi dans la pastille et y peignait l'icône en gris. */
.quick-action-text > span { display: block; color: var(--text-2); font-size: var(--text-xs); }
/* Le chevron n'apparaît qu'au survol et au focus : au repos les quatre lignes
   se lisent comme une liste, pas comme quatre appels à cliquer concurrents. */
.quick-action-go {
  width: 14px; height: 14px; color: var(--accent-strong);
  opacity: 0; transform: translateX(-3px);
  transition: opacity var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.quick-action:hover .quick-action-go,
.quick-action:focus-visible .quick-action-go { opacity: 1; transform: translateX(0); }

/* ===================== explorateur SQL ===================== */
.explorer { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.explorer-side { display: flex; flex-direction: column; gap: 14px; }
.side-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 14px 16px;
  box-shadow: var(--shadow-card);
}
.side-card-title {
  font-size: var(--text-2xs); font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 10px;
}
/* L'action de service rangée dans un titre latéral (« voir l'historique »,
   « derniers uniquement », « vider ») : elle reprend le corps du titre mais en
   casse de phrase, sans espacement, et pousse la couleur vers l'accent parce
   que c'est un lien, pas un libellé. */
.side-card-title .side-card-action {
  float: right; margin-left: 8px;
  font: inherit; font-size: var(--text-2xs); font-weight: 700;
  letter-spacing: .01em; text-transform: none;
  color: var(--accent-strong); text-decoration: none; white-space: nowrap;
}
.side-card-title .side-card-action:hover { text-decoration: underline; }
.dataset-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dataset-item {
  display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink);
  border: 1px solid transparent;
}
.dataset-item:hover { background: var(--surface-2); }
.dataset-item.active { background: var(--accent-soft); border-color: var(--accent-line); }
.dataset-domain { display: block; font-weight: 700; font-size: var(--text-sm); }
.dataset-meta { display: block; color: var(--ink-soft); font-size: var(--text-2xs); }
.dataset-item.missing { opacity: .75; cursor: default; }
.dataset-item.missing .dataset-domain { color: var(--ink-soft); }
.req-dot { color: var(--danger); font-weight: 900; margin-left: 4px; }
.saved-item { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 999px; padding: 5px 10px; font-size: var(--text-xs); cursor: pointer;
  font-family: ui-monospace, Consolas, monospace; color: var(--ink);
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); }

.explorer-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.editor-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  flex-wrap: wrap;
}
.editor-title { font-weight: 700; font-size: var(--text-sm); }
.dataset-switch {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--text-2xs); font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em;
}
.dataset-switch select {
  font: inherit; font-size: var(--text-xs); font-weight: 600; text-transform: none;
  letter-spacing: 0; padding: 5px 9px; border-radius: 7px;
  border: 0; background: var(--surface-2); color: var(--ink);
  max-width: 320px;
}
.dataset-switch select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,33,182,.13); }
.sql-editor {
  width: 100%; min-height: 230px; border: none; outline: none; resize: vertical;
  padding: 14px 16px; font-family: "Cascadia Mono", Consolas, monospace;
  font-size: var(--text-sm); line-height: 1.6; background: var(--control-bg); color: var(--ink);
}
.sql-editor:focus { background: var(--control-focus-bg); box-shadow: inset 0 0 0 2px rgba(91,33,182,.12); }
.editor-actions {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap;
}
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.result-head {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); font-size: var(--text-xs); color: var(--ink-soft); flex-wrap: wrap;
}
.result-head.error-head { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
/* Les deux compteurs du journal restent groupés à gauche, face aux exports. */
.journal-counts { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-error { padding: 14px 16px; color: var(--danger); font-size: var(--text-sm); white-space: pre-wrap; }
/* Le tableau de résultat est la grille canonique : cadre, en-tête collant,
   corps et pagination viennent de la feuille des tableaux, rien ici. */
.result-filter {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface); font-size: var(--text-xs); color: var(--ink-soft);
}
.result-filter input {
  flex: 1; min-width: 120px; padding: 6px 10px; font: inherit; font-size: var(--text-xs);
  border: 1px solid var(--control-border); border-radius: 7px;
}
.result-filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,33,182,.12); }
/* Un état vide est une invitation, pas un trou : la pile est centrée et
   espacée régulièrement, et la ligne de texte reste sous 46 caractères pour
   ne pas courir sur toute la largeur d'un panneau de 900 px. */
.empty-state {
  display: grid; justify-items: center; gap: 10px;
  padding: 34px 20px; text-align: center; color: var(--text-2);
}
.empty-state p { margin: 0; max-width: 46ch; }
.empty-state .btn { margin-top: 2px; }

/* ===================== connexion ===================== */
.auth-body { background: var(--paper); }
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 28px 18px; gap: 16px;
}
.auth-panel { display: flex; flex-direction: column; align-items: center; width: 100%; }
.auth-panel .alert { width: min(430px, 100%); margin: 0 0 14px; }
.signin-box {
  width: min(430px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 32px;
}
.signin-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.signin-title { font-size: 1.12rem; font-weight: 800; letter-spacing: .04em; }
.signin-sub { font-size: var(--text-xs); color: var(--ink-soft); }
.auth-foot { color: var(--ink-faint); font-size: var(--text-xs); margin: 0; }

/* ===================== sources / listes ===================== */
.entry-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.entry-card-grid { display: grid; grid-template-columns: 1.3fr 1fr .9fr 1.35fr .6fr 1.1fr .9fr 1.1fr; gap: 8px; }
.entry-card-grid--params { grid-template-columns: 1.1fr 2.1fr .6fr; }
.entry-card-grid input, .entry-card-grid select {
  padding: 7px 9px; border: 1px solid var(--control-border); border-radius: 7px;
  font: inherit; font-size: var(--text-xs); width: 100%; min-width: 0; background: var(--control-bg);
}
.password-field { position: relative; display: flex; align-items: center; min-width: 0; }
.password-field input { width: 100%; padding-right: 36px; box-sizing: border-box; }
.stacked .password-field input, .entry-card-grid .password-field input { padding-right: 36px; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-soft); cursor: pointer;
}
.password-toggle svg { width: 17px; height: 17px; }
.password-toggle:hover { color: var(--ink); background: var(--accent-soft); }
.password-toggle.is-revealed { color: var(--accent); }
.password-toggle:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.entry-card-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; justify-content: flex-end; }
.test-result { flex: 1; text-align: left; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.banner-link { margin-left: auto; font-weight: 700; color: inherit; text-decoration: underline; }
.banner .inline-form { margin: 0; }
.filter-chip {
  font-size: var(--text-2xs); font-weight: 650; color: var(--accent-strong);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 999px; padding: 3px 9px;
}
.filter-clear { font-size: var(--text-xs); font-weight: 750; color: var(--accent-strong); margin-left: 4px; }
.entry-card-grid + .entry-card-grid { margin-top: 8px; }
.mapping-label { display: block; margin-top: 9px; font-size: var(--text-xs); color: var(--ink-soft); }
.mapping-label textarea, .mapping-details textarea {
  display: block; width: 100%; margin-top: 4px; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid var(--control-border); border-radius: 7px;
  font: var(--text-xs)/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--control-bg); resize: vertical;
}
.mapping-details { margin-top: 8px; }
.mapping-details summary { cursor: pointer; font-size: var(--text-xs); color: var(--ink-soft); }
.mapping-details .hint { margin: 6px 0 0; }
.fields-details { margin-top: 6px; }
.coverage-box {
  margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.coverage-warn { border-color: #f0d7a8; background: var(--amber-soft); }
.coverage-ok { border-color: #c9e6d3; background: var(--ok-soft); }
.coverage-title { font-size: var(--text-2xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.coverage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.coverage-list li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); }
.coverage-list li.ok { color: var(--ok); }
.coverage-list li.ko { color: var(--danger); }
.coverage-mark { font-weight: 800; }
.extract-dirty { color: var(--amber); font-weight: 700; margin: 8px 0 0; }
.extract-progress {
  margin-top: 12px; padding: 10px 12px; border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm); background: var(--accent-soft);
}
.extract-progress-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: var(--text-xs); font-weight: 800; color: var(--accent-strong);
}
.extract-progress .progress { background: var(--track-accent); }
.progress-bar-error { background: var(--danger); }
.extract-progress .alert { margin: 8px 0 0; }
.extract-progress .btn { margin-top: 8px; }

/* menu d'export CSV (deux provenances) */
.export-menu { position: relative; }
.export-menu > summary { list-style: none; cursor: pointer; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > summary .caret { font-size: var(--text-2xs); opacity: .7; margin-left: 2px; }
.export-menu[open] > summary { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.export-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 280px; max-width: min(360px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: 0 14px 34px rgba(20, 16, 40, .18);
  padding: 6px;
}
.export-menu-panel a {
  display: block; padding: 8px 10px; border-radius: 6px;
  text-decoration: none; color: var(--ink);
}
.export-menu-panel a:hover { background: var(--accent-soft); }
.export-menu-panel strong { display: block; font-size: var(--text-xs); }
.export-menu-panel span { display: block; font-size: var(--text-2xs); color: var(--ink-soft); margin-top: 2px; }
.fields-details summary { cursor: pointer; font-size: var(--text-xs); }
.fields-list {
  display: block; margin-top: 6px; padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; font-size: var(--text-xs); line-height: 1.6;
  word-break: break-word; max-height: 180px; overflow: auto;
}
.entry-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.entry-row input[type=text] {
  flex: 1; padding: 8px 10px; border: 1px solid var(--control-border);
  border-radius: 7px; font: inherit; min-width: 0; background: var(--control-bg);
}
.version-list { display: flex; flex-direction: column; gap: 6px; }
.version-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.version-item.current { border-color: var(--accent-line); background: var(--accent-soft); }
.version-pill { font-weight: 800; color: var(--accent-strong); font-size: var(--text-sm); }

/* ===================== dialogues intégrés ===================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 22, 26, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .12s ease-out;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(20, 22, 26, .28);
  width: min(460px, 100%);
  padding: 22px 24px;
  animation: popIn .16s ease-out;
}
.modal-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--danger-soft); color: var(--danger);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 12px;
}
.modal-title { font-size: 1.02rem; font-weight: 750; margin-bottom: 6px; }
.modal-text { color: var(--ink-soft); font-size: var(--text-sm); margin: 0 0 4px; }
.modal-field { margin-top: 14px; }
.modal-field label { display: block; font-size: var(--text-xs); font-weight: 700; margin-bottom: 5px; }
.modal-field input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--control-border);
  border-radius: var(--radius-sm); font: inherit;
}
.modal-field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, .13);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.99) } to { opacity: 1; transform: none } }

/* raccourcis clavier */
.kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  background: var(--surface); font-size: var(--text-2xs); font-weight: 700;
  font-family: "Cascadia Mono", Consolas, monospace; color: var(--ink-soft);
}
.example-list { display: flex; flex-direction: column; gap: 5px; }
.example-btn {
  text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-size: var(--text-xs);
  color: var(--ink); cursor: pointer;
}
.example-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }

/* ===================== écran de dépôt ===================== */
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; max-width: 620px; }
.mode-btn {
  text-align: left; border: 1px solid var(--control-border); background: var(--surface);
  border-radius: var(--radius); padding: 12px 15px; cursor: pointer; font: inherit;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.mode-btn:hover { border-color: var(--accent-line); }
.mode-btn.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(91,33,182,.10); }
.mode-title { display: block; font-weight: 750; font-size: var(--text-md); color: var(--ink); }
.mode-sub { display: block; font-size: var(--text-xs); color: var(--ink-soft); margin-top: 2px; }

.deposit-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); gap: 18px; align-items: start; }
.deposit-grid.no-switch { margin-top: 4px; }
.deposit-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.deposit-side { display: flex; flex-direction: column; gap: 14px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2);
  padding: 34px 22px; transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }
.dropzone-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 4px;
}
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone-title { font-weight: 750; font-size: var(--text-md); }
.dropzone-sub { font-size: var(--text-xs); color: var(--ink-soft); }
.dropzone-sub strong { color: var(--accent-strong); }

.file-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 11px 13px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.file-card-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-chip {
  flex-shrink: 0; font-size: var(--text-2xs); font-weight: 800; letter-spacing: .08em;
  background: var(--accent); color: var(--text-on-accent); border-radius: 6px; padding: 4px 7px;
}
.file-card-info { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 700; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: var(--text-xs); color: var(--ink-soft); }

.notes-block { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 13px; background: var(--surface-2); }
.notes-block summary { cursor: pointer; padding: 10px 0; font-size: var(--text-sm); font-weight: 700; }
.notes-block textarea {
  width: 100%; margin: 0 0 12px; padding: 9px 11px; font: inherit;
  border: 1px solid var(--control-border); border-radius: var(--radius-sm); resize: vertical;
}
.notes-block textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,33,182,.12); }

.controls-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; }
.controls-title { font-size: var(--text-2xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.check-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.check { display: flex; align-items: center; gap: 9px; font-size: var(--text-sm); color: var(--ink-soft); }
.check-mark {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #efeeea; color: var(--ink-faint); font-size: var(--text-2xs); font-weight: 800;
}
.check.ok { color: var(--ok); }
.check.ok .check-mark { background: var(--ok-soft); color: var(--ok); }
.check.ko { color: var(--danger); }
.check.ko .check-mark { background: var(--danger-soft); color: var(--danger); }

.meta-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: var(--text-sm); }
.meta-list dt { color: var(--ink-soft); }
.meta-list dd { margin: 0; font-weight: 600; }
.next-steps { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: var(--text-xs); display: flex; flex-direction: column; gap: 6px; }
.activity-list.compact li { padding: 9px 2px; }

/* ---------- dépôt : choix du type, panneaux et guide ---------- */
.deposit-head { align-items: flex-start; }
.deposit-modes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.deposit-mode {
  display: flex; align-items: flex-start; gap: 11px; text-align: left;
  border: 1px solid var(--control-border); background: var(--surface);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer; font: inherit;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.deposit-mode:hover { border-color: var(--accent-line); background: var(--surface-2); }
.deposit-mode.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(91,33,182,.10); }
.deposit-mode .mode-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent);
}
.deposit-mode.active .mode-icon { border-color: var(--accent-line); }
.deposit-mode .mode-icon svg { width: 18px; height: 18px; }
.deposit-mode .mode-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deposit-mode .mode-title { font-weight: 750; font-size: var(--text-sm); color: var(--ink); }
.deposit-mode .mode-sub { font-size: var(--text-xs); color: var(--ink-soft); }

.deposit-panel { padding: 18px 20px; }
.deposit-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.deposit-panel-head h2 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.deposit-panel-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: var(--text-xs); }
.kind-badge {
  flex-shrink: 0; font-size: var(--text-2xs); font-weight: 800; letter-spacing: .08em;
  border-radius: 999px; padding: 4px 9px; background: var(--accent-soft);
  color: var(--accent-strong); border: 1px solid var(--accent-line);
}
.kind-badge-alt { background: var(--accent-alt-soft); color: var(--accent-alt); border-color: var(--accent-alt-line); }
.kind-badge-soft { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line); }

.deposit-flow {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 14px; padding: 0; counter-reset: step;
}
.deposit-flow li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-2xs); color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 9px;
}
.deposit-flow li::before {
  counter-increment: step; content: counter(step);
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-size: var(--text-2xs); font-weight: 800; color: var(--ink-soft);
}
.deposit-checks {
  margin-top: 14px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.deposit-checks .check-list { margin-bottom: 6px; }
.deposit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.deposit-actions .btn-primary { min-width: 190px; }
.deposit-tip { margin: 10px 0 0; }

.format-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.format-list li { display: flex; gap: 9px; align-items: flex-start; font-size: var(--text-xs); color: var(--ink-soft); }
.format-tag {
  flex-shrink: 0; font-size: var(--text-2xs); font-weight: 800; letter-spacing: .06em;
  padding: 3px 6px; border-radius: 5px; background: var(--accent); color: var(--text-on-accent);
}
.format-tag-alt { background: var(--accent-alt); }
.side-link { display: inline-block; margin-top: 9px; font-size: var(--text-xs); font-weight: 700; color: var(--accent-strong); }

@media (max-width: 1080px) {
  .deposit-grid { grid-template-columns: 1fr; }
  .deposit-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 720px) {
  .deposit-modes { grid-template-columns: 1fr; }
  .deposit-side { grid-template-columns: 1fr; }
  .deposit-panel { padding: 14px; }
  .deposit-panel-head { flex-direction: column; align-items: flex-start; }
  .dropzone { padding: 24px 14px; }
  .deposit-actions .btn { width: 100%; }
  .deposit-actions { flex-direction: column; }
}

/* ===================== responsive ===================== */
@media (max-width: 1080px) {
  .explorer { grid-template-columns: 1fr; }
  .card-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-card-grid { grid-template-columns: 1fr 1fr; }
  .entry-card-grid--params { grid-template-columns: 1fr 1fr; }
  .entry-card-grid input[name="sourceHost"] { grid-column: span 2; }
}
@media (max-width: 760px) {
  .card-grid.cols-4, .card-grid.cols-3, .card-grid.cols-2 { grid-template-columns: 1fr; }
  .dashboard-kpis.card-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px 12px 16px; }
  .kpi-value { font-size: var(--text-2xl); }
  .data-overview { margin: 18px 0 14px; padding: 16px; }
  .data-overview-grid { grid-template-columns: 1fr; margin-top: 12px; }
}
@media (max-width: 480px) {
  /* Deux colonnes de cartes tiennent sans que le nombre passe au-dessus du
     libellé : la puce se retire, le ton reste porté par le filet. */
  .kpi-icon { display: none; }
  .kpi-head { gap: 0; }
}
@media (max-width: 359px) {
  .dashboard-kpis.card-grid.cols-4 { grid-template-columns: 1fr; }
}

/* ===================== listes de champs (règles de données) ===================== */
.field-select { min-width: 280px; }
.field-select .field-label { margin-bottom: 2px; }
.field-select select { min-width: 280px; }
.field-custom { min-width: 280px; }
.field-tag {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: .01em;
}
.tab-count {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; background: #eeedea; color: var(--ink-soft);
  font-size: var(--text-2xs); font-weight: 800; text-align: center;
}
.tab-count-warn { background: var(--amber-soft); color: var(--amber); }
.chip-cond {
  display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px;
  border-radius: 999px; background: var(--accent-soft); font-size: var(--text-xs);
}
.rule-form { align-items: flex-end; }

/* ===================== correction des lignes ===================== */
.correction-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.correction-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); text-decoration: none;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.correction-item:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.correction-name { font-weight: 700; font-size: var(--text-md); }
.correction-meta { font-size: var(--text-xs); color: var(--ink-soft); }
.correction-action {
  margin-top: 4px; font-size: var(--text-xs); font-weight: 800;
  color: var(--accent-strong); letter-spacing: .01em;
}

/* ===================== portillon de conformité ===================== */
.conformity-reasons { margin: 8px 0; padding-left: 18px; color: var(--danger); font-size: var(--text-sm); }
.conformity-details { margin: 6px 0 10px; padding-left: 18px; }
.conformity-details li { margin-bottom: 3px; }
.ack-inline { font-size: var(--text-xs); color: var(--danger); }

/* ===================== periode / version ===================== */
.pv-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.pv-row label { flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; font-size: var(--text-xs); font-weight: 700; color: var(--ink-soft); }

/* ===================== rapport du bureau ===================== */
/* Les tuiles du rapport portent leur ton via `.stat.tone-*` : les anciennes
   classes de couleur sur `<strong>` n'ont plus de raison d'être. */
.bureau-stats { margin-bottom: 14px; }
.bureau-meta {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  align-items: center; font-size: var(--text-xs); color: var(--ink-soft);
}
.bureau-codes { display: flex; flex-wrap: wrap; gap: 8px; }
.bureau-code {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 9px; border-radius: 7px; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font-size: var(--text-xs);
}
.bureau-code:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.bureau-code.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.bureau-code-name { font-family: "Cascadia Mono", "Consolas", monospace; font-weight: 600; }
.bureau-code-count {
  min-width: 22px; text-align: center; padding: 1px 6px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: var(--text-2xs); font-weight: 800; color: var(--ink-soft);
}
.bureau-filters .check-inline {
  flex-direction: row; align-items: center; gap: 8px;
  font-weight: 600; padding-bottom: 7px; white-space: nowrap;
}
.bureau-table-card { margin-top: 16px; }
/* Largeurs de colonnes : ce sont des mesures de contenu, pas de style. Le
   corps, l'en-tête, le trait et le cadre viennent de la grille canonique ;
   `.grid--top` aligne le haut parce qu'une adresse court sur trois lignes. */
.bureau-table th:nth-child(1) { width: 84px; }
.bureau-table th:nth-child(2) { width: 100px; }
.bureau-table th:nth-child(3) { width: 150px; }
.bureau-table th:nth-child(4) { width: 130px; }
.bureau-table th:nth-child(5) { width: 130px; }
.bureau-table th:nth-child(6) { width: 280px; }
.bureau-table th:nth-child(7) { width: 240px; }
.bureau-table th:nth-child(8) { width: 240px; }
.bureau-table th:nth-child(9) { width: 90px; }

/* Journal du lot : mêmes colonnes de diagnostic que le rapport du bureau. */
.batch-log-table th:nth-child(1) { width: 80px; }
.batch-log-table th:nth-child(2), .batch-log-table th:nth-child(3) { width: 125px; }
.batch-log-table th:nth-child(4) { width: 150px; }
.batch-log-table th:nth-child(5) { width: 110px; }
.batch-log-table th:nth-child(6) { width: 230px; }
.batch-log-table th:nth-child(7), .batch-log-table th:nth-child(8) { width: 200px; }
.batch-log-table th:nth-child(9) { width: 140px; }
.bureau-check { width: 36px; text-align: center; }
.bureau-table tr.bureau-unmapped td { background: var(--amber-soft); }
.bureau-message { max-width: 520px; line-height: 1.45; }
.bureau-help { font-size: var(--text-xs); line-height: 1.45; color: var(--ink-soft); }
.bureau-hint { color: var(--ink); background: var(--amber-soft); }
.bureau-export { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bureau-export .hint { margin-left: 4px; }
.bureau-source {
  display: block; margin-top: 4px; font-size: var(--text-2xs);
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em;
}
.bureau-tag {
  display: inline-block; margin-left: 6px; padding: 1px 5px;
  border-radius: 4px; background: var(--amber-soft); color: var(--amber);
  font-size: var(--text-2xs); font-weight: 700; vertical-align: 1px;
}
.bureau-intro { margin-bottom: 16px; }
.bureau-steps { margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.6; }
.bureau-upload-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.bureau-file { display: flex; flex-direction: column; gap: 5px; font-size: var(--text-xs); font-weight: 700; color: var(--ink-soft); }
.bureau-file input { font: inherit; font-weight: 400; }
.bureau-delete { margin-top: 12px; }
.help-inline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 6px; border-radius: 999px;
  border: 1px dashed var(--line-strong); background: var(--surface-2);
  color: var(--ink-soft); font-size: var(--text-xs); font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.help-inline:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.help-inline-icon {
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid currentColor; font-size: var(--text-2xs); font-weight: 800; line-height: 1;
}

.help-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 18px;
}
.help-eyebrow {
  display: inline-block; margin-bottom: 8px;
  font-size: var(--text-2xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-strong);
}
.help-hero h1 { margin: 0 0 8px; font-size: 1.9rem; letter-spacing: -.02em; }
.help-hero .page-lead { margin: 0; max-width: 720px; }
.help-hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.help-search {
  position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 12px 8px 38px;
  box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.help-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); font-size: 1.05rem; pointer-events: none;
}
.help-search input {
  flex: 1; border: 0; background: transparent; font: inherit; font-size: var(--text-md);
  color: var(--ink); outline: none; min-width: 0;
}
.help-search input::placeholder { color: var(--ink-faint); }

.help-layout {
  display: grid; grid-template-columns: 264px minmax(0, 1fr);
  gap: 28px; align-items: start;
}
.help-toc {
  position: sticky; top: 78px;
  max-height: calc(100vh - 100px); overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 14px 10px;
}
.help-toc-title {
  font-size: var(--text-2xs); font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); padding: 0 8px 8px;
}
.help-toc nav { display: flex; flex-direction: column; gap: 1px; }
.help-toc a {
  display: flex; gap: 9px; align-items: baseline;
  padding: 7px 8px; border-radius: 7px;
  color: var(--ink-soft); font-size: var(--text-xs); font-weight: 600;
  text-decoration: none; line-height: 1.3;
}
.help-toc a:hover { background: var(--surface-2); color: var(--ink); }
.help-toc a.active { background: var(--accent-soft); color: var(--accent-strong); }
.help-toc-num {
  font-size: var(--text-2xs); font-weight: 800; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; min-width: 18px;
}
.help-toc a.active .help-toc-num { color: var(--accent); }
.help-toc-foot {
  margin-top: 12px; padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
  font-size: var(--text-2xs); color: var(--ink-faint);
}

.help-content { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.help-section {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow-sm); scroll-margin-top: 82px;
}
.help-section[hidden] { display: none; }
.help-section-head { display: flex; gap: 14px; align-items: flex-start; }
.help-section-num {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: var(--text-xs); font-weight: 800; font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.help-section-head h2 {
  margin: 0 0 4px; font-size: 1.12rem; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.help-section-head p { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.5; }
.help-anchor {
  opacity: 0; color: var(--ink-faint); text-decoration: none;
  font-weight: 600; font-size: var(--text-md);
}
.help-section:hover .help-anchor, .help-anchor:focus { opacity: 1; }

.help-steps {
  margin: 18px 0 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
  counter-reset: helpstep;
}
.help-steps li {
  position: relative; padding: 10px 12px 10px 40px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: var(--text-sm); line-height: 1.5;
  counter-increment: helpstep;
}
.help-steps li::before {
  content: counter(helpstep);
  position: absolute; left: 12px; top: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-soft); font-size: var(--text-2xs); font-weight: 800;
}
.help-steps li strong { display: block; margin-bottom: 2px; color: var(--ink); }
.help-steps li span { color: var(--ink-soft); }

.help-subtitle {
  margin: 20px 0 8px; font-size: var(--text-2xs); font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
/* Le cadre et le corps de ce tableau d'aide viennent de la grille canonique ;
   seules les deux premières colonnes y sont mesurées. */
.help-buttons th:first-child, .help-buttons td:first-child { width: 24%; }
.help-buttons th:nth-child(2), .help-buttons td:nth-child(2) { width: 22%; }
.help-button-label {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: var(--text-2xs); font-weight: 700; line-height: 1.4;
}
.help-where { color: var(--ink-soft); font-size: var(--text-xs); }
.help-note { display: block; margin-top: 4px; color: var(--ink-faint); font-size: var(--text-xs); }

.help-tips {
  margin-top: 16px; padding: 12px 14px;
  background: var(--amber-soft); border: 1px solid #f0dcb8;
  border-radius: var(--radius-sm);
}
.help-tips-title {
  font-size: var(--text-2xs); font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 6px;
}
.help-tips ul { margin: 0; padding-left: 18px; }
.help-tips li { font-size: var(--text-xs); line-height: 1.55; color: var(--ink-soft); }
.help-tips li + li { margin-top: 5px; }

.help-empty { text-align: center; }
.help-empty p { margin: 6px 0 0; }
.help-footer-note {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 4px 4px 24px; color: var(--ink-faint); font-size: var(--text-2xs);
}

@media (max-width: 1080px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
  .help-toc nav { flex-direction: row; flex-wrap: wrap; }
  .help-toc a { flex: 1 1 220px; }
  .help-toc-foot { display: none; }
}
@media (max-width: 720px) {
  .help-section { padding: 18px 16px; }
  .help-section-head { gap: 10px; }
  .help-section-num { width: 32px; height: 32px; border-radius: 9px; font-size: var(--text-2xs); }
  .help-hero h1 { font-size: 1.5rem; }
  .help-inline-text { display: none; }
  .help-inline { padding: 5px 7px; }
}

@media print {
  .help-search, .help-toc,
  .help-hero-meta .btn, .help-inline { display: none !important; }
  body, .canvas, .canvas-inner { background: #fff !important; }
  .help-layout { display: block; }
  .help-section {
    break-inside: avoid; box-shadow: none; border-color: #ccc;
    margin-bottom: 14px;
  }
  .help-anchor { display: none; }
  .help-tips { background: #fff; border-color: #ccc; }
}

/* ---------- explorateur : édition de lignes ----------
   Déplacé depuis la <style> d'explorer/edit.ejs. Une feuille de vue écrasait
   toute style.css par son ordre de source ; en fin de fichier elle retrouve le
   même ordre de cascade. `.check-inline` est resserré en `.bulk-panel
   .check-inline` pour ne pas déteindre sur le rapport du bureau. */
.cell-input {
  width: 100%; min-width: 120px; padding: 5px 8px; font: inherit; font-size: var(--text-xs);
  border: 1px solid var(--control-border); border-radius: 6px; background: var(--control-bg);
}
.cell-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,33,182,.13); }
.bulk-panel { margin-bottom: 16px; }
.bulk-result { margin-top: 12px; }
.bulk-count { font-size: var(--text-sm); margin-bottom: 8px; }
.diff-before, .diff-after {
  display: inline-block; padding: 2px 7px; border-radius: 6px; font-family: ui-monospace, monospace;
}
.diff-before { background: var(--danger-soft); color: var(--danger); }
.diff-after { background: var(--ok-soft); color: var(--ok); }
.bulk-panel .check-inline { flex-direction: row; align-items: center; gap: 6px; align-self: center; }
