    :root {
      --bg:#f8fafc; --surface:#ffffff; --border:#e2e8f0; --border-strong:#cbd5e1;
      --ink:#0f172a; --muted:#64748b; --faint:#94a3b8;
      --accent:#2563eb; --accent-ink:#1d4ed8; --accent-soft:#eff6ff;
      --ok:#16a34a; --warn:#d97706; --err:#dc2626;
      --radius:10px; --shadow:0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
    }
    * { box-sizing: border-box; }
    html, body { min-height: 100%; }
    body {
      margin: 0; background: var(--bg); color: var(--ink);
      font-family: 'Inter', -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    .page { display: flex; align-items: flex-start; justify-content: center; padding: 20px 20px 24px; }
    .app { width: 100%; max-width: 820px; }

    /* ── Bandeau header ── */
    .navbar-custom {
      width: 100%; background: #1B2D4F; padding: 22px 48px;
      display: flex; align-items: center; justify-content: space-between;
      position: relative; overflow: hidden;
    }
    .navbar-custom::before {
      content: ''; position: absolute; right: 18%; top: -60px;
      width: 260px; height: 260px; border-radius: 50%;
      background: #E05030; opacity: .11; pointer-events: none;
    }
    .navbar-custom::after {
      content: ''; position: absolute; right: 28%; top: 10px;
      width: 110px; height: 110px; border-radius: 50%;
      background: #E05030; opacity: .08; pointer-events: none;
    }
    .nav-left { position: relative; z-index: 1; }
    .nav-badge {
      display: inline-block; background: #E05030; color: #fff;
      font-size: 9.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
      padding: 3px 10px; border-radius: 4px; margin-bottom: 8px;
    }
    .nav-title {
      font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 800;
      color: #fff; line-height: 1.2; margin: 0;
    }
    .nav-pill {
      display: flex; align-items: center; gap: 8px;
      background: rgba(255,255,255,.08); border: .5px solid rgba(255,255,255,.18);
      border-radius: 20px; padding: 8px 16px; position: relative; z-index: 1;
    }
    .nav-pill .live { width: 7px; height: 7px; border-radius: 50%; background: #4CAF50; flex-shrink: 0; }
    .nav-pill span { font-size: 11.5px; color: rgba(255,255,255,.6); white-space: nowrap; }

    /* En-tête */
    .masthead { margin-bottom: 12px; }
    .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
    .masthead h1 { font-size: 22px; font-weight: 650; margin: 6px 0 0; letter-spacing: -.01em; }

    /* Carte */
    .card {
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
      box-shadow: var(--shadow); overflow: hidden;
    }
    .card-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
    .card-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
    .card-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
    .card-head em { font-style: italic; }
    .card-body { padding: 18px 22px; }

    /* Boutons d'action */
    .btn {
      appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px;
      padding: 11px 18px; border-radius: 8px; border: 1px solid var(--accent);
      background: var(--accent); color: #fff; transition: background .15s ease, border-color .15s ease;
      display: inline-flex; align-items: center; gap: 8px;
    }
    .btn:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); }
    .btn:disabled { opacity: .55; cursor: not-allowed; }
    .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
    .btn.secondary:hover:not(:disabled) { background: #f1f5f9; }
    .btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
    .btn.loading .spinner { display: inline-block; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Stepper */
    .stepper { list-style: none; margin: 0; padding: 0; counter-reset: step; }
    .step { position: relative; padding: 0 0 26px 38px; }
    .step:last-child { padding-bottom: 0; }
    .step::before {
      content: counter(step); counter-increment: step;
      position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
      display: grid; place-items: center; font-size: 12px; font-weight: 600;
      background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--muted);
    }
    .step::after {
      content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 1.5px; background: var(--border);
    }
    .step:last-child::after { display: none; }
    .step.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
    .step.active::before { border-color: var(--accent); color: var(--accent-ink); }
    .step h3 { font-size: 15px; font-weight: 600; margin: 3px 0 4px; }
    .step p { font-size: 14px; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
    .step p em { font-style: italic; }
    .step.done p { color: var(--faint); }

    /* Statut */
    .status { margin-top: 12px; font-size: 14px; font-weight: 500; min-height: 18px; display: flex; align-items: center; gap: 8px; }
    .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
    .status:empty::before { display: none; }
    .status.success { color: var(--ok); } .status.success::before { background: var(--ok); }
    .status.warning { color: var(--warn); } .status.warning::before { background: var(--warn); }
    .status.error   { color: var(--err); } .status.error::before   { background: var(--err); }

    /* Résultat final : identifiant de tenant */
    .result {
      margin-top: 20px; border: 1px solid #bbf7d0; background: #f0fdf4;
      border-radius: var(--radius); padding: 18px 20px;
    }
    .result-head { display: flex; align-items: center; gap: 10px; color: var(--ok); }
    .result-head strong { font-size: 15px; }
    .result-text { font-size: 14px; color: #14532d; margin: 10px 0 16px; line-height: 1.5; }
    .field label {
      display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
      text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
    }
    .field-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
    .field-row code {
      flex: 1; min-width: 240px; background: var(--surface); border: 1px solid var(--border-strong);
      border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
      font-size: 14px; color: var(--ink); user-select: all; overflow-wrap: anywhere; line-height: 1.4;
    }
    .btn.copy { flex: none; padding: 10px 14px; font-size: 14px; }
    .btn.copy.copied { border-color: var(--ok); color: var(--ok); background: var(--surface); }

    /* Journal */
    .logwrap { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
    .logbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #f8fafc; }
    .logbar span { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
    .logbar button { appearance: none; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
    .logbar button:hover { background: #f1f5f9; color: var(--ink); }
    .log {
      margin: 0; padding: 16px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
      font-size: 13.5px; line-height: 1.65; color: #334155; white-space: pre-wrap;
      max-height: 320px; overflow-y: auto;
    }

    .hidden { display: none !important; }

    /* ── Ajouts propres à la page Versioning ── */

    /* Bandeau d'avertissement / information */
    .notice {
      margin: 0 0 18px; padding: 12px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.5;
      border: 1px solid #fde68a; background: #fffbeb; color: #78350f;
    }
    .notice strong { font-weight: 600; }
    .notice code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }

    /* Liste des permissions consenties */
    .perms { margin: 0 0 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .perms-head {
      padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--border);
      font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
    }
    .perms ul { list-style: none; margin: 0; padding: 6px 12px 10px; }
    .perms li { font-size: 13.5px; color: var(--muted); padding: 4px 0; display: flex; gap: 8px; align-items: baseline; }
    .perms li code {
      font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px;
      color: var(--ink); background: #f1f5f9; border-radius: 4px; padding: 1px 5px;
    }
    .perms li .kind { font-size: 11px; color: var(--faint); }

    /* Récapitulatif de la configuration détectée */
    .recap { margin: 16px 0 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .recap dl { margin: 0; display: grid; grid-template-columns: minmax(140px, auto) 1fr; }
    .recap dt {
      padding: 9px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted);
      background: #f8fafc; border-bottom: 1px solid var(--border);
    }
    .recap dd {
      margin: 0; padding: 9px 12px; font-size: 13.5px; color: var(--ink);
      border-bottom: 1px solid var(--border); overflow-wrap: anywhere;
    }
    .recap dt:last-of-type, .recap dd:last-of-type { border-bottom: none; }

    /* Bloc JSON final */
    .json-block {
      margin: 0 0 12px; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px 15px;
      font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45;
      white-space: pre; overflow-x: auto; user-select: all;
    }
    .actions { display: flex; gap: 10px; flex-wrap: wrap; }

    /* ── Vue d'accueil : le déroulé annoncé ── */
    .plan { list-style: none; margin: 0 0 20px; padding: 0; counter-reset: plan; }
    .plan li { position: relative; padding: 0 0 16px 38px; }
    .plan li:last-child { padding-bottom: 4px; }
    .plan li::before {
      content: counter(plan); counter-increment: plan;
      position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
      display: grid; place-items: center; font-size: 12px; font-weight: 600;
      background: var(--accent-soft); color: var(--accent-ink);
    }
    .plan h3 { font-size: 14.5px; font-weight: 600; margin: 3px 0 3px; }
    .plan p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.5; }
    .plan em { font-style: italic; }

    /* ── Reprise discrète, en bas de la vue de configuration ── */
    .restart { margin: 18px 0 0; }
    .linklike {
      appearance: none; background: none; border: none; padding: 0;
      font: inherit; font-size: 13px; color: var(--faint);
      text-decoration: underline; cursor: pointer;
    }
    .linklike:hover { color: var(--muted); }

    /* ── Vue de configuration : déroulé des opérations ── */
    .lead { font-size: 14px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }

    .tasks {
      list-style: none; margin: 14px 0 0; padding: 0;
      border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
    }
    .tasks li {
      display: flex; align-items: center; gap: 11px; padding: 7px 14px;
      border-bottom: 1px solid var(--border); font-size: 14px;
    }
    .tasks li:last-child { border-bottom: none; }
    .tasks .tick {
      width: 18px; height: 18px; border-radius: 50%; flex: none;
      border: 1.5px solid var(--border-strong); background: var(--surface);
      display: grid; place-items: center; font-size: 11px; line-height: 1; color: #fff;
    }
    .tasks .tname { flex: 1; color: var(--faint); }
    .tasks .tdetail { font-size: 13px; color: var(--faint); text-align: right; overflow-wrap: anywhere; }

    .tasks li[data-state="running"] .tick {
      border-color: var(--accent); border-top-color: transparent;
      animation: spin .7s linear infinite;
    }
    .tasks li[data-state="running"] .tname { color: var(--ink); font-weight: 500; }

    .tasks li[data-state="done"] .tick { background: var(--ok); border-color: var(--ok); }
    .tasks li[data-state="done"] .tick::after { content: "✓"; }
    .tasks li[data-state="done"] .tname { color: var(--ink); }
    .tasks li[data-state="done"] .tdetail { color: var(--muted); }

    .tasks li[data-state="error"] .tick { background: var(--err); border-color: var(--err); }
    .tasks li[data-state="error"] .tick::after { content: "✕"; }
    .tasks li[data-state="error"] .tname { color: var(--err); font-weight: 500; }

    .tasks li[data-state="skipped"] .tick { border-style: dashed; }
    .tasks li[data-state="skipped"] .tname { color: var(--faint); }

    /* Journal brut, replié par défaut */
    .rawlog {
      margin-top: 14px; border: 1px solid var(--border); border-radius: 10px;
      overflow: hidden; background: var(--surface);
    }
    .rawlog > summary {
      padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--muted);
      list-style: none; user-select: none;
    }
    .rawlog > summary::-webkit-details-marker { display: none; }
    .rawlog > summary::before { content: "▸ "; color: var(--faint); }
    .rawlog[open] > summary::before { content: "▾ "; }
    .rawlog > summary:hover { color: var(--ink); background: #f8fafc; }
    .rawlog .logbar { border-top: 1px solid var(--border); }
    .rawlog .log { max-height: 220px; }

    /* Le récapitulatif s'affiche en entier : c'est ce que l'admin doit relire
       avant de le transmettre, il ne doit pas avoir à faire défiler dedans. */
    .json-block { max-height: none; }

    /* ── Coordonnées du cabinet ──
       Encadré comme le bloc des permissions, pour qu'il se lise en un bloc et
       non en trois champs posés sur la carte. Il précède le récapitulatif : le
       nom saisi apparait aussitot dans le JSON relu juste en dessous. */
    .contact { margin: 0 0 14px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .contact-head {
      padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--border);
      font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
    }
    .contact-body { padding: 14px 12px 12px; }
    .contact-lead { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
    .cfield { margin-bottom: 12px; }
    .cfield:last-of-type { margin-bottom: 0; }
    .cfield label {
      display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
      text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
    }
    .cfield input {
      width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink);
      background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
      transition: border-color .15s, box-shadow .15s;
    }
    .cfield input::placeholder { color: var(--faint); }
    .cfield input:focus {
      outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    }
    /* Marquage en rouge seulement après une tentative d'envoi : signaler un champ
       vide avant que l'admin ait fini de le remplir serait du bruit. */
    .cfield input.invalid { border-color: var(--err); }
    .cfield input.invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
    .cfield input:disabled { background: #f8fafc; color: var(--muted); }
    .contact-error { margin-top: 12px; font-size: 13.5px; color: var(--err); line-height: 1.5; }
