html, body {
  margin: 0;
  height: 100%;
  background: #1a1c1f;
  color: #e8eaed;
  font: 13px/1.45 ui-sans-serif, system-ui, sans-serif;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
canvas.drag { cursor: grabbing; }
canvas.mesure { cursor: crosshair; }
canvas.doom { cursor: crosshair; }
canvas.doom.lock { cursor: none; }
#bbox-cotes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
#bbox-cotes[hidden] { display: none; }
.cote {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(18, 20, 24, 0.85);
  color: #9ee0ff;
  border: 1px solid #3d6a80;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.cote.mesure-cote {
  color: #ffe08a;
  border-color: #8a7020;
}
#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 268px;
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 12px 14px;
  background: rgba(18, 20, 24, 0.92);
  border: 1px solid #2e333c;
  border-radius: 8px;
  z-index: 3;
}
h1 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #8ec8ff;
}
h2 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b909a;
}
#bloc-corpus h2:not(:first-of-type),
#bloc-metier h2:not(:first-of-type) { margin-top: 12px; }
#statut { margin: 0; color: #b4b8c0; }
#fiche, #stats {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 4px 10px;
}
#stats { margin: 0; }
#fiche dt, #stats dt { color: #8b909a; }
#fiche dd, #stats dd { margin: 0; word-break: break-all; }
.gid {
  all: unset;
  cursor: pointer;
  color: #c5e4ff;
  border-bottom: 1px dotted #5a7a94;
}
.gid:hover { color: #fff; }
.bloc { margin-top: 12px; padding-top: 10px; border-top: 1px solid #2e333c; }
.checks { display: flex; flex-direction: column; gap: 3px; max-height: 9.5em; overflow: auto; }
.chk { display: flex; gap: 6px; align-items: center; color: #d0d4dc; }
.chk input { margin: 0; }
.rangs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
button {
  background: #2a3038;
  color: #e8eaed;
  border: 1px solid #3c4450;
  border-radius: 4px;
  padding: 2px 8px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: #36404c; }
button.on { background: #3d5a73; border-color: #6a90b0; }
input[type="range"] { width: 100%; }
input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
  background: #12141a;
  color: #e8eaed;
  border: 1px solid #3c4450;
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
}
#rech-res, #lst-pieces, #lst-portes { max-height: 8em; }
#rech-res button,
#lst-pieces button,
#lst-portes button {
  display: block;
  width: 100%;
  text-align: left;
  overflow: visible;
}
#rech-res button > span,
#lst-pieces button > span,
#lst-portes button > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barre {
  height: 6px;
  margin-top: 8px;
  background: #2a3038;
  border-radius: 3px;
  overflow: hidden;
}
.barre > span {
  display: block;
  height: 100%;
  width: 0;
  background: #8ec8ff;
}
.barre.indef > span {
  width: 35%;
  animation: barre-slide 1.1s ease-in-out infinite;
}
@keyframes barre-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
#ifc-liste,
#ifc-prets {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 4px;
  background: #12141a;
  color: #e8eaed;
  border: 1px solid #3c4450;
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
  max-width: 100%;
}
#plan-cadre {
  margin-top: 6px;
  background: #f4f6f8;
  border: 1px solid #2e333c;
  border-radius: 4px;
  min-height: 80px;
  max-height: 240px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#plan-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  cursor: zoom-in;
}
#plan-img[hidden] { display: none; }
#plan-cadre .hint { padding: 8px; color: #5a616c; }
#plan-plein {
  position: absolute;
  inset: 0;
  z-index: 10;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 16px 16px;
  background: rgba(12, 14, 18, 0.88);
}
#plan-plein[hidden] { display: none; }
#plan-plein-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}
#plan-plein-fermer {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}
#plan-plein > .hint {
  margin-top: 8px;
  color: #b4b8c0;
}
body.plan-plein canvas,
body.plan-plein #hud {
  pointer-events: none;
}
#travail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 18, 0.62);
  pointer-events: none;
  z-index: 2;
  gap: 10px;
}
#travail[hidden] { display: none; }
#travail-txt {
  margin: 0;
  color: #e8eaed;
  max-width: 70%;
  text-align: center;
}
.spin {
  width: 36px;
  height: 36px;
  border: 3px solid #2e333c;
  border-top-color: #8ec8ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.occupe canvas { cursor: wait; }
.hint { color: #8b909a; font-size: 11px; margin-top: 2px; }
#lst-skip { white-space: pre-wrap; }
.aide {
  margin: 12px 0 0;
  color: #6e7480;
  font-size: 11px;
}
