.ed-shell {
  height: calc(100dvh - 60px);
  min-height: 330px;
  display: flex;
  flex-direction: column;
  background: #f5f5fa;
  overflow: hidden;
}
.ed-top,
.ed-sub {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 48px;
  background: #fff;
  border-bottom: 1px solid #d8d8df;
  overflow-x: auto;
  flex: none;
  z-index: 2;
}
.ed-top {
  box-shadow: 0 2px 5px #2222;
}
.ed-top button,
.ed-sub button {
  min-width: 42px;
  min-height: 44px;
  padding: 6px 10px;
  color: #64646e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.ed-top button:hover,
.ed-sub button:hover,
.ed-top button.on,
.ed-sub button.on {
  color: #df322b;
  background: #f4f4f8;
}
.ed-top button span,
.ed-sub button span {
  font-size: 12px;
}
.ed-switch {
  display: flex;
  margin: 0 16px;
  border: 1px solid #45454d;
  background: #45454d;
  border-radius: 20px;
  padding: 2px;
}
.ed-switch button {
  font-size: 13px;
  min-height: 21px;
  min-width: 70px;
  padding: 2px 12px;
  color: #fff;
  border-radius: 14px;
}
.ed-switch button.on {
  background: white;
  color: #333;
}
.ed-sub {
  padding: 0 8px;
  gap: 4px;
}
.ed-sub label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ed-sub select,
.ed-sub input[type='number'] {
  border: 1px solid #cfcfd5;
  border-radius: 3px;
  background: white;
  padding: 5px;
  font-size: 13px;
}
.ed-sub input[type='number'] {
  width: 52px;
}
.ed-sub input[type='color'] {
  width: 30px;
  height: 25px;
  padding: 1px;
  border: 1px solid #bbb;
}
.ed-main {
  display: grid;
  grid-template-columns: clamp(110px, 15vw, 190px) minmax(0, 1fr) clamp(250px, 24vw, 370px);
  min-height: 0;
  flex: 1;
}
.ed-library[hidden]{display:none}
.ed-library{grid-column:1;grid-row:1;overflow:auto;background:#fff;border-right:5px solid #dddde2;padding:16px;min-width:0}
.ed-library-open .ed-main{grid-template-columns:250px minmax(0,1fr) clamp(250px,24vw,370px)}
.ed-library-open .ed-thumbs{display:none}
.ed-library h2{font-size:15px;margin:0 0 16px}
.ed-library .ed-new-stamp{width:100%;padding:8px;border:1px solid #517b91;border-radius:3px;color:#517b91;margin-bottom:16px}
.ed-library summary{font-size:13px;font-weight:600;padding:16px 0;border-top:1px solid #ddd;cursor:pointer}
.ed-library details>button{display:flex;justify-content:center;align-items:center;width:100%;height:48px;margin-bottom:4px;padding:3px;border:1px solid #ccc;border-radius:3px}
.ed-library details>button:hover{border-color:#477dac;background:#eef5fa}
.ed-library details img{max-width:100%;max-height:40px;width:auto;object-fit:contain}
.ed-stamp-preview{display:block;max-width:100%;height:90px;object-fit:contain;margin-bottom:18px}
.ed-stamp-format{display:flex;gap:6px;flex-wrap:wrap}
.ed-stamp-format button{padding:6px;border:1px solid #ccc;border-radius:4px}
.ed-stamp-format [aria-pressed=true]{background:#dceaf7;border-color:#477dac}
.ed-dialog fieldset{border:0;padding:12px 0}
@media(max-width:760px){.ed-library-open .ed-main{grid-template-columns:minmax(0,1fr)}.ed-library{position:absolute;z-index:4;top:96px;bottom:0;left:0;width:250px;box-shadow:4px 0 10px #0002}}
.ed-shell.no-thumbs .ed-main {
  grid-template-columns: 0 minmax(0, 1fr) clamp(250px, 24vw, 370px);
}
.ed-thumbs {
  overflow: auto;
  border-right: 5px solid #dddde2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 6px;
}
.no-thumbs .ed-thumbs {
  visibility: hidden;
  padding: 0;
  border: 0;
}
.ed-thumbs button {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 12px;
}
.ed-thumbs button span {
  width: 80%;
  max-width: 98px;
  aspect-ratio: 0.707;
  display: grid;
  place-items: center;
  background: white;
  box-shadow: 0 2px 6px #0002;
}
.ed-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ed-thumbs .active span {
  outline: 2px solid #3696c6;
}
.ed-center {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.ed-scroll {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 12px 58px;
}
.ed-sheets {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  min-width: max-content;
  min-height: 90px;
}
.ed-sheets[aria-busy='true']:empty:before {
  content: attr(data-loading-label);
  margin: 40px auto;
  color: #666;
}
.ed-sheet {
  position: relative;
  flex: none;
  background: #fff;
  box-shadow: 0 1px 6px #0003;
  overflow: hidden;
  touch-action: none;
}
.ed-page-img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.ed-object,
.ed-text-hit,
.ed-field-hit,
.ed-search-hit {
  position: absolute;
}
.ed-object {
  cursor: move;
  touch-action: none;
}
.ed-object:hover,
.ed-object.selected {
  outline: 1px solid #3098cb;
}
.ed-obj-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.ed-obj-content img {
  width: 100%;
  height: 100%;
}
.ed-resize {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1px solid #3098cb;
  cursor: nwse-resize;
}
.ed-text-hit,
.ed-field-hit {
  padding: 0;
  background: transparent;
  border: 1px dashed #67a7c999;
}
.ed-text-hit:hover,
.ed-field-hit:hover {
  background: #65b8f02b;
}
.ed-search-hit {
  background: #f7dd5060;
  border: 1px solid #ccaf00;
  pointer-events: none;
}
.ed-form-preview {
  border: 1px solid #868692;
  background: #dbe8ff55;
  font: 12px Arial;
  color: #223;
}
.ed-mark.highlight {
  background: var(--ink);
}
.ed-mark.underline {
  border-bottom: 2px solid var(--ink);
}
.ed-mark.strike {
  background: linear-gradient(transparent 45%, var(--ink) 47% 54%, transparent 56%);
}
.ed-mark.squiggle {
  border-bottom: 2px wavy var(--ink);
}
.ed-live-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ed-side {
  background: white;
  border-left: 1px solid #d0d0d6;
  display: flex;
  min-height: 0;
  flex-direction: column;
}
.ed-side h1 {
  text-align: center;
  font-size: 22px;
  margin: 0;
  border-bottom: 1px solid #ddd;
  padding: 16px;
}
.ed-details {
  padding: 20px 16px;
  overflow: auto;
  flex: 1;
}
.ed-details h3 {
  font-size: 14px;
  border-bottom: 1px solid #ddd;
  padding: 10px 0;
}
.ed-details .info-box {
  border: 1px solid #1598c6;
  background: #e5f5fc;
  color: #243b48;
  padding: 13px;
  border-radius: 8px;
  font-size: 14px;
}
.ed-clear {
  display: block;
  color: #c52e29;
  text-decoration: underline;
  margin: 10px 0 0 auto;
  font-size: 14px;
}
.ed-layer {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f7f7fa;
  margin: 5px 0;
  padding: 4px;
}
.ed-layer.active {
  outline: 1px solid #b8bfd0;
}
.ed-layer button {
  padding: 3px;
}
.ed-layer button:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.ed-layer button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.ed-layer svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.ed-save-wrap {
  padding: 12px 16px 18px;
}
.ed-save {
  width: 100%;
  min-height: 60px;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.ed-save:disabled {
  opacity: 0.42;
}
.ed-side .pdf-message {
  margin: 6px 14px;
}
.ed-view {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: 98%;
  padding: 4px 6px;
  border-radius: 4px;
  color: white;
  background: #464650;
  box-shadow: 0 3px 10px #0002;
  font-size: 12px;
  overflow: auto;
}
.ed-view button {
  color: white;
  display: grid;
  place-items: center;
  padding: 4px;
}
.ed-view svg {
  width: 17px;
  height: 17px;
}
.ed-view input,
.ed-view select {
  background: #656570;
  color: white;
  border: 0;
  border-radius: 2px;
  padding: 4px;
  font-size: 12px;
}
.ed-view input {
  width: 42px;
  text-align: center;
}
.ed-view select {
  max-width: 88px;
}
.ed-dialog label {
  display: block;
  text-align: left;
  margin: 8px 0;
}
.ed-dialog textarea,
.ed-dialog input:not([type='checkbox']),
.ed-dialog select {
  display: block;
  width: 100%;
  font: inherit;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.ed-dialog textarea {
  height: 100px;
  resize: vertical;
}
.ed-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.ed-dialog-actions button {
  padding: 9px 16px;
}
.ed-form-error {
  color: #ae3025;
}
@media (max-width: 760px) {
  .ed-shell {
    height: calc(100dvh - 56px);
  }
  .ed-main,
  .ed-shell.no-thumbs .ed-main {
    grid-template-columns: 0 minmax(0, 1fr);
    grid-template-rows: minmax(150px, 1fr) auto;
  }
  .ed-thumbs {
    visibility: hidden;
    padding: 0;
    border: 0;
  }
  .ed-center {
    grid-column: 2;
  }
  .ed-side {
    grid-column: 1/-1;
    max-height: 32vh;
  }
  .ed-side h1 {
    display: none;
  }
  .ed-details {
    padding: 6px 12px;
  }
  .ed-save-wrap {
    padding: 5px 12px;
  }
  .ed-save {
    min-height: 42px;
    font-size: 18px;
  }
  .ed-top,
  .ed-sub {
    min-height: 40px;
  }
  .ed-switch {
    margin: 0 5px;
  }
  .ed-top button,
  .ed-sub button {
    min-height: 38px;
  }
  .ed-view {
    left: 0;
    transform: none;
    bottom: 4px;
  }
  .ed-view select {
    width: 52px;
  }
}

@media (max-width: 760px) {
  .ed-shell.mobile-thumbs .ed-thumbs {
    position: absolute;
    visibility: visible;
    z-index: 4;
    width: 112px;
    max-height: 55vh;
    padding: 8px;
    background: #fff;
    box-shadow: 0 3px 9px #0003;
  }
}

.ed-image-hit {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.ed-image-hit:hover,
.ed-image-hit:focus-visible {
  border-color: #3279cf;
  background: #4f93e51a;
}

.ed-comment {
  margin: 10px 0;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.ed-comment p {
  white-space: pre-wrap;
}
.ed-comment button,
.ed-outline {
  color: #365f90;
}
.ed-outline {
  display: block;
  text-align: left;
}
.ed-callout {
  background: #fffde8;
  border: 1px solid #bf3838;
  padding: 3px;
  font-size: 14px;
}

.ed-dialog [hidden] {
  display: none !important;
}
.ed-sign-tabs,
.ed-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ed-sign-tabs button,
.ed-field-row button {
  padding: 6px;
  background: #f1f1f6;
  border-radius: 4px;
}
.ed-field-row {
  margin: 5px 0;
}
.ed-field-row span {
  flex: 1;
}
.ed-dialog canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #aaa;
  touch-action: none;
}

.ed-thumbs [data-thumb] > span {
  position: relative;
  overflow: hidden;
}
.ed-thumb-art {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  transform-origin: center;
  background: #fff;
}
.ed-thumbs .ed-thumb-art .ed-page-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
.ed-thumbs .ed-thumb-art .ed-object {
  pointer-events: none;
}
.ed-image-hit {
  z-index: 1;
}
.ed-text-hit,
.ed-field-hit {
  z-index: 2;
}
.ed-search-hit {
  pointer-events: none;
}
