/* arka-production.css — flux « production multi-agents » d'Arka.
   Charge APRÈS arka-live.css (réutilise tokens + shell : .ark-stage, .ark-msg, .ark-context…).
   Vocabulaire de cards dans le fil, deux registres :
     • info    — arka narre / une équipe travaille (calme, neutre)
     • await   — on a besoin de toi (escalade / décision) : barre rouge, pulse, le fil se met en pause
   Cible : PM / juriste / auditeur. Zéro jargon d'orchestration, zéro cockpit. */

/* ══════════ objectif (message d'ouverture, un cran au-dessus d'un message normal) ══════════ */
.pk-goal { display: flex; flex-direction: column; gap: 11px; animation: ark-msg-in .42s cubic-bezier(.16,1,.3,1); }
.pk-goal-head { display: flex; align-items: center; gap: 10px; }
.pk-goal-head .ark-ava { background: var(--surface-hover); color: var(--content); font-weight: 700; }
.pk-goal-head .who { font-size: 13px; font-weight: 600; color: var(--content); }
.pk-goal-head .ts { font-family: var(--font-mono); font-size: 9px; color: var(--content-subtle); margin-left: auto; }
.pk-goal-body {
  font-size: 16px; line-height: 1.5; font-weight: 600; color: var(--content);
  padding: 15px 17px; border-radius: 14px; border: 1px solid var(--app-border);
  background: color-mix(in oklab, var(--arka-red) 6%, var(--surface-card));
  position: relative; overflow: hidden;
}
.pk-goal-body::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--arka-red); }
.pk-goal-body .obj { display: block; }
.pk-goal-body .obj-lbl { display: block; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--arka-red); margin-bottom: 7px; }
body.theme-light .pk-goal-body { background: color-mix(in oklab, var(--arka-red) 5%, #fff); box-shadow: 0 2px 10px rgba(28,24,22,.05); }

/* ══════════ tour arka : narration + pile de cards ══════════ */
.pk-turn { display: flex; flex-direction: column; gap: 11px; animation: ark-msg-in .42s cubic-bezier(.16,1,.3,1); }
.pk-turn-head { display: flex; align-items: center; gap: 10px; }
.pk-turn-head .ark-ava { background: var(--arka-red); color: #fff; font-weight: 700; }
.pk-turn-head .who { font-size: 13px; font-weight: 700; color: var(--content); display: flex; align-items: baseline; gap: 8px; }
.pk-turn-head .who .role { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--content-subtle); }
.pk-flow { display: flex; flex-direction: column; gap: 10px; }

/* narration inline d'arka entre deux cards (fil qui respire, jamais une card lourde) */
.pk-say { display: flex; gap: 10px; align-items: flex-start; padding: 2px 0 2px 2px; font-size: 13.5px; line-height: 1.55; color: var(--content-muted); animation: pk-fade .4s ease; }
.pk-say .g { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--content-subtle); margin-top: 1px; }
.pk-say .g svg { width: 14px; height: 14px; }
.pk-say b { color: var(--content); font-weight: 600; }
@keyframes pk-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ══════════ card générique ══════════ */
.pk-card {
  position: relative; border: 1px solid var(--app-border); border-radius: 14px;
  background: var(--surface-card); overflow: hidden;
  animation: pk-card-in .44s cubic-bezier(.16,1,.3,1);
}
body:not(.theme-light) .pk-card { background: rgba(255,255,255,.025); }
body.theme-light .pk-card { background: #fff; box-shadow: 0 24px 64px -44px rgba(28,24,22,.38), 0 8px 22px -20px rgba(28,24,22,.24); }
@keyframes pk-card-in { from { opacity: 0; transform: translateY(9px) scale(.995); } to { opacity: 1; transform: none; } }

.pk-card-h { display: flex; align-items: center; gap: 11px; padding: 13px 15px; }
.pk-card-h .ic { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-hover); color: var(--content-muted); }
.pk-card-h .ic svg { width: 16px; height: 16px; }
.pk-card-h .tt { flex: 1; min-width: 0; }
.pk-card-h .kk { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--content-subtle); }
.pk-card-h .tl { font-size: 14px; font-weight: 700; color: var(--content); margin-top: 2px; line-height: 1.25; }
.pk-card-h .st { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--content-subtle); }
.pk-card-h .st .sp { width: 6px; height: 6px; border-radius: 99px; background: var(--content-subtle); }
.pk-card-h .st.run { color: var(--status-warn); }
.pk-card-h .st.run .sp { background: var(--status-warn); animation: ark-blink 1s infinite; }
.pk-card-h .st.done { color: var(--arka-green); }
.pk-card-h .st.done .sp { background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); }

