@value selectionWidth: 1px;
@value selectionPadding: -6px;
@value selectionPadding2: -0.5em;

.main {
  position: relative;
}

.main:before,
.main:after {
  content: '';
  position: absolute;
  top: selectionPadding2;
  left: selectionPadding2;
  right: selectionPadding2;
  bottom: selectionPadding2;
  pointer-events: none;
  opacity: 0.8
}

.draggable:not(.full):before {
  top: 5px;
}

.full:before,
.full:after {
  left: 0;
  right: 0;
}

.inset:before {
  top: 5px;
  left: 4px;
  bottom: 5px;
  right: 4px;
  z-index: 4;
}

.selected:before {
  border-left: solid 1px currentColor;
}

.inset.selected:before {
  border: solid 1px currentColor;
}

.selected:after {
  border-right: solid 1px currentColor;
}

.toolbar {
  position: absolute;
  top: -40px;
  right: -15px;
  z-index: 2;
  pointer-events: auto;
}

.insert {
  display: none;
  text-align: center;
  position: absolute;
  width: 100%;
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
}

.insertHovered.insert {
  opacity: 1;
}

.start .insert-before,
.end .insert-after {
  display: block;
}

.insert::before,
.insert::after {
  content: '';
  position: absolute;
  top: 0;
  width: calc(50% - 5px);
  height: 0;
  border-bottom: solid 1px currentColor;
}

.insert::before {
  left: selectionPadding2;
}

.insert::after {
  right: selectionPadding2;
}

.draggable:not(.full) .insert-before::before {
  left: 5px;
  width: calc(50% - 10px - 0.5em);
}

.full .insert::before,
.full .insert::after {
  width: calc(50% - 5px + selectionPadding2);
}

.full .insert::before {
  left: 0;
}

.full .insert::after {
  right: 0;
}

.insertButton {
  pointer-events: auto;
  border: 0;
  background: none;
  color: currentColor;
  display: inline-block;
  vertical-align: top;
  position: relative;
  top: -9px;
  padding: 2px 10px;
}

.insert-before,
.insert-after {
  composes: insert;
}

.insert-before {
  top: -0.5em;
}

.insert-after {
  top: calc(100% + 0.5em);
}

.dragHandle {
  position: absolute;
  top: -7px;
  left: 10px;
  transform: translate(-100%, -50%);
  z-index: 1;
  visibility: hidden;
  padding: 10px;
  cursor: move;
  pointer-events: auto;
}

.selected .dragHandle {
  visibility: visible;
}

.full .dragHandle {
  left: 0;
  top: 0;
  transform: translate(0, 0);
  background: radial-gradient(#000000b8, transparent 50%)
}

.dragHandle svg {
  display: block;
  color: currentColor;
  width: 15px;
  height: 15px;
  opacity: 0.8;
}

.dragHandle:hover svg {
  opacity: 1;
}

.full .dragHandle svg {
  color: #fff;
}

.inset .dragHandle,
.inset .insert,
.inset:after {
  display: none;
}
