/* Send for signature (send.html) and the signing page (sign.html) */
body.es { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); }
.es-bar { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.es-bar .title-in { font-weight: 600; font-size: 15px; border: 1px solid transparent; background: none; padding: 5px 8px; border-radius: 6px; min-width: 120px; max-width: 40vw; }
.es-bar .title-in:hover, .es-bar .title-in:focus { border-color: var(--border); outline: none; }
.es-bar .grow { flex: 1; }
.es-bar .state { font-size: 12.5px; color: var(--text-2); }
.es-body { flex: 1; display: flex; min-height: 0; }
.es-side { width: 320px; flex: none; background: var(--surface); border-right: 1px solid var(--border-soft); overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.es-right { width: 220px; flex: none; background: var(--surface); border-left: 1px solid var(--border-soft); overflow: auto; padding: 14px; }
.es-side h4, .es-right h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.es-pages { flex: 1; overflow: auto; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 18px; background: var(--viewer-bg, #e3e4e8); }
.es-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); flex: none; user-select: none; }
.es-page img { display: block; width: 100%; height: 100%; pointer-events: none; }
.es-page .pnum { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-3); }
.es-page.placing { cursor: crosshair; }

.rcp { border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; position: relative; }
.rcp.on { border-color: var(--rc); box-shadow: 0 0 0 1px var(--rc); }
.rcp .top { display: flex; align-items: center; gap: 8px; }
.rcp .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rc); flex: none; }
.rcp .ord { width: 42px; }
.rcp .input { height: 28px; font-size: 13px; }
.rcp .row2 { display: flex; gap: 6px; }
.rcp .del { position: absolute; top: 4px; right: 4px; }
.rcp .st { font-size: 12px; color: var(--text-2); }
.seg { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; border: none; background: var(--surface); padding: 6px 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.ftype { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; margin-bottom: 6px; border: 1px dashed var(--rc, var(--border)); border-radius: 6px; background: var(--surface); cursor: grab; font-size: 13px; text-align: left; color: var(--text); }
.ftype:hover, .ftype.on { background: color-mix(in srgb, var(--rc) 10%, var(--surface)); }
.ftype svg.i { width: 16px; height: 16px; color: var(--rc); }

.sf { position: absolute; border: 1.5px solid var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); border-radius: 3px; font-size: 11px; color: color-mix(in srgb, var(--rc) 80%, #000); display: flex; align-items: center; justify-content: center; gap: 4px; overflow: hidden; white-space: nowrap; cursor: move; }
.sf.sel { box-shadow: 0 0 0 2px var(--rc); }
.sf .rz { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; background: var(--rc); cursor: nwse-resize; }
.sf .req { position: absolute; top: 0; right: 3px; color: #e5484d; font-weight: 700; }
.sf.done { border-style: solid; background: rgba(48, 164, 108, 0.08); border-color: #30a46c; color: #12663a; cursor: default; }

.timeline { font-size: 12.5px; }
.timeline .ev { padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.timeline .ev small { display: block; color: var(--text-3); }
.badge-st { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.badge-st.signed, .badge-st.completed { background: #dff5e7; color: #12663a; }
.badge-st.viewed, .badge-st.in_progress, .badge-st.sent { background: #e6efff; color: #1d4fc4; }
.badge-st.declined, .badge-st.voided, .badge-st.expired { background: var(--danger-soft); color: var(--danger); }

/* signing page */
.sg-bar { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.sg-bar .doc { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-bar .prog { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.sg-note { flex: none; padding: 10px 16px; background: var(--accent-soft); font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sg-note.info { background: #e6efff; }
.sg-note.ok { background: #dff5e7; }
.sgf { position: absolute; border: 1.5px dashed var(--rc); background: color-mix(in srgb, var(--rc) 12%, rgba(255,255,255,.6)); border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: #1f2a44; cursor: pointer; overflow: hidden; }
.sgf.cur { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 55%, transparent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--rc) 25%, transparent); } }
.sgf.filled { border-style: solid; background: rgba(255,255,255,.85); }
.sgf img { max-width: 100%; max-height: 100%; }
.sgf input[type=text] { width: 100%; height: 100%; border: none; background: transparent; font: inherit; padding: 0 4px; outline: none; }
.sgf.other { border: 1px solid #30a46c; background: rgba(48,164,108,.1); color: #12663a; cursor: default; }
.sgf { overflow: visible; }
.sgf .flag { position: absolute; left: -1.5px; bottom: 100%; background: var(--rc); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px 4px 0 0; white-space: nowrap; pointer-events: none; }
.adopt-tabs { display: flex; border-bottom: 1px solid var(--border-soft); margin-bottom: 12px; }
.adopt-tabs button { flex: 1; border: none; background: none; padding: 9px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text-2); }
.adopt-tabs button.on { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.sig-styles { display: flex; flex-direction: column; gap: 6px; }
.sig-styles button { text-align: left; border: 1px solid var(--border-soft); border-radius: 6px; background: #fff; color: #1f2a44; font-size: 32px; padding: 6px 12px; cursor: pointer; }
.sig-styles button.on { box-shadow: 0 0 0 2px var(--accent); }
.pad { border: 1px dashed var(--border); border-radius: 6px; background: #fff; touch-action: none; cursor: crosshair; display: block; width: 100%; height: 160px; }
.consent-text { font-size: 13.5px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px 12px; }

@media (max-width: 860px) {
  .es-side { width: 260px; }
  .es-right { display: none; }
}
@media (max-width: 640px) {
  .es-body { flex-direction: column; }
  .es-side { width: auto; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .es-pages { padding: 12px 6px; }
}
