/* ═══════════════════════════════════════════════════════════════════════════════════════
   GoToRev Product UI — styles de base et composants (langage D « Monochrome »).
   SOURCE UNIQUE : Operations/Engine/ui/ui.css ; copie par `npm run ui:sync`, jamais modifiée dans une app.
   Dépend de tokens.css (importé avant). Aucune couleur en dur hors des médias sombres (pellicule, vignette).
   Pages natives (sans React) : tokens.css + ui.css suffisent pour boutons, panneaux, états, labels, logos.
   ═══════════════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────── Base */
/* Remise à zéro minimale, la même que le preflight de Tailwind : les pages natives n'ont plus à la recopier */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { margin: 0; font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; }
html { -webkit-text-size-adjust: 100%; background: var(--canvas); }
body {
  background: var(--canvas);
  color: var(--ink);
  font: 400 13px/1.5 var(--font);
  letter-spacing: -0.002em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; color: inherit; }
button:disabled { cursor: default; }
::selection { background: var(--brand-whisper); }
:focus-visible { outline: 1.5px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.mono, code, kbd, pre { font-family: var(--mono); font-feature-settings: normal; letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-200%); background: var(--ink); color: var(--on-ink); padding: 6px 12px; border-radius: var(--r-sm); font-weight: 560; }
.skip:focus { transform: none; }
.grow { flex: 1; min-width: 0; }

/* Échelle : corps 13, méta 12, panneau 13.5 en 560, titre 22 en 590, un seul grand nombre */
.t-num { font-size: 30px; line-height: 1; font-weight: 400; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.t-title { font-size: 22px; line-height: 1.25; font-weight: 590; letter-spacing: -0.015em; }
.t-h2 { font-size: 13.5px; line-height: 1.35; font-weight: 560; letter-spacing: -0.006em; }
.t-body { font-size: 13px; line-height: 1.55; }
.t-meta { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.t-label { font-size: 12px; line-height: 1.3; font-weight: 500; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* ─────────────────────────────── Primitives */
.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--r-xs); font: 500 10.5px/1 var(--mono); color: var(--ink-2);
  background: linear-gradient(180deg, light-dark(#ffffff, #202125), light-dark(#f4f4f5, #17181b));
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 -1px 0 light-dark(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.5));
}
.kbd svg { width: 10px; height: 10px; }
.kbds { display: inline-flex; gap: 3px; }

.apptile {
  --t: 22px;
  position: relative; display: inline-grid; place-items: center; flex: none; width: var(--t); height: var(--t);
  border-radius: calc(var(--t) * 0.28); color: var(--tile-ink);
  background: linear-gradient(180deg, var(--tile-top), var(--tile-bottom));
  box-shadow: 0 0 0 1px var(--tile-edge), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.apptile svg { width: 62%; height: 62%; }
.apptile[data-size='sm'] { --t: 18px; }
.apptile[data-size='lg'] { --t: 40px; }
.apptile[data-size='xl'] { --t: 56px; }
.appmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 560; font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; min-width: 0; }
.relay-mark { width: 18px; height: 15px; display: block; color: var(--ink); flex: none; }

.iconbtn { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-2); flex: none; transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease); }
.iconbtn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.iconbtn:disabled { opacity: 0.35; }
.iconbtn svg { width: 15px; height: 15px; }
.iconbtn[data-size='sm'] { width: 24px; height: 24px; }
.iconbtn[data-size='sm'] svg { width: 14px; height: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 13px; white-space: nowrap; transition: background var(--d-1) var(--ease), box-shadow var(--d-1) var(--ease), color var(--d-1) var(--ease), opacity var(--d-1) var(--ease); }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn .logo { width: 14px; height: 14px; }
.btn-primary { background: var(--ink); color: var(--on-ink); box-shadow: inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.6)), 0 1px 2px rgba(0, 0, 0, 0.2); }
.btn-primary:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 88%, var(--canvas)); }
.btn-primary .logo { --logo-color: var(--on-ink) !important; }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong), var(--glow); }
.btn-secondary:hover:not(:disabled) { background: var(--raised); }
.btn-ghost { color: var(--ink-2); padding: 0 8px; }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; gap: 5px; }
.btn-lg { height: 36px; padding: 0 16px; }
.btn:disabled { opacity: 0.5; }

.logo { display: inline-block; flex: none; width: 14px; height: 14px; background: var(--logo-color, var(--ink-2)); -webkit-mask: var(--logo-src) center / contain no-repeat; mask: var(--logo-src) center / contain no-repeat; }

/* Icône d'état (grammaire Linear) : 14 px, la seule couleur d'une ligne */
.sicon { width: 14px; height: 14px; flex: none; display: block; overflow: visible; }
.sicon[data-size='12'] { width: 12px; height: 12px; }
.sicon .spin { transform-origin: 7px 7px; animation: spin var(--d-spin) linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); flex: none; }
.dot[data-tone='ok'] { background: var(--ok); }
.dot[data-tone='warn'] { background: var(--warn); }
.dot[data-tone='fail'] { background: var(--fail); }
.dot[data-tone='live'] { background: var(--ink-2); }

.count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-xs); font-size: 11px; font-weight: 500; color: var(--ink-3); background: var(--hover); font-variant-numeric: tabular-nums; }

/* Humain : une vraie photo (ou des initiales), toujours ronde. Un agent n'a jamais de visage. */
.av { position: relative; display: inline-block; border-radius: 50%; overflow: hidden; flex: none; background: var(--raised); box-shadow: 0 0 0 1px var(--line); }
.av img { width: 100%; height: 100%; object-fit: cover; }

