/* ============================================================
   MODULE — TABLEAUX DE BORD PERSONNALISABLES (0.4.27.P2, TDB)

   Toutes les classes sont préfixées `t-` : le module pose des fenêtres,
   des graphiques et un éditeur de graphe dans la vue, et les noms
   naturels (.bar, .tbl, .note, .chips, .modal, .inp…) sont déjà pris par
   components.css. Les couleurs, ombres et polices viennent de tokens.css :
   rien n'est écrit en dur ici, sauf la palette des séries (choisie par
   l'utilisateur) et les couleurs de types du graphe, portées par le JS.

   ANGLES. Plus carrés que les panneaux du reste de l'ERP, à la demande de
   la maîtrise d'ouvrage (maquette du 2026-10-02). Un seul jeu de variables,
   ci-dessous, pour les régler.
   ============================================================ */
.t-root, .t-at, .t-modal {
  --t-r-win: 6px;
  --t-r-carte: 6px;
  --t-r-ctl: 4px;
  --t-r-min: 3px;
}

/* ---------- Barre d'outils du module ---------- */
.t-root { position: relative; }
.t-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.t-top .t-sp { flex: 1; }
.t-tabs { display: flex; gap: 2px; background: var(--panneau); padding: 4px; border-radius: 999px; box-shadow: var(--o-carte); flex-wrap: wrap; }
.t-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: 500 12.5px var(--sans); color: var(--encre2); cursor: pointer; }
.t-tabs button:hover { background: var(--voile); }
.t-tabs button.t-on { background: var(--encre); color: var(--panneau); }
.t-tabs button.t-add { color: var(--encre3); padding: 6px 11px; }
.t-tabs input { border: 0; outline: 0; background: var(--voile); border-radius: 999px; padding: 6px 12px; width: 160px; font: 500 12.5px var(--sans); color: var(--encre); }
.t-btn-on { background: var(--ia-voile) !important; color: var(--ia) !important; box-shadow: 0 0 0 1px var(--ia) inset; }
.t-hint { display: flex; gap: 18px; align-items: center; background: var(--ia-voile); color: var(--ia); border-radius: var(--t-r-carte); padding: 9px 14px; font-size: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.t-hint b { font-weight: 600; }
.t-etat { font-size: 11.5px; color: var(--encre3); }
.t-etat.t-bad { color: var(--alerte); }

/* ---------- Grille ---------- */
.t-board { position: relative; touch-action: none; }
.t-board.t-edit { cursor: crosshair; }
.t-cell { position: absolute; border-radius: var(--t-r-min); border: 1px dashed color-mix(in srgb, var(--encre4) 70%, transparent); pointer-events: none; }
.t-ghost { position: absolute; border-radius: var(--t-r-win); background: color-mix(in srgb, var(--ia) 12%, transparent); border: 2px dashed var(--ia); pointer-events: none; z-index: 40; display: flex; align-items: center; justify-content: center; font: 600 13px var(--sans); color: var(--ia); }
.t-vide { padding: 60px 20px; text-align: center; color: var(--encre3); font-size: 13px; }

/* ---------- Fenêtre ---------- */
.t-win { position: absolute; box-sizing: border-box; --win-bg: var(--panneau); background: var(--win-bg); border-radius: var(--t-r-win); box-shadow: var(--o-pan); display: flex; flex-direction: column; overflow: hidden; color: var(--encre); font-family: var(--sans); }
.t-win.t-f-papier { --win-bg: var(--papier); }
.t-win.t-f-contraste { --win-bg: var(--contraste-fond); --encre: var(--contraste-texte);
  --encre2: color-mix(in srgb, var(--contraste-texte) 74%, transparent); --encre3: color-mix(in srgb, var(--contraste-texte) 58%, transparent);
  --trait: color-mix(in srgb, var(--contraste-texte) 14%, transparent); --trait2: color-mix(in srgb, var(--contraste-texte) 8%, transparent);
  --voile: color-mix(in srgb, var(--contraste-texte) 10%, transparent); }
.t-win.t-f-teinte { --win-bg: color-mix(in srgb, var(--accent) 11%, var(--panneau)); }
.t-win.t-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); }
.t-win.t-alert { box-shadow: 0 0 0 2px var(--alerte), var(--o-pan); }
.t-win.t-blank { background: transparent; box-shadow: none; border: 2px dashed var(--encre4); }
.t-win-h { display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px 0; height: 46px; flex-shrink: 0; box-sizing: border-box; }
.t-win-t { flex: 1; min-width: 0; }
.t-win-t b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-win-t small { display: block; font-size: 11.5px; color: var(--encre3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-win-act { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.t-win:hover .t-win-act, .t-board.t-edit .t-win-act { opacity: 1; }
.t-win-act button { border: 0; background: none; width: 26px; height: 26px; border-radius: var(--t-r-min); display: grid; place-items: center; color: var(--encre3); cursor: pointer; }
.t-win-act button:hover { background: var(--voile); color: var(--encre); }
.t-win-act svg { width: 15px; height: 15px; }
.t-board.t-edit .t-win-h { cursor: grab; }
.t-badge-al { font-size: 11px; font-weight: 600; color: var(--alerte); background: var(--alerte-voile); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.t-win-b { flex: 1; min-height: 0; position: relative; padding: 6px 16px 14px; }
.t-win.t-notitle .t-win-b { padding: 14px 16px; }
.t-win-rz { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; cursor: nwse-resize; display: none; color: var(--encre3); }
.t-board.t-edit .t-win-rz { display: block; }
.t-win.t-dragging { z-index: 30; opacity: .85; box-shadow: var(--o-flot); transition: none; }
.t-blank-c { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--encre3); text-align: center; }
.t-blank-c b { color: var(--encre2); font-weight: 600; }

/* ---------- Formes ---------- */
.t-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--encre3); font-size: 12px; padding: 8px; }
.t-empty.t-bad { color: var(--alerte); }
.t-lg { display: flex; gap: 12px; height: 24px; align-items: center; overflow: hidden; white-space: nowrap; font-size: 11.5px; color: var(--encre2); }
.t-lg span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.t-lg i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.t-lg i.t-dash { height: 0; border-top: 2px dashed; border-radius: 0; background: none !important; }
.t-chw { position: relative; }
svg.t-ch { display: block; overflow: visible; }
svg.t-ch .t-gl { stroke: var(--trait); stroke-width: 1; }
svg.t-ch .t-zl { stroke: var(--encre4); stroke-width: 1; }
svg.t-ch .t-ax { fill: var(--encre3); font: 400 11px var(--sans); }
svg.t-ch .t-vl { fill: var(--encre2); font: 500 10.5px var(--sans); }
svg.t-ch .t-rl { font: 500 11px var(--sans); paint-order: stroke; stroke: var(--win-bg); stroke-width: 3px; }
svg.t-ch .t-guide { stroke: var(--encre3); stroke-width: 1; stroke-dasharray: 3 3; }
.t-tip { position: absolute; pointer-events: none; background: var(--panneau); color: var(--encre); border-radius: var(--t-r-ctl); box-shadow: var(--o-flot); padding: 8px 10px; font-size: 11.5px; min-width: 150px; z-index: 5; display: none; }
.t-f-contraste .t-tip { --encre: var(--contraste-fond); background: var(--contraste-texte); }
.t-tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.t-tip div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.t-tip i { width: 8px; height: 8px; border-radius: 2px; }
.t-tip span { margin-left: auto; padding-left: 12px; font-weight: 600; }

.t-kpi { height: 100%; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.t-kpi-v { font-weight: 600; letter-spacing: -.03em; line-height: 1.05; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-kpi-cmp { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--encre3); flex-wrap: wrap; }
.t-kpi-cmp b { color: var(--encre); font-weight: 600; }
.t-pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.t-pill.t-ok { background: var(--ok-voile); color: var(--ok); }
.t-pill.t-bad { background: var(--alerte-voile); color: var(--alerte); }
.t-f-contraste .t-pill.t-ok { background: color-mix(in srgb, var(--ok) 26%, transparent); color: color-mix(in srgb, var(--ok) 55%, var(--contraste-texte)); }
.t-f-contraste .t-pill.t-bad { background: color-mix(in srgb, var(--alerte) 26%, transparent); color: color-mix(in srgb, var(--alerte) 55%, var(--contraste-texte)); }
.t-kpi .t-spark { margin-top: auto; }

.t-hb { height: 100%; overflow: auto; display: flex; flex-direction: column; }
.t-hb-r { display: grid; grid-template-columns: minmax(70px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 12px; min-height: 22px; }
.t-hb-r .t-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--encre2); }
.t-hb-r .t-t { height: 12px; background: var(--trait2); border-radius: 2px; overflow: hidden; }
.t-hb-r .t-t div { height: 100%; border-radius: 2px; }
.t-hb-r .t-v { font-weight: 600; white-space: nowrap; font-size: 11.5px; }

.t-dn { height: 100%; display: flex; gap: 14px; align-items: center; justify-content: center; }
.t-dn.t-col { flex-direction: column; gap: 8px; }
.t-dn-l { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; min-width: 0; max-width: 100%; }
.t-dn-l div { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.t-dn-l i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.t-dn-l span { overflow: hidden; text-overflow: ellipsis; color: var(--encre2); }
.t-dn-l b { margin-left: auto; padding-left: 10px; font-weight: 600; }

.t-tbl { height: 100%; overflow: auto; }
.t-tbl table { width: 100%; border-collapse: collapse; font-size: 12px; }
.t-tbl th { position: sticky; top: 0; background: var(--win-bg); text-align: right; font-weight: 500; font-size: 11px; color: var(--encre3); padding: 6px 8px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.t-tbl th:first-child, .t-tbl td:first-child { text-align: left; }
.t-tbl th i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.t-tbl td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--trait2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-tbl.t-zebra tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--encre) 3%, transparent); }
.t-tbl td.t-neg { color: var(--alerte); }
.t-tbl tfoot td { font-weight: 600; border-top: 1px solid var(--trait); border-bottom: 0; position: sticky; bottom: 0; background: var(--win-bg); }

