
  .content { background: var(--surface-soft); }

  /* ===== Header ===== */
  .wf-header { display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-lg); flex-wrap: wrap; }
  .wf-header h1 { font-size: 22px; font-weight: 500; color: var(--ink); margin: 0; letter-spacing: -0.3px; }
  .wf-status-pill {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
    border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary);
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  }
  .wf-status-pill::before { content: ''; width: 6px; height: 6px; border-radius: var(--r-full); background: var(--primary); }
  .wf-header-spacer { flex: 1; }
  .wf-btn {
    height: 36px; padding: 0 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
    border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink);
    cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
    transition: background 80ms ease;
  }
  .wf-btn:hover { background: var(--surface-soft); }
  .wf-btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
  .wf-btn.primary:hover { background: var(--primary-active); }
  .wf-btn.danger { color: var(--semantic-down); border-color: var(--hairline); }
  .wf-btn.danger:hover { background: var(--surface-soft); }
  .wf-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .wf-btn.small { height: 30px; padding: 0 12px; font-size: 12px; }
  .wf-btn.ghost { border-color: transparent; background: transparent; }
  .wf-btn.ghost:hover { background: var(--surface-soft); }

  /* ===== Flux de cartes ===== */
  /* ===== Deux colonnes · le flux et son aperçu =====
     Le flux garde ses 580px (il n'a pas besoin de plus, et une carte trop large
     se lit mal). L'aperçu prend ce qui reste, plafonné · c'est une fiche qu'on
     imite, pas un tableau de bord. Sous 1100px il repasse dessous : à cette
     largeur, deux colonnes donneraient deux colonnes illisibles. */
  /* La PAIRE se centre, pas chacun de son côté. Sans le max-width, la colonne
     de gauche s'étirait sur toute la largeur restante avec le flux (580px)
     centré DEDANS · l'aperçu se retrouvait collé au bord droit avec 278px de
     vide au milieu, mesurés sur un écran de 1700px. */
  .wf-split {
    display: flex; align-items: flex-start; gap: var(--space-lg);
    max-width: 1064px; margin: 0 auto;   /* 580 + 24 + 460 */
  }
  .wf-split-main { flex: 1 1 580px; max-width: 580px; min-width: 0; }
  /* ⚠ LE `top` DOIT DESCENDRE SOUS LA BARRE DU HAUT. Elle est sticky, haute de
     `--topbar-h` et posée à z-index 50 · avec `top: var(--space-base)` le
     panneau se collait à 16px du haut de la FENÊTRE, donc son en-tête (et le
     début du suivi) glissait DERRIÈRE la barre en défilant. Vécu · « quand je
     scroll, je perds l'étape 1 ». Le titre était bien dans la fenêtre, il était
     juste recouvert : `elementFromPoint` au niveau du titre rendait `.topbar`.
     Vérifier qu'un élément est dans la fenêtre ne dit PAS qu'on le voit. */
  .wf-preview {
    flex: 0 1 460px; min-width: 0;
    position: sticky; top: calc(var(--topbar-h) + var(--space-base));
    background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl);
    padding: var(--space-base); box-shadow: var(--shadow);
    max-height: calc(100vh - var(--topbar-h) - var(--space-xl)); overflow: auto;
  }
  .wf-preview-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
  .wf-preview-titre { font-size: var(--text-h2); font-weight: 600; color: var(--ink); }
  .wf-preview-sous { font-size: var(--text-caption); color: var(--muted); }
  .wf-preview-note {
    font-size: var(--text-caption); line-height: 1.5; color: var(--muted);
    background: var(--surface-soft); border-radius: var(--r-md);
    padding: 8px 10px; margin-bottom: var(--space-sm);
  }
  /* La scène imite le fond d'une fiche · sans ça l'aperçu flotte et on ne sait
     pas où commence « la fiche ». */
  .wf-preview-scene { background: var(--surface-soft); border-radius: var(--r-md); padding: var(--space-xxs); }
  /* Le cadre porte la scène · sa hauteur est posée par le parent au fil des
     redessins (un cadre ne se dimensionne pas à son contenu). */
  #wf-preview-frame { display: block; width: 100%; border: 0; height: 320px; background: transparent; }
  @media (max-width: 1100px) {
    .wf-split { flex-direction: column; }
    .wf-split-main, .wf-preview { flex: 1 1 auto; width: 100%; }
    .wf-preview { position: static; max-height: none; }
  }

  .wf-flow { max-width: 580px; margin: 0 auto; display: flex; flex-direction: column; gap: 0; }
  .wf-connector { width: 2px; height: 18px; background: var(--hairline); margin: 0 auto; }

  .wf-card {
    background: var(--canvas); border: 1px solid var(--hairline); border-top-width: 3px;
    border-radius: var(--r-md); overflow: hidden; transition: border-color 80ms ease, box-shadow 80ms ease;
  }
  .wf-card[data-type="start"]    { border-top-color: var(--primary); }
  .wf-card[data-type="step"]     { border-top-color: var(--ink); }
  .wf-card[data-type="decision"] { border-top-color: var(--accent-yellow); }
  .wf-card[data-type="outcome"]  { border-top-color: var(--semantic-up); }
  .wf-card[data-type="end"]      { border-top-color: var(--semantic-down); }
  .wf-card.editing { box-shadow: 0 0 0 2px var(--primary); border-color: var(--primary); }
  .wf-card.flash { box-shadow: 0 0 0 2px var(--accent-yellow); }

  .wf-card-compact { padding: 14px 16px; cursor: pointer; }
  .wf-card-compact:hover { background: var(--surface-soft); }
  .wf-card-head { display: flex; align-items: center; gap: 10px; }
  .wf-dot { width: 10px; height: 10px; border-radius: var(--r-full); flex-shrink: 0; }
  .wf-card[data-type="start"]    .wf-dot { background: var(--primary); }
  .wf-card[data-type="step"]     .wf-dot { background: var(--ink); }
  .wf-card[data-type="decision"] .wf-dot { background: var(--accent-yellow); }
  .wf-card[data-type="outcome"]  .wf-dot { background: var(--semantic-up); }
  .wf-card[data-type="end"]      .wf-dot { background: var(--semantic-down); }
  .wf-card-label { font-size: 15px; font-weight: 600; color: var(--ink); flex: 1; }
  .wf-card-code {
    font-family: var(--font-mono); font-size: 11px; color: var(--muted);
    background: var(--surface-soft); padding: 2px 7px; border-radius: var(--r-xs);
  }
  .wf-card-type-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
  .wf-card-desc { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
  .wf-card-reorder { display: inline-flex; flex-direction: column; gap: 1px; flex-shrink: 0; margin-left: 2px; }
  .wf-reorder-btn { background: transparent; border: none; cursor: pointer; color: var(--muted-soft); font-size: 10px; line-height: 1; padding: 1px 4px; border-radius: var(--r-xs); font-family: inherit; }
  .wf-reorder-btn:hover { background: var(--surface-strong); color: var(--ink); }
  .wf-reorder-btn:disabled { opacity: 0.25; cursor: default; }
  .wf-card-paths { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
  .wf-path-line { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--body); flex-wrap: wrap; }
  .wf-path-cond {
    font-family: var(--font-mono); font-size: 11px; background: var(--surface-soft);
    border: 1px solid var(--hairline-soft); border-radius: var(--r-xs); padding: 1px 6px; color: var(--ink);
  }
  .wf-path-icons { display: inline-flex; gap: 3px; color: var(--muted-soft); }
  .wf-path-icons svg { width: 13px; height: 13px; }
  .wf-path-arrow { color: var(--muted-soft); }
  .wf-path-target { color: var(--primary); font-weight: 500; cursor: pointer; border-bottom: 1px dashed transparent; }
  .wf-path-target:hover { border-bottom-color: var(--primary); }
  .wf-card-sla { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 8px; }

  /* ===== Edition inline ===== */
  .wf-card-edit { padding: 16px; border-top: 1px solid var(--hairline-soft); background: var(--surface-soft); }
  .wf-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
  .wf-field-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .wf-field-hint { font-size: 11px; color: var(--muted-soft); }
  .wf-inp, .wf-sel, .wf-ta {
    border: 1px solid var(--hairline); background: var(--input-bg); border-radius: var(--r-md);
    padding: 9px 12px; font-size: 13px; color: var(--ink); font-family: inherit; outline: none; transition: border-color 80ms;
  }
  .wf-inp:focus, .wf-sel:focus, .wf-ta:focus { border-color: var(--primary); }
  .wf-inp[readonly] { background: var(--surface-strong); color: var(--muted); cursor: not-allowed; }
  .wf-ta { min-height: 60px; resize: vertical; }
  .wf-inp-mono { font-family: var(--font-mono); }
  .wf-inp-sm { padding: 6px 9px; font-size: 12px; }

  /* Avertissement de configuration · il ne bloque rien, il explique une
     conséquence au moment où on la crée. */
  .wf-avert {
    margin-top: 10px; padding: 8px 10px;
    font-size: var(--text-caption); line-height: 1.5; color: var(--body);
    background: var(--surface-soft);
    border-left: 2px solid var(--accent-yellow); border-radius: var(--r-sm);
  }
  .wf-avert strong { color: var(--ink); font-weight: 600; }

  .wf-radio-group { display: flex; gap: 6px; flex-wrap: wrap; }
  .wf-radio-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border: 1px solid var(--hairline); border-radius: var(--r-pill); cursor: pointer;
    font-size: 12px; color: var(--ink); background: var(--canvas);
  }
  .wf-radio-chip input { display: none; }
  .wf-radio-chip.checked { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

  .wf-section-label {
    font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.05em; margin: 18px 0 8px;
  }

  /* En-tete de categorie dans la liste des reponses · reflete le bouton qui
     apparait sur la fiche (les reponses dessous sont ses choix). */
  .wf-grp-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; color: var(--ink);
    margin: 14px 0 6px;
  }
  .wf-grp-header::after {
    content: ''; flex: 1; height: 1px; background: var(--hairline);
  }
  .wf-grp-header .wf-grp-pill {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--muted);
    background: var(--surface-soft); border: 1px solid var(--hairline-soft);
    border-radius: var(--r-pill); padding: 2px 8px;
  }
  .wf-grp-header.solo { color: var(--muted); font-weight: 500; }

  /* ===== Reponses ===== */
  .wf-resp {
    background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
    margin-bottom: 10px; overflow: hidden;
  }
  .wf-resp-head {
    display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer;
  }
  .wf-resp-head:hover { background: var(--surface-soft); }
  .wf-resp-chevron { color: var(--muted-soft); transition: transform 120ms; flex-shrink: 0; }
  .wf-resp.open .wf-resp-chevron { transform: rotate(90deg); }
  .wf-resp-btn-label { font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; }
  .wf-resp-summary { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
  .wf-resp-rm {
    background: transparent; border: none; cursor: pointer; color: var(--semantic-down);
    width: 26px; height: 26px; border-radius: var(--r-md); font-size: 16px; line-height: 1; flex-shrink: 0;
  }
  .wf-resp-rm:hover { background: var(--surface-soft); }
  .wf-resp-body { padding: 0 12px 14px; display: none; }
  .wf-resp.open .wf-resp-body { display: block; }
  .wf-resp-body-inner { border-top: 1px solid var(--hairline-soft); padding-top: 12px; }

  .wf-mini-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

  /* Section repliable des reglages rarement modifies (nom, regroupement...) */
  .wf-adv-fold {
    border: 1px solid var(--hairline-soft); border-radius: var(--r-md);
    background: var(--surface-soft); margin-bottom: 10px;
  }
  .wf-adv-summary {
    cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted);
    padding: 8px 12px; user-select: none; list-style: none;
  }
  .wf-adv-summary::-webkit-details-marker { display: none; }
  .wf-adv-summary::before { content: '\25B8'; color: var(--muted-soft); margin-right: 6px; }
  .wf-adv-fold[open] .wf-adv-summary::before { content: '\25BE'; }
  .wf-adv-summary:hover { color: var(--ink); }
  .wf-adv-body { padding: 2px 12px 6px; }

  /* champs d une reponse */
  .wf-field-row {
    background: var(--surface-soft); border: 1px solid var(--hairline-soft); border-radius: var(--r-md);
    padding: 10px; margin-bottom: 8px;
  }
  .wf-field-row-top { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: center; }
  .wf-field-row-constraints { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; font-size: 12px; color: var(--body); }
  .wf-field-row-constraints label { display: inline-flex; align-items: center; gap: 5px; }
  .wf-chk { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

  /* effets */
  .wf-effect { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--hairline-soft); }
  .wf-effect:last-child { border-bottom: none; }
  .wf-effect-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
  .wf-effect-detail { padding-left: 22px; display: none; flex-direction: column; gap: 6px; }
  .wf-effect.on .wf-effect-detail { display: flex; }

  .wf-edit-foot { display: flex; gap: 8px; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline-soft); }

  /* ===== Modal plein ecran ===== */
  .wf-fs-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .wf-fs-backdrop.open { opacity: 1; pointer-events: auto; }
  .wf-fs { position: fixed; inset: 32px; background: var(--canvas); border-radius: var(--r-xl); z-index: 301; display: none; flex-direction: column; overflow: hidden; }
  .wf-fs.open { display: flex; }
  .wf-fs-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
  .wf-fs-title { font-size: 15px; font-weight: 600; color: var(--ink); }
  .wf-fs-zoom { display: inline-flex; gap: 4px; align-items: center; background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 2px; }
  .wf-fs-zoom button { width: 28px; height: 28px; border: none; background: transparent; border-radius: var(--r-full); cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 600; }
  .wf-fs-zoom button:hover { background: var(--canvas); }
  .wf-fs-zoom-value { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding: 0 8px; min-width: 48px; text-align: center; }
  .wf-fs-canvas { flex: 1; overflow: auto; background: var(--surface-soft); background-image: radial-gradient(circle, var(--hairline-soft) 1px, transparent 1px); background-size: 24px 24px; padding: 40px; display: flex; align-items: center; justify-content: center; }
  .wf-fs-inner { transform-origin: center center; transition: transform 100ms ease; }
  .wf-fs-inner svg { max-width: none; }

  /* ===== Modal Calendrier de travail ===== */
  .wf-sched-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 320; opacity: 0; pointer-events: none; transition: opacity 200ms; }
  .wf-sched-backdrop.open { opacity: 1; pointer-events: auto; }
  .wf-sched {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%);
    width: min(540px, 94vw); max-height: 88vh; background: var(--canvas);
    border-radius: var(--r-xl); z-index: 321; display: none; flex-direction: column; overflow: hidden;
  }
  .wf-sched.open { display: flex; }
  .wf-sched-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
  .wf-sched-title { font-size: 16px; font-weight: 600; color: var(--ink); }
  .wf-sched-body { padding: 18px 20px; overflow: auto; flex: 1; }
  .wf-sched-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--hairline); }
  .wf-sched-day { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
  .wf-sched-dayname { font-size: 13px; color: var(--ink); width: 84px; }
  .wf-sched-toggle { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
  .wf-sched-toggle input { display: none; }
  .wf-sched-track { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--hairline); position: relative; transition: background 120ms; }
  .wf-sched-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--r-full); background: var(--canvas); transition: transform 120ms; }
  .wf-sched-toggle input:checked + .wf-sched-track { background: var(--primary); }
  .wf-sched-toggle input:checked + .wf-sched-track::after { transform: translateX(16px); }
  .wf-sched-holiday { display: flex; align-items: center; justify-content: space-between; background: var(--surface-soft); border: 1px solid var(--hairline-soft); border-radius: var(--r-md); padding: 7px 12px; margin-bottom: 6px; font-size: 13px; color: var(--ink); }

  /* ===== Misc ===== */
  .no-access { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: 40px; text-align: center; color: var(--body); }
  .no-access h2 { color: var(--ink); margin: 0 0 8px; font-weight: 500; }
  .wf-empty { background: var(--canvas); border: 1px dashed var(--hairline); border-radius: var(--r-md); padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
  .wf-toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: var(--canvas); padding: 12px 18px; border-radius: var(--r-pill); font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index: 400; opacity: 0; transform: translateY(8px); transition: opacity 150ms, transform 150ms; pointer-events: none; }
  .wf-toast.show { opacity: 1; transform: translateY(0); }

  /* Le nom du tableau dont on édite le suivi · dans le titre, pas à côté. */
  .wf-tableau-nom { color: var(--muted); font-weight: var(--weight-regular); }
