/* ==========================================================================
   UEMI Docx — modèle d'état de sortie relié aux données (static/bureau/js/docx-binding.js)  [2026-10-21]
   Préfixe .dbk-* : voile de mise en page fidèle, pastille et menu des blocs vivants, panneau « Paramétrer »,
   diagnostic. Jetons de la plateforme (--uemi-*) avec valeurs de repli : suit le thème clair / sombre.
   ========================================================================== */
.dbk-overlay { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: rgba(10, 27, 45, .45); }
.dbk-overlay__box { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; padding: 24px 28px; border-radius: 16px;
  background: var(--uemi-surface, #fff); color: var(--uemi-ink, #1f2937); text-align: center; box-shadow: 0 24px 60px rgba(10, 20, 45, .35); }
.dbk-overlay__box small { color: var(--uemi-muted, #5a6577); font-size: .78rem; }
.dbk-spin { width: 34px; height: 34px; border: 4px solid #d9e2ef; border-top-color: var(--uemi-orange, #d96a32); border-radius: 50%; animation: dbk-spin .9s linear infinite; }
@keyframes dbk-spin { to { transform: rotate(360deg); } }

/* Pastille « Modèle n/100 » et ajout de blocs vivants (en bas à droite, au-dessus de la barre d'état). */
.dbk-pill { position: fixed; right: 92px; bottom: 46px; z-index: 900; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 999px; background: var(--uemi-surface, #fff); color: var(--uemi-ink, #1f2937);
  box-shadow: 0 8px 22px rgba(15, 30, 60, .16); font: 600 12px/1.2 inherit; cursor: pointer; }
.dbk-pill b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12px; background: #12805c; }
.dbk-pill.is-warn b { background: #a15c00; }
.dbk-pill.is-bad b { background: #b42335; }
.dbk-add { position: fixed; right: 92px; bottom: 92px; z-index: 900; display: flex; gap: 4px; }
.dbk-add button { padding: 4px 9px; border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 999px; background: var(--uemi-surface, #fff);
  color: var(--uemi-navy, #0b2854); font: 600 11px/1.3 inherit; cursor: pointer; box-shadow: 0 4px 12px rgba(15, 30, 60, .1); }
.dbk-add button:hover, .dbk-pill:hover { border-color: var(--uemi-primary, #1d4ed8); }

/* Pastille sur un bloc vivant. */
.dbk-chip { position: absolute; z-index: 950; display: flex; gap: 4px; }
.dbk-chip[hidden] { display: none; }
.dbk-chip button { padding: 3px 9px; border: 0; border-radius: 999px; background: var(--uemi-navy, #0b2854); color: #fff; font: 600 11px/1.4 inherit; cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 30, 60, .2); }
.dbk-chip button + button { background: var(--uemi-orange, #d96a32); }
.uemi-formtable:hover, figure.uemi-widget:hover { outline: 2px dashed rgba(29, 78, 216, .35); outline-offset: 3px; }
.dbk-flash { outline: 3px solid var(--uemi-orange, #d96a32) !important; outline-offset: 4px; transition: outline-color .4s; }

/* Panneau latéral (modèle « Outlook ») : enfant de <body>, fermeture par le fond, la croix ou Échap. */
.dbk-layer { position: fixed; inset: 0; z-index: 9200; }
.dbk-backdrop { position: absolute; inset: 0; background: rgba(10, 27, 45, .35); }
.dbk-drawer { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(860px, 100vw);
  background: var(--uemi-surface, #fff); color: var(--uemi-ink, #1f2937); box-shadow: -18px 0 50px rgba(10, 20, 45, .25); animation: dbk-in .2s ease-out; }
@keyframes dbk-in { from { transform: translateX(40px); opacity: .4; } }
.dbk-drawer > header { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; border-top: 4px solid var(--uemi-orange, #d96a32);
  border-bottom: 1px solid var(--uemi-line, #dfe5ee); }
.dbk-drawer > header p { margin: 0; color: var(--uemi-orange, #d96a32); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.dbk-drawer > header h2 { margin: 2px 0; color: var(--uemi-navy, #0b2854); font-size: 1.05rem; font-weight: 800; }
.dbk-drawer > header small { color: var(--uemi-muted, #5a6577); font-size: .76rem; }
.dbk-x { width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--uemi-surface-2, #f3f6fa); color: inherit; font-size: 20px; cursor: pointer; }
.dbk-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.dbk-foot { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--uemi-line, #dfe5ee); }
.dbk-foot > span { flex: 1 1 auto; }
.dbk-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.dbk-modes button { padding: 6px 12px; border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 999px; background: var(--uemi-surface, #fff); color: var(--uemi-ink, #1f2937);
  font: 600 12px/1.2 inherit; cursor: pointer; }
.dbk-modes button.is-on { border-color: var(--uemi-navy, #0b2854); background: var(--uemi-navy, #0b2854); color: #fff; }
.dbk-help { margin: 0; padding: 8px 10px; border-radius: 9px; background: var(--uemi-surface-2, #f3f6fa); color: var(--uemi-muted, #5a6577); font-size: .78rem; }
.dbk-f { display: flex; flex-direction: column; gap: 3px; font-size: .76rem; font-weight: 700; color: var(--uemi-ink, #1f2937); }
.dbk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dbk-drawer select, .dbk-drawer input[type=text], .dbk-drawer input[type=search], .dbk-cols input, .dbk-cols select { min-height: 32px; padding: 4px 8px;
  border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 8px; background: var(--uemi-surface, #fff); color: var(--uemi-ink, #1f2937); font: 500 12px/1.3 inherit; }
.dbk-checks { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow: auto; padding: 6px 8px; border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 8px; font-weight: 500; }
.dbk-check { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.dbk-cols p { margin: 0 0 4px; color: var(--uemi-muted, #5a6577); font-size: .74rem; }
.dbk-cols table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.dbk-cols th { padding: 4px; color: var(--uemi-muted, #5a6577); text-align: left; }
.dbk-cols td { padding: 2px 3px; }
.dbk-cols td input, .dbk-cols td select { width: 100%; }
.dbk-cols .dbk-unit { width: 52px; }
.dbk-cols td button { border: 0; background: none; color: var(--uemi-muted, #5a6577); font-size: 16px; cursor: pointer; }
.dbk-cn { color: var(--uemi-primary, #1d4ed8); font-weight: 800; font-family: ui-monospace, Menlo, monospace; }
.dbk-pull { padding: 10px; border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 12px; background: var(--uemi-surface-2, #f3f6fa); }
.dbk-pull__bar { display: flex; gap: 8px; }
.dbk-pull__bar input { flex: 1 1 auto; min-width: 0; }
.dbk-out:not(:empty) { margin-top: 8px; }
.dbk-paper { max-height: 420px; overflow: auto; padding: 10px; border-radius: 8px; background: #fff; color: #1f2937; }   /* rendu « papier » */
.dbk-paper img { max-width: 100%; height: auto; }
.dbk-muted { margin: 0; color: var(--uemi-muted, #5a6577); font-size: .76rem; }
.dbk-err { margin: 0; color: #b42335; font-size: .78rem; }

/* Diagnostic. */
.dbk-score { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.dbk-score b { color: var(--uemi-navy, #0b2854); font-size: 2rem; font-weight: 800; }
.dbk-score p { flex-basis: 100%; margin: 0; color: var(--uemi-muted, #5a6577); font-size: .8rem; }
.dbk-finds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dbk-find { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--uemi-line, #dfe5ee); border-left-width: 4px; border-radius: 10px; font-size: .78rem; }
.dbk-find.is-bad { border-left-color: #b42335; } .dbk-find.is-warn { border-left-color: #a15c00; } .dbk-find.is-info { border-left-color: #1d4ed8; } .dbk-find.is-ok { border-left-color: #12805c; }
.dbk-sev { flex: 0 0 auto; align-self: flex-start; padding: 1px 7px; border-radius: 999px; background: var(--uemi-surface-2, #f3f6fa); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.dbk-find strong { display: block; color: var(--uemi-ink, #1f2937); }
.dbk-find small { color: var(--uemi-muted, #5a6577); font-size: .7rem; }
.dbk-find p { margin: 3px 0 0; }
.dbk-fix { color: var(--uemi-navy, #0b2854); font-weight: 600; }
.dbk-acts { display: flex; gap: 6px; margin-top: 5px; }
.dbk-acts button, .dbk-acts a { padding: 2px 9px; border: 1px solid var(--uemi-line, #dfe5ee); border-radius: 999px; background: var(--uemi-surface, #fff); color: var(--uemi-navy, #0b2854);
  font: 600 11px/1.5 inherit; text-decoration: none; cursor: pointer; }
.dbk-finds--mini .dbk-find { padding: 5px 8px; }
@media (max-width: 760px) { .dbk-row { grid-template-columns: 1fr; } .dbk-pill, .dbk-add { right: 12px; } }