.t-txt { height: 100%; overflow: auto; line-height: 1.5; color: var(--encre); }
.t-txt b { font-weight: 600; }
.t-txt .t-ph { color: var(--c); font-weight: 600; }
.t-txt .t-ph-miss { color: var(--encre3); font-family: var(--mono); font-size: .85em; background: var(--voile); padding: 0 4px; border-radius: 4px; }
.t-gauge { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ---------- Atelier (surcouche, hors de #root) ---------- */
.t-at { position: fixed; inset: 0; background: var(--voile-modal); z-index: 900; display: flex; padding: 16px; font-family: var(--sans); color: var(--encre); font-size: 13.5px; }
.t-at[hidden], .t-modal[hidden] { display: none; }
.t-at button, .t-at input, .t-at select, .t-at textarea, .t-modal button { font: inherit; color: inherit; }
.t-at button { cursor: pointer; }
.t-at-box { flex: 1; background: var(--fond); border-radius: var(--t-r-win); box-shadow: var(--o-flot); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.t-at-h { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--panneau); border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.t-at-title { display: flex; flex-direction: column; min-width: 180px; }
.t-eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre3); font-weight: 600; }
.t-at-title input { border: 0; outline: 0; background: none; font-size: 16px; font-weight: 600; padding: 0; letter-spacing: -.01em; }
.t-steps { display: flex; gap: 4px; background: var(--voile); padding: 4px; border-radius: 999px; margin: 0 auto; }
.t-steps button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 500; color: var(--encre2); }
.t-steps button.t-on { background: var(--panneau); color: var(--encre); box-shadow: var(--o-carte); }
.t-steps .t-sep { font-size: 11px; color: var(--encre3); padding: 0 4px 0 10px; border-left: 1px solid var(--trait); margin-left: 4px; align-self: center; }
.t-at-actions { display: flex; gap: 6px; }
.t-at-body { flex: 1; min-height: 0; display: flex; }
.t-at-body > div { flex: 1; min-width: 0; min-height: 0; }

