/* arka-live.css — « Arka · le documentaliste — en direct ».
   Charte Arkalabs (dark) : #0a0a0b, arka-red chirurgical, Poppins + JetBrains Mono.
   Principe visuel : CENTRIPÈTE — tout converge vers Arka (workers, tools, documents).
   Layout distinct d'ENOD : deux lanes (pensée à gauche · atelier à droite),
   bande de lecture, cascade d'injection. Les panneaux émergent au travail, s'effacent au repos. */

:root {
  --surface: #171718;
  --surface-alt: #222121;
  --surface-card: rgba(255,255,255,.018);
  --surface-hover: rgba(255,255,255,.04);
  --content: #ffffff;
  --content-muted: #c2c6cc;
  --content-subtle: #6b7280;
  --app-border: rgba(255,255,255,.08);
  --app-border-subtle: rgba(255,255,255,.05);
  --arka-red: #c70f43;
  --arka-green: #00d287;
  --arka-purple: #8b5cf6;
  --arka-blue: #4a90e2;
  --arka-fuchsia: #d946ef;
  --status-warn: #d97706;
  --status-fail: #dc2626;
  --status-pass: #16a34a;
  --status-pending: #c70f43;
  --arka-amber: #fbbf24;    /* strate Learning / résonance (couche viz) */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --accent: #00d287;       /* sélection et activité */
}
/* Poppins conservé pour les moments de marque / hero ; corps & UI en Geist (plus lisible). */
.ark-rail-brand .wm, .ark-id .nm, .cx-pagehead-title, .ark-mark, .ark-brand .wm { font-family: var(--font-display); }

* { box-sizing: border-box; }

/* scrollbars discrètes (global) */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
body.theme-light * { scrollbar-color: rgba(28,24,22,.18) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); background-clip: padding-box; }
body.theme-light *::-webkit-scrollbar-thumb { background: rgba(28,24,22,.16); background-clip: padding-box; }
body.theme-light *::-webkit-scrollbar-thumb:hover { background: rgba(28,24,22,.3); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--surface); color: var(--content);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased; overflow: hidden;
}

.ark-stage { position: fixed; inset: 0; overflow: hidden; }
.ark-grid { display: none; }
.ark-vignette { display:none; }
#ark-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }
/* Liquid Glass (CSS+SVG) : les panneaux tagués réfractent la scène vivante derrière eux */
body.glass-on [data-glass] {
  background: rgba(255,255,255,.05) !important;
  -webkit-backdrop-filter: blur(3px) saturate(1.5) url(#lg-displace);
  backdrop-filter: blur(3px) saturate(1.5) url(#lg-displace);
  border: 1px solid rgba(255,255,255,.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -8px 18px -10px rgba(0,0,0,.5), 0 8px 30px -12px rgba(0,0,0,.5) !important;
}
/* mode WebGL : la couche #ark-gl peint la réfraction ; les panneaux laissent voir le verre */
body.glass-webgl [data-glass] {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 34px -14px rgba(0,0,0,.55) !important;
}
body.theme-light.glass-webgl [data-glass] {
  border-color: rgba(28,24,22,.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 30px -14px rgba(28,24,22,.2) !important;
}
body.theme-light.glass-on [data-glass] {
  background: rgba(255,255,255,.32) !important;
  border-color: rgba(255,255,255,.6) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -8px 18px -10px rgba(28,24,22,.18), 0 8px 26px -12px rgba(28,24,22,.22) !important;
}

/* ===== Top bar ===== */
.ark-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; padding: 20px 26px;
}
.ark-brand { display: flex; align-items: center; gap: 11px; }
.ark-mark { width: 16px; height: 16px; border-radius: 4px; background: var(--arka-red); flex-shrink: 0; }
.ark-mark-logo { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: block; }
.ark-brand .wm { font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; }
.ark-brand .wm .dot { color: var(--arka-red); }
.ark-brand .bywm { font-size: 9px; letter-spacing: .02em; color: var(--content-muted); margin-top: 3px; }
.ark-brand .bywm .bold { font-weight: 800; }
.ark-brand .bywm .light { font-weight: 300; }
.ark-brand .sub { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--content-subtle); margin-top: 3px; }
.ark-live-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--arka-green); box-shadow: 0 0 9px rgba(0,210,135,.7); display: inline-block; margin-right: 6px; }
.ark-brand .live { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--content-muted); display: flex; align-items: center; margin-top: 4px; }