/* Agent : tuile neutre, glyphe, jamais une photo. L'état se lit par l'anneau, l'icône et le mot. */
.agent {
  position: relative; display: inline-grid; place-items: center; flex: none; width: var(--size, 28px); height: var(--size, 28px);
  border-radius: 28%; color: var(--ink-2);
  background: linear-gradient(180deg, light-dark(#ffffff, #1b1c20), light-dark(#f4f4f5, #141518));
  box-shadow: inset 0 0 0 1px var(--line-strong), light-dark(0 1px 1px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06));
  transition: color var(--d-2) var(--ease), opacity var(--d-2) var(--ease);
}
.agent > svg:first-child { width: 56%; height: 56%; }
/* Teinte propre à l'agent (déclarée par l'app, posée en --hue par <AgentAvatar>) : glyphe teinté, tuile à 14 % */
.agent[data-hue] { color: var(--hue); background: color-mix(in oklab, var(--hue) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--hue) 24%, transparent); }
.agent[data-round] { border-radius: 50%; }
.agent[data-state='waiting'] { opacity: 0.55; }
.agent-ring { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); pointer-events: none; overflow: visible; }
.agent-ring rect { fill: none; stroke-width: 1.25; }
.agent-ring .base { stroke: var(--line-strong); }
.agent-ring .arc { stroke: var(--hue, var(--ink)); stroke-linecap: round; stroke-dasharray: 22 78; animation: travel var(--d-spin) linear infinite; }
.agent[data-stalled='true'] .agent-ring .base { stroke: var(--warn); }
@keyframes travel { to { stroke-dashoffset: -100; } }
.agent-badge { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.agent-badge svg { width: 8px; height: 8px; }
.agent-badge[data-state='done'] { background: var(--ok); color: #ffffff; }
.agent-badge[data-state='failed'] { background: var(--ink-3); color: var(--surface); }
.agent-badge[data-state='failed'] svg { width: 6px; height: 6px; }
.agent-stack { display: inline-flex; }
.agent-stack > * + * { margin-left: -5px; }
.agent-stack .agent { box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 2px var(--surface); }

.gauge { position: relative; flex: 1; height: 2px; min-width: 40px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.gauge i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--ink-2); }
.gauge[data-over='true'] i { background: var(--fail); }
.gauge-label { font: 400 11px/1 var(--mono); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lenring { width: 16px; height: 16px; flex: none; transform: rotate(-90deg); }
.lenring .bg { stroke: var(--line-strong); }
.lenring .fg { stroke: var(--ink-2); }
.lenring[data-over='true'] .fg { stroke: var(--fail); }

/* États colorés : le mot prend la teinte de son icône (grammaire Linear) ; fini et réussi = vert */
.status[data-state='ready'] { color: var(--ok-ink); }
.status[data-state='working'] { color: var(--progress-ink); }
.status[data-state='failed'] { color: var(--fail-ink); }
.status[data-state='stalled'] { color: var(--warn-ink); }
.status[data-state='done'] { color: var(--ok-ink); }
.health-l { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.health-l svg { width: 14px; height: 14px; flex: none; }
.health-l svg rect { fill: color-mix(in oklab, var(--c) 22%, transparent); }
.health-l svg path { fill: none; stroke: var(--c); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.health-l[data-tone='ok'] { --c: var(--ok); color: var(--ok-ink); }
.health-l[data-tone='warn'] { --c: var(--warn); color: var(--warn-ink); }
.health-l[data-tone='fail'] { --c: var(--fail); color: var(--fail-ink); }
.lbl { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: var(--r-pill); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.lbl > i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.lbl > svg, .lbl > .logo, .lbl > .av, .lbl > .agent { width: 13px; height: 13px; flex: none; }
.lbl b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.workchip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 3px 0 9px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 12px; color: var(--ink-2); white-space: nowrap; background: var(--surface); }
.stackav { display: inline-flex; }
.stackav > * { box-shadow: 0 0 0 1.5px var(--surface) !important; }
.stackav > * + * { margin-left: -5px; }
.logo-svg { display: inline-block; flex: none; width: 14px; height: 14px; }
/* Logo dessiné (Drive, Shorts) ou multicolore (<img>) : jamais de fond ni de masque, arrière-plan transparent. */
.logo.logo-svg, .logo.logo-img { background: none !important; -webkit-mask: none; mask: none; object-fit: contain; }
.initials { display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 600; letter-spacing: 0; color: var(--c, var(--ink-2)); background: color-mix(in oklab, var(--c, var(--ink-3)) 16%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c, var(--ink-3)) 26%, transparent); }

/* ─────────────────────────────── Coque : cadre d'app (barre latérale au fond du cadre) + vue intérieure */
/* Le cadre ne défile pas comme un document : la vue intérieure défile seule, la barre latérale reste. */
.shell { position: relative; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; overflow: hidden; background: var(--canvas); transition: grid-template-columns var(--d-2) var(--ease); }
.shell::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: light-dark(0.018, 0.035); mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.side { display: flex; flex-direction: column; width: var(--side-w); min-width: 0; min-height: 0; background: var(--sidebar); transition: opacity var(--d-2) var(--ease), visibility 0s linear 0s; }
/* Barre repliée ([ ou bouton) : la colonne passe à 0, la vue prend toute la largeur ; en mouvement réduit, instantané */
.side-close { margin-left: 2px; }
.side-open { display: none !important; }
html[data-side='collapsed'] .shell { grid-template-columns: 0px minmax(0, 1fr); }
html[data-side='collapsed'] .shell .side { opacity: 0; visibility: hidden; transition: opacity var(--d-1) var(--ease), visibility 0s linear var(--d-2); }
html[data-side='collapsed'] .shell .main { margin-left: 8px; }
html[data-side='collapsed'] .side-open { display: inline-grid !important; margin-left: -6px; }
.side-head { display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 10px 0 12px; flex: none; }
.side-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; flex: 0 1 auto; height: 30px; padding: 0 8px 0 6px; border-radius: var(--r-sm); margin-right: auto; transition: background var(--d-1) var(--ease); }
.side-brand:hover { background: var(--hover); }
.side-brand b { font-weight: 560; font-size: 13.5px; letter-spacing: -0.012em; white-space: nowrap; }
.side-brand > svg { width: 12px; height: 12px; color: var(--ink-3); }
.side-search { display: flex; align-items: center; gap: 8px; height: 30px; margin: 0 10px 8px 12px; padding: 0 5px 0 9px; border-radius: var(--r-sm); flex: none; color: var(--ink-3); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--glow); transition: box-shadow var(--d-1) var(--ease), color var(--d-1) var(--ease); }
.side-search:hover { color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong), var(--glow); }
.side-search svg { width: 14px; height: 14px; }
.side-search .kbds { margin-left: auto; }
.hint-keys { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 2px 0 8px; margin-bottom: 4px; border-radius: var(--r-sm); font-size: 12px; color: var(--ink-3); }
.hint-keys > button:first-child { display: inline-flex; align-items: center; gap: 5px; flex: 1; text-align: left; }
.hint-keys > button:first-child:hover { color: var(--ink-2); }
.hint-keys .iconbtn { color: var(--ink-4); }
.newbtn { box-shadow: inset 0 0 0 1px var(--line-strong), var(--glow); color: var(--ink); background: var(--raised); margin-left: 4px; }
.newbtn:hover:not(:disabled) { background: var(--selected); }
.demo-tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: var(--r-xs); font-size: 11px; font-weight: 500; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); white-space: nowrap; flex: none; }
/* Tête de barre avec étiquette : l'étiquette suit le nom (6 px), le nom s'abrège avant de la toucher */
.side-head[data-tag] .side-brand { margin-right: 0; }
.side-head[data-tag] .side-brand b { overflow: hidden; text-overflow: ellipsis; }
.side-head .demo-tag { height: 18px; padding: 0 5px; font-size: 10.5px; margin: 0 auto 0 6px; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 12px 12px; scrollbar-width: none; }
.side-scroll::-webkit-scrollbar { display: none; }
.side-link { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 8px; border-radius: var(--r-sm); color: var(--ink); font-weight: 500; transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease); }
.side-link:hover { background: var(--hover); }
.side-link[aria-current='page'] { background: var(--selected); }
.side-link > svg, .side-link > .logo { width: 14px; height: 14px; flex: none; color: var(--ink-2); --logo-color: var(--ink-2); }
.side-link .n { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side-link .ext { width: 12px !important; height: 12px !important; margin-left: auto; color: var(--ink-3); }
.side-group { margin-top: 18px; }
.side-group h2 { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; margin-bottom: 2px; font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.side-group h2 svg { width: 10px; height: 10px; }
.side-group h2 .n { margin-left: auto; font-weight: 400; font-variant-numeric: tabular-nums; }
.side-foot { flex: none; padding: 8px 10px 10px 12px; display: grid; gap: 2px; }
.side-me { display: flex; align-items: center; gap: 2px; height: 34px; }
.mebtn { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1; height: 30px; padding: 0 6px; border-radius: var(--r-sm); font-weight: 500; color: var(--ink); transition: background var(--d-1) var(--ease); text-align: left; }
.mebtn:hover, .mebtn[data-popup-open] { background: var(--hover); }
.mebtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.built { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; color: var(--ink-3); font-size: 12px; border-radius: var(--r-sm); }
.built:hover { color: var(--ink); background: var(--hover); }
.built .relay-mark { width: 14px; height: 12px; color: currentColor; }

/* Ligne de la barre latérale (objet de l'app) : mini-vignette 16:9, titre, icône d'état. 32 px, constante. */
.vrow { position: relative; display: flex; align-items: center; gap: 10px; height: var(--row-h); padding: 0 8px 0 6px; border-radius: var(--r-sm); color: var(--ink); transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease); }
.vrow:hover { background: var(--hover); }
.vrow[aria-current='page'] { background: var(--selected); }
.vrow-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.vrow-title[data-file='true'] { font: 400 12px/1 var(--mono); color: var(--ink-2); }
.mini { position: relative; width: 32px; height: 18px; border-radius: 4px; overflow: hidden; flex: none; background: radial-gradient(90% 120% at 30% 0%, #26272b, #121315 70%); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line); }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini .sicon { width: 10px; height: 10px; }
.mini .sicon[data-state='queued'] circle, .mini .sicon[data-state='waiting'] circle { stroke: rgba(255, 255, 255, 0.55); }
.mini b { position: absolute; right: 2px; bottom: 1px; font: 600 6.5px/1 var(--mono); color: rgba(255, 255, 255, 0.5); letter-spacing: 0.02em; }

/* Vue intérieure : un panneau un cran plus clair, filet 1 px, rayon 10, défilement propre */
.main { position: relative; z-index: 2; min-width: 0; min-height: 0; margin: 8px 8px 8px 0; transition: margin var(--d-2) var(--ease); display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line), light-dark(0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 0 transparent); overflow: hidden; }
.main-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.top { position: relative; z-index: var(--z-top); display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 16px; flex: none; border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font-size: 13px; color: var(--ink-3); }
.crumb > svg, .crumb > .sicon { width: 14px; height: 14px; flex: none; color: var(--ink-2); }
.crumb a { color: var(--ink-2); font-weight: 500; transition: color var(--d-1) var(--ease); white-space: nowrap; }
.crumb a:hover { color: var(--ink); }
.crumb .chev { width: 12px; height: 12px; color: var(--ink-4); flex: none; }
.crumb b { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb .back { display: none; }
.pager { display: inline-flex; align-items: center; gap: 0; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pager > span { padding: 0 8px 0 4px; }
.pager b { color: var(--ink-2); font-weight: 400; }
.top-sep { width: 1px; height: 16px; background: var(--line-strong); margin: 0 4px; }
.top-actions { display: flex; align-items: center; gap: 2px; }
.content { width: 100%; max-width: calc(var(--content-max) + 64px); margin: 0 auto; padding: 24px 32px 96px; }

/* Capture pleine page (dev/shoot.mjs) : le cadre se déplie en document, rien d'autre ne change */
[data-capture='full'] .shell { height: auto; overflow: visible; }
[data-capture='full'] .side { position: sticky; top: 0; height: 100vh; }
[data-capture='full'] .main, [data-capture='full'] .main-scroll { overflow: visible; }

/* ─────────────────────────────── Panneaux */
.panel { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line), var(--glow); min-width: 0; }
.panel-pad { padding: 16px; }
.phead { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.phead h2, .phead h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 560; letter-spacing: -0.006em; white-space: nowrap; }
.phead .t-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.phead-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.byline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-7 { grid-column: span 7; } .c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; }
.stack { display: grid; gap: 12px; align-content: start; min-width: 0; }
.sec { margin-top: 40px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 24px; }
.sec-head h2 { font-size: 13.5px; font-weight: 560; letter-spacing: -0.006em; }
.sec-head p { font-size: 12px; color: var(--ink-3); }
.sec-head .byline { margin-left: auto; }

/* ─────────────────────────────── Propriétés, barres horizontales, en-tête de vue */
.prop { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; white-space: nowrap; min-width: 0; }
.prop > svg { width: 14px; height: 14px; color: var(--ink-2); flex: none; }
.prop.faint { color: var(--ink-3); font-weight: 400; }
.pdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart-bars { display: grid; gap: 10px; padding: 16px; }
.cb-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 28px; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.cb-row > span:first-child { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cb-row > span:first-child svg { width: 14px; height: 14px; }
.cb-track { height: 6px; border-radius: 3px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line-faint); overflow: hidden; }
.cb-track i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.cb-row b { text-align: right; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.ov-top { display: flex; align-items: flex-end; gap: 16px; }
.ov-top .grow { min-width: 0; }

/* Ligne d'agent : tuile + nom + ce qu'il fait */
.crew-row { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: var(--r-sm); outline-offset: 3px; }
.crew-row .who { display: grid; line-height: 1.35; min-width: 0; }
.crew-row .who b { font-weight: 500; font-size: 13px; }
.crew-row .who > span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────────────────────────── Média, copie, texte repliable */
.thumb { display: block; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--film); position: relative; }
.thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.copybtn { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 7px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; color: var(--ink-3); transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease), opacity var(--d-1) var(--ease); }
.copybtn:hover { background: var(--hover); color: var(--ink); }
.panel:hover .phead .copybtn, [data-active='true'] .phead .copybtn { color: var(--ink-2); }
.copybtn svg { width: 13px; height: 13px; }
.copybtn[data-icon] { width: 24px; padding: 0; justify-content: center; }
.copybtn[data-done='true'] { color: var(--ink); }
.copybtn[data-done='true'] svg { color: var(--ok); }
.copybtn .kbd { margin-left: 2px; }

.clamp { overflow: hidden; max-height: var(--clamp, 11em); position: relative; }
.clamp[data-open='false']::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.clamp[data-open='true'] { max-height: none; }
.more { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 2px 0; }
.more:hover { color: var(--ink); }
.over { color: var(--fail-ink); }

/* ─────────────────────────────── Avis en ligne */
.notice { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.notice svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--ink-3); }

