/*
  IA-t-il un pilote dans l’avion ? — feuille de style unique
  Deux couleurs (papier, encre), polices du système, aucune image décorative.
  Tout le site est un bureau : une barre de menus, des fenêtres posées sur un fond tramé.
*/

/* ---- R É G L A G E S ---- */

:root {
  --paper: #fff;
  --ink: #000;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text: 16px;
  --small: 13px;
  --tiny: 11px;
  --gap: 18px;
  --shadow: 3px 3px 0 var(--ink);
  --measure: 36em;

  /* trame de bureau : un carré d’encre de 1 px tous les 3 px, comme un gris tramé d’écran 1 bit */
  --trame: conic-gradient(from 90deg at 1px 1px, transparent 95%, var(--ink) 0) 0 0 / 3px 3px;
  /*--trame: #000;*/
  /* hachures : ce qui reste à vérifier */
  --hachures: repeating-linear-gradient(-45deg, var(--ink) 0 1px, transparent 1px 4px);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root { --paper: #000; --ink: #fff; }
}

/* ---- B A S E ---- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body, h1, h2, h3, p, ul, ol, li, dl, dd, figure, blockquote, fieldset, legend { margin: 0; padding: 0; }

ul, ol { list-style: none; }

body {
  min-height: 100vh;
  font: var(--text)/1.45 var(--sans);
  color: var(--ink);
  background: var(--paper) var(--trame);
  /*background: #000;*/
}

h1, h2, h3 { font-size: inherit; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

img { display: block; max-width: 100%; height: auto; }
/* noir et blanc jusqu’au bout : les images aussi */
img { filter: grayscale(1) contrast(1.1); }

button, input, select { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; cursor: pointer; }

:focus-visible { outline: 2px dotted var(--ink); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--paper); }

strong, b { font-weight: 700; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* « muted » : pas de gris, on passe en petit */
.muted { font-size: var(--small); }

/* ---- B A R R E   D E   M E N U S ---- */

.menubar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.menubar a { display: flex; align-items: center; gap: 6px; padding: 6px 10px; text-decoration: none; }
.menubar a[aria-current] { background: var(--ink); color: var(--paper); }
.menubar__brand { white-space: nowrap; }
.menubar__brand svg { flex: none; }
.menubar nav { display: flex; flex-wrap: wrap; }
.menubar__right { margin-left: auto; display: flex; }
.menubar__right a { font-weight: normal; }

/* ---- B U R E A U   E T   F E N Ê T R E S ---- */

.desk {
  display: grid;
  gap: 22px;
  align-items: start;
  padding: 22px 12px 60px;
}

.win {
  min-width: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.win__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--ink);
}

.win__box {
  flex: none;
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--paper);
}

a.win__box:hover { background: var(--ink); }

.win__title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.win__title span {
  display: inline-block;
  max-width: 100%;
  padding: 0 7px;
  background: var(--paper);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.win__status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--ink);
  font-size: var(--small);
}

.win__body { padding: 14px; }
.win__body--flush { padding: 0; }

/* intertitres dans une fenêtre : gras, discret, sans capitales */
.head { font-size: var(--small); font-weight: 700; margin: 18px 0 6px; }
.head:first-child { margin-top: 0; }

/* ---- T E X T E ---- */

.text { font-family: var(--serif); font-size: 17px; line-height: 1.55; max-width: var(--measure); }
.text p + p, .text p + ul, .text ul + p { margin-top: 0.7em; }
.text ul { list-style: square; padding-left: 1.2em; }
.text h2, .text h3 { font-family: var(--sans); font-size: var(--small); margin: 1.4em 0 0.4em; }
.text blockquote { padding-left: 1em; border-left: 3px solid var(--ink); }

.intro { font-family: var(--serif); font-size: 17px; line-height: 1.5; max-width: var(--measure); }
.win__body > .intro:not(:last-child),
.win__body > .icons:not(:last-child) { margin-bottom: 18px; }
.doc__image { width: 100%; margin-bottom: 14px; border: 1px solid var(--ink); }

