body.signing { background: var(--wash); }
.signing header.top { background: var(--paper); }
.secure { color: var(--muted); font-size: 13.5px; }
/* 🌐 English / Español, as on the new client form */
.sg-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sg-lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.sg-lang button { font: inherit; font-size: 14px; padding: 0 12px; min-height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.sg-lang button.on { background: var(--blue-fill); color: #fff; font-weight: 600; }
@media (max-width: 820px) { .secure { display: none; } .sg-right { flex: none; } }   /* (the switch, not the note, where there's room for one — whole:
   the firm's name beside the logo shortens instead, as on the new client form) */
.signing header.top .wrap { gap: 12px; }
.sign-main { max-width: 980px; padding-top: 24px; padding-bottom: 60px; }
.sg-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin: 0 auto 18px; max-width: 680px; }
.sg-card h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
.sg-card .from { color: var(--muted); margin: 0 0 14px; }
.sg-card .msg { white-space: pre-wrap; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.disclosure { font-size: 14px; color: var(--muted); background: var(--wash); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.disclosure p { margin: 0 0 8px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.btn { font: inherit; font-size: 15.5px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--blue-fill); border-color: var(--blue-fill); color: #fff; font-weight: 600; }
.btn.primary:disabled { opacity: 0.45; cursor: default; }
.btn.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 9px 6px; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.bar .grow { flex: 1; }
#todo { color: var(--muted); font-size: 15px; }
#pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sg-loading { color: var(--muted); margin: 40px 0; }
.pg { position: relative; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); max-width: 100%; }
.pg canvas { display: block; width: 100%; height: auto; }
/* 📄 a page the sender added to read first — above the papers, not one of them */
.sg-first { background: #eaf6f0; border: 2px solid #2f9e6a; border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; box-sizing: border-box; }
.sg-first-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; width: 100%; padding: 6px 8px 0; box-sizing: border-box; }
.sg-first-h { font-size: 19px; color: #1f6b4f; }
.sg-first-note { margin: 2px 0 0; color: #3d5a4e; font-size: 14.5px; }
.sg-first-save { text-decoration: none; flex: none; }
.sg-papers { font-size: 19px; margin: 18px 0 0; align-self: stretch; text-align: center; color: var(--ink); }
.fld { position: absolute; border: 2px dashed #e0a100; background: rgba(255, 210, 31, 0.28); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #6b4d00; overflow: hidden; }
.fld.done { border: 1px solid rgba(var(--blue-rgb, 43,100,222),.35); background: rgba(var(--blue-rgb, 43,100,222),.06); color: #16202e; }
.fld.done img { max-width: 100%; max-height: 100%; }
.fld input { width: 100%; height: 100%; border: 0; background: transparent; font: inherit; font-weight: 500; color: #16202e; padding: 0 4px; }
.fld.focus { outline: 3px solid var(--blue); outline-offset: 2px; }
.fld.other { border: 1px dotted #b3bac6; background: none; color: #8a93a2; cursor: default; font-weight: 500; font-size: 10px; justify-content: flex-start; padding-left: 3px; white-space: nowrap; }   /* (someone else's: small and grey, not one to fill) */
/* ✍️ this signer's own boxes: each the size and in the place of the mark it gets — an outline and a see-through fill,
   so the papers' words show through it
   (the dashed line just outside the box, so it never crosses the mark — a date's box is only a few pixels tall) */
.fld.mark { z-index: 2; border: 0; border-radius: 0; outline: 1px dashed #c48a00; outline-offset: 0;
  background: rgba(255, 210, 31, 0.22); color: rgba(107, 77, 0, .75); font-weight: 500; white-space: nowrap;
  overflow: visible; line-height: 1; }
.fld.mark.done { border: 0; outline: 1px solid rgba(var(--blue-rgb, 43,100,222), .35);
  background: rgba(var(--blue-rgb, 43,100,222), .06); }
.fld.mark > svg, .fld.mark > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none;
  max-height: none; overflow: visible; }
.fld.mark svg text, .fld-stamp svg text { font-family: Helvetica, Arial, sans-serif; }
.fld.mark svg text { fill: rgba(154, 122, 28, .7); }
.fld.mark.done svg text { fill: #17243f; }
.fld.mark.focus { outline: 2px solid var(--blue); outline-offset: 2px; }
/* (the date and time written under a signature or initials, where and as big as it's written: faint till it's
   filled) */
.fld-stamp { position: absolute; z-index: 2; pointer-events: none; opacity: .5; }
.fld-stamp.done { opacity: 1; }
/* (before it's signed: a dotted place for the date and time, its words — never a time) */
.fld-stamp:not(.done) { border: 1px dotted rgb(89, 97, 115); box-sizing: border-box; display: flex; align-items: center;
  overflow: hidden; white-space: nowrap; font-family: Helvetica, Arial, sans-serif; font-style: italic; line-height: 1;
  color: rgb(89, 97, 115); }
/* (🔐 asked at signing, before the code: the papers to read, every box greyed and still; nothing to press below) */
.sg-locked .fld, .sg-locked .fld-hit, .sg-locked .fld-stamp {
  pointer-events: none; filter: grayscale(1); opacity: .45;
}
.sg-locked #bar, .sg-locked #guide { display: none !important; }
.fld-stamp svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.fld-stamp svg text { fill: rgb(89, 97, 115); }
/* 👆 a fingertip's room round a small box: nothing seen, under the boxes */
.fld-hit { position: absolute; z-index: 1; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.fld-hit[hidden] { display: none; }
.sg-modal { position: fixed; inset: 0; background: rgba(10, 14, 22, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.sg-modal[hidden] { display: none; }
.sg-box { background: var(--paper); border-radius: 16px; padding: 22px; width: 560px; max-width: 100%; }
.sg-box h2 { margin: 0 0 12px; font-size: 21px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { font: inherit; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--blue-fill); border-color: var(--blue-fill); color: #fff; }
#pad-canvas { width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
#pad-name { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.typed { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 42px; color: #16233f; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; padding: 8px 16px; min-height: 76px; white-space: nowrap; overflow: hidden; }
.fine { font-size: 13px; color: var(--muted); }
.done-mark { font-size: 42px; }
@media (max-width: 560px) { .secure { display: none; } .sg-card { padding: 18px; } }

.datepop { color-scheme: light; position: absolute; z-index: 20; background: #fff; color: #16202e; border: 1px solid #c9d2e0; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.25); padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 210px; }
.datepop .dp-head { font-size: 14px; }
.datepop .dp-or { display: flex; align-items: center; gap: 6px; color: #5b6575; }
.datepop .dp-in { font: inherit; padding: 4px 6px; border: 1px solid #c9d2e0; border-radius: 6px; }

.sg-dialog { max-width: 440px; width: 100%; }
.sg-dialog .sg-dmsg { margin: 0 0 12px; white-space: pre-line; line-height: 1.45; }
.sg-dialog .sg-din { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; resize: vertical; background: var(--paper); color: var(--ink); }

/* (Marc: Finish where a phone's thumb is — a bar fixed at the bottom, with how many are done; the steps said at the top) */
.guide { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; font-size: 15.5px; line-height: 1.5; }
.guide-box { background: rgba(255, 210, 31, 0.22); border: 1px dashed #c48a00; border-radius: 2px; padding: 0 5px; }
#doc { padding-bottom: 96px; }
.bar { position: fixed; top: auto; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; border-width: 1px 0 0; padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); box-shadow: 0 -4px 18px rgba(0,0,0,.12); z-index: 15; }
.bar-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#todo { color: var(--ink); font-weight: 600; font-size: 15px; }
.prog { display: block; height: 6px; border-radius: 3px; background: var(--wash); overflow: hidden; max-width: 320px; }
#prog-in { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.bar.ready { border-top: 3px solid #1f9d55; }
.bar.ready #prog-in { background: #1f9d55; }
.bar #finish { font-size: 17px; padding: 11px 26px; }
.bar:not(.ready) #finish { background: var(--paper); color: var(--muted); border-color: var(--line); font-weight: 500; }
.bar.ready #finish { animation: sg-pulse 1.6s ease-in-out 3; }
@keyframes sg-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--blue-rgb, 43,100,222),.5); } 50% { box-shadow: 0 0 0 8px rgba(var(--blue-rgb, 43,100,222),0); } }
.sg-toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(10px); background: #16202e; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: calc(100vw - 32px); box-shadow: 0 6px 22px rgba(0,0,0,.3); opacity: 0; transition: opacity .25s, transform .25s; z-index: 18; text-align: center; }
.sg-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 560px) { .bar { gap: 8px; } .bar #next { padding: 9px 12px; font-size: 14.5px; } .bar #finish { padding: 10px 18px; } }
@media (prefers-color-scheme: dark) {
  .sg-first { background: #12291f; border-color: #3fae7a; }
  .sg-first-h { color: #8fe0b5; }
  .sg-first-note { color: #b9d8c8; }
}
.sg-preview { position: sticky; top: 0; z-index: 20; background: #fff6dc; color: #6b4d00; text-align: center; font-size: 14px; font-weight: 600; padding: 7px 12px; border-bottom: 1px solid #f0d58a; }
@media (prefers-color-scheme: dark) { .sg-preview { background: #3a2f10; color: #f5dc9a; border-color: #5a4a1a; } }

/* (Next field ↓ is the thing to press until every box is done — then Finish) */
.bar:not(.ready) #next { background: var(--blue-fill); border-color: var(--blue-fill); color: #fff; font-weight: 600; }
/* ☎ the firm's number, a tap calls it */
.sg-call { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
.sg-tel { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 12px 0; margin: -12px 0; }
.sg-dextra .sg-call { margin: 0 0 12px; }
/* a last screen: centered, its title, what happens next — as the new client form's and mileage's */
#status.sg-fin { text-align: center; padding: 30px 22px 24px; }
#status.sg-fin .done-mark { font-size: 46px; }
#status.sg-fin h1 { font-size: 26px; line-height: 1.25; margin: 6px 0 10px; letter-spacing: -0.01em; }
#status.sg-fin p { margin: 0 0 10px; }
.sg-close { color: var(--muted); font-size: 15px; }
/* the code: its box and button apart, both fingertip-sized */
.sg-coderow { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin: 0 0 12px; }
#code-in { font: inherit; font-size: 20px; letter-spacing: 3px; width: 190px; min-height: 48px; padding: 8px 12px; border: 1px solid #c3cad6; border-radius: 10px; background: var(--paper); color: var(--ink); }
.sg-coderow .btn { min-height: 48px; }
.sg-tap, #show-disclosure { display: inline-block; padding: 12px 0; margin: -12px 0; }
/* the signature pad: a line to sign on, and what to do, until the first stroke */
.pad-wrap { position: relative; }
.pad-hint { position: absolute; left: 22px; right: 22px; bottom: 34px; border-bottom: 2px solid #c3cad6; color: #8a93a2; font-size: 15px; padding: 0 0 6px; pointer-events: none; }
.pad-hint[hidden] { display: none; }
.btn { min-height: 44px; }
.btn.link { min-height: 44px; }
.tab { min-height: 44px; }