.t-pan { background: var(--panneau); border-radius: var(--t-r-carte); box-shadow: var(--o-carte); }
.t-sec { padding: 14px 16px; border-bottom: 1px solid var(--trait2); }
.t-sec:last-child { border-bottom: 0; }
.t-sec h4 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre3); font-weight: 600; }
.t-sec p { margin: 0 0 8px; font-size: 12px; color: var(--encre2); }
.t-fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.t-fld label, .t-lbl { font-size: 11.5px; color: var(--encre2); }
.t-fld input[type=text], .t-fld input[type=number], .t-fld select, .t-fld textarea, .t-inp { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--t-r-ctl); padding: 7px 10px; font-size: 12.5px; outline: 0; width: 100%; box-sizing: border-box; color: var(--encre); }
.t-fld textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.t-fld input:focus, .t-fld select:focus, .t-fld textarea:focus, .t-inp:focus { border-color: var(--encre3); }
.t-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t-seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--voile); padding: 3px; border-radius: var(--t-r-ctl); }
.t-seg button { flex: 1; border: 0; background: none; border-radius: var(--t-r-min); padding: 5px 8px; font-size: 12px; color: var(--encre2); white-space: nowrap; }
.t-seg button.t-on { background: var(--panneau); color: var(--encre); font-weight: 600; box-shadow: var(--o-carte); }
.t-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 5px 0; }
.t-sw input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--encre4); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; margin: 0; }
.t-sw input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); transition: left .15s; box-shadow: var(--o-knob); }
.t-sw input:checked { background: var(--ok); }
.t-sw input:checked::after { left: 16px; }
.t-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.t-types button, .t-alt button { border: 1px solid var(--trait); background: var(--papier); border-radius: var(--t-r-ctl); padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--encre2); }
.t-types button svg { width: 30px; height: 22px; }
.t-types button.t-on, .t-alt button.t-on { border-color: var(--encre); background: var(--panneau); color: var(--encre); font-weight: 600; box-shadow: 0 0 0 1px var(--encre); }
.t-alt { display: flex; gap: 6px; flex-wrap: wrap; }
.t-alt button { min-width: 62px; padding: 6px 8px; }
.t-alt button svg { width: 28px; height: 20px; }
.t-slot { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.t-slot .t-tag { font: 500 10.5px var(--mono); color: var(--encre3); width: 22px; flex-shrink: 0; }
.t-slot .t-ty { font-size: 10.5px; color: var(--encre3); white-space: nowrap; }
.t-cpick { position: relative; width: 26px; height: 26px; border-radius: var(--t-r-min); flex-shrink: 0; box-shadow: inset 0 0 0 1px var(--trait); overflow: hidden; display: inline-block; }
.t-cpick input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.t-pals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.t-pals button { border: 1px solid var(--trait); background: var(--papier); border-radius: var(--t-r-ctl); padding: 6px 8px; display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--encre2); text-align: left; }
.t-pals button.t-on { border-color: var(--encre); color: var(--encre); font-weight: 600; }
.t-pals .t-st { display: flex; height: 8px; border-radius: 3px; overflow: hidden; }
.t-pals .t-st i { flex: 1; }
.t-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.t-chips button { border: 1px solid var(--trait); background: var(--papier); border-radius: 999px; padding: 2px 9px; font: 500 11px var(--mono); color: var(--encre2); }
.t-swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.t-swatches button { width: 22px; height: 22px; border-radius: var(--t-r-min); border: 0; box-shadow: inset 0 0 0 1px var(--trait); }
.t-swatches button.t-on { box-shadow: 0 0 0 2px var(--panneau), 0 0 0 4px var(--encre); }
.t-note { font-size: 11.5px; color: var(--encre3); }
.t-note.t-warn { color: var(--ambre); background: var(--ambre-voile); padding: 8px 10px; border-radius: var(--t-r-ctl); }
.t-cta { display: flex; flex-direction: column; gap: 6px; }
.t-cta .btn { justify-content: center; }

