/* ============================================================================
   E-Signer — an independent workspace for the two-tool signing flow.
   This stylesheet deliberately shares nothing with css/editor.css: E-Signer
   keeps one document, two parties and exactly two tools (signature + text).
   ========================================================================== */

.es-page,
.es-workpage {
  color-scheme: light;
  --es-ink: #102a43;
  --es-ink-2: #334e68;
  --es-muted: #6b7c93;
  --es-soft: #f5f9fc;
  --es-line: #dfe8f0;
  --es-line-strong: #c7d5e2;
  --es-blue: #2079c8;
  --es-blue-dark: #0c4d8f;
  --es-blue-soft: #eaf4fc;
  --es-blue-line: #c6e2f3;
  --es-teal: #0f766e;
  --es-green: #0b7a58;
  --es-green-soft: #e9f8f2;
  --es-amber: #a76409;
  --es-amber-soft: #fff6e6;
  --es-red: #b42318;
  --es-red-soft: #fef3f2;
  --es-shadow: 0 12px 32px rgba(15, 35, 58, .07);
  --es-shadow-lg: 0 24px 60px rgba(15, 35, 58, .13);
  --es-radius: 18px;
  color: var(--es-ink);
}

body.es-page {
  background:
    radial-gradient(1100px 480px at 8% -10%, #d7ecfb 0%, transparent 55%),
    radial-gradient(900px 460px at 98% 3%, #e8f2fe 0%, transparent 52%),
    linear-gradient(180deg, #f2f8fd 0%, #eef5fb 60%, #f7fafc 100%);
  background-attachment: fixed;
}
body.es-page #page-back { display: none; }
body.es-page .site-footer { display: none; }

.es-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 76px;
}

.es-dash { display: flex; flex-direction: column; gap: 54px; }

/* ------------------------------------------------------------------ hero */
.es-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(390px, .94fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-top: 6px;
}

.es-hero-copy { max-width: 610px; }

.es-crumb {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--es-muted); font-size: .84rem; font-weight: 650;
  padding: 7px 11px; margin: 0 0 24px -11px; border-radius: 9px;
  transition: background .15s ease, color .15s ease;
}
.es-crumb:hover { color: var(--es-blue-dark); background: rgba(255, 255, 255, .7); text-decoration: none; }

.es-kicker {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 15px; color: var(--es-blue-dark);
  font-size: .74rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase;
}
.es-kicker i { color: var(--es-blue); font-size: .85rem; }

.es-hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 4.35rem);
  line-height: .98;
  letter-spacing: -.055em;
  color: var(--es-ink);
  font-weight: 800;
}
.es-hero h1 span {
  color: var(--es-blue);
  background: linear-gradient(100deg, #2079c8, #0f766e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.es-lead {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--es-ink-2);
  font-size: 1.05rem;
  line-height: 1.7;
}

.es-trust {
  display: flex; flex-wrap: wrap; gap: 9px 20px;
  margin: 27px 0 0; padding: 0; list-style: none;
  color: var(--es-muted); font-size: .82rem; font-weight: 600;
}
.es-trust li { display: inline-flex; align-items: center; gap: 7px; }
.es-trust i { color: var(--es-green); font-size: .8rem; }

/* ---------------------------------------------------------- upload card */
.es-upload-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--es-shadow-lg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.es-upload-card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 25px; pointer-events: none;
  background: linear-gradient(140deg, rgba(32, 121, 200, .22), transparent 42%, rgba(15, 118, 110, .15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px;
}
.es-upload-head { display: flex; align-items: center; gap: 13px; padding: 2px 4px 17px; }
.es-upload-badge {
  display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto;
  border-radius: 13px; background: var(--es-blue-soft); color: var(--es-blue);
  font-size: 1.05rem;
}
.es-upload-head h2 { margin: 0; font-size: 1.04rem; letter-spacing: -.015em; }
.es-upload-head p { margin: 3px 0 0; color: var(--es-muted); font-size: .79rem; }

.es-drop {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 34px 22px 24px;
  border: 1.6px dashed var(--es-line-strong);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(32, 121, 200, .07), transparent 60%),
    #fbfdff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.es-drop:hover,
.es-drop:focus-visible,
.es-drop.is-drag {
  border-color: var(--es-blue);
  background: var(--es-blue-soft);
  outline: none;
}
.es-drop.is-drag { transform: scale(.995); }
.es-drop-art {
  display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 15px;
  border-radius: 18px; background: #fff; color: var(--es-blue);
  box-shadow: 0 8px 22px rgba(32, 121, 200, .14);
  font-size: 1.35rem;
}
.es-drop strong { font-size: 1.02rem; color: var(--es-ink); }
.es-drop-sub { margin-top: 5px; color: var(--es-muted); font-size: .83rem; }
.es-linklike { color: var(--es-blue-dark); font-weight: 700; }
.es-drop-file {
  max-width: 100%; margin-top: 10px; padding: 5px 10px;
  border-radius: 7px; background: #fff; border: 1px solid var(--es-line);
  color: var(--es-ink-2); font-size: .76rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.es-pick { margin-top: 19px; }
.es-btn.es-pick { min-height: 42px; padding: 9px 22px; }
.es-drop-note {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin: 15px 0 0; color: #7e8da0; font-size: .72rem;
}
.es-drop-note i { color: var(--es-teal); }

.es-upload-progress { padding: 20px 7px 5px; }
.es-progress-row {
  display: flex; justify-content: space-between; gap: 12px;
  margin-bottom: 9px; color: var(--es-ink-2); font-size: .8rem; font-weight: 650;
}
.es-progress-track {
  height: 7px; border-radius: 10px; background: #e7eef5; overflow: hidden;
}
.es-progress-track span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--es-blue), var(--es-teal));
  transition: width .2s ease;
}

.es-alert {
  margin: 14px 0 0; padding: 11px 13px; border-radius: 10px;
  font-size: .82rem; line-height: 1.45;
}
.es-alert-error { color: var(--es-red); background: var(--es-red-soft); border: 1px solid #f6ccc7; }

/* --------------------------------------------------------------- requests */
.es-requests { display: flex; flex-direction: column; gap: 18px; }
.es-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 0 2px;
}
.es-section-kicker {
  margin: 0 0 6px; color: var(--es-blue-dark);
  font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
}
.es-section-head h2 {
  margin: 0; font-size: clamp(1.4rem, 2.3vw, 1.85rem);
  letter-spacing: -.035em; color: var(--es-ink);
}
.es-count {
  flex: 0 0 auto; padding: 6px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--es-line);
  color: var(--es-muted); font-size: .74rem; font-weight: 700;
}

.es-request-list { display: flex; flex-direction: column; gap: 10px; }
.es-request-card {
  display: flex; align-items: center; gap: 15px;
  padding: 15px 16px;
  border: 1px solid var(--es-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 42, 67, .025);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.es-request-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--es-shadow);
  border-color: var(--es-blue-line);
}
.es-request-mark {
  display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px; color: var(--es-blue); background: var(--es-blue-soft);
  font-size: 1rem;
}
.es-request-card.is-done .es-request-mark { color: var(--es-green); background: var(--es-green-soft); }
.es-request-main { flex: 1 1 auto; min-width: 0; }
.es-request-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.es-request-title h3 {
  margin: 0; max-width: 100%;
  color: var(--es-ink); font-size: .94rem; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.es-request-parties {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin: 5px 0 0; color: var(--es-muted); font-size: .76rem;
}
.es-request-parties i { color: #98a7b8; font-size: .66rem; }
.es-dot { color: #a9b6c4; }
.es-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: .65rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase;
}
.es-status.is-sent { color: var(--es-amber); background: var(--es-amber-soft); }
.es-status.is-done { color: var(--es-green); background: var(--es-green-soft); }
.es-request-actions { display: flex; gap: 7px; flex: 0 0 auto; }

.es-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 46px 20px;
  border: 1px dashed var(--es-line-strong);
  border-radius: 17px;
  background: rgba(255, 255, 255, .55);
}
.es-empty-art {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 13px;
  border-radius: 16px; background: #fff; color: var(--es-blue); font-size: 1.2rem;
  box-shadow: var(--es-shadow);
}
.es-empty h3 { margin: 0 0 5px; font-size: 1rem; }
.es-empty p { margin: 0; max-width: 470px; color: var(--es-muted); font-size: .84rem; line-height: 1.55; }

/* ------------------------------------------------------------------- flow */
.es-flow {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(32, 121, 200, .08), transparent 65%),
    #fff;
  box-shadow: var(--es-shadow);
}
.es-steps {
  position: relative;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px; margin: 28px 0 0; padding: 0; list-style: none;
}
.es-steps::before {
  content: ""; position: absolute; top: 25px; left: 9%; right: 9%;
  height: 1px; background: linear-gradient(90deg, transparent, var(--es-line-strong), transparent);
}
.es-steps li { position: relative; z-index: 1; text-align: center; }
.es-step-num {
  position: absolute; top: -8px; left: calc(50% + 16px);
  display: grid; place-items: center; width: 19px; height: 19px;
  border-radius: 50%; background: var(--es-blue); color: #fff;
  font-size: .6rem; font-weight: 800; border: 2px solid #fff;
}
.es-step-ico {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 15px; background: var(--es-soft); color: var(--es-blue);
  border: 1px solid var(--es-line); font-size: 1.02rem;
}
.es-steps h3 { margin: 0 0 5px; font-size: .86rem; color: var(--es-ink); }
.es-steps p { margin: 0 auto; max-width: 160px; color: var(--es-muted); font-size: .75rem; line-height: 1.5; }
.es-flow-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 28px 0 0; padding-top: 19px; border-top: 1px solid var(--es-line);
  color: var(--es-muted); font-size: .78rem; line-height: 1.5;
}
.es-flow-note i { color: var(--es-teal); margin-top: 2px; }