/* étiquettes */
.tags { display: flex; flex-wrap: wrap; gap: 2px 10px; font-family: var(--mono); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; padding: 0 5px; border: 1px solid var(--ink); font-size: var(--small); text-decoration: none; }

.flag {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--ink);
  background: var(--paper) var(--hachures);
  font-size: var(--tiny);
  font-weight: 700;
  line-height: 1.4;
}

.flag span { background: var(--paper); padding: 0 2px; }

.button {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* ---- R E S S O U R C E S  (accueil) ---- */

.desk--ressources { grid-template-columns: 1fr; }
.desk__side { display: grid; gap: 22px; min-width: 0; }

.search { display: flex; border: 1px solid var(--ink); }
.search input { flex: 1; min-width: 0; padding: 5px 8px; border: 0; background: var(--paper); }
.search input:focus { outline: 0; }
.search button { padding: 0 10px; border-left: 1px solid var(--ink); font-size: var(--small); font-weight: 700; }
.search button:hover { background: var(--ink); color: var(--paper); }

/* filtres : des cases à cocher */
.facet { border-top: 1px solid var(--ink); }
.facet:first-of-type { margin-top: 12px; }
.facet__label { display: flex; justify-content: space-between; padding: 6px 0; font-size: var(--small); font-weight: 700; cursor: pointer; list-style: none; }
.facet__label::-webkit-details-marker { display: none; }
.facet__label::after { content: "▸"; font-weight: normal; }
.facet[open] > .facet__label::after { content: "▾"; }
.facet__label .muted { font-weight: normal; margin-left: auto; margin-right: 8px; }
.facet__list { padding-bottom: 8px; font-size: 14px; }
.facet__list li { margin: 1px 0; }
.facet__list a { display: flex; align-items: baseline; gap: 7px; padding: 1px 2px; text-decoration: none; }
.facet__list a::before { content: ""; flex: none; width: 10px; height: 10px; border: 1px solid currentColor; transform: translateY(1px); }
.facet__list a.is-active::before { background: currentColor; }
.facet__list a .muted { margin-left: auto; }
.facet__list--tree ul { padding-left: 17px; }
.facet__more { display: none; }
.facet.is-expanded .facet__more { display: block; }
.facet__toggle { margin-bottom: 8px; font-size: var(--small); text-decoration: underline; }
.facet--verify a::before { background: var(--hachures); }

.active-filters { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.chip--remove:hover { background: var(--ink); color: var(--paper); }

/* liste façon gestionnaire de fichiers */
.list-head,
.item {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr) 3.5em;
  gap: 0 12px;
  padding: 7px 12px;
}

.list-head {
  position: sticky;
  top: 25px;
  z-index: 2;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-size: var(--small);
  font-weight: 700;
}

.list-head a { text-decoration: none; }
.list-head a[aria-current]::after { content: " ▾"; }
.list-head span:last-child { text-align: right; }

.item { border-bottom: 1px dotted var(--ink); }
.item:last-child { border-bottom: 0; }
.item__type { font-size: var(--small); line-height: 1.7; }
.item__type .flag { margin-top: 3px; }
.item__title { font-family: var(--serif); font-size: 18px; font-weight: normal; line-height: 1.25; }
.item__title a { text-decoration: none; }
.item__title a:hover { text-decoration: none; }
.item__by { margin-top: 2px; font-size: 14px; }
.item__footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 4px; }
.item__links { display: flex; gap: 10px; font-size: var(--small); }
.item__year { font-size: var(--small); text-align: right; line-height: 1.7; }

.pagination { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--ink); font-size: var(--small); }
.empty { padding: 20px 14px; font-family: var(--serif); font-style: italic; }

/* ---- F I C H E  (lire les informations) ---- */

.desk--ressource { grid-template-columns: minmax(0, 1fr); max-width: 1180px; }

