/* ═══════════════════════════════════════════════════════════════════════════
   Démo Lead Hub ESPE — page autonome, deux chartes qui cohabitent :
   · la PAGE (en-tête, chapitres, valeur, pied) suit la charte du site mindeon.ai
     et du CRM : Plus Jakarta Sans / Manrope, accent #FF4A1C, fonds chauds ;
   · la FENÊTRE D'APPLICATION reprend les jetons réels de l'app ESPE
     (`app/globals.css`) : Inter, brand #FF6B35, canvas #FAFAF9, traits #E7E5E4,
     badges de segment aux couleurs de `lib/routing.ts`.
   Page volontairement en thème clair unique : elle vit dans un site clair.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* — charte vitrine / CRM — */
  --v-bg: #FBFAF7;
  --v-surface: #FFFFFF;
  --v-soft: #F8F7F4;
  --v-warm: #FBF7EE;
  --v-line: #E8E7E3;
  --v-ink: #0E0E0C;
  --v-ink-2: #3D3D38;
  --v-muted: #76746C;
  --v-accent: #FF4A1C;
  --v-accent-hover: #E63E14;
  --v-accent-soft: rgba(255, 74, 28, .10);
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  --font-head: 'Manrope', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  /* — jetons de l'application ESPE — */
  --brand: #FF6B35;
  --brand-hover: #E85A28;
  --brand-strong: #C2410C;
  --brand-soft: #FFF0EB;
  --brand-ring: #FFD9C7;
  --canvas: #FAFAF9;
  --surface: #FFFFFF;
  --line: #E7E5E4;
  --line-strong: #D6D3D1;
  --fill: #F5F5F4;
  --ink: #0C0A09;
  --ink-body: #57534E;
  --ink-muted: #78716C;
  --ink-subtle: #A8A29E;
  --waalaxy: #0077B5;
  --waalaxy-hover: #005885;
  --success: #10B981; --success-bg: #ECFDF5; --success-fg: #065F46; --success-bd: #A7F3D0;
  --warning-bg: #FFFBEB; --warning-fg: #92400E; --warning-bd: #FDE68A;
  --info-bg: #EFF6FF; --info-fg: #1E40AF; --info-bd: #BFDBFE;
  --violet-bg: #F5F3FF; --violet-fg: #5B21B6; --violet-bd: #DDD6FE;
  --font-app: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(12, 10, 9, .05);
  --shadow-md: 0 6px 18px -8px rgba(12, 10, 9, .18), 0 1px 2px rgba(12, 10, 9, .05);
  --shadow-lg: 0 24px 60px -24px rgba(12, 10, 9, .28), 0 2px 6px rgba(12, 10, 9, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--v-bg);
  color: var(--v-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  padding-inline: 16px;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; text-wrap: balance; margin: 0; }
.wrap { max-width: 1080px; margin-inline: auto; }
.wrap--wide { max-width: 1240px; }
:focus-visible { outline: 2px solid var(--v-accent); outline-offset: 2px; }