/* ------------------------------------------------------------------ buttons */
.es-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 16px;
  border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-size: .83rem; font-weight: 700; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.es-btn:hover { text-decoration: none; transform: translateY(-1px); }
.es-btn:active { transform: translateY(0); }
.es-btn i { font-size: .88em; }
.es-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #2079c8, #0d5c9e);
  border-color: #0d5c9e;
  box-shadow: 0 7px 18px rgba(32, 121, 200, .23);
}
.es-btn-primary:hover { background: linear-gradient(135deg, #1b6cb4, #0b4d87); color: #fff; }
.es-btn-soft {
  color: var(--es-blue-dark); background: var(--es-blue-soft);
  border-color: var(--es-blue-line);
}
.es-btn-soft:hover { color: var(--es-blue-dark); background: #dfeffb; }
.es-btn-quiet {
  color: var(--es-ink-2); background: #fff; border-color: var(--es-line-strong);
}
.es-btn-quiet:hover { color: var(--es-blue-dark); border-color: var(--es-blue); background: #fff; }
.es-btn-block { width: 100%; }
.es-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.es-plain-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px; border: 0; background: none;
  color: var(--es-blue-dark); font: inherit; font-size: .75rem; font-weight: 700;
  cursor: pointer; border-radius: 6px;
}
.es-plain-btn:hover { background: var(--es-blue-soft); }

/* ========================================================================== */
/* Workspace                                                                  */
/* ========================================================================== */

body.es-workpage { background: #edf2f7; overflow: hidden; }
body.es-workpage .site-header { display: none; }
body.es-workpage .site-footer { display: none; }
body.es-workpage #page-back { display: none; }
.es-editor-main { width: 100%; margin: 0; padding: 0; }

.es-editor {
  position: relative;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: #edf2f7;
  color: var(--es-ink);
}

/* ---------------------------------------------------------------- top bar */
.es-workbar {
  position: relative; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 66px; padding: 0 18px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--es-line);
  box-shadow: 0 1px 0 rgba(16, 42, 67, .02);
}
.es-workbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 340px; }
.es-workbar-back {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 10px; border-radius: 9px;
  color: var(--es-ink-2); font-size: .8rem; font-weight: 700;
}
.es-workbar-back:hover { background: var(--es-soft); color: var(--es-blue-dark); text-decoration: none; }
.es-workbar-divider { width: 1px; height: 25px; background: var(--es-line); flex: 0 0 auto; }
.es-doc-mark {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 10px; background: var(--es-blue-soft); color: var(--es-blue);
  font-size: .91rem;
}
.es-doc-meta { min-width: 0; }
.es-doc-meta h1 {
  margin: 0; max-width: 34vw;
  font-size: .9rem; font-weight: 750; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.es-doc-meta p { margin: 2px 0 0; color: var(--es-muted); font-size: .7rem; }
.es-workbar-center { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.es-page-pill {
  padding: 5px 10px; border-radius: 999px;
  background: var(--es-soft); border: 1px solid var(--es-line);
  color: var(--es-muted); font-size: .7rem; font-weight: 700;
}
.es-zoom {
  display: flex; align-items: center; gap: 4px;
  padding: 3px; border: 1px solid var(--es-line); border-radius: 9px; background: #fff;
}
.es-zoom span {
  min-width: 44px; text-align: center; color: var(--es-muted);
  font-size: .68rem; font-weight: 700;
}
.es-icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 7px; background: transparent; color: var(--es-ink-2);
  cursor: pointer; font-size: .78rem;
}
.es-icon-btn:hover { background: var(--es-soft); color: var(--es-blue-dark); }
.es-workbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.es-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #18a874;
  box-shadow: 0 0 0 4px rgba(24, 168, 116, .13);
}
.es-panel-toggle { display: none; }
.es-top-primary { min-height: 38px; padding: 8px 16px; }

/* ------------------------------------------------------------------ work */
.es-work {
  display: grid; grid-template-columns: 306px minmax(0, 1fr) 368px;
  flex: 1 1 auto; min-height: 0;
}
.es-canvas-col {
  position: relative; min-width: 0; min-height: 0;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(255, 255, 255, .75), transparent 65%),
    #e9eff5;
}
.es-viewer {
  height: 100%; overflow: auto; overscroll-behavior: contain;
  padding: 34px 34px 120px;
  scroll-behavior: smooth;
}
.es-viewer::-webkit-scrollbar { width: 10px; height: 10px; }
.es-viewer::-webkit-scrollbar-thumb { background: #c5d1dd; border-radius: 10px; border: 2px solid #e9eff5; }
.es-viewer-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; color: var(--es-muted); text-align: center;
}
.es-viewer-loading strong { margin-top: 14px; color: var(--es-ink-2); font-size: .9rem; }
.es-viewer-loading p { margin: 6px 0 0; font-size: .78rem; }

.es-page-wrap {
  position: relative;
  width: max-content; max-width: 100%;
  margin: 0 auto 30px;
}
.es-page-wrap:last-child { margin-bottom: 0; }
.es-page {
  position: relative;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(16, 42, 67, .09), 0 14px 36px rgba(16, 42, 67, .13);
  cursor: default;
}
.es-page-wrap.is-tool-active .es-page { cursor: crosshair; }
.es-page canvas { display: block; max-width: 100%; }
.es-page-tag {
  position: absolute; left: -8px; bottom: -9px;
  padding: 3px 7px; border-radius: 5px;
  background: rgba(16, 42, 67, .62); color: #fff;
  font-size: .59rem; font-weight: 700; letter-spacing: .03em;
  opacity: 0; transition: opacity .15s ease;
}
.es-page-wrap:hover .es-page-tag { opacity: 1; }
.es-page-overlay { position: absolute; inset: 0; pointer-events: none; }

/* --------------------------------------------------------------- fields */
.es-field {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 2px;
  pointer-events: auto;
  cursor: move;
  touch-action: none;
  user-select: none;
}
.es-field:hover { border-color: rgba(32, 121, 200, .42); }
.es-field.is-selected {
  border: 1.5px dashed var(--es-blue);
  background: rgba(32, 121, 200, .045);
  box-shadow: 0 0 0 3px rgba(32, 121, 200, .08);
}
.es-field-body { width: 100%; height: 100%; overflow: hidden; }
.es-field.is-text .es-field-body { padding: 0 1px; }
.es-field-text {
  display: block; width: 100%; height: 100%;
  color: #111827; white-space: pre-wrap; overflow-wrap: anywhere;
  line-height: 1.25; font-family: "Inter", "Segoe UI", Arial, sans-serif;
  pointer-events: none;
}
.es-field.is-signature .es-field-body { display: flex; align-items: center; }
.es-field-signature-img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}
.es-field-empty {
  display: flex; align-items: center; height: 100%;
  color: rgba(16, 42, 67, .36); font-size: .68rem; font-style: italic;
}
.es-field-handle {
  position: absolute; top: -25px; left: -1px;
  display: none; align-items: center; gap: 5px;
  height: 21px; padding: 0 7px;
  border-radius: 6px 6px 0 0;
  background: var(--es-blue); color: #fff;
  font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap; cursor: move;
}
.es-field.is-selected .es-field-handle { display: inline-flex; }
.es-field-handle i { font-size: .55rem; }
.es-field-delete {
  position: absolute; top: -26px; right: -1px;
  display: none; place-items: center;
  width: 23px; height: 23px; border: 0; border-radius: 50%;
  background: #fff; color: var(--es-red);
  box-shadow: 0 3px 10px rgba(16, 42, 67, .2);
  cursor: pointer; font-size: .64rem;
}
.es-field-delete:hover { background: var(--es-red); color: #fff; }
.es-field.is-selected .es-field-delete { display: grid; }
.es-field-resize {
  position: absolute; right: -6px; bottom: -6px;
  display: none; width: 14px; height: 14px;
  border: 2px solid #fff; border-radius: 50%;
  background: var(--es-blue);
  box-shadow: 0 2px 8px rgba(16, 42, 67, .2);
  cursor: nwse-resize; touch-action: none;
}
.es-field.is-selected .es-field-resize { display: block; }
.es-field-readonly { pointer-events: none; }
.es-field.is-dragging { opacity: .82; }

.es-field-text-edit {
  width: 100%; height: 100%; min-height: 1em;
  padding: 0; border: 0; outline: 0; resize: none;
  background: rgba(255, 255, 255, .88);
  color: #111827; font-family: "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.25; overflow: hidden;
}

.es-page.is-placing { cursor: crosshair; }
.es-canvas-hint {
  position: absolute; left: 50%; bottom: 28px;
  z-index: 70;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-radius: 10px;
  background: rgba(16, 42, 67, .92); color: #fff;
  font-size: .76rem; font-weight: 600;
  box-shadow: var(--es-shadow-lg);
  transform: translateX(-50%);
  pointer-events: none;
}
.es-canvas-hint i { color: #8bd3ff; }

/* ---------------------------------------------------------------- sidebar */
.es-side {
  display: flex; flex-direction: column; min-height: 0;
  background: #fff;
}
.es-tools-panel {
  border-right: 1px solid var(--es-line);
  box-shadow: 8px 0 28px rgba(16, 42, 67, .035);
}
.es-mail-panel {
  border-left: 1px solid var(--es-line);
  box-shadow: -8px 0 28px rgba(16, 42, 67, .035);
}
.es-side-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 18px 18px 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.es-side-scroll::-webkit-scrollbar { width: 8px; }
.es-side-scroll::-webkit-scrollbar-thumb { background: #d6e0e8; border-radius: 8px; }

.es-card {
  padding: 16px;
  border: 1px solid var(--es-line);
  border-radius: 15px;
  background: #fff;
}
.es-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.es-card-head-compact { align-items: center; margin-bottom: 10px; }
.es-card-kicker {
  margin: 0 0 3px; color: var(--es-blue-dark);
  font-size: .61rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.es-card-head h2 { margin: 0; font-size: .98rem; letter-spacing: -.02em; }
.es-card-ico {
  display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px; background: var(--es-soft); color: var(--es-blue); font-size: .76rem;
}

.es-party { padding: 12px; border-radius: 11px; background: var(--es-soft); border: 1px solid #eaf0f5; }
.es-party-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.es-party-role { color: var(--es-ink); font-size: .78rem; font-weight: 800; }
.es-party-tag {
  padding: 3px 7px; border-radius: 999px;
  background: var(--es-blue-soft); color: var(--es-blue-dark);
  font-size: .59rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.es-party-tag.is-next { background: #fff; color: var(--es-amber); border: 1px solid #f0dcb8; }
.es-party-connector {
  display: flex; align-items: center; gap: 7px; padding: 7px 14px;
  color: #9aabba; font-size: .6rem;
}
.es-party-connector span { flex: 1 1 auto; height: 1px; background: var(--es-line); }

.es-form-field { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.es-form-field > span { color: var(--es-muted); font-size: .68rem; font-weight: 650; }
.es-form-field > span em { font-style: normal; color: #9aabba; font-weight: 500; }
.es-form-field input,
.es-form-field textarea,
.es-form-field select {
  width: 100%; min-height: 36px; padding: 8px 10px;
  border: 1px solid var(--es-line-strong); border-radius: 8px;
  background: #fff; color: var(--es-ink);
  font: inherit; font-size: .79rem;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.es-form-field input:focus,
.es-form-field textarea:focus,
.es-form-field select:focus {
  outline: none; border-color: var(--es-blue);
  box-shadow: 0 0 0 3px rgba(32, 121, 200, .11);
}
.es-form-field textarea { resize: vertical; min-height: 55px; line-height: 1.4; }
.es-form-field-message { margin-top: 12px; }
.es-form-field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; }
.es-form-field-inline > span { flex: 0 0 auto; }
.es-form-field-inline select { width: 105px; }

.es-readonly-party {
  display: flex; align-items: center; gap: 10px;
  padding: 11px; border: 1px solid var(--es-line); border-radius: 11px;
  background: #fff;
}
.es-readonly-party.is-you { border-color: var(--es-blue-line); background: #fbfdff; }
.es-avatar {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%; background: var(--es-blue-soft); color: var(--es-blue-dark);
  font-size: .82rem; font-weight: 800;
}
.es-readonly-party > div { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.es-role-label { color: var(--es-muted); font-size: .59rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.es-readonly-party strong { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-readonly-party small { color: var(--es-muted); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-signed-tick,
.es-awaiting-tick {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%; font-size: .58rem;
}
.es-signed-tick { background: var(--es-green-soft); color: var(--es-green); }
.es-awaiting-tick { background: var(--es-amber-soft); color: var(--es-amber); }
.es-message-quote {
  margin: 12px 0 0; padding: 10px 12px;
  border-left: 3px solid var(--es-blue-line); border-radius: 0 8px 8px 0;
  background: var(--es-soft); color: var(--es-ink-2);
  font-size: .75rem; line-height: 1.55; white-space: pre-wrap;
}

/* tools */
.es-tool-grid { display: flex; flex-direction: column; gap: 7px; }
.es-tool {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border: 1px solid var(--es-line); border-radius: 11px;
  background: #fff; color: var(--es-ink); text-align: left; font: inherit;
  cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.es-tool:hover { border-color: var(--es-blue-line); background: #fbfdff; }
.es-tool.is-active {
  border-color: var(--es-blue); background: var(--es-blue-soft);
  box-shadow: 0 0 0 3px rgba(32, 121, 200, .08);
}
.es-tool-ico {
  display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto;
  border-radius: 9px; background: var(--es-soft); color: var(--es-blue); font-size: .84rem;
}
.es-tool.is-active .es-tool-ico { background: #fff; color: var(--es-blue-dark); }
.es-tool-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.es-tool-text strong { font-size: .8rem; }
.es-tool-text small { color: var(--es-muted); font-size: .67rem; }
.es-tool-key {
  display: grid; place-items: center; width: 20px; height: 20px;
  border: 1px solid var(--es-line); border-radius: 5px;
  color: #9aabba; font-size: .58rem; font-weight: 700;
}
.es-tool.is-active .es-tool-key { border-color: var(--es-blue-line); color: var(--es-blue-dark); }

.es-tool-hint {
  margin: 11px 1px 0; color: var(--es-muted);
  font-size: .69rem; line-height: 1.5;
}
.es-text-options {
  margin-top: 11px; padding: 11px;
  border: 1px solid var(--es-blue-line); border-radius: 10px; background: #fbfdff;
}
.es-text-options-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; color: var(--es-blue-dark);
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.es-ink-row { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.es-ink-row > span { color: var(--es-muted); font-size: .68rem; font-weight: 650; }
.es-ink {
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: var(--ink, #111827);
  box-shadow: 0 0 0 1px var(--es-line-strong); cursor: pointer;
}
.es-ink[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink, #111827); }

/* placed list */
.es-placed-list { display: flex; flex-direction: column; gap: 5px; }
.es-placed-empty { margin: 0; padding: 7px 2px 4px; color: var(--es-muted); font-size: .72rem; line-height: 1.5; }
.es-placed-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: 1px solid transparent; border-radius: 8px;
  background: var(--es-soft); cursor: pointer; text-align: left; width: 100%;
  color: var(--es-ink-2); font: inherit;
}
.es-placed-item:hover { border-color: var(--es-line-strong); background: #fff; }
.es-placed-item.is-selected { border-color: var(--es-blue); background: #fff; }
.es-placed-item > i { width: 17px; color: var(--es-blue); font-size: .65rem; text-align: center; }
.es-placed-item span {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; font-weight: 600;
}
.es-placed-item small { color: #9aabba; font-size: .59rem; flex: 0 0 auto; }
.es-placed-item .es-placed-del {
  display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 auto;
  border: 0; border-radius: 5px; background: transparent; color: #99a8b7;
  font-size: .6rem; cursor: pointer;
}
.es-placed-item .es-placed-del:hover { background: var(--es-red-soft); color: var(--es-red); }

.es-side-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 3px 2px 0; color: #8b9aab; font-size: .66rem; line-height: 1.5;
}
.es-side-note i { margin-top: 2px; color: var(--es-teal); }

.es-side-foot {
  flex: 0 0 auto; padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--es-line);
  background: #fff;
  box-shadow: 0 -8px 24px rgba(16, 42, 67, .04);
}
.es-send-summary { display: flex; flex-direction: column; gap: 3px; margin-bottom: 9px; }
.es-send-state { display: flex; align-items: center; gap: 6px; color: var(--es-ink-2); font-size: .72rem; font-weight: 700; }
.es-send-state i { color: var(--es-blue); font-size: .67rem; }
.es-send-state.is-ready i { color: var(--es-green); }
.es-send-note { color: var(--es-muted); font-size: .65rem; }
.es-side-privacy {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin: 8px 0 0; color: #95a3b4; font-size: .62rem;
}
.es-side-privacy i { color: var(--es-teal); }

/* ---------------------------------------------------------------- toast */
.es-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 400;
  max-width: min(460px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 10px;
  background: #102a43; color: #fff;
  font-size: .8rem; line-height: 1.4;
  box-shadow: var(--es-shadow-lg);
  transform: translateX(-50%);
  animation: esToastIn .18s ease;
}
.es-toast.is-error { background: #7a271a; }
@keyframes esToastIn { from { opacity: 0; transform: translate(-50%, 7px); } }

/* ------------------------------------------------------------- signature */
.es-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.es-modal[hidden] { display: none; }
.es-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(9, 24, 40, .48);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.es-modal-box {
  position: relative; z-index: 1;
  width: min(720px, 100%); max-height: 92vh; max-height: 92dvh;
  overflow-y: auto;
  padding: 25px 27px 0;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(9, 24, 40, .34);
  animation: esModalIn .2s ease;
}
@keyframes esModalIn { from { opacity: 0; transform: translateY(9px) scale(.99); } }
.es-modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 31px; height: 31px; border: 0; border-radius: 8px;
  background: var(--es-soft); color: var(--es-muted);
  font-size: 1.18rem; line-height: 1; cursor: pointer;
}
.es-modal-close:hover { background: var(--es-red-soft); color: var(--es-red); }
.es-modal-head h2 { margin: 0; font-size: 1.42rem; letter-spacing: -.035em; }
.es-modal-head > p:last-child { margin: 6px 0 0; color: var(--es-muted); font-size: .8rem; }

.es-sig-tabs {
  display: flex; gap: 4px; margin: 20px 0 16px; padding: 4px;
  border-radius: 11px; background: var(--es-soft); border: 1px solid var(--es-line);
}
.es-sig-tabs button {
  flex: 1 1 0; min-height: 34px; padding: 7px 8px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--es-muted); font: inherit; font-size: .75rem; font-weight: 700;
  cursor: pointer;
}
.es-sig-tabs button i { margin-right: 5px; font-size: .72rem; }
.es-sig-tabs button.is-active { background: #fff; color: var(--es-blue-dark); box-shadow: 0 1px 4px rgba(16, 42, 67, .1); }

.es-sig-panel[hidden] { display: none; }
#es-sig-canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 660 / 206;
  border: 1.5px dashed var(--es-line-strong); border-radius: 12px;
  background:
    linear-gradient(#f7fbfe, #f7fbfe) padding-box,
    #fff;
  cursor: crosshair; touch-action: none;
}
.es-sig-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.es-sig-inks { display: flex; align-items: center; gap: 11px; }
.es-ink.is-dark { --ink: #0f172a; }
.es-sig-help { margin: 8px 0 0; color: var(--es-muted); font-size: .68rem; text-align: center; }

.es-sig-styles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  max-height: 208px; overflow-y: auto; padding: 2px;
}
.es-sig-style {
  min-height: 63px; padding: 6px 8px;
  border: 1px solid var(--es-line); border-radius: 9px;
  background: #fff; color: var(--es-ink); cursor: pointer;
  font-size: 25px; line-height: 1.15; text-align: center;
  overflow: hidden; white-space: nowrap;
}
.es-sig-style:hover { border-color: var(--es-blue-line); background: #fbfdff; }
.es-sig-style.is-active { border-color: var(--es-blue); background: var(--es-blue-soft); box-shadow: 0 0 0 2px rgba(32, 121, 200, .09); }

.es-upload-sig {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 29px 20px; border: 1.5px dashed var(--es-line-strong); border-radius: 12px;
  background: var(--es-soft); color: var(--es-muted); text-align: center; cursor: pointer;
}
.es-upload-sig:hover { border-color: var(--es-blue); background: var(--es-blue-soft); }
.es-upload-sig i { color: var(--es-blue); font-size: 1.35rem; margin-bottom: 4px; }
.es-upload-sig strong { color: var(--es-ink-2); font-size: .82rem; }
.es-upload-sig span { max-width: 380px; font-size: .7rem; line-height: 1.45; }
.es-sig-preview {
  margin-top: 12px; padding: 12px; border: 1px solid var(--es-line);
  border-radius: 10px; background: #fff;
}
.es-sig-preview img { display: block; max-width: 100%; max-height: 150px; margin: 0 auto; object-fit: contain; }

.es-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
  margin: 22px -27px 0; padding: 15px 27px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--es-line);
  background: #fff;
}
.es-check { display: inline-flex; align-items: center; gap: 7px; color: var(--es-muted); font-size: .72rem; cursor: pointer; }
.es-check input { accent-color: var(--es-blue); width: 15px; height: 15px; }
.es-modal-actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------------- sending */
.es-sending {
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(9, 24, 40, .52);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.es-sending[hidden] { display: none; }
.es-sending-box {
  position: relative; width: min(380px, 100%);
  padding: 35px 28px 30px; border-radius: 20px;
  background: #fff; text-align: center;
  box-shadow: 0 28px 80px rgba(9, 24, 40, .32);
}
.es-sending-box h2 { margin: 16px 0 5px; font-size: 1.08rem; letter-spacing: -.02em; }
.es-sending-box p { margin: 0; color: var(--es-muted); font-size: .78rem; }
.es-seal {
  display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto;
  border-radius: 50%; background: var(--es-blue-soft); color: var(--es-blue);
  font-size: 1.16rem;
}
.es-sending .es-spinner { margin-top: 20px; }

.es-spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid #d7e6f3; border-top-color: var(--es-blue);
  border-radius: 50%; animation: esSpin .8s linear infinite;
}
@keyframes esSpin { to { transform: rotate(360deg); } }

/* signature faces — separate declarations from the editor stylesheet */

/* ========================================================================== */
/* Status + completion page                                                   */
/* ========================================================================== */

.es-view { display: flex; flex-direction: column; gap: 26px; }
.es-view-crumb {
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
  padding-top: 2px;
}
.es-view-crumb .es-crumb { margin: 0; padding-left: 0; }
.es-secure-chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--es-muted); font-size: .7rem; font-weight: 650;
}
.es-secure-chip i { color: var(--es-teal); }

.es-result-hero {
  position: relative; overflow: hidden;
  padding: clamp(30px, 5vw, 50px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: var(--es-shadow);
}
.es-result-hero.is-done {
  background:
    radial-gradient(700px 280px at 50% -15%, rgba(15, 138, 95, .16), transparent 70%),
    linear-gradient(160deg, #f2fcf8, #ffffff 62%);
}
.es-result-hero.is-sent {
  background:
    radial-gradient(700px 280px at 50% -15%, rgba(32, 121, 200, .16), transparent 70%),
    linear-gradient(160deg, #f3f9fe, #ffffff 62%);
}
.es-result-icon {
  display: grid; place-items: center; width: 62px; height: 62px;
  margin-bottom: 16px; border-radius: 20px;
  font-size: 1.4rem;
  box-shadow: 0 11px 26px rgba(16, 42, 67, .12);
}
.es-result-hero.is-done .es-result-icon { background: var(--es-green); color: #fff; }
.es-result-hero.is-sent .es-result-icon { background: var(--es-blue); color: #fff; }
.es-result-hero .es-kicker { margin-bottom: 8px; }
.es-result-hero h1 {
  max-width: 760px; margin: 0;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05;
  letter-spacing: -.045em; color: var(--es-ink);
}
.es-result-lead {
  max-width: 610px; margin: 14px 0 0;
  color: var(--es-ink-2); font-size: .96rem; line-height: 1.65;
}
.es-result-lead strong { color: var(--es-ink); }
.es-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 24px; }
.es-status-strip {
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 9px 18px;
  margin-top: 23px; padding-top: 19px; border-top: 1px solid rgba(16, 42, 67, .08);
  color: var(--es-muted); font-size: .7rem;
}
.es-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.es-status-pill.is-done { color: var(--es-green); background: var(--es-green-soft); }
.es-status-pill.is-sent { color: var(--es-amber); background: var(--es-amber-soft); }

.es-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.es-confetti span {
  position: absolute; top: -18px; width: 7px; height: 13px;
  border-radius: 2px; opacity: .7;
  animation: esConfetti 4.2s linear infinite;
}
.es-confetti span:nth-child(1) { left: 8%; background: #2079c8; animation-delay: -.5s; }
.es-confetti span:nth-child(2) { left: 21%; background: #0f766e; animation-delay: -2.6s; transform: rotate(30deg); }
.es-confetti span:nth-child(3) { left: 34%; background: #f4a261; animation-delay: -1.3s; }
.es-confetti span:nth-child(4) { left: 47%; background: #9b5de5; animation-delay: -3.6s; }
.es-confetti span:nth-child(5) { left: 61%; background: #0f8a5f; animation-delay: -.9s; }
.es-confetti span:nth-child(6) { left: 72%; background: #ef476f; animation-delay: -2s; }
.es-confetti span:nth-child(7) { left: 84%; background: #2079c8; animation-delay: -3.3s; }
.es-confetti span:nth-child(8) { left: 94%; background: #f4a261; animation-delay: -1.7s; }
@keyframes esConfetti {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  8% { opacity: .75; }
  100% { transform: translateY(450px) rotate(420deg); opacity: 0; }
}

.es-view-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .75fr);
  gap: 20px; align-items: start;
}
.es-view-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.es-view-side { display: flex; flex-direction: column; gap: 13px; min-width: 0; }

.es-panel {
  padding: 22px 23px;
  border: 1px solid var(--es-line); border-radius: 17px;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 42, 67, .025);
}
.es-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.es-panel-head h2 {
  margin: 0; font-size: 1.12rem; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.es-file-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 11px; background: var(--es-red-soft); color: #c53a2f; font-size: 1rem;
}
.es-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; margin: 18px 0 0; padding: 0;
  border: 1px solid var(--es-line); border-radius: 12px; overflow: hidden;
  background: var(--es-line);
}
.es-facts > div { padding: 12px 14px; background: #fff; }
.es-facts dt {
  color: var(--es-muted); font-size: .61rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.es-facts dd {
  display: flex; flex-direction: column; gap: 2px;
  margin: 4px 0 0; color: var(--es-ink-2); font-size: .79rem; font-weight: 650;
  overflow-wrap: anywhere;
}
.es-facts dd small { color: var(--es-muted); font-size: .68rem; font-weight: 500; }
.es-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem !important; letter-spacing: -.01em; }
.es-wrap { word-break: break-all; }
.es-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.es-audit-count { color: var(--es-muted); font-size: .68rem; font-weight: 700; }

.es-timeline { margin: 18px 0 0; padding: 0; list-style: none; }
.es-timeline li {
  position: relative; display: flex; gap: 13px;
  padding: 0 0 18px 0;
}
.es-timeline li:last-child { padding-bottom: 0; }
.es-timeline li:not(:last-child)::before {
  content: ""; position: absolute; left: 4px; top: 13px; bottom: 1px;
  width: 1px; background: var(--es-line);
}
.es-timeline-dot {
  width: 9px; height: 9px; margin-top: 4px; flex: 0 0 auto;
  border: 2px solid #fff; border-radius: 50%;
  background: var(--es-blue); box-shadow: 0 0 0 1px var(--es-blue-line);
}
.es-timeline li:last-child .es-timeline-dot { background: var(--es-green); box-shadow: 0 0 0 1px #b9e5d5; }
.es-timeline strong { display: block; color: var(--es-ink); font-size: .78rem; }
.es-timeline p { margin: 3px 0 0; color: var(--es-ink-2); font-size: .72rem; line-height: 1.45; overflow-wrap: anywhere; }
.es-timeline-meta { display: block; margin-top: 3px; color: #95a3b4; font-size: .63rem; }

.es-side-card {
  padding: 20px;
  border: 1px solid var(--es-line); border-radius: 17px;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 42, 67, .025);
}
.es-side-card-ico {
  display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 12px;
  border-radius: 11px; background: var(--es-blue-soft); color: var(--es-blue); font-size: .92rem;
}
.es-side-card-ico.is-done { background: var(--es-green-soft); color: var(--es-green); }
.es-side-card h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.es-side-card p { margin: 7px 0 0; color: var(--es-muted); font-size: .75rem; line-height: 1.52; }
.es-side-card p strong { color: var(--es-ink-2); }
.es-waiting-card { border-color: var(--es-blue-line); background: linear-gradient(165deg, #f7fbff, #fff 58%); }
.es-copy-label {
  display: block; margin-top: 14px;
  color: var(--es-muted); font-size: .61rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.es-copy-row { display: flex; gap: 6px; margin-top: 5px; }
.es-copy-row input {
  flex: 1 1 auto; min-width: 0; height: 36px; padding: 7px 9px;
  border: 1px solid var(--es-line-strong); border-radius: 8px;
  background: #fff; color: var(--es-ink-2); font: inherit; font-size: .69rem;
}
.es-copy-note { margin-top: 6px !important; font-size: .66rem !important; }
.es-mail-note {
  display: flex; gap: 6px; margin-top: 12px !important; padding: 8px 9px;
  border-radius: 8px; font-size: .68rem !important;
}
.es-mail-note.is-warn { color: var(--es-amber); background: var(--es-amber-soft); }
.es-mail-note i { margin-top: 2px; }
.es-waiting-card .es-btn-block { margin-top: 13px; }

.es-download-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 9px; padding: 9px 10px;
  border: 1px solid var(--es-line); border-radius: 10px;
  color: var(--es-ink); background: #fff;
}
.es-download-row:hover { border-color: var(--es-blue-line); background: #fbfdff; text-decoration: none; }
.es-download-row > span {
  display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto;
  border-radius: 8px; background: var(--es-soft); color: var(--es-blue); font-size: .8rem;
}
.es-download-row > div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.es-download-row strong { font-size: .72rem; }
.es-download-row small { color: var(--es-muted); font-size: .62rem; }
.es-download-row > i { color: #94a3b4; font-size: .7rem; }
.es-cert-id { margin-top: 12px !important; font-size: .64rem !important; color: #92a0b1 !important; }
.es-help-card { background: var(--es-soft); border-color: #e7eef5; }
.es-help-card h2 { font-size: .82rem; }
.es-help-card h2 i { color: var(--es-teal); margin-right: 4px; }
.es-help-card a { display: inline-block; margin-top: 10px; font-size: .72rem; font-weight: 700; color: var(--es-blue-dark); }

/* ========================================================================== */
/* Responsive                                                                 */
/* ========================================================================== */

@media (max-width: 1060px) {
  .es-hero { grid-template-columns: 1fr; gap: 34px; }
  .es-hero-copy { max-width: 760px; }
  .es-upload-card { max-width: 620px; }
  .es-view-grid { grid-template-columns: 1fr; }
  .es-view-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .es-work { grid-template-columns: minmax(0, 1fr); }
  .es-side {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; max-height: min(82vh, 760px); max-height: min(82dvh, 760px);
    z-index: 130; border-left: 0;
    border-top: 1px solid var(--es-line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px rgba(9, 24, 40, .22);
    transform: translateY(105%);
    transition: transform .24s cubic-bezier(.2, .7, .2, 1);
  }
  .es-side.is-open { transform: translateY(0); }
  .es-side-toggle { display: grid; }
  .es-workbar-center { display: none; }
  .es-canvas-hint { left: 50%; }
  .es-viewer { padding: 26px 22px 100px; }
}

@media (max-width: 820px) {
  .es-main { width: min(100% - 28px, 1180px); padding-top: 22px; }
  .es-dash { gap: 40px; }
  .es-hero h1 { font-size: clamp(2.2rem, 9vw, 3.35rem); }
  .es-lead { font-size: .97rem; }
  .es-upload-card { max-width: none; }
  .es-request-card { align-items: flex-start; flex-wrap: wrap; }
  .es-request-actions { width: 100%; padding-left: 57px; }
  .es-steps { grid-template-columns: 1fr; gap: 9px; }
  .es-steps::before { left: 25px; top: 22px; bottom: 22px; right: auto; width: 1px; height: auto;
    background: linear-gradient(180deg, transparent, var(--es-line-strong), transparent); }
  .es-steps li { display: flex; align-items: flex-start; gap: 13px; text-align: left; padding: 8px 0; }
  .es-step-ico { margin: 0; width: 44px; height: 44px; flex: 0 0 auto; }
  .es-step-num { left: 33px; top: 3px; }
  .es-steps h3 { margin-top: 2px; }
  .es-steps p { margin: 0; max-width: none; }
  .es-view-side { grid-template-columns: 1fr; }
  .es-result-hero { padding: 30px 20px; }
  .es-view-crumb { align-items: flex-start; flex-direction: column; gap: 7px; }
  .es-facts { grid-template-columns: 1fr; }
  .es-workbar { min-height: 60px; padding: 0 10px; gap: 8px; }
  .es-workbar-left { flex-basis: 0; gap: 7px; }
  .es-workbar-back span { display: none; }
  .es-workbar-back { width: 34px; justify-content: center; padding: 0; }
  .es-workbar-divider { display: none; }
  .es-doc-mark { width: 30px; height: 30px; }
  .es-doc-meta h1 { max-width: 32vw; font-size: .8rem; }
  .es-doc-meta p { display: none; }
  .es-live-dot { display: none; }
  .es-top-primary { padding: 8px 12px; }
  .es-top-primary span { display: none; }
  .es-top-primary i { font-size: .95rem; }
  .es-viewer { padding: 18px 12px 92px; }
  .es-page-wrap { margin-bottom: 18px; }
  .es-modal { padding: 10px; }
  .es-modal-box { padding: 22px 18px 0; border-radius: 16px; }
  .es-modal-foot { margin: 20px -18px 0; padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); }
  .es-modal-actions .es-btn { padding: 8px 11px; font-size: .76rem; }
  .es-check { font-size: .67rem; }
  .es-sig-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .es-main { width: min(100% - 20px, 1180px); }
  .es-hero h1 { font-size: 2.5rem; }
  .es-trust { flex-direction: column; align-items: flex-start; gap: 7px; }
  .es-upload-card { padding: 14px; border-radius: 19px; }
  .es-drop { padding: 27px 14px 20px; }
  .es-upload-head h2 { font-size: .95rem; }
  .es-request-card { padding: 12px; gap: 11px; }
  .es-request-mark { width: 36px; height: 36px; }
  .es-request-actions { padding-left: 47px; }
  .es-request-actions .es-btn { flex: 1 1 auto; padding: 8px 10px; }
  .es-request-title h3 { white-space: normal; }
  .es-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .es-result-actions { flex-direction: column; width: 100%; }
  .es-result-actions .es-btn { width: 100%; }
  .es-panel { padding: 17px; }
  .es-side-card { padding: 17px; }
  .es-panel-head { gap: 10px; }
  .es-panel-actions .es-btn { flex: 1 1 auto; }
  .es-copy-row { flex-direction: column; }
  .es-copy-row .es-btn { width: 100%; }
  .es-canvas-hint { width: max-content; max-width: calc(100vw - 24px); bottom: 92px; }
  .es-workbar-right { gap: 4px; }
  .es-icon-btn { width: 30px; height: 30px; }
  .es-sig-tabs button { font-size: .68rem; padding: 6px 4px; }
  .es-sig-tabs button i { display: none; }
  .es-modal-head h2 { font-size: 1.2rem; }
  .es-modal-foot { align-items: stretch; flex-direction: column; gap: 10px; }
  .es-modal-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .es-confetti span,
  .es-spinner,
  .es-modal-box,
  .es-toast { animation: none !important; }
  .es-side { transition: none !important; }
  .es-btn { transition: none; }
  .es-btn:hover { transform: none; }
}

/* saved signature helper */
.es-saved-sig {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 9px 11px;
  border: 1px solid var(--es-blue-line); border-radius: 10px;
  background: #f8fbff;
}
.es-saved-sig[hidden] { display: none; }
.es-saved-sig-preview { display: flex; align-items: center; gap: 10px; min-width: 0; }
.es-saved-sig-preview span { color: var(--es-muted); font-size: .64rem; font-weight: 700; }
.es-saved-sig-preview img { display: block; max-height: 33px; max-width: 160px; object-fit: contain; }
.es-btn-sm { min-height: 31px; padding: 6px 10px; font-size: .7rem; }

/* An odd number of facts should finish the row, not leave a grey empty cell. */
.es-facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 1060px) {
  .es-side::before {
    content: ""; position: absolute; top: 8px; left: 50%;
    width: 42px; height: 4px; margin-left: -21px;
    border-radius: 999px; background: #d3dee8;
  }
  .es-side-scroll { padding-top: 27px; }
}

.es-btn:focus-visible,
.es-tool:focus-visible,
.es-icon-btn:focus-visible,
.es-plain-btn:focus-visible,
.es-drop:focus-visible,
.es-modal-close:focus-visible {
  outline: 2px solid var(--es-blue);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .es-field-resize { width: 19px; height: 19px; right: -9px; bottom: -9px; }
  .es-field-delete { width: 27px; height: 27px; top: -29px; font-size: .72rem; }
  .es-field-handle { height: 24px; top: -28px; font-size: .61rem; }
}

/* ========================================================================== */
/* Left tool column — text formatting toolbar                                 */
/* ========================================================================== */

.es-format-card[hidden] { display: none; }
.es-format-card {
  border-color: var(--es-blue-line);
  background: linear-gradient(165deg, #f8fcff, #fff 65%);
}
.es-format-toolbar {
  display: flex; flex-direction: column; gap: 10px;
}
.es-fmt-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.es-fmt-group {
  display: inline-flex; align-items: center;
  border: 1px solid var(--es-line-strong); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.es-fmt-btn {
  min-width: 29px; height: 32px; padding: 0 5px;
  border: 0; border-right: 1px solid var(--es-line);
  background: transparent; color: var(--es-ink-2);
  font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer;
}
.es-fmt-btn:last-child { border-right: 0; }
.es-fmt-btn:hover { background: var(--es-soft); color: var(--es-blue-dark); }
.es-fmt-btn.is-active {
  background: var(--es-blue-soft); color: var(--es-blue-dark);
  box-shadow: inset 0 -2px 0 var(--es-blue);
}
.es-fmt-size {
  display: inline-flex; align-items: center; gap: 2px;
  height: 33px; padding: 0 7px;
  border: 1px solid var(--es-line-strong); border-radius: 8px;
  background: #fff; color: var(--es-muted);
}
.es-fmt-size input {
  width: 38px; height: 28px; padding: 0; border: 0; outline: 0;
  background: transparent; color: var(--es-ink);
  font: inherit; font-size: .78rem; font-weight: 700; text-align: right;
}
.es-fmt-size input::-webkit-inner-spin-button { opacity: .35; }
.es-fmt-size span { font-size: .64rem; font-weight: 700; }
.es-fmt-font { display: flex; flex-direction: column; gap: 4px; }
.es-fmt-font > span,
.es-fmt-colour > span {
  color: var(--es-muted); font-size: .66rem; font-weight: 700;
}
.es-fmt-font select {
  width: 100%; height: 34px; padding: 5px 29px 5px 9px;
  border: 1px solid var(--es-line-strong); border-radius: 8px;
  background: #fff; color: var(--es-ink);
  font: inherit; font-size: .76rem; cursor: pointer;
}
.es-fmt-font select:focus,
.es-fmt-size:focus-within {
  outline: none; border-color: var(--es-blue);
  box-shadow: 0 0 0 3px rgba(32, 121, 200, .11);
}
.es-fmt-colour {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
}
.es-text-swatches {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  flex: 1 1 auto;
}
.es-colour-pick {
  position: relative; display: grid; place-items: center;
  width: 33px; height: 33px; flex: 0 0 auto;
  border: 1px solid var(--es-line-strong); border-radius: 8px;
  background: #fff; color: var(--es-ink-2); cursor: pointer; overflow: hidden;
}
.es-colour-pick:hover { border-color: var(--es-blue); color: var(--es-blue-dark); }
.es-colour-pick i { font-size: .76rem; pointer-events: none; }
.es-colour-pick input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; opacity: 0; cursor: pointer;
}
.es-format-hint {
  margin: 9px 1px 0; color: var(--es-muted);
  font-size: .64rem; line-height: 1.45;
}

.es-mail-note-box {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--es-blue-line); border-radius: 12px;
  background: linear-gradient(150deg, #f5fbff, #fff);
  color: var(--es-muted);
}
.es-mail-note-box i { color: var(--es-teal); margin-top: 2px; font-size: .8rem; }
.es-mail-note-box p { margin: 0; font-size: .68rem; line-height: 1.5; }

.es-tools-panel .es-side-scroll { padding-bottom: 24px; }

/* ========================================================================== */
/* Desktop / tablet workspace layout                                          */
/* ========================================================================== */

@media (max-width: 1240px) {
  .es-work { grid-template-columns: minmax(0, 1fr); }
  .es-side {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; max-height: min(84vh, 780px); max-height: min(84dvh, 780px);
    z-index: 130;
    border: 0; border-top: 1px solid var(--es-line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px rgba(9, 24, 40, .22);
    transform: translateY(105%);
    transition: transform .24s cubic-bezier(.2, .7, .2, 1);
  }
  .es-side.is-open { transform: translateY(0); }
  .es-side::before {
    content: ""; position: absolute; top: 8px; left: 50%;
    width: 42px; height: 4px; margin-left: -21px; z-index: 1;
    border-radius: 999px; background: #d3dee8;
  }
  .es-side-scroll { padding-top: 27px; }
  .es-panel-toggle { display: grid; }
  .es-workbar-center { display: none; }
  .es-top-primary { padding: 8px 12px; }
  .es-top-primary span { display: none; }
  .es-canvas-hint { left: 50%; }
  .es-viewer { padding: 26px 22px 100px; }
}

@media (max-width: 1060px) {
  .es-side { border: 0; border-top: 1px solid var(--es-line); }
}

.es-order-card {
  padding: 16px;
  border: 1px solid var(--es-line); border-radius: 15px;
  background: #fff;
}
.es-order-card h2 { margin: 0 0 12px; font-size: .98rem; letter-spacing: -.02em; }
.es-order-list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.es-order-list li {
  position: relative; display: flex; gap: 10px;
  padding: 0 0 15px;
}
.es-order-list li:last-child { padding-bottom: 0; }
.es-order-list li:not(:last-child)::before {
  content: ""; position: absolute; left: 10px; top: 23px; bottom: 2px;
  width: 1px; background: var(--es-line);
}
.es-order-num {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 21px; height: 21px; flex: 0 0 auto; border-radius: 50%;
  background: var(--es-soft); color: var(--es-muted);
  border: 1px solid var(--es-line-strong);
  font-size: .6rem; font-weight: 800;
}
.es-order-list li.is-current .es-order-num { background: var(--es-blue); color: #fff; border-color: var(--es-blue); box-shadow: 0 0 0 3px var(--es-blue-soft); }
.es-order-list li.is-done .es-order-num { background: var(--es-green-soft); color: var(--es-green); border-color: #b9e5d5; font-size: .57rem; }
.es-order-list strong { display: block; color: var(--es-ink-2); font-size: .73rem; line-height: 1.35; }
.es-order-list small { display: block; margin-top: 2px; color: var(--es-muted); font-size: .64rem; line-height: 1.45; }

.es-panel-toggle[aria-expanded="true"] {
  background: var(--es-blue-soft);
  color: var(--es-blue-dark);
  box-shadow: inset 0 0 0 1px var(--es-blue-line);
}

/* ========================================================================== */
/* Floating text toolbar — the editor's floatbar idea, on the sheet           */
/* ========================================================================== */

.es-text-floatbar {
  position: fixed; left: 50%; top: 82px; z-index: 125;
  display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 20px);
  padding: 5px;
  border: 1px solid var(--es-line-strong); border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(9, 24, 40, .2);
  transform: translateX(-50%);
  overflow-x: auto; overflow-y: hidden;
  touch-action: manipulation;
}
.es-text-floatbar[hidden] { display: none !important; }
.es-text-floatbar::-webkit-scrollbar { height: 4px; }
.es-text-floatbar::-webkit-scrollbar-thumb { background: #d6e0e8; border-radius: 4px; }

.es-fb-group {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  border: 1px solid var(--es-line); border-radius: 7px; overflow: hidden;
}
.es-fb-btn {
  width: 29px; height: 29px; padding: 0;
  border: 0; border-right: 1px solid var(--es-line);
  background: #fff; color: var(--es-ink-2);
  font: inherit; font-size: .76rem; font-weight: 650; cursor: pointer;
  display: grid; place-items: center;
}
.es-fb-btn:last-child { border-right: 0; }
.es-fb-btn:hover { background: var(--es-soft); color: var(--es-blue-dark); }
.es-fb-btn.is-active {
  background: var(--es-blue-soft); color: var(--es-blue-dark);
  box-shadow: inset 0 -2px 0 var(--es-blue);
}
.es-fb-size {
  display: inline-flex; align-items: center; gap: 1px; flex: 0 0 auto;
  height: 31px; padding: 0 6px;
  border: 1px solid var(--es-line); border-radius: 7px; background: #fff;
  color: var(--es-muted);
}
.es-fb-size input {
  width: 34px; height: 25px; padding: 0; border: 0; outline: 0;
  background: transparent; color: var(--es-ink);
  font: inherit; font-size: .74rem; font-weight: 700; text-align: right;
}
.es-fb-size span { font-size: .59rem; font-weight: 700; }
.es-fb-font {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  height: 31px; padding: 0 7px;
  border: 1px solid var(--es-line); border-radius: 7px; background: #fff;
}
.es-fb-font > span { color: var(--es-muted); font-size: .6rem; font-weight: 700; }
.es-fb-font select {
  width: 158px; height: 25px; padding: 0 4px;
  border: 0; outline: 0; background: transparent; color: var(--es-ink);
  font: inherit; font-size: .72rem; cursor: pointer;
}
.es-fb-colour {
  position: relative; display: grid; place-items: center; flex: 0 0 auto;
  width: 31px; height: 31px; overflow: hidden;
  border: 1px solid var(--es-line); border-radius: 7px;
  background: #fff; cursor: pointer;
}
.es-fb-colour input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; opacity: 0; cursor: pointer;
}
.es-fb-colour #es-fb-colour-swatch {
  width: 17px; height: 17px; border-radius: 50%;
  background: #111827; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
  pointer-events: none;
}
.es-fb-delete { border: 1px solid var(--es-line); border-radius: 7px; color: var(--es-red); }
.es-fb-delete:hover { background: var(--es-red-soft); color: var(--es-red); }

/* Side drawers on tablet / phone — left tools and right delivery, never a
   bottom sheet. The same two columns as the desktop layout, sliding in from
   their own edges. */
@media (max-width: 1240px) {
  .es-side {
    position: fixed; top: 66px; bottom: 0; left: auto; right: auto;
    width: min(360px, 86vw); height: auto; max-height: none;
    border: 0; border-radius: 0;
    transition: transform .24s cubic-bezier(.2, .7, .2, 1);
    box-shadow: 0 0 50px rgba(9, 24, 40, .24);
  }
  .es-tools-panel {
    left: 0; right: auto; transform: translateX(-104%);
    border-right: 1px solid var(--es-line);
    border-radius: 0 18px 18px 0;
  }
  .es-mail-panel {
    right: 0; left: auto; transform: translateX(104%);
    border-left: 1px solid var(--es-line);
    border-radius: 18px 0 0 18px;
  }
  .es-side.is-open { transform: translateX(0); }
  .es-side::before { display: none; }
  .es-side-scroll { padding-top: 18px; }
  .es-panel-mobilebar {
    display: flex; align-items: center; justify-content: space-between;
    flex: 0 0 auto; padding: 12px 14px 10px;
    border-bottom: 1px solid var(--es-line);
    background: #fff;
  }
  .es-panel-mobilebar > span {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--es-ink); font-size: .82rem; font-weight: 800;
  }
  .es-panel-mobilebar > span i { color: var(--es-blue); font-size: .75rem; }
  .es-panel-close {
    display: grid; place-items: center; width: 30px; height: 30px;
    border: 0; border-radius: 8px; background: var(--es-soft);
    color: var(--es-muted); font-size: 1.15rem; line-height: 1; cursor: pointer;
  }
  .es-panel-close:hover { background: var(--es-red-soft); color: var(--es-red); }
  .es-panel-scrim {
    position: fixed; top: 66px; right: 0; bottom: 0; left: 0;
    z-index: 132; background: rgba(9, 24, 40, .32);
    -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  }
  .es-panel-scrim[hidden] { display: none !important; }
  .es-text-floatbar {
    left: 12px; right: 12px; top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: none; transform: none;
    justify-content: flex-start;
    padding: 6px;
  }
  .es-fb-font select { width: 138px; }
}

.es-panel-mobilebar { display: none; }

@media (max-width: 820px) {
  .es-side { top: 60px; }
  .es-panel-scrim { top: 60px; }
}

@media (max-width: 1240px) {
  .es-panel-mobilebar { display: flex; }
  .es-side { z-index: 140; }
}

.es-fb-break { display: none; }

@media (max-width: 1240px) {
  .es-text-floatbar {
    flex-wrap: wrap; overflow-x: visible;
    row-gap: 5px;
  }
  .es-fb-group, .es-fb-size, .es-fb-colour, .es-fb-font,
  .es-fb-delete { order: 0; }
  .es-fb-style { order: 1; }
  .es-fb-size { order: 2; }
  .es-fb-colour { order: 3; }
  .es-fb-break { display: block; order: 4; flex: 0 0 100%; height: 0; }
  .es-fb-font { order: 5; flex: 0 0 auto; }
  .es-fb-align { order: 6; }
  .es-fb-delete { order: 7; }
}

/* The floatbar follows the selected text box on phones too. Its two-row
   layout wraps to the available width, then JS positions it above/below the
   box, clamped inside the visual viewport. */
@media (max-width: 1240px) {
  .es-text-floatbar {
    left: auto; right: auto; top: auto; bottom: auto;
    width: max-content;
    max-width: calc(100vw - 16px);
    transform: none;
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 5px;
  }
}

.es-email-retry { margin-top: 12px; }

/* Keep touch selection/tap highlight off the sheet: on Android it paints a
   pale overlay over the signature exactly while the resize handle is held,
   which can make black ink look white for that moment. */
.es-field,
.es-field-signature-img,
.es-page,
#es-sig-canvas {
  -webkit-tap-highlight-color: transparent;
}
.es-field.is-signature,
.es-field.is-signature.is-selected {
  background: transparent;
}
.es-field-signature-img {
  background: transparent;
  filter: none !important;
  -webkit-user-drag: none;
  user-select: none;
}

/* ========================================================================== */
/* Guided recipient fields                                                    */
/* ========================================================================== */

.es-assignee {
  display: flex; gap: 4px; padding: 4px;
  margin: 0 0 10px; border: 1px solid var(--es-line); border-radius: 10px;
  background: var(--es-soft);
}
.es-assignee button {
  flex: 1 1 0; min-height: 32px; padding: 6px 7px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--es-muted); font: inherit; font-size: .7rem; font-weight: 700;
  cursor: pointer;
}
.es-assignee button i { margin-right: 4px; font-size: .68rem; }
.es-assignee button.is-active {
  background: #fff; color: var(--es-blue-dark);
  box-shadow: 0 1px 4px rgba(16, 42, 67, .1);
}
.es-assignee-hint {
  margin: -2px 1px 12px; color: var(--es-muted);
  font-size: .65rem; line-height: 1.45;
}
.es-required-chip {
  padding: 3px 7px; border-radius: 999px;
  background: var(--es-amber-soft); color: var(--es-amber);
  font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.es-recipient-settings { border-color: #f0dcb8; background: linear-gradient(165deg, #fffdf7, #fff 65%); }
.es-recipient-settings[hidden] { display: none; }

.es-field.is-recipient { border-color: rgba(183, 110, 10, .32); }
.es-field.is-recipient.is-selected { border-color: var(--es-amber); background: rgba(183, 110, 10, .06); box-shadow: 0 0 0 3px rgba(183, 110, 10, .08); }
.es-field.is-recipient .es-field-handle { background: var(--es-amber); }
.es-field-placeholder {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; height: 100%; padding: 1px 4px;
  border: 1px dashed rgba(183, 110, 10, .65); border-radius: 3px;
  background: rgba(255, 248, 233, .72);
  color: #9a670b; text-align: center;
  font-size: .58rem; font-weight: 800; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.es-field-placeholder i { font-size: .62rem; flex: 0 0 auto; }
.es-field.is-recipient .es-field-text { pointer-events: none; }

/* Sender-side field lock */
.es-field-lock {
  position: absolute; top: -26px; right: 29px;
  display: none; place-items: center;
  width: 23px; height: 23px; padding: 0;
  border: 0; border-radius: 50%;
  background: #fff; color: var(--es-muted);
  box-shadow: 0 3px 10px rgba(16, 42, 67, .18);
  cursor: pointer; font-size: .62rem;
}
.es-field.is-selected .es-field-lock { display: grid; }
.es-field-lock:hover { color: var(--es-blue-dark); background: var(--es-blue-soft); }
.es-field.is-locked .es-field-lock { color: var(--es-amber); background: var(--es-amber-soft); }
.es-field.is-locked { cursor: default; }
.es-field.is-locked .es-field-resize { display: none !important; }
.es-field.is-locked .es-field-handle { cursor: default; }

/* Recipient checklist */
.es-checklist { display: flex; flex-direction: column; gap: 5px; }
.es-check-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 9px; border: 1px solid var(--es-line); border-radius: 8px;
  background: #fff; color: var(--es-ink-2); text-align: left;
  font: inherit; font-size: .7rem; cursor: pointer;
}
.es-check-item:hover { border-color: var(--es-blue-line); background: #fbfdff; }
.es-check-item > i:first-child { width: 16px; color: var(--es-amber); font-size: .68rem; text-align: center; }
.es-check-item span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-check-item small { color: var(--es-amber); font-size: .59rem; font-weight: 800; }
.es-check-item.is-done { border-color: #cce9de; background: #fbfffd; }
.es-check-item.is-done > i:first-child { color: var(--es-green); }
.es-check-item.is-done small { color: var(--es-green); }
.es-check-item.is-done span { text-decoration: line-through; text-decoration-color: #cce9de; }

/* Sign mode has no tools column: centre + recipient checklist only. */
@media (min-width: 1241px) {
  .es-mode-sign .es-work { grid-template-columns: minmax(0, 1fr) 368px; }
}
.es-mode-sign .es-tools-panel { display: none; }

.es-field.is-locked .es-field-delete { display: none !important; }
.es-field.is-locked .es-field-lock { display: grid; }

/* Guided signing: the recipient's boxes are buttons, not draggable fields. */
.es-field.is-guided { cursor: pointer; }
.es-field.is-guided:hover { border-color: var(--es-amber); background: rgba(255, 248, 233, .45); }
.es-field.is-guided.is-filled:hover { border-color: var(--es-blue); background: transparent; }
.es-field.is-guided .es-field-body { cursor: pointer; }
.es-placed-item.is-recipient { background: #fffaf0; border-color: #f3e5c8; }
.es-placed-item.is-recipient > i { color: var(--es-amber); }
.es-placed-lock { width: auto !important; color: var(--es-amber) !important; font-size: .58rem !important; }
.es-mode-sign .es-canvas-col { grid-column: auto; }

/* The instruction floats above a guided box, so a long sender instruction is
   never clipped by a small field on a phone. */
.es-guided-label {
  position: absolute; left: 0; bottom: calc(100% + 4px);
  z-index: 2; max-width: min(240px, 68vw);
  padding: 3px 6px;
  border: 1px solid #f0dcb8; border-radius: 4px;
  background: #fff8e9; color: #9a670b;
  font-size: .58rem; font-weight: 700; line-height: 1.3;
  white-space: normal; overflow-wrap: anywhere;
  box-shadow: 0 2px 6px rgba(16, 42, 67, .08);
  pointer-events: none;
}
.es-field-placeholder-compact { border: 0; background: transparent; }

.es-field.is-guided.is-filled { border-color: rgba(11, 122, 88, .32); }

/* Recipient adjustment handles: move and resize the assigned box only. */
.es-guided-move {
  position: absolute; left: 0; bottom: calc(100% + 3px); z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  height: 19px; padding: 0 6px;
  border-radius: 5px 5px 0 0;
  background: var(--es-amber); color: #fff;
  font-size: .55rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; cursor: move; touch-action: none;
  opacity: .9;
}
.es-guided-move i { font-size: .52rem; }
.es-guided-resize {
  position: absolute; right: -7px; bottom: -7px; z-index: 3;
  width: 16px; height: 16px;
  border: 2px solid #fff; border-radius: 50%;
  background: var(--es-amber);
  box-shadow: 0 2px 8px rgba(16, 42, 67, .2);
  cursor: nwse-resize; touch-action: none;
}
.es-field.is-guided:hover .es-guided-move,
.es-field.is-guided:hover .es-guided-resize { opacity: 1; }

@media (max-width: 820px) {
  .es-guided-move { height: 23px; font-size: .58rem; }
  .es-guided-resize { width: 20px; height: 20px; right: -9px; bottom: -9px; }
}

/* ---------------------------------------------------------- the contract desk
   Client: "pending contract, draft, reciver info desk a to z full info,
   signed date, agreement expire … clear ui for reciver data". The dashboard
   groups contracts (drafts, pending, rejected/expired, completed) and every
   card carries the receiver block, both signing dates and the expiry. */
.es-desk-group { margin: 0 0 22px; }
.es-desk-heading {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 10px; font-size: 13px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: #5d6f83;
}
.es-desk-heading i { color: #8296a9; }
.es-desk-heading span {
  background: #eef3f8; border: 1px solid #e2eaf3; color: #51637a;
  border-radius: 999px; padding: 1px 9px; font-size: 11px;
}
.es-desk-card { display: block; padding: 16px 18px; }
.es-desk-top { display: flex; align-items: flex-start; gap: 12px; }
.es-desk-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 22px; margin: 12px 0 4px; padding: 12px 0 0;
  border-top: 1px dashed #e6edf6;
}
.es-desk-facts > div { min-width: 0; }
.es-desk-facts dt {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #93a1b1; margin: 0 0 2px;
}
.es-desk-facts dd {
  margin: 0; font-size: 13px; color: #2f3f52; overflow-wrap: anywhere;
}
.es-desk-reason {
  margin: 10px 0 0; padding: 9px 12px; border-radius: 9px;
  background: #fdf1f1; border: 1px solid #f3cdcd; color: #8f3b3b;
  font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start;
}
.es-live-pill-draft { background: #eef3f8; color: #51637a; }
.es-live-pill-sent { background: #e9f4ff; color: #1f6fb2; }
.es-live-pill-expired { background: #fff4e0; color: #a06a12; }
.es-live-pill-rejected { background: #fdeaea; color: #b04141; }
.es-live-pill-completed { background: #eaf7f0; color: #1e6b3f; }
.es-btn-danger { color: #b04141; border-color: #f3cdcd; background: #fff; }
.es-btn-danger:hover { background: #fdf1f1; border-color: #e5a7a7; }

.es-desk-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 35, 60, .45); padding: 20px;
}
.es-desk-modal[hidden] { display: none; }
.es-desk-modal-box {
  width: min(460px, 100%); background: #fff; border-radius: 16px;
  padding: 20px 22px 18px; box-shadow: 0 26px 60px rgba(15, 35, 60, .3);
}
.es-desk-modal-box h3 { margin: 0 0 6px; font-size: 17px; color: #1d2b3a; }
.es-desk-modal-note { margin: 0 0 12px; font-size: 13px; color: #5d6f83; }
.es-desk-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.es-draft-row {
  display: flex; align-items: center; gap: 12px; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed #e6edf6;
}
.es-draft-note { margin: 0; font-size: 12px; color: #8296a9; }

.es-desk-alert {
  margin: 0 0 14px; padding: 12px 16px; border-radius: 12px;
  background: #f4f7fb; border: 1px solid #e2eaf3; color: #3c4d61;
  display: flex; flex-direction: column; gap: 4px; font-size: 13.5px;
}
.es-desk-alert.is-error { background: #fdf1f1; border-color: #f3cdcd; color: #8f3b3b; }
.es-desk-alert.is-warn { background: #fff8ec; border-color: #f0dcb4; color: #8a6413; }