.ark-top-right { display: flex; align-items: center; gap: 18px; margin-left: auto; }
/* fil d'Ariane (contexte de page) */
.ark-crumb { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--content); }
.ark-crumb .seg.muted { color: var(--content-subtle); font-weight: 500; }
.ark-crumb svg { width: 14px; height: 14px; color: var(--content-subtle); }
/* menu latéral gauche (hover-expand) */
.ark-rail { position: absolute; left: 0; top: 0; bottom: 0; width: 64px; z-index: 9; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 18px; background: rgba(255,255,255,.02); border-right: 1px solid var(--app-border); overflow: hidden; transition: width .26s cubic-bezier(.16,1,.3,1), background .2s; }
.ark-rail:hover { width: 230px; background: rgba(16,16,18,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.theme-light .ark-rail:hover { background: rgba(255,255,255,.9); }
.ark-rail-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--app-border-subtle); }
.ark-rail-brand .ark-mark-logo { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: block; }
.ark-rail-brand .lb { opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; white-space: nowrap; }
.ark-rail:hover .ark-rail-brand .lb { opacity: 1; transform: none; }
.ark-rail-brand .wm { font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; }
.ark-rail-brand .wm .dot { color: var(--arka-red); }
.ark-rail-brand .bywm { font-size: 9px; letter-spacing: .02em; color: var(--content-muted); margin-top: 3px; }
.ark-rail-brand .bywm .bold { font-weight: 800; }
.ark-rail-brand .bywm .light { font-weight: 300; }
.ark-rail-item { display: flex; align-items: center; gap: 13px; padding: 10px; border-radius: 11px; color: var(--content-muted); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .14s, color .14s; }
.ark-rail-item:hover { background: var(--surface-hover); color: var(--content); }
.ark-rail-item.on { color: var(--content); }
.ark-rail-item.on .ic { color: var(--arka-red); }
.ark-rail-item .ic { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ark-rail-item .ic svg { width: 19px; height: 19px; }
.ark-rail-item .lb { font-size: 13.5px; font-weight: 600; opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.ark-rail:hover .ark-rail-item .lb { opacity: 1; transform: none; }
.ark-rail-sp { flex: 1; }
/* raccourci session → arka */
.ark-rail-ses { display: flex; align-items: center; gap: 13px; padding: 8px 10px; margin: 2px 0 6px; border-radius: 11px; border: 1px dashed var(--app-border); color: var(--content-muted); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.ark-rail-ses:hover { background: var(--surface-hover); color: var(--content); border-color: var(--content-subtle); }
.ark-rail-ses .ic { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ark-rail-ses .ic svg { width: 18px; height: 18px; }
.ark-rail-ses .sx { min-width: 0; opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.ark-rail:hover .ark-rail-ses .sx { opacity: 1; transform: none; }
.ark-rail-ses .s1 { font-size: 11.5px; font-weight: 600; color: var(--content); display: flex; align-items: center; gap: 7px; }
.ark-rail-ses .s1 .sid { font-family: var(--font-mono); font-size: 9px; color: var(--content-muted); }
.ark-rail-ses .s2 { font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--content-subtle); margin-top: 3px; }
.ark-rail-ses .sd { width: 6px; height: 6px; border-radius: 99px; background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); flex-shrink: 0; }
/* libellés de section */
.ark-rail-sec { position: relative; height: 26px; display: flex; align-items: center; padding: 0 12px; margin-top: 4px; }
.ark-rail-sec span { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--content-subtle); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; white-space: nowrap; }
.ark-rail:hover .ark-rail-sec span { opacity: .7; transform: none; }
.ark-rail-sec::before { content: ''; position: absolute; left: 14px; right: 14px; top: 50%; height: 1px; background: var(--app-border-subtle); opacity: 1; transition: opacity .2s; }
.ark-rail:hover .ark-rail-sec::before { opacity: 0; }
/* on décale la chrome pour laisser la place au rail replié */
.ark-top { padding-left: 84px; }
.ark-files { left: 84px; }
/* posture — traduite zéro-jargon */
.ark-posture { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px; border: 1px solid var(--app-border); border-radius: 99px; background: rgba(255,255,255,.025); backdrop-filter: blur(6px); }
.ark-posture .pd { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 9px -1px var(--accent); transition: background .4s, box-shadow .4s; flex-shrink: 0; }
.ark-posture .pl { font-size: 12px; font-weight: 600; color: var(--content); white-space: nowrap; }
.ark-posture .pmeta { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); padding-left: 9px; border-left: 1px solid var(--app-border); white-space: nowrap; }

/* cascade d'injection (budget tokens) */
.ark-cascade { display: flex; align-items: center; gap: 8px; }
.ark-cascade .lab { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); }
.ark-cascade .seg { display: flex; gap: 3px; }
.ark-cascade .seg i { width: 16px; height: 4px; border-radius: 2px; background: var(--app-border); transition: background .35s, box-shadow .35s; }
.ark-cascade .seg i.on { background: var(--accent); box-shadow: 0 0 7px -1px var(--accent); }
.ark-cascade .tk { font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--content-muted); min-width: 46px; text-align: right; }