/* modèles prêts */
.t-g-mod { display: grid; grid-template-columns: 200px 1fr 360px; gap: 12px; padding: 12px; min-height: 0; }
.t-cats { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding-bottom: 8px; }
.t-cats button { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 7px 14px; font-size: 12.5px; color: var(--encre2); }
.t-cats button span { flex: 1; }
.t-cats button em { font-style: normal; font-size: 11px; color: var(--encre3); }
.t-cats button.t-on { background: var(--papier); color: var(--encre); font-weight: 600; box-shadow: inset 2px 0 0 var(--encre); }
.t-gal { overflow: auto; min-height: 0; padding: 2px; }
.t-gal h5 { margin: 4px 2px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre3); font-weight: 600; }
.t-gal-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.t-card { background: var(--panneau); border-radius: var(--t-r-carte); box-shadow: 0 0 0 1px var(--trait); cursor: pointer; display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .12s; }
.t-card:hover { box-shadow: 0 0 0 1px var(--encre3), var(--o-survol); }
.t-card.t-on { box-shadow: 0 0 0 2px var(--encre); }
.t-card .t-cp { height: 118px; background: var(--fond); overflow: hidden; position: relative; pointer-events: none; }
.t-card .t-cp > div { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.t-card .t-cp .t-win { position: relative; box-shadow: var(--o-carte); }
.t-card .t-ct { padding: 8px 10px 10px; }
.t-card .t-ct b { display: block; font-size: 12.5px; font-weight: 600; }
.t-card .t-ct span { display: block; font-size: 11px; color: var(--encre3); line-height: 1.35; margin-top: 2px; }
.t-mod-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.t-mod-side .t-pan:first-child { flex-shrink: 0; }
.t-mod-side .t-pv { flex: 1 0 260px; }
.t-bmenu { position: absolute; z-index: 60; background: var(--panneau); border-radius: var(--t-r-carte); box-shadow: var(--o-flot); padding: 6px; width: 300px; }
.t-bmenu button { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: var(--t-r-ctl); padding: 8px 10px; cursor: pointer; color: var(--encre); font-family: var(--sans); }
.t-bmenu button:hover { background: var(--voile); }
.t-bmenu b { display: block; font-size: 12.5px; font-weight: 600; }
.t-bmenu span { display: block; font-size: 11px; color: var(--encre3); }
.t-bmenu hr { border: 0; border-top: 1px solid var(--trait); margin: 4px 0; }

/* aperçu */
.t-pv { display: flex; flex-direction: column; min-height: 0; }
.t-pv-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre3); font-weight: 600; }
.t-pv-h span { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; }
.t-pv-box { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; background: repeating-conic-gradient(var(--fond) 0% 25%, color-mix(in srgb, var(--fond) 70%, var(--voile2)) 0% 50%) 0 0 / 16px 16px; border-radius: var(--t-r-ctl); margin: 0 10px 10px; overflow: hidden; }
.t-pv-stage { position: relative; }
.t-pv-stage > div { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.t-pv-stage .t-win { position: relative; }

/* contenu : graphe de variables */
.t-g-con { display: grid; grid-template-columns: 232px 1fr 350px; gap: 12px; padding: 12px; min-height: 0; }
.t-lib { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.t-lib-h { padding: 12px 14px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre3); font-weight: 600; }
.t-lib-s { margin: 0 10px 8px; width: calc(100% - 20px) !important; }
.t-lib-l { flex: 1; overflow: auto; padding-bottom: 10px; }
.t-lib-c { display: flex; align-items: center; gap: 7px; width: 100%; border: 0; background: none; padding: 7px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--encre2); font-weight: 600; text-align: left; }
.t-lib-c i { width: 8px; height: 8px; border-radius: 50%; }
.t-lib-c span { flex: 1; }
.t-lib-c em { font-style: normal; color: var(--encre3); font-weight: 400; }
.t-lib-i { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 26px; font-size: 12.5px; cursor: grab; border-left: 2px solid transparent; user-select: none; }
.t-lib-i:hover { background: var(--papier); border-left-color: var(--fc); }
.t-lib-i .t-tt { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.t-lib-i button { border: 0; background: none; color: var(--encre3); padding: 0 4px; font-size: 15px; line-height: 1; opacity: 0; }
.t-lib-i:hover button { opacity: 1; }
.t-cv { position: relative; overflow: hidden; border-radius: var(--t-r-carte); background-color: var(--papier); background-image: radial-gradient(circle, var(--encre4) 1px, transparent 1.3px); touch-action: none; }
.t-cv.t-pend { cursor: crosshair; }
.t-cv-l { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.t-wires { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.t-wires .t-w { pointer-events: visibleStroke; cursor: pointer; }
.t-wires .t-w:hover path.t-vis { stroke-width: 3.5; }
.t-cv-tb { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: var(--panneau); border-radius: 999px; padding: 4px 6px; box-shadow: var(--o-pan); font-size: 11.5px; z-index: 5; }
.t-cv-tb button { border: 0; background: none; border-radius: 999px; padding: 3px 9px; color: var(--encre2); }
.t-cv-tb button:hover { background: var(--voile); }
.t-cv-tb span { font: 500 11px var(--mono); min-width: 42px; text-align: center; color: var(--encre3); }
.t-cv-hint { position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: var(--encre3); background: var(--panneau); border-radius: var(--t-r-min); padding: 4px 10px; box-shadow: var(--o-carte); pointer-events: none; max-width: calc(100% - 24px); }
.t-tlg { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--encre3); }
.t-tlg span { display: inline-flex; align-items: center; gap: 5px; }
.t-tlg i { width: 9px; height: 9px; border-radius: 50%; }
.t-nd { position: absolute; width: 196px; background: var(--panneau); border-radius: var(--t-r-carte); box-shadow: 0 0 0 1px var(--trait), var(--o-carte); user-select: none; }
.t-nd.t-sel { box-shadow: 0 0 0 1.5px var(--fc), 0 0 0 5px color-mix(in srgb, var(--fc) 18%, transparent), var(--o-pan); }
.t-nd-h { height: 30px; box-sizing: border-box; display: flex; align-items: center; gap: 7px; padding: 0 6px 0 10px; border-bottom: 1px solid var(--trait); border-radius: var(--t-r-carte) var(--t-r-carte) 0 0; background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 16%, transparent), transparent 85%); cursor: grab; }
.t-nd-h .t-d { width: 8px; height: 8px; border-radius: 50%; background: var(--fc); flex-shrink: 0; }
.t-nd-h b { flex: 1; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-nd-h button { border: 0; background: none; color: var(--encre3); width: 20px; height: 20px; border-radius: var(--t-r-min); font-size: 11px; }
.t-nd-h button:hover { color: var(--alerte); background: var(--alerte-voile); }
.t-nd-p { position: relative; }
.t-pr { position: absolute; height: 22px; display: flex; align-items: center; gap: 6px; font: 500 10.5px var(--mono); color: var(--encre3); white-space: nowrap; }
.t-pr.t-in { left: 0; }
.t-pr.t-out { right: 0; flex-direction: row-reverse; }
.t-port { width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--pc); background: var(--panneau); cursor: crosshair; flex-shrink: 0; transition: box-shadow .12s; }
.t-pr.t-in .t-port { margin-left: -6px; }
.t-pr.t-out .t-port { margin-right: -6px; }
.t-port.t-on { background: var(--pc); }
.t-port:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 25%, transparent); }
.t-cv.t-pend .t-port.t-in { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 22%, transparent); }
.t-port.t-flash { animation: t-shake .35s; border-color: var(--alerte) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--alerte) 30%, transparent); }
@keyframes t-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.t-nd-c { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 8px 6px; }
.t-nd-c span { font: 400 10px var(--mono); color: var(--encre2); background: var(--voile); padding: 1px 5px; border-radius: 4px; }
.t-nd-v { border-top: 1px solid var(--trait2); padding: 5px 9px 6px; font-size: 11px; color: var(--encre2); display: flex; flex-direction: column; gap: 2px; }
.t-nd-v div { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.t-nd-v em { font-style: normal; color: var(--encre3); font: 400 10px var(--mono); }
.t-nd-v b { font-weight: 600; color: var(--encre); overflow: hidden; text-overflow: ellipsis; }
.t-nd-v .t-vrai { color: var(--ok); font-weight: 600; }
.t-nd-v .t-faux { color: var(--encre3); font-weight: 600; }
.t-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.t-insp { flex: 1; min-height: 0; overflow: auto; }
.t-side .t-pv { height: 300px; flex-shrink: 0; }
.t-insp-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 4px; }
.t-insp-h i { width: 9px; height: 9px; border-radius: 50%; }
.t-insp-h b { font-size: 14px; font-weight: 600; flex: 1; }
.t-insp-h small { font-size: 11px; color: var(--encre3); }
.t-plist div { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 4px; }
.t-plist i { width: 8px; height: 8px; border-radius: 50%; }
.t-plist span { margin-left: auto; font: 400 10.5px var(--mono); color: var(--encre3); }
.t-btn-del { width: 100%; border: 1px solid color-mix(in srgb, var(--alerte) 35%, transparent); background: var(--alerte-voile); color: var(--alerte); border-radius: var(--t-r-ctl); padding: 7px; font-size: 12px; font-weight: 600; }