.pk-card-b { padding: 0 15px 14px; }
.pk-card-b .lead { font-size: 13px; line-height: 1.55; color: var(--content-muted); margin: 0 0 4px; }
.pk-card-b .lead b { color: var(--content); font-weight: 600; }

/* ══════════ card ÉQUIPE — le roster d'agents réels ══════════ */
.pk-card.team .pk-card-h .ic { background: rgba(199,15,67,.12); color: var(--arka-red); }
.pk-roster { display: flex; flex-direction: column; gap: 8px; }
.pk-agent {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
  border: 1px solid var(--app-border); background: var(--surface-card); position: relative; overflow: hidden;
  --a-color: var(--arka-blue);
}
body:not(.theme-light) .pk-agent { background: rgba(255,255,255,.02); }
.pk-agent::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--a-color); opacity: .5; }
.pk-agent.spawning { animation: pk-spawn .5s cubic-bezier(.16,1,.3,1); }
@keyframes pk-spawn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.pk-agent .agic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--a-color) 15%, transparent); color: var(--a-color); }
.pk-agent .agic svg { width: 16px; height: 16px; }
.pk-agent .aginfo { flex: 1; min-width: 0; }
.pk-agent .agn { font-size: 13px; font-weight: 700; color: var(--content); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pk-agent .agrole { font-size: 11.5px; color: var(--content-muted); margin-top: 2px; }
.pk-meta-row { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.pk-model { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; letter-spacing: .02em; color: var(--content-muted); padding: 3px 7px; border-radius: 6px; background: var(--surface-hover); border: 1px solid var(--app-border); }
.pk-model svg { width: 10px; height: 10px; opacity: .8; }
.pk-synth { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; color: var(--arka-green); padding: 3px 7px; border-radius: 6px; background: rgba(0,210,135,.08); border: 1px solid rgba(0,210,135,.22); }
.pk-synth svg { width: 10px; height: 10px; }
.pk-agent .agdot { width: 8px; height: 8px; border-radius: 99px; flex-shrink: 0; background: var(--content-subtle); align-self: flex-start; margin-top: 4px; }
.pk-agent[data-st="wait"] .agdot { background: var(--content-subtle); }
.pk-agent[data-st="run"] .agdot { background: var(--status-warn); animation: ark-blink 1s infinite; box-shadow: 0 0 8px rgba(217,119,6,.5); }
.pk-agent[data-st="done"] .agdot { background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); }
.pk-agent[data-st="block"] .agdot { background: var(--arka-red); animation: ark-blink 1s infinite; }

/* ══════════ card CONTRAT ══════════ */
.pk-card.contract .pk-card-h .ic { background: rgba(74,144,226,.13); color: var(--arka-blue); }
.pk-contract-to { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--content-muted); margin-bottom: 10px; }
.pk-contract-to .arrow { color: var(--content-subtle); }
.pk-contract-to .arrow svg { width: 13px; height: 13px; }
.pk-contract-to b { color: var(--content); font-weight: 600; }
.pk-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.pk-kv .k { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--content-subtle); padding-top: 2px; }
.pk-kv .v { font-size: 12.5px; line-height: 1.45; color: var(--content); }

