/* Documents to sign — the customer page (/sign) and the staff pages (#/documents, client card). */
.sg-doc { background: var(--surface); }
.sg-public .sg-doc { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); }
.sg-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); max-height: 60vh; overflow: auto; margin: 12px 0; overflow-wrap: anywhere; }
.sg-signed { margin-top: 16px; break-inside: avoid; }
.sg-sigs { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.sg-sigs figure { margin: 0; }
.sg-sigs figcaption { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.sg-sig { display: block; width: 100%; max-width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.sg-ini { display: block; width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.sg-cert { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; color: var(--ink-2); break-inside: avoid; }
.sg-cert h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.sg-cert dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 8px; }
.sg-cert dt { font-weight: 700; }
.sg-cert dd { margin: 0; min-width: 0; }
.sg-hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.sg-events { margin: 0 0 8px; padding-left: 20px; }
.sg-small { font-size: 12px; color: var(--ink-3); margin: 0; }
.sg-box { margin-top: 14px; }
.sg-consent { display: flex; align-items: flex-start; gap: 10px; border-radius: 10px; padding: 10px 12px; height: auto; min-height: var(--tap); font-weight: 600; line-height: 1.4; margin: 10px 0 14px; white-space: normal; }
.sg-consent input { width: 22px; height: 22px; min-height: 0; flex: none; margin-top: 1px; }
.sg-sighead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sg-sighead label { margin: 0; }
.sg-sighead .spacer { flex: 1; }
.sg-inipad { max-width: 240px; aspect-ratio: 2 / 1; }
.sg-typed { font: italic 40px "Segoe Script", "Brush Script MT", "Snell Roundhand", "Apple Chancery", cursive; color: #0f172a; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 22px 18px; max-width: 600px; overflow-wrap: anywhere; }
.sg-hand { text-align: center; max-width: 520px; margin: 8vh auto 0; padding: 28px 20px; }
.sg-hand h1 { font-size: 24px; margin: 8px 0; }
.sg-hand-logo { max-height: 64px; max-width: 220px; }
.sg-hand .btn { margin-top: 14px; }
.sg-back { text-align: center; margin-bottom: 14px; }
.sg-back h2 { margin-top: 0; }
.sg-missing { max-width: 560px; margin: 10vh auto 0; }

/* staff pages */
.dg-row .main small { display: block; }
.dg-tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dg-tpl .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.dg-tpl .card p { margin: 0; color: var(--ink-3); font-size: 14px; flex: 1; }
.dg-pick { display: grid; gap: 8px; }
.dg-pick button { justify-content: flex-start; text-align: left; white-space: normal; height: auto; padding: 10px 14px; }
.dg-pick button small { display: block; font-weight: 400; color: var(--ink-3); }
.dg-blanks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.dg-timeline { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.dg-preview .sg-text { max-height: 40vh; }

@media (max-width: 640px) {
  .sg-text { font-size: 15px; max-height: 55vh; padding: 12px; }
  .sg-typed { font-size: 32px; }
}
@media print {
  .sg-text { max-height: none; overflow: visible; border: 0; padding: 0; background: none; }
  .sg-public .sg-doc { border: 0; box-shadow: none; padding: 0; }
}