/* forme */
.t-g-forme { display: grid; grid-template-columns: 380px 1fr; gap: 12px; padding: 12px; min-height: 0; }
.t-g-forme .t-ctl { overflow: auto; }
.t-g-forme .t-pv { min-height: 0; }

/* fenêtre JSON */
.t-modal { position: fixed; inset: 0; background: var(--voile-modal); z-index: 950; display: grid; place-items: center; padding: 16px; font-family: var(--sans); color: var(--encre); }
.t-modal-box { background: var(--panneau); border-radius: var(--t-r-win); box-shadow: var(--o-flot); width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column; }
.t-modal-box header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--trait); }
.t-modal-box header b { flex: 1; }
.t-modal-box pre { margin: 0; padding: 14px 16px; overflow: auto; font: 400 11.5px/1.5 var(--mono); color: var(--encre2); }

@media (max-width: 1100px) {
  .t-g-con { grid-template-columns: 200px 1fr; grid-template-rows: minmax(420px, 1fr) auto; }
  .t-g-con .t-side { grid-column: 1 / -1; flex-direction: row; }
  .t-g-con .t-side > * { flex: 1; }
  .t-g-forme { grid-template-columns: 1fr; }
  .t-g-forme .t-pv { height: 420px; }
  .t-g-mod { grid-template-columns: 180px 1fr; }
  .t-g-mod .t-mod-side { grid-column: 1 / -1; flex-direction: row; }
  .t-g-mod .t-mod-side > * { flex: 1; }
  .t-at-body { overflow: auto; }
}
@media (max-width: 720px) {
  .t-at { padding: 0; }
  .t-at-box { border-radius: 0; }
  .t-g-con, .t-g-mod { grid-template-columns: 1fr; }
  .t-g-con .t-lib, .t-g-mod .t-cats { max-height: 220px; }
  .t-g-con .t-side, .t-g-mod .t-mod-side { flex-direction: column; }
  .t-types { grid-template-columns: repeat(4, 1fr); }
}
