* {
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-size: 100%;
  line-height: 1.2em;
  letter-spacing: 0;
}

.calculate-letter-size {
  font-family: monospace;
  height: auto;
  width: auto;
  top: -10000px;
  left: -10000px;
  visibility: hidden;
  position: fixed;
  overflow: visible;
  white-space: nowrap;
  line-height: 1.2em;
  letter-spacing: 0;
}

.canvas--content--item {
  font-size: 1em;
  line-height: 1.2em;
}

.project.is-hover,
.project.is-hover .canvas--content--item {
  cursor: pointer;
}

.project.is-able-to-move,
.project.is-able-to-move .canvas--content--item {
  cursor: move;
}

.project.is-text,
.project.is-text .canvas--content--item {
  cursor: text;
}

.project {
  margin-top: -1px;
  border: solid #eee;
  border-width: 1px 0 1px 1px;
  overflow: auto;
  position: absolute;
  top: 3em;
  left: 5em;
  right: 0;
  bottom: 2em;
}

body,
.canvas,
.selection,
.selection--dot {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}

.current-selection {
  position: absolute;
  pointer-events: none;
  border: 1px solid gray;
}

.canvas {
  overflow: hidden;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 1px solid #eee;
}

.canvas--content {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.canvas--content--item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

.canvas--content--item.is-hover {
  color: red;
}

.canvas--content--item.is-selected {
  color: blue;
}

.canvas--content--item--z-index {
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(252, 250, 247, 0.9);
  width: 1.5em;
  height: 1.5em;
  color: green;
  border: 1px solid rgba(248, 242, 228, 0.5);
  margin-left: -0.75em;
  margin-top: -0.75em;
  text-align: center;
  line-height: 1.5em;
}

.selection {
  position: absolute;
  pointer-events: none;
  border: 1px solid gray;
}

.selection--dot {
  position: absolute;
  background: white;
  width: 5px;
  height: 5px;
  border: 1px solid gray;
  margin-left: -3px;
  margin-top: -3px;
  pointer-events: auto;
}

.selection--dot__nw,
.selection.is-flipped-x.is-flipped-y .selection--dot.selection--dot__se,
.selection.is-flipped-x .selection--dot__ne,
.selection.is-flipped-y .selection--dot__sw {
  top: 0;
  left: 0;
  margin-left: -4px;
  margin-top: -4px;
  cursor: nwse-resize;
}

.selection--dot__n,
.selection.is-flipped-y .selection--dot__s {
  top: 0;
  left: 50%;
  margin-left: -4px;
  margin-top: -4px;
  cursor: ns-resize;
}

.selection--dot__ne,
.selection.is-flipped-x.is-flipped-y .selection--dot.selection--dot__sw,
.selection.is-flipped-x .selection--dot__nw,
.selection.is-flipped-y .selection--dot__se {
  top: 0;
  left: 100%;
  margin-top: -4px;
  cursor: nesw-resize;
}

.selection--dot__w,
.selection.is-flipped-x .selection--dot__e {
  top: 50%;
  left: 0;
  margin-left: -4px;
  margin-top: -4px;
  cursor: ew-resize;
}

.selection--dot__e,
.selection.is-flipped-x .selection--dot__w {
  top: 50%;
  left: 100%;
  cursor: ew-resize;
}

.selection--dot__sw,
.selection.is-flipped-x.is-flipped-y .selection--dot.selection--dot__ne,
.selection.is-flipped-x .selection--dot__se,
.selection.is-flipped-y .selection--dot__nw {
  top: 100%;
  left: 0;
  cursor: nesw-resize;
}

.selection--dot__s,
.selection.is-flipped-y .selection--dot__n {
  top: 100%;
  left: 50%;
  cursor: ns-resize;
}

.selection--dot__se,
.selection.is-flipped-x.is-flipped-y .selection--dot.selection--dot__nw,
.selection.is-flipped-x .selection--dot__sw,
.selection.is-flipped-y .selection--dot__ne {
  top: 100%;
  left: 100%;
  cursor: nwse-resize;
}

.selection__text .selection--dot {
  display: none;
}

.selection__line,
.selection__rect-line {
  border: none;
}

.selection__line .selection--dot,
.selection__rect-line .selection--dot {
  display: none;
}

.selection__line .selection--dot__nw,
.selection__line .selection--dot__se,
.selection__rect-line .selection--dot__nw,
.selection__rect-line .selection--dot__se {
  display: block;
  cursor: pointer !important;
}

.selection__line .selection--dot,
.selection__rect-line .selection--dot {
  width: 10px;
  height: 10px;
  border: 1px solid gray;
  margin-left: -6px;
  margin-top: -6px;
  pointer-events: auto;
  border-radius: 5px;
  background: gray;
  opacity: 0.7;
}

.selection__line .selection--dot__se,
.selection__rect-line .selection--dot__se {
  margin-top: -12px;
  margin-left: -10px;
}

.selection__line .selection--dot__nw,
.selection__rect-line .selection--dot__nw {
  margin-top: 2px;
  margin-left: -2px;
}

.selection__line.is-flipped-x .selection--dot__se,
.selection__rect-line.is-flipped-x .selection--dot__se {
  margin-left: -2px !important;
}

.selection__line.is-flipped-x .selection--dot__nw,
.selection__rect-line.is-flipped-x .selection--dot__nw {
  margin-left: -10px !important;
  margin-top: 2px !important;
}

.selection__line.is-flipped-y .selection--dot__se,
.selection__rect-line.is-flipped-y .selection--dot__se {
  margin-top: 3px !important;
}

.selection__line.is-flipped-y .selection--dot__nw,
.selection__rect-line.is-flipped-y .selection--dot__nw {
  margin-top: -13px !important;
}

.tool {
  position: fixed;
  right: 0;
  bottom: 0;
}

.text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.text--wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: left;
  box-sizing: border-box;
}