/* ══════════ card TRAVAIL — l'agent parle pendant qu'il bosse, puis se referme ══════════ */
.pk-card.work { --a-color: var(--arka-blue); }
.pk-card.work .pk-work-h { display: flex; align-items: center; gap: 11px; padding: 13px 15px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: var(--font-sans); }
.pk-card.work .pk-work-h .ic { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--a-color) 15%, transparent); color: var(--a-color); }
.pk-card.work .pk-work-h .ic svg { width: 16px; height: 16px; }
.pk-card.work .pk-work-h .tt { flex: 1; min-width: 0; }
.pk-card.work .pk-work-h .kk { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--content-subtle); }
.pk-card.work .pk-work-h .tl { font-size: 14px; font-weight: 700; color: var(--content); margin-top: 2px; line-height: 1.25; display: flex; align-items: center; gap: 8px; }
.pk-card.work .pk-work-h .tl .mdl { font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; letter-spacing: .02em; color: var(--content-subtle); padding: 2px 6px; border-radius: 5px; background: var(--surface-hover); border: 1px solid var(--app-border); }
/* chrono vivant : le signal « ça tourne » (comme 12h45 dans un vrai agent) */
.pk-work-timer { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--content-muted); flex-shrink: 0; padding: 3px 8px; border-radius: 99px; background: var(--surface-hover); border: 1px solid var(--app-border); }
.pk-work-timer svg { width: 11px; height: 11px; }
.pk-card.work[data-st="run"] .pk-work-timer { color: var(--status-warn); border-color: rgba(217,119,6,.28); }
.pk-card.work[data-st="run"] .pk-work-timer svg { animation: pk-tick 1s steps(8) infinite; }
.pk-card.work[data-st="block"] .pk-work-timer { color: var(--arka-red); border-color: rgba(199,15,67,.3); }
.pk-card.work[data-st="done"] .pk-work-timer { color: var(--arka-green); border-color: rgba(0,210,135,.28); }
.pk-card.work[data-st="done"] .pk-work-timer svg { animation: none; }
@keyframes pk-tick { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pk-card.work[data-st="run"] .pk-work-timer svg { animation: none; } }
.pk-card.work .pk-work-h .st { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--status-warn); }
.pk-card.work .pk-work-h .st .sp { width: 6px; height: 6px; border-radius: 99px; background: var(--status-warn); animation: ark-blink 1s infinite; }
.pk-card.work[data-st="done"] .pk-work-h .st { color: var(--arka-green); }
.pk-card.work[data-st="done"] .pk-work-h .st .sp { background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); animation: none; }
.pk-card.work[data-st="block"] .pk-work-h .st { color: var(--arka-red); }
.pk-card.work[data-st="block"] .pk-work-h .st .sp { background: var(--arka-red); }
.pk-card.work .pk-work-h .chev { flex-shrink: 0; color: var(--content-subtle); display: flex; transition: transform .25s; }
.pk-card.work .pk-work-h .chev svg { width: 15px; height: 15px; }
.pk-card.work.collapsed .pk-work-h .chev { transform: rotate(-90deg); }
.pk-card.work[data-st="done"] .pk-work-h .ic { background: rgba(0,210,135,.14); color: var(--arka-green); }

/* corps accordéon : le flux d'activité de l'agent */
.pk-work-body { overflow: hidden; transition: max-height .45s cubic-bezier(.16,1,.3,1), opacity .3s; max-height: 800px; opacity: 1; }
.pk-card.work.collapsed .pk-work-body { max-height: 0 !important; opacity: 0; }
.pk-mission { margin: 0 15px 10px; padding: 9px 12px; border-radius: 9px; background: var(--surface-hover); border: 1px solid var(--app-border); font-size: 12px; line-height: 1.45; color: var(--content-muted); }
.pk-mission b { color: var(--content); font-weight: 600; }
.pk-stream { padding: 0 15px 14px; display: flex; flex-direction: column; gap: 2px; }
.pk-actline { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 12.5px; line-height: 1.5; color: var(--content-muted); animation: pk-fade .32s ease; }
.pk-actline .ag { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; color: var(--content-subtle); }
.pk-actline .ag svg { width: 13px; height: 13px; }
.pk-actline.tick .ag { color: var(--arka-green); }
.pk-actline.warn { color: var(--content); } .pk-actline.warn .ag { color: var(--status-warn); }
.pk-actline b { color: var(--content); font-weight: 600; }
/* la ligne « vive » : l'agent est en train de la faire (curseur clignotant) */
.pk-actline.live { color: var(--content); }
.pk-actline.live .ag { color: var(--a-color); }
.pk-actline.live .ag svg { animation: pk-spin 1.6s linear infinite; }
.pk-cursor { display: inline-block; width: 7px; height: 14px; margin-left: 3px; border-radius: 1px; background: var(--a-color); transform: translateY(2px); animation: ark-blink .9s steps(2,start) infinite; }
@media (prefers-reduced-motion: reduce) { .pk-actline.live .ag svg { animation: none; } .pk-cursor { animation: none; } }