.doc { display: grid; gap: 18px 28px; }
.doc__title { font-family: var(--serif); font-size: clamp(26px, 4vw, 40px); font-weight: normal; line-height: 1.08; letter-spacing: -0.01em; max-width: 20em; }
.doc__by { margin-top: 6px; font-family: var(--serif); font-size: 19px; font-style: italic; }
.doc__access { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }

.info { font-size: 14px; border-top: 1px solid var(--ink); }
.info > div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--ink); }
.info dt { font-weight: 700; }
.info dd .chips { margin-top: 1px; }

.notes { padding: 8px 10px; border: 1px dashed var(--ink); font-size: var(--small); }

.extrait { padding: 16px 0; border-top: 1px dotted var(--ink); }
.extrait:first-of-type { border-top: 0; padding-top: 4px; }
.extrait__title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.extrait__footer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 8px; font-size: var(--small); }

.relations li { padding: 7px 0; border-bottom: 1px dotted var(--ink); }
.relations li:last-child { border-bottom: 0; }
.relations__kind { display: block; font-size: var(--small); font-weight: 700; }
.relations__note { display: block; font-size: var(--small); font-style: italic; }

/* ---- R U B R I Q U E S  (icônes de dossiers) ---- */

.icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 10px;
  padding: 6px 0;
}

.icon { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; }
.icon:hover { background: none; color: inherit; }
.icon__shape { position: relative; width: 64px; height: 46px; margin-top: 12px; border: 2px solid var(--ink); background: var(--paper); }
.icon__shape::before { content: ""; position: absolute; left: -2px; top: -12px; width: 26px; height: 10px; border: 2px solid var(--ink); border-bottom: 0; background: var(--paper); }
.icon--full .icon__shape { background: var(--paper) var(--trame); }
.icon__name { padding: 1px 5px; font-size: 14px; font-weight: 700; line-height: 1.2; }
.icon__count { font-size: var(--tiny); }
.icon:hover .icon__name, .icon:focus-visible .icon__name { background: var(--ink); color: var(--paper); }
.icon:hover .icon__shape { background: var(--ink); }

.desk--rubrique { grid-template-columns: minmax(0, 1fr); max-width: 1180px; }
.rubrique__extraits { columns: 2 22em; column-gap: 32px; }
.rubrique__extraits .extrait { break-inside: avoid; }

/* ---- C A R T E ---- */

.desk--carte { grid-template-columns: minmax(0, 1fr); max-width: 1180px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--small); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__item[aria-pressed="false"] { text-decoration: line-through; }
.legend__item[aria-pressed="false"] .dot { opacity: 0.25; }

