/* The diagram lives inside the existing report; the report keeps its own tilt. */
.inspection-diagram-v2 {
  margin: 16px 0 0;
  max-width: 100%;
  color: var(--ink, #111110);
}

.inspection-diagram-v2__stage {
  position: relative;
  height: 110px;
}

.inspection-diagram-v2__artboard {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  width: min(100%, 400px);
  aspect-ratio: 520 / 144;
  margin-inline: auto;
  transform: translateY(-50%);
}

.inspection-diagram-v2__car {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.inspection-diagram-v2__car path,
.inspection-diagram-v2__car circle {
  vector-effect: non-scaling-stroke;
}

.inspection-diagram-v2__body {
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspection-diagram-v2__glass {
  fill: #efefea;
  stroke-width: 0.9;
}

.inspection-diagram-v2__detail {
  stroke: #777771;
  stroke-width: 0.75;
}

.inspection-diagram-v2__ground {
  stroke: #d9d9d3;
  stroke-width: 0.75;
}

.inspection-diagram-v2__leader {
  stroke: #a5a59e;
  stroke-width: 0.8;
}

.inspection-diagram-v2__trace {
  stroke: var(--red, #d71920);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  opacity: 0;
}

.inspection-diagram-v2__trace[data-active="true"] {
  opacity: 1;
}

.inspection-diagram-v2__pin {
  --pin-nudge: 0px;
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--red, #d71920);
  cursor: pointer;
  touch-action: manipulation;
  transform: translate(-50%, calc(-50% + var(--pin-nudge)));
  -webkit-tap-highlight-color: transparent;
}

/* The front pins retain separate hit areas even in a narrow two-column report. */
.inspection-diagram-v2__pin[data-diagram-pin="now"] {
  --pin-nudge: 6px;
}

.inspection-diagram-v2__pin[data-diagram-pin="next"] {
  --pin-nudge: -6px;
}

.inspection-diagram-v2__number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #fcfcfa;
  color: var(--red, #d71920);
  font: 700 10px/1 var(--sans, Arial, sans-serif);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px #fcfcfa;
  transition: background-color 160ms ease, color 160ms ease;
}

.inspection-diagram-v2__pin[aria-pressed="true"] .inspection-diagram-v2__number {
  border-color: var(--red, #d71920);
  background: var(--red, #d71920);
  color: #fff;
  box-shadow: 0 0 0 3px #fcfcfa, 0 0 0 4px #d7192033;
}

.inspection-diagram-v2__pin:focus-visible {
  outline: none;
}

.inspection-diagram-v2__pin:focus-visible .inspection-diagram-v2__number {
  outline: 2px solid var(--red, #d71920);
  outline-offset: 5px;
}

.inspection-diagram-v2__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
  color: var(--muted, #686865);
  font: 400 10px/1.4 var(--sans, Arial, sans-serif);
  letter-spacing: 0.005em;
}

.inspection-diagram-v2__caption > span {
  min-width: 0;
}

.inspection-diagram-v2__stamp {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--red, #d71920);
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspection-diagram-v2__stamp-frame {
  opacity: 0.45;
}

.inspection-diagram-v2__stamp-check {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.inspection-diagram-v2[data-active-report=""] .inspection-diagram-v2__stamp {
  visibility: hidden;
}

.inspection-diagram-v2 + .report-tabs {
  margin-top: 12px;
}

@media (hover: hover) and (pointer: fine) {
  .inspection-diagram-v2__pin:hover .inspection-diagram-v2__number {
    border-color: var(--red, #d71920);
    background: var(--red, #d71920);
    color: #fff;
  }
}

@media (max-width: 580px) {
  .inspection-diagram-v2 {
    margin-top: 13px;
  }

  .inspection-diagram-v2__stage {
    height: 88px;
  }

  .inspection-diagram-v2__artboard {
    width: min(100%, 318px);
  }

  .inspection-diagram-v2__caption {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inspection-diagram-v2__number {
    transition: none;
  }

  .inspection-diagram-v2__trace,
  .inspection-diagram-v2__stamp-check {
    stroke-dashoffset: 0 !important;
  }
}
