/* ===== Visual PDF editor (Toto.Editor) + form filler + signature dialog ===== */
.tool-app.ws-wide .workspace { grid-template-columns: minmax(0, 1fr) 300px; }
.ed { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.ed-bar { position: sticky; top: 72px; z-index: 6; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .4rem; box-shadow: var(--shadow-sm); }
.ed-modes, .ed-actions { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.ed-btn { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; color: var(--ink); font-weight: 650; font-size: .84rem;
  padding: .45rem .65rem; border-radius: 10px; line-height: 1; white-space: nowrap; }
.ed-btn i { font-size: 1.05rem; }
.ed-btn:hover { background: var(--line-2); }
.ed-btn.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(224, 49, 49, .6); }
.ed-btn.icon { padding: .45rem .55rem; }
.ed-btn.zoomv { min-width: 58px; justify-content: center; font-variant-numeric: tabular-nums; }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 .25rem; }
.ed-props { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; min-height: 44px; padding: .35rem .6rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: .84rem; }
.ed-prop { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--muted); font-weight: 600; }
.ed-prop.grow { flex: 1 1 220px; }
.ed-prop.grow input { flex: 1; }
.ed-prop input[type=number] { width: 72px; }
.ed-prop input[type=color] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.ed-prop input[type=range] { width: 96px; }
.ed-prop select { width: auto; }
.ed-toggle { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.ed-toggle.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ed-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); margin-right: 2px; padding: 0; }
.ed-swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.ed-tip { color: var(--muted); font-size: .8rem; }
.ed-hint { font-size: .82rem; color: var(--muted); padding: 0 .25rem; }
.ed-scroll { max-height: min(78vh, 1100px); overflow: auto; border-radius: 14px; background: #E9ECF3; padding: 16px; overscroll-behavior: contain; }
.ed-stack { display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: min-content; }
.ed-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(27, 35, 65, .14); flex: 0 0 auto; }
.ed-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-layer { position: absolute; inset: 0; touch-action: pan-x pan-y; }
.ed-pno { position: absolute; bottom: -18px; right: 0; font-size: .7rem; color: var(--muted); font-weight: 600; }
.ed:not(.ed-mode-select) .ed-layer { cursor: crosshair; touch-action: none; }
.ed-mode-text .ed-layer { cursor: text; }
.ed-obj { position: absolute; box-sizing: border-box; touch-action: none; cursor: move; user-select: none; -webkit-user-select: none; }
.ed-obj svg { display: block; overflow: visible; pointer-events: none; }
.ed-obj img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-obj.sel { outline: 2px solid #4C6EF5; outline-offset: 2px; }
.ed-mode-draw .ed-obj { cursor: crosshair; }
.ed-text { white-space: pre; line-height: 1.2; min-width: 12px; min-height: 1em; outline: none; padding: 0; margin: 0; }
.ed-obj.editing { cursor: text; outline: 2px dashed #4C6EF5; }
.ed-obj.editing .ed-text { user-select: text; -webkit-user-select: text; }
.ed-text:empty::before { content: '\200b'; }
.ed-h { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #4C6EF5; z-index: 2; touch-action: none; }
.ed-h-br { right: -9px; bottom: -9px; cursor: nwse-resize; }
.ed-h-pt { transform: translate(-50%, -50%); cursor: grab; }
.ed-del { position: absolute; top: -14px; right: -14px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: .62rem;
  display: flex; align-items: center; justify-content: center; z-index: 3; box-shadow: var(--shadow-sm); }
.ed-del:hover { background: var(--brand); }
.ed-redact { cursor: move; }

/* signature dialog */
.sig-tabs .nav-link { font-weight: 650; color: var(--ink-2); border-radius: 10px; }
.sig-tabs .nav-link.active { background: var(--ink); color: #fff; }
.sig-pad-wrap { position: relative; border: 1.5px dashed #CED4DA; border-radius: 14px; background: #fff; overflow: hidden; }
.sig-pad { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; position: relative; z-index: 2; }
.sig-line { position: absolute; left: 8%; right: 8%; bottom: 26%; border-bottom: 1.5px solid #DEE2E6; }
.sig-ph { position: absolute; left: 8%; bottom: 28%; color: #ADB5BD; font-size: .9rem; pointer-events: none; }
.sig-fonts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; }
.sig-font { border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1rem; display: flex; align-items: center; gap: .6rem; cursor: pointer; margin: 0; }
.sig-font span { font-size: 1.9rem; color: #0b2a6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-font:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.sig-saved img, .sig-upload-prev img { background: repeating-conic-gradient(#f1f3f5 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 8px; padding: 6px; }

/* form filler */
.form-fill { display: grid; gap: 1rem; }
.ff-page { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.ff-thumb canvas, .ff-ph { width: 100%; aspect-ratio: 3/4; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); background: var(--line-2); display: block; }
.ff-fields { display: grid; gap: .75rem; align-content: start; }
.ff-row .form-label { font-weight: 650; font-size: .86rem; margin-bottom: .25rem; color: var(--ink); }
.form-empty { text-align: center; padding: 2.5rem 1rem; background: #fff; border: 1px dashed #CED4DA; border-radius: 14px; }
.form-empty > i { font-size: 2.4rem; color: var(--brand); }

@media (max-width: 991.98px) {
  .tool-app.ws-wide .workspace { grid-template-columns: 1fr; }
  .ed-bar { top: 64px; }
  .ed-scroll { max-height: 70vh; padding: 10px; }
}
@media (max-width: 575.98px) {
  .ed-btn span { display: none; }
  .ed-btn { padding: .5rem .55rem; }
  .ed-bar { gap: .25rem; }
  .ed-actions { width: 100%; justify-content: space-between; }
  .ff-page { grid-template-columns: 1fr; }
  .ff-thumb { max-width: 160px; }
  .ed-h { width: 20px; height: 20px; }
  .ed-h-br { right: -12px; bottom: -12px; }
}