/* familles de types : des formes, pas des couleurs */
.dot, .point { background: var(--ink); }
.dot { display: inline-block; width: 11px; height: 11px; }
.dot--presse, .point--presse { border-radius: 50%; }
.dot--projet, .point--projet { border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.dot--web, .point--web { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.dot--autre, .point--autre { transform: rotate(45deg) scale(0.8); }

.carte {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 1;
  margin: 14px auto 0;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.carte__axis { position: absolute; border: 0 dashed var(--ink); }
.carte__axis--h { left: 5%; right: 5%; top: 50%; border-top-width: 1px; }
.carte__axis--v { top: 5%; bottom: 5%; left: 50%; border-left-width: 1px; }

.carte__pole { position: absolute; padding: 1px 5px; background: var(--paper); font-size: var(--small); font-weight: 700; line-height: 1.2; }
.carte__pole--top    { top: 1.5%; left: 50%; transform: translateX(-50%); }
.carte__pole--bottom { bottom: 1.5%; left: 50%; transform: translateX(-50%); }
.carte__pole--left   { left: 1.5%; top: 50%; transform: translateY(-50%) rotate(-90deg) translateY(-50%); transform-origin: left center; white-space: nowrap; }
.carte__pole--right  { right: 1.5%; top: 50%; transform: translateY(-50%) rotate(90deg) translateY(-50%); transform-origin: right center; white-space: nowrap; }

.carte__links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.carte .link { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.carte .link--contredit { stroke-dasharray: 5 4; }
.carte .link--illustre { stroke-dasharray: 1 3; stroke-linecap: round; stroke-width: 2; }
.carte .link--repond { stroke-dasharray: 8 3 2 3; }

.point { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; text-decoration: none; }
.point:hover { background: var(--ink); }
.point--projet:hover { background: var(--paper); }
.point--image { width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1px solid var(--ink); border-radius: 0; clip-path: none; transform: none; background: var(--paper); overflow: hidden; }
.point--image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.2); }

.carte.has-active .point { opacity: 0.2; }
.carte.has-active .point.is-active,
.carte.has-active .point.is-related { opacity: 1; }
.point.is-active { outline: 2px solid var(--ink); outline-offset: 3px; z-index: 2; }
.point.is-related { outline: 1px solid var(--ink); outline-offset: 2px; z-index: 1; }

.carte.hide-presse .point--presse,
.carte.hide-livres .point--livres,
.carte.hide-web .point--web,
.carte.hide-projet .point--projet,
.carte.hide-autre .point--autre { display: none; }

.carte__tooltip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(17rem, 70%);
  padding: 8px 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: var(--small);
  pointer-events: none;
}

.carte__tooltip strong { font-family: var(--serif); font-size: 16px; font-weight: normal; line-height: 1.2; }
.carte__tooltip ul { margin-top: 4px; }
.carte__tooltip li { display: flex; gap: 6px; align-items: baseline; }
.link-kind { flex: none; display: inline-block; width: 1.4em; border-top: 2px solid currentColor; transform: translateY(-0.2em); }
.link-kind--contredit { border-top-style: dashed; }
.link-kind--illustre { border-top-style: dotted; }

.carte__help { max-width: 900px; margin: 10px auto 0; font-size: var(--small); }

/* ---- P I E D ---- */

.site-footer { padding: 0 12px 24px; font-size: var(--tiny); }
.site-footer p { display: inline-block; padding: 1px 5px; background: var(--paper); }

/* ---- G R A N D S   É C R A N S ---- */

@media (min-width: 52em) {
  .desk { padding: 30px 30px 80px; gap: 30px; }
  .desk--ressources { grid-template-columns: 17rem minmax(0, 1fr); }
  .desk__side { position: sticky; top: 50px; max-height: calc(100vh - 70px); overflow-y: auto; padding: 0 4px 4px 0; }
  .doc { grid-template-columns: minmax(0, 1fr) 19rem; }
  .doc__head { grid-column: 1 / -1; }
  .doc__info { grid-column: 2; grid-row: 2; }
  .doc__text { grid-column: 1; grid-row: 2; }
  .desk--ressource, .desk--rubrique, .desk--carte { margin: 0 auto; }
}

@media (max-width: 34em) {
  .list-head, .item { grid-template-columns: minmax(0, 1fr) 3em; }
  .list-head span:first-child, .item__type { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  body { background: none; }
  .menubar, .desk__side, .site-footer { display: none; }
  .win { box-shadow: none; }
}

/* ---- T E R R I T O I R E S  (bureau, esprit « desktop documentary ») ---- */

body.template-territoires {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

body.template-territoires .menubar { position: static; flex: none; }
body.template-territoires { background: var(--paper); }

.bureau {
  --desk: var(--paper);
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: default;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  color: var(--ink);
  /* trame grise de bureau, en noir et blanc */
  background-color: var(--desk);
  background: var(--desk) var(--trame);
  font-family: var(--sans);
}

.bureau.is-panning { cursor: grabbing; }

.bureau__world { position: absolute; top: 0; left: 0; width: 4000px; transform-origin: 0 0; opacity: 0; }
.bureau.is-ready .bureau__world { opacity: 1; }

.dossier { position: absolute; }

/* icône de dossier */
.dossier__icon {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
  border: 0;
  text-align: center;
}

.dossier__icon:hover { border: 0; }

.dossier__shape {
  position: relative;
  width: 76px;
  height: 56px;
  margin-top: 14px;
  border: 2px solid var(--ink);
  background: var(--desk);
}

.dossier__shape::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -14px;
  width: 30px;
  height: 12px;
  border: 2px solid var(--ink);
  border-bottom: 0;
  background: var(--desk);
}

.dossier__name {
  margin-top: 6px;
  padding: 1px 5px;
  background: var(--desk);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.dossier__name small { display: block; font-size: 11px; font-weight: normal; }
.dossier__icon:hover .dossier__name,
.dossier__icon:focus-visible .dossier__name { background: var(--ink); color: var(--desk); }

.groupe { position: absolute; }

.groupe__tag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 1px 6px;
  background: var(--desk);
  border: 1px solid var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  white-space: nowrap;
}

/* fenêtre */
.fenetre {
  position: absolute;
  z-index: 2;
  width: 300px;
  background: var(--desk);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.fenetre__bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  border-bottom: 1px solid var(--ink);
  cursor: grab;
  padding-top: 5px;
  padding-bottom: 5px;
}

.fenetre.is-moving .fenetre__bar { cursor: grabbing; }

.fenetre__close {
  flex: none;
  width: 12px;
  height: 12px;
  padding: 0;
  margin-right: 6px;
  border: 1px solid var(--ink);
  background: var(--desk);
  box-shadow: 0 0 0 2px var(--desk);
  cursor: pointer;
  box-sizing: border-box;
}

.fenetre__close:active { background: var(--ink); }

.fenetre__title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.fenetre__title span {
  display: inline-block;
  max-width: 100%;
  padding: 0 6px;
  background: var(--desk);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.fenetre__body {
  max-height: 340px;
  overflow-y: auto;
  padding: 10px 12px;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--desk);
}

.fenetre__image { display: block; width: 100%; height: auto; max-height: 220px; object-fit: contain; margin-bottom: 10px; border: 1px solid var(--ink); }
.fenetre__extrait { font-family: var(--serif); font-size: 14px; }
.fenetre__extrait + .fenetre__extrait { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ink); }
.fenetre__extrait p + p { margin-top: 0.6em; }
.fenetre__subtitle { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }

.fenetre__footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-top: 1px solid var(--ink);
  font-size: 11px;
}

