/* Sign a PDF (r70) — the list, the editor and the signer's page.
 * Tokens and buttons come from so-tokens.css + superoffice.css; this file only
 * lays the three pages out. Type scale 11/13/14/15/18/28; inputs go to 16px on a
 * phone so iOS does not zoom on focus.
 *
 * Recipient colours are data, not accents: muted, told apart by an initials
 * badge as well as the hue, and only ever a tint behind a field. */
:root{
  --rc-0:light-dark(#3f6fa0,#86aedb); --rc-1:light-dark(#2f8f7a,#7fcfb9); --rc-2:light-dark(#b6603f,#e6a184);
  --rc-3:light-dark(#7a5aa6,#bba3e0); --rc-4:light-dark(#6b7f2a,#b9cc7a); --rc-5:light-dark(#b04a6f,#e597b3);
  --rc-6:light-dark(#4f6b7a,#a7bfcc); --rc-7:light-dark(#a8893e,#d4ba7a);
  --page-shadow:0 1px 3px rgba(11,29,50,.10);
}
*{box-sizing:border-box}
html,body{margin:0}
body{font:500 14px/1.5 var(--so-font);min-height:100dvh;display:flex;flex-direction:column}
[hidden]{display:none!important}
button{font:inherit}

/* ---- the app bar: the same one /tools draws (public/tools/tools.css), copied, not
   imported: logo tile + stacked wordmark, a divider, the title; language and at most
   one action on the right. ---- */
.bar{flex:none;display:flex;align-items:center;gap:12px;min-height:64px;padding:0 24px;background:var(--so-bar);color:#fff;position:sticky;top:0;z-index:30}
.lockup{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;flex:none}
.lockup img{width:34px;height:34px;border-radius:8px;box-shadow:0 0 0 2px #3f5a82}
.lockup .word{font:700 15px/1.1 var(--so-font);letter-spacing:2.4px}
.lockup .word small{display:block;margin-top:3px;font-size:11px;letter-spacing:3px;color:var(--so-gold-400)}
.bar .sep{width:1px;height:28px;background:#3f5a82;flex:none}
.bar .ttl{font:600 15px var(--so-font);color:#fff;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar .grow{flex:1 1 auto}
.so-lang{min-height:40px;padding:0 10px;border-radius:var(--so-r-pill);border:1px solid rgba(255,255,255,.38);background:transparent;color:#fff;font:600 13px var(--so-font);cursor:pointer}
.so-lang option{color:var(--so-ink-900);background:var(--so-paper-000)}
.lockup:focus-visible,.so-lang:focus-visible,.bar a:focus-visible,.bar button:focus-visible{outline:2px solid var(--so-gold);outline-offset:2px}
.bar .note{font-size:13px;color:#b7bdc7;white-space:nowrap}
.bar .note.warn{color:var(--so-gold-400)}
@media (max-width:700px){
  .bar{padding:0 16px;gap:8px}
  .lockup .word{display:none}
  .bar .ttl{max-width:24ch}
  .so-lang{font-size:16px}
}

main{flex:1;width:100%}
.wrap{max-width:1100px;margin:0 auto;padding:32px 24px 48px}
h1{font:700 28px/1.2 var(--so-font);margin:0 0 24px;color:var(--so-ink-900)}
h2{font:700 18px/1.3 var(--so-font);margin:0 0 16px}
.muted{color:var(--so-ink-600)}
.small{font-size:13px}
.err{color:var(--so-danger-600);font-weight:600;font-size:14px;margin:0}

/* ---- status chip: a dot and a word ---- */
.chip{display:inline-flex;align-items:center;gap:6px;font:600 13px var(--so-font);color:var(--so-ink-600);white-space:nowrap}
.chip::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--so-stone-300)}
.chip.sent::before,.chip.viewed::before{background:var(--so-gold)}
.chip.completed::before,.chip.signed::before{background:var(--so-success)}
.chip.declined::before,.chip.voided::before,.chip.expired::before{background:var(--so-danger-600)}

/* ---- the list (r72.3): /app's own look — public/app-v3.html is the reference.
   Same width, 28px title, 15px headings and row titles, 13px captions; the documents in
   one paper card of 64px rows with the kind's sketch and a ⋮ menu. Scoped to .sl so
   the editor and the signer's page keep their own type. ---- */
.sl main{background:var(--so-paper-100)}
.sl .wrap{max-width:1120px;padding:32px 24px 64px}
.sl h1{margin:0;font:700 28px/34px var(--so-font);letter-spacing:-.01em;color:var(--so-ink-900)}
.sl-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:24px}
.sl-h{display:flex;align-items:baseline;gap:12px;margin:0 0 12px}
.sl-h h2,.sl .tpls h2{flex:1 1 auto;margin:0;font:600 15px/20px var(--so-font);letter-spacing:0;text-transform:none;color:var(--so-ink-900)}
.sl .cap{font-size:13px;line-height:18px;color:var(--so-ink-500)}
/* the one gold on the page: /app's Blank tile, laid flat */
.drop{display:flex;align-items:center;gap:20px;min-height:120px;padding:20px 24px;
  border:1.5px dashed var(--so-gold-500);border-radius:var(--so-r-lg);background:var(--so-gold-050);cursor:pointer;transition:background-color .14s,border-color .14s}
.drop.over{border-style:solid;border-color:var(--so-gold)}
.drop .dtxt{display:flex;align-items:center;gap:16px;flex-wrap:wrap;min-width:0}
.drop .hint{color:var(--so-ink-600);font-size:13px}
.drop .err{flex-basis:100%}
.drop:focus-within{outline:2px solid var(--so-navy-900);outline-offset:2px}
.drop{flex-wrap:wrap}
.sl-docs{margin-top:40px}
.sl-list{margin:0;padding:0;list-style:none;background:var(--so-paper-000);border:1px solid var(--so-stone-200);border-radius:var(--so-r-lg);box-shadow:var(--so-shadow-card)}
.sl-row{position:relative;display:grid;grid-template-columns:36px minmax(0,1fr) 44px;align-items:center;gap:16px;min-height:64px;padding:8px 12px 8px 20px;border-top:1px solid var(--so-stone-200)}
.sl-list>li:first-child{border-top:0}
.sl-row:last-child{border-radius:0 0 var(--so-r-lg) var(--so-r-lg)}
.sl-row:first-child{border-radius:var(--so-r-lg) var(--so-r-lg) 0 0}
.sl-row:only-child{border-radius:var(--so-r-lg)}
.sl-row:not(.ask):hover{background:var(--so-paper-050);box-shadow:inset 3px 0 0 var(--so-gold)}
.sl-row .ttl{min-width:0}
.sl-row .ttl a{display:block;font:600 15px/20px var(--so-font);color:var(--so-ink-900);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-block:4px;margin-block:-4px}
.sl-row .ttl a::after{content:"";position:absolute;inset:0;border-radius:inherit}
.sl-row .ttl a:focus-visible{outline:none}
.sl-row .ttl a:focus-visible::after{outline:2px solid var(--so-navy-900);outline-offset:-2px}
.sl-row .ttl .cap{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.est{font-weight:600;color:var(--so-ink-600)}
.est.sent{color:var(--so-gold-800)}
.est.completed{color:var(--so-success-600,#1f7a4d)}
.est.declined,.est.voided,.est.expired{color:var(--so-danger-600)}
.sl-more{position:relative;z-index:1;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:var(--so-r-md);background:transparent;color:var(--so-ink-600);cursor:pointer}
.sl-more:hover,.sl-more[aria-expanded="true"]{background:var(--so-btn-hover);color:#fff}
.sl-more:focus-visible{outline:2px solid var(--so-navy-900);outline-offset:0}
.sl-menu{position:absolute;z-index:40;min-width:220px;padding:6px;background:var(--so-paper-000);border:1px solid var(--so-stone-200);border-radius:var(--so-r-md);box-shadow:var(--so-shadow-dialog)}
.sl-menu button,.sl-menu a{display:flex;align-items:center;width:100%;min-height:40px;padding:0 12px;border:0;border-radius:var(--so-r-sm);background:none;color:var(--so-ink-900);font:500 14px var(--so-font);text-align:left;text-decoration:none;cursor:pointer;box-sizing:border-box}
.sl-menu button:hover,.sl-menu a:hover,.sl-menu button:focus-visible,.sl-menu a:focus-visible{background:var(--so-btn-hover);color:#fff;outline:none}
.sl-menu hr{border:0;border-top:1px solid var(--so-stone-200);margin:6px 0}
.sl-menu .bad{color:var(--so-danger-600)}
.sl-menu .bad:hover,.sl-menu .bad:focus-visible{background:var(--so-danger);color:#fff}
/* the inline "Delete? Yes / Cancel" — the row itself, tinted, never a browser confirm() */
.sl-row.ask{grid-template-columns:minmax(0,1fr) auto;background:var(--so-paper-050);box-shadow:inset 3px 0 0 var(--so-danger-600)}
.sl-row.ask .ttl b{display:block;font:600 15px/20px var(--so-font);color:var(--so-ink-900);overflow-wrap:anywhere}
.sl-row.ask .ttl .cap{white-space:normal;margin-top:2px}
.sl-row.ask .acts{display:flex;gap:8px}
.sl-note{padding:12px 20px;font-size:13px;color:var(--so-ink-600);border-bottom:1px solid var(--so-stone-200)}
.sl-note+.sl-row{border-top:0}
.sl-empty{padding:40px 24px;text-align:center;border:1.5px dashed var(--so-stone-300);border-radius:var(--so-r-lg);color:var(--so-ink-600);font-size:13px}
.sl-empty b{display:block;margin-bottom:4px;font-size:15px;color:var(--so-ink-900)}
#listErr{margin:0 0 12px}
/* the kind's sketch, as on /app: paper, so white in both themes */
.sl .pg{position:relative;flex:none;display:flex;flex-direction:column;overflow:hidden;width:28px;height:36px;padding:5px 4px 0;gap:3px;background:#fff;border:1px solid var(--so-stone-300);border-radius:3px;box-sizing:border-box}
.sl .pg i{display:block;height:2px;border-radius:1px;background:#e3ddd0;flex:none}
.sl .pg i.s{width:60%}.sl .pg i.m{width:80%}
.sl .pg i.h{height:3px;width:55%;background:#0b1d32}
.sl .pg .ink{position:absolute;left:14%;right:18%;bottom:14%;height:22%;width:auto}
.sl .pg .line{position:absolute;left:12%;right:12%;bottom:14%;height:1px;width:auto;background:#c5a55a}
.drop .pg{width:56px;height:72px;padding:10px 8px 0;gap:5px;box-shadow:var(--so-shadow-card)}
.drop .pg i{height:3px}.drop .pg i.h{height:5px}
@media (max-width:640px){
  .sl .wrap{padding:24px 16px 48px}
  .sl h1{font-size:24px;line-height:30px}
  .sl-head{margin-bottom:16px}
  .drop{gap:16px;min-height:0;padding:16px}
  .drop .pg{width:44px;height:56px}
  .drop .dtxt{flex:1 1 0;gap:8px}
  .sl-docs{margin-top:32px}
  .sl-row{gap:12px;padding:10px 4px 10px 12px}
  .sl-row .ttl a,.sl-row .ttl .cap{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .sl-row.ask{grid-template-columns:minmax(0,1fr);padding:14px 12px}
  .sl-row.ask .acts .btn{min-height:44px;flex:1 1 0}
}

/* ---- the editor: three columns ---- */
.ed{flex:1;display:grid;grid-template-columns:300px minmax(0,1fr) 264px;min-height:0}
.side{background:var(--so-paper-050);border-right:1px solid var(--so-stone-200);padding:24px 20px;overflow:auto;max-height:calc(100dvh - 64px);position:sticky;top:64px}
.side.right{border-right:0;border-left:1px solid var(--so-stone-200)}
.side h2{font:700 11px/16px var(--so-font);letter-spacing:.12em;text-transform:uppercase;color:var(--so-gold-800);margin:0 0 12px}
.side section+section{margin-top:24px}
.canvas{padding:32px 24px 64px;background:var(--so-paper-100);overflow:auto}
.pages{max-width:860px;margin:0 auto;display:flex;flex-direction:column;gap:24px}
.page{position:relative;background:#fff;box-shadow:var(--page-shadow);width:100%;user-select:none;touch-action:pan-y}
.page canvas{display:block;width:100%;height:100%;position:absolute;inset:0}
.page .pno{position:absolute;right:0;bottom:-20px;font-size:11px;color:var(--so-ink-500)}

.rcp{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:10px;border:1px solid var(--so-stone-200);border-radius:var(--so-r-md);background:var(--so-paper-000);cursor:pointer}
.rcp+.rcp{margin-top:8px}
.rcp.on{border-color:var(--so-gold);box-shadow:0 0 0 1px var(--so-gold)}
.rcp .fill{grid-column:1/-1;display:grid;gap:8px}
.rcp .row select{flex:1;min-width:0}
/* r71: the role reads in full ("Gets a copy"); the step is a short word and a number */
.rcp .row select[name=step]{flex:0 0 84px;padding-right:4px}
.rcp input,.rcp select,.props input,.props select,.props textarea,.dlg input,.dlg select,.dlg textarea{width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--so-stone-300);border-radius:var(--so-r-md);background:var(--so-paper-000);color:var(--so-ink-900);font:500 14px var(--so-font)}
.rcp input:focus,.rcp select:focus,.props input:focus,.props select:focus,.props textarea:focus,.dlg input:focus,.dlg select:focus,.dlg textarea:focus{outline:2px solid var(--so-navy-900);outline-offset:0}
.badge{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font:700 11px var(--so-font);color:#fff;background:var(--c)}
.rcp .step{font:600 13px var(--so-font);color:var(--so-ink-600)}
.rcp .grip{cursor:grab;color:var(--so-ink-500);font-size:15px;padding:0 4px;line-height:1}
.x{border:0;background:transparent;color:var(--so-ink-500);width:32px;height:32px;border-radius:var(--so-r-md);cursor:pointer;font-size:18px;line-height:1}
.x:hover{background:var(--so-navy);color:#fff}
.x:focus-visible{outline:2px solid var(--so-navy-900)}
.row{display:flex;align-items:center;gap:8px}
.switch{display:flex;align-items:center;justify-content:space-between;gap:12px;font-weight:600;min-height:44px}
.switch input{width:20px;height:20px}
.add{margin-top:12px;width:100%}

.pal{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.pal button{display:flex;align-items:center;gap:8px;min-height:36px;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;border:1px solid var(--so-stone-300);border-radius:var(--so-r-md);background:var(--so-paper-000);color:var(--so-ink-900);font:600 13px var(--so-font);cursor:grab;text-align:left;touch-action:none}
.pal button::before{content:"";width:10px;height:10px;border-radius:2px;background:var(--c);flex:none}
.pal button:hover{background:var(--so-navy);color:#fff;border-color:var(--so-gold)}
.pal button:focus-visible{outline:2px solid var(--so-navy-900);outline-offset:2px}
.pal[aria-disabled="true"] button{opacity:.45;cursor:not-allowed}

/* a field on the page */
.fld{position:absolute;border:1.5px solid var(--c);background:color-mix(in srgb,var(--c) 16%,transparent);border-radius:3px;
  display:flex;align-items:center;gap:4px;padding:0 4px;font:600 11px/1 var(--so-font);color:var(--so-ink-900);overflow:hidden;cursor:move;touch-action:none}
.fld .tag{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#1c2733}
.fld .ini{flex:none;font:700 9px/1 var(--so-font);color:#fff;background:var(--c);border-radius:6px;padding:2px 4px}
.fld.tiny .tag{display:none}
.fld.sel{outline:2px solid var(--so-navy-900);outline-offset:1px;overflow:visible;z-index:2}
.fld.none{--c:var(--so-ink-500);border-style:dashed}
.fld img{max-width:100%;max-height:100%;object-fit:contain}
.h{position:absolute;width:12px;height:12px;background:#fff;border:2px solid var(--so-navy);border-radius:2px}
.h.nw{left:-7px;top:-7px;cursor:nwse-resize}.h.se{right:-7px;bottom:-7px;cursor:nwse-resize}
.h.ne{right:-7px;top:-7px;cursor:nesw-resize}.h.sw{left:-7px;bottom:-7px;cursor:nesw-resize}
.snap{position:absolute;z-index:3;pointer-events:none;background:var(--so-gold-600)}
/* r72: sv/sh, not v/h — `.h` is the resize handle (12px, navy border), and sharing it made
   every horizontal guide a 12px navy blob in r71: "guides only snap left". */
.snap.sv{width:2px;transform:translateX(-1px)}
.snap.sh{height:2px;transform:translateY(-1px)}
/* the page's own centre line reads as a different kind of guide */
.snap.mid{background:transparent}
.snap.sv.mid{border-left:2px dashed var(--so-gold-600)}
.snap.sh.mid{border-top:2px dashed var(--so-gold-600)}
.props .seg{display:flex;gap:6px}
.props .seg .btn{flex:1;padding:0 8px}
.nofill{margin:0;padding:12px;border:1px dashed var(--so-stone-300);border-radius:var(--so-r-md)}
.undo{margin:0 0 12px;font-size:13px;color:var(--so-ink-600)}
.undo .more{padding:0 4px}
.rcp.self{grid-template-columns:auto 1fr}
/* a button waiting on the server */
.spin{width:14px;height:14px;flex:none;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:so-spin .7s linear infinite}
@keyframes so-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:2s}}
.ghost{position:fixed;z-index:50;pointer-events:none;border:1.5px dashed var(--c);background:color-mix(in srgb,var(--c) 20%,transparent);border-radius:3px}

.props .fieldset{display:grid;gap:16px}
.props label.lab{display:grid;gap:6px;font-weight:600;font-size:13px}
.props .tick{display:flex;align-items:center;gap:10px;font-weight:600;min-height:40px;cursor:pointer}
.props .tick input{width:18px;height:18px;min-height:0}
.props textarea{min-height:96px;resize:vertical}
.props .acts{display:flex;gap:8px;margin-top:8px}
.tip{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;border:1px solid var(--so-stone-300);font:700 11px var(--so-font);color:var(--so-ink-600);cursor:help;margin-left:4px}

.status-line{font-size:13px;color:var(--so-ink-600);white-space:nowrap}
.bar .status-line{color:#b7bdc7}
.alert{margin:0 auto;max-width:860px;padding:12px 16px;border:1px solid var(--so-danger-600);border-radius:var(--so-r-md);background:var(--so-paper-000);color:var(--so-danger-600);font-weight:600;margin-bottom:24px}

/* the envelope once sent */
.trail{list-style:none;margin:0;padding:0}
.trail li{padding:10px 0;border-bottom:1px solid var(--so-stone-200);font-size:13px}
.trail li:last-child{border-bottom:0}
.trail b{font-weight:600;color:var(--so-ink-900)}
.trail time{display:block;color:var(--so-ink-600);font-size:11px}
.rs{padding:12px 0;border-bottom:1px solid var(--so-stone-200);display:grid;grid-template-columns:auto 1fr;gap:4px 10px;align-items:center}
.rs:last-child{border-bottom:0}
.rs .nm{font-weight:600;overflow-wrap:anywhere}
.rs .sub{grid-column:2;font-size:13px;color:var(--so-ink-600);overflow-wrap:anywhere}
.rs .acts{grid-column:2;display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}

/* phone: the editor is a status page */
.phone-only{display:none}
@media (max-width:900px){
  .ed{grid-template-columns:1fr}
  .ed .side.left,.ed .canvas,.ed .side.right{display:none}
  .phone-only{display:block}
}

/* ---- dialogs ---- */
.dlg{border:0;border-radius:var(--so-r-lg);padding:0;width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);background:var(--so-paper-000);color:var(--so-ink-900);box-shadow:var(--so-shadow-dialog)}
.dlg::backdrop{background:rgba(11,29,50,.45)}
.dlg form,.dlg .in{padding:24px;display:grid;gap:16px}
.dlg h2{margin:0}
.dlg label{display:grid;gap:6px;font-weight:600;font-size:13px}
.dlg .two{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.dlg textarea{min-height:88px;resize:vertical}
.dlg .foot{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.links{display:grid;gap:8px}
.links .ln{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--so-stone-200);border-radius:var(--so-r-md)}
.links .ln .who{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.links .ln .who b{font-weight:600}
.links .ln .who small{font-size:13px;color:var(--so-ink-600)}
.links .ln .badge{flex:none;width:32px;height:32px}
.links .ln .btn{flex:none}

/* ---- the signer's page ---- */
.sg-card{max-width:520px;margin:48px auto;padding:32px;background:var(--so-paper-000);border:1px solid var(--so-stone-200);border-radius:var(--so-r-lg)}
.sg-card h1{font-size:18px;margin:0 0 8px}
.sg-card .doc{font-size:15px;font-weight:600;margin:0 0 24px;overflow-wrap:anywhere}
.sg-card .msg{margin:0 0 24px;padding-left:12px;border-left:2px solid var(--so-stone-300);color:var(--so-ink-600);white-space:pre-wrap}
.sg-card .agree{display:flex;gap:12px;align-items:flex-start;font-weight:600;margin-bottom:24px;cursor:pointer}
.sg-card .agree input{width:20px;height:20px;margin-top:1px;flex:none}
.sg-card .btn{width:100%}
.guide{position:sticky;top:64px;z-index:20;height:56px;display:flex;align-items:center;gap:16px;padding:0 24px;background:var(--so-paper-000);border-bottom:1px solid var(--so-stone-200)}
.guide .left{flex:1;font-weight:600}
.sgdoc{padding:24px 24px 120px 88px;background:var(--so-paper-100)}
.sgdoc .pages{max-width:860px}
.sf{position:absolute;border:1.5px solid var(--so-gold-500);background:var(--so-gold-050);border-radius:3px;display:flex;align-items:center;justify-content:center;overflow:visible}
.sf[data-type=date_signed]{justify-content:flex-start}
.sf.req{box-shadow:inset 3px 0 0 var(--so-gold-600)}
.sf.cur{outline:2px solid var(--so-navy-900);outline-offset:2px;z-index:3}
.sf.done{background:transparent;border-color:color-mix(in srgb,var(--so-gold-500) 55%,transparent);box-shadow:none}
.sf input[type=text],.sf select{width:100%;height:100%;border:0;background:transparent;font:500 12px var(--so-font);color:#1c2733;padding:0 4px;min-height:0}
.sf select{cursor:pointer}
.sf input[type=checkbox]{width:80%;height:80%;margin:0;min-height:0}
.sf input:focus,.sf select:focus{outline:none}
.sf .signbtn{width:100%;height:100%;border:0;background:transparent;font:700 12px var(--so-font);color:#1c2733;cursor:pointer}
.sf img{max-width:100%;max-height:100%;object-fit:contain;pointer-events:none}
.sf .auto{font:500 11px var(--so-font);color:#1c2733;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px}
.flag{position:absolute;left:-76px;height:28px;width:64px;display:flex;align-items:center;justify-content:center;background:var(--so-gold);color:#0b1d32;font:700 13px var(--so-font);
  clip-path:polygon(0 0,82% 0,100% 50%,82% 100%,0 100%);transition:top .25s var(--so-ease);z-index:4;pointer-events:none}
.menu{position:relative}
.menu .pop{position:absolute;right:0;top:44px;min-width:220px;background:var(--so-paper-000);border:1px solid var(--so-stone-200);border-radius:var(--so-r-md);box-shadow:var(--so-shadow-dialog);padding:6px;display:grid;z-index:40}
.menu .pop button,.menu .pop a{display:flex;align-items:center;min-height:44px;padding:0 12px;border:0;background:transparent;color:var(--so-ink-900);font:600 14px var(--so-font);text-align:left;border-radius:6px;cursor:pointer;text-decoration:none}
.menu .pop button:hover,.menu .pop a:hover{background:var(--so-navy);color:#fff}
.bar .optbtn{height:40px;border-radius:var(--so-r-pill);padding:0 14px;border:1px solid rgba(255,255,255,.38);border-radius:var(--so-r-md);background:transparent;color:#fff;font:600 13px var(--so-font);cursor:pointer}
.bar .optbtn:hover{background:#24406a;border-color:var(--so-gold)}
.sheet{display:none}

/* the signer's Options menu also carries the language on a phone */
.menu .langrow{display:none;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:0 12px;font:600 14px var(--so-font);border-top:1px solid var(--so-stone-200);margin-top:4px}
.menu .langrow .so-lang{border-color:var(--so-stone-300);color:var(--so-ink-900)}
.menu.langonly{display:none}
.sg-card .quiet{margin:24px 0 0;font-size:13px;color:var(--so-ink-600)}
.sg-card .quiet a{color:var(--so-ink-600)}
.back{display:inline-block;font:600 13px var(--so-font);color:var(--so-navy-900);text-decoration:none;margin-bottom:16px}
.back:hover{text-decoration:underline}
.btn[aria-disabled="true"],.btn[aria-disabled="true"]:hover{background:var(--so-stone-300);border-color:var(--so-stone-300);color:var(--so-ink-500);transform:none;box-shadow:none}
.btn[aria-disabled="true"]::before{display:none}
.more{border:0;background:transparent;padding:8px 0;font:600 13px var(--so-font);color:var(--so-navy-900);cursor:pointer;text-decoration:underline}
.thumb{display:block;width:160px;border:1px solid var(--so-stone-200);border-radius:6px;background:#fff;margin:16px 0 8px}

@media (max-width:600px){
  .sgpage .bar #lang{display:none}
  .menu .langrow{display:flex}
  .menu.langonly{display:block}
  .wrap{padding:24px 16px 40px}
  h1{font-size:18px;margin-bottom:16px}
  .sg-card{margin:16px;padding:24px 20px}
  .guide{display:none}
  .sgdoc{padding:12px 8px 220px}
  .flag{display:none}
  .sheet{display:grid;gap:12px;position:fixed;left:0;right:0;bottom:0;z-index:30;padding:16px 16px calc(16px + env(safe-area-inset-bottom));
    background:var(--so-paper-000);border-radius:var(--so-r-xl) var(--so-r-xl) 0 0;box-shadow:var(--so-shadow-sheet)}
  .sheet .top{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
  .sheet .lbl{font:700 15px var(--so-font)}
  .sheet .cnt{font-size:13px;color:var(--so-ink-600);white-space:nowrap}
  .sheet input[type=text],.sheet select{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--so-stone-300);border-radius:var(--so-r-md);font:500 16px var(--so-font);background:var(--so-paper-000);color:var(--so-ink-900)}
  .sheet .chk{display:flex;align-items:center;gap:12px;min-height:44px;font-weight:600}
  .sheet .chk input{width:22px;height:22px}
  .sheet .prev{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:8px 12px;border:1px solid var(--so-stone-200);border-radius:var(--so-r-md)}
  .sheet .prev img{max-height:44px;max-width:70%}
  .sheet .btn{width:100%}
  .dlg input,.dlg select,.dlg textarea{font-size:16px}
  .dlg .two{grid-template-columns:1fr}
}

/* ---- r71, the recipient side after the act: busy, done, read ---- */
/* Finish / Approve while the server works (the last one seals the PDF) */
.sgspin{display:inline-block;width:14px;height:14px;margin-right:8px;vertical-align:-2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:sgspin .7s linear infinite}
@keyframes sgspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.sgspin{animation-duration:2s}}
body.busy #doc,body.busy #shCtl,body.busy #left{opacity:.5;pointer-events:none;transition:opacity .2s}
.btn[aria-busy="true"]{cursor:progress}

/* the done card: outcome, the first page, one true line about what happens next */
.sg-done .hd{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.sg-done .hd h1{margin:0;font-size:22px}
.sg-done .disc{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--so-stone-200);color:var(--so-ink-900)}
.sg-done .disc.ok{background:var(--so-success);color:#fff}
.sg-done .row{display:flex;gap:20px;align-items:flex-start;margin-bottom:24px}
.sg-done .pg{flex:none;width:112px;border:1px solid var(--so-stone-200);border-radius:4px;background:#fff}
.sg-done .doc{margin:0 0 12px}
.sg-done .next{margin:0 0 8px;font-weight:600;color:var(--so-success-600)}
.sg-done .muted{margin:0}
.sg-done .links{display:flex;flex-wrap:wrap;gap:8px 12px;justify-content:center;margin:16px 0 0;font-size:14px}
.sg-done .links a{color:var(--so-navy-900);font-weight:600}
.sg-done .links span{color:var(--so-ink-500)}

/* the reading bar: where the envelope is, and Certificate + Download (or Decline + Approve) */
.vbar{position:sticky;top:64px;z-index:20;min-height:56px;display:flex;align-items:center;gap:16px;padding:8px 24px;background:var(--so-paper-000);border-bottom:1px solid var(--so-stone-200)}
.vbar .vstat{flex:1;min-width:0;font-weight:600}
.vbar .vstat .ok{display:inline-flex;align-items:center;gap:8px;color:var(--so-success-600)}
.vbar .vstat svg{flex:none}
.vbar .vact{display:flex;align-items:center;gap:16px;flex:none}
.vbar .vact a:not(.btn){color:var(--so-navy-900);font:600 14px var(--so-font)}
.vbar .vact .btn{min-height:40px;padding:0 16px}
.sgdoc.read{padding-left:24px}
.ff{position:absolute;display:flex;align-items:center;padding:0 4px;font:500 11px var(--so-font);color:#1c2733;overflow:hidden;white-space:nowrap;pointer-events:none}
.ff img{max-width:100%;max-height:100%;object-fit:contain}
.ff svg{width:100%;height:100%;color:#0b1d32}

@media (max-width:600px){
  .sg-done .row{gap:16px}
  .sg-done .pg{width:88px}
  .vbar{padding:10px 16px;gap:12px;flex-wrap:wrap}
  .vbar .vstat{flex-basis:100%;font-size:13px}
  .vbar .vact{flex:1;justify-content:flex-end}
  /* an approver's two buttons sit under the thumb */
  body.apv .vbar{position:fixed;top:auto;bottom:0;left:0;right:0;z-index:30;padding:12px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--so-stone-200);border-bottom:0;box-shadow:var(--so-shadow-sheet)}
  body.apv .vbar .vact{flex:1}
  body.apv .vbar .vact .btn{flex:1;min-height:44px}
  body.apv .sgdoc{padding-bottom:160px}
  .sgdoc.read{padding-left:8px}
}

/* ---- r72, the sender: templates, bulk send, the attachment field ---- */
.tplnote{margin:0 0 12px;padding:10px 12px;border-left:2px solid var(--so-gold);background:var(--so-paper-000);font-size:13px;color:var(--so-ink-900)}
.bar .menu .pop{right:0}
.dlg .bulkcsv{flex-wrap:wrap;gap:12px}
.dlg .filebtn{position:relative;display:inline-flex;align-items:center;cursor:pointer;min-height:40px}
.dlg .filebtn input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;min-height:0;padding:0}
.dlg .filebtn:focus-within{outline:2px solid var(--so-navy-900);outline-offset:2px}
.bulkres{list-style:none;margin:0;padding:0;max-height:min(50dvh,420px);overflow:auto;border:1px solid var(--so-stone-200);border-radius:var(--so-r-md)}
.bulkres li{display:grid;grid-template-columns:auto 1fr;gap:2px 12px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--so-stone-200)}
.bulkres li:last-child{border-bottom:0}
.bulkres .chip{grid-row:span 2;min-width:76px}
.bulkres b{font-weight:600;overflow-wrap:anywhere}
.bulkres b a{color:var(--so-ink-900)}
.bulkres small{font-size:13px;color:var(--so-ink-600);overflow-wrap:anywhere}
/* the list page's templates */
.tpls{margin-top:32px}
.tpls h2{font:700 11px/16px var(--so-font);letter-spacing:.12em;text-transform:uppercase;color:var(--so-gold-800);margin:0 0 12px}
.sl .tpls{margin-top:40px}
.tplrows{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr));gap:12px}
.tpl{display:grid;grid-template-columns:1fr auto auto;gap:4px 8px;align-items:center;padding:12px 12px 12px 16px;border:1px solid var(--so-stone-200);border-radius:var(--so-r-md);background:var(--so-paper-000);min-width:0}
.tpl .nm{font-weight:600;color:var(--so-ink-900);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tpl .meta{grid-column:1;font-size:13px;color:var(--so-ink-600);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tpl .btn{grid-row:1/span 2;grid-column:2;min-height:40px}
.tpl .x{grid-row:1/span 2;grid-column:3;width:40px;height:40px}
/* the signer's upload box */
.sf[data-type=attachment]{justify-content:flex-start}
.sf .attbtn{display:flex;align-items:center;gap:6px;width:100%;height:100%;border:0;background:transparent;font:700 12px var(--so-font);color:#1c2733;cursor:pointer;padding:0 6px;min-width:0}
.sf .attbtn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sf .attbtn svg{flex:none}
.sf .attbtn:focus-visible{outline:2px solid var(--so-navy-900);outline-offset:2px}
.sheet .att{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:8px 12px;border:1px solid var(--so-stone-200);border-radius:var(--so-r-md)}
.sheet .att .nm{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheet .att .btn{width:auto;min-height:44px}
.sheet .atthint{margin:0;font-size:13px;color:var(--so-ink-600)}
/* the audit trail's Check it online sits in the button stack, no extra gap */
.trail ~ p.row a[data-verify]{margin-top:0;min-height:var(--so-btn-sm-h,36px)}
@media (max-width:600px){ .tpl .btn,.tpl .x{min-height:44px;height:44px} .tpl .x{width:44px} }

/* ---- r72, the signer's polish (Amit, 9 Nov) ---- */
/* the centred loader: the document area while the PDF loads, and over it while Finish/Approve work */
.sgload{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:40;display:flex;align-items:center;gap:12px;max-width:calc(100vw - 32px);padding:14px 20px;background:var(--so-paper-000);border:1px solid var(--so-stone-200);border-radius:var(--so-r-lg);box-shadow:0 8px 24px rgba(11,29,50,.16);font:600 15px var(--so-font);color:var(--so-ink-900)}
.sgload .sgspin{width:22px;height:22px;margin:0;border-width:3px;color:var(--so-gold-500,#c5a55a)}
body.busy .sgload{box-shadow:0 0 0 100vmax rgba(11,29,50,.12),0 8px 24px rgba(11,29,50,.16)}
/* the done card: three actions, all buttons — View (primary), then Download + Certificate (secondary) */
.sg-done .acts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.sg-done .acts .btn{width:100%;min-height:44px;padding:0 12px;text-align:center;line-height:1.2;white-space:normal}
/* the sign-off: the SuperOffice lockup, not an underlined line */
.sglock{display:flex;align-items:center;justify-content:center;gap:8px;width:max-content;margin:24px auto 0;min-height:44px;padding:0 12px;border-radius:var(--so-r-md);text-decoration:none;color:var(--so-navy-900)}
.sg-card .sglock{margin-bottom:-8px}
.sglock img{width:22px;height:22px;border-radius:5px}
.sglock span{font:700 12px/1 var(--so-font);letter-spacing:2px;color:var(--so-ink-900)}
.sglock b{font-weight:700;color:var(--so-gold-800);margin-left:3px}
.sglock:hover{background:var(--so-paper-050)}
.sglock:focus-visible{outline:2px solid var(--so-navy-900);outline-offset:2px}
/* the editor's audit trail (markup in edit.js): its toggle and its actions read as buttons */
.trail + .more{display:inline-flex;align-items:center;gap:6px;min-height:36px;margin-top:8px;padding:0 12px;border:1px solid var(--so-btn-sec-edge,var(--so-stone-300));border-radius:var(--so-r-md);background:var(--so-btn-sec,var(--so-paper-000));font:600 13px var(--so-font);color:var(--so-navy-900);text-decoration:none}
.trail + .more::after{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg) translateY(-2px)}
.trail + .more:hover{border-color:var(--so-gold-500,#c5a55a)}
.trail + .more:focus-visible{outline:2px solid var(--so-navy-900);outline-offset:2px}
.trail ~ p a[href^="/verify/"]{display:flex;width:100%;align-items:center;min-height:32px;margin-top:6px;padding:0 12px;border:1px solid var(--so-btn-sec-edge,var(--so-stone-300));border-radius:var(--so-r-md);background:var(--so-btn-sec,var(--so-paper-000));font:600 13px var(--so-font);color:var(--so-navy-900);text-decoration:none;white-space:nowrap}
.trail ~ p a[href^="/verify/"]:hover{border-color:var(--so-gold-500,#c5a55a)}
.trail ~ p.row{display:flex;flex-direction:column;align-items:stretch;gap:8px}
.trail ~ p.row .btn{justify-content:flex-start}
@media (max-width:600px){
  .sg-done .acts{grid-template-columns:1fr}
  .trail + .more,.trail ~ p a[href^="/verify/"],.trail ~ p.row .btn{min-height:44px}
}
