/* FillDesk editor */
@font-face { font-family: "fd-sans"; src: url("../../lib/tfpdf/font/unifont/DejaVuSans.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "fd-sans"; src: url("../../lib/tfpdf/font/unifont/DejaVuSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "fd-serif"; src: url("../../lib/tfpdf/font/unifont/DejaVuSerif.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "fd-serif"; src: url("../../lib/tfpdf/font/unifont/DejaVuSerif-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "fd-mono"; src: url("../../lib/tfpdf/font/unifont/DejaVuSansMono.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "fd-mono"; src: url("../../lib/tfpdf/font/unifont/DejaVuSansMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "fd-script-1"; src: url("../fonts/fd-script-1.woff") format("woff"); font-display: block; }
@font-face { font-family: "fd-script-2"; src: url("../fonts/fd-script-2.woff") format("woff"); font-display: block; }
@font-face { font-family: "fd-script-3"; src: url("../fonts/fd-script-3.woff") format("woff"); font-display: block; }

.filldesk { --fd-brand: #1d4ed8; --fd-line: #d5d9e0; --fd-bg: #eef1f5; position: relative; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; color: #1d2330; max-width: 100%; }
.filldesk *, .filldesk *::before, .filldesk *::after { box-sizing: border-box; }
.filldesk button { font: inherit; cursor: pointer; }
.filldesk:not(.filldesk--notice) { width: auto; max-width: none; --fd-out: max(0px, calc((min(1240px, 100vw - 40px) - 100%) / 2)); margin-left: calc(-1 * var(--fd-out)) !important; margin-right: calc(-1 * var(--fd-out)) !important; }
.filldesk .filldesk-loading { padding: 2rem; text-align: center; color: #555; }
.fd-ribbon { background: #fff4ce; color: #6b4e00; border: 1px solid #f0d77a; padding: .35rem .75rem; font-size: 13px; border-radius: 6px; margin-bottom: .5rem; }
.fd-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 38px; padding: .4rem .9rem; border: 1px solid var(--fd-line); background: #fff; color: #1d2330; border-radius: 6px; text-decoration: none; line-height: 1.2; }
.fd-btn:hover { border-color: var(--fd-brand); }
.fd-btn--primary { background: var(--fd-brand); border-color: var(--fd-brand); color: #fff; }
.fd-btn--primary:hover { filter: brightness(1.08); color: #fff; }
.fd-btn--ghost { background: transparent; }
.fd-btn--link { border: 0; background: none; color: #a11; text-decoration: underline; padding: 0; min-height: 0; }
.fd-btn--big { font-size: 1.05rem; padding: .7rem 1.4rem; }
.fd-btn:disabled { opacity: .5; cursor: default; }
.fd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.fd-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.fd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.fd-status { font-size: 12px; color: #667; min-width: 9em; text-align: right; }
.fd-zoom, .fd-props select, .fd-props input { min-height: 34px; border: 1px solid var(--fd-line); border-radius: 6px; background: #fff; padding: 0 .4rem; }
.fd-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #fff; border: 1px solid var(--fd-line); border-radius: 8px 8px 0 0; position: sticky; top: 0; z-index: 30; }
.fd-tool { width: 40px; height: 40px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 17px; line-height: 1; color: #1d2330; }
.fd-tool:hover { background: var(--fd-bg); }
.fd-tool.is-active { background: var(--fd-brand); color: #fff; }
.fd-props { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; background: #fafbfc; border: 1px solid var(--fd-line); border-top: 0; }
.fd-props[hidden], .fd-props [hidden] { display: none !important; }
.fd-prop-size, .fd-prop-width { width: 4.5em; }
.fd-prop-color { width: 42px; padding: 2px !important; }
.fd-prop-bold { width: 34px; min-height: 34px; border: 1px solid var(--fd-line); border-radius: 6px; background: #fff; font-weight: 700; }
.fd-prop-bold[aria-pressed="true"] { background: var(--fd-brand); color: #fff; }
.fd-body { display: flex; border: 1px solid var(--fd-line); border-top: 0; background: var(--fd-bg); height: 78vh; min-height: 420px; }
.fd-side { width: 160px; flex: 0 0 160px; overflow-y: auto; background: #fff; border-right: 1px solid var(--fd-line); padding: 6px; }
.fd-side.is-closed { display: none; }
.fd-side__title { font-weight: 600; margin: 0 0 6px; font-size: 13px; }
.fd-thumbs { list-style: none; margin: 0; padding: 0; }
.fd-thumb { margin: 0 0 10px; padding: 4px; border: 1px solid transparent; border-radius: 6px; }
.fd-thumb.is-over { border-color: var(--fd-brand); }
.fd-thumb__go { display: flex; justify-content: center; align-items: center; width: 100%; height: 120px; border: 1px solid var(--fd-line); background: #f6f7f9; border-radius: 4px; padding: 0; }
.fd-thumb__img canvas { display: block; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.fd-thumb__bar { display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.fd-thumb__n { font-size: 12px; margin-right: auto; }
.fd-mini { width: 26px; height: 26px; border: 1px solid var(--fd-line); background: #fff; border-radius: 4px; font-size: 13px; padding: 0; }
.fd-viewer { flex: 1; overflow: auto; padding: 16px; position: relative; outline: none; }
.fd-page { position: relative; margin: 0 auto 18px; }
.fd-page__num { position: absolute; right: -2px; bottom: -16px; font-size: 11px; color: #778; }
.fd-sheet { position: absolute; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transform-origin: center center; }
.fd-canvas { position: absolute; left: 0; top: 0; }
.fd-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 3; pointer-events: none; }
.fd-svg .fd-hit { pointer-events: stroke; cursor: move; }
.fd-svg .is-selected line:first-child, .fd-svg .is-selected polyline:first-child { filter: drop-shadow(0 0 2px var(--fd-brand)); }
.fd-fields { position: absolute; inset: 0; z-index: 2; }
.fd-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.filldesk[data-tool]:not([data-tool="select"]) .fd-layer { pointer-events: auto; cursor: crosshair; touch-action: none; }
.filldesk[data-tool]:not([data-tool="select"]) .fd-fields { pointer-events: none; }
.fd-field { position: absolute; margin: 0; padding: 0 2px; border: 1px solid rgba(29,78,216,.35); background: rgba(219,234,254,.55); font-family: "fd-sans", sans-serif; color: #000; border-radius: 0; line-height: 1.15; resize: none; }
.fd-field:focus { outline: 2px solid var(--fd-brand); background: rgba(219,234,254,.85); }
.fd-field--check { appearance: auto; accent-color: #111; }
.fd-obj { position: absolute; pointer-events: auto; cursor: move; touch-action: none; }
.fd-obj.is-selected { outline: 1.5px dashed var(--fd-brand); outline-offset: 1px; }
.fd-obj img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.fd-textobj { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; resize: none; overflow: hidden; line-height: 1.2; white-space: pre-wrap; overflow-wrap: break-word; cursor: text; letter-spacing: 0; }
.fd-textobj:focus { outline: none; background: rgba(255,255,255,.35); }
.fd-obj--text:not(.is-selected) .fd-textobj:placeholder-shown, .fd-obj--text .fd-textobj:focus { box-shadow: inset 0 0 0 1px rgba(29,78,216,.25); }
.fd-obj--note { background: #fff3a0; border: .75px solid #d6b428; }
.fd-grip { position: absolute; left: -14px; top: -2px; width: 14px; height: 18px; font-size: 12px; line-height: 18px; text-align: center; color: var(--fd-brand); cursor: move; background: #fff; border-radius: 3px; opacity: 0; }
.fd-obj:hover .fd-grip, .fd-obj.is-selected .fd-grip { opacity: 1; }
.fd-glyph { display: block; width: 100%; text-align: center; font-family: "fd-sans", sans-serif; user-select: none; }
.fd-resize { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #fff; border: 2px solid var(--fd-brand); border-radius: 2px; cursor: nwse-resize; display: none; }
.fd-obj.is-selected .fd-resize { display: block; }
.fd-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-top: .6rem; }
.fd-legal { font-size: 12px; color: #667; margin: 0; max-width: 70ch; }
.fd-upload { background: #fff; border: 1px solid var(--fd-line); border-radius: 10px; padding: 1.5rem; max-width: 640px; margin: 0 auto; }
.fd-upload h2 { margin-top: 0; }
.fd-drop { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2.5rem 1rem; border: 2px dashed var(--fd-line); border-radius: 10px; text-align: center; cursor: pointer; background: #fafbfc; }
.fd-drop.is-over, .fd-drop:hover, .fd-drop:focus { border-color: var(--fd-brand); outline: none; }
.fd-drop span { font-size: 13px; color: #667; }
.fd-upload__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fd-consent { font-size: 13px; margin-top: .8rem; }
.fd-upload__msg.is-bad, .fd-error { color: #a11; }
.fd-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2330; color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 100001; max-width: 90vw; transition: opacity .6s; }
.fd-toast.is-bad { background: #a11; }
.fd-toast.is-gone { opacity: 0; }
.fd-modal { position: fixed; inset: 0; background: rgba(16,20,28,.55); display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 12px; }
.fd-modal__box { background: #fff; border-radius: 12px; width: 520px; max-width: 100%; max-height: 92vh; overflow: auto; padding: 1rem 1.25rem 1.25rem; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.fd-modal__box.is-wide { width: 940px; }
.fd-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.fd-modal__head h2 { margin: .2rem 0 .6rem; font-size: 1.25rem; }
.fd-modal__x { border: 0; background: none; font-size: 28px; line-height: 1; width: 40px; height: 40px; }
.fd-modal__foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .8rem; }
.fd-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--fd-bg); padding: 12px; user-select: none; }
.fd-preview__page { box-shadow: 0 1px 4px rgba(0,0,0,.25); max-width: 100%; height: auto; }
.fd-options { display: grid; gap: .5rem; }
.fd-option { margin: 0; }
.fd-option__btn { width: 100%; display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 1rem; padding: .75rem 1rem; border: 1px solid var(--fd-line); background: #fff; border-radius: 8px; }
.fd-option__btn:hover { border-color: var(--fd-brand); box-shadow: 0 0 0 1px var(--fd-brand); }
.fd-option__price { font-weight: 700; font-size: 1.1rem; grid-row: span 2; align-self: center; }
.fd-option__btn small { color: #667; }
.fd-copy { font-weight: 600; margin: .8rem 0 .2rem; }
.fd-hint { font-size: 13px; color: #667; }
.fd-test { font-size: 13px; background: #fff4ce; padding: .4rem .6rem; border-radius: 6px; }
.fd-balance { background: #ecfdf3; padding: .4rem .6rem; border-radius: 6px; }
.fd-paywall__ok { font-weight: 600; }
.fd-sig canvas.fd-sigpad { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; border: 1px solid var(--fd-line); border-radius: 8px; background: #fff repeating-linear-gradient(0deg, transparent 0 74%, #e8ebf0 74% 75%, transparent 75% 100%); display: block; margin: .5rem auto; touch-action: none; }
.fd-tabs { display: flex; gap: 4px; margin-bottom: .4rem; }
.fd-tab { border: 1px solid var(--fd-line); background: #fff; padding: .35rem .9rem; border-radius: 6px; min-height: 36px; }
.fd-tab.is-active { background: var(--fd-brand); color: #fff; border-color: var(--fd-brand); }
.fd-sig-typed { min-height: 40px; width: 60%; padding: 0 .5rem; border: 1px solid var(--fd-line); border-radius: 6px; }
.filldesk--notice { padding: 1rem; border: 1px solid #f0d77a; background: #fff8e1; border-radius: 8px; }
@media (max-width: 767px) {
	.fd-body { height: 70vh; }
	.fd-title { max-width: 100%; }
	.fd-toolbar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; flex-wrap: nowrap; overflow-x: auto; border-radius: 0; z-index: 9990; box-shadow: 0 -2px 8px rgba(0,0,0,.12); }
	.fd-tool { flex: 0 0 44px; width: 44px; height: 44px; }
	.fd-side { position: absolute; left: 0; top: 0; bottom: 0; z-index: 40; box-shadow: 2px 0 8px rgba(0,0,0,.15); }
	.fd-body { position: relative; }
	.fd-viewer { padding: 8px; }
	.fd-foot { padding-bottom: 60px; }
	.fd-btn { min-height: 44px; }
	.fd-modal__box { padding: .8rem; }
}
