/* Tableau d'enquête : complète fiches.css. La planche reste dense, le style reste calme :
   filets fins, aplats francs, pas de halo ni de balayage. Seuls bougent les retours d'interface. */
.page-tableau { --contenu: 1400px; }

/* L'en-tête est plus compact : le sujet de la page, c'est la planche. */
.page-tableau .bandeau { margin-bottom: 32px; padding-bottom: 28px; }
.page-tableau .bandeau .logo svg, .page-tableau .bandeau .logo img { width: 210px; }
.page-tableau .bandeau h1 { font-size: clamp(2rem, 5vw, 3.6rem); }

/* --- Zone d'enquête --- */
.enquete { display: grid; grid-template-columns: 1fr; gap: 20px; }
.enquete > *, .outils > * { min-width: 0; }
.outils { display: grid; gap: 16px; }

.recherche { display: flex; flex-direction: column; gap: 6px; max-width: 40rem; }
.recherche label, .filtres legend {
  font-family: var(--titre);
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.recherche input {
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--texte);
  border-radius: 0;
}

.filtres { display: flex; flex-wrap: wrap; gap: 2px 18px; min-width: 0; margin: 0; padding: 0; border: 0; }
.filtres legend { padding: 0; margin-bottom: 4px; }
.filtres label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: .95rem; }
.filtres label:has(input:focus-visible) { outline: 3px solid var(--texte); outline-offset: 2px; }
.filtres input { width: 24px; height: 24px; margin: 0; accent-color: var(--texte); }
.filtres input:focus-visible { outline: none; }

.barre { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.zoom { display: flex; gap: 8px; }
.zoom .btn { font-size: 1.1rem; min-width: 48px; padding-inline: 12px 18px; }

/* Échantillons et ficelles : chaque type a sa couleur ET son style de trait (la couleur ne porte jamais seule le sens). */
.echantillon { display: inline-block; width: 34px; height: 0; border-top: 4px solid; }
.echantillon.type-formation { border-top-color: var(--texte); }
.echantillon.type-equipe { border-top-style: dashed; border-top-color: var(--primaire); }
.echantillon.type-argent { border-top-style: dashed; border-top-color: var(--or-fonce); border-top-width: 5px; }
.echantillon.type-conflit { border-top-color: var(--marque-1-fonce); border-top-width: 5px; }
.echantillon.type-accord { border-top-style: dotted; border-top-color: var(--succes); border-top-width: 5px; }
.echantillon.type-tentative { border-top-style: dashed; border-top-color: var(--or-fonce); border-top-width: 4px; }

.legende-cat { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.legende-cat li { display: flex; align-items: center; gap: 8px; }
.photo-mini { width: 20px; height: 20px; display: inline-block; }

/* --- La planche : un filet autour, et à l'intérieur une zone qui défile --- */
.planche-cadre { position: relative; border: 1px solid var(--texte); background: var(--surface); }
.planche-defile { overflow: auto; max-height: 80vh; }
.planche {
  position: relative;
  width: 1640px;
  height: 1360px;
  transform-origin: 0 0;
  background-image: radial-gradient(circle, rgba(30, 22, 56, .12) 1.6px, transparent 1.8px);
  background-size: 20px 20px;
}
.ficelles { position: absolute; inset: 0; overflow: visible; }
.ficelle { fill: none; stroke-width: 3; stroke-linecap: round; transition: opacity .2s ease; }
.ficelle.type-formation { stroke: var(--texte); }
.ficelle.type-equipe { stroke: var(--primaire); stroke-dasharray: 10 7; }
.ficelle.type-argent { stroke: var(--or-fonce); stroke-dasharray: 14 6; stroke-width: 3.5; }
.ficelle.type-conflit { stroke: var(--marque-1-fonce); stroke-width: 4; }
.ficelle.type-accord { stroke: var(--succes); stroke-dasharray: 1 8; stroke-width: 5; }
.ficelle.type-tentative { stroke: var(--or-fonce); stroke-dasharray: 10 8; stroke-width: 3; }
.zone-clic { fill: none; stroke: transparent; stroke-width: 24; cursor: pointer; pointer-events: stroke; }
.zone-clic:focus-visible { outline: none; }
.zone-clic:focus-visible + .ficelle, .zone-clic:hover + .ficelle { stroke-width: 6; }
.planche.focus .ficelle { opacity: .12; }
.planche.focus .ficelle.actif { opacity: 1; stroke-width: 6; }
.cache { display: none; }

/* --- Cartes des personnes : des fiches épinglées, seul endroit où un cadre a un sens --- */
.carte-poi {
  position: absolute;
  width: 176px;
  padding: 0 0 10px;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--texte);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
  z-index: 1;
}
.carte-poi:hover { z-index: 3; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1.04); }
.carte-poi:focus-visible { z-index: 3; }
.carte-poi.selection { z-index: 3; background: var(--marque-2); }
.planche.focus .carte-poi { opacity: .35; }
.planche.focus .carte-poi.voisin, .planche.focus .carte-poi.selection { opacity: 1; }
/* La punaise : le capteur rond du casque. */
.punaise {
  position: absolute;
  top: -9px;
  left: calc(50% - 9px);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--texte);
  box-shadow: inset 0 0 0 3px var(--cyan);
}
.photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  margin-bottom: 8px;
  font-family: var(--affiche);
  font-size: 1.9rem;
  letter-spacing: .02em;
  color: var(--texte);
}
.carte-poi strong, .carte-poi small { margin-inline: 10px; }
.cat-pionnier .photo, .photo-mini.cat-pionnier { background: var(--cyan); }
.cat-labo .photo, .photo-mini.cat-labo { background: var(--marque-1); }
.cat-geant .photo, .photo-mini.cat-geant { background: var(--texte); color: var(--marque-2); }
.cat-financeur .photo, .photo-mini.cat-financeur { background: var(--jaune); }
.carte-poi strong { display: block; font-family: var(--titre); font-size: 1.02rem; font-weight: 700; line-height: 1.2; }
.carte-poi small { display: block; margin-top: 3px; font-size: .875rem; line-height: 1.3; color: var(--texte-2); }

