/* Edge dimensions (package d): the measured-drawing callouts that float over the 3D barn.
 * Read as a draughtsman's dimension tag — a glass chip with a leader tick pointing at the grade
 * line, the number in Montserrat, the part name underneath in Inter. Positioned by edge-dims.js
 * with an inline transform on drawn frames only, so nothing here may animate transform. */

.dim-label {
  position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px 7px; max-width: min(260px, 74vw);
  border: 1px solid #ffffffee; border-radius: 12px;
  background: linear-gradient(#fbfdff 0%, #eff6fc 100%);
  box-shadow: 0 10px 26px #0b273c24, 0 2px 5px #0b273c14, inset 0 1px 0 #fff;
  color: #173950; font: 11px/1.3 Inter, Arial, sans-serif; text-align: center;
  animation: dim-in .13s ease-out both;
}
.dim-label[hidden] { display: none !important; }
/* Leader tick: a hairline stem down to the highlighted line. */
.dim-label::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 1px; height: 7px;
  background: linear-gradient(#3d6bb4cc, #3d6bb400); transform: translateX(-50%);
}
.dim-value { font: 700 15px/1.1 Montserrat, Inter, Arial, sans-serif; letter-spacing: -.02em; color: #1e3a5f; }
.dim-caption { font-size: 9.5px; letter-spacing: .035em; line-height: 1.35; color: #56708a; overflow-wrap: anywhere; }
.dim-cta { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #3d6bb4; margin-top: 1px; }
.dim-cta[hidden] { display: none; }

/* Depth: one z-plane per role, so the chip a visitor is reading paints last however the chips were
 * appended. edge-dims.js keeps the same order and steps the quieter chips physically aside; this is
 * the backstop for the frame where a dodge has nowhere left to go. */
.dim-label[data-role="aux"] { z-index: 1; }
.dim-label[data-role="hover"] { z-index: 2; }
.dim-label[data-role="selected"] { z-index: 3; }

/* Selected: brand-blue frame and a soft halo, so it reads as the live target. */
.dim-label[data-role="selected"] {
  border-color: #3d6bb4; box-shadow: 0 12px 30px #1e3a5f2e, 0 0 0 3px #3d6bb41f, inset 0 1px 0 #fff;
}
.dim-label[data-role="selected"] .dim-value { color: #16304f; }
/* Companion labels (a selected eave's length, and width + length while the phone Dimensions
 * group is open) sit back: smaller, quieter, never competing with the live target. */
.dim-label[data-role="aux"] {
  padding: 4px 9px 5px; background: #f4f9fdea; border-color: #ffffffcc; box-shadow: 0 6px 16px #0b273c1c;
}
.dim-label[data-role="aux"] .dim-value { font-size: 12px; color: #2c507f; }
.dim-label[data-role="aux"] .dim-caption { font-size: 9px; color: #6b829a; }
.dim-label[data-role="aux"]::after { background: linear-gradient(#2c507f99, #2c507f00); }

@media (pointer: coarse), (max-width: 650px) {
  .dim-label { padding: 7px 13px 8px; font-size: 11.5px; }
  .dim-value { font-size: 16px; }
  .dim-caption { font-size: 10px; }
}

/* Announced to screen readers when an edge is selected; never seen. */
.dim-live { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes dim-in { from { opacity: 0 } to { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .dim-label { animation: none } }
