/* Écran 05 — Bordereau et visionneuse (3 colonnes 380 / 1fr / 380, hauteur de l'écran). */
.bd { display: grid; grid-template-columns: 380px minmax(0, 1fr) 380px; height: 100vh; }
.with-admin .bd { height: calc(100vh - 38px); }
.bd-list { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.bd-list-h { padding: 20px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.bd-title { display: flex; justify-content: space-between; align-items: baseline; }
.bd-title h1 { font-weight: 500; font-size: 26px; }
.bd-title span { font-size: 12.5px; color: var(--muted); }
.bd-search { width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff; }
.bd-search::placeholder { color: var(--label); }
.bd-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.bd-series { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.bd-serie { font-size: 12px; font-weight: 600; border: 0; border-radius: 6px; padding: 3px 8px; background: var(--line-soft-2); color: var(--text-2b); cursor: pointer; }
.bd-serie[aria-pressed="true"] { background: var(--ink); color: #fff; }
.bd-scroll { overflow: auto; flex: 1; }
.bd-none { padding: 18px 20px; font-size: 13px; color: var(--muted); }
.bd-group { padding: 10px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--label); background: var(--surface-2); border-bottom: 1px solid var(--line-soft-2); }
.bd-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft-2); cursor: pointer; background: #fff; }
.bd-item:hover { background: var(--surface-2); }
.bd-item.sel { background: var(--select); box-shadow: inset 3px 0 0 var(--blue); }
.bd-item .cote { justify-content: center; align-self: start; margin-top: 1px; padding: 2px 5px; }
.bd-item-t .t { font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.bd-item-t .d { font-size: 12px; color: var(--meta); margin-top: 2px; }
.bd-item .pill { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; align-self: start; }

.bd-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-alt); }
.bd-view-h { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); min-height: 53px; }
.bd-cote-dark { font-size: 12px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 4px; padding: 3px 7px; white-space: nowrap; }
.bd-cote-dark.prov { background: #fff; color: var(--steel); border: 1px dashed var(--label); }
.bd-view-t { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.bd-pages { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bd-tool { font-size: 12.5px; font-weight: 500; color: var(--steel); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; background: #fff; cursor: pointer; white-space: nowrap; }
.bd-tool:hover { background: var(--surface-2); }
.bd-paper-wrap { flex: 1; min-height: 0; overflow: auto; padding: 24px; }
.bd-empty { margin: auto; padding: 40px; color: var(--muted); }
.bd-missing { max-width: 520px; margin: 40px auto; background: #fff; border-radius: 4px; padding: 36px 40px; box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 12px 30px -12px rgba(16,24,40,.18); }
.bd-missing .serif { font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
.bd-missing p { font-size: 14px; line-height: 1.6; color: var(--text-2b); margin-bottom: 16px; }

/* habillage du rendu de vault.js : la feuille blanche ombrée de la maquette */
.bd-pv { margin: 0 auto; max-width: 760px; border: 0; background: transparent; }
.bd-pv .ld-pv-bar { display: none; }
.bd-pv .ld-pv-view { background: transparent; }
.bd-paper-wrap:has(.bd-pv) { padding: 0; overflow: hidden; }
.bd-pv .ld-pdf { height: calc(100vh - 53px); padding: 28px 24px; gap: 18px; overflow: auto; }
.with-admin .bd-pv .ld-pdf { height: calc(100vh - 38px - 53px); }
.bd-pv .ld-pv-pre, .bd-pv .ld-pv-img, .bd-pv .ld-pv-frame, .bd-pv .ld-pv-msg { margin: 28px 24px; width: auto; }
.bd-pv .ld-pv-frame { width: calc(100% - 48px); }
.bd-pv .ld-pv-view { max-height: calc(100vh - 53px); overflow: auto; }
.with-admin .bd-pv .ld-pv-view { max-height: calc(100vh - 38px - 53px); }
.bd-pv .ld-pdf canvas { box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 12px 30px -12px rgba(16,24,40,.18); }
.bd-pv .ld-pv-pre { background: #fff; padding: 44px 48px 56px; min-height: 600px; font: 12px/1.9 var(--mono); color: #22262B; box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 12px 30px -12px rgba(16,24,40,.18); }
.bd-pv .ld-pv-img { background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 12px 30px -12px rgba(16,24,40,.18); padding: 0; }
.bd-pv .ld-pv-frame { height: calc(100vh - 160px); background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.bd-pv .ld-pv-msg { background: #fff; border-radius: 4px; min-height: 260px; }

/* rendu générique de vault.js (aussi utilisé en plein écran et ailleurs) */
.ld-pv-body { min-height: 120px; }
.ld-pv-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; padding: 24px; text-align: center; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.ld-pv-msg b { color: var(--ink); }
.ld-pv-btn { padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--steel); font-weight: 500; font-size: 12.5px; cursor: pointer; }
.ld-pv-bar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.ld-pv-kind { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--ink); color: #fff; }
.ld-pv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ld-pv-meta { font-size: 12px; color: var(--muted); white-space: nowrap; } .ld-pv-sp { flex: 1; }
.ld-pdf { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 12px; overflow: auto; height: min(78vh, 980px); }
.ld-pdf canvas { display: block; max-width: 100%; height: auto !important; background: #fff; }
.ld-pdf-ph { flex: none; max-width: 100%; display: flex; align-items: center; justify-content: center; background: #fff; font-size: 12px; color: var(--label); }
.ld-pv-frame { display: block; width: 100%; height: min(78vh, 980px); border: 0; background: #fff; }
.ld-pv-img { display: block; max-width: 100%; margin: 0 auto; }
.ld-pv-pre { margin: 0; overflow: auto; padding: 16px; background: #fff; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.ld-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: ldspin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes ldspin { to { transform: rotate(360deg); } }
.ld-ov { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; padding: 16px; background: rgba(16,24,32,.62); }
.ld-ov-panel { display: flex; flex-direction: column; width: min(1200px, 100%); background: var(--bg-alt); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-float); }
.ld-ov-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.ld-ov-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-ov-body { flex: 1; min-height: 0; overflow: auto; }
.ld-ov .ld-pdf { height: calc(100vh - 120px); } .ld-ov .ld-pv-frame { height: calc(100vh - 120px); }

.bd-aside { background: #fff; border-left: 1px solid var(--line); overflow: auto; padding: 22px 24px 32px; min-height: 0; }
.bd-aside-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bd-aside-h .vis { font-size: 11.5px; padding: 2px 8px; border-radius: 5px; }
.bd-h2 { font-weight: 500; font-size: 22px; line-height: 1.3; margin-top: 10px; }
.bd-by { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.bd-lab { font-size: 12.5px; font-weight: 700; margin: 20px 0 6px; }
.bd-lab.ok { color: var(--ok-fg); } .bd-lab.no { color: var(--lack-fg); }
.bd-read { font-family: var(--serif); font-size: 16.5px; line-height: 1.62; color: #22262B; white-space: pre-wrap; }
.bd-nonote { margin-top: 16px; font-size: 13.5px; line-height: 1.6; color: var(--muted); padding: 12px 14px; border: 1px dashed var(--border); border-radius: 10px; }
.bd-note-edit .serif-in { font-family: var(--serif); font-size: 16px; line-height: 1.55; }
.bd-vis-choice { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.bd-sec { margin: 22px 0 8px; }
.bd-cite { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-soft-2); font-size: 13px; line-height: 1.5; color: var(--text-2); }
.bd-cite b { color: var(--text-2b); }
.bd-facts { display: flex; flex-direction: column; gap: 6px; }
.bd-fact { display: flex; gap: 8px; border: 0; background: none; padding: 0; text-align: left; font-size: 13px; color: var(--ink); cursor: pointer; }
.bd-fact b { font-size: 11.5px; color: var(--label); white-space: nowrap; margin-top: 1px; }
.bd-fact:hover span { color: var(--blue); }
.bd-prov { margin-top: 22px; background: var(--soft-2); border-radius: 10px; padding: 13px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 12.5px; line-height: 1.45; }
.bd-prov > span:nth-child(odd) { color: var(--meta); } .bd-prov > span:nth-child(even) { color: var(--steel); }
.bd-prov .mono { font-size: 11.5px; }
.bd-validate { margin-top: 18px; }
.bd-thread { margin-top: 6px; }

@media (max-width: 1180px) {
  .bd { grid-template-columns: 300px minmax(0, 1fr); height: auto; }
  .bd-aside { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .bd { grid-template-columns: minmax(0, 1fr); }
  .bd-list { max-height: 50vh; } .bd-pv .ld-pdf { height: 70vh; }
}

/* scellé : numéro lisible, date, vérification d'un fichier */
.bd-seal { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.bd-seal.bad { border-color: var(--err, #b42318); }
.bd-seal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bd-seal-ok { font-size: 12px; color: var(--ok-ink, #1f6f43); }
.bd-seal-no { font-size: 17px; font-weight: 600; letter-spacing: .06em; }
.bd-seal-d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.bd-seal-more { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.bd-seal-more summary { cursor: pointer; }
.bd-seal-sha { word-break: break-all; font-size: 11.5px; margin-top: 4px; color: var(--ink, inherit); }
.bd-verif { display: inline-block; margin-top: 10px; cursor: pointer; font-size: 13.5px; }
.bd-verif-in { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bd-verif-res { margin-top: 8px; font-size: 13.5px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f4f5f7); }
.bd-verif-res.ok { color: var(--ok-ink, #1f6f43); }
.bd-verif-res.no { color: var(--err, #b42318); }
