/* tableaux.css : écran « Tableaux de bord » (tableaux.js, lot C). Jetons et classes d'app.css ; palette du moteur
   graphique (--graph-1 à --graph-16, graphiques.css). Aucun style en ligne : positions posées par le CSSOM
   (grid-column, grid-row, --tb-rang, --tb-rangees). La page ne défile jamais : seuls la liste, la toile et les
   panneaux défilent à l'intérieur. */

.metier-hote[data-ecran="tableaux"] { overflow: hidden; }

/* ---------- Liste des tableaux et des modèles ---------- */
.tb-liste-ecran { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.tb-liste-ecran .barre-outils .champ { width: 220px; height: 20px; }
.tb-liste { flex: 1 1 0; min-height: 0; overflow: auto; background: var(--bg-0); padding: var(--e4); display: grid; align-content: start; gap: var(--e4); }
.tb-sec { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; }
.tb-sec > .d-titre { border-top: 0; }
.tb-sec .d-note { padding: var(--e3) var(--e4) 0; }
.tb-table td.tb-actions { display: flex; align-items: center; gap: var(--e2); }
.tb-table .w-act { width: 330px; }
.tb-lien { display: inline-flex; align-items: center; gap: var(--e2); max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--accent-texte); font: inherit; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tb-lien:hover { text-decoration: underline; }
.tb-modeles { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--e4); padding: var(--e4); }
.tb-modele { display: grid; gap: var(--e2); align-content: start; padding: var(--e4); border: 1px solid var(--line); border-radius: var(--r3); background: var(--grid-bg); }
.tb-modele:hover { border-color: var(--line-fort); }
.tb-modele b { font-size: var(--fs-l); }
.tb-modele span { color: var(--ink-2); font-size: var(--fs-s); line-height: 1.45; }
.tb-modele small { color: var(--ink-2); font-size: var(--fs-xs); }
.tb-modele .btn { justify-self: start; margin-top: var(--e2); }
.tb-modele-minis { display: flex; gap: var(--e2); flex-wrap: wrap; }