/* bande d'activité VIVANTE — bouge en continu tant que l'agent bosse (même sur une étape longue) */
.pk-livestrip { display: flex; align-items: center; gap: 10px; margin: 6px 15px 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--app-border); background: color-mix(in oklab, var(--a-color) 5%, var(--surface-hover)); position: relative; overflow: hidden; }
.pk-livestrip .lg { width: 15px; height: 15px; flex-shrink: 0; display: flex; color: var(--a-color); }
.pk-livestrip .lg svg { width: 14px; height: 14px; animation: pk-spin 1.4s linear infinite; }
.pk-livestrip .lt { flex: 1; min-width: 0; font-size: 12px; color: var(--content); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-livestrip .lt .dots::after { content: ''; animation: pk-dots 1.4s steps(4,end) infinite; }
.pk-livestrip .lc { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .02em; color: var(--content-muted); flex-shrink: 0; padding: 2px 7px; border-radius: 99px; background: var(--surface-card); border: 1px solid var(--app-border); }
.pk-livestrip .lc b { color: var(--content); }
/* barre de progression indéterminée : le mouvement continu qui dit « c'est vivant » */
.pk-livestrip .lbar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; overflow: hidden; }
.pk-livestrip .lbar span { position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 99px; background: var(--a-color); opacity: .55; animation: pk-indet 1.5s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes pk-indet { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes pk-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@media (prefers-reduced-motion: reduce) { .pk-livestrip .lg svg, .pk-livestrip .lbar span { animation: none; } .pk-livestrip .lbar span { left: 0; width: 100%; opacity: .4; } }

/* le résultat, révélé quand l'accordéon se referme (toujours visible) */

/* ── narration de raisonnement (1re personne) : le plus fort signal « je sais ce que je fais » ── */
.pk-narr { padding: 3px 15px 3px; font-size: 13px; line-height: 1.58; color: var(--content); animation: pk-fade .3s ease; }
.pk-narr code { font-family: var(--font-mono); font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--surface-hover); border: 1px solid var(--app-border); color: var(--content); }
.pk-narr.live::after { content: ''; display: inline-block; width: 6px; height: 13px; margin-left: 3px; border-radius: 1px; background: var(--a-color); transform: translateY(2px); animation: ark-blink .9s steps(2,start) infinite; }
@media (prefers-reduced-motion: reduce) { .pk-narr.live::after { animation: none; } }

/* ── groupe d'opérations réelles (repliable, « N opérations exécutées ») ── */
.pk-ops { margin: 7px 15px 3px; border: 1px solid var(--app-border); border-radius: 10px; overflow: hidden; background: var(--surface-card); }
body:not(.theme-light) .pk-ops { background: rgba(255,255,255,.02); }
.pk-ops-h { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; background: none; border: 0; cursor: pointer; text-align: left; font-family: var(--font-sans); color: var(--content-muted); }
.pk-ops-h .oc { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: color-mix(in oklab, var(--a-color) 16%, transparent); color: var(--a-color); font-family: var(--font-mono); font-size: 9px; font-weight: 700; }
.pk-ops-h .ot { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--content); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-ops-h .run { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--status-warn); display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.pk-ops-h .run .sp { width: 6px; height: 6px; border-radius: 99px; background: var(--status-warn); animation: ark-blink 1s infinite; }
.pk-ops-h .chev { flex-shrink: 0; color: var(--content-subtle); display: flex; transition: transform .22s; }
.pk-ops-h .chev svg { width: 14px; height: 14px; }
.pk-ops.closed .pk-ops-h .chev { transform: rotate(-90deg); }
.pk-ops-list { overflow: hidden; transition: max-height .4s cubic-bezier(.16,1,.3,1); max-height: 600px; border-top: 1px solid var(--app-border-subtle, var(--app-border)); }
.pk-ops.closed .pk-ops-list { max-height: 0; border-top-color: transparent; }
.pk-op { display: flex; align-items: center; gap: 9px; padding: 7px 12px; font-size: 12px; color: var(--content-muted); animation: pk-fade .28s ease; border-bottom: 1px solid var(--app-border-subtle, var(--app-border)); }
.pk-op:last-child { border-bottom: 0; }
.pk-op .og { width: 15px; height: 15px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--content-subtle); }
.pk-op .og svg { width: 12px; height: 12px; }
.pk-op .ot { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 11px; color: var(--content); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-op .ot .obj { color: var(--a-color); }
.pk-op .od { font-family: var(--font-mono); font-size: 9px; color: var(--content-subtle); flex-shrink: 0; }
.pk-op.live .og { color: var(--a-color); } .pk-op.live .og svg { animation: pk-spin 1.2s linear infinite; }
.pk-op.live .ot { color: var(--content); }
.pk-op.done .og { color: var(--arka-green); }
@media (prefers-reduced-motion: reduce) { .pk-op.live .og svg { animation: none; } }

/* ── fichier / livrable modifié (chip « +16 −7 ») ── */
.pk-edit { display: inline-flex; align-items: center; gap: 8px; margin: 7px 15px 3px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--app-border); background: var(--surface-hover); font-size: 12px; color: var(--content-muted); animation: pk-fade .3s ease; }
.pk-edit .eg { width: 15px; height: 15px; flex-shrink: 0; display: flex; color: var(--a-color); }
.pk-edit .eg svg { width: 13px; height: 13px; }
.pk-edit b { color: var(--content); font-weight: 600; }
.pk-edit .plus { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--arka-green); }
.pk-edit .minus { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--arka-red); }