/* --- Panneau « Pièce à conviction » --- */
.dossier { border-top: 3px solid var(--texte); }
.dossier-defile { padding: 14px 4px 14px 0; }
.dossier h2 { margin: 0 0 12px; font: 400 1.5rem/1.15 var(--affiche); letter-spacing: -.01em; text-transform: uppercase; }
.dossier h3 { margin: 18px 0 6px; font-size: 1.05rem; font-weight: 700; }
.dossier ul { margin: 6px 0 0; padding-left: 18px; list-style: square; }
.dossier li { margin-bottom: 6px; }
.dossier .btn { margin: 4px 0; }
.dossier mark { background: var(--marque-2); color: var(--texte); padding: 0 2px; }
.dossier ul.resultats { list-style: none; padding: 0; }
.resultats button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--texte);
  color: var(--texte);
  cursor: pointer;
}
.resultats button:hover { background: var(--marque-2); }
.resultats strong { font-family: var(--titre); }
.resultats small { display: block; color: var(--texte-2); }

/* --- Commandes et bandeaux d'état --- */
.commandes { display: flex; flex-wrap: wrap; gap: 8px; }
#bouton-son[aria-pressed="true"]::before { background: var(--cyan); }

/* Marques de mise au point aux quatre angles de la planche. */
.coin { position: absolute; z-index: 3; width: 22px; height: 22px; border: 0 solid var(--texte); pointer-events: none; }
.coin.hg { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; }
.coin.hd { top: 6px; right: 6px; border-top-width: 2px; border-right-width: 2px; }
.coin.bg { bottom: 6px; left: 6px; border-bottom-width: 2px; border-left-width: 2px; }
.coin.bd { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; }

.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 8px 36px;
  font-family: var(--titre);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--texte-2);
  background: var(--fond);
}
.hud-haut { border-bottom: 1px solid var(--texte); }
.hud-bas { border-top: 1px solid var(--texte); }
.hud-etat { color: var(--texte); }
.hud-etat::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--succes); vertical-align: 1px; }
.hud-etat.en-cours::before { background: var(--marque-1); }

/* Cadre de mise au point qui se pose sur la personne analysée. */
.mise-au-point { position: absolute; z-index: 4; pointer-events: none; opacity: 0; transform: scale(1.3); transition: opacity .2s ease, transform .25s ease; }
.mise-au-point.visible { opacity: 1; transform: scale(1); }
.mise-au-point span { position: absolute; width: 22px; height: 22px; border: 0 solid var(--marque-1-fonce); }
.mise-au-point span:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.mise-au-point span:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.mise-au-point span:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.mise-au-point span:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }

/* Panneau pendant l'analyse, puis rapport. */
.analyse p { margin: 0 0 10px; font-family: var(--titre); font-weight: 700; }
.jauge { height: 14px; border: 1px solid var(--texte); background: var(--surface); }
.jauge span { display: block; height: 100%; width: 0; background: var(--rayure-rose); animation: remplir var(--duree, .8s) linear forwards; }
@keyframes remplir { to { width: 100%; } }
.rapport-titre { margin: 0 0 4px; font-family: var(--titre); font-size: .875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--texte-2); }
.rapport { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 12px; }
.rapport dt { font-size: .875rem; font-weight: 700; color: var(--texte-2); padding-top: 2px; }
.rapport dd { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .mise-au-point { transition: none; transform: none; }
  .jauge span { animation: none; width: 100%; }
}

/* --- Version allégée de l'accueil : des noms plus grands, sans la fonction, pour rester lisible une fois réduit --- */
.apercu .carte-poi small { display: none; }
.apercu .carte-poi strong { font-size: 1.5rem; line-height: 1.1; }
.apercu .photo { height: 52px; font-size: 1.6rem; }
.apercu .planche-defile { max-height: none; }
.apercu .dossier-defile { max-height: 70vh; overflow: auto; }
.aide-glisser { display: none; }
main > section > .btn { justify-self: start; }

/* --- Version texte --- */
.tous-liens { padding-left: 20px; list-style: square; }
.tous-liens > li { margin-bottom: 12px; }
.tous-liens > li > strong { font-family: var(--titre); }

/* --- Mise en page --- */
@media (min-width: 1100px) {
  .enquete { grid-template-columns: 1fr 360px; gap: 20px 28px; align-items: start; }
  .outils { grid-column: 1 / -1; }
  .dossier { position: sticky; top: 16px; }
  .dossier-defile { max-height: calc(80vh - 6px); overflow: auto; }
  .apercu { grid-template-columns: 1fr 320px; }
  .apercu .dossier-defile { max-height: 620px; }
}
@media (max-width: 760px) {
  .aide-glisser { display: inline; }
}
@media print {
  .recherche, .filtres, .barre, .planche-cadre { display: none; }
}