.fenetre__credit { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fenetre__actions { flex: none; display: flex; gap: 8px; }
.fenetre__actions a { border-bottom: 1px solid var(--ink); }
.fenetre__actions a:hover { background: var(--ink); color: var(--desk); }

/* fenêtre repliée : seule la barre de titre reste */
.fenetre.is-shaded .fenetre__body,
.fenetre.is-shaded .fenetre__footer { display: none; }
.fenetre.is-shaded .fenetre__bar { border-bottom: 0; }

.fenetre.is-linked { outline: 2px solid var(--ink); outline-offset: 3px; }

/* liens */
.bureau__links { position: absolute; top: 0; left: 0; z-index: 1; overflow: visible; pointer-events: none; }
.bureau__links .link { fill: none; stroke: var(--ink); transition: opacity 0.15s ease; }
.link--source { stroke-width: 1.2; stroke-dasharray: 2 4; }
.link--relation { stroke-width: 2.2; }
.link--contredit { stroke-dasharray: 9 6; }
.link--illustre { stroke-dasharray: 1 5; stroke-linecap: round; stroke-width: 3; }
.link--repond { stroke-dasharray: 12 5 3 5; }
.bureau.has-focus .link { opacity: 0.1; }
.bureau.has-focus .link.is-on { opacity: 1; stroke-width: 3.5; }
.bureau.hide-relation .link--relation,
.bureau.hide-source .link--source { display: none; }

/* niveaux de détail */
.bureau.lod-mid .fenetre__extrait { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.bureau.lod-far .fenetre__body,
.bureau.lod-far .fenetre__footer,
.bureau.lod-far .groupe__tag { visibility: hidden; }
.bureau.lod-far .dossier__name { visibility: hidden; }

.bureau__names { display: none; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.bureau.lod-far .bureau__names { display: block; }
.bureau__names span {
  position: absolute;
  width: max-content;
  max-width: 12rem;
  transform: translate(-50%, 18px);
  padding: 1px 5px;
  background: var(--desk);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.bureau__names small { display: block; font-weight: normal; font-size: 10px; }

/* commandes */
.bureau__controls,
.bureau__layers,
.bureau__panel select,
.bureau__status {
  background: var(--desk);
  border: 1px solid var(--ink);
  /*box-shadow: 2px 2px 0 var(--ink);*/
  color: var(--ink);
}

.bureau__controls { position: absolute; top: 16px; left: 16px; z-index: 5; display: flex; flex-direction: column; }
.bureau__controls button { width: 34px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink); }
.bureau__controls button + button { border-top: 1px solid var(--ink); }
.bureau__controls button:hover { background: var(--ink); color: var(--desk); }

.bureau__panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-size: 12px;
}

.bureau__panel select { width: min(16rem, 60vw); padding: 0.35em 0.5em; border-radius: 0; font-size: 12px; }
.bureau__layers { padding: 0.4em 0.7em; }
.bureau__layers legend { padding: 0; margin-bottom: 0.3em; font-weight: 700; }
.bureau__layers label { display: flex; align-items: center; gap: 0.45em; cursor: pointer; white-space: nowrap; }
.bureau__layers input { margin: 0; border: 0; accent-color: var(--ink); }
.swatch { display: inline-block; width: 1.8em; border-top: 2px solid var(--ink); }
.swatch--source { border-top: 2px dotted var(--ink); }

.bureau__status { position: absolute; left: 16px; bottom: 12px; z-index: 5; margin: 0; padding: 0.2em 0.6em; font-size: 11px; max-width: calc(100% - 32px); }

/* ---- M I S E   E N   É V I D E N C E  (Carte, Territoires) ---- */

.highlight { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 0.6em; font-size: var(--small); }
.highlight select { max-width: 14rem; padding: 2px 6px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); }
.highlight__status { margin: 0; }
.highlight__status button { text-decoration: underline; cursor: pointer; }

.desk--carte.has-highlight .point:not(.is-match) { opacity: 0.1; }
.desk--carte.has-highlight .point.is-match { z-index: 2; outline: 2px solid var(--ink); outline-offset: 3px; }

.bureau .highlight { flex-direction: column; align-items: stretch; width: min(16rem, 60vw); }
.bureau .highlight select { width: 100%; max-width: none; }
.bureau .highlight__status { align-self: flex-end; }
.bureau .highlight select { 
  border: 1px solid var(--ink); 
  border-radius: 0; 
  /*box-shadow: 2px 2px 0 var(--ink); color: var(--ink); */
  background: var(--desk); 
}
.bureau .highlight__status { padding: 0.1em 0.5em; background: var(--desk); border: 1px solid var(--ink); }
.bureau.has-highlight .fenetre:not(.is-match) { opacity: 0.2; }
.bureau.has-highlight .fenetre.is-match { outline: 3px solid var(--ink); outline-offset: 3px; }

button.groupe__tag { cursor: pointer; color: var(--ink); }
button.groupe__tag:hover { background: var(--ink); color: var(--desk); }

.fenetre__mots { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.mot {
  padding: 0 5px;
  border: 1px solid var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}
.mot--lieu { border-style: dashed; }
.mot--organisation { font-weight: 700; }
.mot--personne { font-style: italic; }
.mot:hover { background: var(--ink); color: var(--desk); }
.fenetre__mots:empty { display: none; }

