.diagram-port {
  cursor: crosshair;
  transition: fill 80ms ease, stroke 80ms ease;
}

.diagram-port:hover {
  fill: #2266EE;
  stroke: #4488FF;
}

.diagram-endpoint {
  cursor: grab;
}

.diagram-endpoint:active {
  cursor: grabbing;
}

.diagram-bend-horizontal {
  cursor: ew-resize;
}

.diagram-bend-vertical {
  cursor: ns-resize;
}

.diagram-property {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.diagram-property-label {
  display: block;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 400;
  user-select: none;
}

.diagram-option-group {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border-radius: 8px;
  background: var(--background);
}

.diagram-option {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: var(--transparent);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.diagram-option:hover {
  background: var(--hover);
  color: var(--white);
}

.diagram-option.active {
  background: var(--selected);
  color: var(--brand);
}

.diagram-option svg {
  width: 100%;
  max-width: 48px;
  height: 24px;
}

.diagram-property-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--background);
  color: var(--text);
  font-size: 12px;
  transition: border-color 120ms ease;
}

.diagram-property-input:focus {
  border-color: var(--brand);
}

.diagram-property-input::placeholder {
  color: var(--muted);
}

.diagram-connector-input {
  position: absolute;
  z-index: 12;
  min-width: 120px;
  max-width: 80%;
  min-height: 32px;
  padding: 4px 8px;
  margin: 0;
  border: 2px solid #4488FF;
  border-radius: 4px;
  outline: none;
  background: var(--white);
  color: var(--black);
  font-family: Arial, sans-serif;
  text-align: center;
  transform: translate(-50%, -50%);
  user-select: text;
  cursor: text;
}

.diagram-connector-options {
  position: absolute;
  bottom: 88px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 6px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateX(-50%);
  animation: diagram-options-enter 160ms var(--transition-ease) both;
  user-select: none;
}

.diagram-connector-options .sketch-tool-button {
  width: 36px;
  height: 36px;
  padding: 6px;
}

.diagram-connector-options svg {
  width: 24px;
  height: 24px;
}

.vector-viewport[data-mode="diagram"] [data-connector-label] {
  cursor: text;
}

@keyframes diagram-options-enter {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .diagram-connector-options {
    animation: none;
  }
}