/* le résultat, révélé quand l'accordéon se referme (toujours visible) */
.pk-work-result { border-top: 1px solid var(--app-border-subtle, var(--app-border)); padding: 13px 15px 14px; }
.pk-work-result[hidden] { display: none; }
.pk-work-result .rlead { font-size: 13px; line-height: 1.55; color: var(--content-muted); margin: 0 0 9px; }
.pk-work-result .rlead b { color: var(--content); font-weight: 600; }

/* ══════════ card RÉSULTAT ══════════ */
.pk-card.result .pk-card-h .ic { background: rgba(0,210,135,.13); color: var(--arka-green); }
.pk-deliver { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.pk-deliver .di { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--content-muted); }
.pk-deliver .di .dg { width: 15px; height: 15px; flex-shrink: 0; color: var(--arka-green); margin-top: 1px; }
.pk-deliver .di .dg svg { width: 13px; height: 13px; }
.pk-deliver .di b { color: var(--content); font-weight: 600; }

/* ══════════ card AJUSTEMENT — la boucle ══════════ */
.pk-card.adjust { background: transparent; border-style: dashed; }
body:not(.theme-light) .pk-card.adjust { background: transparent; }
body.theme-light .pk-card.adjust { background: transparent; box-shadow: none; }
.pk-card.adjust .pk-card-h { padding-bottom: 13px; }
.pk-card.adjust .pk-card-h .ic { background: rgba(217,119,6,.13); color: var(--status-warn); }
.pk-card.adjust .pk-card-h .ic svg { animation: pk-spin 3.4s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pk-card.adjust .pk-card-h .ic svg { animation: none; } }

/* ══════════ cards AWAIT — on a besoin de toi ══════════ */
.pk-card.await { border-color: rgba(199,15,67,.38); box-shadow:none; }
body.theme-light .pk-card.await { box-shadow:none; }
.pk-card.await::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--arka-red); z-index: 2; }
.pk-card.await::after { content:''; position:absolute; inset:0; border-radius:14px; border:1px solid rgba(199,15,67,0); animation:pk-await-pulse 2.2s ease-in-out infinite; pointer-events:none; }
@keyframes pk-await-pulse { 0%,100% { border-color:rgba(199,15,67,0); } 50% { border-color:rgba(199,15,67,.35); } }
@media (prefers-reduced-motion: reduce) { .pk-card.await::after { animation: none; } }
.pk-card.await .pk-card-h { padding-left: 17px; }
.pk-card.await .pk-card-h .ic { background: rgba(199,15,67,.12); color:var(--arka-red); }
.pk-card.await .pk-card-h .kk { color: var(--arka-red); }
.pk-await-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--arka-red); }
.pk-await-badge .pd { width: 6px; height: 6px; border-radius: 99px; background: var(--arka-red); animation: ark-blink 1s infinite; }
.pk-card.await .pk-card-b { padding-left: 17px; }

/* le contexte de l'escalade (deux clauses en conflit, un chiffre à confirmer…) */
.pk-conflict { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.pk-conflict .cf { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--app-border); background: var(--surface-hover); }
.pk-conflict .cf .cfl { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--content-subtle); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.pk-conflict .cf .cfl svg { width: 11px; height: 11px; }
.pk-conflict .cf .cft { font-size: 12px; line-height: 1.45; color: var(--content); }
.pk-conflict .cf.a .cfl { color: var(--arka-blue); }
.pk-conflict .cf.b .cfl { color: var(--status-warn); }

