@import url('/tools/zt/eng/sign/pad.css');
#tool > .zt-do { margin-bottom: 6px; }
.sp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem;
}
.sp-layout > * {
  min-width: 0;
}
.sp-mat {
  padding: 0.7rem;
  background: #dadad2;
}
.sp-pager {
  justify-content: center;
  align-items: center;
}
.sp-pager input,
#selection input,
#font-size {
  width: 6rem;
}
.sp-pager .zt-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#sheet {
  margin: auto;
  position: relative;
  max-width: 100%;
  background: white;
  isolation: isolate;
  overflow: hidden;
}
#backdrop canvas {
  width: 100%;
  height: auto;
  display: block;
}
#placements {
  position: absolute;
  inset: 0;
}
.sp-mark {
  position: absolute;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
  touch-action: none;
  cursor: move;
  transform-origin: center;
  user-select: none;
}
.sp-mark:focus-visible,
.sp-mark.is-selected {
  outline: 2px solid #305db3;
  outline-offset: 0;
}
.sp-mark canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.sp-grip {
  position: absolute;
  width: 20px;
  height: 20px;
  touch-action: none;
  cursor: nwse-resize;
}
.sp-grip::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: white;
  border: 2px solid #305db3;
}
.sp-grip[data-corner*='n'] {
  top: -10px;
}
.sp-grip[data-corner*='s'] {
  bottom: -10px;
}
.sp-grip[data-corner*='w'] {
  left: -10px;
}
.sp-grip[data-corner*='e'] {
  right: -10px;
}
#selection,
#composer {
  border-top: 1px solid var(--ws-line);
  padding-top: 0.6rem;
  margin-top: 0.8rem;
}
.sp-layout h3 {
  margin: 0.5rem 0;
}
#edit-controls > .zt-field {
  margin: 0.6rem 0;
}
.sp-pager .zt-button {
  padding: 0.4rem 0.6rem;
}
@media (max-width: 800px) {
  .sp-layout {
    grid-template-columns: 1fr;
  }
  .sp-pager {
    gap: 0.4rem;
  }
  .sp-pager input {
    width: 4rem;
  }
  .sp-mat {
    padding: 0.4rem;
  }
}
@media (max-width: 620px) {
  .sp-first-signature .sp-add-action,
  .sp-place-action {
    position: fixed;
    z-index: 12;
    inset: auto 0 0;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--ws);
    border-top: 1px solid var(--ws-line-strong);
  }
  .sp-place-action { flex-wrap: nowrap; }
  .sp-place-action #place { width: auto; flex: 1; }
  #tool:has(.sp-first-signature, #workbench:not([hidden]) #composer:not([hidden])) {
    padding-bottom: 76px;
  }
}
