/* ConstructNav v0.9.8.1 — signature-field placement and signing surface */
#cnSignatureFieldDesignerModal{
  width:min(1240px,96vw);
  max-width:none;
  height:min(900px,94vh);
  max-height:94vh;
  box-sizing:border-box;
  padding:0;
  overflow:hidden;
}
#cnSignatureFieldDesignerModal::backdrop{background:rgba(4,18,31,.68)}
#cnSignatureFieldDesignerModal .modal-head,
#cnSignatureFieldDesignerModal .modal-foot{
  position:relative;z-index:20;flex:0 0 auto;background:#fff
}
#cnSignatureFieldDesignerModal .modal-head{gap:14px;flex-wrap:wrap}
#cnSignatureFieldDesignerModal .modal-foot{box-shadow:0 -5px 16px rgba(8,45,73,.08)}
.cn-sign-field-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.cn-sign-field-save-state{font-size:11px;font-weight:800;color:#65798a;white-space:nowrap}
.cn-sign-field-save-state.is-dirty{color:#9b5d00}
.cn-sign-field-save-state.is-saving{color:#0c6598}
.cn-sign-field-save-state.is-saved{color:#217044}
.cn-sign-field-foot{min-height:64px}
.cn-sign-field-foot .btn,.cn-sign-field-head-actions .btn{white-space:nowrap}
.cn-sign-field-shell{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0;overflow:hidden}
.cn-sign-field-body{display:grid;grid-template-columns:220px minmax(0,1fr) 250px;min-height:0;overflow:hidden;background:#edf3f7}
.cn-sign-field-palette,.cn-sign-field-inspector{padding:16px;background:#fff;overflow:auto;min-height:0}
.cn-sign-field-palette{border-right:1px solid #d5e0e8}
.cn-sign-field-inspector{border-left:1px solid #d5e0e8}
.cn-sign-field-palette h4,.cn-sign-field-inspector h4{margin:0 0 10px;color:#0b2d4b}
.cn-sign-field-palette p,.cn-sign-field-inspector p{margin:0 0 12px;color:#66788a;font-size:12px;line-height:1.45}
.cn-sign-field-tools{display:grid;gap:8px}
.cn-sign-field-tool{
  width:100%;display:flex;align-items:center;gap:9px;justify-content:flex-start;
  min-height:42px;padding:9px 11px;border:1px solid #cbd9e4;border-radius:9px;
  background:#f8fbfd;color:#143b5b;font-weight:800;cursor:grab;text-align:left
}
.cn-sign-field-tool:hover,.cn-sign-field-tool.active{background:#eaf4fb;border-color:#5d94bd}
.cn-sign-field-tool span{display:grid;place-items:center;width:27px;height:27px;border-radius:7px;background:#fff;border:1px solid #d5e1ea;font-size:13px}
.cn-sign-field-stage{position:relative;min-width:0;min-height:0;overflow:auto;padding:22px}
.cn-sign-field-stage-note{max-width:850px;margin:0 auto 14px;padding:10px 12px;border-radius:9px;background:#fff8db;border:1px solid #e8c866;color:#6f5510;font-size:12px}
.cn-sign-pages{display:grid;gap:24px;justify-items:center;min-height:100%}
.cn-sign-page{
  position:relative;background:#fff;box-shadow:0 9px 28px rgba(13,41,64,.18);
  border:1px solid #cad7e1;max-width:100%;overflow:hidden;isolation:isolate
}
.cn-sign-page[data-placeable="true"]{cursor:crosshair}
.cn-sign-page canvas,.cn-sign-page img,.cn-sign-page iframe{display:block;width:100%;height:100%;border:0;background:#fff;pointer-events:none}
.cn-sign-page-content{position:absolute;inset:0;z-index:2}
.cn-sign-page-number{position:absolute;right:8px;bottom:6px;z-index:4;padding:3px 7px;border-radius:999px;background:rgba(8,38,62,.75);color:#fff;font-size:10px;pointer-events:none}
.cn-signature-appendix{box-sizing:border-box;width:816px;min-height:1056px;padding:58px 64px;color:#16354e;background:#fff}
.cn-signature-appendix h2{margin:0 0 10px;font-size:25px;color:#082d4e}
.cn-signature-appendix .doc-name{padding:12px;border:1px solid #d5e0e8;border-radius:9px;background:#f7fafc;font-weight:800}
.cn-signature-appendix .notice{margin-top:18px;color:#617487;line-height:1.6}
.cn-sign-field{
  position:absolute;z-index:5;box-sizing:border-box;display:flex;align-items:center;justify-content:center;
  min-width:54px;min-height:24px;padding:4px 7px;border:2px dashed #0f6fa7;border-radius:5px;
  background:rgba(225,244,255,.92);color:#084f78;font-size:11px;font-weight:850;cursor:move;
  user-select:none;overflow:hidden;box-shadow:0 2px 6px rgba(8,61,94,.12)
}
.cn-sign-field.required:after{content:'*';color:#b4232b;margin-left:3px}
.cn-sign-field.selected{border-style:solid;border-color:#d08a00;background:rgba(255,242,199,.95);box-shadow:0 0 0 3px rgba(208,138,0,.15)}
.cn-sign-field .cn-sign-resize{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:3px 0 3px 0;background:#0f6fa7;cursor:nwse-resize}
.cn-sign-field-list{display:grid;gap:7px;margin:10px 0 16px}
.cn-sign-field-list button{display:block;width:100%;text-align:left;padding:8px;border:1px solid #d5e0e8;border-radius:7px;background:#f8fbfd;color:#173b58;font-size:11px}
.cn-sign-field-list button.active{border-color:#d08a00;background:#fff7dd}
.cn-sign-field-inspector .field{margin-bottom:10px}
.cn-sign-field-inspector label{display:block;margin-bottom:4px;font-size:11px;font-weight:800;color:#284b65}
.cn-sign-field-inspector input,.cn-sign-field-inspector select{width:100%;box-sizing:border-box}
.cn-sign-field-empty{padding:16px;border:1px dashed #bfcfdb;border-radius:9px;color:#6b7e8e;background:#f8fbfd;font-size:12px}
.cn-sign-field-loading{display:grid;place-items:center;min-height:320px;color:#5b6f80;font-weight:750}
.cn-sign-field-error{max-width:760px;padding:18px;border:1px solid #e5a5aa;border-radius:10px;background:#fff1f2;color:#8a1f2a}

/* Signing view */
.cn-signing-document-host{margin:12px 0 16px;padding:12px;border:1px solid #d4e0e9;border-radius:11px;background:#eef4f7}
.cn-signing-document-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.cn-signing-document-head strong{color:#0b2d4b}
.cn-signing-document-pages{max-height:58vh;overflow:auto;display:grid;gap:18px;justify-items:center;padding:10px}
.cn-signing-document-pages .cn-sign-page{box-shadow:0 7px 20px rgba(13,41,64,.16)}
.cn-sign-field.signing{cursor:default;border-style:solid;background:rgba(255,251,235,.96);color:#633e00;border-color:#ca930c;overflow:visible}
.cn-sign-field.signing input[type="text"]{width:100%;height:100%;min-height:24px;border:0;background:transparent;padding:0 3px;font:inherit;color:#342100;box-shadow:none}
.cn-sign-field.signing input[type="checkbox"]{width:20px;height:20px;margin:0}
.cn-sign-field.signing.signature-value{font-family:"Segoe Script","Brush Script MT",cursive;font-size:18px;color:#173c60}
.cn-sign-field.signing .cn-sign-placeholder{font-family:inherit;font-size:11px;color:#805b08}
.cn-signing-field-warning{padding:10px 12px;border-radius:8px;background:#fff4d5;border:1px solid #e4c269;color:#6d5211;font-size:12px}

@media (max-width:980px){
  #cnSignatureFieldDesignerModal{width:98vw;height:96vh;max-height:96vh}
  .cn-sign-field-head-actions{width:100%;justify-content:flex-start}
  .cn-sign-field-body{grid-template-columns:170px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
  .cn-sign-field-inspector{grid-column:1/-1;border-left:0;border-top:1px solid #d5e0e8;max-height:210px}
}
@media (max-width:700px){
  #cnSignatureFieldDesignerModal .modal-head{align-items:flex-start}
  .cn-sign-field-save-state{width:100%}
  .cn-sign-field-body{display:block;overflow:auto}
  .cn-sign-field-palette,.cn-sign-field-inspector{border:0;border-bottom:1px solid #d5e0e8}
  .cn-sign-field-tools{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cn-sign-field-stage{overflow:visible;padding:12px}
}

@media (max-height:720px){
  #cnSignatureFieldDesignerModal{height:98vh;max-height:98vh}
  #cnSignatureFieldDesignerModal .modal-head{padding:10px 14px}
  #cnSignatureFieldDesignerModal .modal-foot{padding:10px 14px;min-height:54px}
  .cn-sign-field-stage{padding:12px}
}

/* v0.9.8.1 — keep save controls visible and protect unsaved field placement. */
#cnSignatureFieldDesignerModal{
  box-sizing:border-box;
  height:min(900px,94dvh);
  max-height:94dvh;
}
#cnSignatureFieldDesignerModal .cn-sign-field-shell{
  box-sizing:border-box;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
}
#cnSignatureFieldDesignerModal .cn-sign-field-body{
  min-height:0;
  overflow:hidden;
}
#cnSignatureFieldDesignerModal .cn-sign-field-head,
#cnSignatureFieldDesignerModal .cn-sign-field-foot{
  position:relative;
  z-index:30;
  box-sizing:border-box;
  flex:0 0 auto;
  background:#fff;
}
#cnSignatureFieldDesignerModal .cn-sign-field-head{
  gap:16px;
  min-height:72px;
}
.cn-sign-field-head-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.cn-sign-field-save-state{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:4px 8px;
  border:1px solid #d5e0e8;
  border-radius:999px;
  background:#f5f8fa;
  color:#66788a;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}
.cn-sign-field-save-state.is-dirty{border-color:#e5bd5a;background:#fff8dc;color:#75540b}
.cn-sign-field-save-state.is-saving{border-color:#7db1d2;background:#eaf5fb;color:#0d5a86}
.cn-sign-field-save-state.is-saved{border-color:#8ec8a4;background:#edf9f1;color:#17663a}
#cnSignatureFieldDesignerModal .cn-sign-field-foot{
  position:sticky;
  bottom:0;
  min-height:68px;
  box-shadow:0 -8px 22px rgba(8,37,61,.08);
}
#cnSignatureFieldDesignerModal [data-cn-sign-field-save-draft],
#cnSignatureFieldDesignerModal [data-cn-sign-field-save-continue]{
  min-width:112px;
}
#cnSignatureFieldDesignerModal [data-cn-sign-field-save-continue]{min-width:152px}
#cnSignatureFieldDesignerModal button[disabled]{cursor:wait;opacity:.68}

@media (max-width:980px){
  #cnSignatureFieldDesignerModal{height:96dvh;max-height:96dvh}
  #cnSignatureFieldDesignerModal .cn-sign-field-head{align-items:flex-start;flex-wrap:wrap}
  .cn-sign-field-head-actions{width:100%;justify-content:flex-start}
}
@media (max-width:700px){
  #cnSignatureFieldDesignerModal .cn-sign-field-head-actions .cn-sign-field-save-state{width:100%;justify-content:center}
  #cnSignatureFieldDesignerModal .cn-sign-field-foot{flex-wrap:wrap}
  #cnSignatureFieldDesignerModal .cn-sign-field-foot #cnSignFieldCount{order:3;width:100%;margin-right:0!important;text-align:center}
  #cnSignatureFieldDesignerModal .cn-sign-field-body{display:block;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}
  #cnSignatureFieldDesignerModal .cn-sign-field-stage{min-width:0;overflow:visible;padding:12px}
  #cnSignatureFieldDesignerModal .cn-sign-page{max-width:none}
}
.cn-sign-page:focus-visible,.cn-sign-field:focus-visible{outline:3px solid #f0ad28;outline-offset:3px}
