/* Onglet Documents : dossiers, vignettes, visionneuse plein écran (zoom au doigt). */

.puces { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.puce {
  border: 1px solid var(--filet); background: var(--blanc); color: var(--encre); border-radius: 999px; padding: 6px 14px;
  font-weight: 600; cursor: pointer; min-height: 40px;
}
.puce small { color: var(--gris); font-weight: 500; }
.puce[aria-pressed=true] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.puce[aria-pressed=true] small { color: inherit; }
:where(html[data-theme=nuit]) .puce[aria-pressed=true] { color: #0E1428; }

.docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 14px; }
.doc-carte { display: flex; flex-direction: column; border: 1px solid var(--filet); border-radius: 12px; overflow: hidden; background: var(--blanc); }
.doc-vignette {
  display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; border: 0; padding: 0; background: var(--survol);
  cursor: pointer; overflow: hidden;
}
.doc-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-pdf { font-weight: 700; font-size: 26px; letter-spacing: .04em; color: var(--retard); }
.doc-texte { display: grid; gap: 4px; padding: 10px 12px 12px; }
.doc-titre { overflow-wrap: anywhere; }
.doc-texte small { color: var(--gris); font-size: 13px; overflow-wrap: anywhere; }
.doc-chantier { display: flex; align-items: center; gap: 6px; }
.doc-texte .btn.lien { justify-self: start; margin-left: -8px; }
.ligne-dossier { display: grid; gap: 4px; }
.doc-place { margin: 0 0 12px; color: var(--gris); font-size: 14px; }

/* ---------- visionneuse ---------- */
dialog.visionneuse {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0B0D14; color: #F1F3FA; overflow: hidden;
}
dialog.visionneuse[open] { display: flex; flex-direction: column; }
dialog.visionneuse::backdrop { background: #0B0D14; }
.vis-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: #161A26; }
.vis-barre h2 { flex: 1 1 160px; min-width: 0; margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.vis-boutons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vis-boutons .btn.second { background: #20232F; color: #F1F3FA; border-color: #30344A; min-width: 40px; }
.vis-boutons .fermer { background: #20232F; color: #F1F3FA; border-color: #30344A; }
.vis-niveau { min-width: 4.2em; text-align: center; font-size: 13.5px; }
.vis-scene { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: zoom-in; }
.vis-scene.agrandie { cursor: grab; }
.vis-scene:focus-visible { outline-offset: -4px; }
.vis-scene img {
  position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; transform-origin: center center;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; pointer-events: none;
}