/* boutons de choix (registre await) */
.pk-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.pk-choice {
  display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 11px;
  border: 1px solid var(--app-border); background: var(--surface-card); color: var(--content);
  cursor: pointer; text-align: left; width: 100%; font-family: var(--font-sans); position: relative; transition: all .15s;
}
body:not(.theme-light) .pk-choice { background: rgba(255,255,255,.03); }
.pk-choice:hover { border-color: var(--arka-red); transform: translateY(-1px); }
.pk-choice .cic { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--arka-red) 12%, transparent); color: var(--arka-red); }
.pk-choice .cic svg { width: 15px; height: 15px; }
.pk-choice .cb { flex: 1; min-width: 0; }
.pk-choice .ct { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.pk-choice .cm { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .02em; color: var(--content-subtle); margin-top: 3px; }
.pk-choice .ck { font-family: var(--font-mono); font-size: 7.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--arka-red); display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pk-choice .ck svg { width: 12px; height: 12px; transition: transform .16s; }
.pk-choice:hover .ck svg { transform: translateX(2px); }
/* choix secondaire (juste consulter) */
.pk-choice.ghost .cic { background: var(--surface-hover); color: var(--content-muted); }
.pk-choice.ghost .ck { color: var(--content-subtle); }
/* choix à impact — demande une confirmation */
.pk-choice.impact .cic { background: rgba(217,119,6,.14); color: var(--status-warn); }
.pk-choice.impact .ck { color: var(--status-warn); }
.pk-choice.impact:hover { border-color: var(--status-warn); }
.pk-choice .cflag { display: inline-block; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .04em; color: var(--status-warn); margin-top: 4px; }
.pk-choice.arming { border-color: var(--status-warn); background: rgba(217,119,6,.08); }

/* état résolu — la card await retombe au calme (vert) */
.pk-card.resolved { border-color: rgba(0,210,135,.3); box-shadow: none; }
.pk-card.resolved::before { background: var(--arka-green); }
.pk-card.resolved::after { animation: none; }
.pk-card.resolved .pk-card-h .ic { background: rgba(0,210,135,.14); color: var(--arka-green); box-shadow: none; }
.pk-card.resolved .pk-card-h .kk { color: var(--arka-green); }
.pk-resolved { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 10px; background: rgba(0,210,135,.08); border: 1px solid rgba(0,210,135,.2); margin-top: 6px; }
.pk-resolved .rg { width: 18px; height: 18px; flex-shrink: 0; color: var(--arka-green); }
.pk-resolved .rg svg { width: 16px; height: 16px; }
.pk-resolved .rt { font-size: 12.5px; color: var(--content); } .pk-resolved .rt b { font-weight: 600; }

/* ══════════ card BOUCLÉ — livrable final ══════════ */
.pk-card.done { border-color: rgba(0,210,135,.32); }
.pk-card.done .pk-card-h .ic { background: var(--arka-green); color: #06231a; }
.pk-card.done .pk-card-h .kk { color: var(--arka-green); }
.pk-artifacts { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.pk-artifact { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--app-border); background: var(--surface-hover); }
.pk-artifact .afic { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-card); color: var(--content-muted); border: 1px solid var(--app-border); }
.pk-artifact .afic svg { width: 15px; height: 15px; }
.pk-artifact .afi { flex: 1; min-width: 0; }
.pk-artifact .afn { font-size: 12.5px; font-weight: 600; color: var(--content); }
.pk-artifact .afm { font-family: var(--font-mono); font-size: 8.5px; color: var(--content-subtle); margin-top: 2px; }
.pk-artifact .afo { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--arka-red); display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pk-artifact .afo svg { width: 12px; height: 12px; }
.pk-footprint { display: flex; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px solid var(--app-border-subtle, var(--app-border)); flex-wrap: wrap; }
.pk-footprint .fp { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9px; color: var(--content-subtle); }
.pk-footprint .fp svg { width: 12px; height: 12px; color: var(--content-muted); }
.pk-footprint .fp b { color: var(--content); font-weight: 600; }

/* ══════════ sidebar droite : ÉQUIPE EN COURS (agents qui travaillent pour toi) ══════════ */
.pk-team-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--app-border-subtle, var(--app-border)); --a-color: var(--arka-blue); }
.pk-team-item:last-child { border-bottom: 0; }
.pk-team-item .tg { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--a-color) 15%, transparent); color: var(--a-color); }
.pk-team-item .tg svg { width: 14px; height: 14px; }
.pk-team-item .ti { flex: 1; min-width: 0; }
.pk-team-item .tn { font-size: 12px; font-weight: 600; color: var(--content); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-team-item .tm { font-family: var(--font-mono); font-size: 8px; letter-spacing: .02em; color: var(--content-subtle); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-team-item .ts { font-family: var(--font-mono); font-size: 7.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; color: var(--content-subtle); }
.pk-team-item .ts .d { width: 6px; height: 6px; border-radius: 99px; background: var(--content-subtle); }
.pk-team-item[data-st="run"] .ts { color: var(--status-warn); } .pk-team-item[data-st="run"] .ts .d { background: var(--status-warn); animation: ark-blink 1s infinite; }
.pk-team-item[data-st="done"] .ts { color: var(--arka-green); } .pk-team-item[data-st="done"] .ts .d { background: var(--arka-green); box-shadow: 0 0 7px rgba(0,210,135,.6); }
.pk-team-item[data-st="block"] .ts { color: var(--arka-red); } .pk-team-item[data-st="block"] .ts .d { background: var(--arka-red); animation: ark-blink 1s infinite; }
.pk-team-item[data-st="wait"] .ts { color: var(--content-subtle); }

/* ══════════ état de production (top bar, ambiant — pas un cockpit) ══════════ */
.pk-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--app-border); background: var(--surface-card); font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--content-muted); transition: all .3s; }
body:not(.theme-light) .pk-state { background: rgba(255,255,255,.03); }
.pk-state .pi { width: 13px; height: 13px; display: flex; }
.pk-state .pi svg { width: 13px; height: 13px; }
.pk-state[data-s="run"] { color: var(--status-warn); border-color: rgba(217,119,6,.3); }
.pk-state[data-s="run"] .pi svg { animation: pk-spin 3s linear infinite; }
.pk-state[data-s="await"] { color:var(--arka-red); border-color:rgba(199,15,67,.4); background:rgba(199,15,67,.08); box-shadow:none; }
.pk-state[data-s="await"] .pi { animation: ark-blink 1s infinite; }
.pk-state[data-s="done"] { color: var(--arka-green); border-color: rgba(0,210,135,.35); }
@media (prefers-reduced-motion: reduce) { .pk-state[data-s="run"] .pi svg { animation: none; } }

