.qmv { position: relative; }
.qmv:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-md); }
.qmv-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--black-700);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.qmv-viewport.is-interactive { cursor: crosshair; }
.qmv-viewport.is-zoomed { touch-action: none; }
.qmv-viewport.is-zoomed:not(.is-interactive) { cursor: grab; }
.qmv-viewport.is-panning { cursor: grabbing; }
.qmv-stage { position: relative; transform-origin: 0 0; will-change: transform; --qmv-inv: 1; }
.qmv-stage img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.qmv-layer { position: absolute; inset: 0; pointer-events: none; }
.qmv-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #140A03;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%) scale(var(--qmv-inv));
}
.qmv-pin.is-other { background: var(--white-300); }
.qmv-pin.is-solution { background: var(--green-400); }
.qmv-pin-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(8, 8, 10, 0.88);
  color: var(--text-1);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}
.qmv-ring {
  position: absolute;
  width: calc(var(--r) * 2%);
  aspect-ratio: 1;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.qmv-ring.is-solution { border-color: var(--green-400); }
.qmv-tools { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.qmv-tool {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 14, 17, 0.86);
  color: var(--text-1);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.qmv-tool:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.qmv-tool:disabled { opacity: 0.4; cursor: default; }
.qmv-tool[data-qmv="reset"] { font-size: 0.6875rem; }