/* ───────────────────────────── En-tête ───────────────────────────── */
.hero { padding-block: 56px 28px; }
.eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--v-accent);
}
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 800; letter-spacing: -.02em; max-width: 18ch; }
.lede { font-size: clamp(16px, 1.6vw, 19px); color: var(--v-ink-2); max-width: 62ch; margin: 18px 0 0; }
.kpis {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.kpis li {
  background: var(--v-surface); border: 1px solid var(--v-line); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpis strong { font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpis span { font-size: 13px; color: var(--v-muted); }
.hero-note { margin: 14px 0 0; font-size: 12.5px; color: var(--v-muted); }

/* ───────────────────────────── Pipeline ───────────────────────────── */
.pipeline { padding-block: 10px 30px; }
.pipeline ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipeline li { position: relative; padding: 14px 14px 14px 46px; background: var(--v-soft); border-radius: 12px; }
.pipeline .n {
  position: absolute; left: 14px; top: 14px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--v-accent); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center;
}
.pipeline b { display: block; font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.pipeline small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--v-muted); line-height: 1.4; }

/* ───────────────────────────── Chapitres ───────────────────────────── */
.chapters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.chapters--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chapter {
  text-align: left; background: var(--v-surface); border: 1px solid var(--v-line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.chapter:hover { border-color: var(--v-accent); }
.chapter.is-active { border-color: var(--v-accent); box-shadow: 0 0 0 3px var(--v-accent-soft); }
.chapter b { font-family: var(--font-head); font-size: 14px; }
.chapter small { font-size: 12px; color: var(--v-muted); line-height: 1.35; }

/* ───────────────────────────── La fenêtre d'application ───────────────────────────── */
.app {
  position: relative;
  font-family: var(--font-app); color: var(--ink); font-size: 14px; line-height: 1.45;
  background: var(--canvas); border: 1px solid var(--v-line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.app-chrome {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #F2F1EE; border-bottom: 1px solid var(--v-line);
}
.app-chrome .dot { width: 10px; height: 10px; border-radius: 50%; background: #D6D3D1; }
.app-chrome .url {
  margin-left: 12px; flex: 1; max-width: 420px; background: #fff; border: 1px solid var(--v-line); border-radius: 8px;
  padding: 4px 10px; font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-chrome .lock { font-size: 10px; margin-right: 4px; }
.app-chrome .path { color: var(--ink); font-weight: 500; }
.app-body { display: flex; min-height: 640px; }

/* barre latérale : flottante, détachée des bords, comme dans l'app */
.sidebar {
  width: 232px; flex-shrink: 0; margin: 12px 0 12px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); display: flex; flex-direction: column; align-self: stretch;
}
.brand { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px;
}
.brand-name { font-weight: 600; font-size: 14px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--ink-muted); }
.nav { padding: 12px; flex: 1; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-subtle); padding: 4px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); text-decoration: none;
  color: var(--ink-body); font-weight: 500; font-size: 13.5px; transition: background-color .15s ease, color .15s ease;
}
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: var(--fill); color: var(--ink); }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand-strong); }
.nav-item.is-muted { opacity: .55; pointer-events: none; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--violet-bg); color: var(--violet-fg); font-size: 11px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0;
}
.avatar.big { width: 40px; height: 40px; font-size: 13px; }
.who { font-size: 13px; font-weight: 600; } .role { font-size: 11.5px; color: var(--ink-muted); }

.main { flex: 1; min-width: 0; padding: 12px 20px 24px 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 16px; }
.topbar h2 { font-family: var(--font-app); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.topbar p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-muted); }

.screen { display: none; flex-direction: column; gap: 14px; }
.screen.is-active { display: flex; animation: page-enter .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* cartes, grilles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { font-family: var(--font-app); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.muted { color: var(--ink-muted); font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--ink-muted); line-height: 1.45; }
.hint b { color: var(--ink-body); }
.grow { flex: 1; }

/* barres */
.bar { position: relative; height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ink-subtle); transition: width .6s ease; }
.bar--brand > span, .bar--run > span { background: var(--brand); }
.bar--run { height: 6px; }
.reflet {
  position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
  animation: reflet 1.6s linear infinite; transform: translateX(-100%);
}
@keyframes reflet { to { transform: translateX(100%); } }
.quota-num { font-size: 22px; font-weight: 600; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.quota-num strong { font-weight: 700; }

/* entonnoir */
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.funnel li { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 5px 8px; border-radius: 6px; overflow: hidden; font-size: 13px; }
.funnel li span { position: relative; z-index: 1; color: var(--ink-body); }
.funnel li b { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.funnel li i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-soft); min-width: 6px; }

/* objectif */
.obj-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.obj-row { display: grid; grid-template-columns: 180px 1fr 90px; align-items: center; gap: 12px; font-size: 13px; }
.obj-label { color: var(--ink-body); }
.obj-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.obj-val b { color: var(--ink); font-weight: 600; }

