#clearanceGuides, #clearanceGuides > svg {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#clearanceGuides { z-index: 1; overflow: hidden; color: #ffd400; }
#clearanceGuides path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#clearanceGuides .clearance-halo { stroke: #000; stroke-width: 2.8; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 38%)); }
.clearance-label {
  position: absolute; width: max-content; transform: translate(-50%, -50%); display: flex; align-items: baseline;
  justify-content: center; gap: 3px; padding: 5px; box-sizing: border-box; line-height: 16px;
  background: var(--glass); border: 1px solid color-mix(in srgb, var(--green) 48%, white);
  border-radius: 8px; color: #000; text-shadow: 0 1px 2px rgb(0 0 0 / 26%); box-shadow: 0 1px 4px #18372120;
  pointer-events: auto; cursor: text; font-variant-numeric: tabular-nums;
}
#clearanceGuides .clearance-label input {
  width: calc(var(--digits, 4) * 1ch + 4px); flex: none; min-width: 0; height: auto; min-height: 0; margin: 0; padding: 0; background: transparent;
  color: inherit; border: 0; border-radius: 0; outline: none; box-shadow: none;
  font-family: inherit; font-size: 13px; line-height: 16px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: right; text-shadow: inherit;
}
.clearance-label span { min-width: 1.6em; flex: none; font-size: 10px; line-height: 1; }
.clearance-label:hover, .clearance-label:focus-within { background: var(--wash); border-color: var(--green); }
.clearance-label:focus-within { outline: 2px solid var(--green); outline-offset: 1px; }

.clearance-label > svg.icon { display: none; position: absolute; right: 6px; width: 12px; height: 12px; flex: none; align-self: center; }
@media (hover: hover) {
  .clearance-label:hover:not(:focus-within):has(input:read-write) > svg { display: block; }
  .clearance-label:hover:not(:focus-within):has(input:read-write) > span { visibility: hidden; }
}

/* In the room, dimensions read as lettering on the measured surface. */
.surface-guides .clearance-label {
  transform-origin: 0 0; border-color: transparent; border-radius: 3px;
  background: transparent; box-shadow: none;
}
#clearanceGuides.surface-guides .clearance-label input { font-size: 16px; line-height: 18px; }
.surface-guides .clearance-label span { font-size: 11px; }
.surface-guides .clearance-label:is(:hover,:focus-within) {
  background: var(--glass); border-color: var(--green);
}