/* ─────────────────────────────── En-tête de vue et équipe d'agents */
.ov-head h1 { margin-top: 2px; }
.ov-head p { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); max-width: 620px; }
.crew { display: grid; }
.crew-line { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 52px; padding: 0 16px; }
.crew-line + .crew-line { border-top: 1px solid var(--line-faint); }
.crew-line .status { font-size: 12px; }

.phead h2 .logo, .phead h3 .logo { --logo-color: var(--ink-2); }
.notice .btn { margin-left: 4px; }

/* ─────────────────────────────── États vides et erreurs */
.empty { display: grid; justify-items: start; gap: 10px; max-width: 520px; margin: 12vh auto 0; }
.empty .apptile, .empty .ic-lg { margin-bottom: 6px; }
.empty .ic-lg { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); }
.empty .ic-lg svg { width: 16px; height: 16px; }
.empty h1 { font-size: 18px; font-weight: 590; letter-spacing: -0.012em; }
.empty p { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.empty code { font-size: 12px; color: var(--ink-3); }
.empty .actions { display: flex; gap: 8px; margin-top: 8px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.flow svg { width: 13px; height: 13px; color: var(--ink-4); }

/* ─────────────────────────────── Flottants (Raycast) : palette, menus, infobulles, dialogues */
.scrim { position: fixed; inset: 0; z-index: var(--z-dialog); background: var(--scrim); transition: opacity var(--d-2) var(--ease); }
.scrim[data-starting-style], .scrim[data-ending-style] { opacity: 0; }
.floating { background: var(--float); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); box-shadow: var(--shadow-float); }
.dlg { position: fixed; z-index: calc(var(--z-dialog) + 1); left: 50%; top: 14vh; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); border-radius: var(--r-panel); overflow: hidden; transition: opacity var(--d-2) var(--ease), transform var(--d-2) var(--ease); }
.dlg[data-starting-style], .dlg[data-ending-style] { opacity: 0; transform: translateX(-50%) scale(0.98); }
.dlg.small { width: min(420px, calc(100vw - 32px)); top: 24vh; }
.dlg-pad { padding: 20px; }
.dlg-title { font-size: 15px; font-weight: 590; letter-spacing: -0.01em; }
.dlg-desc { margin-top: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.keys { display: grid; margin-top: 16px; }
.keyrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 34px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line-faint); }
.keyrow:first-child { border-top: 0; }