.text--wrapper--content {
  word-wrap: break-word;
  display: inline-block;
  max-width: 100%;
}

.text--wrapper--content--line {
  background: white;
  white-space: normal;
}

.canvas-content--item__text .text--wrapper {
  padding: 0 !important;
  width: auto;
  height: auto;
}

.canvas-content--item__text .text--wrapper--content {
  word-wrap: initial;
  text-align: left;
  margin-top: 0 !important;
}

.canvas-content--item__text .CodeMirror {
  text-align: left;
  padding-right: 1px;
  max-width: none !important;
}

.CodeMirror {
  height: auto;
  background: transparent;
  border: none;
  pointer-events: none;
  line-height: inherit;
  text-align: left;
}

.CodeMirror-code span {
  background: white;
}

.CodeMirror-scroll {
  overflow-y: hidden;
  height: auto;
}

div.CodeMirror-cursors {
  z-index: 3;
}

.sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5em;
  background: #f8f8f8;
  border-right: gray;
}

.sidebar--logo {
  font-family: Arial, sans-serif;
  padding: 0.5em;
  font-size: 1.3em;
  font-weight: bold;
  text-align: center;
}

.button {
  background: #e6e6e6;
  border: 1px solid gray;
  cursor: pointer;
  outline: none;
}

.button:hover {
  background: silver;
}

.button:active,
.button.is-selected:hover,
.button.is-selected {
  background: silver;
  box-shadow: 0 0 1em gray;
}

.button[disabled] {
  background: #e6e6e6;
  border: 1px solid gray;
  box-shadow: none;
  cursor: default;
  opacity: 0.6;
}

.button__text {
  width: auto;
  padding: 0 1em;
  text-transform: uppercase;
}

.button--icon {
  display: block;
  width: 100%;
  height: 100%;
  background-size: 70% 70%;
  background-position: center center;
  background-repeat: no-repeat;
}

.sidebar--tools--button {
  display: block;
  width: 4em;
  height: 4em;
  margin: 0.5em auto;
}

.sidebar--tools--button__select .sidebar--tools--button--icon {
  background-image: url(../images/select.png)
}