.run-band { border: 1px solid var(--brand-ring); background: #FFFaf7; border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.run-head { display: flex; align-items: center; gap: 10px; }
.halo { position: relative; width: 8px; height: 8px; flex-shrink: 0; }
.halo i { position: absolute; inset: 0; border-radius: 50%; background: var(--brand); }
.halo::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); animation: halo 1.4s ease-out infinite; }
@keyframes halo { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }
.run-phase { font-size: 12.5px; font-weight: 600; color: var(--brand-strong); }
.run-eta { margin-left: auto; font-size: 12px; color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.run-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.run-stats b { display: block; font-size: 13px; font-weight: 600; color: var(--ink-body); }
.run-stats small { font-size: 11px; color: var(--ink-subtle); }
.run-band.is-done { border-color: var(--success-bd); background: var(--success-bg); }
.run-band.is-done .run-phase { color: var(--success-fg); }
.run-band.is-done .bar--run > span { background: var(--success); transition: none; }
.run-band.is-done .run-stats b { color: var(--success-fg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-kpis > div { background: var(--canvas); border-radius: var(--radius-md); padding: 10px 12px; }
.mini-kpis strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-kpis span { font-size: 12px; color: var(--ink-muted); }

/* `display: flex` de .run-band l'emporterait sur `hidden` (même piège que les fenêtres) */
.run-band[hidden] { display: none; }

/* Bouton à cliquer : encadré orange fixe + halo qui pulse vers l'extérieur.
   Le halo est un pseudo-élément animé en transform/opacity (composé par le GPU). */
.btn-pulse { position: relative; box-shadow: 0 0 0 3px var(--v-bg), 0 0 0 5px var(--brand); }
.btn-pulse::after {
  content: ''; position: absolute; inset: -5px; border-radius: 14px; border: 2px solid var(--brand);
  pointer-events: none; animation: btn-pulse 1.6s ease-out infinite;
}
@keyframes btn-pulse {
  0%   { transform: scale(1);    opacity: .9; }
  100% { transform: scale(1.14); opacity: 0; }
}

/* fenêtres de confirmation — posées sur la fenêtre de l'app, pas sur la page */
.modal {
  /* fixe et centrée dans la fenêtre du navigateur : la fenêtre d'app peut être plus haute
     que l'écran, une boîte centrée dans l'app serait souvent sous le pli */
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(12, 10, 9, .28); backdrop-filter: blur(2px); opacity: 0; transition: opacity .18s ease;
}
.modal.is-open { opacity: 1; }
/* `display: flex` ci-dessus l'emporterait sur l'attribut `hidden` : sans ces deux règles, une
   fenêtre fermée reste posée sur la page, invisible, et capte les clics (y compris ceux destinés
   à l'autre fenêtre). */
.modal[hidden] { display: none; }
.modal:not(.is-open) { pointer-events: none; }
.modal-box {
  width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 24px 24px 20px;
  box-shadow: var(--shadow-lg); transform: translateY(8px) scale(.98); transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.modal.is-open .modal-box { transform: none; }
.modal-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--success-bg); color: var(--success-fg); font-weight: 700; font-size: 18px; margin-bottom: 12px; }
.modal-icon--waalaxy { background: #E6F2F9; color: var(--waalaxy); }
.modal-icon--perf { background: var(--brand-soft); }
.modal-box h3 { font-family: var(--font-app); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.modal-box p { margin: 0; color: var(--ink-body); font-size: 13.5px; line-height: 1.5; }
.modal-box p b { color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.obj-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.segmented { display: inline-flex; background: var(--fill); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.segmented button.is-on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-xs); }
.obj-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-muted); }
.obj-form input {
  width: 120px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 7px 10px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); font-variant-numeric: tabular-nums;
}

/* boutons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-brand { background: var(--brand); color: #fff; box-shadow: var(--shadow-xs); }
.btn-brand:hover { background: var(--brand-hover); box-shadow: var(--shadow-md); }
.btn-waalaxy { background: var(--waalaxy); color: #fff; }
.btn-waalaxy:hover { background: var(--waalaxy-hover); }
.btn-waalaxy.btn-outline { background: transparent; color: var(--waalaxy); border-color: var(--waalaxy); }
.btn-ghost { background: var(--surface); color: var(--ink-body); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-accent { background: var(--v-accent); color: #fff; font-family: var(--font-body); padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn-accent:hover { background: var(--v-accent-hover); }

/* tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-inline: -18px; padding-inline: 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl th {
  text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--fill); vertical-align: middle; }
.tbl tbody tr:hover td { background: #FCFCFB; }
.tbl tr.is-selected td { background: #FFF8F5; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; background: var(--canvas); }
.tbl .poste { color: var(--ink-body); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl--profiles { min-width: 480px; }
/* Le tableau partage la largeur avec la fiche du profil : il n'a jamais la place de ses sept
   colonnes, et le segment et le score finissaient rognés. On retire les deux colonnes que la
   fiche affiche déjà (destination, recherche d'origine) et on resserre le poste. */
.tbl--profiles th:nth-child(6), .tbl--profiles td:nth-child(6),
.tbl--profiles th:nth-child(7), .tbl--profiles td:nth-child(7) { display: none; }
.tbl--profiles .poste { max-width: 170px; }
.table-card { padding-bottom: 8px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 2px; font-size: 12.5px; }
.pager { color: var(--ink-subtle); letter-spacing: .25em; }
.pager b { color: var(--ink); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; letter-spacing: 0; }
.tbl input[type="checkbox"] { accent-color: var(--brand); }

/* badges & pastilles — couleurs de lib/routing.ts */
.badge, .pill, .dest { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.badge-psycho { background: var(--violet-bg); color: var(--violet-fg); border-color: var(--violet-bd); }
.badge-rh { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.badge-cible { background: var(--violet-bg); color: var(--violet-fg); border-color: var(--violet-bd); }
.badge-cible2 { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.pill-ok { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
.pill-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.pill-warn { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-bd); }
.pill-muted { background: var(--fill); color: var(--ink-muted); border-color: var(--line); }
.pill-sent { background: #DBEAFE; color: #1D4ED8; }
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.seg-cible  { background: #D1FAE5; color: #065F46; }   /* emerald-100 / 800 */
.seg-l2     { background: #FEF9C3; color: #854D0E; }   /* yellow-100 / 800 */
.seg-master { background: #F3E8FF; color: #7E22CE; }   /* purple-100 / 700 */
.seg-faible { background: #FFEDD5; color: #C2410C; }   /* orange-100 / 700 */
.seg-np     { background: #F3F4F6; color: #9CA3AF; }   /* gray-100 / 400 */
.seg-disq   { background: #FEE2E2; color: #DC2626; }   /* red-100 / 600 */
.seg-passif { background: #F1F5F9; color: #475569; }   /* slate-100 / 600 */
.seg-rh     { background: #DBEAFE; color: #1E40AF; }   /* blue-100 / 800 */
.dest-waalaxy   { background: #DCFCE7; color: #166534; }   /* green-100 / 800 */
.dest-nurturing { background: #DBEAFE; color: #1E40AF; }
.dest-sent      { background: #DBEAFE; color: #1D4ED8; }
.dest-skip      { background: #F3F4F6; color: #9CA3AF; }
.score {
  display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: 7px; font-weight: 700; font-size: 12.5px;
  background: var(--fill); color: var(--ink-body); font-variant-numeric: tabular-nums;
}
.score-hot { background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-ring); }

/* barre d'outils */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px;
  color: var(--ink-subtle); font-size: 13px; min-width: 220px;
}
.search svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--ink-body); display: inline-flex; gap: 6px; }
.chip b { color: var(--ink); }
.chip.is-on { background: var(--brand-soft); border-color: var(--brand-ring); color: var(--brand-strong); }
.chip.is-on b { color: var(--brand-strong); }
.link { font-size: 13px; color: var(--waalaxy); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* profils : table + fiche */
.profiles-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.tbl--profiles td:nth-child(2) { white-space: nowrap; }
.fiche { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.fiche-head { display: flex; gap: 10px; align-items: center; }
.fiche-head b { font-size: 14px; }
.fiche h4 { font-family: var(--font-app); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-top: 4px; }
.fiche p { margin: 0; color: var(--ink-body); }
.fiche q { font-style: italic; }
.fiche-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; padding: 10px 0; border-block: 1px solid var(--fill); }
.fiche-facts dt { font-size: 11px; color: var(--ink-subtle); }
.fiche-facts dd { margin: 2px 0 0; }
.signaux { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.signaux li { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--success-bg); color: var(--success-fg); }
.signaux li.ko { display: none; }
.fiche blockquote { margin: 0; padding: 10px 12px; background: var(--canvas); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; color: var(--ink-body); }
.trace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: var(--ink-subtle); word-break: break-word; }
.fiche-actions { display: flex; gap: 8px; margin-top: 4px; }

/* performance */
.chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; height: 150px; align-items: end; padding: 0 6px; }
.chart .col { position: relative; height: 100%; display: flex; align-items: end; justify-content: center; gap: 4px; }
.chart .col i { display: block; width: 26px; border-radius: 6px 6px 2px 2px; background: #E7E5E4; }
.chart .col i.hot { background: var(--brand); width: 14px; }
.chart .col small { position: absolute; bottom: -18px; font-size: 11px; color: var(--ink-subtle); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; font-size: 11.5px; color: var(--ink-muted); }
.legend i, .compo i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #E7E5E4; vertical-align: -1px; margin-right: 5px; }
.legend i.hot { background: var(--brand); }
.repart { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.repart li { display: grid; grid-template-columns: 170px 1fr 40px; align-items: center; gap: 10px; font-size: 12.5px; }
.repart i { display: block; height: 8px; border-radius: 999px; background: var(--brand-soft); position: relative; }
.repart i::after { content: ''; position: absolute; inset: 0; background: var(--brand); opacity: .55; border-radius: 999px; }
.repart b { text-align: right; font-variant-numeric: tabular-nums; }
.compo { display: flex; height: 8px; width: 150px; border-radius: 999px; overflow: hidden; background: var(--fill); }
.compo i { height: 100%; width: auto; border-radius: 0; margin: 0; }
.c1 { background: var(--success) !important; } .c2 { background: #93C5FD !important; } .c3 { background: #C4B5FD !important; } .c4 { background: #D6D3D1 !important; }

/* exports */
.guide-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.guide-strip > div { position: relative; padding: 12px 12px 12px 42px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); font-size: 12.5px; }
.guide-strip .n { position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--waalaxy); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.guide-strip b { display: block; margin-bottom: 3px; }
.guide-strip small { color: var(--ink-muted); line-height: 1.4; font-size: 12px; }

/* waalaxy */
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--ink-muted); }
.kpi .ok { color: var(--success-fg); }
.tunnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tunnel li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-body); }
.tunnel li > div { display: flex; flex-direction: column; gap: 3px; padding-right: 40px; min-width: 0; } /* place pour les chiffres à droite des barres */
.tunnel i { position: relative; display: block; height: 10px; border-radius: 999px; background: #E7E5E4; min-width: 28px; }
.tunnel i.t2 { background: var(--waalaxy); opacity: .55; } .tunnel i.t3 { background: var(--brand); }
.tunnel i b { position: absolute; left: calc(100% + 6px); top: -3px; font-size: 11px; color: var(--ink-muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ───────────────────────────── Valeur & pied (charte vitrine) ───────────────────────────── */
.value { padding-block: 56px 24px; }
.value h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 22px; }
.value-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.value-grid article { background: var(--v-surface); border: 1px solid var(--v-line); border-radius: 16px; padding: 20px; }
.value-grid h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.value-grid p { margin: 0; color: var(--v-ink-2); font-size: 14.5px; }
.cta { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--v-warm); border-radius: 16px; padding: 22px 24px; }
.cta p { margin: 0; max-width: 56ch; color: var(--v-ink-2); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-block: 28px 48px; font-size: 12.5px; color: var(--v-muted); border-top: 1px solid var(--v-line); margin-top: 24px; }
.wordmark { font-family: var(--font-display); font-size: 18px; color: var(--v-ink); }

/* ───────────────────────────── Responsive ───────────────────────────── */
@media (max-width: 1024px) {
  .profiles-layout { grid-template-columns: minmax(0, 1fr); } /* 1fr seul garderait la largeur minimale de la table */
  .fiche { order: -1; }
}
@media (max-width: 860px) {
  .mini-kpis { grid-template-columns: 1fr 1fr; }
  .kpis, .pipeline ol, .chapters, .chapters--4, .value-grid, .guide-strip, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .app-body { flex-direction: column; min-height: 0; }
  .sidebar { width: auto; margin: 12px 12px 0; flex-direction: row; align-items: center; }
  .brand { border-bottom: 0; border-right: 1px solid var(--line); height: 48px; }
  .nav { display: flex; gap: 2px; padding: 6px; overflow-x: auto; }
  .nav-group, .sidebar-foot, .nav-item.is-muted { display: none; }
  .nav-item { padding: 7px 10px; white-space: nowrap; }
  .obj-row { grid-template-columns: 1fr; gap: 6px; }
  .obj-val { text-align: left; }
}
@media (max-width: 560px) {
  .mini-kpis { grid-template-columns: 1fr; }
  .kpis, .pipeline ol, .chapters, .chapters--4, .value-grid, .guide-strip, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .main { padding: 10px 12px 18px; }
  .run-stats { grid-template-columns: 1fr; }
  .repart li { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───────────────────────────── Mode intégré (?embed=1) ─────────────────────────────
   La démo est ouverte depuis une page projet du site, dans une fenêtre plein écran : on ne
   garde que la fenêtre d'application. */
.is-embed body { padding: 12px; }
.is-embed .hero, .is-embed .pipeline, .is-embed .chapters, .is-embed .value, .is-embed .foot { display: none; }
.is-embed .wrap--wide { max-width: none; }
.is-embed .app { box-shadow: none; }
