.lab-diagram {
  --ld-ink: #20382b;
  --ld-muted-text: #58665a;
  --ld-idle: #bdc7bb;
  --ld-dark: #28573f;
  --ld-bright: #b9e779;
  --ld-done: #8fb79b;
  --ld-guide: #d7dfd4;
  --ld-paper: #f9fbf7;
  --ld-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  height: 300px;
  min-width: 0;
  color: var(--ld-ink);
  background-color: var(--ld-paper);
  background-image: radial-gradient(circle, #cdd7cbbd 0.72px, transparent 0.92px);
  background-size: 16px 16px;
  overflow: hidden;
}
.lab-diagram *, .lab-diagram *::before, .lab-diagram *::after { box-sizing: border-box; }
.ld-bars {
  position: absolute;
  inset: 35px clamp(18px, 6%, 65px) 47px;
}
.ld-scale {
  position: absolute;
  inset: 0;
}
.ld-base {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #96a891;
}
.ld-slot {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--ld-slot-width);
  left: var(--ld-left);
  transition: left 260ms cubic-bezier(.25,.72,.28,1);
}
.ld-bar {
  position: absolute;
  width: 63%;
  max-width: 62px;
  min-height: 3px;
  left: 50%;
  bottom: var(--ld-bottom);
  height: var(--ld-height);
  transform: translateX(-50%);
  border-radius: 5px 5px 0 0;
  background: var(--ld-idle);
  transition: background 160ms ease, height 230ms ease, bottom 230ms ease;
}
.ld-bar.is-negative { border-radius: 0 0 5px 5px; }
.ld-bar.is-focus, .ld-svg .is-focus { fill: var(--ld-dark); background: var(--ld-dark); }
.ld-bar.is-peer, .ld-svg .is-peer { fill: var(--ld-bright); background: var(--ld-bright); }
.ld-bar.is-done, .ld-svg .is-done { fill: var(--ld-done); background: var(--ld-done); }
.ld-svg .is-idle { fill: #e6ece2; }
.ld-svg .is-focus + .ld-number { fill: #fff; }
.ld-number-tag {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 600 15px/1 var(--ld-mono);
  color: var(--ld-ink);
}
.ld-bar.is-negative .ld-number-tag { bottom: auto; top: calc(100% + 4px); }
.ld-index-row {
  position: absolute;
  top: calc(100% + 11px);
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--ld-count), minmax(0, 1fr));
  text-align: center;
  color: var(--ld-muted-text);
  font: 12px/1.05 var(--ld-mono);
}
.ld-index { min-width: 0; display: flex; align-items: center; flex-direction: column; gap: 5px; }
.ld-pointer {
  min-width: 0;
  max-width: 100%;
  color: var(--ld-dark);
  font: 600 12px/1.05 var(--ld-mono);
  overflow-wrap: anywhere;
}
.ld-pointer-summary { display: none; }
.ld-bars.ld-negatives { bottom: 60px; }
.ld-negatives .ld-index-row { top: calc(100% + 25px); }
@container (max-width: 400px) {
  .ld-pointer { display: none; }
  .ld-pointer-summary {
    display: flex;
    position: absolute;
    top: calc(100% + 30px);
    left: 0;
    right: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--ld-dark);
    font: 600 11px/1.2 var(--ld-mono);
  }
  .ld-negatives .ld-pointer-summary { top: calc(100% + 43px); }
}
.ld-svg { display: block; width: 100%; height: 100%; }
.ld-svg text {
  font-family: var(--ld-mono);
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--ld-ink);
}
.ld-svg .ld-number { font-weight: 600; }
.ld-svg .ld-edge { fill: none; stroke: #788e79; stroke-width: 1.5; }
.ld-svg .ld-pointer-label { font-size: 12px; font-weight: 600; fill: var(--ld-dark); }
.ld-svg .ld-small-label { font-size: 12px; fill: var(--ld-muted-text); }
.ld-svg .ld-node { stroke: #adbcaa; stroke-width: 1; }
.ld-svg .ld-node.is-focus { stroke: var(--ld-dark); }
.ld-svg .ld-node.is-peer { stroke: #98b96d; }
.ld-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ld-muted-text);
  font-size: 15px;
}
@media (max-width: 640px) {
  .lab-diagram { height: 245px; }
  .ld-bars { inset: 30px 12px 47px; }
  .ld-number-tag { font-size: 13px; }
  .ld-bar { width: 68%; }
  .ld-index-row { font-size: 11px; }
  .ld-pointer { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-slot, .ld-bar { transition: none; }
}