/* ===== Center identity ===== */
.ark-id {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, 4px);
  z-index: 4; text-align: center; pointer-events: none; width: 420px;
}
.ark-id .nm { font-size: 27px; font-weight: 800; letter-spacing: .02em; }
.ark-id .nm .a { color: var(--accent); transition: color .4s; }
.ark-id .role { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--content-muted); margin-top: 12px; }
.ark-id .creed { font-size: 11.5px; color: var(--content-subtle); margin-top: 10px; line-height: 1.55; max-width: 320px; margin-inline: auto; transition: opacity .4s; }
.ark-stage.working .ark-id .creed { opacity: 0; }

/* ===== Lane gauche : fichiers cités par Arka ===== */
.ark-files {
  position: absolute; left: 90px; top: 21%; bottom: 21%; width: 320px; z-index: 6;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; pointer-events: none;
}
.ark-files-list { display: flex; flex-direction: column; gap: 8px; overflow: hidden; min-height: 0; }

/* ===== Lane: pensée (gauche) ===== */
.ark-think {
  position: absolute; left: 26px; top: 27%; bottom: 27%; width: 318px; z-index: 6;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; pointer-events: none;
}
.ark-lane-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--content-subtle); opacity: 0; transition: opacity .4s; }
.ark-lane-h.show { opacity: 1; }
.ark-lane-h svg { width: 13px; height: 13px; color: var(--accent); }
.ark-think-list { display: flex; flex-direction: column; gap: 9px; overflow: hidden; min-height: 0; }
.ark-thought {
  font-size: 13.5px; line-height: 1.5; color: var(--content); padding-left: 13px;
  border-left: 2px solid var(--accent); opacity: 0; transform: translateX(-10px);
  animation: ark-in .5s cubic-bezier(.16,1,.3,1) forwards;
}
.ark-thought.dim { color: var(--content-muted); }
.ark-thought .lbl { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.ark-thought.miroir { border-left-color: var(--arka-blue); }
.ark-thought.miroir .lbl { color: var(--arka-blue); }
.ark-thought.hypothese { border-left-color: var(--arka-fuchsia); }
.ark-thought.hypothese .lbl { color: var(--arka-fuchsia); }
@keyframes ark-in { to { opacity: 1; transform: none; } }

/* ===== Lane: atelier (droite) — workers + tools ===== */
.ark-shop {
  position: absolute; right: 26px; top: 18%; bottom: 18%; width: 348px; z-index: 6;
  display: flex; flex-direction: column; justify-content: center; gap: 26px; pointer-events: none;
}
.ark-shop-sec { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.ark-shop .ark-lane-h { padding-bottom: 11px; border-bottom: 1px solid var(--app-border-subtle); margin-bottom: 2px; }
.ark-worker {
  display: flex; align-items: center; gap: 13px; padding: 14px 15px; border-radius: 14px;
  border: 1px solid var(--app-border); position: relative; overflow: hidden;
  background: rgba(255,255,255,.022); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateX(12px); animation: ark-in-r .5s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes ark-in-r { to { opacity: 1; transform: none; } }
.ark-worker::before { content: ''; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: var(--w-color, var(--arka-purple)); opacity: .55; }
.ark-worker .wic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--w-tint, rgba(139,92,246,.12)); color: var(--w-color, var(--arka-purple)); }
.ark-worker .wic svg { width: 16px; height: 16px; }
.ark-worker .winfo { flex: 1; min-width: 0; }
.ark-worker .wn { font-size: 13.5px; font-weight: 600; color: var(--content); }
.ark-worker .wcr { font-family: var(--font-mono); font-size: 10px; color: var(--content-subtle); margin-top: 4px; line-height: 1.45; }
.ark-worker .wstat { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; display: flex; align-items: center; gap: 5px; color: var(--content-subtle); }
.ark-worker .wstat .sp { width: 6px; height: 6px; border-radius: 99px; background: var(--status-warn); }
.ark-worker[data-st="done"] .wstat { color: var(--arka-green); }
.ark-worker[data-st="done"] .wstat .sp { background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); }
.ark-worker[data-st="run"] .wstat .sp { animation: ark-blink 1s infinite; }
@keyframes ark-blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* tools ticker (déterministes) */
.ark-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ark-tool {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--app-border-subtle); background: rgba(255,255,255,.03);
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; color: var(--content-muted);
  opacity: 0; animation: ark-pop .3s ease forwards;
}
@keyframes ark-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.ark-tool .td { width: 5px; height: 5px; border-radius: 99px; background: var(--arka-green); box-shadow: 0 0 6px rgba(0,210,135,.6); }
.ark-tool.pending { color: var(--content-subtle); }
.ark-tool.pending .td { background: var(--status-warn); box-shadow: none; animation: ark-blink 1s infinite; }

