/* OKSeeSee — feuille de style
   Direction « salle d'étalonnage » : chrome quasi noir, filets fins, Geist pour l'interface,
   Geist Mono pour tout ce qui se mesure, couleur réservée aux types de données. */

/* ================================================================= variables */
:root {
  --bg: #141414;              /* canvas */
  --chrome: #0f0f10;          /* header, barres latérales */
  --panel: #151516;           /* librairie */
  --node: #1c1c1d;
  --node-border: #2b2b2d;
  --node-border-hover: #3a3a3d;
  --hair: #262628;            /* filets internes */
  --field: #141415;
  --field-border: #2f2f31;
  --raised: #232325;          /* boutons neutres */
  --raised-border: #333335;
  --grid: #2a2a2c;
  /* grille du canvas : de tout petits « + » (5 px, trait d'1 px) tous les 24 px */
  --grid-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M12 9.5v5M9.5 12h5' stroke='%23313134' stroke-width='1' fill='none' shape-rendering='crispEdges'/%3E%3C/svg%3E");
  --text: #ededed;
  --text-2: #a6a6a6;
  --muted: #8f8f8f;
  --accent: #f2f0ea;          /* ivoire : action principale, états actifs */
  --accent-ink: #141414;
  --text-port: #c58bff;
  --image-port: #5fd39a;
  --video-port: #ff6fa8;
  --audio-port: #5ec8f2;
  --danger: #ff6b6b;
  --warn: #f4b942;
  --ok: #5fd39a;
  --radius: 14px;
  --sans: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --shadow-node: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6a6a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --hatch: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 10px);
  font-family: var(--sans);
}

/* ================================================================= base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overflow: hidden; font-size: 13px; -webkit-font-smoothing: antialiased; }
svg.ico { display: block; flex: none; }

button { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--raised-border); border-radius: 10px; padding: 6px 11px; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
button:hover { background: #2c2c2e; border-color: #444447; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
button.primary:hover { background: #fffdf7; border-color: #fffdf7; }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: #1a1a1b; border-color: var(--node-border); color: var(--text); }
button.danger { background: #2a1718; border-color: #5a2c2e; color: #ffb4b4; }
button.danger:hover { background: #3a1e20; border-color: #7a3a3d; }
button:disabled { opacity: .45; cursor: not-allowed; }

select, input[type=number], input[type=text], input[type=search], input[type=email], textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--field-border); border-radius: 8px; padding: 6px 9px; outline: none; }
select { appearance: none; -webkit-appearance: none; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; padding-right: 26px; }
select:hover, input:hover, textarea:hover { border-color: #3d3d40; }
select:focus, input:focus, textarea:focus { border-color: #6a6a6e; }
input[type=checkbox] { accent-color: var(--accent); }

/* libellé technique : capitales mono interlettrées */
.k, .sb-title, .node .head .code, .port-row .label, .params label > span, .taskfield > span, .results .rh, .lib-day .stat, .vprompt .lbl { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }

/* ================================================================= header */
#topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: var(--chrome); border-bottom: 1px solid #242426; white-space: nowrap; overflow: hidden; }
.brand { display: flex; align-items: baseline; gap: 8px; }
button.brand { display: flex; align-items: center; height: 36px; padding: 0 8px; margin-left: -8px; background: transparent; border-color: transparent; border-radius: 10px; color: var(--text); }
button.brand:hover, button.brand:active { background: transparent; border-color: transparent; }
button.brand img { display: block; height: 26px; width: auto; opacity: .92; transition: opacity .15s; } button.brand:hover img { opacity: 1; }
.brand b { font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.brand span { font-size: 11.5px; font-weight: 400; letter-spacing: .28em; text-transform: uppercase; color: #b4b4b4; }
.topsep { width: 1px; height: 22px; background: var(--grid); flex: none; }
.spacer { flex: 1; }
#pactions { display: flex; align-items: center; gap: 6px; }
#pactions:empty { display: none; }
#pactions .invite { height: 34px; padding: 0 12px; background: transparent; border-color: var(--node-border); color: #d6d6d6; font-size: 12.5px; font-weight: 500; }
#pactions .invite:hover { border-color: var(--node-border-hover); background: #1a1a1b; }
#pactions .icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); }
#pactions .icon:hover, #pactions .icon.open { background: #1a1a1b; border-color: var(--node-border); color: var(--text); }

/* menu déroulant (sélecteur de projet, actions du projet, cartes de l'accueil) */
.dropmenu { position: fixed; z-index: 75; min-width: 232px; max-width: 340px; max-height: calc(100vh - 80px); overflow: auto; padding: 5px; background: #1c1c1d; border: 1px solid #333335; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05); }
.dropmenu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; background: transparent; border: none; border-radius: 8px; font-size: 12.5px; color: var(--text); text-align: left; }
.dropmenu button:hover { background: #2a2a2c; }
.dropmenu button svg, .dropmenu button .noico { flex: none; width: 14px; color: var(--text-2); }
.dropmenu button .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropmenu button .hint { flex: none; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.dropmenu button.danger { color: #ffb4b4; }
.dropmenu button.danger svg { color: #ff8f8f; }
.dropmenu button.danger:hover { background: #3a1e20; }
.dropmenu .sep { height: 1px; margin: 5px 6px; background: var(--hair); }
.dropmenu .mhead { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 9px; }
.dropmenu .mhead b { font-size: 13px; font-weight: 600; }
.dropmenu .mhead span { font-size: 11px; color: var(--muted); white-space: normal; line-height: 1.4; }
.dropmenu .mtitle { padding: 7px 10px 4px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* projet : fil d'Ariane « Projets / Nom du projet », puis dépenses */
#project { display: flex; align-items: center; gap: 4px; min-width: 0; }
#project .crumb { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: transparent; border-color: transparent; color: var(--text-2); font-size: 13px; border-radius: 10px; }
#project .crumb:hover { background: #1a1a1b; color: var(--text); }
#project .crumb.here { color: var(--text); font-weight: 600; cursor: default; }
#project .crumb.here:hover { background: transparent; }
#project .crumb-sep { color: #4a4a4e; font-size: 15px; font-weight: 300; }
#project .pname { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 300px; height: 34px; padding: 0 10px; margin-right: 6px; background: transparent; border-color: transparent; color: var(--text); font-size: 13px; font-weight: 600; border-radius: 10px; }
#project .pname span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#project .pname svg { color: var(--muted); }
#project .pname:hover, #project .pname.open { background: #1a1a1b; border-color: var(--node-border); }

/* dépenses du projet */
.pspend { position: relative; display: flex; align-items: center; gap: 7px; height: 34px; line-height: 1; padding: 0 12px; overflow: hidden; background: #1a1a1b; border: 1px solid var(--node-border); border-radius: 10px; font-family: var(--mono); font-size: 12px; color: var(--text); }
.pspend:hover { background: #1f1f21; border-color: var(--node-border-hover); }
.pspend svg { color: var(--muted); }
.pspend .k, .pspend b, .pspend .of { position: relative; top: .5px; } /* la chasse fixe s'aligne optiquement un demi-pixel plus bas */
.pspend .k { font-size: 10px; color: var(--muted); }
.pspend b { font-weight: 500; }
.pspend .of { color: var(--text-2); }
.pspend .pend { font-family: var(--sans); font-size: 10.5px; color: var(--text-2); }
.pspend i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--ok); transition: width .4s; }
.pspend.warn { border-color: #5e4a1c; } .pspend.warn i { background: var(--warn); } .pspend.warn b { color: var(--warn); }
.pspend.over { border-color: #5a2c2e; } .pspend.over i { background: var(--danger); } .pspend.over b { color: #ffb4b4; }
@media (max-width: 1180px) { .pspend .k, .pspend .pend { display: none; } }
#modal .spendbox { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.sp-total { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.sp-total b { font-size: 34px; font-weight: 300; letter-spacing: -.02em; line-height: 1; color: var(--accent); }
.sp-total span { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.sp-meter { position: relative; height: 6px; border-radius: 999px; background: #2a2a2c; overflow: visible; }
.sp-meter i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.sp-meter.warn i { background: var(--warn); } .sp-meter.over i { background: var(--danger); }
.sp-meter u { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text-2); border-radius: 1px; }
.sp-cap { margin: 8px 0 16px; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.sp-table { display: flex; flex-direction: column; margin-bottom: 14px; }
.sp-table .k, .sp-form .k { font-size: 9.5px; color: var(--muted); padding-bottom: 6px; }
.sp-table .r { display: grid; grid-template-columns: minmax(0, 1fr) 40px 90px; gap: 8px; padding: 6px 0; border-top: 1px solid var(--hair); font-size: 12.5px; }
.sp-table .r .n, .sp-table .r .v { font-family: var(--mono); font-size: 11.5px; text-align: right; color: var(--text-2); }
.sp-table .r .v { color: var(--text); }
#modal p.sp-note { margin: 0 0 16px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
#modal .sp-credits { margin: 4px 0 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
#modal .sp-credits .k { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 9.5px; color: var(--muted); }
#modal .sp-credits .refresh { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; background: transparent; border-color: transparent; color: var(--muted); } #modal .sp-credits .refresh:hover { color: var(--text); background: #232325; } #modal .sp-credits .refresh.spin svg { animation: spin .9s linear infinite; }
#modal .sp-credits .cr { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; height: 26px; font-size: 12px; }
#modal .sp-credits .cr .bar { height: 4px; border-radius: 2px; background: #2f2f31; overflow: hidden; } #modal .sp-credits .cr .bar i { display: block; height: 100%; background: var(--ok); }
#modal .sp-credits .cr .v { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }
#modal .sp-credits .cr.low .bar i { background: var(--danger); } #modal .sp-credits .cr.low .v { color: #ff8f8f; }
#modal .sp-credits p.sp-note { margin: 8px 0 0; } #modal .sp-credits p.sp-note.warn { color: var(--warn); }
.sp-form { border-top: 1px solid var(--hair); padding-top: 14px; }
.sp-form .g { display: grid; grid-template-columns: 1.1fr 1.4fr .8fr; gap: 10px; margin-bottom: 10px; }
.sp-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-2); }
.sp-form input, .sp-form select { width: 100%; height: 34px; font-size: 12.5px; }
#modal .spendbox .row .btn:first-child { margin-right: auto; }

/* présence */
#presence { display: flex; align-items: center; gap: 4px; }
#presence .plabel { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-left: 6px; }
#presence .plabel::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
#presence[data-status="online"] .plabel::before { background: var(--ok); }
#presence[data-status="offline"] .plabel::before { background: var(--danger); }
#presence .more { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); margin-left: 4px; }
.avatar { --c: #666; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #0f0f10; font-size: 11px; font-weight: 700; overflow: hidden; box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3px var(--c); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.peer + .avatar.peer { margin-left: -4px; }
#user { display: flex; align-items: center; gap: 8px; }
#user:empty { display: none; }
#user .avatar { width: 30px; height: 30px; font-size: 12px; box-shadow: none; }
#user button { height: 30px; padding: 0 10px; font-size: 12px; }
.pill { white-space: nowrap; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #1a1a1b; color: var(--text-2); border: 1px solid var(--node-border); }

/* ================================================================= barres latérales */
#sidebar, #rightbar { position: fixed; z-index: 20; top: 56px; bottom: 0; width: 72px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 14px 5px 16px; background: var(--chrome); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
#sidebar { left: 0; border-right: 1px solid #242426; }
#rightbar { right: 0; border-left: 1px solid #242426; }
#sidebar::-webkit-scrollbar, #rightbar::-webkit-scrollbar { display: none; }
.sb-title { font-size: 9.5px; letter-spacing: .1em; color: var(--muted); text-align: center; padding: 0 0 8px; }
.sb-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 8px; background: transparent; border: 1px solid transparent; border-radius: 12px; color: var(--text-2); font-size: 10.5px; }
.sb-item:hover { background: #1a1a1b; border-color: var(--node-border); color: var(--text); }
.sb-item:active { background: #222224; }
.sb-item svg { width: 22px; height: 22px; }
.sb-item[data-add="image"]:hover svg, .sb-item[data-add="import"]:hover svg { color: var(--image-port); }
.sb-item[data-add="prompt"]:hover svg { color: var(--text-port); }
.sb-item[data-add="video"]:hover svg, .sb-item[data-add="clip"]:hover svg { color: var(--video-port); }
.sb-item[data-add="audio"]:hover svg { color: var(--audio-port); }
.sb-item[data-add="edit"]:hover svg, .sb-item[data-add="imagegen"]:hover svg { color: var(--image-port); }
.sb-item[data-add="montage"]:hover svg, #btn-montages:hover svg { color: var(--video-port); } #btn-retouches:hover svg { color: var(--image-port); }
.sb-item[data-add="note"]:hover svg, #btn-reactions:hover svg { color: #f4d35e; }
.sb-item[data-add="router"]:hover svg { color: var(--text); }
#btn-reactions.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#btn-reactions.on svg { color: var(--accent-ink); }
.sb-sep { flex: none; height: 1px; margin: 8px 6px 10px; background: #242426; }
#rightbar .sb-item .n { position: absolute; top: 5px; right: 8px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 9.5px; font-weight: 500; text-align: center; }
#rightbar .sb-item .n[hidden] { display: none; }
#rightbar .sb-item.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
#rightbar .sb-item.on svg { color: var(--accent-ink); }
#rightbar .sb-item.on .n { background: var(--accent-ink); color: var(--accent); }

/* ================================================================= canvas */
#canvas { position: absolute; top: 56px; left: 72px; right: 72px; bottom: 0; overflow: hidden; cursor: default; background-color: var(--bg); background-image: var(--grid-plus); background-size: 24px 24px; }
#canvas.panning { cursor: grabbing; }
/* Espace tenu : la main, partout sur le canvas */
#canvas.hand, #canvas.hand * { cursor: grab !important; } #canvas.hand.panning, #canvas.hand.panning * { cursor: grabbing !important; }
#canvas.hand .node { pointer-events: none; }
#canvas.dropping { outline: 2px dashed #5a5a5e; outline-offset: -10px; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
#edges path { fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: stroke; cursor: pointer; }
#edges path.hit { stroke: transparent; stroke-width: 14; }
#edges path.selected { stroke-width: 3; filter: drop-shadow(0 0 5px currentColor); }
#edges path.temp { stroke-dasharray: 6 5; opacity: .85; }
#hint { position: absolute; left: 20px; bottom: 22px; max-width: calc(100vw - 860px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; pointer-events: none; }
@media (max-width: 1320px) { #hint { display: none; } }

/* ================================================================= pied de page (crédits, alertes, état API) */
#footer { position: fixed; z-index: 21; right: 88px; bottom: 14px; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; background: rgba(15,15,16,.92); backdrop-filter: blur(10px); border: 1px solid var(--node-border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); transition: right .28s cubic-bezier(.2,.8,.2,1), opacity .2s; max-width: calc(100vw - 200px); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
#footer::-webkit-scrollbar { display: none; }
body.lib-open #footer { right: calc(72px + var(--panel-w, 440px) + 12px); }
@media (max-width: 1000px) { body.lib-open #footer { opacity: 0; pointer-events: none; } }
/* pied de page : ce qui demande d'agir — pack bientôt épuisé (règle rouge), échecs de génération — puis l'état de l'API */
#alerts { display: flex; align-items: center; gap: 6px; min-width: 0; }
#alerts:empty { display: none; }
#alerts .rule { display: inline-flex; align-items: baseline; gap: 6px; height: 24px; padding: 5px 9px 0; border-radius: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: #ff8f8f; background: rgba(255,107,107,.09); box-shadow: inset 0 0 0 1px rgba(255,107,107,.35); white-space: nowrap; cursor: help; }
#alerts .rule b { font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: #ffb4b4; }
#alerts .rule.empty { color: #fff; background: rgba(255,107,107,.3); }
#alerts .alert { display: inline-flex; align-items: center; gap: 4px; max-width: 320px; height: 28px; padding: 0 4px 0 10px; border-radius: 9px; font-size: 11.5px; color: #ffd2d2; background: #2a1718; box-shadow: inset 0 0 0 1px #5a2c2e; }
#alerts .alert .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #alerts .alert.go .t { cursor: pointer; } #alerts .alert.go .t:hover { text-decoration: underline; text-underline-offset: 3px; }
#alerts .alert .x { flex: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; background: transparent; border: none; color: #ffb4b4; border-radius: 6px; } #alerts .alert .x:hover { background: rgba(255,255,255,.08); color: #fff; }
#alerts .more { height: 24px; padding: 0 8px; font-family: var(--mono); font-size: 10px; color: #ffb4b4; background: transparent; border: 1px solid #5a2c2e; border-radius: 8px; }
#keystatus { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; font-size: 11.5px; color: #c9c9c9; font-family: var(--sans); text-transform: none; letter-spacing: 0; background: transparent; border: none; }
#keystatus::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
#keystatus.ok::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(95,211,154,.18); }
#keystatus.bad { color: #ffb4b4; }
#keystatus.bad::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,107,107,.18); }

/* ================================================================= toast */
#toast { position: fixed; z-index: 70; bottom: 70px; left: 50%; transform: translateX(-50%) translateY(6px); background: #1f1f21; border: 1px solid #3a3a3d; padding: 10px 14px; border-radius: 12px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: 70vw; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { border-color: #7a3a3d; color: #ffc9c9; }

/* ================================================================= nœuds */
.node { position: absolute; z-index: 100000; width: 320px; background: var(--node); border: 1px solid var(--node-border); border-radius: var(--radius); box-shadow: var(--shadow-node); user-select: none; cursor: default; }
.node:hover { border-color: var(--node-border-hover); }
.node.selected { border-color: #4a4a4e; box-shadow: 0 0 0 1px #4a4a4e, 0 28px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06); }
.node-video { width: 372px; }
.node .head { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 14px; cursor: grab; border-bottom: 1px solid var(--hair); }
.node .head:active { cursor: grabbing; }
.node .head .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.node .head .pip.kind-text { background: var(--text-port); }
.node .head .pip.kind-image { background: var(--image-port); }
.node .head .pip.kind-video { background: var(--video-port); }
.node .head .pip.kind-audio { background: var(--audio-port); }
.node .head .code { font-size: 10px; color: var(--muted); }
.node .head .title { flex: 1; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .head select.model { flex: 1; min-width: 0; height: 30px; font-weight: 600; font-size: 13px; padding: 0 24px 0 4px; background-color: transparent; border-color: transparent; }
.node .head select.model:hover { border-color: var(--field-border); background-color: var(--field); }
.node .head .ver { font-family: var(--mono); font-size: 10px; color: var(--text-port); border: 1px solid #4a3a5e; border-radius: 999px; padding: 2px 7px; }
.node .head .ver:empty { display: none; }
.node .head .x, .node .head .mini { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; color: var(--muted); background: transparent; border: none; border-radius: 8px; }
.node .head .x:hover { color: var(--danger); background: #241a1b; }
.node .head .mini:hover { color: var(--text); background: #262628; }
.node .body { position: relative; padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 10px; cursor: grab; }
.node .body .preview, .node .body .drop, .node .body .results, .node .body .history, .node .body textarea, .node .body .tip, .node .body .cost, .node .body .filename, .node .body .limits { cursor: auto; }
.node .body .tip, .node .body .cost, .node .body .filename, .node .body .limits { cursor: grab; }
.node-video .head { height: 46px; }
.node-video .body { gap: 12px; padding-bottom: 14px; }

/* ports */
.port { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--node); border: 2px solid var(--muted); box-shadow: 0 0 0 3px var(--bg); cursor: crosshair; z-index: 7; transition: transform .12s; }
.port.kind-text { border-color: var(--text-port); }
.port.kind-image { border-color: var(--image-port); }
.port.kind-video { border-color: var(--video-port); }
.port.kind-audio { border-color: var(--audio-port); }
.port.kind-text.connected { background: var(--text-port); }
.port.kind-image.connected { background: var(--image-port); }
.port.kind-video.connected { background: var(--video-port); }
.port.kind-audio.connected { background: var(--audio-port); }
.port:hover { transform: scale(1.25); }
.port.target { transform: scale(1.45); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px rgba(255,255,255,.14); }
.port.hot, .port.target.hot { transform: scale(1.8); box-shadow: 0 0 0 3px var(--bg), 0 0 0 7px rgba(242,240,234,.55); }
.node.drop-ok { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-node); }
.node.drop-no { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger), var(--shadow-node); }
.node-router.drop-ok .body, .node-router.drop-no .body { border-color: inherit; }
.port-row { position: relative; height: 20px; display: flex; align-items: center; gap: 4px; }
.port-row .port.in { left: -21px; top: 4px; }
.port-row .port.out { right: -21px; top: 4px; }
.node-video .port-row { height: 26px; }
.node-video .port-row .port.in, .node-video .port-row .port.out { top: 7px; }
.port-row .label { font-size: 10px; color: var(--text-2); }
.port-row .label.req::after { content: ' *'; color: var(--text-port); }
.port-row.right { justify-content: flex-end; }
.port-row .rm { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; color: var(--muted); background: transparent; border: none; border-radius: 6px; }
.port-row .rm:hover { color: var(--danger); background: #241a1b; }
.ports { display: flex; flex-direction: column; gap: 0; }
.ports.outs { position: absolute; right: 14px; top: 12px; align-items: flex-end; }

/* modules média */
.drop { position: relative; aspect-ratio: 4 / 3; border: 1px dashed #3a3a3d; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 12px; line-height: 1.45; text-align: center; padding: 14px; cursor: pointer; overflow: hidden; background-color: var(--field); background-image: var(--hatch); }
.drop:hover, .drop.over { border-color: #6a6a6e; color: var(--text); }
.drop.has { border-style: solid; border-color: var(--field-border); background-image: none; }
.drop img, .drop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0a0a0b; }
.drop.audio { aspect-ratio: auto; min-height: 68px; padding: 10px; }
.drop.audio audio { width: 100%; }
.filename { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.limits { font-size: 10.5px; color: var(--muted); line-height: 1.4; cursor: help; border-top: 1px solid var(--hair); padding-top: 8px; }
.limits::before { content: 'FORMATS · '; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: var(--muted); }
.warn { font-size: 11px; color: var(--warn); line-height: 1.4; }

/* miniature (nœud réduit) */
.node.collapsed { width: 176px; }
.node.collapsed .head { display: none; }
.node.collapsed .body { padding: 0; gap: 0; }
.node.collapsed .thumb { position: relative; height: 112px; border-radius: var(--radius); overflow: hidden; background-color: #1f1f21; background-image: var(--hatch); display: flex; align-items: center; justify-content: center; cursor: grab; }
.node.collapsed .thumb:active { cursor: grabbing; }
.node.collapsed .thumb img, .node.collapsed .thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.node.collapsed .thumb .big { font-size: 30px; color: var(--audio-port); }
.node.collapsed .thumb .big.muted { color: #4a4a4e; }
.node.collapsed .thumb .cap, .node.collapsed .thumb .badge { position: absolute; bottom: 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: #d6d6d6; background: rgba(15,15,16,.82); padding: 3px 7px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.collapsed .thumb .cap { left: 8px; max-width: calc(100% - 64px); }
.node.collapsed .thumb .badge { right: 8px; }
.node.collapsed .expand { position: absolute; top: 7px; right: 7px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border-radius: 8px; background: rgba(15,15,16,.85); border-color: rgba(255,255,255,.16); opacity: 0; transition: opacity .15s; z-index: 3; }
.node.collapsed:hover .expand, .node.collapsed.selected .expand { opacity: 1; }
.node.collapsed .port-row.right { position: absolute; right: 14px; top: 50%; width: 0; height: 0; margin-top: -10px; }
.node.collapsed .port-row.right .label { display: none; }

/* prompt */
.node-prompt textarea { width: 100%; min-height: 124px; resize: vertical; line-height: 1.5; font-size: 13px; border-radius: 10px; padding: 10px 12px; }
.prompt-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.prompt-foot .dirty { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: none; }
.prompt-foot .dirty.on { display: inline-block; }
.prompt-foot button { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; color: #d6d6d6; }
.prompt-foot .hstat { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.history { display: none; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; border-top: 1px solid var(--hair); padding-top: 10px; }
.history.open { display: flex; }
.hver { background: var(--field); border: 1px solid var(--hair); border-radius: 10px; padding: 8px 10px; font-size: 11.5px; line-height: 1.5; }
.hver .hh { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--mono); font-size: 10px; margin-bottom: 5px; }
.hver .hh b { color: var(--text-port); font-weight: 500; }
.hver .hh button { margin-left: auto; height: 20px; padding: 0 8px; font-family: var(--sans); font-size: 10.5px; border-radius: 6px; }
.hver .diff { white-space: pre-wrap; word-break: break-word; user-select: text; color: #d6d6d6; }
.hver ins { background: rgba(95,211,154,.2); color: #b8f0d2; text-decoration: none; border-radius: 3px; }
.hver del { background: rgba(255,107,107,.2); color: #ffc0c0; text-decoration: line-through; border-radius: 3px; }
.hver.current { border-color: #3a3a3d; }
.tip { font-size: 11px; color: var(--text-2); line-height: 16px; text-wrap: pretty; }
.tip code { font-family: var(--mono); font-size: 10.5px; color: var(--text); }
.tip code.k-image { color: var(--image-port); }
.tip code.k-video { color: var(--video-port); }
.tip code.k-audio { color: var(--audio-port); }

/* vidéo */
.node-video .body { padding-top: 0; }
.node-video .ports:not(.outs) { padding-top: 12px; }
.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background-color: #1f1f21; background-image: var(--hatch); display: flex; align-items: center; justify-content: center; }
.preview video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.preview .empty { max-width: 240px; font-size: 12px; line-height: 1.5; color: var(--text-2); text-align: center; padding: 12px; }
.preview .status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(12,12,13,.78); color: var(--text); }
.preview .status .spin { width: 24px; height: 24px; border: 2px solid #3a3a3d; border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.preview .status .txt { font-size: 13px; font-weight: 600; }
.preview .status .sub { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }
.preview .err { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px 20px; background: rgba(44,16,14,.95); color: #ffd2c4; font-size: 12.5px; line-height: 1.5; overflow: auto; user-select: text; cursor: pointer; }
.preview .err::before { content: 'ÉCHEC DE LA GÉNÉRATION'; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: #ff9d7a; }
.preview .err::after { content: 'Cliquer pour masquer'; font-size: 11px; color: #d9a090; }
@keyframes spin { to { transform: rotate(360deg); } }

.mode { display: flex; gap: 2px; padding: 3px; background: var(--field); border: 1px solid var(--field-border); border-radius: 10px; }
.mode button { flex: 1; height: 28px; padding: 0; background: transparent; border: none; border-radius: 7px; font-size: 12px; color: var(--text-2); }
.mode button:hover { color: var(--text); background: transparent; }
.mode button.on { background: #2c2c2e; color: var(--text); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.params label, .taskfield { display: flex; flex-direction: column; gap: 5px; }
.params label > span, .taskfield > span { font-size: 9.5px; color: var(--muted); }
.params label.row { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }
.params label.row > span { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); }
.params select, .params input[type=number] { width: 100%; height: 32px; font-family: var(--mono); font-size: 12px; }
.params input[type=checkbox] { width: 16px; height: 16px; margin: 0; }
.params label.disabled { opacity: .45; }
.taskfield select { height: 32px; font-size: 12.5px; }
details.more { font-size: 11px; }
details.more summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-2); font-size: 11px; list-style: none; padding: 2px 0; user-select: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary:hover { color: var(--text); }
details.more[open] summary { color: var(--text); margin-bottom: 8px; }
.cost { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); line-height: 1.5; cursor: help; }
.cost i { font-style: normal; opacity: .45; }
.cost small { display: block; font-family: var(--sans); font-size: 10.5px; color: var(--warn); }
.vfoot { display: flex; align-items: center; gap: 6px; }
.vfoot .add { height: 30px; padding: 0 9px; background: transparent; border: 1px dashed #3a3a3d; border-radius: 8px; font-size: 11.5px; color: var(--text-2); }
.vfoot .add-image { color: var(--image-port); }
.vfoot .add-video { color: var(--video-port); }
.vfoot .add-audio { color: var(--audio-port); }
.vfoot .add:hover { background: #1f1f21; border-style: solid; }
.vfoot .add[disabled] { opacity: .35; }
.vfoot .run { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.results { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--hair); padding-top: 12px; max-height: 168px; overflow: auto; }
.results .rh { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 20px; padding: 0 0 2px; background: transparent; border: none; border-radius: 0; font-size: 9.5px; color: var(--muted); text-align: left; }
.results .rh:hover { background: transparent; color: var(--text); }
.results .rh .rl { display: inline-flex; align-items: center; gap: 5px; }
.results.folded { padding-top: 8px; }
.ritem { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 8px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-family: var(--mono); font-size: 10.5px; flex: none; }
.ritem:hover { background: #222224; color: var(--text); }
.ritem.on { background: #26262a; color: var(--text); }
.ritem .n { font-weight: 500; }
.ritem .p { flex: 1; min-width: 0; font-family: var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ritem .rc { white-space: nowrap; color: inherit; }
.ritem a { display: flex; color: var(--muted); text-decoration: none; padding: 0 2px; }
.ritem a:hover { color: var(--text); }

/* retouche (éditeur d'images) */
.node-edit { width: 340px; }
/* module Import (vide) et Objet 3D */
.node .head .pip.kind-any { background: #9a9a9a; }
.node-import .kinds { display: flex; flex-wrap: wrap; gap: 5px; }
.node-import .kd { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; font-size: 10.5px; color: var(--text-2); border: 1px solid var(--node-border); border-radius: 999px; }
.node-import .kd.kind-image svg { color: var(--image-port); } .node-import .kd.kind-video svg { color: var(--video-port); } .node-import .kd.kind-audio svg { color: var(--audio-port); }
.node-model3d { width: 340px; }
.node-model3d .body { padding-top: 0; } .node-model3d .ports.outs { padding-top: 12px; }
.m3d-stage { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--node-border); background: #101011; cursor: grab; }
.m3d-stage:active { cursor: grabbing; }
.m3d-stage.checker { background-color: #161617; background-image: linear-gradient(45deg, #1f1f21 25%, transparent 25%, transparent 75%, #1f1f21 75%), linear-gradient(45deg, #1f1f21 25%, transparent 25%, transparent 75%, #1f1f21 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.m3d-stage model-viewer { --poster-color: transparent; --progress-bar-color: var(--accent); }
.m3d-status { font-family: var(--mono); font-size: 10px; color: var(--muted); } .m3d-status.ok { color: var(--ok); } .m3d-status.bad { color: var(--danger); }
.m3d-sliders { display: flex; flex-direction: column; gap: 4px; }
.m3d-sliders .sl { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.m3d-sliders .sl .v { text-align: right; font-family: var(--mono); font-size: 10px; color: var(--text); }
.m3d-sliders input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; }
.m3d-sliders input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: #3a3a3d; }
.m3d-sliders input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--accent); border: 2px solid var(--node); }
.m3d-sliders input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: #3a3a3d; } .m3d-sliders input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--node); }
.node-model3d .vfoot .add { border-style: solid; }
/* module Image IA : même gabarit que le module Vidéo */
.node-imagegen { width: 372px; }
.node-imagegen .gen-preview { max-height: 420px; }
.node-imagegen .gen-preview img { width: 100%; height: 100%; object-fit: contain; display: block; background: #0a0a0b; }
.node-imagegen .gen-preview.has { background-image: none; background-color: #0a0a0b; cursor: zoom-in; }
.node-imagegen .tip { margin-top: 10px; }
.node-imagegen .addport { align-self: flex-start; height: 22px; margin: 2px 0 4px 14px; padding: 0 8px; font-size: 11px; color: var(--text-2); background: transparent; border: 1px dashed var(--node-border); border-radius: 7px; }
.node-imagegen .addport:hover { color: var(--image-port); border-color: var(--image-port); }
.gen-results .strip { display: flex; gap: 6px; padding: 2px 0 4px; overflow-x: auto; scrollbar-width: thin; }
.gthumb { flex: none; width: 58px; height: 58px; padding: 0; overflow: hidden; border-radius: 9px; border: 1px solid var(--node-border); background: #0a0a0b; opacity: .72; }
.gthumb:hover { opacity: 1; border-color: var(--node-border-hover); } .gthumb.on { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
body[data-role="viewer"] .node-imagegen .addport, body[data-role="commenter"] .node-imagegen .addport { display: none; }
.node-edit .body { padding-top: 0; }
.node-edit .ports:not(.outs) { padding-top: 12px; }
.preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.edit-preview { max-height: 380px; cursor: zoom-in; }
.edit-preview.has { background-color: #0a0a0b; background-image: none; }
.warn.stale { display: flex; align-items: center; gap: 8px; }
.warn.stale button { margin-left: auto; flex: none; height: 24px; padding: 0 9px; font-size: 11px; border-radius: 7px; }
.vfoot .btn-dl { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--text-2); background: var(--raised); border: 1px solid var(--raised-border); }
.vfoot .btn-dl:hover { color: var(--text); background: #2c2c2e; border-color: #444447; }

/* ================================================================= router (mini-connecteur) */
.node-router { width: auto; min-width: 96px; height: 32px; display: flex; align-items: center; border-radius: 999px; background: #222224; border: 1px solid #3a3a3d; box-shadow: 0 10px 26px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); }
.node-router .body { flex: 1; flex-direction: row; align-items: center; gap: 7px; height: 100%; padding: 0 16px 0 14px; cursor: grab; white-space: nowrap; }
.node-router .body:active { cursor: grabbing; }
.node-router .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.node-router .pip.kind-text { background: var(--text-port); } .node-router .pip.kind-image { background: var(--image-port); }
.node-router .pip.kind-video { background: var(--video-port); } .node-router .pip.kind-audio { background: var(--audio-port); }
.node-router img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; flex: none; pointer-events: none; }
.node-router .rlabel { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.node-router .fan { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.node-router input { width: 110px; height: 22px; padding: 0 6px; font-size: 11.5px; border-radius: 6px; }
.node-router .port { top: 50%; margin-top: -6px; }
.node-router .port.in { left: -7px; } .node-router .port.out { right: -7px; }
.node-router .x { position: absolute; top: -9px; right: 10px; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; background: #2c2c2e; border: 1px solid #4a4a4e; color: var(--text-2); opacity: 0; transition: opacity .15s; }
.node-router:hover .x, .node-router.selected .x { opacity: 1; }
.node-router .x:hover { color: var(--danger); }
.port.kind-any { border-color: #9a9a9a; border-style: dashed; }

/* ================================================================= réactions (stickers) */
.node-sticker { z-index: 200000; width: auto; background: transparent; border: none; box-shadow: none; cursor: grab; }
.node-sticker:hover, .node-sticker.selected { border: none; box-shadow: none; }
.node-sticker:active { cursor: grabbing; }
.node-sticker .body { padding: 6px; gap: 0; }
/* contour blanc découpé à la forme de l'emoji, comme un autocollant : les ombres portées sans flou s'additionnent */
.node-sticker .glyph { display: block; line-height: 1.1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; user-select: none; pointer-events: none;
  filter: drop-shadow(.045em 0 0 #fff) drop-shadow(-.045em 0 0 #fff) drop-shadow(0 .045em 0 #fff) drop-shadow(0 -.045em 0 #fff) drop-shadow(.03em .03em 0 #fff) drop-shadow(-.03em -.03em 0 #fff) drop-shadow(0 .06em .1em rgba(0,0,0,.55)); }
.node-sticker.selected .glyph { filter: drop-shadow(.045em 0 0 #fff) drop-shadow(-.045em 0 0 #fff) drop-shadow(0 .045em 0 #fff) drop-shadow(0 -.045em 0 #fff) drop-shadow(.03em .03em 0 #fff) drop-shadow(-.03em -.03em 0 #fff) drop-shadow(0 0 .12em rgba(242,240,234,.9)); }
.node-sticker .resize { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #141414; cursor: nwse-resize; opacity: 0; transition: opacity .15s; }
.node-sticker.selected .resize, .node-sticker:hover .resize { opacity: 1; }
.sticker-palette { position: fixed; z-index: 70; width: 232px; padding: 12px; background: #1c1c1d; border: 1px solid #333335; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05); }
.sticker-palette .k { font-size: 9.5px; color: var(--muted); padding: 0 2px 8px; }
.sticker-palette .grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.sticker-palette .grid button { height: 34px; padding: 0; font-size: 21px; line-height: 1; background: transparent; border: 1px solid transparent; border-radius: 9px; cursor: grab; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.sticker-palette .grid button:hover { background: #2a2a2c; border-color: #3a3a3d; transform: scale(1.12); }
.sticker-palette .tip { margin-top: 9px; font-size: 10.5px; line-height: 1.45; color: var(--muted); }

/* rectangle de sélection (Maj + glisser sur le fond) */
.marquee { position: absolute; z-index: 5; border: 1px solid var(--accent); background: rgba(242,240,234,.08); border-radius: 3px; pointer-events: none; }

/* ================================================================= invitations */
#modal .invitebox { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.rolecard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: auto; padding: 12px; text-align: left; white-space: normal; border-radius: 12px; background: var(--field); border: 1px solid var(--field-border); }
.rolecard b { font-size: 13px; font-weight: 600; }
.rolecard span { font-size: 11px; line-height: 1.45; color: var(--text-2); }
.rolecard:hover { background: #1c1c1d; border-color: #4a4a4e; }
.rolecard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #1f1f20; }
.inv-result:empty { display: none; }
.inv-result { margin-bottom: 14px; padding: 12px; border-radius: 12px; background: #16211b; border: 1px solid #2c4a3a; }
#modal .inv-result p.ok { margin: 0 0 10px; font-size: 12.5px; color: #cdebd9; }
#modal .inv-result input.link { margin-bottom: 10px; }
.inv-list:empty { display: none; }
.inv-list { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 6px; }
.inv-list .k { font-size: 9.5px; color: var(--muted); padding-bottom: 4px; }
.inv-list .inv { display: grid; grid-template-columns: minmax(0, 1fr) 150px 32px 32px; align-items: center; gap: 6px; }
.inv-list .who { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.inv-list select { height: 30px; font-size: 12px; padding-top: 0; padding-bottom: 0; }
.inv-list button.icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 30px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); }
.inv-list button.icon:hover { background: #2a2a2c; color: var(--text); }
.inv-list button.icon.del:hover { color: var(--danger); }
.userbtn { display: flex; padding: 2px; background: transparent; border-color: transparent; border-radius: 50%; }
.userbtn:hover, .userbtn.open { background: transparent; border-color: transparent; }
#user .userbtn .avatar { transition: box-shadow .15s; } #user .userbtn:hover .avatar, #user .userbtn.open .avatar { box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3.5px var(--accent); }
@media (max-width: 640px) { .roles { grid-template-columns: 1fr; } }

/* ================================================================= rôles des invités */
.rolepill { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; color: #141414; background: var(--warn); white-space: nowrap; }
body[data-role="viewer"] #sidebar .sb-item, body[data-role="commenter"] #sidebar .sb-item:not([data-add="note"]):not(#btn-reactions) { display: none; }
body[data-role="viewer"] #sidebar .sb-title, body[data-role="viewer"] #sidebar .sb-sep, body[data-role="commenter"] #sidebar .sb-title:first-child, body[data-role="commenter"] #sidebar .sb-sep { display: none; }
body[data-role="viewer"] #world .node, body[data-role="commenter"] #world .node:not(.node-note):not(.node-sticker) { pointer-events: none; }
body[data-role="viewer"] #world .node video, body[data-role="viewer"] #world .node audio, body[data-role="viewer"] #world .node .results, body[data-role="viewer"] #world .node .history, body[data-role="viewer"] #world .node .prompt-foot,
body[data-role="commenter"] #world .node video, body[data-role="commenter"] #world .node audio, body[data-role="commenter"] #world .node .results, body[data-role="commenter"] #world .node .history, body[data-role="commenter"] #world .node .prompt-foot { pointer-events: auto; }
body[data-role="viewer"] #edges path, body[data-role="commenter"] #edges path { pointer-events: none; }
body[data-role="viewer"] .card .media .fav, body[data-role="commenter"] .card .media .fav, body:not([data-role="member"]) .card .media .del, body[data-role="viewer"] .slot .rm, body[data-role="commenter"] .slot .rm, body[data-role="viewer"] .import-btn, body[data-role="commenter"] .import-btn { display: none; }

/* bandeau « nouvelle version » */
#reload-banner { position: fixed; z-index: 90; left: 50%; top: 68px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: #2a2210; border: 1px solid #6b5518; color: #ffe9a8; font-size: 12.5px; box-shadow: 0 18px 44px rgba(0,0,0,.55); }
#reload-banner button { height: 30px; padding: 0 12px; font-size: 12.5px; }

/* ================================================================= notes adhésives */
.node-note { --paper: #f4d35e; --ink: #1d1a10; z-index: 1; display: flex; flex-direction: column; width: 240px; background: var(--paper); color: var(--ink); border: none; border-radius: 3px 3px 16px 3px; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 18px 40px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35); }
/* une note sélectionnée passe devant les modules le temps de la lire ou de la déplacer, puis retourne dessous */
.node-note.selected { z-index: 300000 !important; box-shadow: 0 0 0 2px var(--accent), 0 22px 50px rgba(0,0,0,.55); }
.note-yellow { --paper: #f4d35e; }
.note-pink { --paper: #f4a3bd; }
.note-green { --paper: #9fdcae; }
.note-blue { --paper: #93cdf1; }
.note-violet { --paper: #c9aef6; }
.note-orange { --paper: #f6ab74; }
.note-paper { --paper: #ece9df; }
.node-note .head { flex: none; height: 26px; gap: 6px; padding: 0 4px 0 9px; border-bottom: none; border-radius: 3px 3px 0 0; background: rgba(0,0,0,.07); }
.node-note .head .dots { flex: 1; display: flex; gap: 5px; opacity: 0; transition: opacity .15s; }
.node-note:hover .head .dots, .node-note.selected .head .dots { opacity: 1; }
.node-note .head .dot { width: 13px; height: 13px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.35); background: var(--paper); transition: transform .12s; }
.node-note .head .dot:hover { transform: scale(1.25); background: var(--paper); border-color: rgba(0,0,0,.75); }
.node-note .head .x { width: 20px; height: 20px; color: rgba(0,0,0,.55); opacity: 0; transition: opacity .15s; }
.node-note:hover .head .x, .node-note.selected .head .x { opacity: 1; }
.node-note .head .x:hover { color: #7a1010; background: rgba(0,0,0,.12); }
.node-note .body { flex: 1; min-height: 0; gap: 6px; padding: 8px 12px 9px; cursor: grab; }
.node-note textarea { flex: 1; min-height: 0; width: 100%; resize: none; padding: 0; border: none; border-radius: 0; background: transparent; color: var(--ink); font-size: 13.5px; font-weight: 500; line-height: 1.45; cursor: text; }
.node-note textarea::placeholder { color: rgba(0,0,0,.4); }
.node-note textarea:focus-visible { outline: none; }
.node-note .sig { flex: none; padding-right: 18px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(0,0,0,.58); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-note .resize { position: absolute; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: flex-end; width: 24px; height: 24px; padding: 3px; color: rgba(0,0,0,.45); cursor: nwse-resize; }
.node-note .resize:hover { color: rgba(0,0,0,.9); }

/* ================================================================= librairie */
#library, .sidepanel { position: fixed; z-index: 19; top: 56px; right: 72px; bottom: 0; width: 440px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--node-border); transform: translateX(calc(100% + 72px)); transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; display: flex; flex-direction: column; box-shadow: -30px 0 70px rgba(0,0,0,.55); visibility: hidden; }
#library.open, .sidepanel.open { transform: translateX(0); visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.lib-head { display: flex; align-items: baseline; gap: 10px; padding: 20px 18px 16px; }
.lib-head b { font-size: 15px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.lib-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.lib-close { align-self: center; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); border-radius: 9px; }
.lib-close:hover { color: var(--text); background: #1f1f21; }
.lib-filters { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 14px; border-bottom: 1px solid var(--hair); }
.lib-filters .frow { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.lib-filters .qwrap { position: relative; flex: 1; min-width: 140px; display: flex; align-items: center; }
.lib-filters .qwrap svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.lib-filters .q { width: 100%; height: 34px; font-size: 12.5px; background-color: var(--node); border-color: #303032; border-radius: 9px; padding-left: 32px; }
.lib-filters select { height: 32px; font-size: 12px; background-color: var(--node); border-color: #303032; border-radius: 9px; }
.lib-filters select.sort { height: 34px; }
.lib-filters .reset { margin-left: auto; height: 28px; padding: 0 8px; background: transparent; border: none; color: var(--text-2); font-size: 11.5px; text-decoration: underline; text-underline-offset: 3px; }
.lib-filters .reset:hover { color: var(--text); background: transparent; }
.lib-filters .sep { width: 1px; height: 16px; background: #303032; margin: 0 1px; }
.fchip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--node); border: 1px solid #303032; color: #b4b4b4; font-size: 11px; }
.fchip:hover { color: var(--text); border-color: #4a4a4e; background: var(--node); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.lib-grid { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; }
.lib-day { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; padding-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text); }
.lib-day .stat { font-size: 10px; font-weight: 400; color: var(--muted); }
.lib-empty { grid-column: 1 / -1; color: var(--text-2); font-size: 12.5px; padding: 32px 0; text-align: center; }
.card { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--node); border: 1px solid var(--node-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: #4a4a4e; }
.card.flash { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 34px rgba(242,240,234,.22); }
.card .media { position: relative; flex: none; height: 122px; background-color: #1f1f21; background-image: var(--hatch); cursor: zoom-in; overflow: hidden; }
.card .media video, .card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .media .fav, .card .media .del { position: absolute; top: 7px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 8px; background: rgba(15,15,16,.78); border: 1px solid rgba(255,255,255,.18); color: var(--text); opacity: 0; transition: opacity .15s, background .15s; }
.card .media .fav { left: 7px; }
.card .media .del { right: 7px; }
.card .media:hover .fav, .card .media:hover .del, .card.fav .media .fav, .card.flash .media .fav, .card.flash .media .del { opacity: 1; }
.card.fav .media .fav { color: var(--video-port); border-color: rgba(255,111,168,.55); }
.card.fav .media .fav svg { fill: var(--video-port); }
.card .media .fav:hover { background: rgba(255,111,168,.9); color: #141414; }
.card .media .del:hover { background: rgba(255,107,107,.92); color: #141414; }
.card .media .dur, .card .media .badge { position: absolute; bottom: 7px; display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9.5px; color: var(--text); background: rgba(15,15,16,.82); padding: 3px 6px; border-radius: 999px; }
.card .media .dur { right: 7px; }
.card .media .badge { left: 7px; }
.card .meta { display: flex; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--text-2); padding: 8px 10px 0; }
.card .meta .who { font-family: var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .prompt { font-size: 11.5px; color: #d6d6d6; padding: 3px 10px 10px; line-height: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ================================================================= Assets : Brand et Imports */
.sidepanel.narrow { width: 320px; }
/* Vignettes : toutes à la même hauteur, la largeur suit le format du média (--ar, posé par OKS.fitTile). Une rangée se remplit
   en étirant un peu ses vignettes (22 % au plus) ; le panneau défile pour remonter aux plus anciennes. */
.lib-grid.tiles { --tile-h: 104px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; }
.lib-grid.tiles .lib-day, .lib-grid.tiles .lib-empty { flex: 0 0 100%; }
.lib-grid.tiles .lib-day:not(:first-child) { padding-top: 10px; }
.lib-grid.tiles .card { --ar: 1.7778; flex: 1 1 calc(var(--tile-h) * var(--ar)); width: calc(var(--tile-h) * var(--ar)); max-width: min(100%, calc(var(--tile-h) * var(--ar) * 1.22)); height: var(--tile-h); border-radius: 10px; }
.lib-grid.tiles .card .media { width: 100%; height: 100%; }
.lib-grid.tiles .card .media .dl { position: absolute; right: 7px; bottom: 7px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(15,15,16,.78); border: 1px solid rgba(255,255,255,.14); color: var(--text); text-decoration: none; opacity: 0; transition: opacity .15s, background .15s; }
.lib-grid.tiles .card .media:hover .dl { opacity: 1; } .lib-grid.tiles .card .media .dl:hover { background: var(--accent); color: var(--accent-ink); }
.lib-grid.tiles .card.narrow .media .dl { right: 4px; bottom: 4px; width: 24px; height: 24px; }
.lib-grid.tiles .card.narrow .badge { display: none; }
.lib-grid.tiles .card.narrow .media .fav, .lib-grid.tiles .card.narrow .media .del { top: 4px; width: 24px; height: 24px; } .lib-grid.tiles .card.narrow .media .fav { left: 4px; } .lib-grid.tiles .card.narrow .media .del { right: 4px; }
.lib-grid.tiles .card.narrow .media .dur { right: 4px; bottom: 4px; }
#retouches .card, #montages .card { cursor: grab; } #retouches .card.dragging, #montages .card.dragging { opacity: .45; }
#retouches .card .media { cursor: pointer; background-image: linear-gradient(45deg, #232325 25%, transparent 25%, transparent 75%, #232325 75%), linear-gradient(45deg, #232325 25%, transparent 25%, transparent 75%, #232325 75%); background-size: 14px 14px; background-position: 0 0, 7px 7px; }
#retouches .card .media img { object-fit: cover; }
#retouches .card .media .fav:hover, #montages .card .media .fav:hover { background: var(--accent); color: var(--accent-ink); }

.sidepanel.over { outline: 2px dashed #6a6a6e; outline-offset: -10px; }
.brand-body { flex: 1; overflow: auto; padding: 0 18px 28px; display: flex; flex-direction: column; gap: 20px; }
.brand-intro { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-2); text-wrap: pretty; }
.brand-intro.small { font-size: 10.5px; color: var(--muted); }
.brand-list { display: flex; flex-direction: column; }
.brand-sec { display: flex; flex-direction: column; border-top: 1px solid var(--hair); }
.brand-sec:last-child { border-bottom: 1px solid var(--hair); }
.brand-sec .bh { display: flex; align-items: center; gap: 4px; height: 40px; border-radius: 8px; }
.brand-sec .bh.over { background: #232325; box-shadow: inset 0 0 0 1px var(--accent); }
.brand-sec .btog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 2px; background: transparent; border: none; border-radius: 8px; color: var(--text-2); text-align: left; }
.brand-sec .btog:hover { background: transparent; color: var(--text); }
.brand-sec .btog svg { color: var(--muted); }
.brand-sec .btog .k { font-size: 10px; letter-spacing: .1em; color: var(--text-2); }
.brand-sec.has .btog .k, .brand-sec.open .btog .k { color: var(--text); }
.brand-sec .btog .n { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.brand-sec .bplus { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted); }
.brand-sec .bplus:hover { background: #232325; border-color: var(--node-border); color: var(--text); }
.brand-sec .slots { padding: 2px 0 14px; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot { position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; border-radius: 10px; overflow: hidden; border: 1px dashed #343437; background-color: #1a1a1b; background-image: var(--hatch); color: #55555a; cursor: pointer; transition: border-color .12s, color .12s, background-color .12s; }
.slot:hover, .slot:focus-visible { border-color: #6a6a6e; color: var(--text); }
.slot.over { border-color: var(--accent); border-style: solid; color: var(--accent); background-color: #232325; }
.slot.has { border-style: solid; border-color: var(--node-border); background-image: none; background-color: #0a0a0b; cursor: grab; }
.slot.has:hover { border-color: #4a4a4e; }
.slot.has img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slot.dragging { opacity: .45; }
.slot.loading { cursor: progress; border-style: solid; }
.slot.checker.has { background-color: #2b2b2d; background-image: linear-gradient(45deg, #38383b 25%, transparent 25%, transparent 75%, #38383b 75%), linear-gradient(45deg, #38383b 25%, transparent 25%, transparent 75%, #38383b 75%); background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.slot.checker.has img { object-fit: contain; padding: 8px; }
.slot.font { flex-direction: column; gap: 4px; cursor: default; background-color: #1c1c1d; }
.slot.font .aa { font-size: 38px; line-height: 1; color: var(--accent); }
.slot.font .fname { max-width: 90%; font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.font.broken .aa { color: var(--danger); }
.slot .spin { width: 18px; height: 18px; border: 2px solid #3a3a3d; border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.slot .rm { position: absolute; top: 5px; right: 5px; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border-radius: 7px; background: rgba(15,15,16,.82); border: 1px solid rgba(255,255,255,.18); color: var(--text); opacity: 0; transition: opacity .15s; }
.slot:hover .rm, .slot .rm:focus-visible { opacity: 1; }
.slot .rm:hover { background: rgba(255,107,107,.92); color: #141414; }
.lib-filters .import-btn { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
#imports .card { cursor: grab; }
#imports .card.dragging { opacity: .45; }
#imports .card .media { cursor: copy; display: flex; align-items: center; justify-content: center; }
#imports .card .media .audio-ico { color: var(--audio-port); }
#imports .card .media .model-ico { color: var(--image-port); }
.slot.model { flex-direction: column; gap: 4px; } .slot.model .cube3d { color: var(--image-port); display: flex; } .slot.model .fname { max-width: 90%; font-size: 10px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#imports .card .media .fav:hover { background: var(--accent); color: var(--accent-ink); }
/* fichier encore utilisé par un module : le badge prend la place de la corbeille (haut, droite) et mène au module */
#imports .card .media .badge.used { left: auto; right: 7px; top: 7px; bottom: auto; border: 1px solid rgba(255,255,255,.14); cursor: pointer; line-height: 1.2; }
#imports .card .media .badge.used:hover { border-color: var(--accent); color: var(--accent); }
#imports .card .prompt { -webkit-line-clamp: 1; font-family: var(--mono); font-size: 10.5px; }

/* ================================================================= accueil : tous les projets */
body.home #sidebar, body.home #rightbar, body.home #canvas, body.home #footer, body.home .sidepanel, body.home #presence { display: none; }
#home { position: fixed; z-index: 15; top: 56px; left: 0; right: 0; bottom: 0; overflow: auto; background-color: var(--bg); background-image: var(--grid-plus); background-size: 24px 24px; }
#home[hidden] { display: none; }
.home-wrap { max-width: 1480px; margin: 0 auto; padding: 44px 40px 80px; }
.home-head { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.home-head h1 { margin: 0; font-size: 34px; font-weight: 300; letter-spacing: -.02em; line-height: 1; color: var(--accent); }
.home-head h1 b { font-weight: 700; }
.home-head .count { align-self: flex-end; padding-bottom: 3px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.home-head .qwrap { position: relative; display: flex; align-items: center; width: 260px; }
.home-head .qwrap svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.home-head .qwrap input { width: 100%; height: 38px; padding-left: 33px; font-size: 13px; border-radius: 10px; background-color: var(--node); }
.home-head select { height: 38px; font-size: 12.5px; border-radius: 10px; background-color: var(--node); }
.home-head button.primary { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; font-size: 13px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 18px; }
.home-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--text-2); }
.pcard { position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; border-radius: 16px; overflow: hidden; background: var(--node); border: 1px solid var(--node-border); box-shadow: 0 18px 44px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.pcard:hover, .pcard:focus-visible { border-color: #4a4a4e; transform: translateY(-2px); box-shadow: 0 26px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); background: var(--node); }
.pcard .cover { position: relative; aspect-ratio: 16 / 9; background-color: #1f1f21; background-image: var(--hatch); overflow: hidden; }
.pcard .cover img, .pcard .cover video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .cover video.hoveronly { opacity: 0; transition: opacity .25s; }
.pcard .cover video.hoveronly.playing { opacity: 1; }
.pcard .cover.empty { display: flex; align-items: center; justify-content: center; }
.pcard .cover .mono { font-size: 40px; font-weight: 300; letter-spacing: .08em; color: #4a4a4e; }
.pcard .cover .online { position: absolute; left: 10px; top: 10px; display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(15,15,16,.82); font-size: 10.5px; color: var(--text); }
.pcard .cover .online::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.pcard .cover .more { position: absolute; right: 8px; top: 8px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 9px; background: rgba(15,15,16,.82); border: 1px solid rgba(255,255,255,.16); color: var(--text); opacity: 0; transition: opacity .15s; }
.pcard:hover .more, .pcard .more:focus-visible, .pcard .more.open { opacity: 1; }
.pcard .pbody { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px 15px; }
.pcard .l1 { display: flex; align-items: baseline; gap: 10px; }
.pcard h3 { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .usd { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.pcard .l2 { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.pcard .l3 { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pbar { height: 2px; margin-top: 6px; border-radius: 2px; background: #2a2a2c; }
.pcard .pbar i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.pcard .pbar.warn i { background: var(--warn); } .pcard .pbar.over i { background: var(--danger); }
.pcard.new { align-items: center; justify-content: center; gap: 8px; min-height: 250px; background: transparent; border: 1px dashed #3a3a3d; box-shadow: none; color: var(--text-2); }
.pcard.new:hover { background: #19191a; border-style: solid; border-color: #6a6a6e; color: var(--text); box-shadow: none; }
.pcard.new .plus { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.pcard.new .lbl { font-size: 14px; font-weight: 600; color: var(--text); }
.pcard.new .sub { font-size: 11.5px; color: var(--muted); }
@media (max-width: 760px) { .home-wrap { padding: 28px 18px 60px; } .home-head .qwrap { width: 100%; order: 5; } }
@media (max-width: 680px) { .pcard.new { display: none; } } /* sur écran étroit, le bouton « Nouveau projet » suffit */

/* ================================================================= visionneuse */
#viewer { position: fixed; inset: 0; z-index: 40; background: rgba(8,8,9,.86); display: flex; align-items: center; justify-content: center; padding: 28px; }
#viewer .vbox { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; width: min(1200px, 100%); max-height: 100%; background: #171718; border: 1px solid #303032; border-radius: 18px; overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,.7); }
#viewer .stage { position: relative; background: #0a0a0b; display: flex; align-items: center; justify-content: center; min-height: 360px; max-height: 84vh; }
#viewer .stage video, #viewer .stage img { max-width: 100%; max-height: 84vh; object-fit: contain; }
#viewer .side { padding: 24px 22px; overflow: auto; display: flex; flex-direction: column; gap: 18px; border-left: 1px solid var(--hair); }
#viewer .vhead { display: flex; align-items: flex-start; gap: 10px; }
#viewer .vhead .tt { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
#viewer .vhead h2 { margin: 0; font-size: 30px; font-weight: 300; letter-spacing: -.02em; line-height: 1; color: var(--accent); }
#viewer .vhead h2 b { font-weight: 700; }
#viewer .vhead .when { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
#viewer .vclose { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; flex: none; }
#viewer .vacts { display: flex; flex-wrap: wrap; gap: 8px; }
#viewer .vacts button, #viewer .vacts .btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
#viewer .vacts button.on { color: var(--video-port); border-color: #5e3347; }
#viewer .vacts button.on svg { fill: var(--video-port); }
#viewer .btn { color: var(--text); background: var(--raised); border: 1px solid var(--raised-border); text-decoration: none; }
#viewer .btn:hover { background: #2c2c2e; border-color: #444447; }
#viewer dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 9px 12px; margin: 0; padding: 16px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
#viewer dt { font-size: 12px; color: var(--muted); }
#viewer dd { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--text); word-break: break-all; }
#viewer .vprompt { display: flex; flex-direction: column; gap: 8px; }
#viewer .vprompt .ph { display: flex; align-items: center; justify-content: space-between; }
#viewer .vprompt .lbl { font-size: 10px; letter-spacing: .1em; color: var(--muted); }
#viewer .vprompt p { font-size: 13px; line-height: 1.55; margin: 0; color: #d6d6d6; user-select: text; text-wrap: pretty; }
#viewer .vprompt .small { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; font-size: 11.5px; background: transparent; border-radius: 8px; color: #d6d6d6; }
#viewer .vnav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(28,28,29,.9); }
#viewer .vnav.prev { left: 14px; }
#viewer .vnav.next { right: 14px; }
@media (max-width: 900px) { #viewer .vbox { grid-template-columns: 1fr; } }

/* ================================================================= dialogues */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(8,8,9,.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
#modal .box { width: min(440px, 100%); background: var(--node); border: 1px solid #333335; border-radius: 16px; padding: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.05); }
#modal h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
#modal p { margin: 0 0 16px; font-size: 13px; color: #cfcfcf; line-height: 1.5; text-wrap: pretty; }
#modal .pv { border-radius: 10px; overflow: hidden; background: #0a0a0b; margin-bottom: 14px; aspect-ratio: 16 / 9; }
#modal .pv img, #modal .pv video { width: 100%; height: 100%; object-fit: contain; display: block; }
#modal .row { display: flex; justify-content: flex-end; gap: 8px; }
#modal .row button, #modal .row .btn { height: 36px; padding: 0 14px; font-size: 13px; }
#modal .row .btn { display: inline-flex; align-items: center; color: var(--text); background: var(--raised); border: 1px solid var(--raised-border); border-radius: 10px; text-decoration: none; }
#modal input.link { width: 100%; height: 38px; font-size: 13px; margin-bottom: 14px; border-radius: 10px; }
#modal .coverbox { width: min(760px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
#modal .coverbox .lib-grid { flex: 1; min-height: 120px; max-height: 56vh; margin: 0 -6px 16px; padding: 4px 6px 8px; }
#modal .coverbox .lib-grid.tiles { --tile-h: 112px; }
#modal .coverbox .card { cursor: pointer; } #modal .coverbox .card .media { cursor: pointer; }
#modal .coverbox .card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#modal .coverbox .row .auto { margin-right: auto; }
#viewer[hidden], #modal[hidden], #login[hidden] { display: none !important; }

/* ================================================================= connexion */
.btn-google { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; font-size: 12.5px; }
.btn-google::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(#4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0); }
.btn-google.big { padding: 11px 18px; font-size: 14px; }
#login { position: fixed; inset: 0; z-index: 60; background: rgba(10,10,10,.94); display: flex; align-items: center; justify-content: center; padding: 20px; }
#login .box { width: min(400px, 100%); text-align: center; background: var(--node); border: 1px solid #333335; border-radius: 18px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; align-items: center; box-shadow: 0 30px 90px rgba(0,0,0,.65); }
#login .brand img { display: block; height: 46px; width: auto; }
#login p { margin: 0; color: #cfcfcf; font-size: 13px; line-height: 1.5; }
#login p.small { font-size: 11.5px; color: var(--muted); }

/* ================================================================= curseurs des collègues */
#cursors { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 400000; } /* toujours au-dessus des modules et des notes */
.cursor { --c: #fff; position: absolute; left: 0; top: 0; transition: transform .06s linear, opacity .4s; will-change: transform; }
.cursor svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.cursor .lbl { position: absolute; left: 14px; top: 14px; white-space: nowrap; font-size: 10.5px; font-weight: 600; color: #0f0f10; background: var(--c); padding: 2px 7px; border-radius: 999px; }
.cursor.idle { opacity: .35; }

/* ---- Canvas vide : une phrase, avec un reflet irisé qui passe de gauche à droite */
.canvas-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 18px; background: transparent; border: none; border-radius: 12px; cursor: pointer; z-index: 3; }
.canvas-empty span { display: block; font-size: 22px; font-weight: 500; letter-spacing: -.01em; color: transparent; white-space: nowrap;
  background: linear-gradient(100deg, #6e6e72 0%, #6e6e72 34%, #ff6fa8 42%, #f4b942 47%, #5fd39a 52%, #5ec8f2 57%, #c58bff 62%, #6e6e72 70%, #6e6e72 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; animation: empty-sheen 4.2s cubic-bezier(.45,0,.2,1) infinite; }
.canvas-empty:hover, .canvas-empty:focus-visible { background: transparent; border-color: transparent; box-shadow: none; }
.canvas-empty:hover span { filter: brightness(1.3) drop-shadow(0 0 10px rgba(255,255,255,.28)) drop-shadow(0 0 26px rgba(197,139,255,.25)); transition: filter .25s; }
.canvas-empty[hidden] { display: none; }
@keyframes empty-sheen { 0% { background-position: 100% 0; } 55% { background-position: 0% 0; } 100% { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) { .canvas-empty span { animation: none; background-position: 50% 0; } }
.menu-anchor { position: fixed; width: 0; height: 0; pointer-events: none; }
.dropmenu button svg.ico, .dropmenu button > svg { flex: none; width: 14px; height: 14px; }

/* ---- Outils de navigation : haut droite du canvas (sous la barre, à gauche de la barre d'Assets) */
#navtools { position: fixed; z-index: 21; top: 68px; right: 88px; display: flex; align-items: center; gap: 2px; padding: 3px; background: rgba(20,20,21,.92); border: 1px solid var(--raised-border); border-radius: 11px; backdrop-filter: blur(8px); }
#navtools button { display: flex; align-items: center; justify-content: center; height: 28px; min-width: 28px; padding: 0 6px; background: transparent; border: none; border-radius: 8px; color: var(--text-2); }
#navtools button:hover { background: #2a2a2c; color: var(--text); }
#navtools button.on { background: var(--accent); color: var(--accent-ink); }
#navtools button.zoom { min-width: 54px; margin-left: 2px; font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }
body.home #navtools, body.lib-open.narrow #navtools { display: none; }
body.lib-open #navtools { right: calc(88px + var(--panel-w, 440px)); }

/* ---- Suivi d'un collègue */
#presence .avatar.peer { cursor: pointer; transition: box-shadow .15s, transform .15s; }
#presence .avatar.peer:hover, #presence .avatar.peer.open { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3.5px var(--c); }
#presence .avatar.peer.following { box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3.5px var(--c); }
.follow-banner { --c: #fff; position: fixed; z-index: 22; left: 50%; top: 68px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; background: rgba(20,20,21,.94); border: 1px solid var(--c); border-radius: 999px; color: var(--text); font-size: 12.5px; cursor: pointer; }
.follow-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.follow-banner .hint { color: var(--muted); font-size: 11px; }
#canvas.following { box-shadow: inset 0 0 0 2px var(--follow-c, transparent); }

/* ---- Notifications (cloche) */
#notif { display: flex; align-items: center; } #notif:empty { display: none; }
#notif .bell { position: relative; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); }
#notif .bell:hover, #notif .bell.open { background: #1a1a1b; border-color: var(--node-border); color: var(--text); }
#notif .bell.has { color: var(--text); }
#notif .bell .n { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #141414; font-family: var(--mono); font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center; }

/* ---- Notes : mentions, fil de réponses, état résolu */
.mentions { position: fixed; z-index: 76; width: 220px; padding: 4px; background: #1c1c1d; border: 1px solid #333335; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.mentions button { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; background: transparent; border: none; border-radius: 7px; font-size: 12.5px; color: var(--text); text-align: left; }
.mentions button.on, .mentions button:hover { background: #2a2a2c; }
.mentions .av { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #3a3a3d; font-size: 9px; font-weight: 700; color: var(--text); }
.node-note .thread { flex: none; max-height: 42%; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,.18); font-size: 12px; line-height: 1.35; }
.node-note .reply { display: flex; gap: 5px; align-items: baseline; } .node-note .reply b { flex: none; font-weight: 700; } .node-note .reply span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.node-note .donerow { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: rgba(0,0,0,.62); }
.node-note .replyrow { flex: none; }
.node-note .replyrow input { width: 100%; height: 26px; padding: 0 8px; border: 1px solid rgba(0,0,0,.25); border-radius: 7px; background: rgba(255,255,255,.45); color: var(--ink); font-size: 12.5px; }
.node-note .replyrow input:focus-visible { outline: none; border-color: rgba(0,0,0,.6); }
.node-note .nacts { flex: none; display: flex; align-items: center; gap: 4px; padding-right: 18px; }
.node-note .nact { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border: none; border-radius: 999px; background: rgba(0,0,0,.09); color: rgba(0,0,0,.72); font-size: 10.5px; font-weight: 600; opacity: 0; transition: opacity .15s; }
.node-note:hover .nact, .node-note.selected .nact, .node-note.done .nact { opacity: 1; }
.node-note .nact:hover { background: rgba(0,0,0,.18); color: var(--ink); }
.node-note .nacts .sig { flex: 1; min-width: 0; padding-right: 0; text-align: right; }
.node-note.done { opacity: .72; } .node-note.done textarea { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.node-note.done:hover, .node-note.done.selected { opacity: 1; }

/* ---- Rendus glissables */
#library .card { cursor: grab; } #library .card.dragging { opacity: .45; }

/* ---- Boards : fil d'Ariane, accueil (mes derniers boards, filtres, boards d'un projet) */
#project .pname.bname { max-width: 260px; }
.home-head .hchips { display: flex; gap: 4px; margin-left: 10px; }
.home-strip { margin: -6px 0 30px; }
.home-strip[hidden] { display: none; }
.strip-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.strip-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.strip-head .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.strip-row { display: grid; grid-auto-flow: column; grid-auto-columns: 292px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.home-strip .bcard { position: relative; display: flex; flex-direction: row; align-items: center; gap: 11px; padding: 10px 12px 10px 10px; background: var(--node); border: 1px solid var(--node-border); border-radius: 13px; text-align: left; scroll-snap-align: start; transition: border-color .15s, transform .15s; }
.home-strip .bcard:hover { border-color: #4a4a4e; transform: translateY(-1px); }
.home-strip .bcard b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.home-strip .bcard .proj { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.home-strip .bcard .meta { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--muted); }
.home-strip .bcard .online { position: absolute; right: 10px; top: 11px; display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-2); }
.home-strip .bcard .online::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.pcard .boards { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hair); }
.pcard .brow { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; margin: 0 -8px; background: transparent; border: none; border-radius: 7px; color: var(--text); font-size: 12px; text-align: left; }
.pcard .brow:hover { background: #232325; }
.pcard .brow .bn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .brow .bm { flex: none; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.pcard .brow.add { color: var(--text-2); } .pcard .brow.add:hover { color: var(--text); }
.pcard .brow.add svg { flex: none; }
.pcard .bmore { padding: 2px 0 0; font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* ---- Bande « mes derniers boards » : vignette à gauche */
.home-strip .bcard .thumb { flex: none; display: flex; align-items: center; justify-content: center; width: 64px; height: 40px; border-radius: 7px; overflow: hidden; background: #1f1f21; background-image: var(--hatch); color: #4a4a4e; }
.home-strip .bcard .thumb img, .bcard .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-strip .bcard .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home-strip .bcard .txt b, .bcard .txt .proj { max-width: 100%; }
/* ---- Brouillon vidéo et calques */
.node-video .preview .finalize { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; }
.node-video .preview .finalize:disabled { opacity: .5; }
.node-video .preview .draftbadge { position: absolute; right: 10px; top: 10px; z-index: 3; padding: 3px 7px; border-radius: 999px; background: rgba(15,15,16,.82); font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.gthumb .lz { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 2px 5px; border-radius: 6px; background: rgba(15,15,16,.84); font-family: var(--mono); font-size: 9px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gthumb { position: relative; }

/* ---- Couleur d'un module ou d'un groupe (clic droit › pastilles) */
[data-tint="red"] { --tint: #ff6b6b; } [data-tint="orange"] { --tint: #ff9f43; } [data-tint="yellow"] { --tint: #f4d35e; } [data-tint="green"] { --tint: #5fd38d; }
[data-tint="teal"] { --tint: #45c9c0; } [data-tint="blue"] { --tint: #5b9dff; } [data-tint="violet"] { --tint: #a78bfa; } [data-tint="pink"] { --tint: #f58bc0; } [data-tint="none"] { --tint: #8a8a8f; }
.node[data-tint]:not(.node-group) { border-color: color-mix(in srgb, var(--tint) 55%, var(--node-border)); background: color-mix(in srgb, var(--tint) 7%, var(--node)); }
.node[data-tint]:not(.node-group):not(.node-router) > .head { background: color-mix(in srgb, var(--tint) 24%, transparent); border-bottom-color: color-mix(in srgb, var(--tint) 35%, transparent); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.node[data-tint].selected:not(.node-group) { border-color: var(--tint); box-shadow: 0 0 0 1px var(--tint), 0 28px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06); }
.dropmenu .mswatches { display: flex; gap: 6px; padding: 6px 10px 8px; }
.dropmenu .mswatches .sw { flex: none; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--tint); transition: transform .12s; }
.dropmenu .mswatches .sw:hover { background: var(--tint); transform: scale(1.18); }
.dropmenu .mswatches .sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px #1c1c1d inset; }
.dropmenu .mswatches .sw[data-tint="none"] { background: transparent; border: 2px dashed #5a5a5e; }
.dropmenu .mswatches .sw[data-tint="none"].on { border-style: solid; border-color: var(--accent); }
/* ---- Groupe : cadre sous les modules ; seul le titre et le coin se saisissent, l'intérieur laisse passer les clics */
.node-group:not([data-tint]) { --tint: #8a8a8f; }
.node-group { z-index: 0; width: auto; pointer-events: none; background: color-mix(in srgb, var(--tint) 9%, transparent); border: 1.5px solid color-mix(in srgb, var(--tint) 60%, transparent); border-radius: 18px; box-shadow: none; }
.node-group.selected { border-color: var(--tint); box-shadow: 0 0 0 1px var(--tint); }
.node-group .ghead { position: absolute; left: 12px; top: 10px; max-width: calc(100% - 24px); display: flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 8px; background: color-mix(in srgb, var(--tint) 30%, #1c1c1d); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: grab; pointer-events: auto; }
.node-group .gtitle { min-width: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; }
.node-group .gtitle[contenteditable="true"] { cursor: text; text-overflow: clip; box-shadow: 0 1px 0 var(--accent); }
.node-group .body { display: none; }
.node-group .resize { position: absolute; right: 2px; bottom: 2px; display: flex; align-items: flex-end; justify-content: flex-end; width: 24px; height: 24px; padding: 3px; color: color-mix(in srgb, var(--tint) 80%, transparent); cursor: nwse-resize; pointer-events: auto; }
#canvas.hand .node-group .ghead, #canvas.hand .node-group .resize { pointer-events: none; }
body[data-role="viewer"] #world .node-group .ghead, body[data-role="viewer"] #world .node-group .resize, body[data-role="commenter"] #world .node-group .ghead, body[data-role="commenter"] #world .node-group .resize { pointer-events: none; }