/* le fil « attend » : léger voile sur la pile quand une décision est requise plus bas */
.pk-flow.awaiting .pk-card:not(.await):not(.resolved) { opacity: .55; }

/* home — objectifs de production proposés (remplace la grille de fils) */
.pk-home-obj { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--app-border); background: var(--surface-card); cursor: pointer; text-align: left; width: 100%; transition: all .15s; }
body:not(.theme-light) .pk-home-obj { background: rgba(255,255,255,.025); }
.pk-home-obj:hover { border-color: var(--arka-red); transform: translateY(-1px); }
.pk-home-obj .hoic { width:34px; height:34px; border-radius:10px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background:rgba(199,15,67,.12); color:var(--arka-red); }
.pk-home-obj .hoic svg { width: 16px; height: 16px; }
.pk-home-obj .hob { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-home-obj .hot { display: block; font-size: 13.5px; font-weight: 600; color: var(--content); }
.pk-home-obj .hom { display: block; font-size: 11.5px; color: var(--content-muted); margin-top: 2px; }
.pk-home-obj .hok { color: var(--content-subtle); flex-shrink: 0; }
.pk-home-obj .hok svg { width: 15px; height: 15px; }
ction: column; }
.pk-home-obj .hot { display: block; font-size: 13.5px; font-weight: 600; color: var(--content); }
.pk-home-obj .hom { display: block; font-size: 11.5px; color: var(--content-muted); margin-top: 2px; }
.pk-home-obj .hok { color: var(--content-subtle); flex-shrink: 0; }
.pk-home-obj .hok svg { width: 15px; height: 15px; }
 svg { width: 15px; height: 15px; }