/* ===== Bande de lecture (documents lus, sous le cœur) ===== */
.ark-read {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -132px);
  z-index: 5; width: 360px; pointer-events: none;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.ark-doc {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 11px;
  border: 1px solid var(--app-border); background: rgba(255,255,255,.03);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(8px) scale(.98); animation: ark-doc-in .45s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes ark-doc-in { to { opacity: 1; transform: none; } }
.ark-doc.reading { border-color: color-mix(in oklab, var(--accent) 55%, transparent); box-shadow: 0 0 28px -10px var(--accent); }
.ark-doc .dglyph { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ark-doc .dglyph svg { width: 15px; height: 15px; }
.gl-notion { background: rgba(255,255,255,.06); color: #e6e6e6; }
.gl-slack  { background: rgba(139,92,246,.14); color: var(--arka-purple); }
.gl-drive  { background: rgba(74,144,226,.14); color: var(--arka-blue); }
.gl-note   { background: rgba(199,15,67,.12); color: var(--arka-red); }
.ark-doc .dn { font-size: 12.5px; font-weight: 600; color: var(--content); line-height: 1.25; }
.ark-doc .dm { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--content-subtle); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.ark-doc .dprov { color: var(--arka-green); }
.ark-doc .dscan { margin-left: auto; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); flex-shrink: 0; }

/* historique de conversation (navigable) */
.ark-history { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; max-width: min(720px, 94vw); }
.ark-turn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 9px; border-radius: 99px;
  border: 1px solid var(--app-border); background: rgba(255,255,255,.03); cursor: pointer;
  font-family: var(--font-sans); font-size: 11.5px; color: var(--content-muted);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: all .15s; max-width: 240px;
}
.ark-turn:hover { color: var(--content); border-color: var(--content-subtle); }
.ark-turn.on { color: var(--content); border-color: var(--t-accent, var(--accent)); background: color-mix(in oklab, var(--t-accent, var(--accent)) 10%, transparent); }
.ark-turn .tn { width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 8px; font-weight: 700; color: #fff; background: var(--t-accent, var(--accent)); }
.ark-turn .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ark-turn.live-now { border-style: dashed; }
body.theme-light .ark-turn { background: #fff; box-shadow: 0 1px 2px rgba(28,24,22,.06); }

/* historique remplacé par le fil déployable centré (.ark-thread) */
.ark-history { display: none; }

/* dernier tour user — toujours visible au-dessus de la réponse */
.ark-lastuser { width: min(680px, 94vw); display: flex; justify-content: flex-end; }
.ark-lastuser[hidden] { display: none; }
.lu-bub { max-width: 80%; padding: 9px 14px; border-radius: 14px 14px 4px 14px; background: var(--content); color: var(--surface); font-size: 13.5px; line-height: 1.45; box-shadow:none; }

/* bouton fil dans le composer */
.ark-thread-btn { position: relative; flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--app-border); background: var(--surface-card); color: var(--content-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.ark-thread-btn[hidden] { display: none; }
.ark-thread-btn:hover { color: var(--content); border-color: var(--content-subtle); }
.ark-thread-btn.on { color: var(--accent); border-color: var(--accent); }
.ark-thread-btn svg { width: 17px; height: 17px; }
.ark-thread-btn .tcount { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-family: var(--font-mono); font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
body:not(.theme-light) .ark-thread-btn { background: rgba(255,255,255,.04); }

/* fil déployable, centré */
.ark-thread { position: absolute; left: 50%; top: 84px; bottom: 150px; transform: translate(-50%, 26px) scale(.97); transform-origin: 50% 100%; width: min(680px, 94vw); z-index: 8; display: flex; flex-direction: column; border: 1px solid var(--app-border); border-radius: 18px; background: rgba(20,20,22,.72); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 30px 80px -20px rgba(0,0,0,.7); opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .42s cubic-bezier(.34,1.4,.5,1); }
.ark-thread[hidden] { display: none; }
.ark-thread.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
body.theme-light .ark-thread { background: rgba(255,255,255,.88); }

/* au déploiement du fil : on efface la version compacte derrière */
.ark-lastuser, .ark-answer, .ark-chips { transition: opacity .26s ease, transform .26s cubic-bezier(.16,1,.3,1); }
.ark-stage.thread-open .ark-lastuser,
.ark-stage.thread-open .ark-answer,
.ark-stage.thread-open .ark-chips { opacity: 0; transform: translateY(10px); pointer-events: none; }
.ark-thread-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--app-border); flex-shrink: 0; }
.ark-thread-head .tt-title { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--content); }
.ark-thread-head .tt-title svg { width: 15px; height: 15px; color: var(--accent); }
.ark-thread-head .tt-count { font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--content-subtle); padding: 2px 7px; border-radius: 99px; background: var(--surface-hover); }
.ark-thread-close { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--app-border); background: transparent; color: var(--content-muted); font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.ark-thread-close:hover { color: var(--content); border-color: var(--content-subtle); }
.ark-thread-close svg { width: 13px; height: 13px; }
.ark-thread-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--accent) 50%, transparent) transparent; }
.ark-thread-scroll::-webkit-scrollbar { width: 8px; }
.ark-thread-scroll::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.ark-thread-scroll::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--accent) 45%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.ark-thread-scroll::-webkit-scrollbar-thumb:hover { background: color-mix(in oklab, var(--accent) 70%, transparent); background-clip: padding-box; }
.th-turn { display: flex; flex-direction: column; gap: 11px; }
.th-user { display: flex; justify-content: flex-end; }
.th-agent { border-left: 2px solid var(--t-accent, var(--accent)); padding-left: 14px; }
.th-agent .ah { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.th-agent .ah .av { width: 18px; height: 18px; border-radius: 6px; background: color-mix(in srgb, var(--t-accent, var(--accent)) 14%, transparent); border: 1px solid var(--t-accent, var(--accent)); flex-shrink: 0; }
.th-agent .ah .who { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); }
.th-agent .atxt { font-size: 13.5px; line-height: 1.55; color: var(--content); }
.th-agent .src { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; font-family: var(--font-mono); font-size: 9px; line-height: 1.5; color: var(--content-subtle); }
.th-agent .src svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; color: var(--arka-green); }
.th-agent .src b { color: var(--content-muted); font-weight: 600; }
.th-agent .ark-props { margin-top: 11px; }

