.tiptap :first-child {
  margin-top: 0;
}

.tiptap img {
  display: block;
}

.tiptap [data-resize-handle] {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  z-index: 10;
}

.tiptap [data-resize-handle]:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Corner handles - always visible */
.tiptap [data-resize-handle='top-left'],
.tiptap [data-resize-handle='top-right'],
.tiptap [data-resize-handle='bottom-left'],
.tiptap [data-resize-handle='bottom-right'] {
  width: 8px;
  height: 8px;
}

.tiptap [data-resize-handle='top-left'] {
  top: -4px;
  left: -4px;
  cursor: nwse-resize;
}

.tiptap [data-resize-handle='top-right'] {
  top: -4px;
  right: -4px;
  cursor: nesw-resize;
}

.tiptap [data-resize-handle='bottom-left'] {
  bottom: 10px !important;
  left: -4px;
  cursor: nesw-resize;
}

.tiptap [data-resize-handle='bottom-right'] {
  bottom: 10px !important;
  right: -4px;
  cursor: nwse-resize;
}

/* Edge handles - hidden by default */
.tiptap [data-resize-handle='top'],
.tiptap [data-resize-handle='bottom'] {
  height: 6px;
  left: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.tiptap [data-resize-handle='left'],
.tiptap [data-resize-handle='right'] {
  width: 6px;
  top: 8px;
  bottom: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Show edge handles on wrapper hover */
.tiptap [data-resize-wrapper]:hover [data-resize-handle='top'],
.tiptap [data-resize-wrapper]:hover [data-resize-handle='bottom'],
.tiptap [data-resize-wrapper]:hover [data-resize-handle='left'],
.tiptap [data-resize-wrapper]:hover [data-resize-handle='right'] {
  opacity: 1;
}

.tiptap [data-resize-handle='top'] {
  top: -3px;
  cursor: ns-resize;
}

.tiptap [data-resize-handle='bottom'] {
  bottom: -3px;
  cursor: ns-resize;
}

.tiptap [data-resize-handle='left'] {
  left: -3px;
  cursor: ew-resize;
}

.tiptap [data-resize-handle='right'] {
  right: -3px;
  cursor: ew-resize;
}

.tiptap [data-resize-state='true'] [data-resize-wrapper] {
  outline: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 0.125rem;
}