/* ---------- Aperçus schématiques des graphiques ---------- */
.tb-mini { width: 40px; height: 28px; flex: none; border: 1px solid var(--line); border-radius: var(--r1); background: var(--bg-1); }
.tb-mini .a { fill: var(--graph-1); }
.tb-mini .b { fill: var(--graph-2); }
.tb-mini .c { fill: var(--graph-3); }
.tb-mini .d { fill: var(--graph-4); }
.tb-mini .g { fill: var(--bg-3); }
.tb-mini .g0 { fill: none; stroke: var(--line-fort); stroke-width: 1; }
.tb-mini .f1 { fill: var(--graph-1); fill-opacity: .55; }
.tb-mini .f2 { fill: var(--graph-2); fill-opacity: .55; }
.tb-mini .f3 { fill: var(--graph-3); fill-opacity: .55; }
.tb-mini .l1, .tb-mini .l2, .tb-mini .l3, .tb-mini .l1e { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tb-mini .l1, .tb-mini .l1e { stroke: var(--graph-1); }
.tb-mini .l1e { stroke-width: 3.5; }
.tb-mini .l2 { stroke: var(--graph-3); }
.tb-mini .l3 { stroke: var(--bg-3); stroke-width: 3.5; }
.tb-mini .ax { stroke: var(--ink-2); stroke-width: 1; }
.tb-mini .lim { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 2 2; }
.tb-mini .o1 { fill-opacity: .3; }
.tb-mini .o2 { fill-opacity: .6; }
.tb-mini .o3 { fill-opacity: 1; }

/* ---------- Tableau ouvert ---------- */
.tb-ecran { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.tb-barre { flex: none; height: 28px; display: flex; align-items: center; gap: var(--e4); padding: 0 var(--e3) 0 var(--e4); background: var(--bg-1); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tb-b-titre { display: inline-flex; align-items: center; gap: var(--e3); min-width: 0; }
.tb-b-titre b { font-size: var(--fs-l); overflow: hidden; text-overflow: ellipsis; }
.tb-modifie { border-color: var(--warn); color: var(--warn); }
.tb-b-info { flex: 1; min-width: 0; color: var(--ink-2); font-size: var(--fs-s); overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tb-b-actions { display: inline-flex; align-items: center; gap: var(--e2); }
.tb-seg { display: inline-flex; }
.tb-seg .btn { border-radius: 0; }
.tb-seg .btn:first-child { border-radius: var(--r2) 0 0 var(--r2); }
.tb-seg .btn:last-child { border-radius: 0 var(--r2) var(--r2) 0; border-left: 0; }

.tb-toile { position: relative; flex: 1 1 0; min-height: 0; overflow: auto; padding: 4px; background: var(--bg-0); }
.tb-grille { --tb-rang: 40px; --tb-rangees: 12; position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(var(--tb-rangees), var(--tb-rang)); grid-auto-rows: var(--tb-rang); min-height: 100%; }
.tb-ecran[data-mode="conception"] .tb-grille { min-height: 0; background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px); background-size: calc(100% / 12) var(--tb-rang); outline: 1px solid var(--grid-line); }

.tb-visuel { position: relative; min-width: 0; min-height: 0; margin: 3px; display: flex; flex-direction: column; background: var(--grid-bg); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; transition: border-color var(--duree), box-shadow var(--duree); }
.tb-visuel:hover { border-color: var(--line-fort); }
.tb-visuel:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tb-visuel.tb-choisi { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tb-visuel.tb-glisse { opacity: .55; }
.tb-v-tete { flex: none; height: 22px; display: flex; align-items: center; gap: var(--e2); padding: 0 var(--e1) 0 var(--e4); border-bottom: 1px solid var(--grid-line); }
.tb-v-titre { flex: 1; min-width: 0; font-size: var(--fs-m); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-v-badges { display: inline-flex; align-items: center; gap: var(--e1); }
.tb-badge { display: inline-flex; align-items: center; gap: 2px; height: 16px; padding: 0 4px; border: 1px solid var(--line-fort); border-radius: var(--r1); background: transparent; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.tb-badge.tb-forage { border-color: var(--info); color: var(--info); cursor: pointer; }
.tb-badge.tb-forage:hover { background: var(--info-bg); }
.tb-badge.tb-prov { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.tb-badge.tb-err { border-color: var(--bad); color: var(--bad); }
.tb-v-corps { position: relative; flex: 1 1 0; min-height: 0; padding: var(--e2) var(--e3) var(--e2); overflow: hidden; }
.tb-v-corps .gg-titre { display: none; }
.tb-v-corps > .chargement { padding: var(--e4); }
.tb-v-msg { height: 100%; display: flex; align-items: center; justify-content: center; padding: var(--e4); overflow: auto; }
.tb-v-msg .message { max-width: 100%; }
/* Visuel sans valeur : « n.d. : raison », même taille et même couleur que le message du moteur (gg-vide, 13 px). */
.tb-nd { max-width: 52ch; color: var(--ink-2); font-size: var(--fs-l); line-height: 1.45; text-align: center; }
.tb-nd .nd { font-weight: 400; }
.tb-poignee { display: none; position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--line-fort) 50%, var(--line-fort) 60%, transparent 60%, transparent 70%, var(--line-fort) 70%, var(--line-fort) 80%, transparent 80%); }
.tb-ecran[data-mode="conception"] .tb-poignee { display: block; }
.tb-ecran[data-mode="conception"] .tb-v-tete { cursor: move; background: var(--bg-2); }
.tb-ecran[data-mode="conception"] .tb-v-tete button { cursor: pointer; }
/* Glisser au doigt ou au stylet : le navigateur ne prend pas le geste (sinon pointercancel interrompt le déplacement). */
.tb-ecran[data-mode="conception"] .tb-v-tete, .tb-ecran[data-mode="conception"] .tb-poignee { touch-action: none; }
.tb-fantome { margin: 3px; border: 2px dashed var(--accent); border-radius: var(--r3); background: var(--choisi); pointer-events: none; z-index: 5; }
.tb-fantome.tb-refus { border-color: var(--bad); background: var(--bad-bg); }
.tb-vide-page { grid-column: 1 / -1; grid-row: 1 / span 3; align-self: center; justify-self: center; display: grid; justify-items: center; gap: var(--e4); padding: var(--e5); color: var(--ink-2); text-align: center; }

.tb-pages .tb-p-ajout { align-self: center; margin-left: var(--e2); }
/* Plus de pages que de largeur : la barre des onglets se resserre et défile (molette, flèches, onglet actif ramené),
   au lieu d'être coupée par la barre (overflow: hidden) ; la légende de droite cède sa place la première. */
.tb-pages [role="tablist"] { flex: 0 1 auto; min-width: 0; }
.tb-pages .legende { flex: 1 10 auto; }

/* ---------- Panneau « Tableau de bord » et éditeur d'un visuel ---------- */
.tb-pn-sec > summary { cursor: pointer; list-style: none; }
.tb-pn-sec > summary::-webkit-details-marker { display: none; }
.tb-pn-sec > summary::before { content: "▸"; color: var(--ink-2); font-size: var(--fs-xs); }
.tb-pn-sec[open] > summary::before { content: "▾"; }
.tb-pn-corps { display: grid; gap: var(--e3); padding: var(--e3) var(--e4); }
.tb-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e3); }
.tb-duo-bouton { display: flex; gap: var(--e2); }
.tb-duo-bouton .champ { flex: 1; min-width: 0; }
.tb-boutons { display: flex; flex-wrap: wrap; gap: var(--e2); }
.tb-coche { display: flex; align-items: center; gap: var(--e3); min-width: 0; min-height: 20px; font-size: var(--fs-m); cursor: pointer; }
.tb-coche .lib { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-coche .u { color: var(--ink-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tb-f-dim > summary { display: flex; align-items: center; gap: var(--e3); height: 22px; padding: 0 var(--e4); border-bottom: 1px solid var(--grid-line); cursor: pointer; list-style: none; }
.tb-f-dim > summary::-webkit-details-marker { display: none; }
.tb-f-dim > summary .lib { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-f-dim.tb-actif > summary { color: var(--accent-texte); font-weight: 600; }
.tb-f-dim .tb-ed-liste { max-height: 180px; overflow: auto; padding: var(--e2) var(--e4); }
.tb-zone-texte { width: 100%; height: auto; min-height: 54px; padding: 3px 5px; resize: vertical; font-family: var(--font); }

.tb-ed { display: grid; gap: var(--e3); align-content: start; min-width: 0; }
.tb-ed-groupe { display: grid; gap: var(--e2); min-width: 0; margin: 0; padding: var(--e3) var(--e3) var(--e4); border: 1px solid var(--line); border-radius: var(--r2); }
.tb-ed-groupe > legend { padding: 0 var(--e2); color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; }
.tb-ligne { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: var(--e3); min-height: 22px; font-size: var(--fs-s); color: var(--ink-2); }
.tb-ligne .champ { width: 100%; height: 20px; color: var(--ink); }
.tb-ligne .champ.court { width: 100%; }
.tb-ed .tb-seg { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-fort); border-radius: var(--r2); overflow: hidden; }
.tb-ed .tb-seg label { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--e2); min-height: 20px; padding: 0 var(--e3); font-size: var(--fs-s); white-space: nowrap; cursor: pointer; }
.tb-ed .tb-seg label + label { border-left: 1px solid var(--line-fort); }
.tb-ed .tb-seg label:has(input:checked) { background: var(--bg-3); box-shadow: inset 0 -2px 0 var(--accent); color: var(--ink); font-weight: 600; }
.tb-ed-sous { display: flex; align-items: center; gap: var(--e2); margin-top: var(--e2); font-size: var(--fs-s); color: var(--ink-2); }
.tb-ed-sous > span:first-child { flex: 1; font-weight: 600; }
.tb-ed-liste { list-style: none; display: grid; gap: 1px; max-height: 220px; overflow: auto; }
.tb-ed-liste li { display: flex; align-items: center; gap: var(--e2); min-width: 0; }
.tb-ed-liste li .tb-coche { flex: 1; }
.tb-ed-liste b { color: var(--accent-texte); }
.tb-role { color: var(--ink-2); font-size: var(--fs-xxs); white-space: nowrap; }
.tb-seuils li .champ:first-child { flex: 1; min-width: 0; }
.tb-ed-avert { display: flex; align-items: flex-start; gap: var(--e2); }

/* ---------- Sélecteur de séries multi-sources (contrat K4) ---------- */
.tb-series { list-style: none; display: grid; gap: var(--e2); max-height: 340px; overflow: auto; }
.tb-serie { display: grid; gap: var(--e1); min-width: 0; padding: var(--e2) var(--e3); border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg-1); }
.tb-sr-tete { display: flex; align-items: center; gap: var(--e2); min-width: 0; }
.tb-sr-tete .champ { flex: 1; min-width: 0; height: 20px; }
.tb-pastille { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--graph-1)); }
.tb-sr-origine { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.35; overflow-wrap: anywhere; }
.tb-sr-criteres { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--e2); }
.tb-sr-champ { display: grid; gap: 1px; min-width: 0; font-size: var(--fs-xxs); color: var(--ink-2); }
.tb-sr-champ .champ { width: 100%; min-width: 0; height: 20px; color: var(--ink); font-size: var(--fs-s); }
.tb-sr-champ select[multiple].champ { height: auto; }
.tb-sr-large { grid-column: 1 / -1; }
.tb-sr-filtres { display: grid; gap: var(--e2); font-size: var(--fs-s); }
.tb-sr-filtres > summary { cursor: pointer; color: var(--ink-2); }
.tb-sr-filtres[open] > summary { margin-bottom: var(--e2); }
.tb-sr-ajout { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--e2); }