.pal { width: min(640px, calc(100vw - 24px)); top: 12vh; }
.pal-search { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.pal [cmdk-input] { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; font: 400 15px var(--font); color: var(--ink); letter-spacing: -0.005em; }
.pal [cmdk-input]::placeholder { color: var(--ink-3); }
.pal [cmdk-list] { max-height: min(420px, 56vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; scroll-padding: 6px; }
.pal [cmdk-group-heading] { padding: 10px 10px 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.pal [cmdk-item] { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r-md); font-size: 13px; color: var(--ink); cursor: pointer; }
.pal [cmdk-item][data-selected='true'] { background: var(--selected); }
.pal [cmdk-item] .ic { width: 20px; height: 20px; display: grid; place-items: center; flex: none; color: var(--ink-2); border-radius: 4px; overflow: hidden; }
.pal [cmdk-item] .ic svg { width: 15px; height: 15px; }
.pal [cmdk-item] .ic img { width: 20px; height: 12px; object-fit: cover; border-radius: 2px; }
.pal [cmdk-item] .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal [cmdk-item] .hint { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.pal [cmdk-item] > svg { width: 13px; height: 13px; color: var(--ink-3); flex: none; }
.pal [cmdk-empty] { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.pal-foot { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px 0 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.pal-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.pal-foot .grow { display: flex; align-items: center; gap: 8px; }
.pal-foot .apptile { --t: 16px; }

.tip { z-index: var(--z-pop); display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--r-sm); font-size: 12px; color: var(--ink); background: var(--float); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-float); transition: opacity var(--d-1) var(--ease); max-width: 320px; line-height: 1.45; }
.tip[data-starting-style], .tip[data-ending-style] { opacity: 0; }
.tip .kbds { margin-left: 2px; }
.tip-wide { display: grid; gap: 2px; padding: 8px 10px; }
.tip-wide b { font-weight: 560; }
.tip-wide span { color: var(--ink-2); }
.tip .mono { color: var(--ink-3); }

.menu { z-index: var(--z-pop); min-width: 220px; padding: 4px; border-radius: var(--r-md); transition: opacity var(--d-1) var(--ease), transform var(--d-1) var(--ease); }
.menu[data-starting-style], .menu[data-ending-style] { opacity: 0; transform: scale(0.98); }
.menu-who { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-who > span { display: grid; line-height: 1.35; }
.menu-who b { font-weight: 560; }
.menu-who span span { font-size: 12px; color: var(--ink-3); }
.menu-item { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink); cursor: pointer; outline: 0; }
.menu-item svg { width: 14px; height: 14px; color: var(--ink-2); }
.menu-item[data-highlighted] { background: var(--selected); }
.menu-sep { height: 1px; background: var(--line); margin: 4px; }

.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: min(420px, calc(100vw - 32px)); padding: 10px 14px; border-radius: var(--r-md); font-size: 13px; color: var(--ink); background: var(--float); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: var(--shadow-float); }
.toast [data-icon] { display: grid; place-items: center; width: 14px; height: 14px; flex: none; color: var(--ink-2); }
.toast [data-icon] svg { width: 14px; height: 14px; }
.toast[data-type='success'] [data-icon] { color: var(--ok); }
.toast[data-type='error'] [data-icon] { color: var(--fail); }
.toast [data-content] { display: grid; gap: 1px; }
.toast-desc { font-size: 12px; color: var(--ink-3); }

/* ─────────────────────────────── Connexion (commune à toutes les apps) */
.login { min-height: 100vh; display: grid; place-items: center; padding: 48px 16px; position: relative; overflow: hidden; background: var(--canvas); }
.login::before { content: ''; position: absolute; left: 50%; top: -30vh; width: 1100px; height: 70vh; transform: translateX(-50%); background: radial-gradient(closest-side, light-dark(rgba(0, 0, 0, 0.022), rgba(255, 255, 255, 0.055)), transparent); pointer-events: none; }
.login-theme { position: absolute; top: 14px; right: 14px; }
.login-col { position: relative; width: min(360px, 100%); display: grid; gap: 28px; }
.login-form { display: grid; gap: 16px; }
.login-form h1 { font-size: 20px; font-weight: 590; letter-spacing: -0.015em; margin-top: 16px; }
.login-form .sub { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.input { height: 36px; width: 100%; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); border: 0; font: inherit; font-size: 13.5px; box-shadow: inset 0 0 0 1px var(--line-strong), var(--glow); transition: box-shadow var(--d-1) var(--ease); }
.input:hover { box-shadow: inset 0 0 0 1px light-dark(rgba(0, 0, 0, 0.22), rgba(255, 255, 255, 0.18)), var(--glow); }
.input:focus { outline: 0; box-shadow: inset 0 0 0 1px var(--ink-2), 0 0 0 3px light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.06)); }
.input[aria-invalid='true'] { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--fail) 70%, transparent); }
.field-error { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.field-error svg { width: 13px; height: 13px; color: var(--fail); flex: none; }
.login-form .btn { width: 100%; }
.login-crew { display: grid; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.login-crew .agents { display: flex; gap: 8px; }
.login-crew p { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.login-owner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); margin-top: -12px; }
.login-owner b { color: var(--ink); font-weight: 500; }
.login-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.login-foot span { display: inline-flex; align-items: center; gap: 8px; }
.login-foot .relay-mark { width: 14px; height: 12px; color: var(--ink-3); }
.login-foot .logo { width: 13px; height: 13px; }

/* ─────────────────────────────── Barre d'onglets (sous l'en-tête de vue, à la Linear) */
.tabbar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; flex: none; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabs { display: flex; align-items: center; gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease), box-shadow var(--d-1) var(--ease); }
.tab:hover { background: var(--hover); color: var(--ink); }
.tab[aria-selected='true'] { color: var(--ink); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tab > svg { width: 14px; height: 14px; flex: none; color: var(--ink-3); }
.tab[aria-selected='true'] > svg { color: var(--ink-2); }
.tab .logo { width: 14px; height: 14px; }
.tab-n { font-size: 12px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kbd-to { color: var(--ink-3); font-size: 11px; padding: 0 1px; align-self: center; }

/* ─────────────────────────────── Colonne de propriétés (à droite, à la Linear) */
.aside { display: grid; gap: 22px; align-content: start; padding-left: 24px; border-left: 1px solid var(--line); min-width: 0; min-height: 100%; }
.aside h2 { display: flex; align-items: center; height: 24px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.aside ul { display: grid; }
.aside li { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; font-weight: 500; color: var(--ink); min-width: 0; white-space: nowrap; }
.aside li > svg { width: 14px; height: 14px; color: var(--ink-2); flex: none; }
.aside li.faint { color: var(--ink-3); font-weight: 400; }
.aside .status { font-size: 13px; }
.aside-labels { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.aside .res { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); }
.aside .res > svg { width: 14px; height: 14px; flex: none; }
.aside .res span { overflow: hidden; text-overflow: ellipsis; }
.aside .res:hover span { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

.notice-panel { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; font-size: 13px; color: var(--ink-2); }

.tab-empty { display: grid; justify-items: center; gap: 8px; padding: 56px 28px 48px; text-align: center; }
.tab-empty-ic { display: grid; place-items: center; width: 20px; height: 20px; margin-bottom: 4px; }
.tab-empty-ic svg, .tab-empty-ic .logo { width: 20px; height: 20px; color: var(--ink-2); }
.tab-empty h2 { font-size: 15px; font-weight: 590; letter-spacing: -0.01em; }
.tab-empty p { font-size: 13px; line-height: 1.55; color: var(--ink-2); max-width: 460px; }
.tab-empty p.faint { color: var(--ink-3); }
.tab-empty-by { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin: 12px 0 10px; text-align: left; }
.grid-stretch { align-items: stretch; }

/* ─────────────────────────────── Tableau de bord : cartes métriques et cartes de graphes (Linear Insights) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.kpi { display: grid; gap: 12px; padding: 16px 18px 16px; align-content: start; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 30px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; min-height: 16px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi-foot svg { width: 13px; height: 13px; flex: none; }
.trend { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trend[data-tone='ok'] svg { color: var(--ok); }
.trend[data-tone='warn'] svg { color: var(--warn); }
.spark-line { flex: none; overflow: visible; }
.spark-line polyline { stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-line circle { fill: var(--ink); }
.dash-grid { margin-top: 12px; align-items: stretch; }
.dcard { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; min-width: 0; }
.dcard-head { display: flex; align-items: baseline; gap: 8px; min-height: 20px; min-width: 0; }
.dcard-head h2 { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.dcard-head .t-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dcard-head .copybtn { align-self: center; margin-right: -8px; }
.dash-empty { font-size: 13px; color: var(--ink-3); }

.chart { display: flex; flex-direction: column; gap: 8px; margin: 0; flex: 1; min-height: 0; }
.chart-plot { position: relative; flex: 1; min-height: var(--h); margin: 6px 36px 0 0; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { position: relative; height: 0; border-top: 1px dashed var(--line); }
.chart-grid span:last-child { border-top: 1px solid var(--line-strong); }
.chart-grid i { position: absolute; left: calc(100% + 10px); top: -7px; font: 400 11px/14px var(--font); font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 10px; padding: 0 6px; }
.bar-col { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.bar { width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; gap: 1px; border-radius: 3px 3px 1px 1px; overflow: hidden; transition: opacity var(--d-1) var(--ease); }
.bar i { display: block; flex-basis: 0; min-height: 3px; }
.bars:hover .bar-col:not([data-on='true']) .bar { opacity: 0.45; }
.chart-x { display: flex; gap: 10px; padding: 0 6px; margin-right: 36px; font-size: 11px; line-height: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-x span { flex: 1; text-align: center; white-space: nowrap; min-width: 0; transition: color var(--d-1) var(--ease); }
.chart-x span[data-on='true'] { color: var(--ink); }
.chart-x-abs { position: relative; display: block; height: 14px; padding: 0; }
.chart-x-abs span { position: absolute; top: 0; text-align: left; }
.chart-tip { position: absolute; left: 50%; transform: translateX(-50%); display: grid; gap: 4px; min-width: 150px; padding: 8px 10px; pointer-events: none; white-space: nowrap; z-index: 3; }
.chart-tip b { font-weight: 560; }
.chart-tip-row { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.chart-tip-row i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.chart-tip-row em { margin-left: auto; padding-left: 12px; font-style: normal; color: var(--ink); font-variant-numeric: tabular-nums; }
.area { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.area-top { stop-color: var(--ink); stop-opacity: 0.14; }
.area-bottom { stop-color: var(--ink); stop-opacity: 0; }
.area-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; }
.area-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-strong); pointer-events: none; }
.area-dot { position: absolute; width: 7px; height: 7px; margin: 0 0 -3.5px -3.5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--surface); pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.legend .sicon { width: 12px; height: 12px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.area-trend { fill: none; stroke: var(--ink-3); stroke-width: 1.25; stroke-dasharray: 5 4; }
.trend-key { width: 16px; height: 0; border-top: 1.25px dashed var(--ink-3); flex: none; }
.segments { display: flex; gap: 2px; width: 100%; border-radius: 3px; overflow: hidden; flex: none; }
.segments i { display: block; flex-basis: 0; min-width: 3px; }

.legend-tight { gap: 6px 16px; }

.share-list { display: grid; }
.share-list li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 40px; align-items: center; gap: 10px; height: 32px; font-size: 13px; border-top: 1px solid var(--line-faint); }
.share-list li:first-child { border-top: 0; }
.share-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); min-width: 0; }
.share-name > svg, .share-name .logo { width: 14px; height: 14px; flex: none; }
.share-list b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.share-list .pct { text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.acts { display: grid; margin: -6px -8px -8px; }
.acts a { display: grid; grid-template-columns: 40px minmax(0, 1fr) 14px 64px; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); transition: background var(--d-1) var(--ease); }
.acts a:hover { background: var(--hover); }
.act-who { display: flex; align-items: center; }
.act-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.act-text b, .act-text em { color: var(--ink); font-weight: 500; font-style: normal; }
.act-t { font-size: 12px; color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dcard .crew { margin: -6px 0 -8px; }
.dcard .crew-line { grid-template-columns: minmax(0, 1fr) auto; min-height: 44px; padding: 0; }
.dcard .chart-bars { padding: 2px 0 0; gap: 12px; }

/* ─────────────────────────────── Mode suite : sélecteur d'apps (affiché seulement à partir de deux apps) */
.suite-switch { display: grid; gap: 1px; padding: 4px; margin: 0 10px 8px 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--glow); }
.suite-app { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px 0 5px; border-radius: var(--r-sm); font-weight: 500; color: var(--ink-2); transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease); }
.suite-app:hover { background: var(--hover); color: var(--ink); }
.suite-app[aria-current='true'] { background: var(--selected); color: var(--ink); }
.suite-app .apptile { --t: 18px; }
.suite-app > svg { width: 12px; height: 12px; margin-left: auto; color: var(--ink-3); }

/* ─────────────────────────────── Teintes d'agents et d'initiales (tokens --a-*, --tint-* de tokens.css) */
.agent[data-agent='echo'] { --hue: var(--a-echo); }
.agent[data-agent='quill'] { --hue: var(--a-quill); }
.agent[data-agent='reel'] { --hue: var(--a-reel); }
.agent[data-agent='frame'] { --hue: var(--a-frame); }
.agent[data-agent='courier'] { --hue: var(--a-courier); }
.agent[data-agent='scribe'] { --hue: var(--a-scribe); }
.agent[data-agent='pulse'] { --hue: var(--a-pulse); }
.agent[data-agent='scout'] { --hue: var(--a-scout); }
.agent[data-agent='spark'] { --hue: var(--a-spark); }
.agent[data-agent='pitch'] { --hue: var(--a-pitch); }
.agent[data-agent='herald'] { --hue: var(--a-herald); }
.agent[data-agent='ledger'] { --hue: var(--a-ledger); }
.agent[data-agent='porter'] { --hue: var(--a-porter); }
.agent[data-agent='sage'] { --hue: var(--a-sage); }
.agent[data-agent='swift'] { --hue: var(--a-swift); }
.agent[data-agent='compass'] { --hue: var(--a-compass); }
.initials[data-tint='tint-teal'] { --c: var(--tint-teal); }
.initials[data-tint='tint-violet'] { --c: var(--tint-violet); }
.initials[data-tint='tint-amber'] { --c: var(--tint-amber); }
.initials[data-tint='tint-blue'] { --c: var(--tint-blue); }
.initials[data-tint='tint-pink'] { --c: var(--tint-pink); }
.initials[data-tint='tint-green'] { --c: var(--tint-green); }
/* Tailles sans attribut style (pages natives sous CSP stricte) : 16 à 40 px */
.agent[data-size='16'] { --size: 16px; } .agent[data-size='18'] { --size: 18px; } .agent[data-size='20'] { --size: 20px; }
.agent[data-size='24'] { --size: 24px; } .agent[data-size='28'] { --size: 28px; } .agent[data-size='30'] { --size: 30px; }
.agent[data-size='32'] { --size: 32px; } .agent[data-size='36'] { --size: 36px; } .agent[data-size='40'] { --size: 40px; }
.initials[data-size] { width: var(--av); height: var(--av); font-size: max(8px, calc(var(--av) * 0.38)); }
.initials[data-size='16'] { --av: 16px; } .initials[data-size='18'] { --av: 18px; } .initials[data-size='20'] { --av: 20px; }
.initials[data-size='24'] { --av: 24px; } .initials[data-size='28'] { --av: 28px; } .initials[data-size='32'] { --av: 32px; }
.initials[data-size='36'] { --av: 36px; } .initials[data-size='40'] { --av: 40px; }

/* Client de démo : pastille « D » au coin des initiales (<ClientAvatar>) */
.cav { position: relative; display: inline-flex; flex: none; }
.cav-d { position: absolute; right: -4px; bottom: -3px; display: grid; place-items: center; min-width: 11px; height: 11px; padding: 0 2px; border-radius: 3px; font-size: 7.5px; font-weight: 600; font-style: normal; line-height: 1; letter-spacing: 0; color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cav[data-size='lg'] .cav-d { min-width: 14px; height: 14px; font-size: 9px; right: -3px; bottom: -2px; }

/* ─────────────────────────────── Santé : score, échelle neutre, seul le repère est coloré (<Health>, <HealthScale>) */
.hscore { margin-left: 2px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.hscale { width: 100%; padding-top: 6px; }
.hscale-track { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line-faint); }
.hscale-track i { position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); height: 100%; border-radius: 4px; opacity: 0.55; background: var(--chart-3); }
.hscale-track em { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.hscale-track em.t1, .hscale-ticks .t1 { left: var(--t1, 50%); }
.hscale-track em.t2, .hscale-ticks .t2 { left: var(--t2, 75%); }
.hscale-mark { position: absolute; top: -5px; bottom: -5px; left: var(--v, 0%); width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink-4); box-shadow: 0 0 0 2px var(--surface); }
.hscale-mark[data-tone='ok'] { background: var(--ok); }
.hscale-mark[data-tone='warn'] { background: var(--warn); }
.hscale-mark[data-tone='fail'] { background: var(--fail); }
.hscale-ticks { position: relative; height: 16px; margin-top: 6px; }
.hscale-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hscale-ticks .t0 { left: 0; transform: none; }
.hscale-ticks .t3 { left: 100%; transform: translateX(-100%); }

/* ─────────────────────────────── Anneau de progression (<ProgressRing>) : encre, temps écoulé en arc fin */
.pring { --ring: 88px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--ring); height: var(--ring); }
.pring[data-size='40'] { --ring: 40px; } .pring[data-size='56'] { --ring: 56px; } .pring[data-size='64'] { --ring: 64px; }
.pring[data-size='88'] { --ring: 88px; } .pring[data-size='112'] { --ring: 112px; }
.pring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pring circle { fill: none; }
.pring-track { stroke: var(--line-strong); stroke-width: 7; }
.pring-value { stroke: var(--ink); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease); }
.pring-time-track { stroke: var(--line-faint); stroke-width: 2; }
.pring-time { stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.pring-label { display: grid; justify-items: center; line-height: 1.1; }
.pring-label b { font-size: calc(var(--ring) * 0.23); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pring-label span { font-size: 10.5px; color: var(--ink-3); }
.pring[data-size='40'] .pring-label span, .pring[data-size='56'] .pring-label span { display: none; }

/* ─────────────────────────────── Frise d'étapes (<StageTrack>) : icône d'état, trait plein jusqu'à l'étape atteinte,
   pointillé ensuite, étiquette et date dessous, repère « Today ». Verticale sous 520 px. */
.stages { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 22px 0 0; list-style: none; }
.stage { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; min-width: 0; padding: 0 4px; text-align: center; }
.stage > .sicon { width: 14px; height: 14px; margin-bottom: 6px; position: relative; z-index: 1; }
.stage + .stage::before { content: ''; position: absolute; top: 6.25px; left: calc(-50% + 13px); right: calc(50% + 13px); border-top: 1.5px dashed var(--line-strong); }
.stage[data-reached='true']::before { border-top-style: solid; border-top-color: var(--ink-4); }
.stage > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 500; color: var(--ink); }
.stage[data-state='waiting'] > b, .stage[data-state='queued'] > b { color: var(--ink-2); }
.stage-meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stage-today { position: absolute; top: 0; left: calc((var(--at, 0) + 0.5) / var(--n, 1) * 100%); height: 34px; width: 0; border-left: 1.5px solid var(--ink); pointer-events: none; }
.stage-today b { position: absolute; top: -2px; left: 0; transform: translateX(-50%); padding: 1px 5px; border-radius: 4px; font-size: 10.5px; font-weight: 560; line-height: 1.4; color: var(--on-ink); background: var(--ink); white-space: nowrap; }

/* ─────────────────────────────── Page introuvable (<NotFound>) : dans la coque, centrée */
.empty[data-center] { justify-items: center; text-align: center; }
.empty[data-center] .actions { justify-content: center; }

/* ─────────────────────────────── Pages publiques (démo, page client, artefact) : une largeur, un titre, une barre */
.page { width: 100%; max-width: calc(var(--page-max) + 48px); margin: 0 auto; padding: 0 24px; }
.t-display { font-size: 56px; line-height: 1.04; font-weight: 600; letter-spacing: -0.035em; text-wrap: balance; }
.pubbar { position: sticky; top: 0; z-index: var(--z-top); border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--canvas) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pubbar-in { display: flex; align-items: center; gap: 12px; height: 52px; width: 100%; max-width: calc(var(--page-max) + 48px); margin: 0 auto; padding: 0 24px; }
.pubbar .appmark { font-size: 14px; }
.pubbar .apptile { --t: 24px; }
.pub-by { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.pub-by svg, .pub-by .relay-mark { width: 16px; height: 13px; color: var(--ink-3); }
.pubbar nav { display: flex; align-items: center; gap: 2px; }
.pubbar nav a { height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease); }
.pubbar nav a:hover { background: var(--hover); color: var(--ink); }
.live-pill { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); white-space: nowrap; }
.live-pill .dot { width: 6px; height: 6px; }