/* ===== Bottom : réponse + composer ===== */
.ark-bottom { position: absolute; left: 64px; right: 340px; bottom: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 13px; padding: 0 26px 26px; }
.ark-chips { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.ark-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 99px;
  border: 1px solid var(--app-border); background: rgba(255,255,255,.022); color: var(--content-muted);
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .16s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ark-chip:hover { color: var(--content); border-color: var(--content-subtle); background: rgba(255,255,255,.05); transform: translateY(-1px); }
.ark-chip .cd { width: 6px; height: 6px; border-radius: 99px; background: var(--c-color, var(--content-subtle)); }
.ark-chip:disabled { opacity: .4; cursor: default; transform: none; }
.ark-bottom.working .ark-chips { display: none; }

/* réponse livrée d'Arka (sa parole) */
.ark-answer {
  width: min(680px, 94vw); border: 1px solid var(--app-border); border-left: 2px solid var(--accent);
  border-radius: 14px; background: rgba(255,255,255,.03); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 15px 18px; opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity .4s ease, max-height .5s cubic-bezier(.16,1,.3,1), padding .4s ease;
}
.ark-answer.show { opacity: 1; max-height: 320px; padding: 15px 18px; }
.ark-answer .ah { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.ark-answer .ah .av { width: 22px; height: 22px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid var(--accent); flex-shrink: 0; }
.ark-answer .ah .who { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); }
.ark-answer .atxt { font-size: 14px; line-height: 1.6; color: var(--content); }
.ark-answer .src { display: flex; align-items: flex-start; gap: 8px; margin-top: 11px; font-family: var(--font-mono); font-size: 10px; line-height: 1.5; color: var(--content-subtle); }
.ark-answer .src svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; color: var(--arka-green); }
.ark-answer .src b { color: var(--content-muted); font-weight: 600; }
/* propositions d'Arka — actions contextualisées (conséquence + verbe), pas de simple CTA */
.ark-props { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--app-border-subtle); }
.ark-props .pph { display: block; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); margin-bottom: 9px; }
.ark-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ark-prop { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--app-border); background: rgba(255,255,255,.03); color: var(--content); cursor: pointer; text-align: left; position: relative; overflow: hidden; transition: border-color .16s, transform .16s, background .16s; }
.ark-prop::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--accent); opacity: 0; transition: opacity .2s; }
.ark-prop:hover { border-color: var(--accent); transform: translateY(-1px); }
.ark-prop:hover::after { opacity: .6; }
.ark-prop .pic { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--accent) 13%, transparent); color: var(--accent); }
.ark-prop .pic svg { width: 15px; height: 15px; }
.ark-prop .pbody { flex: 1; min-width: 0; }
.ark-prop .pt { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.ark-prop .pm { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .03em; color: var(--content-subtle); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ark-prop .pk { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 7.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); flex-shrink: 0; }
.ark-prop .pk svg { width: 12px; height: 12px; transition: transform .16s; }
.ark-prop:hover .pk svg { transform: translateX(2px); }
.ark-prop.warn .pic { background: rgba(217,119,6,.14); color: var(--status-warn); }
.ark-prop.warn .pk { color: var(--status-warn); }
.ark-prop.warn:hover { border-color: var(--status-warn); }

.ark-ask { display: flex; align-items: center; gap: 12px; width: min(680px, 94vw); border: 1px solid var(--app-border); border-radius: 15px; background: rgba(255,255,255,.025); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 13px 14px 13px 18px; transition: border-color .2s, box-shadow .2s; }
.ark-ask:focus-within { border-color: var(--arka-red); box-shadow: 0 0 0 4px rgba(199,15,67,.08); }
.ark-ask input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--content); font-family: var(--font-sans); font-size: 14px; }
.ark-ask input::placeholder { color: var(--content-subtle); }
.ark-ask .hint { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); }
.ark-send { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; border: 0; background: var(--content); color: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity .16s; }
.ark-send:hover { opacity:.88; }
.ark-send:disabled { opacity: .45; cursor: default; background: var(--content-subtle); box-shadow: none; }
.ark-send svg { width: 17px; height: 17px; }
.ark-status { font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--content-subtle); height: 12px; }
.ark-status .bl { color: var(--accent); }

