/* Couleur de marque unique : violet #4b2fbf, plus de choix de theme. */
:root{--accent:#4b2fbf;--surface:#f4f3fa;--sel:#ebe7fb;--line:#dad8e8;--ink:#17212b;--mute:#4a5866;--field:#7a8794;--bad:#9b1c31;--bad-bg:#fde7ea;--focus:#1d4ed8}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{display:flex;flex-direction:column;background:#fff;color:var(--ink);font:14px/1.45 "IBM Plex Sans",system-ui,sans-serif}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,textarea:focus-visible,a:focus-visible,.scroll-x:focus-visible{outline:3px solid var(--focus);outline-offset:1px}
[hidden]{display:none!important}
header{display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:8px 16px;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:8px;border:0;background:none;padding:0;min-height:40px;font-weight:700;font-size:17px;color:var(--accent)}
.brand-icon{width:22px;height:22px;flex:none}
.wordmark{display:inline-flex;align-items:center;letter-spacing:-.01em}
.glyph-o{width:.83em;height:.83em;margin:0;transform:translateY(.02em)}
.searchbox{position:relative;flex:1 1 240px;max-width:520px;margin:0 auto}
#search{width:100%;height:36px;padding:0 12px;border:1px solid var(--field);border-radius:4px;font:inherit}
#palette{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:5;max-height:min(70vh,560px);overflow:auto;padding:4px;border:1px solid var(--field);border-radius:4px;background:#fff;box-shadow:0 8px 24px rgba(23,33,43,.18)}
#palette .section{padding:6px 8px 2px;color:var(--mute);font-size:12px;font-weight:700}
#palette [role=option]{padding:6px 8px;border-left:3px solid transparent;border-radius:4px;cursor:pointer;overflow-wrap:anywhere}
#palette [role=option]:hover{background:var(--surface)}
#palette [aria-selected=true]{border-left-color:var(--accent);background:var(--sel)}
.excerpt{display:block;color:var(--mute);font-size:13px}
mark{padding:0;background:#ffe9a8;color:inherit}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.search{display:flex;gap:20px;align-items:flex-start}
.facets{width:210px;flex:none}
.facets>summary{min-height:34px;margin-bottom:8px;font-weight:700;cursor:pointer}
.facets fieldset{margin:0 0 12px;padding:0;border:0}
.facets legend{padding:0;font-weight:700}
.facets label{display:flex;gap:8px;align-items:center;min-height:34px;overflow-wrap:anywhere}
.results{margin:0;padding:0;list-style:none}
.results>li{padding:10px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.results .group{font-weight:700}
.results li>.group+.hit{margin-top:8px}
.results li>.hit+.hit{margin-top:8px}
.pill{min-height:34px;padding:0 12px;border:1px solid var(--field);border-radius:4px;background:#fff}
.pill[aria-pressed=true],.pill[aria-expanded=true]{background:var(--accent);border-color:var(--accent);color:#fff}
.primary{min-height:34px;padding:0 14px;border:0;border-radius:4px;background:var(--accent);color:#fff}
.secondary{display:inline-flex;align-items:center;min-height:34px;padding:0 14px;border:1px solid var(--accent);border-radius:4px;background:#fff;color:var(--accent);text-decoration:none}
.link{border:0;background:none;padding:0;text-align:left;color:var(--accent);text-decoration:underline;overflow-wrap:anywhere}
/* Sous-corpus d'un flux : la limite reste visible sur toutes les vues. */
.corpus{margin:0;padding:8px 16px;border-bottom:1px solid var(--line);background:var(--sel)}
.bar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;align-items:center;padding:0 16px;border-bottom:1px solid var(--line)}
#tabs button{min-height:42px;padding:0 14px;border:0;border-bottom:3px solid transparent;background:none}
#tabs button[aria-current=page]{border-bottom-color:var(--accent);font-weight:700}
.body{display:flex;flex:1;min-height:0}
/* Selecteur de regroupement (registre + arbre + lineage) : par couche ou par flux metier.
   Bordure en --field (3.67:1) et non --line : la limite du composant doit atteindre 3:1 (WCAG 1.4.11). */
.seg{display:inline-flex;border:1px solid var(--field);border-radius:6px;overflow:hidden;margin:0 0 10px}
.seg button{border:0;background:none;padding:6px 14px;min-height:34px;cursor:pointer;font:inherit;color:var(--mute)}
.seg button:not(.on):hover{background:var(--surface)}
.seg button.on{background:var(--accent);color:#fff;font-weight:700}
#tree{width:270px;flex:none;overflow:auto;padding:8px;border-right:1px solid var(--line)}
#tree .seg{display:flex;width:100%;margin-bottom:6px}
#tree .seg button{flex:1;padding:5px 8px}
/* Registre : colonnes de largeur fixe (alignees entre sections), en-tetes sur une ligne. */
.regtable{table-layout:fixed;width:100%}
.regtable th{white-space:nowrap}
.regtable td:nth-child(3){white-space:nowrap}
#tree summary{display:flex;justify-content:space-between;list-style:none;min-height:34px;align-items:center;padding:0 8px;font-weight:700;cursor:pointer}
/* Le selecteur de groupement de l'arbre n'est pas une entree de l'arbre. */
#tree details button{display:block;width:100%;min-height:34px;padding:4px 8px 4px 24px;border:0;border-radius:4px;background:none;text-align:left;overflow-wrap:anywhere}
#tree details button:not([aria-current=true]):hover{background:var(--sel)}
#tree details button[aria-current=true]{background:var(--accent);color:#fff;font-weight:600}
main{flex:1;min-width:0;overflow:auto}
main.fill{display:flex;flex-direction:column;overflow:hidden}
#side{width:360px;flex:none;overflow:auto;padding:16px;border-left:1px solid var(--line);background:var(--surface)}
.page{padding:20px 24px;display:flex;flex-direction:column;gap:12px}
.review td.go{text-align:right;white-space:nowrap}
.trace .grow td.meta{width:130px;text-align:right}
#tree .treetoggle{display:none}
h1{margin:0;font-size:24px;overflow-wrap:anywhere}
h2{margin:0;font-size:17px}
h3{margin:12px 0 4px;font-size:15px}
p{margin:0 0 8px}
.mute{color:var(--mute)}
.row{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:center}
.spread{justify-content:space-between}
details.panel{border:1px solid var(--field);border-radius:4px}
details.panel>summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;padding:10px 14px;background:var(--surface);font-weight:700;cursor:pointer}
details.panel>summary span:last-child{font-weight:400}
/* display:flex supprime la fleche native des summary : on la redessine. */
#tree summary span:first-child::before,details.panel>summary span:first-child::before{content:"▸";display:inline-block;width:18px}
#tree details[open]>summary span:first-child::before,details.panel[open]>summary span:first-child::before{content:"▾"}
.tableid{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:6px 0}
.tableid code{font-size:13px;overflow-wrap:anywhere}
.tid{display:block;margin-top:2px;font-size:11px;font-weight:400;overflow-wrap:anywhere}
.inner{padding:12px 16px;max-width:96ch}
.checks{margin:0;padding:0;list-style:none}
.checks li{padding:10px 16px;border-top:1px solid var(--line);overflow-wrap:anywhere}
.checks li:first-child{border-top:0}
.checks pre{max-width:96ch;margin-bottom:0}
details.alert{border:2px solid var(--bad);border-radius:4px;background:var(--bad-bg);color:#6e1022}
details.alert>summary,div.alert{padding:10px 14px;font-weight:700}
div.alert{border:2px solid var(--bad);border-radius:4px;background:var(--bad-bg);color:#6e1022;font-weight:400}
details.alert ul{margin:0;padding:0 14px 10px 32px}
details.alert .link{color:#6e1022}
table{width:100%;border-collapse:collapse}
th,td{padding:9px 12px;border-top:1px solid var(--line);text-align:left;vertical-align:top}
th{color:var(--mute);font-weight:600}
thead th{position:sticky;top:0;background:#fff;z-index:1}
td.name{width:230px;overflow-wrap:anywhere;font-weight:600}
tr.open,tr.open+tr,tr.selected{background:var(--sel)}
tr.more>td{border-top:0}
td.from{width:260px;font-size:12px;overflow-wrap:anywhere}
.clickable{cursor:pointer}
.clickable:hover{background:var(--surface)}
/* Table large : conteneur scrollable focusable (defilement clavier, WCAG 2.1.1). */
.scroll-x{overflow-x:auto}
.mark{display:inline-block;margin:2px 4px 0 0;padding:0 6px;border:1px solid var(--field);border-radius:4px;font-size:11px;font-weight:600}
.mark.restricted{background:#3b0764;border-color:#3b0764;color:#fff}
.mark.bad{background:var(--bad);border-color:var(--bad);color:#fff}
.level{display:inline-block;flex:none;white-space:nowrap;padding:1px 8px;border-radius:4px;background:var(--surface);font-size:12px;font-weight:700}
.level.C2{background:#fff1cc;color:#7a4b00}
.level.C3{background:var(--bad-bg);color:var(--bad)}
.level.TBD{background:var(--surface);color:var(--mute);border:1px dashed var(--field)}
dl{display:grid;grid-template-columns:minmax(120px,190px) minmax(0,1fr);gap:6px 16px;margin:0}
dt{color:var(--mute)}
dd{margin:0;overflow-wrap:anywhere}
pre{margin:8px 0;padding:10px;border-radius:4px;background:#101828;color:#e6edf7;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}
.trace{display:flex;gap:16px;padding:16px;align-items:flex-start}
.collist{width:260px;flex:none;border:1px solid var(--line);border-radius:4px;padding:8px;max-height:calc(100vh - 150px);overflow:auto}
.collist button{display:flex;justify-content:space-between;gap:8px;width:100%;min-height:34px;align-items:center;padding:2px 8px;border:0;border-radius:4px;background:none;text-align:left;overflow-wrap:anywhere}
.collist button[aria-current=true]{background:var(--sel);font-weight:700}
.grow{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
/* Barre de filtres : registre, lineage et fiches. */
.filterbar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 16px;align-items:center}
.viewctl,.filtermenus,#filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.filterbar .seg{margin:0}
.count{color:var(--mute);font-variant-numeric:tabular-nums}
main.fill>.filterbar,main.fill>.chips{padding:8px 16px;border-bottom:1px solid var(--line)}
.icon{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.menu{position:relative}
.menu>summary{display:inline-flex;align-items:center;gap:8px;min-height:34px;padding:0 10px 0 12px;border:1px solid var(--field);border-radius:4px;background:#fff;cursor:pointer;list-style:none}
.menu>summary::-webkit-details-marker{display:none}
.menu>summary:hover{background:var(--surface)}
.menu>summary.active{border-color:var(--accent);background:var(--sel)}
.menu[open]>summary .icon{transform:rotate(180deg)}
.pop{position:absolute;z-index:6;top:calc(100% + 4px);left:0;min-width:280px;max-height:min(60vh,420px);overflow:auto;padding:4px;border:1px solid var(--field);border-radius:4px;background:#fff;box-shadow:0 8px 24px rgba(23,33,43,.18)}
/* Menus de la barre de filtres : larges comme leur contenu, rien n'est coupe.
   Le cote d'ouverture (gauche ou droite du bouton) est choisi a l'ouverture pour rester a l'ecran. */
.filtermenus .pop,#filters .pop{width:max-content;min-width:280px;max-width:min(480px,calc(100vw - 32px))}
.pop fieldset{margin:0;padding:0;border:0}
.pop label{display:flex;gap:8px;align-items:center;min-height:36px;padding:0 8px;border-radius:4px;cursor:pointer;white-space:nowrap}
.pop label:hover{background:var(--surface)}
.pop label span:last-child{margin-left:auto;padding-left:16px;color:var(--mute);font-variant-numeric:tabular-nums}
.pop p{margin:4px 0 0;padding:8px 8px 4px;border-top:1px solid var(--line);color:var(--mute);font-size:12px}
input[type=checkbox],input[type=radio]{accent-color:var(--accent)}
.chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.chip{display:inline-flex;gap:8px;align-items:center;min-height:34px;padding:0 8px 0 10px;border:1px solid var(--accent);border-radius:4px;background:var(--sel)}
.chip:hover{background:#fff}
.graphfoot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;align-items:center;padding:6px 16px;border-top:1px solid var(--line)}
.zoom{display:flex;gap:4px;margin-left:auto}
.iconbtn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid var(--field);border-radius:4px;background:#fff}
.iconbtn:hover{background:var(--surface)}
.iconbtn.wide{width:auto;padding:0 10px;font-size:12px}
.graph.is-empty{display:flex}
.empty{margin:auto;padding:24px;text-align:center}
.graph{flex:1;overflow:auto;min-height:0}
.canvas{position:relative;transform-origin:0 0}
.canvas>svg{position:absolute;left:0;top:0;pointer-events:none}
.lane{position:absolute;top:8px;font-weight:700}
.node{position:absolute;width:260px;overflow:hidden;border:1px solid var(--field);border-radius:4px;background:#fff}
.node.current{border:2px solid var(--accent);background:var(--sel)}
.node.dim{border-color:var(--line);background:var(--surface);color:var(--mute)}
.node .head{display:flex;height:48px}
.node .head button{border:0;background:none}
.node .title{flex:1;min-width:0;padding:0 10px;text-align:left;font-weight:600;font-size:13px;overflow:hidden}
.node .title:hover,.node .title:focus-visible{text-decoration:underline}
.node .title>span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:"IBM Plex Mono",ui-monospace,monospace}
.node .title small{display:block;font-weight:400;font-size:11px;color:var(--mute)}
.node .col{display:flex;gap:8px;align-items:center;width:100%;height:26px;padding:0 10px;border:0;background:none;text-align:left;font-size:12px}
.node .col span:first-child{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:"IBM Plex Mono",ui-monospace,monospace}
.node .col[aria-pressed=true]{background:var(--accent);color:#fff}
/* Aretes table a table : le style passe par des classes, le survol n'en pose que des classes. */
.lk{fill:none;stroke:var(--field);stroke-width:1;opacity:.5}
.lk.near{stroke:var(--accent);stroke-width:1.5;opacity:1}
.graph.col .lk{opacity:.15}
/* Aretes colonne a colonne : toutes rendues mais masquees ; vives quand elles portent
   le chemin de la colonne choisie (.on, fixe au clic) ou la trace de la colonne
   survolee (.hl), ancree sur les lignes visibles. */
.cl{fill:none;stroke:var(--accent);stroke-width:1.25;opacity:0}
.graph.col .cl.on{opacity:1}
.node,.lk,.cl{transition:opacity .15s ease-out}
/* Lineage, survol d'un noeud : lui, tout son amont et tout son aval en avant, le reste s'efface.
   Survol d'une colonne : sa seule trace, lignes surlignees ; hors de la trace, les aretes de
   colonnes disparaissent tout a fait (pas de halo violet), sauf le chemin fixe au clic (.on). */
.graph.hover .node:not(.hl){opacity:.3}
.graph.hover .node .col.hl:not([aria-pressed=true]){background:var(--sel)}
.graph.hover .lk:not(.hl){opacity:.08}
.graph.hover .lk.hl{stroke:var(--accent);stroke-width:1.5;opacity:1}
.graph.hover .cl.hl{opacity:1}
.graph.hover .cl:not(.hl):not(.on){opacity:0}
.graph.hover .cl.on:not(.hl){opacity:.08}
.setting{display:flex;justify-content:space-between;gap:12px;align-items:center;width:100%;min-height:52px;margin-bottom:8px;padding:8px 12px;border:1px solid var(--line);border-radius:4px;background:#fff;text-align:left}
.setting small{display:block}
.themes{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.themes button{display:flex;gap:8px;align-items:center;min-height:44px;padding:0 10px;border:1px solid var(--field);border-radius:4px;background:#fff}
.themes button[aria-pressed=true]{border:2px solid var(--accent);font-weight:700}
/* Accueil : la vitrine du produit — aucune donnee de contrat, le catalogue commence au clic. */
.page.landing{max-width:880px;margin:0 auto;gap:0}
.landing .hero{padding:72px 0 56px}
.landing h1{font-size:clamp(40px,6vw,72px);line-height:1.04;letter-spacing:-.03em}
.landing h1 em{font-style:normal;color:var(--accent)}
.landing .hero>p{max-width:62ch;margin:28px 0 0;font-size:17px;line-height:1.6;color:var(--mute)}
.landing .hero-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:36px 0 0}
/* Deux entrees de profil a egalite : meme taille, meme accent, meme ecart. */
.landing .hero-note{margin:14px 0 0;font-size:13px;color:var(--mute)}
.landing .primary{min-height:48px;padding:0 24px;font-size:15px}
.landing .statement{padding:64px 0;border-top:1px solid var(--line)}
.landing .statement h2{margin:0;font-size:clamp(24px,3.4vw,34px);line-height:1.15;letter-spacing:-.02em;max-width:24ch}
.landing .statement .lead{max-width:65ch;margin:14px 0 0;font-size:16px;line-height:1.6;color:var(--ink);font-weight:600}
.landing .statement p:not(.lead){max-width:65ch;margin:12px 0 0;font-size:15px;line-height:1.6;color:var(--mute)}
/* Illustration du lineage : un seul style d'arete (declairee), l'accent marque le chemin
   mis en avant. Elle ne depend pas des contrats : libelles generiques, couleurs par tokens. */
.landing figure{margin:0;padding:64px 0;border-top:1px solid var(--line);text-align:center}
.landing figure svg{max-width:480px;width:100%;height:auto}
.landing figcaption{margin-top:14px;font-size:13px;color:var(--mute)}
.landing .flow{display:flex;flex-wrap:wrap;gap:12px 24px;margin:32px 0 0;padding:0;list-style:none}
.landing .flow li{max-width:24ch}
.landing .flow li+li::before{content:"\2192";margin-right:20px;color:var(--accent);font-weight:700}
.landing .flow b{display:block;font:600 13px "IBM Plex Mono",ui-monospace,monospace;margin-bottom:4px}
.landing .flow span{display:block;font-size:13px;color:var(--mute);line-height:1.5}
.landing .band{margin-top:64px;padding:44px 32px;background:var(--surface);border:1px solid var(--line);border-radius:4px}
.landing .band h2{margin:0 0 14px;font-size:24px;letter-spacing:-.02em}
.landing .band p{max-width:68ch;margin:0 0 10px;font-size:15px;line-height:1.6;color:var(--mute)}
.landing .band .no{color:var(--ink);font-weight:600}
.landing .close{padding:72px 0 80px;text-align:center}
.landing .close h2{margin:0 0 8px;font-size:clamp(24px,3vw,32px);letter-spacing:-.02em}
.landing .close p{margin:0 0 28px;color:var(--mute)}
#side table{font-size:13px}
#side th,#side td{padding:6px 8px 6px 0}
dialog{width:min(720px,calc(100vw - 32px));max-height:calc(100vh - 32px);padding:20px;border:0;border-radius:8px;color:var(--ink)}
dialog::backdrop{background:rgba(23,33,43,.55)}
select,textarea{font:inherit;padding:6px 8px;border:1px solid var(--field);border-radius:4px}
/* Trace : liste et preuve empilees avant que la colonne centrale ne s'ecrase. */
@media (max-width:1100px){
  .trace{flex-direction:column;align-items:stretch;overflow:auto}
  .collist{width:auto;max-height:220px}
}
/* Registre : en dessous de cette largeur les six colonnes defilent au lieu de se chevaucher. */
@media (min-width:901px){
  .regtable{min-width:900px}
  .regtable td{overflow-wrap:anywhere}
}
@media (max-width:900px){
  /* Menus de filtre : la largeur de la barre, pas celle du bouton. */
  .filterbar,.bar{position:relative}
  .menu{position:static}
  .filtermenus .pop,#filters .pop,.pop{top:auto;left:8px;right:8px;min-width:0;width:auto;max-width:none}
  .pop label{min-height:44px;white-space:normal}
  .menu>summary,.chip,.iconbtn{min-height:44px}
  .iconbtn{width:44px;height:44px}
  /* Cibles tactiles 44 px (WCAG 2.1 AAA 2.5.5) sur tous les controles hors liens inline. */
  #tree button,#tree summary,.seg button,#tree .seg button,.pill,#tabs button,.primary,.secondary,.collist button,details.panel>summary,details.alert>summary,.facets>summary{min-height:44px}
  #search{height:44px}
  .brand{min-height:44px}
  .body,.trace{flex-direction:column;overflow:auto}
  #tree,.collist{width:auto;max-height:220px;border:0;border-bottom:1px solid var(--line)}
  main{overflow:visible;flex:none}
  main.fill{height:80vh}
  .search{flex-direction:column}
  .facets{width:auto}
  table.columns thead,table.regtable thead{display:none}
  table.columns tbody,table.columns tr,table.columns td,table.regtable,table.regtable tbody,table.regtable tr,table.regtable td,
  table.review,table.review tbody,table.review tr,table.review td,.trace .grow table,.trace .grow tbody,.trace .grow tr,.trace .grow td{display:block;width:auto}
  table.columns td,table.regtable td,table.review td,.trace .grow td{border-top:0;padding-block:3px}
  table.columns tr,table.regtable tr,table.review tr,.trace .grow tr{border-top:1px solid var(--line);padding:6px 0}
  .regtable colgroup{display:none}
  .regtable td:nth-child(3){white-space:normal}
  td[data-l]::before{content:attr(data-l) ": ";color:var(--mute)}
  table.review td.go,.trace .grow td.meta{width:auto;text-align:left}
  /* Settings et contexte metier : tiroir par-dessus la page, pas sous elle. */
  #side{position:fixed;top:0;right:0;bottom:0;z-index:10;width:min(360px,100%);max-height:none;border:0;border-left:1px solid var(--line);box-shadow:-8px 0 24px rgba(23,33,43,.18)}
  #tree .treetoggle{display:inline-flex;width:auto;min-height:44px;padding:0 14px}
  #tree.closed{max-height:none;flex:none}
  #tree.closed>:not(.treetoggle){display:none}
}
/* Page 404 in-app (vue Trace interdite a un analyste) : meme habillage que 404.html. */
.nf{align-items:center;justify-content:center;text-align:center;max-width:36em;margin:auto}
.nf .code{font-size:72px;font-weight:700;line-height:1;color:var(--accent);letter-spacing:-.02em}
.nf p{margin:0}
/* Vitrine : resserrer la respiration sur petit ecran. */
@media (max-width:700px){
  .landing .hero{padding:40px 0 32px}
  .landing .statement{padding:40px 0}
  .landing figure{padding:40px 0}
  .landing .band{margin-top:40px;padding:32px 20px}
  .landing .close{padding:48px 0 56px}
  /* En-tete sur deux lignes au lieu de trois : marque et pilules ensemble, recherche
     pleine largeur en dessous — la promesse arrive plus haut dans le premier ecran. */
  header{flex-wrap:wrap;row-gap:8px}
  header .searchbox{order:3;flex-basis:100%;max-width:none;margin:0}
  header .pill{padding:0 10px;font-size:12px}
}