/* ---------- Boîtes : catalogue, générateur, agrandissement ---------- */
.dlg.tb-dlg-catalogue { width: min(1100px, calc(100vw - 32px)); height: min(780px, calc(100vh - 48px)); }
.tb-dlg-catalogue .dlg-corps { display: block; }
.tb-cat-outils { display: flex; align-items: center; gap: var(--e4); margin-bottom: var(--e4); }
.tb-cat-fam + .tb-cat-fam { margin-top: var(--e4); }
.tb-cat-outils .champ { width: 280px; }
.tb-cat-fam { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.tb-cat-grille { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--line); }
.tb-cat-carte { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--e4); padding: var(--e4); background: var(--bg-1); }
.tb-cat-carte:hover { background: var(--survol); }
.tb-cat-carte .tb-mini { width: 56px; height: 39px; }
.tb-cat-texte { display: grid; gap: 2px; min-width: 0; }
.tb-cat-texte b { font-size: var(--fs-m); }
.tb-cat-texte span { font-size: var(--fs-s); line-height: 1.4; }
.tb-cat-texte small { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.4; }

.dlg.tb-dlg-gen { width: min(1280px, calc(100vw - 32px)); height: min(800px, calc(100vh - 48px)); }
.tb-dlg-gen .dlg-corps { display: block; padding: 0; overflow: hidden; }
.tb-gen { height: 100%; display: grid; grid-template-columns: 210px minmax(260px, 340px) minmax(0, 1fr); }
.tb-gen-types { overflow: auto; padding: var(--e2) 0; background: var(--bg-1); border-right: 1px solid var(--line); }
.tb-gen-fam { padding: var(--e3) var(--e4) var(--e1); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tb-gen-type { display: flex; align-items: center; gap: var(--e3); padding: 2px var(--e4); font-size: var(--fs-s); cursor: pointer; }
.tb-gen-type:hover { background: var(--bg-3); }
.tb-gen-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tb-gen-type:has(input:checked) { background: var(--choisi-panneau); box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.tb-gen-type:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.tb-gen-type .tb-mini { width: 34px; height: 24px; }
.tb-gen-source { overflow: auto; padding: var(--e4); border-right: 1px solid var(--line); }
.tb-gen-apercu { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--e3); padding: var(--e4); background: var(--bg-0); }
.tb-gen-tete { display: flex; align-items: center; gap: var(--e2); }
.tb-gen-zone { flex: 1 1 0; min-height: 0; padding: var(--e3); background: var(--grid-bg); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; }
.tb-gen-etat { flex: 1; text-align: left; }

.dlg.tb-dlg-grand { width: min(1400px, calc(100vw - 32px)); height: calc(100vh - 48px); }
.tb-dlg-grand .dlg-corps { display: flex; flex-direction: column; gap: var(--e3); padding: var(--e4); }
.tb-grand-zone { flex: 1 1 0; min-width: 0; min-height: 0; }

/* ---------- Impression : une page imprimée par page du tableau ---------- */
/* Atelier hors écran : les graphiques imprimés y sont dessinés en thème clair (l'export SVG du moteur lit les styles
   calculés à cet endroit), quel que soit le thème de l'écran. Les jetons du thème clair n'y sont PAS recopiés : au
   moment d'imprimer, tableaux.js (themeClair) les lit dans les règles :root[data-theme="light"] d'app.css et de
   graphiques.css, puis recalcule ici les jetons dérivés (règles :root). Une seule source pour l'écran et le papier. */
.tb-atelier {
  position: fixed; left: -20000px; top: 0; width: 1040px; height: 720px; overflow: hidden; pointer-events: none;
  color-scheme: light;
  background: var(--grid-bg); color: var(--ink);
}
.tb-grille-atelier { min-height: 0; }
.tb-atelier-cellule { min-width: 0; min-height: 0; margin: 3px; display: flex; }
.tb-atelier-zone { flex: 1 1 0; min-width: 0; min-height: 0; }
.tb-impression { display: none; }

/* ---------- Disposition personnelle en Lecture (public/disposition.js, réorganisation 2.12.0) ----------
   La poignée de redimensionnement du visuel sert au moteur de disposition en Lecture ; elle reste masquée pour un
   visuel fixé, une disposition fixée ou un visuel agrandi (règles de disposition.css). */
.tb-ecran[data-mode="lecture"] .tb-poignee.disp-redim { display: block; }
.tb-ecran[data-mode="lecture"] .tb-v-tete.disp-poignee:hover { background: var(--bg-2); }
.tb-visuel.disp-fixe .tb-v-tete { cursor: default; }
.tb-visuel .disp-outils { margin-left: var(--e1); }
.tb-visuel.disp-agrandi { margin: 3px; }

/* ---------- Natures dessinées par l'écran : cartes, tableau, lecture, circuit ---------- */
.tb-nature { height: 100%; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.tb-v-corps:has(> .tb-nature) { padding: 0; }
.tb-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: var(--e2); margin: 0; padding: var(--e2) var(--e3); }
.tb-carte { min-width: 0; display: grid; align-content: start; gap: 2px; padding: var(--e2) var(--e3); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r2); }
.tb-carte dt { color: var(--ink-2); font-size: var(--fs-m); font-variant-caps: all-small-caps; letter-spacing: .02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-carte dd { margin: 0; min-width: 0; }
.tb-carte-v { font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-carte-v small { color: var(--ink-2); font-size: var(--fs-s); font-weight: 400; }
.tb-carte-v .nd { font-weight: 600; }
.tb-carte-txt { display: block; font-size: var(--fs-m); font-weight: 400; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.tb-carte-c { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-carte-n { color: var(--ink-2); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-fav { color: var(--ok); font-weight: 600; }
.tb-defav { color: var(--bad); font-weight: 600; }
.tb-neutre { color: var(--ink-2); }
.tb-sep { color: var(--ink-2); }
.tb-nat-tableau { display: flex; flex-direction: column; overflow: hidden; }
.tb-nat-tableau > * { flex: 1 1 0; min-height: 0; }
/* Grille d'un tableau : bornée par le visuel (flex), sa zone défile dans les deux sens ; toutes les lignes et toutes les
   colonnes restent atteignables. En-têtes trop longs coupés à droite avec points de suspension (titre complet en
   infobulle), jamais à gauche. */
.tb-tab-grille { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.tb-tab-grille .grl-table thead th .grl-lib { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-tab-grille .grl-table thead th.n .grl-lib { text-align: right; }
.tb-hors-vue { flex: none; margin: 0; padding: 2px var(--e3) 0; color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.35; }
.tb-lecture { display: grid; gap: var(--e2); padding: var(--e3) var(--e4); font-size: var(--fs-m); line-height: 1.5; }
.tb-lec-phrase { font-size: var(--fs-l); line-height: 1.45; }
.tb-lec-titre { color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; }
.tb-lec-liste { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.tb-lec-sel { border: 1px solid var(--line); border-radius: var(--r2); }
.tb-circuit { width: 100%; }
/* Suivi des saisies : colonne Jeu large (noms entiers à 1366 x 768), statuts étroits, date sur une ligne ; plus de
   colonnes de largeur égale (disposition fixe de .tableau). */
.tb-circuit { table-layout: auto; }
.tb-circuit thead th:first-child { width: 36%; }
.tb-circuit thead th:last-child { width: 96px; }
.tb-circuit tbody th, .tb-circuit tbody th .tb-lien { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.tb-circuit tbody th .tb-lien { overflow: visible; text-overflow: clip; }
.tb-circuit .tb-zero { color: var(--ink-2); }
.tb-tab-imp { width: 100%; }

/* ---------- Boîte « Modèles » du Catalogue (menu Données, groupe Graphiques) ---------- */
.dlg.tb-dlg-modeles { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.tb-dlg-modeles .dlg-corps { display: block; overflow: auto; }
.tb-dlg-modeles .d-note { margin-bottom: var(--e3); }
.tb-modeles-liste { list-style: none; display: grid; gap: var(--e2); margin: 0; padding: 0; }
.tb-modele-ligne { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--e4); padding: var(--e3) var(--e4); border: 1px solid var(--line); border-radius: var(--r3); background: var(--grid-bg); }
.tb-modele-ligne:hover { border-color: var(--line-fort); }
.tb-modele-texte { display: grid; gap: 2px; min-width: 0; }
.tb-modele-texte b { font-size: var(--fs-l); }
.tb-modele-texte span { color: var(--ink-2); font-size: var(--fs-s); line-height: 1.45; }
.tb-modele-texte small { color: var(--ink-2); font-size: var(--fs-xs); }
.tb-modele-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--e2); }

@media (max-width: 760px) {
  .tb-modele-ligne { grid-template-columns: minmax(0, 1fr); }
  .tb-modele-actions { justify-content: flex-start; }
  .tb-cartes { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

@media (max-width: 760px) {
  .tb-gen { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(240px, 1fr); overflow: auto; }
  .tb-gen-types { max-height: 160px; }
  .tb-b-info { display: none; }
}

@media print {
  .metier:has(> .metier-hote[data-ecran="tableaux"]), .metier-hote[data-ecran="tableaux"] { display: block !important; height: auto !important; overflow: visible !important; }
  .metier-hote[data-imp="oui"] .tb-ecran, .tb-atelier { display: none !important; }
  .metier-hote[data-imp="oui"] .tb-impression { display: block !important; }
  .tb-feuille { break-after: page; page-break-after: always; break-inside: avoid; color: #000000; }
  .tb-feuille:last-child { break-after: auto; page-break-after: auto; }
  .tb-f-tete { display: grid; gap: 2px; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid #888888; }
  .tb-f-tete h1 { font-size: 15px; }
  .tb-f-tete p { font-size: 10px; }
  .tb-f-pied { color: #555555; }
  .tb-f-grille { min-height: 0; }
  .tb-f-visuel { min-width: 0; min-height: 0; margin: 2px; border: 1px solid #BBBBBB; overflow: hidden; }
  .tb-f-visuel > svg { display: block; width: 100%; height: 100%; }
  .tb-f-visuel figcaption { padding: 2px 4px; font-weight: 600; font-size: 11px; }
  .tb-f-visuel p { padding: 2px 4px; font-size: 10px; }
  .tb-f-nature { padding: 2px 4px; font-size: 10px; overflow: hidden; }
  .tb-f-nature .tb-cartes { padding: 0; }
  .tb-f-nature .tb-carte { border-color: #BBBBBB; background: transparent; }
  .tb-f-nature .tb-fav { color: #1B6B2F; }
  .tb-f-nature .tb-defav { color: #A11D1D; }
  .tb-f-nature table { font-size: 9px; }
  .tb-f-nature details > :not(summary) { display: block; }
}

/* Prévision de fin de mois (nature « atterrissage », atterrissage.js, B1 du 23/10/2026). */
.tb-nat-at { height: 100%; overflow: auto; padding: var(--e2) var(--e3); }
.at-table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.at-table th, .at-table td { padding: var(--e2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.at-table thead th { color: var(--ink-2); font-weight: 600; font-size: var(--fs-xs); }
.at-table tbody th { font-weight: 600; }
.at-realise-t, .at-int, .at-rythme { display: block; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 400; }
.at-prev strong { font-variant-numeric: tabular-nums; }
.at-plan-t, .at-chance { font-variant-numeric: tabular-nums; white-space: nowrap; }
.at-ecart { display: block; font-size: var(--fs-xs); }
.at-barre { display: block; width: 100%; min-width: 120px; height: 14px; }
.at-fond { fill: var(--bg-3); }
.at-realise { fill: var(--graph-1); }
.at-intervalle { fill: var(--graph-2); fill-opacity: .35; }
.at-prevision { fill: var(--graph-2); }
.at-plan { fill: var(--ink); }

/* ---------- Tableaux de bord standard (02/11/2026, spécification des tableaux de bord avancés, lot MOTEUR) ---------- */
/* Cartes (spécification 1.12) : valeur jamais tronquée (la taille baisse), bandeau sur une rangée, bandeau double sur deux
   rangées, seconde référence et note quand la place le permet, mini-histogramme quotidien ; indice de défilement. */
.tb-nat-cartes { container: tbcartes / size; display: flex; flex-direction: column; }
.tb-nat-cartes > .tb-cartes { flex: none; }
/* Cartes serrées (posé par tableaux.js quand le contenu dépasse le visuel) : seconde référence, mini-histogramme et note
   de carte retirés avant tout défilement interne. Notes de la source : dans la bulle (i) « Définition » seulement
   (04/11/2026). */
.tb-nat-cartes.tb-serre .tb-carte-c2, .tb-nat-cartes.tb-serre .tb-carte-mini, .tb-nat-cartes.tb-serre .tb-carte-n { display: none; }
.tb-carte { container: tbcarte / inline-size; }
.tb-carte-num { font-variant-numeric: tabular-nums; }
.tb-cmp-ref { color: var(--ink-2); }
.tb-carte-mini { height: 16px; margin-top: 1px; }
.tb-mini-j { display: block; width: 100%; height: 16px; }
.tb-mini-b { fill: color-mix(in srgb, var(--graph-8) 55%, transparent); }
.tb-mini-b.tb-mini-der { fill: var(--graph-8); }
.tb-mini-nd { fill: var(--ink-2); opacity: .55; }
@container tbcartes (min-height: 150px) { .tb-carte-v { font-size: 20px; } }
@container tbcartes (min-height: 260px) { .tb-carte-v { font-size: 24px; } }
@container tbcartes (max-height: 150px) {
  .tb-nat-cartes > .tb-cartes { flex: 1 1 0; min-height: 0; }
  .tb-cartes { height: auto; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(132px, 1fr); overflow-x: auto; overflow-y: hidden;
    background: linear-gradient(to left, var(--grid-bg) 0, transparent 18px) right / 18px 100% no-repeat local, linear-gradient(to left, color-mix(in srgb, var(--ink) 18%, transparent), transparent 10px) right / 10px 100% no-repeat scroll; }
}
@container tbcartes (min-height: 151px) and (max-height: 240px) {
  .tb-nat-cartes > .tb-cartes.tb-cartes-2r { flex: 1 1 0; min-height: 0; }
  .tb-cartes.tb-cartes-2r { height: auto; grid-template-columns: none; grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-auto-columns: minmax(132px, 1fr); overflow-x: auto; }
  .tb-cartes-2r .tb-carte-c2, .tb-cartes-2r .tb-carte-n, .tb-cartes-2r .tb-carte-mini { display: none; }
}
@container tbcartes (max-height: 140px) { .tb-carte-c2, .tb-carte-n { display: none; } }
@container tbcartes (max-height: 88px) { .tb-carte-mini { display: none; } }
/* Carte étroite : la référence et l'écart passent sur deux lignes plutôt que d'être tronqués. */
@container tbcarte (max-width: 189px) {
  .tb-carte-c { white-space: normal; }
  .tb-carte-c .tb-sep { display: none; }
  .tb-carte-c .tb-cmp-ref { display: block; }
  .tb-carte-c > span:last-child { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@container tbcarte (max-width: 150px) { .tb-carte-v { font-size: 15px; } }
@container tbcarte (max-width: 120px) { .tb-carte-v { font-size: 13px; } }

/* Tableaux (spécification 1.13) : grille, renvois n.d. numérotés (leur note est dans la bulle (i) « Définition » du
   visuel depuis le 04/11/2026) ; tableau réalisé / référence / écart. */
.tb-renvoi { margin-left: 1px; font-size: 75%; font-weight: 600; }
.tb-tab-imp { font-variant-numeric: tabular-nums; }
.tb-nat-statique .tb-tab-imp { border-collapse: separate; border-spacing: 0; }
.tb-nat-statique .tb-tab-imp th, .tb-nat-statique .tb-tab-imp td { padding: 2px var(--e3); white-space: nowrap; }
.tb-nat-statique .tb-tab-imp thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-2); }
.tb-nat-statique .tb-tab-imp tfoot th, .tb-nat-statique .tb-tab-imp tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--bg-2); font-weight: 600; }

/* Tableau d'horizons (spécification 1.14) : en-têtes figés, première colonne figée, un groupe par horizon. */
.tb-nat-hz { overflow: auto; }
.tb-hz { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.tb-hz th, .tb-hz td { padding: 2px var(--e3); border-bottom: 1px solid var(--grid-line); white-space: nowrap; }
.tb-hz thead th { position: sticky; z-index: 2; background: var(--bg-2); color: var(--ink); font-weight: 600; }
.tb-hz thead tr:first-child th { top: 0; height: 34px; }
.tb-hz thead tr:nth-child(2) th { top: 34px; font-size: var(--fs-xs); color: var(--ink-2); }
.tb-hz th.tb-hz-lib { left: 0; z-index: 3; text-align: left; vertical-align: bottom; }
.tb-hz-h { text-align: center; line-height: 1.25; }
.tb-hz-h small { display: block; color: var(--ink-2); font-size: var(--fs-xxs); font-weight: 400; }
.tb-hz-refnom { color: var(--ink-2); font-weight: 400; }
.tb-hz .tb-hz-g, .tb-hz-h { border-left: 1px solid var(--line); }
.tb-hz tbody th { position: sticky; left: 0; z-index: 1; max-width: 240px; overflow: hidden; text-overflow: ellipsis; background: var(--grid-bg); font-weight: 400; text-align: left; }
.tb-hz tbody th small { color: var(--ink-2); }
.tb-hz td.n, .tb-hz th.n { text-align: right; }
.tb-hz .tb-hz-bloc th { background: var(--bg-1); color: var(--accent-texte); font-weight: 600; }
/* Vue compacte : la seconde ligne de l'en-tête (référence et période) ne donne pas sa largeur à la colonne (largeur nulle,
   étirée à la cellule, points de suspension) ; libellés des indicateurs plus étroits. */
.tb-hz-compact .tb-hz-h small { width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tb-hz-compact tbody th { max-width: 180px; }
.tb-hz-compact th, .tb-hz-compact td { padding-left: var(--e2); padding-right: var(--e2); }

/* Bulle (i) « Définition » d'un visuel (spécification 1.16) : panneau commun des bulles depuis le 04/11/2026 (bulles.js :
   div.bl-panneau.tb-bulle, position, cadre, tête et défilement de bulles.css), tableaux.js et tableaux_pitinfo.js. Le
   titre du contenu (tb-bulle-titre) est repris par la tête du panneau : il n'y est pas répété. */
.tb-v-def { flex: none; }
/* Aides de l'éditeur et du panneau Tableau de bord : bulle (i) dans la légende ou le titre de leur groupe (boîtes
   modales comprises : le panneau s'ouvre dans la boîte). */
.tb-ed-groupe > legend .bl, .tb-ed .champ-bloc > span .bl { margin-left: var(--e2); }
/* Bulle d'une section repliable du panneau : hors du <summary> (docs/INTERFACE.md, 26.3), posée sur la barre du titre. */
.tb-pn-sec-ai { position: relative; }
.tb-pn-sec-ai > summary { padding-right: 28px; }
.tb-pn-sec-bl { position: absolute; top: 3px; right: var(--e3); }
.tb-pn-sec-bl > .bl { margin-left: 0; }
.tb-bulle-titre { margin: 0 0 var(--e2); font-weight: 600; }
.tb-bulle .bl-corps > .tb-bulle-titre:first-child { display: none; }
.tb-bulle-dl { display: grid; gap: var(--e2); margin: 0; }
.tb-bulle-dl dt { color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; }
.tb-bulle-dl dd { margin: 0; overflow-wrap: anywhere; }
.tb-bulle-dl ul { margin: 0; padding-left: 16px; }
.tb-bulle-pied { margin: var(--e2) 0 0; color: var(--ink-2); font-size: var(--fs-xxs); }

/* Graphique dans une cellule : tête du moteur retirée quand elle n'a plus rien à montrer (titre dans l'en-tête du visuel,
   actions dans son menu, notes dans le badge (i) en densité compacte). */
.tb-v-corps .gg-tete:not(:has(.gg-actions > :not([hidden]))):has(.gg-sous-titre:empty) { display: none; }
/* Densité compacte : la tête garde toujours la hauteur du badge (i) (vide et invisible sans notes), pour que les zones
   tracées des graphiques d'une même bande aient la même hauteur, avec ou sans notes (une bande, une hauteur). */
.tb-v-corps .gg.gg-compacte .gg-tete { height: 22px; overflow: hidden; }
.tb-v-corps .gg.gg-compacte .gg-tete:not(:has(.gg-actions > :not([hidden]))) { display: flex; visibility: hidden; }

/* ------------------------------------------------------------------ Bulle (i) « Définition » d'une mesure (lot 5) */
/* Définition rendue par le serveur (catalogue de GET /api/objectifs/comparaison) à côté du nom d'une mesure des cartes et
   du tableau d'horizons : infobulle au survol, bulle (tb-bulle) au clic. Même allure que les bulles (i) des rapports de
   réconciliation (rr-bulle). Posée au bord droit du nom (cellule collante ou carte) : un nom long, coupé par des points de
   suspension, lui laisse sa place. */
.tb-carte:has(.tb-def) { position: relative; }
.tb-carte > dt.tb-avec-def { padding-right: 18px; }
.tb-hz tbody th.tb-avec-def { padding-right: 24px; }
.tb-def { position: absolute; top: 3px; right: 3px; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0;
  border: 1px solid var(--line-fort); border-radius: 50%; background: var(--bg-1); color: var(--ink-2); font: italic 600 var(--fs-xxs)/1 var(--font);
  font-variant-caps: normal; letter-spacing: 0; cursor: help; }
.tb-hz tbody th .tb-def { top: 50%; right: 4px; margin-top: -8px; }
.tb-def:hover, .tb-def[aria-expanded="true"] { color: var(--ink); border-color: var(--accent); }
.tb-def:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media print { .tb-def { display: none !important; } }