/* ===== Home — état de repos (« on sait où on arrive ») ===== */
.ark-home { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; padding: 86px 26px 28px; overflow-y: auto; transition: opacity .5s ease, transform .55s cubic-bezier(.16,1,.3,1), filter .5s ease; }
.ark-stage.live .ark-home { opacity: 0; transform: translateY(-26px) scale(.955); filter: blur(4px); pointer-events: none; }
.ark-home-in { width: 100%; max-width: 680px; margin: auto; text-align: center; }
.ark-eyebrow { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--content-subtle); margin-bottom: 18px; }
.ark-h1 { font-size: 33px; font-weight: 800; letter-spacing: -.02em; line-height: 1.13; margin: 0 0 16px; color: var(--content); text-wrap: balance; }
.ark-h1 .hl { color: var(--arka-red); }
.ark-sub { font-size: 14px; line-height: 1.6; color: var(--content-muted); margin: 0 auto 26px; max-width: 480px; text-wrap: pretty; }
.ark-home-ask { border: 1px solid var(--app-border); border-radius: 16px; background: rgba(255,255,255,.025); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 15px 17px; text-align: left; transition: border-color .2s, box-shadow .2s; }
.ark-home-ask:focus-within { border-color: var(--arka-red); box-shadow: 0 0 0 4px rgba(199,15,67,.08); }
.ark-home-ask .row1 { display: flex; align-items: center; gap: 12px; }
.ark-home-ask .row1 svg { width: 18px; height: 18px; color: var(--content-subtle); flex-shrink: 0; }
.ark-home-ask input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--content); font-family: var(--font-sans); font-size: 15.5px; }
.ark-home-ask input::placeholder { color: var(--content-subtle); }
.ark-home-ask .row2 { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.ark-home-ask .shint { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--content-subtle); }
.ark-home-ask .shint svg { width: 12px; height: 12px; }
.ark-home-sec { margin-top: 26px; }
.ark-home-lbl { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--content-subtle); margin-bottom: 11px; }
.ark-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ark-home-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--content-muted); cursor: pointer; text-align: left; transition: border-color .15s, background .15s, color .15s; }
.ark-home-item:hover { border-color: var(--app-border); background: var(--surface-hover); color: var(--content); }
.ark-home-item .hic { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--content-subtle); transition: color .15s; }
.ark-home-item:hover .hic { color: var(--content-muted); }
.ark-home-item .hic svg { width: 15px; height: 15px; }
.ark-home-item .ht { flex: 1; font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.ark-home-item.start .hic { color: var(--arka-red); }
.ark-filed { display: inline-flex; align-items: center; gap: 9px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--app-border-subtle); font-size: 12px; color: var(--content-subtle); }
.ark-filed .fd { width: 6px; height: 6px; border-radius: 99px; background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); }
.ark-filed b { color: var(--content-muted); font-weight: 600; }

