/* Oddsprig E-Signature — tool-specific layout on top of css/theme.css.
   Script fonts: SIL OFL 1.1, self-hosted in ../fonts. */
@font-face { font-family: "Dancing Script"; font-display: swap; src: url("../fonts/dancing-script-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Great Vibes"; font-display: swap; src: url("../fonts/great-vibes-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Sacramento"; font-display: swap; src: url("../fonts/sacramento-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-display: swap; src: url("../fonts/caveat-latin-400-normal.woff2") format("woff2"); }

body.es-tool main { max-width: var(--es-content); margin: 0 auto; padding: 20px var(--es-gutter) 32px; }
.es-side { display: grid; gap: 16px; min-width: 0; }
.es-side .es-panel h3 { margin-top: 12px; }
@media (min-width: 851px) {
  .es-workspace.es-sign-workspace { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
  .es-viewer-panel { position: sticky; top: 12px; }
}
.es-add-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
#es-initials-all { width: 100%; }
.es-field { display: grid; gap: 4px; margin-top: 10px; }
.es-field input, .es-field select { width: 100%; }
.es-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 14px; line-height: 1.4; }
.es-check input { min-height: 0 !important; width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--es-lime); }
.es-props { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--es-line); }
.es-props-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 10px; }
.es-props-row .es-field { flex: 1 1 120px; margin: 0; }
.es-download { width: 100%; margin-top: 14px; }
.es-hash { margin-top: 8px; font-size: 12.5px; color: var(--es-muted); overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.es-muted { color: var(--es-muted); font-size: 14px; }
.es-notice { padding: 12px; border: 1px solid var(--es-line); border-radius: var(--es-radius-sm); }
.es-legal-short { font-size: 13px; }

.es-saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.es-saved-list li { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--es-line); border-radius: var(--es-radius-sm); background: #fff; }
.es-saved-list img { flex: 1; min-width: 0; height: 40px; object-fit: contain; }
.es-saved-list button { min-height: 36px; padding: 4px 10px; font-size: 13px; }

.es-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.es-viewer-bar h2 { margin: 0; }
.es-zoom { display: flex; align-items: center; gap: 6px; }
.es-zoom button { min-width: 44px; }
#es-zoom-label { min-width: 3.5em; text-align: center; font-variant-numeric: tabular-nums; }
.es-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 14px; min-height: 340px; max-height: calc(100vh - 110px); overflow: auto; border-radius: var(--es-radius-sm); background: var(--es-check-b); overscroll-behavior: contain; }
.es-viewer-empty { margin: auto; color: var(--es-muted); text-align: center; max-width: 34ch; }
.es-page { position: relative; flex: none; background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / 0.35); }
.es-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.es-page-label { position: absolute; left: 0; top: -16px; font-size: 11px; color: var(--es-muted); }
.es-layer { position: absolute; inset: 0; }

.es-field-box { position: absolute; display: flex; align-items: center; justify-content: flex-start; border: 1px dashed rgb(37 99 88 / 0.65); background: rgb(200 230 160 / 0.12); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.es-field-box img { width: 100%; height: 100%; object-fit: fill; pointer-events: none; max-width: none; }
.es-field-box .es-field-text { white-space: pre; overflow: hidden; line-height: 1; font-family: Helvetica, Arial, "Liberation Sans", sans-serif; pointer-events: none; padding-left: 0; }
.es-field-box svg { width: 100%; height: 100%; pointer-events: none; }
.es-field-box.is-selected, .es-field-box:focus-visible { border: 2px solid #9a5018; background: rgb(229 206 142 / 0.2); }
.es-field-box.is-dragging { cursor: grabbing; opacity: 0.85; }
.es-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #9a5018; border: 2px solid #fff; cursor: nwse-resize; touch-action: none; display: none; }
.es-remove { position: absolute; right: -11px; top: -11px; width: 22px; height: 22px; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; font-size: 13px; line-height: 1; display: none; background: #8a3410 !important; color: #fff !important; border: 2px solid #fff !important; }
.es-field-box.is-selected .es-handle, .es-field-box.is-selected .es-remove { display: block; }
@media (pointer: coarse) { .es-handle { width: 28px; height: 28px; right: -14px; bottom: -14px; } .es-remove { width: 30px; height: 30px; right: -15px; top: -15px; } }

.es-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--es-line); border-radius: var(--es-radius); background: var(--es-panel); color: var(--es-ink); }
.es-dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.es-dialog-inner { padding: 18px; }
.es-dialog h2 { margin: 0 0 12px; color: var(--es-gold); font-size: 1.2rem; }
.es-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.es-tabs [aria-selected="true"] { background: var(--es-lime); color: var(--es-accent-ink); border-color: var(--es-lime); font-weight: 700; }
.es-draw-pad { display: block; width: 100%; aspect-ratio: 3 / 1; height: auto; background: #fff; border: 1px solid var(--es-line); border-radius: var(--es-radius-sm); touch-action: none; cursor: crosshair; background-image: linear-gradient(transparent calc(75% - 1px), #c9d3cf calc(75% - 1px), #c9d3cf 75%, transparent 75%); }
.es-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; border: 0; }
.es-fonts label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--es-line); border-radius: var(--es-radius-sm); background: #fff; color: #111; cursor: pointer; }
.es-fonts label:has(input:checked) { outline: 3px solid var(--es-lime); }
.es-fonts input { min-height: 0 !important; accent-color: #256358; }
.es-font-sample { font-size: 30px; line-height: 1.2; overflow: hidden; white-space: nowrap; }
.es-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.es-dialog-error { color: var(--es-danger); margin-top: 8px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { .es-field-box { transition: none; } }
@media print { .es-side, .es-viewer-bar, .es-guide, header, footer { display: none !important; } }
.es-hash { white-space: pre-line; }
/* Phones: show the document right after "Open", then the tools. */
@media (max-width: 850px) {
  .es-side { display: contents; }
  .es-side > section { order: 3; }
  .es-side > section:first-child { order: 1; }
  .es-viewer-panel { order: 2; }
  .es-pages { max-height: 75vh; padding: 8px; }
}
.es-license-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.es-license-table th, .es-license-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--es-line); }

/* typed-signature font samples (moved out of inline style attributes so the CSP can drop 'unsafe-inline') */
.es-font-dancing { font-family: 'Dancing Script'; }
.es-font-vibes { font-family: 'Great Vibes'; }
.es-font-sacramento { font-family: 'Sacramento'; }
.es-font-caveat { font-family: 'Caveat'; }