.sidebar--tools--button__line .sidebar--tools--button--icon {
  background-image: url(../images/line.png)
}

.sidebar--tools--button__rect-line .sidebar--tools--button--icon {
  background-image: url(../images/rect-line.png)
}

.sidebar--tools--button__rect .sidebar--tools--button--icon {
  background-image: url(../images/rect.png)
}

.sidebar--tools--button__undo .sidebar--tools--button--icon {
  background-image: url(../images/undo.png)
}

.sidebar--tools--button__redo .sidebar--tools--button--icon {
  background-image: url(../images/redo.png)
}

.sidebar--tools--button__text .sidebar--tools--button--icon {
  background-image: url(../images/text.png)
}

.sidebar--tools--button__result .sidebar--tools--button--icon {
  background-image: url(../images/result.png)
}

.sidebar--tools--button__delete .sidebar--tools--button--icon {
  background-image: url(../images/delete.png)
}

.result {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.result-enter {
  opacity: 0;
}

.result-enter-active {
  opacity: 1;
  transition: opacity 0.1s ease-in;
  -webkit-transition: opacity 0.1s ease-in;
  -moz-transition: opacity 0.1s ease-in;
}

.result-leave {
  opacity: 1;
}

.result-leave-active {
  transition: opacity 0.1s ease-in;
  -webkit-transition: opacity 0.1s ease-in;
  -moz-transition: opacity 0.1s ease-in;
  opacity: 0;
}

.result--overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1d2226;
  opacity: 0.9;
}

.result--popup {
  position: absolute;
  top: 50%;
  left: 50%;
  background: #f5f5f5;
  border-radius: 3px;
}

.result--content {
  margin: 2.5em 1.5em 1em;
  background: white;
  border: #eee;
}

.result--content--pre {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  -o-user-select: text;
  user-select: text;
  overflow: hidden;
  line-height: 1.2em;
}

.result--close-top {
  position: absolute;
  top: 1em;
  right: 1em;
  width: 2em;
  height: 2em;
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: transparent;
  background-image: url(../images/close.png);
  border: none;
  cursor: pointer;
  outline: none;
}

.result--bottom {
  text-align: center;
  padding-bottom: 1em;
}

.result--bottom--hint {
  font-size: 0.8em;
  padding: 0 1em 1em 1em;
}

.result--bottom--close {
  background: #e6e6e6;
  padding: 0.5em 1em;
  border: 1px solid gray;
  cursor: pointer;
  outline: none;
  font-size: 1.2em;
}

.outlets {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.outlets--point {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  margin-top: 2px;
  margin-left: -2px;
  border: 1px solid silver;
}

.topbar {
  position: absolute;
  left: 5em;
  top: 0;
  height: 3em;
  right: 0;
  background: #f8f8f8;
  z-index: 1;
}

.topbar--button {
  display: inline-block;
  height: 3em;
  margin: 0.5em;
  vertical-align: top;
}

.topbar--button__icon {
  width: 3em;
}

.topbar--button__z-inc .topbar--button--icon {
  background-image: url(../images/z-inc.png)
}
.topbar--button__z-dec .topbar--button--icon {
  background-image: url(../images/z-dec.png)
}
.topbar--button__grid .topbar--button--icon {
  background-image: url(../images/grid.png)
}


.grid {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}
.grid.is-visible {
  display: block;
}

.bottombar {
  position: absolute;
  left: 5em;
  bottom: 0;
  height: 2em;
  right: 0;
  background: #f8f8f8;
  line-height: 2em;
}

.bottombar a {
  color: #0074D9;
  text-decoration: none;
  margin: 0 0.5em;
}

.bottombar--left {
  float: left;
  font-size: 0.8em;
}

.bottombar--left--size {
  width: 4em;
  padding: 0.2em 0.4em;
  margin: 0 0.3em;
}

.bottombar--right {
  float: right;
  padding-right: 1em;
  font-size: 0.8em;
}

.bottombar a:hover {
  border-bottom: 1px solid #0074D9;
}
