/* workspace.css - tool column, drawing stage, action column */

.app {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 104px 1fr 92px;
  grid-template-rows: 1fr 128px;
  grid-template-areas: "left stage right" "left bottom right"
}

/* left tools */
.left {
  grid-area: left;
  background: var(--lime-soft);
  border-right: 3px solid var(--ink);
  padding: 14px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--lime-deep) transparent
}

#tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .08s
}
#tip.show { opacity: 1 }

.group {
  display: grid;
  grid-template-columns: repeat(2, 40px);
  gap: 10px;
  justify-content: center
}

.rule {
  height: 0;
  border-top: 2px dashed var(--lime-deep);
  margin: 14px 14px
}

.tool {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--cream);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 2px 0 var(--ink);
  position: relative
}

.tool svg {
  width: 22px;
  height: 22px;
  fill: var(--ink);
  stroke: var(--ink)
}

.tool.shape svg {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round
}

.tool:hover {
  background: #f1f9d6
}

.tool:active {
  transform: translateY(2px);
  box-shadow: none
}

.tool.on {
  background: var(--lime);
  box-shadow: 0 2px 0 var(--ink), 0 0 0 3px var(--lime-soft), 0 0 0 5px var(--ink)
}

/* stage */
.stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  background: var(--stage)
}

.scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  scrollbar-width: auto;
  scrollbar-color: var(--lime-deep) var(--lime-soft)
}

.scroll::-webkit-scrollbar {
  width: 14px;
  height: 14px
}

.scroll::-webkit-scrollbar-track {
  background: var(--lime-soft)
}

.scroll::-webkit-scrollbar-thumb {
  background: var(--lime-deep);
  border: 3px solid var(--lime-soft);
  border-radius: 99px
}

.scroll::-webkit-scrollbar-thumb:hover {
  background: var(--brand-dk)
}

.scroll::-webkit-scrollbar-corner {
  background: var(--lime-soft)
}

.scroll {
  display: flex
}

.sizer {
  position: relative;
  flex: none;
  margin: auto
}

.board {
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25)
}

.page-h {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--ink);
  box-sizing: border-box;
  touch-action: none;
  z-index: 3;
  opacity: 0;
  transition: opacity .12s
}

.page-h.near,
.page-h.drag {
  opacity: 1
}

.page-h:hover {
  background: var(--lime)
}

.ph-e,
.ph-w {
  cursor: ew-resize
}

.ph-n,
.ph-s {
  cursor: ns-resize
}

.ph-nw,
.ph-se {
  cursor: nwse-resize
}

.ph-ne,
.ph-sw {
  cursor: nesw-resize
}

.board {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  background: #fff
}

.board canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  border-radius: 3px
}

.coords {
  position: absolute;
  left: 14px;
  bottom: 10px;
  background: var(--ink);
  color: var(--lime);
  font-size: 13px;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 99px
}

/* right actions */
.right {
  grid-area: right;
  background: var(--lime-soft);
  border-left: 3px solid var(--ink);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px
}

.right .rule {
  width: 44px;
  margin: 4px 0
}

.act {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--cream);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 0;
  position: relative
}

.act svg {
  width: 28px;
  height: 28px;
  fill: var(--ink)
}

.act:hover {
  background: #f1f9d6
}

.act:active {
  transform: translateY(3px);
  box-shadow: none
}

.act.danger:hover {
  background: #ffd9cf
}

.text-wrap {
  position: absolute;
  z-index: 5;
  padding: 6px;
  outline: 1px dashed var(--ink);
  cursor: move;
  box-sizing: content-box
}

.text-box {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  caret-color: var(--ink);
  cursor: text
}

.text-guide {
  position: absolute;
  outline: 1px dashed var(--ink);
  pointer-events: none;
  z-index: 4
}

.text-h {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-sizing: border-box;
  touch-action: none
}

.text-h.h-nw {
  left: -11px;
  top: -11px;
  cursor: nwse-resize
}

.text-h.h-n {
  left: calc(50% - 6px);
  top: -11px;
  cursor: ns-resize
}

.text-h.h-ne {
  right: -11px;
  top: -11px;
  cursor: nesw-resize
}

.text-h.h-e {
  right: -11px;
  top: calc(50% - 6px);
  cursor: ew-resize
}

.text-h.h-se {
  right: -11px;
  bottom: -11px;
  cursor: nwse-resize
}

.text-h.h-s {
  left: calc(50% - 6px);
  bottom: -11px;
  cursor: ns-resize
}

.text-h.h-sw {
  left: -11px;
  bottom: -11px;
  cursor: nesw-resize
}

.text-h.h-w {
  left: -11px;
  top: calc(50% - 6px);
  cursor: ew-resize
}

.text-h:hover {
  background: var(--lime)
}

/* editable shapes */
.board canvas.shape-ov {
  pointer-events: none;
  cursor: default
}

.shape-sel {
  position: absolute;
  border: 1px dashed var(--ink);
  box-sizing: border-box;
  cursor: move;
  z-index: 5;
  touch-action: none
}

.shape-rot {
  position: absolute;
  left: calc(50% - 6px);
  top: -32px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  border: 2px solid var(--ink);
  box-sizing: border-box;
  cursor: grab;
  touch-action: none
}

.shape-rot::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 2px;
  height: 20px;
  background: var(--ink);
  pointer-events: none
}


/* selection */
.shape-sel.sel-ants {
  outline: 1px dashed #fff;
  outline-offset: -1px
}

.shape-sel canvas.sel-pv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  cursor: move;
  border-radius: 0
}