@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/site/assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --brand: #4f46e5; --brand-soft: #eef2ff; --hot: #f97316; --amber: #f59e0b; --ok: #16a34a; --late: #dc2626;
  --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --card: rgba(255, 255, 255, .94); --bg: #f4f5f8;
  --shadow: 0 6px 18px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: "IBM Plex Sans", Inter, system-ui, sans-serif; color: var(--text); background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
code { font-size: 11.5px; background: #f1f5f9; padding: 1px 5px; border-radius: 5px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
/* Bulles des pièces et étiquettes de la scène : cliquables (ouvrent les tâches de la pièce), le reste laisse passer le clic */
#labels [data-room] { pointer-events: auto; cursor: pointer; }
#labels [data-room]:focus-visible { outline: 2px solid var(--accent, #4f46e5); outline-offset: 2px; }

/* Barre du haut */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 18px 0 22px;
  background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); z-index: 10; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.logo i { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 15px; }
.logo small { font-weight: 500; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; margin-left: 14px; }
.tab { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { background: #f1f5f9; color: var(--text); }
.tab.on { background: var(--brand-soft); color: var(--brand); }
.tab .count { background: #e2e8f0; color: var(--text); border-radius: 9px; padding: 0 7px; font-size: 11px; }
.tab .count.hot { background: var(--hot); color: #fff; }
.status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.status.live .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.status.live { color: var(--text); }
.status.error .dot { background: var(--late); }
.status.busy .dot { background: var(--amber); }
.status.locked { cursor: default; } /* connexion réglée : le badge n'ouvre plus les paramètres */
.bell { position: relative; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 15px; }
.bell b { position: absolute; top: -5px; right: -5px; background: var(--hot); color: #fff; font-size: 10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; }

.me-wrap { position: relative; }
.me { display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; padding: 4px 8px 4px 4px; border-radius: 11px; }
.me:hover, .me[aria-expanded="true"] { background: #f1f5f9; border-color: var(--line); }
.me-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.me-text b { font-size: 13px; }
.me-text small { font-size: 11px; color: var(--muted); font-weight: 500; }
.caret { color: var(--muted); font-size: 11px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; background: #0ea5e9; flex: none; }
.avatar.big { width: 40px; height: 40px; font-size: 14px; }
.avatar.small { width: 26px; height: 26px; font-size: 10.5px; }

.menu { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .18); padding: 8px; z-index: 20; }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b { display: block; font-size: 14px; }
.menu-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
.menu-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px 4px; }
.menu-profiles { display: flex; flex-direction: column; }
.profile { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 9px; font-size: 13px; }
.profile:hover { background: #f8fafc; }
.profile.on { background: var(--brand-soft); }
.profile small { display: block; color: var(--muted); font-size: 11.5px; }
.profile .tick { margin-left: auto; color: var(--brand); font-weight: 700; }
.profile .n { margin-left: auto; background: var(--hot); color: #fff; border-radius: 9px; font-size: 10.5px; font-weight: 700; padding: 0 6px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-item { display: flex; gap: 10px; width: 100%; text-align: left; align-items: flex-start; border: 0; background: none; padding: 9px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.menu-item:hover { background: #f8fafc; }
.menu-item i { font-style: normal; width: 22px; height: 22px; border-radius: 7px; background: #f1f5f9; display: grid; place-items: center; font-size: 12px; flex: none; }
.menu-item small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* Indicateurs, activité, légende */
.kpis { position: fixed; top: 74px; left: 22px; display: grid; grid-template-columns: repeat(2, 168px); gap: 10px; z-index: 7; } /* au-dessus du voile : on passe d'un indicateur à l'autre, panneau ouvert ; les panneaux (plus loin dans la page) restent devant */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow); }
.kpi span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font-size: 22px; margin-top: 3px; letter-spacing: -.01em; }
.kpi em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); }
button.kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
button.kpi:hover { border-color: #c7d2fe; box-shadow: 0 8px 20px rgba(79, 70, 229, .14); transform: translateY(-1px); }
button.kpi:focus-visible { outline: 2px solid var(--brand, #4f46e5); outline-offset: 2px; }
button.kpi.on { border-color: var(--brand, #4f46e5); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
button.kpi:disabled { cursor: default; transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.task.static { cursor: default; }
.task.static:hover { border-color: var(--line); box-shadow: none; }
.list-room { margin: 6px 0 -4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.list-room i { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #eef2ff; color: #4f46e5; font-size: 10px; }
.feed { position: fixed; left: 22px; bottom: 22px; width: 330px; max-height: 40vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; z-index: 4; box-shadow: var(--shadow); }
.feed h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.feed .empty { margin: 4px 0; color: var(--muted); font-size: 12.5px; }
.ev { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid #f1f5f9; font-size: 12.5px; line-height: 1.35; animation: evIn .4s ease-out; }
.ev:first-child { border-top: 0; }
.ev i { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 12px; background: #f1f5f9; }
.ev small { display: block; color: var(--muted); }
@keyframes evIn { from { opacity: 0; transform: translateY(-4px); } }
.legend { position: fixed; right: 22px; bottom: 22px; display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; font-size: 12px; color: var(--muted); z-index: 4; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.zoom { position: fixed; right: 22px; bottom: 66px; display: flex; flex-direction: column; gap: 4px; z-index: 4; }
.zoom button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); font-size: 16px; font-weight: 600; box-shadow: var(--shadow); }
.zoom button:hover { background: #fff; }

/* Étiquettes posées sur la scène */
.room { position: absolute; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 7px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(15, 23, 42, .10); font-size: 12.5px; font-weight: 700; white-space: nowrap; transition: transform .15s; }
.room i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; background: var(--brand); }
.room em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.room b.badge { background: var(--hot); color: #fff; border-radius: 9px; padding: 1px 7px; font-size: 11px; }
.room.alert { border-color: #fecaca; }
.room.alert b.badge { background: var(--late); }
.room.mine { border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(79, 70, 229, .15), 0 6px 16px rgba(15, 23, 42, .10); }
.room.hover { transform: translate(-50%, -100%) scale(1.06); }
/* Pièces où la personne choisie a des tâches : étiquette indigo pleine, avec un halo qui respire */
.room.for-me { background: var(--brand); border-color: var(--brand); color: #fff; z-index: 3; animation: for-me 2.4s ease-in-out infinite; }
.room.for-me i { background: #fff; color: var(--brand); }
.room.for-me em { color: #e0e7ff; }
.room.for-me b.badge.you { background: #fff; color: var(--brand); }
.room.for-me b.badge:not(.you) { background: rgba(255, 255, 255, .22); }
@keyframes for-me { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45), 0 6px 16px rgba(15, 23, 42, .18); } 50% { box-shadow: 0 0 0 7px rgba(79, 70, 229, 0), 0 6px 16px rgba(15, 23, 42, .18); } }
@media (prefers-reduced-motion: reduce) { .room.for-me { animation: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, .3), 0 6px 16px rgba(15, 23, 42, .18); } }
.tag { position: absolute; transform: translate(-50%, -100%); background: #0f172a; color: #fff; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 7px; white-space: nowrap; box-shadow: 0 4px 10px rgba(0, 0, 0, .18); }
.tag::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-top-color: #0f172a; border-bottom: 0; }
.tag.hot { background: var(--hot); } .tag.hot::after { border-top-color: var(--hot); }
.tag.ok { background: var(--ok); } .tag.ok::after { border-top-color: var(--ok); }
.tag.late { background: var(--late); } .tag.late::after { border-top-color: var(--late); }

/* Panneaux */
.shade { position: fixed; inset: 58px 0 0 0; background: linear-gradient(90deg, rgba(15, 23, 42, 0) 35%, rgba(15, 23, 42, .2)); z-index: 6; }
.panel { position: fixed; top: 74px; right: 22px; bottom: 22px; width: 440px; max-width: calc(100vw - 44px); background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .18); z-index: 7; display: flex; flex-direction: column; overflow: hidden; animation: panelIn .22s ease-out; }
.panel.wide { width: min(760px, calc(100vw - 44px)); }
@keyframes panelIn { from { opacity: 0; transform: translateX(16px); } }
.panel header, dialog header { position: relative; padding: 18px 52px 14px 22px; border-bottom: 1px solid var(--line); }
.crumb { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.crumb i { width: 18px; height: 18px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 10px; }
.panel h2, dialog h2 { margin: 6px 0 2px; font-size: 20px; letter-spacing: -.01em; }
.panel header p, dialog header p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
/* Formulaire K2 dans le panneau : pas de pied (les boutons sont ceux du formulaire) ; « Open in K2 » dans l'en-tête */
.head-k2 { position: absolute; top: 14px; right: 54px; height: 32px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.head-k2:hover { color: var(--brand); border-color: #c7d2fe; }
.panel header.with-k2 { padding-right: 160px; }
.close:hover { color: var(--text); background: #f8fafc; }
.panel .body, dialog .body { padding: 16px 22px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.scroll { overflow: auto; }
.panel footer, dialog footer { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.panel footer small { margin-right: auto; color: var(--muted); font-size: 11.5px; }
.actions { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .act-as { color: var(--muted); font-size: 12px; font-weight: 600; }

.frame-wrap { position: relative; flex: 1; background: #f8fafc; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.frame-loading { position: absolute; inset: 0; display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #f8fafc; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c7d2fe; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.task { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.task:hover { border-color: #c7d2fe; box-shadow: 0 6px 16px rgba(79, 70, 229, .10); }
.task .ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff7ed; font-size: 15px; }
.task.late .ico { background: #fef2f2; }
.task b { display: block; font-size: 14px; }
.task small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.task .acts { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.task .acts span { font-size: 11px; font-weight: 600; background: #f1f5f9; border-radius: 6px; padding: 2px 7px; }
.task .age { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.task.late .age { color: var(--late); }
.empty-state { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 10px; line-height: 1.5; }
.empty-state b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; font-size: 12.5px; line-height: 1.45; }
.notice.info { background: var(--brand-soft); border-color: #c7d2fe; }
.notice.err { background: #fef2f2; border-color: #fecaca; }
.sum { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.sum div span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sum div b { font-size: 14px; }
.sum .big b { font-size: 22px; }
/* Tâche d'une autre personne : KPI de la pièce, tâches en cours, dernières décisions (lecture seule) */
.ov-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ov-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.ov-kpi span { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ov-kpi b { display: block; font-size: 22px; margin-top: 2px; letter-spacing: -.01em; }
.ov-kpi em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ov-kpi.ok b { color: var(--ok); }
.ov-kpi.no b { color: var(--late); }
.ov-h { margin-top: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ov-list { display: flex; flex-direction: column; gap: 6px; }
.ov-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font: inherit; color: inherit; cursor: pointer; }
.ov-row:hover { border-color: #c7d2fe; }
.ov-row.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); cursor: default; }
.ov-row.static { cursor: default; }
.ov-row.static:hover { border-color: var(--line); }
.ov-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; background: #f1f5f9; display: grid; place-items: center; font-size: 13px; }
.ov-ico.ok { background: #dcfce7; color: var(--ok); font-weight: 700; }
.ov-ico.no { background: #fee2e2; color: var(--late); font-weight: 700; }
.ov-txt { flex: 1; min-width: 0; }
.ov-txt b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-txt small { display: block; font-size: 11.5px; color: var(--muted); }
.ov-age { flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ov-empty { margin: 0; font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .ov-kpis { grid-template-columns: repeat(2, 1fr); } }

.btn { white-space: nowrap; height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; }
.btn:hover { background: #f8fafc; }
.btn.small { height: 38px; padding: 0 12px; font-size: 12.5px; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 16px rgba(79, 70, 229, .3); }
.btn.primary:hover { background: #4338ca; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); box-shadow: 0 6px 16px rgba(22, 163, 74, .28); }
.btn.no { color: var(--late); border-color: #fecaca; }
.btn[disabled] { opacity: .55; cursor: default; }

/* Paramètres */
dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(15, 23, 42, .3); color: var(--text); }
dialog::backdrop { background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field label s { text-decoration: none; color: var(--late); }
.field input[type="url"], .field input[type="text"], .field input[type="password"], .people input { width: 100%; height: 38px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 0 12px; font: inherit; font-size: 13.5px; background: #fff; color: var(--text); }
.field input:focus, .people input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.with-btn { display: flex; gap: 8px; }
.check { display: flex !important; gap: 8px; align-items: center; font-weight: 500 !important; margin-top: 8px; font-size: 12.5px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.people { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
.people legend { font-size: 12.5px; font-weight: 600; padding: 0 6px; }
.person-row { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.person-row span { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; }
.person-row span small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.test-result { border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.test-result.ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.test-result.err { background: #fef2f2; border: 1px solid #fecaca; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; border-radius: 12px; padding: 11px 16px; font-size: 13.5px; font-weight: 600;
  display: flex; gap: 10px; align-items: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); z-index: 30; animation: toastIn .25s ease-out; max-width: calc(100vw - 40px); }
.toast i { width: 24px; height: 24px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; font-style: normal; flex: none; }
.toast.err i { background: var(--late); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(4, 1fr); left: 12px; right: 12px; }
  .kpi b { font-size: 18px; }
  .feed { display: none; }
  .legend { display: none; }
  .me-text { display: none; }
  .logo small { display: none; }
}
@media (max-width: 720px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .logo { font-size: 0; gap: 0; }
  .tabs { margin-left: 4px; }
  .tabs .tab { padding: 7px 9px; }
  .tabs .tab[data-view="company"], .tab-text { display: none; }
  .status { padding: 0 9px; }
  .status #statusText { display: none; }
  .menu { position: fixed; top: 64px; right: 8px; left: 8px; width: auto; }
  .kpis { display: none; }
  .zoom { bottom: 22px; }
  .row2 { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: 1fr; }
  .panel, .panel.wide { right: 8px; left: 8px; width: auto; max-width: none; top: 66px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Démo usine : étiquettes de postes, type de demande, état de la ligne */
.station { position: absolute; transform: translate(-50%, -100%); background: rgba(255, 255, 255, .92); border: 1px solid var(--line); color: var(--text-2, #334155); font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.tag.line-status { font-size: 12px; padding: 6px 11px; border-radius: 9px; }
.kind { display: inline-block; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--k); border-radius: 5px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.task.type { border-left: 4px solid var(--k); }
.task.type .ico { background: color-mix(in srgb, var(--k) 14%, #fff); }
.legend span.dot::before { border-radius: 50%; }
@media (max-width: 1100px) { .station { display: none; } }
@media (max-width: 720px) { .tag.mtag { display: none; } #labels .room { font-size: 11px; padding: 4px 8px 4px 5px; } #labels .room i { width: 18px; height: 18px; } .tag.line-status { font-size: 11px; } }

/* ------------------------------------------------------------------ Pièces jointes et aperçu (fenêtre modale) */
.hv-att { margin-top: 12px; display: grid; gap: 8px; }
.hv-att-h { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hv-att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.hv-att-chip { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.hv-att-chip:hover { border-color: #c7d2fe; box-shadow: 0 6px 16px rgba(79, 70, 229, .12); transform: translateY(-1px); }
.hv-att-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hv-att-chip i, .pv-icon, .pv-chip i, .pv-big { flex: none; display: grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; background: #64748b; letter-spacing: .02em; }
.hv-att-chip i { width: 34px; height: 40px; border-radius: 7px; font-size: 10px; }
.hv-att-chip span { display: grid; min-width: 0; }
.hv-att-chip b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-att-chip small { font-size: 11.5px; color: var(--muted); }
.k-pdf > i, i.k-pdf, .pv-icon.k-pdf { background: #dc2626; }
.k-image > i, i.k-image, .pv-icon.k-image { background: #0891b2; }
.k-docx > i, i.k-docx, .pv-icon.k-docx { background: #2563eb; }
.k-xlsx > i, i.k-xlsx, .pv-icon.k-xlsx, .k-csv > i, i.k-csv, .pv-icon.k-csv { background: #16a34a; }
.k-pptx > i, i.k-pptx, .pv-icon.k-pptx { background: #ea580c; }
.k-video > i, i.k-video, .pv-icon.k-video, .k-audio > i, i.k-audio, .pv-icon.k-audio { background: #7c3aed; }
.k-link > i, i.k-link, .pv-icon.k-link { background: var(--brand-soft); color: var(--brand); font-size: 15px; }

html.pv-open, html.pv-open body { overflow: hidden; }
.pv { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 3vh 3vw; opacity: 0; transition: opacity .18s ease; }
.pv.in { opacity: 1; }
.pv-shade { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pv-box { position: relative; width: min(1180px, 100%); height: min(92vh, 960px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35); overflow: hidden; transform: translateY(10px) scale(.985); transition: transform .2s ease; outline: none; }
.pv.in .pv-box { transform: none; }
.pv-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.pv-icon { width: 36px; height: 36px; border-radius: 9px; font-size: 10.5px; }
.pv-name { display: grid; min-width: 0; flex: 1; }
.pv-name b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-name small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-tools { display: flex; align-items: center; gap: 6px; }
.pv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pv-btn:hover { background: var(--bg); }
.pv-btn[hidden] { display: none; }
.pv-btn:focus-visible, .pv-nav:focus-visible, .pv-chip:focus-visible, .pv-cta:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pv-x { border-color: transparent; font-size: 15px; }
.pv-stage { position: relative; flex: 1; min-height: 0; display: flex; background: #eef0f4; }
.pv-body { flex: 1; min-width: 0; overflow: auto; display: flex; }
.pv-nav { position: absolute; top: 50%; z-index: 2; width: 42px; height: 42px; margin-top: -21px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(15, 23, 42, .18); }
.pv-prev { left: 12px; } .pv-next { right: 12px; }
.pv.single .pv-nav, .pv.single .pv-strip { display: none; }
.pv-strip { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.pv-chip { display: flex; align-items: center; gap: 8px; flex: none; max-width: 230px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 12.5px; cursor: pointer; }
.pv-chip i { width: 26px; height: 30px; border-radius: 6px; font-size: 8.5px; }
.pv-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-chip.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pv-wait { margin: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.pv-spin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c7d2fe; border-top-color: var(--brand); animation: spin .8s linear infinite; }
.pv-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.pv-body.k-pdf { padding: 0; }
.pv-imgwrap { flex: 1; display: grid; place-items: center; overflow: auto; padding: 24px; background: repeating-conic-gradient(#e9ecf1 0% 25%, #f5f6f8 0% 50%) 50% / 22px 22px; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); transform-origin: center; transition: transform .15s ease; cursor: zoom-in; }
.pv-imgwrap.zoomed { place-items: start; }
.pv-imgwrap.zoomed .pv-img { max-width: none; max-height: none; cursor: zoom-out; transform-origin: top left; }
.pv-media { margin: auto; max-width: 100%; max-height: 100%; background: #000; }
.pv-text { margin: 0; flex: 1; padding: 22px 26px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; background: #fff; color: var(--text); }
.pv-table { flex: 1; overflow: auto; background: #fff; }
.pv-table table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.pv-table th, .pv-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.pv-table thead th { position: sticky; top: 0; background: #f8fafc; font-weight: 600; }
.pv-table tbody tr:nth-child(even) td { background: #fafbfc; }
.pv-body.k-xlsx { flex-direction: column; }
.pv-tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: #eef0f4; flex: none; overflow-x: auto; }
.pv-tabs button { font: inherit; font-size: 12.5px; padding: 6px 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #e2e8f0; cursor: pointer; }
.pv-tabs button.on { background: #fff; font-weight: 600; color: #15803d; }
.pv-sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; background: #fff; }
.pv-sheet .pv-table td:first-child { background: #f8fafc; }
.pv-page { flex: 1; padding: 28px 16px; overflow: auto; }
.pv-doc { max-width: 820px; margin: 0 auto; background: #fff; padding: 56px 64px; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); font: 15px/1.6 "Segoe UI", "IBM Plex Sans", system-ui, sans-serif; color: #1f2937; }
.pv-doc h1 { font-size: 26px; margin: 0 0 14px; color: #111827; } .pv-doc h2 { font-size: 20px; margin: 22px 0 8px; color: #1e3a8a; } .pv-doc h3, .pv-doc h4 { font-size: 16px; margin: 18px 0 6px; }
.pv-doc p { margin: 0 0 10px; } .pv-doc p.c { text-align: center; } .pv-doc p.r { text-align: right; }
.pv-doc ul { margin: 0 0 10px 20px; padding: 0; }
.pv-doc table { border-collapse: collapse; margin: 8px 0 14px; width: 100%; font-size: 14px; }
.pv-doc td { border: 1px solid #d1d5db; padding: 6px 9px; vertical-align: top; } .pv-doc td p { margin: 0; }
.pv-doc tr:first-child td { background: #f1f5f9; }
.pv-docimg { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.pv-hl { color: #2563eb; text-decoration: underline; }
.pv-slides { flex: 1; overflow: auto; padding: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-content: start; }
.pv-slide { position: relative; aspect-ratio: 16 / 9; background: #fff; border-radius: 10px; box-shadow: 0 8px 22px rgba(15, 23, 42, .12); padding: 18px 20px; overflow: hidden; border-top: 5px solid #ea580c; }
.pv-slide h3 { margin: 0 0 8px; font-size: 16px; } .pv-slide ul { margin: 0; padding-left: 18px; font-size: 13px; color: #334155; }
.pv-slide-n { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--muted); }
.pv-card { margin: auto; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px; max-width: 460px; }
.pv-big { width: 74px; height: 88px; border-radius: 12px; font-size: 16px; }
.pv-card b { font-size: 16px; word-break: break-word; } .pv-card p { margin: 0; color: var(--muted); font-size: 14px; }
.pv-card-a { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.pv-cta { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pv-cta.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.pv-cta.small { height: 30px; padding: 0 12px; font-size: 12.5px; }
.pv-body.k-link { flex-direction: column; }
.pv-linkbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.pv-url { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 6px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-linkframe { position: relative; flex: 1; display: flex; }
.pv-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(15, 23, 42, .78); color: #fff; font-size: 12px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.pv-muted { color: var(--muted); font-size: 13px; padding: 10px 14px; margin: 0; }
@media (max-width: 720px) {
  .pv { padding: 0; }
  .pv-box { width: 100%; height: 100%; border-radius: 0; }
  .pv-wide span { display: none; }
  .pv-count { display: none; }
  .pv-doc { padding: 26px 20px; }
  .pv-nav { width: 36px; height: 36px; margin-top: -18px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .pv, .pv-box, .hv-att-chip { transition: none; } }

/* Helvia Studio : bandeau d'aperçu du brouillon */
.preview-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 12px; background: #0f172a; color: #e2e8f0; font-size: 13px; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); }
.preview-bar b { color: #fff; }
.preview-bar a { color: #c7d2fe; text-decoration: none; padding: 5px 10px; border-radius: 8px; font-weight: 600; }
.preview-bar a.on { background: #4f46e5; color: #fff; }
.preview-bar a:last-child { color: #94a3b8; }

/* Application dans un formulaire K2 : la personne est celle connectée à K2 (pas de choix), pas de réglages */
.embed #profiles, .embed .menu-label, .embed #openSettings, .embed #profiles + .menu-sep { display: none !important; }
.embed .status { cursor: default; }

/* Aperçu du Studio : le plateau seul (étiquettes des pièces comprises), sans interface autour */
.board-only .topbar, .board-only .kpis, .board-only .feed, .board-only .legend, .board-only .zoom, .board-only .shade,
.board-only .panel, .board-only .toast, .board-only .preview-bar, .board-only dialog { display: none !important; }
.board-only #labels .room { pointer-events: none; }