/* identité + composer : cachés au repos, révélés en live */
.ark-id, .ark-bottom { transition: opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1); }
.ark-stage:not(.live) .ark-id { opacity: 0; }
.ark-stage:not(.live) .ark-bottom { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* light theme — home en cartes papier */
body.theme-light .ark-home-ask { background: #fff; box-shadow: 0 2px 10px rgba(28,24,22,.07); }
body.theme-light .ark-home-item:hover { background: #fff; box-shadow: 0 1px 2px rgba(28,24,22,.06); border-color: var(--app-border); }

/* ===== Sessions ===== */
.ark-sessions { position: relative; }
.ark-theme { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--app-border); background: rgba(255,255,255,.025); color: var(--content-muted); cursor: pointer; transition: all .16s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ark-theme:hover { color: var(--content); border-color: var(--content-subtle); }
.ark-theme svg { width: 16px; height: 16px; }
body.theme-light .ark-theme { background: #fff; box-shadow: 0 1px 2px rgba(28,24,22,.06); }
.ark-sess-btn { display: flex; align-items: center; gap: 8px; padding: 7px 12px; white-space: nowrap; border: 1px solid var(--app-border); border-radius: 10px; background: rgba(255,255,255,.025); color: var(--content-muted); font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: all .16s; }
.ark-sess-btn:hover { color: var(--content); border-color: var(--content-subtle); }
.ark-sess-btn .sd { width: 6px; height: 6px; border-radius: 99px; background: var(--arka-green); box-shadow: 0 0 8px rgba(0,210,135,.6); flex-shrink: 0; }
.ark-sess-btn .sid { color: var(--content); }
.ark-sess-btn .chev { display: flex; transition: transform .25s; }
.ark-sess-btn .chev svg { width: 13px; height: 13px; }
.ark-sessions.open .ark-sess-btn .chev { transform: rotate(180deg); }
.ark-sess-menu { position: absolute; top: 44px; right: 0; width: 340px; background: #161617; border: 1px solid var(--app-border); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); padding: 8px; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s ease, transform .2s cubic-bezier(.16,1,.3,1); z-index: 30; }
.ark-sessions.open .ark-sess-menu { opacity: 1; transform: none; pointer-events: auto; }
.ark-sess-menu-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 11px; border-bottom: 1px solid var(--app-border-subtle); margin-bottom: 6px; }
.ark-sess-menu-h .t { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--content-subtle); }
.ark-sess-new { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--arka-red); background: none; border: 0; cursor: pointer; padding: 0; }
.ark-sess-new svg { width: 13px; height: 13px; }
.ark-sess-item { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; cursor: pointer; position: relative; transition: background .14s; }
.ark-sess-item:hover { background: var(--surface-hover); }
.ark-sess-item.active { background: rgba(255,255,255,.03); }
.ark-sess-item.active::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--arka-red); }
.ark-sess-item .st-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.ark-sess-item .info { flex: 1; min-width: 0; }
.ark-sess-item .ti { font-size: 12.5px; font-weight: 600; color: var(--content); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ark-sess-item .mt { font-family: var(--font-mono); font-size: 9px; color: var(--content-subtle); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.ark-sess-item .mt .live { color: var(--arka-green); }
.ark-sess-item .vp { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .05em; padding: 3px 7px; border-radius: 5px; flex-shrink: 0; }

/* responsive */
@media (max-width: 1180px) {
  .ark-files, .ark-think, .ark-shop { display: none; }
  .ark-read { width: min(420px, 88vw); }
}
@media (prefers-reduced-motion: reduce) {
  .ark-thought, .ark-worker, .ark-tool, .ark-doc { animation: none; opacity: 1; transform: none; }
}

/* ===== Thème clair — orienté pro / bureau (même base que le dark) ===== */
body.theme-light {
  --surface: #faf7f4; --surface-alt: #f0ebe5; --content: #1c1816; --content-muted: #453f39; --content-subtle: #9c9288;
  --app-border: rgba(28,24,22,.12); --app-border-subtle: rgba(28,24,22,.07);
}
body.theme-light .ark-grid {
  background-image: none;
}
body.theme-light .ark-vignette { background: none; }
/* surfaces solides (papier), ombres douces plutôt que blur translucide */
body.theme-light .ark-posture,
body.theme-light .ark-chip,
body.theme-light .ark-ask,
body.theme-light .ark-sess-btn,
body.theme-light .ark-tool,
body.theme-light .ark-prop { background: #fff; box-shadow: 0 1px 2px rgba(28,24,22,.06); }
body.theme-light .ark-worker,
body.theme-light .ark-doc,
body.theme-light .ark-answer { background: #fff; box-shadow: 0 2px 10px rgba(28,24,22,.07); }
body.theme-light .ark-thought { background: #fff; padding: 9px 12px 9px 13px; border-radius: 9px; box-shadow: 0 1px 2px rgba(28,24,22,.05); }
body.theme-light .ark-sess-menu { background: #fff; box-shadow: 0 22px 55px rgba(28,24,22,.20); }
body.theme-light .ark-sess-item.active { background: rgba(28,24,22,.04); }
body.theme-light .gl-notion { background: rgba(28,24,22,.07); color: #1c1816; }
body.theme-light .ark-chip:hover,
body.theme-light .ark-prop:hover { background: #fff; }
body.theme-light .ark-mark { box-shadow:none; }
body.theme-light .ark-answer .av { box-shadow: 0 0 10px -2px var(--accent); }







ound: rgba(28,24,22,.07); color: #1c1816; }
body.theme-light .ark-chip:hover,
body.theme-light .ark-prop:hover { background: #fff; }
body.theme-light .ark-mark { box-shadow:none; }
body.theme-light .ark-answer .av { box-shadow: 0 0 10px -2px var(--accent); }







var(--accent); }







var(--accent); }







 .av { box-shadow: 0 0 10px -2px var(--accent); }







var(--accent); }







var(--accent); }







-accent); }







var(--accent); }







var(--accent); }







 .av { box-shadow: 0 0 10px -2px var(--accent); }







var(--accent); }







var(--accent); }