/* ─────────────────────────────── Coque native (native/shell.js) : dialogues <dialog>, toasts */
dialog.dlg { margin: 0; padding: 0; border: 0; inset: auto; left: 50%; color: var(--ink); max-width: none; max-height: none; transform: translateX(-50%); }
dialog.dlg:not([open]) { display: none; }
dialog.dlg::backdrop { background: var(--scrim); }
dialog.pal { top: 12vh; }
.pal ul[cmdk-list] { margin: 0; list-style: none; }
.pal [cmdk-item][hidden], .pal [cmdk-group-heading][hidden], .pal [cmdk-empty][hidden] { display: none; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: 8px; pointer-events: none; }
.toasts .toast { animation: toast-in var(--d-2) var(--ease); }
.toast[data-type='success'] > svg { color: var(--ok); }
.toast[data-type='error'] > svg { color: var(--fail); }
.toast > svg { width: 14px; height: 14px; flex: none; color: var(--ink-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ─────────────────────────────── Responsive */
.only-mobile { display: none !important; }
@media (max-width: 1180px) {
  .aside { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .c-8, .c-7, .c-6, .c-5, .c-4 { grid-column: span 12; }
}
@media (max-width: 860px) {
  :root { --row-h: 44px; }
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .side { min-height: 100vh; }
  .shell[data-view='detail'] .side { display: none; }
  .shell[data-view='overview'] .side { min-height: 0; }
  html[data-side] .shell { grid-template-columns: 1fr; }
  html[data-side] .shell .side { opacity: 1; visibility: visible; }
  html[data-side] .shell .main { margin: 0; }
  .side { width: auto; }
  .side-close, .side-open, html[data-side='collapsed'] .side-open { display: none !important; }
  .tabbar { position: sticky; top: 44px; z-index: calc(var(--z-top) - 1); background: color-mix(in oklab, var(--panel) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 0 8px; }
  .aside { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 14px; }
  .kpi .spark-line { display: none; }
  .acts a { grid-template-columns: 40px minmax(0, 1fr) 52px; }
  .acts a > .sicon { display: none; }
  .dcard { padding: 14px 14px 16px; }
  .chart-x span:nth-child(even) { visibility: hidden; }
  .side-scroll { overflow: visible; }
  .side-foot { position: sticky; bottom: 0; background: var(--sidebar); border-top: 1px solid var(--line); }
  .main { margin: 0; border-radius: 0; box-shadow: none; overflow: visible; min-height: 100vh; }
  .main-scroll { overflow: visible; }
  .top { position: sticky; top: 0; background: color-mix(in oklab, var(--panel) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .vrow { gap: 12px; }
  .mini { width: 48px; height: 27px; border-radius: 4px; }
  .vrow-title { font-size: 14px; }
  .only-mobile { display: inline-flex !important; }
  .no-mobile { display: none !important; }
  .top { padding: 0 8px 0 8px; }
  .crumb .back { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 8px 0 4px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; }
  .crumb .back svg { width: 16px; height: 16px; color: currentColor; }
  .crumb .root, .crumb .root + svg { display: none; }
  .content { padding: 20px 16px 72px; }
  .crew-line { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px; }
}
@media (max-width: 520px) {
  .top-actions .btn span { display: none; }
  .stages { grid-auto-flow: row; grid-auto-rows: auto; gap: 14px; padding: 0; }
  .stage { grid-template-columns: 14px minmax(0, 1fr); justify-items: start; column-gap: 12px; row-gap: 1px; padding: 0; text-align: left; }
  .stage > .sicon { grid-row: span 2; margin: 1px 0 0; }
  .stage + .stage::before { display: none; }
  .stage:has(+ .stage)::after { content: ''; position: absolute; left: 6.25px; top: 19px; bottom: -11px; border-left: 1.5px dashed var(--line-strong); }
  .stage:has(+ .stage[data-reached='true'])::after { border-left-style: solid; border-left-color: var(--ink-4); }
  .stage-today { display: none; }
  .t-display { font-size: 38px; }
  .page, .pubbar-in { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .agent-ring .arc { stroke-dasharray: 22 78; }
}

/* ─────────────────────────────── Liste qui s'estompe tant qu'il reste du contenu (<FadeList>) */
.fade-list[data-more] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
